Editor: update npm packages with first round of bug fixes for 6.3 RC1.

Includes miscellaneous bug fixes for 6.3 RC1.

Props ramonopoly.
See #58804.

Built from https://develop.svn.wordpress.org/trunk@56229


git-svn-id: http://core.svn.wordpress.org/trunk@55741 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
isabel_brison 2023-07-14 04:33:18 +00:00
parent 61c7af563a
commit f29e4144fa
27 changed files with 942 additions and 752 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,8 @@
"name": "core/block", "name": "core/block",
"title": "Pattern", "title": "Pattern",
"category": "reusable", "category": "reusable",
"description": "Create and save content to reuse across your site. Update the block, and the changes apply everywhere its used.", "description": "Create and save content to reuse across your site. Update the pattern, and the changes apply everywhere its used.",
"keywords": [ "reusable" ],
"textdomain": "default", "textdomain": "default",
"attributes": { "attributes": {
"ref": { "ref": {

View File

@ -181,7 +181,10 @@
'name' => 'core/block', 'name' => 'core/block',
'title' => 'Pattern', 'title' => 'Pattern',
'category' => 'reusable', 'category' => 'reusable',
'description' => 'Create and save content to reuse across your site. Update the block, and the changes apply everywhere its used.', 'description' => 'Create and save content to reuse across your site. Update the pattern, and the changes apply everywhere its used.',
'keywords' => array(
'reusable'
),
'textdomain' => 'default', 'textdomain' => 'default',
'attributes' => array( 'attributes' => array(
'ref' => array( 'ref' => array(

View File

@ -1728,7 +1728,12 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed{
content:attr(aria-label); content:attr(aria-label);
} }
.block-editor-link-control__search-input-container,.block-editor-link-control__search-input-wrapper{ .block-editor-link-control__search-input-wrapper{
margin-bottom:8px;
position:relative;
}
.block-editor-link-control__search-input-container{
position:relative; position:relative;
} }
@ -1795,68 +1800,39 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed{
padding:8px; padding:8px;
} }
.block-editor-link-control__search-results-wrapper{
position:relative;
}
.block-editor-link-control__search-results-wrapper:after,.block-editor-link-control__search-results-wrapper:before{
content:"";
display:block;
left:16px;
pointer-events:none;
position:absolute;
right:-1px;
z-index:100;
}
.block-editor-link-control__search-results-wrapper:before{
bottom:auto;
height:8px;
top:0;
}
.block-editor-link-control__search-results-wrapper:after{
bottom:0;
height:16px;
top:auto;
}
.block-editor-link-control__search-results{ .block-editor-link-control__search-results{
margin:0; margin-top:-16px;
max-height:200px; max-height:200px;
overflow-y:auto; overflow-y:auto;
padding:8px 16px; padding:8px;
} }
.block-editor-link-control__search-results.is-loading{ .block-editor-link-control__search-results.is-loading{
opacity:.2; opacity:.2;
} }
.block-editor-link-control__search-item{ .block-editor-link-control__search-item.components-button.components-menu-item__button{
align-items:flex-start;
background:#fff;
border:none;
border-radius:2px;
cursor:pointer;
display:flex;
font-size:13px;
height:auto; height:auto;
padding:12px 16px;
position:relative;
text-align:right; text-align:right;
}
.block-editor-link-control__search-item .components-menu-item__item{
display:inline-block;
overflow:hidden;
text-overflow:ellipsis;
width:100%; width:100%;
} }
.block-editor-link-control__search-item:focus,.block-editor-link-control__search-item:hover{ .block-editor-link-control__search-item .components-menu-item__item mark{
background-color:#f0f0f0; background-color:initial;
color:inherit;
font-weight:600;
} }
.block-editor-link-control__search-item:focus .block-editor-link-control__search-item-type,.block-editor-link-control__search-item:hover .block-editor-link-control__search-item-type{ .block-editor-link-control__search-item .components-menu-item__shortcut{
background:#fff; color:#757575;
text-transform:capitalize;
white-space:nowrap;
} }
.block-editor-link-control__search-item:focus:not(:disabled){ .block-editor-link-control__search-item[aria-selected]{
box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color) inset;
}
.block-editor-link-control__search-item.is-selected{
background:#f0f0f0; background:#f0f0f0;
} }
.block-editor-link-control__search-item.is-selected .block-editor-link-control__search-item-type{
background:#fff;
}
.block-editor-link-control__search-item.is-current{ .block-editor-link-control__search-item.is-current{
background:transparent; background:transparent;
border:0; border:0;
@ -1890,7 +1866,6 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed{
margin-left:8px; margin-left:8px;
max-height:24px; max-height:24px;
position:relative; position:relative;
top:.2em;
width:24px; width:24px;
} }
.block-editor-link-control__search-item .block-editor-link-control__search-item-icon img{ .block-editor-link-control__search-item .block-editor-link-control__search-item-icon img{
@ -1901,15 +1876,6 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed{
top:0; top:0;
width:32px; width:32px;
} }
.block-editor-link-control__search-item .block-editor-link-control__search-item-info,.block-editor-link-control__search-item .block-editor-link-control__search-item-title{
overflow:hidden;
text-overflow:ellipsis;
}
.block-editor-link-control__search-item .block-editor-link-control__search-item-info .components-external-link__icon,.block-editor-link-control__search-item .block-editor-link-control__search-item-title .components-external-link__icon{
left:0;
margin-top:0;
position:absolute;
}
.block-editor-link-control__search-item .block-editor-link-control__search-item-title{ .block-editor-link-control__search-item .block-editor-link-control__search-item-title{
display:block; display:block;
font-weight:500; font-weight:500;
@ -1919,7 +1885,7 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed{
.block-editor-link-control__search-item .block-editor-link-control__search-item-title mark{ .block-editor-link-control__search-item .block-editor-link-control__search-item-title mark{
background-color:initial; background-color:initial;
color:inherit; color:inherit;
font-weight:700; font-weight:600;
} }
.block-editor-link-control__search-item .block-editor-link-control__search-item-title span{ .block-editor-link-control__search-item .block-editor-link-control__search-item-title span{
font-weight:400; font-weight:400;
@ -1927,25 +1893,6 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed{
.block-editor-link-control__search-item .block-editor-link-control__search-item-title svg{ .block-editor-link-control__search-item .block-editor-link-control__search-item-title svg{
display:none; display:none;
} }
.block-editor-link-control__search-item .block-editor-link-control__search-item-info{
color:#757575;
display:block;
font-size:.9em;
line-height:1.3;
}
.block-editor-link-control__search-item .block-editor-link-control__search-item-error-notice{
font-size:1.1em;
font-style:italic;
}
.block-editor-link-control__search-item .block-editor-link-control__search-item-type{
background-color:#f0f0f0;
border-radius:2px;
display:block;
font-size:.9em;
margin-right:auto;
padding:3px 6px;
white-space:nowrap;
}
.block-editor-link-control__search-item .block-editor-link-control__search-item-description{ .block-editor-link-control__search-item .block-editor-link-control__search-item-description{
margin:0; margin:0;
padding-top:12px; padding-top:12px;
@ -2054,10 +2001,6 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed{
top:0; top:0;
} }
.block-editor-link-control__search-results div[role=menu]>.block-editor-link-control__search-item.block-editor-link-control__search-item{
padding:10px;
}
.block-editor-link-control__drawer{ .block-editor-link-control__drawer{
display:flex; display:flex;
flex-basis:100%; flex-basis:100%;

File diff suppressed because one or more lines are too long

View File

@ -1728,7 +1728,12 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed{
content:attr(aria-label); content:attr(aria-label);
} }
.block-editor-link-control__search-input-container,.block-editor-link-control__search-input-wrapper{ .block-editor-link-control__search-input-wrapper{
margin-bottom:8px;
position:relative;
}
.block-editor-link-control__search-input-container{
position:relative; position:relative;
} }
@ -1795,68 +1800,39 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed{
padding:8px; padding:8px;
} }
.block-editor-link-control__search-results-wrapper{
position:relative;
}
.block-editor-link-control__search-results-wrapper:after,.block-editor-link-control__search-results-wrapper:before{
content:"";
display:block;
left:-1px;
pointer-events:none;
position:absolute;
right:16px;
z-index:100;
}
.block-editor-link-control__search-results-wrapper:before{
bottom:auto;
height:8px;
top:0;
}
.block-editor-link-control__search-results-wrapper:after{
bottom:0;
height:16px;
top:auto;
}
.block-editor-link-control__search-results{ .block-editor-link-control__search-results{
margin:0; margin-top:-16px;
max-height:200px; max-height:200px;
overflow-y:auto; overflow-y:auto;
padding:8px 16px; padding:8px;
} }
.block-editor-link-control__search-results.is-loading{ .block-editor-link-control__search-results.is-loading{
opacity:.2; opacity:.2;
} }
.block-editor-link-control__search-item{ .block-editor-link-control__search-item.components-button.components-menu-item__button{
align-items:flex-start;
background:#fff;
border:none;
border-radius:2px;
cursor:pointer;
display:flex;
font-size:13px;
height:auto; height:auto;
padding:12px 16px;
position:relative;
text-align:left; text-align:left;
}
.block-editor-link-control__search-item .components-menu-item__item{
display:inline-block;
overflow:hidden;
text-overflow:ellipsis;
width:100%; width:100%;
} }
.block-editor-link-control__search-item:focus,.block-editor-link-control__search-item:hover{ .block-editor-link-control__search-item .components-menu-item__item mark{
background-color:#f0f0f0; background-color:initial;
color:inherit;
font-weight:600;
} }
.block-editor-link-control__search-item:focus .block-editor-link-control__search-item-type,.block-editor-link-control__search-item:hover .block-editor-link-control__search-item-type{ .block-editor-link-control__search-item .components-menu-item__shortcut{
background:#fff; color:#757575;
text-transform:capitalize;
white-space:nowrap;
} }
.block-editor-link-control__search-item:focus:not(:disabled){ .block-editor-link-control__search-item[aria-selected]{
box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color) inset;
}
.block-editor-link-control__search-item.is-selected{
background:#f0f0f0; background:#f0f0f0;
} }
.block-editor-link-control__search-item.is-selected .block-editor-link-control__search-item-type{
background:#fff;
}
.block-editor-link-control__search-item.is-current{ .block-editor-link-control__search-item.is-current{
background:transparent; background:transparent;
border:0; border:0;
@ -1890,7 +1866,6 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed{
margin-right:8px; margin-right:8px;
max-height:24px; max-height:24px;
position:relative; position:relative;
top:.2em;
width:24px; width:24px;
} }
.block-editor-link-control__search-item .block-editor-link-control__search-item-icon img{ .block-editor-link-control__search-item .block-editor-link-control__search-item-icon img{
@ -1901,15 +1876,6 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed{
top:0; top:0;
width:32px; width:32px;
} }
.block-editor-link-control__search-item .block-editor-link-control__search-item-info,.block-editor-link-control__search-item .block-editor-link-control__search-item-title{
overflow:hidden;
text-overflow:ellipsis;
}
.block-editor-link-control__search-item .block-editor-link-control__search-item-info .components-external-link__icon,.block-editor-link-control__search-item .block-editor-link-control__search-item-title .components-external-link__icon{
margin-top:0;
position:absolute;
right:0;
}
.block-editor-link-control__search-item .block-editor-link-control__search-item-title{ .block-editor-link-control__search-item .block-editor-link-control__search-item-title{
display:block; display:block;
font-weight:500; font-weight:500;
@ -1919,7 +1885,7 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed{
.block-editor-link-control__search-item .block-editor-link-control__search-item-title mark{ .block-editor-link-control__search-item .block-editor-link-control__search-item-title mark{
background-color:initial; background-color:initial;
color:inherit; color:inherit;
font-weight:700; font-weight:600;
} }
.block-editor-link-control__search-item .block-editor-link-control__search-item-title span{ .block-editor-link-control__search-item .block-editor-link-control__search-item-title span{
font-weight:400; font-weight:400;
@ -1927,25 +1893,6 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed{
.block-editor-link-control__search-item .block-editor-link-control__search-item-title svg{ .block-editor-link-control__search-item .block-editor-link-control__search-item-title svg{
display:none; display:none;
} }
.block-editor-link-control__search-item .block-editor-link-control__search-item-info{
color:#757575;
display:block;
font-size:.9em;
line-height:1.3;
}
.block-editor-link-control__search-item .block-editor-link-control__search-item-error-notice{
font-size:1.1em;
font-style:italic;
}
.block-editor-link-control__search-item .block-editor-link-control__search-item-type{
background-color:#f0f0f0;
border-radius:2px;
display:block;
font-size:.9em;
margin-left:auto;
padding:3px 6px;
white-space:nowrap;
}
.block-editor-link-control__search-item .block-editor-link-control__search-item-description{ .block-editor-link-control__search-item .block-editor-link-control__search-item-description{
margin:0; margin:0;
padding-top:12px; padding-top:12px;
@ -2054,10 +2001,6 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed{
top:0; top:0;
} }
.block-editor-link-control__search-results div[role=menu]>.block-editor-link-control__search-item.block-editor-link-control__search-item{
padding:10px;
}
.block-editor-link-control__drawer{ .block-editor-link-control__drawer{
display:flex; display:flex;
flex-basis:100%; flex-basis:100%;

File diff suppressed because one or more lines are too long

View File

@ -1618,7 +1618,9 @@ body.is-fullscreen-mode .edit-site-list-header{
} }
.edit-site-patterns{ .edit-site-patterns{
background:rgba(0,0,0,.15); background:none;
border:1px solid #2f2f2f;
border-radius:0;
margin:60px 0 0; margin:60px 0 0;
} }
.edit-site-patterns .components-base-control{ .edit-site-patterns .components-base-control{
@ -1673,6 +1675,23 @@ body.is-fullscreen-mode .edit-site-list-header{
background:#757575; background:#757575;
color:#f0f0f0; color:#f0f0f0;
} }
.edit-site-patterns .edit-site-patterns__grid-pagination{
width:-moz-fit-content;
width:fit-content;
}
.edit-site-patterns .edit-site-patterns__grid-pagination .components-button.is-tertiary{
background-color:#2f2f2f;
color:#f0f0f0;
height:32px;
width:32px;
}
.edit-site-patterns .edit-site-patterns__grid-pagination .components-button.is-tertiary:disabled{
background:none;
color:#949494;
}
.edit-site-patterns .edit-site-patterns__grid-pagination .components-button.is-tertiary:hover:not(:disabled){
background-color:#757575;
}
.edit-site-patterns__section-header .screen-reader-shortcut:focus{ .edit-site-patterns__section-header .screen-reader-shortcut:focus{
top:0; top:0;
@ -1683,6 +1702,7 @@ body.is-fullscreen-mode .edit-site-list-header{
gap:32px; gap:32px;
grid-template-columns:1fr; grid-template-columns:1fr;
margin-bottom:32px; margin-bottom:32px;
margin-top:0;
padding-top:2px; padding-top:2px;
} }
@media (min-width:960px){ @media (min-width:960px){
@ -2464,6 +2484,7 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
} }
.edit-site-layout__sidebar{ .edit-site-layout__sidebar{
flex-shrink:0;
width:100vw; width:100vw;
z-index:1; z-index:1;
} }
@ -2771,12 +2792,15 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
background:#2f2f2f; background:#2f2f2f;
color:#e0e0e0; color:#e0e0e0;
} }
.edit-site-sidebar-navigation-item.components-item:focus .edit-site-sidebar-navigation-item__drilldown-indicator,.edit-site-sidebar-navigation-item.components-item:hover .edit-site-sidebar-navigation-item__drilldown-indicator,.edit-site-sidebar-navigation-item.components-item[aria-current] .edit-site-sidebar-navigation-item__drilldown-indicator{
fill:#e0e0e0;
}
.edit-site-sidebar-navigation-item.components-item[aria-current]{ .edit-site-sidebar-navigation-item.components-item[aria-current]{
background:var(--wp-admin-theme-color); background:var(--wp-admin-theme-color);
color:#fff; color:#fff;
} }
.edit-site-sidebar-navigation-item.components-item .edit-site-sidebar-navigation-item__drilldown-indicator{ .edit-site-sidebar-navigation-item.components-item .edit-site-sidebar-navigation-item__drilldown-indicator{
fill:#757575; fill:#949494;
} }
.edit-site-sidebar-navigation-item.components-item:is(a){ .edit-site-sidebar-navigation-item.components-item:is(a){
align-items:center; align-items:center;
@ -2787,6 +2811,10 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
box-shadow:none; box-shadow:none;
outline:none; outline:none;
} }
.edit-site-sidebar-navigation-item.components-item:is(a):focus-visible{
box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
outline:2px solid transparent;
}
.edit-site-sidebar-navigation-item.components-item.with-suffix{ .edit-site-sidebar-navigation-item.components-item.with-suffix{
padding-left:16px; padding-left:16px;
} }
@ -3125,6 +3153,9 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
.edit-site-site-hub .edit-site-site-hub__container{ .edit-site-site-hub .edit-site-site-hub__container{
gap:0; gap:0;
} }
.edit-site-site-hub .edit-site-site-hub__site-title,.edit-site-site-hub .edit-site-site-hub_toggle-command-center{
transition:opacity .1s ease;
}
.edit-site-site-hub .edit-site-site-hub__site-view-link{ .edit-site-site-hub .edit-site-site-hub__site-view-link{
flex-grow:0; flex-grow:0;
} }
@ -3315,6 +3346,13 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
.edit-site-resizable-frame__inner{ .edit-site-resizable-frame__inner{
position:relative; position:relative;
} }
body:has(.edit-site-resizable-frame__inner.edit-site-layout__resizable-frame-oversized) .edit-site-site-hub .edit-site-site-hub__site-title,body:has(.edit-site-resizable-frame__inner.edit-site-layout__resizable-frame-oversized) .edit-site-site-hub .edit-site-site-hub_toggle-command-center{
opacity:0 !important;
}
body:has(.edit-site-resizable-frame__inner.edit-site-layout__resizable-frame-oversized) .edit-site-site-hub .edit-site-site-hub__view-mode-toggle-container{
background-color:initial;
}
body:has(.edit-site-resizable-frame__inner.is-resizing){ body:has(.edit-site-resizable-frame__inner.is-resizing){
cursor:col-resize; cursor:col-resize;
user-select:none; user-select:none;
@ -3337,11 +3375,13 @@ body:has(.edit-site-resizable-frame__inner.is-resizing){
.edit-site-resizable-frame__handle{ .edit-site-resizable-frame__handle{
align-items:center; align-items:center;
background-color:hsla(0,0%,46%,.4); background-color:hsla(0,0%,46%,.4);
border:0;
border-radius:4px; border-radius:4px;
cursor:col-resize; cursor:col-resize;
display:flex; display:flex;
height:64px; height:64px;
justify-content:flex-end; justify-content:flex-end;
padding:0;
position:absolute; position:absolute;
top:calc(50% - 32px); top:calc(50% - 32px);
width:4px; width:4px;
@ -3361,15 +3401,11 @@ body:has(.edit-site-resizable-frame__inner.is-resizing){
position:absolute; position:absolute;
width:32px; width:32px;
} }
.edit-site-resizable-frame__handle:hover,.is-resizing .edit-site-resizable-frame__handle{ .edit-site-resizable-frame__handle:focus-visible{
background-color:var(--wp-admin-theme-color); outline:2px solid transparent;
} }
.edit-site-resizable-frame__handle .edit-site-resizable-frame__handle-label{ .edit-site-resizable-frame__handle.is-resizing,.edit-site-resizable-frame__handle:focus,.edit-site-resizable-frame__handle:hover{
background:var(--wp-admin-theme-color); background-color:var(--wp-admin-theme-color);
border-radius:2px;
color:#fff;
margin-left:8px;
padding:4px 8px;
} }
.edit-site-push-changes-to-global-styles-control .components-button{ .edit-site-push-changes-to-global-styles-control .components-button{

File diff suppressed because one or more lines are too long

View File

@ -1618,7 +1618,9 @@ body.is-fullscreen-mode .edit-site-list-header{
} }
.edit-site-patterns{ .edit-site-patterns{
background:rgba(0,0,0,.15); background:none;
border:1px solid #2f2f2f;
border-radius:0;
margin:60px 0 0; margin:60px 0 0;
} }
.edit-site-patterns .components-base-control{ .edit-site-patterns .components-base-control{
@ -1673,6 +1675,23 @@ body.is-fullscreen-mode .edit-site-list-header{
background:#757575; background:#757575;
color:#f0f0f0; color:#f0f0f0;
} }
.edit-site-patterns .edit-site-patterns__grid-pagination{
width:-moz-fit-content;
width:fit-content;
}
.edit-site-patterns .edit-site-patterns__grid-pagination .components-button.is-tertiary{
background-color:#2f2f2f;
color:#f0f0f0;
height:32px;
width:32px;
}
.edit-site-patterns .edit-site-patterns__grid-pagination .components-button.is-tertiary:disabled{
background:none;
color:#949494;
}
.edit-site-patterns .edit-site-patterns__grid-pagination .components-button.is-tertiary:hover:not(:disabled){
background-color:#757575;
}
.edit-site-patterns__section-header .screen-reader-shortcut:focus{ .edit-site-patterns__section-header .screen-reader-shortcut:focus{
top:0; top:0;
@ -1683,6 +1702,7 @@ body.is-fullscreen-mode .edit-site-list-header{
gap:32px; gap:32px;
grid-template-columns:1fr; grid-template-columns:1fr;
margin-bottom:32px; margin-bottom:32px;
margin-top:0;
padding-top:2px; padding-top:2px;
} }
@media (min-width:960px){ @media (min-width:960px){
@ -2464,6 +2484,7 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
} }
.edit-site-layout__sidebar{ .edit-site-layout__sidebar{
flex-shrink:0;
width:100vw; width:100vw;
z-index:1; z-index:1;
} }
@ -2771,12 +2792,15 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
background:#2f2f2f; background:#2f2f2f;
color:#e0e0e0; color:#e0e0e0;
} }
.edit-site-sidebar-navigation-item.components-item:focus .edit-site-sidebar-navigation-item__drilldown-indicator,.edit-site-sidebar-navigation-item.components-item:hover .edit-site-sidebar-navigation-item__drilldown-indicator,.edit-site-sidebar-navigation-item.components-item[aria-current] .edit-site-sidebar-navigation-item__drilldown-indicator{
fill:#e0e0e0;
}
.edit-site-sidebar-navigation-item.components-item[aria-current]{ .edit-site-sidebar-navigation-item.components-item[aria-current]{
background:var(--wp-admin-theme-color); background:var(--wp-admin-theme-color);
color:#fff; color:#fff;
} }
.edit-site-sidebar-navigation-item.components-item .edit-site-sidebar-navigation-item__drilldown-indicator{ .edit-site-sidebar-navigation-item.components-item .edit-site-sidebar-navigation-item__drilldown-indicator{
fill:#757575; fill:#949494;
} }
.edit-site-sidebar-navigation-item.components-item:is(a){ .edit-site-sidebar-navigation-item.components-item:is(a){
align-items:center; align-items:center;
@ -2787,6 +2811,10 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
box-shadow:none; box-shadow:none;
outline:none; outline:none;
} }
.edit-site-sidebar-navigation-item.components-item:is(a):focus-visible{
box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
outline:2px solid transparent;
}
.edit-site-sidebar-navigation-item.components-item.with-suffix{ .edit-site-sidebar-navigation-item.components-item.with-suffix{
padding-right:16px; padding-right:16px;
} }
@ -3125,6 +3153,9 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
.edit-site-site-hub .edit-site-site-hub__container{ .edit-site-site-hub .edit-site-site-hub__container{
gap:0; gap:0;
} }
.edit-site-site-hub .edit-site-site-hub__site-title,.edit-site-site-hub .edit-site-site-hub_toggle-command-center{
transition:opacity .1s ease;
}
.edit-site-site-hub .edit-site-site-hub__site-view-link{ .edit-site-site-hub .edit-site-site-hub__site-view-link{
flex-grow:0; flex-grow:0;
} }
@ -3315,6 +3346,13 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
.edit-site-resizable-frame__inner{ .edit-site-resizable-frame__inner{
position:relative; position:relative;
} }
body:has(.edit-site-resizable-frame__inner.edit-site-layout__resizable-frame-oversized) .edit-site-site-hub .edit-site-site-hub__site-title,body:has(.edit-site-resizable-frame__inner.edit-site-layout__resizable-frame-oversized) .edit-site-site-hub .edit-site-site-hub_toggle-command-center{
opacity:0 !important;
}
body:has(.edit-site-resizable-frame__inner.edit-site-layout__resizable-frame-oversized) .edit-site-site-hub .edit-site-site-hub__view-mode-toggle-container{
background-color:initial;
}
body:has(.edit-site-resizable-frame__inner.is-resizing){ body:has(.edit-site-resizable-frame__inner.is-resizing){
cursor:col-resize; cursor:col-resize;
user-select:none; user-select:none;
@ -3337,11 +3375,13 @@ body:has(.edit-site-resizable-frame__inner.is-resizing){
.edit-site-resizable-frame__handle{ .edit-site-resizable-frame__handle{
align-items:center; align-items:center;
background-color:hsla(0,0%,46%,.4); background-color:hsla(0,0%,46%,.4);
border:0;
border-radius:4px; border-radius:4px;
cursor:col-resize; cursor:col-resize;
display:flex; display:flex;
height:64px; height:64px;
justify-content:flex-end; justify-content:flex-end;
padding:0;
position:absolute; position:absolute;
top:calc(50% - 32px); top:calc(50% - 32px);
width:4px; width:4px;
@ -3361,15 +3401,11 @@ body:has(.edit-site-resizable-frame__inner.is-resizing){
right:100%; right:100%;
width:32px; width:32px;
} }
.edit-site-resizable-frame__handle:hover,.is-resizing .edit-site-resizable-frame__handle{ .edit-site-resizable-frame__handle:focus-visible{
background-color:var(--wp-admin-theme-color); outline:2px solid transparent;
} }
.edit-site-resizable-frame__handle .edit-site-resizable-frame__handle-label{ .edit-site-resizable-frame__handle.is-resizing,.edit-site-resizable-frame__handle:focus,.edit-site-resizable-frame__handle:hover{
background:var(--wp-admin-theme-color); background-color:var(--wp-admin-theme-color);
border-radius:2px;
color:#fff;
margin-right:8px;
padding:4px 8px;
} }
.edit-site-push-changes-to-global-styles-control .components-button{ .edit-site-push-changes-to-global-styles-control .components-button{

File diff suppressed because one or more lines are too long

View File

@ -8325,7 +8325,7 @@ const getInserterItems = rememo((state, rootClientId = null) => {
title: reusableBlock.title.raw, title: reusableBlock.title.raw,
icon, icon,
category: 'reusable', category: 'reusable',
keywords: [], keywords: ['reusable'],
isDisabled: false, isDisabled: false,
utility: 1, utility: 1,
// Deprecated. // Deprecated.
@ -28787,7 +28787,7 @@ function ReusableBlocksRenameHint() {
className: "reusable-blocks-menu-items__rename-hint" className: "reusable-blocks-menu-items__rename-hint"
}, (0,external_wp_element_namespaceObject.createElement)("div", { }, (0,external_wp_element_namespaceObject.createElement)("div", {
className: "reusable-blocks-menu-items__rename-hint-content" className: "reusable-blocks-menu-items__rename-hint-content"
}, (0,external_wp_i18n_namespaceObject.__)('Reusable blocks are now called patterns. A synced pattern will behave in exactly the same way as a reusable block.')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { }, (0,external_wp_i18n_namespaceObject.__)('Reusable blocks are now synced patterns. A synced pattern will behave in exactly the same way as a reusable block.')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
className: "reusable-blocks-menu-items__rename-hint-dismiss", className: "reusable-blocks-menu-items__rename-hint-dismiss",
icon: library_close, icon: library_close,
iconSize: "16", iconSize: "16",
@ -31905,7 +31905,8 @@ function useBlockDisplayInformation(clientId) {
if (!clientId) return null; if (!clientId) return null;
const { const {
getBlockName, getBlockName,
getBlockAttributes getBlockAttributes,
__experimentalGetReusableBlockTitle
} = select(store); } = select(store);
const { const {
getBlockType, getBlockType,
@ -31916,11 +31917,14 @@ function useBlockDisplayInformation(clientId) {
if (!blockType) return null; if (!blockType) return null;
const attributes = getBlockAttributes(clientId); const attributes = getBlockAttributes(clientId);
const match = getActiveBlockVariation(blockName, attributes); const match = getActiveBlockVariation(blockName, attributes);
const isSynced = (0,external_wp_blocks_namespaceObject.isReusableBlock)(blockType) || (0,external_wp_blocks_namespaceObject.isTemplatePart)(blockType); const isReusable = (0,external_wp_blocks_namespaceObject.isReusableBlock)(blockType);
const resusableTitle = isReusable ? __experimentalGetReusableBlockTitle(attributes.ref) : undefined;
const title = resusableTitle || blockType.title;
const isSynced = isReusable || (0,external_wp_blocks_namespaceObject.isTemplatePart)(blockType);
const positionLabel = getPositionTypeLabel(attributes); const positionLabel = getPositionTypeLabel(attributes);
const blockTypeInfo = { const blockTypeInfo = {
isSynced, isSynced,
title: blockType.title, title,
icon: blockType.icon, icon: blockType.icon,
description: blockType.description, description: blockType.description,
anchor: attributes?.anchor, anchor: attributes?.anchor,
@ -32175,17 +32179,20 @@ const BlockDraggable = ({
const { const {
canMoveBlocks, canMoveBlocks,
getBlockRootClientId, getBlockRootClientId,
getBlockName getBlockName,
getBlockAttributes
} = select(store); } = select(store);
const { const {
getBlockType getBlockType,
getActiveBlockVariation
} = select(external_wp_blocks_namespaceObject.store); } = select(external_wp_blocks_namespaceObject.store);
const rootClientId = getBlockRootClientId(clientIds[0]); const rootClientId = getBlockRootClientId(clientIds[0]);
const blockName = getBlockName(clientIds[0]); const blockName = getBlockName(clientIds[0]);
const variation = getActiveBlockVariation(blockName, getBlockAttributes(clientIds[0]));
return { return {
srcRootClientId: rootClientId, srcRootClientId: rootClientId,
isDraggable: canMoveBlocks(clientIds, rootClientId), isDraggable: canMoveBlocks(clientIds, rootClientId),
icon: getBlockType(blockName)?.icon icon: variation?.icon || getBlockType(blockName)?.icon
}; };
}, [clientIds]); }, [clientIds]);
const isDragging = (0,external_wp_element_namespaceObject.useRef)(false); const isDragging = (0,external_wp_element_namespaceObject.useRef)(false);
@ -44489,7 +44496,7 @@ function MarginVisualizer({
const [style, setStyle] = (0,external_wp_element_namespaceObject.useState)(); const [style, setStyle] = (0,external_wp_element_namespaceObject.useState)();
const margin = attributes?.style?.spacing?.margin; const margin = attributes?.style?.spacing?.margin;
(0,external_wp_element_namespaceObject.useEffect)(() => { (0,external_wp_element_namespaceObject.useEffect)(() => {
if (!blockElement) { if (!blockElement || null === blockElement.ownerDocument.defaultView) {
return; return;
} }
@ -44577,7 +44584,7 @@ function PaddingVisualizer({
const [style, setStyle] = (0,external_wp_element_namespaceObject.useState)(); const [style, setStyle] = (0,external_wp_element_namespaceObject.useState)();
const padding = attributes?.style?.spacing?.padding; const padding = attributes?.style?.spacing?.padding;
(0,external_wp_element_namespaceObject.useEffect)(() => { (0,external_wp_element_namespaceObject.useEffect)(() => {
if (!blockElement) { if (!blockElement || null === blockElement.ownerDocument.defaultView) {
return; return;
} }
@ -54197,10 +54204,6 @@ class URLInput extends external_wp_element_namespaceObject.Component {
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/search-create-button.js ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/search-create-button.js
/**
* External dependencies
*/
/** /**
* WordPress dependencies * WordPress dependencies
*/ */
@ -54208,12 +54211,10 @@ class URLInput extends external_wp_element_namespaceObject.Component {
const LinkControlSearchCreate = ({ const LinkControlSearchCreate = ({
searchTerm, searchTerm,
onClick, onClick,
itemProps, itemProps,
isSelected,
buttonText buttonText
}) => { }) => {
if (!searchTerm) { if (!searchTerm) {
@ -54232,19 +54233,12 @@ const LinkControlSearchCreate = ({
}); });
} }
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { ...itemProps, return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { ...itemProps,
className: classnames_default()('block-editor-link-control__search-create block-editor-link-control__search-item', { iconPosition: "left",
'is-selected': isSelected icon: library_plus,
}), className: "block-editor-link-control__search-item",
onClick: onClick onClick: onClick
}, (0,external_wp_element_namespaceObject.createElement)(build_module_icon, { }, text);
className: "block-editor-link-control__search-item-icon",
icon: library_plus
}), (0,external_wp_element_namespaceObject.createElement)("span", {
className: "block-editor-link-control__search-item-header"
}, (0,external_wp_element_namespaceObject.createElement)("span", {
className: "block-editor-link-control__search-item-title"
}, text)));
}; };
/* harmony default export */ var search_create_button = (LinkControlSearchCreate); /* harmony default export */ var search_create_button = (LinkControlSearchCreate);
@ -54328,10 +54322,6 @@ const globe = (0,external_wp_element_namespaceObject.createElement)(external_wp_
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/search-item.js ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/search-item.js
/**
* External dependencies
*/
/** /**
* WordPress dependencies * WordPress dependencies
*/ */
@ -54340,7 +54330,6 @@ const globe = (0,external_wp_element_namespaceObject.createElement)(external_wp_
const ICONS_MAP = { const ICONS_MAP = {
post: post_list, post: post_list,
page: library_page, page: library_page,
@ -54374,36 +54363,27 @@ function SearchItemIcon({
const LinkControlSearchItem = ({ const LinkControlSearchItem = ({
itemProps, itemProps,
suggestion, suggestion,
isSelected = false, searchTerm,
onClick, onClick,
isURL = false, isURL = false,
searchTerm = '',
shouldShowType = false shouldShowType = false
}) => { }) => {
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { ...itemProps, const info = isURL ? (0,external_wp_i18n_namespaceObject.__)('Press ENTER to add this link') : (0,external_wp_url_namespaceObject.filterURLForDisplay)((0,external_wp_url_namespaceObject.safeDecodeURI)(suggestion?.url));
onClick: onClick, return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { ...itemProps,
className: classnames_default()('block-editor-link-control__search-item', { info: info,
'is-selected': isSelected, iconPosition: "left",
'is-url': isURL, icon: (0,external_wp_element_namespaceObject.createElement)(SearchItemIcon, {
'is-entity': !isURL
})
}, (0,external_wp_element_namespaceObject.createElement)(SearchItemIcon, {
suggestion: suggestion, suggestion: suggestion,
isURL: isURL isURL: isURL
}), (0,external_wp_element_namespaceObject.createElement)("span", { }),
className: "block-editor-link-control__search-item-header" onClick: onClick,
}, (0,external_wp_element_namespaceObject.createElement)("span", { shortcut: shouldShowType && getVisualTypeName(suggestion),
className: "block-editor-link-control__search-item-title" className: "block-editor-link-control__search-item"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextHighlight // The component expects a plain text string. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextHighlight // The component expects a plain text string.
, { , {
text: (0,external_wp_dom_namespaceObject.__unstableStripHTML)(suggestion.title), text: (0,external_wp_dom_namespaceObject.__unstableStripHTML)(suggestion.title),
highlight: searchTerm highlight: searchTerm
})), (0,external_wp_element_namespaceObject.createElement)("span", { }));
"aria-hidden": !isURL,
className: "block-editor-link-control__search-item-info"
}, !isURL && ((0,external_wp_url_namespaceObject.filterURLForDisplay)((0,external_wp_url_namespaceObject.safeDecodeURI)(suggestion.url)) || ''), isURL && (0,external_wp_i18n_namespaceObject.__)('Press ENTER to add this link'))), shouldShowType && suggestion.type && (0,external_wp_element_namespaceObject.createElement)("span", {
className: "block-editor-link-control__search-item-type"
}, getVisualTypeName(suggestion)));
}; };
function getVisualTypeName(suggestion) { function getVisualTypeName(suggestion) {
@ -54427,7 +54407,7 @@ function getVisualTypeName(suggestion) {
const CREATE_TYPE = '__CREATE__'; const CREATE_TYPE = '__CREATE__';
const TEL_TYPE = 'tel'; const TEL_TYPE = 'tel';
const URL_TYPE = 'URL'; const URL_TYPE = 'link';
const MAILTO_TYPE = 'mailto'; const MAILTO_TYPE = 'mailto';
const INTERNAL_TYPE = 'internal'; const INTERNAL_TYPE = 'internal';
const LINK_ENTRY_TYPES = [URL_TYPE, MAILTO_TYPE, TEL_TYPE, INTERNAL_TYPE]; const LINK_ENTRY_TYPES = [URL_TYPE, MAILTO_TYPE, TEL_TYPE, INTERNAL_TYPE];
@ -54492,7 +54472,7 @@ function LinkControlSearchResults({
}, searchResultsLabel, (0,external_wp_element_namespaceObject.createElement)("div", { ...suggestionsListProps, }, searchResultsLabel, (0,external_wp_element_namespaceObject.createElement)("div", { ...suggestionsListProps,
className: resultsListClasses, className: resultsListClasses,
"aria-labelledby": searchResultsLabelId "aria-labelledby": searchResultsLabelId
}, suggestions.map((suggestion, index) => { }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, null, suggestions.map((suggestion, index) => {
if (shouldShowCreateSuggestion && CREATE_TYPE === suggestion.type) { if (shouldShowCreateSuggestion && CREATE_TYPE === suggestion.type) {
return (0,external_wp_element_namespaceObject.createElement)(search_create_button, { return (0,external_wp_element_namespaceObject.createElement)(search_create_button, {
searchTerm: currentInputValue, searchTerm: currentInputValue,
@ -54527,7 +54507,7 @@ function LinkControlSearchResults({
shouldShowType: shouldShowSuggestionsTypes, shouldShowType: shouldShowSuggestionsTypes,
isFrontPage: suggestion?.isFrontPage isFrontPage: suggestion?.isFrontPage
}); });
}))); }))));
} }
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/is-url-like.js ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/is-url-like.js

File diff suppressed because one or more lines are too long

View File

@ -11642,8 +11642,9 @@ const deprecated_v11 = {
className: 'wp-block-cover__inner-container' className: 'wp-block-cover__inner-container'
}) })
})); }));
} },
migrate: migrateTag
}; // Deprecation for blocks that renders fixed background as backgroud from the main block container. }; // Deprecation for blocks that renders fixed background as backgroud from the main block container.
const deprecated_v10 = { const deprecated_v10 = {
@ -11737,8 +11738,9 @@ const deprecated_v10 = {
className: 'wp-block-cover__inner-container' className: 'wp-block-cover__inner-container'
}) })
})); }));
} },
migrate: migrateTag
}; // Deprecation for blocks with `minHeightUnit` set but no `minHeight`. }; // Deprecation for blocks with `minHeightUnit` set but no `minHeight`.
const v9 = { const v9 = {
@ -31461,6 +31463,328 @@ function OverlayMenuPreview({
}))); })));
} }
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/menu-items-to-blocks.js
/**
* WordPress dependencies
*/
/**
* Convert a flat menu item structure to a nested blocks structure.
*
* @param {Object[]} menuItems An array of menu items.
*
* @return {WPBlock[]} An array of blocks.
*/
function menuItemsToBlocks(menuItems) {
if (!menuItems) {
return null;
}
const menuTree = createDataTree(menuItems);
const blocks = mapMenuItemsToBlocks(menuTree);
return (0,external_wp_hooks_namespaceObject.applyFilters)('blocks.navigation.__unstableMenuItemsToBlocks', blocks, menuItems);
}
/**
* A recursive function that maps menu item nodes to blocks.
*
* @param {WPNavMenuItem[]} menuItems An array of WPNavMenuItem items.
* @param {number} level An integer representing the nesting level.
* @return {Object} Object containing innerBlocks and mapping.
*/
function mapMenuItemsToBlocks(menuItems, level = 0) {
let mapping = {}; // The menuItem should be in menu_order sort order.
const sortedItems = [...menuItems].sort((a, b) => a.menu_order - b.menu_order);
const innerBlocks = sortedItems.map(menuItem => {
if (menuItem.type === 'block') {
const [block] = (0,external_wp_blocks_namespaceObject.parse)(menuItem.content.raw);
if (!block) {
return (0,external_wp_blocks_namespaceObject.createBlock)('core/freeform', {
content: menuItem.content
});
}
return block;
}
const blockType = menuItem.children?.length ? 'core/navigation-submenu' : 'core/navigation-link';
const attributes = menuItemToBlockAttributes(menuItem, blockType, level); // If there are children recurse to build those nested blocks.
const {
innerBlocks: nestedBlocks = [],
// alias to avoid shadowing
mapping: nestedMapping = {} // alias to avoid shadowing
} = menuItem.children?.length ? mapMenuItemsToBlocks(menuItem.children, level + 1) : {}; // Update parent mapping with nested mapping.
mapping = { ...mapping,
...nestedMapping
}; // Create block with nested "innerBlocks".
const block = (0,external_wp_blocks_namespaceObject.createBlock)(blockType, attributes, nestedBlocks); // Create mapping for menuItem -> block.
mapping[menuItem.id] = block.clientId;
return block;
});
return {
innerBlocks,
mapping
};
}
/**
* A WP nav_menu_item object.
* For more documentation on the individual fields present on a menu item please see:
* https://core.trac.wordpress.org/browser/tags/5.7.1/src/wp-includes/nav-menu.php#L789
*
* @typedef WPNavMenuItem
*
* @property {Object} title stores the raw and rendered versions of the title/label for this menu item.
* @property {Array} xfn the XFN relationships expressed in the link of this menu item.
* @property {Array} classes the HTML class attributes for this menu item.
* @property {string} attr_title the HTML title attribute for this menu item.
* @property {string} object The type of object originally represented, such as 'category', 'post', or 'attachment'.
* @property {string} object_id The DB ID of the original object this menu item represents, e.g. ID for posts and term_id for categories.
* @property {string} description The description of this menu item.
* @property {string} url The URL to which this menu item points.
* @property {string} type The family of objects originally represented, such as 'post_type' or 'taxonomy'.
* @property {string} target The target attribute of the link element for this menu item.
*/
/**
* Convert block attributes to menu item.
*
* @param {WPNavMenuItem} menuItem the menu item to be converted to block attributes.
* @param {string} blockType The block type.
* @param {number} level An integer representing the nesting level.
* @return {Object} the block attributes converted from the WPNavMenuItem item.
*/
function menuItemToBlockAttributes({
title: menuItemTitleField,
xfn,
classes,
// eslint-disable-next-line camelcase
attr_title,
object,
// eslint-disable-next-line camelcase
object_id,
description,
url,
type: menuItemTypeField,
target
}, blockType, level) {
// For historical reasons, the `core/navigation-link` variation type is `tag`
// whereas WP Core expects `post_tag` as the `object` type.
// To avoid writing a block migration we perform a conversion here.
// See also inverse equivalent in `blockAttributesToMenuItem`.
if (object && object === 'post_tag') {
object = 'tag';
}
return {
label: menuItemTitleField?.rendered || '',
...(object?.length && {
type: object
}),
kind: menuItemTypeField?.replace('_', '-') || 'custom',
url: url || '',
...(xfn?.length && xfn.join(' ').trim() && {
rel: xfn.join(' ').trim()
}),
...(classes?.length && classes.join(' ').trim() && {
className: classes.join(' ').trim()
}),
/* eslint-disable camelcase */
...(attr_title?.length && {
title: attr_title
}),
...(object_id && 'custom' !== object && {
id: object_id
}),
/* eslint-enable camelcase */
...(description?.length && {
description
}),
...(target === '_blank' && {
opensInNewTab: true
}),
...(blockType === 'core/navigation-submenu' && {
isTopLevelItem: level === 0
}),
...(blockType === 'core/navigation-link' && {
isTopLevelLink: level === 0
})
};
}
/**
* Creates a nested, hierarchical tree representation from unstructured data that
* has an inherent relationship defined between individual items.
*
* For example, by default, each element in the dataset should have an `id` and
* `parent` property where the `parent` property indicates a relationship between
* the current item and another item with a matching `id` properties.
*
* This is useful for building linked lists of data from flat data structures.
*
* @param {Array} dataset linked data to be rearranged into a hierarchical tree based on relational fields.
* @param {string} id the property which uniquely identifies each entry within the array.
* @param {*} relation the property which identifies how the current item is related to other items in the data (if at all).
* @return {Array} a nested array of parent/child relationships
*/
function createDataTree(dataset, id = 'id', relation = 'parent') {
const hashTable = Object.create(null);
const dataTree = [];
for (const data of dataset) {
hashTable[data[id]] = { ...data,
children: []
};
if (data[relation]) {
hashTable[data[relation]] = hashTable[data[relation]] || {};
hashTable[data[relation]].children = hashTable[data[relation]].children || [];
hashTable[data[relation]].children.push(hashTable[data[id]]);
} else {
dataTree.push(hashTable[data[id]]);
}
}
return dataTree;
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const CLASSIC_MENU_CONVERSION_SUCCESS = 'success';
const CLASSIC_MENU_CONVERSION_ERROR = 'error';
const CLASSIC_MENU_CONVERSION_PENDING = 'pending';
const CLASSIC_MENU_CONVERSION_IDLE = 'idle'; // This is needed to ensure that multiple components using this hook
// do not import the same classic menu twice.
let classicMenuBeingConvertedId = null;
function useConvertClassicToBlockMenu(createNavigationMenu) {
const registry = (0,external_wp_data_namespaceObject.useRegistry)();
const {
editEntityRecord
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
const [status, setStatus] = (0,external_wp_element_namespaceObject.useState)(CLASSIC_MENU_CONVERSION_IDLE);
const [error, setError] = (0,external_wp_element_namespaceObject.useState)(null);
const convertClassicMenuToBlockMenu = (0,external_wp_element_namespaceObject.useCallback)(async (menuId, menuName, postStatus = 'publish') => {
let navigationMenu;
let classicMenuItems; // 1. Fetch the classic Menu items.
try {
classicMenuItems = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getMenuItems({
menus: menuId,
per_page: -1,
context: 'view'
});
} catch (err) {
throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
(0,external_wp_i18n_namespaceObject.__)(`Unable to fetch classic menu "%s" from API.`), menuName), {
cause: err
});
} // Handle offline response which resolves to `null`.
if (classicMenuItems === null) {
throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
(0,external_wp_i18n_namespaceObject.__)(`Unable to fetch classic menu "%s" from API.`), menuName));
} // 2. Convert the classic items into blocks.
const {
innerBlocks
} = menuItemsToBlocks(classicMenuItems); // 3. Create the `wp_navigation` Post with the blocks.
try {
navigationMenu = await createNavigationMenu(menuName, innerBlocks, postStatus);
/**
* Immediately trigger editEntityRecord to change the wp_navigation post status to 'publish'.
* This status change causes the menu to be displayed on the front of the site and sets the post state to be "dirty".
* The problem being solved is if saveEditedEntityRecord was used here, the menu would be updated on the frontend and the editor _automatically_,
* without user interaction.
* If the user abandons the site editor without saving, there would still be a wp_navigation post created as draft.
*/
await editEntityRecord('postType', 'wp_navigation', navigationMenu.id, {
status: 'publish'
}, {
throwOnError: true
});
} catch (err) {
throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
(0,external_wp_i18n_namespaceObject.__)(`Unable to create Navigation Menu "%s".`), menuName), {
cause: err
});
}
return navigationMenu;
}, [createNavigationMenu, editEntityRecord, registry]);
const convert = (0,external_wp_element_namespaceObject.useCallback)(async (menuId, menuName, postStatus) => {
// Check whether this classic menu is being imported already.
if (classicMenuBeingConvertedId === menuId) {
return;
} // Set the ID for the currently importing classic menu.
classicMenuBeingConvertedId = menuId;
if (!menuId || !menuName) {
setError('Unable to convert menu. Missing menu details.');
setStatus(CLASSIC_MENU_CONVERSION_ERROR);
return;
}
setStatus(CLASSIC_MENU_CONVERSION_PENDING);
setError(null);
return await convertClassicMenuToBlockMenu(menuId, menuName, postStatus).then(navigationMenu => {
setStatus(CLASSIC_MENU_CONVERSION_SUCCESS); // Reset the ID for the currently importing classic menu.
classicMenuBeingConvertedId = null;
return navigationMenu;
}).catch(err => {
setError(err?.message); // Reset the ID for the currently importing classic menu.
setStatus(CLASSIC_MENU_CONVERSION_ERROR); // Reset the ID for the currently importing classic menu.
classicMenuBeingConvertedId = null; // Rethrow error for debugging.
throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
(0,external_wp_i18n_namespaceObject.__)(`Unable to create Navigation Menu "%s".`), menuName), {
cause: err
});
});
}, [convertClassicMenuToBlockMenu]);
return {
convert,
status,
error
};
}
/* harmony default export */ var use_convert_classic_menu_to_block_menu = (useConvertClassicToBlockMenu);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/utils/create-template-part-id.js ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/utils/create-template-part-id.js
/** /**
* Generates a template part Id based on slug and theme inputs. * Generates a template part Id based on slug and theme inputs.
@ -31682,336 +32006,6 @@ function useCreateNavigationMenu(clientId) {
}; };
} }
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/menu-items-to-blocks.js
/**
* WordPress dependencies
*/
/**
* Convert a flat menu item structure to a nested blocks structure.
*
* @param {Object[]} menuItems An array of menu items.
*
* @return {WPBlock[]} An array of blocks.
*/
function menuItemsToBlocks(menuItems) {
if (!menuItems) {
return null;
}
const menuTree = createDataTree(menuItems);
const blocks = mapMenuItemsToBlocks(menuTree);
return (0,external_wp_hooks_namespaceObject.applyFilters)('blocks.navigation.__unstableMenuItemsToBlocks', blocks, menuItems);
}
/**
* A recursive function that maps menu item nodes to blocks.
*
* @param {WPNavMenuItem[]} menuItems An array of WPNavMenuItem items.
* @param {number} level An integer representing the nesting level.
* @return {Object} Object containing innerBlocks and mapping.
*/
function mapMenuItemsToBlocks(menuItems, level = 0) {
let mapping = {}; // The menuItem should be in menu_order sort order.
const sortedItems = [...menuItems].sort((a, b) => a.menu_order - b.menu_order);
const innerBlocks = sortedItems.map(menuItem => {
if (menuItem.type === 'block') {
const [block] = (0,external_wp_blocks_namespaceObject.parse)(menuItem.content.raw);
if (!block) {
return (0,external_wp_blocks_namespaceObject.createBlock)('core/freeform', {
content: menuItem.content
});
}
return block;
}
const blockType = menuItem.children?.length ? 'core/navigation-submenu' : 'core/navigation-link';
const attributes = menuItemToBlockAttributes(menuItem, blockType, level); // If there are children recurse to build those nested blocks.
const {
innerBlocks: nestedBlocks = [],
// alias to avoid shadowing
mapping: nestedMapping = {} // alias to avoid shadowing
} = menuItem.children?.length ? mapMenuItemsToBlocks(menuItem.children, level + 1) : {}; // Update parent mapping with nested mapping.
mapping = { ...mapping,
...nestedMapping
}; // Create block with nested "innerBlocks".
const block = (0,external_wp_blocks_namespaceObject.createBlock)(blockType, attributes, nestedBlocks); // Create mapping for menuItem -> block.
mapping[menuItem.id] = block.clientId;
return block;
});
return {
innerBlocks,
mapping
};
}
/**
* A WP nav_menu_item object.
* For more documentation on the individual fields present on a menu item please see:
* https://core.trac.wordpress.org/browser/tags/5.7.1/src/wp-includes/nav-menu.php#L789
*
* @typedef WPNavMenuItem
*
* @property {Object} title stores the raw and rendered versions of the title/label for this menu item.
* @property {Array} xfn the XFN relationships expressed in the link of this menu item.
* @property {Array} classes the HTML class attributes for this menu item.
* @property {string} attr_title the HTML title attribute for this menu item.
* @property {string} object The type of object originally represented, such as 'category', 'post', or 'attachment'.
* @property {string} object_id The DB ID of the original object this menu item represents, e.g. ID for posts and term_id for categories.
* @property {string} description The description of this menu item.
* @property {string} url The URL to which this menu item points.
* @property {string} type The family of objects originally represented, such as 'post_type' or 'taxonomy'.
* @property {string} target The target attribute of the link element for this menu item.
*/
/**
* Convert block attributes to menu item.
*
* @param {WPNavMenuItem} menuItem the menu item to be converted to block attributes.
* @param {string} blockType The block type.
* @param {number} level An integer representing the nesting level.
* @return {Object} the block attributes converted from the WPNavMenuItem item.
*/
function menuItemToBlockAttributes({
title: menuItemTitleField,
xfn,
classes,
// eslint-disable-next-line camelcase
attr_title,
object,
// eslint-disable-next-line camelcase
object_id,
description,
url,
type: menuItemTypeField,
target
}, blockType, level) {
// For historical reasons, the `core/navigation-link` variation type is `tag`
// whereas WP Core expects `post_tag` as the `object` type.
// To avoid writing a block migration we perform a conversion here.
// See also inverse equivalent in `blockAttributesToMenuItem`.
if (object && object === 'post_tag') {
object = 'tag';
}
return {
label: menuItemTitleField?.rendered || '',
...(object?.length && {
type: object
}),
kind: menuItemTypeField?.replace('_', '-') || 'custom',
url: url || '',
...(xfn?.length && xfn.join(' ').trim() && {
rel: xfn.join(' ').trim()
}),
...(classes?.length && classes.join(' ').trim() && {
className: classes.join(' ').trim()
}),
/* eslint-disable camelcase */
...(attr_title?.length && {
title: attr_title
}),
...(object_id && 'custom' !== object && {
id: object_id
}),
/* eslint-enable camelcase */
...(description?.length && {
description
}),
...(target === '_blank' && {
opensInNewTab: true
}),
...(blockType === 'core/navigation-submenu' && {
isTopLevelItem: level === 0
}),
...(blockType === 'core/navigation-link' && {
isTopLevelLink: level === 0
})
};
}
/**
* Creates a nested, hierarchical tree representation from unstructured data that
* has an inherent relationship defined between individual items.
*
* For example, by default, each element in the dataset should have an `id` and
* `parent` property where the `parent` property indicates a relationship between
* the current item and another item with a matching `id` properties.
*
* This is useful for building linked lists of data from flat data structures.
*
* @param {Array} dataset linked data to be rearranged into a hierarchical tree based on relational fields.
* @param {string} id the property which uniquely identifies each entry within the array.
* @param {*} relation the property which identifies how the current item is related to other items in the data (if at all).
* @return {Array} a nested array of parent/child relationships
*/
function createDataTree(dataset, id = 'id', relation = 'parent') {
const hashTable = Object.create(null);
const dataTree = [];
for (const data of dataset) {
hashTable[data[id]] = { ...data,
children: []
};
if (data[relation]) {
hashTable[data[relation]] = hashTable[data[relation]] || {};
hashTable[data[relation]].children = hashTable[data[relation]].children || [];
hashTable[data[relation]].children.push(hashTable[data[id]]);
} else {
dataTree.push(hashTable[data[id]]);
}
}
return dataTree;
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const CLASSIC_MENU_CONVERSION_SUCCESS = 'success';
const CLASSIC_MENU_CONVERSION_ERROR = 'error';
const CLASSIC_MENU_CONVERSION_PENDING = 'pending';
const CLASSIC_MENU_CONVERSION_IDLE = 'idle'; // This is needed to ensure that multiple components using this hook
// do not import the same classic menu twice.
let classicMenuBeingConvertedId = null;
function useConvertClassicToBlockMenu(clientId) {
/*
* The wp_navigation post is created as a draft so the changes on the frontend and
* the site editor are not permanent without a save interaction done by the user.
*/
const {
create: createNavigationMenu
} = useCreateNavigationMenu(clientId, 'draft');
const registry = (0,external_wp_data_namespaceObject.useRegistry)();
const {
editEntityRecord
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
const [status, setStatus] = (0,external_wp_element_namespaceObject.useState)(CLASSIC_MENU_CONVERSION_IDLE);
const [error, setError] = (0,external_wp_element_namespaceObject.useState)(null);
const convertClassicMenuToBlockMenu = (0,external_wp_element_namespaceObject.useCallback)(async (menuId, menuName, postStatus = 'publish') => {
let navigationMenu;
let classicMenuItems; // 1. Fetch the classic Menu items.
try {
classicMenuItems = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getMenuItems({
menus: menuId,
per_page: -1,
context: 'view'
});
} catch (err) {
throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
(0,external_wp_i18n_namespaceObject.__)(`Unable to fetch classic menu "%s" from API.`), menuName), {
cause: err
});
} // Handle offline response which resolves to `null`.
if (classicMenuItems === null) {
throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
(0,external_wp_i18n_namespaceObject.__)(`Unable to fetch classic menu "%s" from API.`), menuName));
} // 2. Convert the classic items into blocks.
const {
innerBlocks
} = menuItemsToBlocks(classicMenuItems); // 3. Create the `wp_navigation` Post with the blocks.
try {
navigationMenu = await createNavigationMenu(menuName, innerBlocks, postStatus);
/**
* Immediately trigger editEntityRecord to change the wp_navigation post status to 'publish'.
* This status change causes the menu to be displayed on the front of the site and sets the post state to be "dirty".
* The problem being solved is if saveEditedEntityRecord was used here, the menu would be updated on the frontend and the editor _automatically_,
* without user interaction.
* If the user abandons the site editor without saving, there would still be a wp_navigation post created as draft.
*/
await editEntityRecord('postType', 'wp_navigation', navigationMenu.id, {
status: 'publish'
}, {
throwOnError: true
});
} catch (err) {
throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
(0,external_wp_i18n_namespaceObject.__)(`Unable to create Navigation Menu "%s".`), menuName), {
cause: err
});
}
return navigationMenu;
}, [createNavigationMenu, editEntityRecord, registry]);
const convert = (0,external_wp_element_namespaceObject.useCallback)(async (menuId, menuName, postStatus) => {
// Check whether this classic menu is being imported already.
if (classicMenuBeingConvertedId === menuId) {
return;
} // Set the ID for the currently importing classic menu.
classicMenuBeingConvertedId = menuId;
if (!menuId || !menuName) {
setError('Unable to convert menu. Missing menu details.');
setStatus(CLASSIC_MENU_CONVERSION_ERROR);
return;
}
setStatus(CLASSIC_MENU_CONVERSION_PENDING);
setError(null);
return await convertClassicMenuToBlockMenu(menuId, menuName, postStatus).then(navigationMenu => {
setStatus(CLASSIC_MENU_CONVERSION_SUCCESS); // Reset the ID for the currently importing classic menu.
classicMenuBeingConvertedId = null;
return navigationMenu;
}).catch(err => {
setError(err?.message); // Reset the ID for the currently importing classic menu.
setStatus(CLASSIC_MENU_CONVERSION_ERROR); // Reset the ID for the currently importing classic menu.
classicMenuBeingConvertedId = null; // Rethrow error for debugging.
throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
(0,external_wp_i18n_namespaceObject.__)(`Unable to create Navigation Menu "%s".`), menuName), {
cause: err
});
});
}, [convertClassicMenuToBlockMenu]);
return {
convert,
status,
error
};
}
/* harmony default export */ var use_convert_classic_menu_to_block_menu = (useConvertClassicToBlockMenu);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-inner-blocks.js ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-inner-blocks.js
/** /**
* WordPress dependencies * WordPress dependencies
@ -32973,7 +32967,7 @@ function Navigation({
convert: convertClassicMenu, convert: convertClassicMenu,
status: classicMenuConversionStatus, status: classicMenuConversionStatus,
error: classicMenuConversionError error: classicMenuConversionError
} = use_convert_classic_menu_to_block_menu(clientId); } = use_convert_classic_menu_to_block_menu(createNavigationMenu);
const isConvertingClassicMenu = classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_PENDING; const isConvertingClassicMenu = classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_PENDING;
const handleUpdateMenu = (0,external_wp_element_namespaceObject.useCallback)((menuId, options = { const handleUpdateMenu = (0,external_wp_element_namespaceObject.useCallback)((menuId, options = {
focusNavigationBlock: false focusNavigationBlock: false
@ -46979,7 +46973,8 @@ const block_metadata = {
name: "core/block", name: "core/block",
title: "Pattern", title: "Pattern",
category: "reusable", category: "reusable",
description: "Create and save content to reuse across your site. Update the block, and the changes apply everywhere it\u2019s used.", description: "Create and save content to reuse across your site. Update the pattern, and the changes apply everywhere it\u2019s used.",
keywords: ["reusable"],
textdomain: "default", textdomain: "default",
attributes: { attributes: {
ref: { ref: {
@ -58562,7 +58557,13 @@ const format = {
function onClick() { function onClick() {
registry.batch(() => { registry.batch(() => {
const id = esm_browser_v4(); let id;
if (isObjectActive) {
const object = value.replacements[value.start];
id = object?.attributes?.['data-fn'];
} else {
id = esm_browser_v4();
const newValue = (0,external_wp_richText_namespaceObject.insertObject)(value, { const newValue = (0,external_wp_richText_namespaceObject.insertObject)(value, {
type: formatName, type: formatName,
attributes: { attributes: {
@ -58571,7 +58572,9 @@ const format = {
innerHTML: `<a href="#${id}" id="${id}-link">*</a>` innerHTML: `<a href="#${id}" id="${id}-link">*</a>`
}, value.end, value.end); }, value.end, value.end);
newValue.start = newValue.end - 1; newValue.start = newValue.end - 1;
onChange(newValue); // BFS search to find the first footnote block. onChange(newValue);
} // BFS search to find the first footnote block.
let fnBlock = null; let fnBlock = null;
{ {

File diff suppressed because one or more lines are too long

View File

@ -61832,6 +61832,7 @@ function UnconnectedNavigatorProvider(props, forwardedRef) {
focusTargetSelector, focusTargetSelector,
isBack = false, isBack = false,
skipFocus = false, skipFocus = false,
replace = false,
...restOptions ...restOptions
} = options; } = options;
const isNavigatingToPreviousPath = isBack && currentLocationHistory.current.length > 1 && currentLocationHistory.current[currentLocationHistory.current.length - 2].path === path; const isNavigatingToPreviousPath = isBack && currentLocationHistory.current.length > 1 && currentLocationHistory.current[currentLocationHistory.current.length - 2].path === path;
@ -61849,18 +61850,25 @@ function UnconnectedNavigatorProvider(props, forwardedRef) {
skipFocus skipFocus
}; };
if (prevLocationHistory.length < 1) { if (prevLocationHistory.length === 0) {
return [newLocation]; return replace ? [] : [newLocation];
} }
return [...prevLocationHistory.slice(prevLocationHistory.length > MAX_HISTORY_LENGTH - 1 ? 1 : 0, -1), // Assign `focusTargetSelector` to the previous location in history const newLocationHistory = prevLocationHistory.slice(prevLocationHistory.length > MAX_HISTORY_LENGTH - 1 ? 1 : 0, -1);
if (!replace) {
newLocationHistory.push( // Assign `focusTargetSelector` to the previous location in history
// (the one we just navigated from). // (the one we just navigated from).
{ ...prevLocationHistory[prevLocationHistory.length - 1], { ...prevLocationHistory[prevLocationHistory.length - 1],
focusTargetSelector focusTargetSelector
}, newLocation]; });
}
newLocationHistory.push(newLocation);
return newLocationHistory;
}); });
}, [goBack]); }, [goBack]);
const goToParent = (0,external_wp_element_namespaceObject.useCallback)(() => { const goToParent = (0,external_wp_element_namespaceObject.useCallback)((options = {}) => {
const currentPath = currentLocationHistory.current[currentLocationHistory.current.length - 1].path; const currentPath = currentLocationHistory.current[currentLocationHistory.current.length - 1].path;
if (currentPath === undefined) { if (currentPath === undefined) {
@ -61873,7 +61881,7 @@ function UnconnectedNavigatorProvider(props, forwardedRef) {
return; return;
} }
goTo(parentPath, { goTo(parentPath, { ...options,
isBack: true isBack: true
}); });
}, [goTo]); }, [goTo]);

File diff suppressed because one or more lines are too long

View File

@ -9121,7 +9121,7 @@ function Layout({
previous: previousShortcut, previous: previousShortcut,
next: nextShortcut next: nextShortcut
} }
}), (0,external_wp_element_namespaceObject.createElement)(EditPostPreferencesModal, null), (0,external_wp_element_namespaceObject.createElement)(keyboard_shortcut_help_modal, null), (0,external_wp_element_namespaceObject.createElement)(WelcomeGuide, null), (0,external_wp_element_namespaceObject.createElement)(StartPageOptions, null), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover.Slot, null), (0,external_wp_element_namespaceObject.createElement)(external_wp_plugins_namespaceObject.PluginArea, { }), (0,external_wp_element_namespaceObject.createElement)(EditPostPreferencesModal, null), (0,external_wp_element_namespaceObject.createElement)(keyboard_shortcut_help_modal, null), (0,external_wp_element_namespaceObject.createElement)(WelcomeGuide, null), (0,external_wp_element_namespaceObject.createElement)(external_wp_editor_namespaceObject.PostSyncStatusModal, null), (0,external_wp_element_namespaceObject.createElement)(StartPageOptions, null), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover.Slot, null), (0,external_wp_element_namespaceObject.createElement)(external_wp_plugins_namespaceObject.PluginArea, {
onError: onPluginAreaError onError: onPluginAreaError
})); }));
} }

File diff suppressed because one or more lines are too long

View File

@ -5492,9 +5492,7 @@ function SidebarNavigationScreen({
const { const {
getTheme getTheme
} = (0,external_wp_data_namespaceObject.useSelect)(external_wp_coreData_namespaceObject.store); } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_coreData_namespaceObject.store);
const { const navigator = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)();
goTo
} = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)();
const theme = getTheme(currentlyPreviewingTheme()); const theme = getTheme(currentlyPreviewingTheme());
const icon = (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right : chevron_left; const icon = (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right : chevron_left;
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalVStack, { return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalVStack, {
@ -5505,13 +5503,21 @@ function SidebarNavigationScreen({
spacing: 4, spacing: 4,
alignment: "flex-start", alignment: "flex-start",
className: "edit-site-sidebar-navigation-screen__title-icon" className: "edit-site-sidebar-navigation-screen__title-icon"
}, !isRoot && !backPath && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorToParentButton, { }, !isRoot && !backPath && (0,external_wp_element_namespaceObject.createElement)(SidebarButton, {
as: SidebarButton, onClick: () => {
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right : chevron_left, if (navigator.location.isInitial) {
navigator.goToParent({
replace: true
});
} else {
navigator.goBack();
}
},
icon: icon,
label: (0,external_wp_i18n_namespaceObject.__)('Back'), label: (0,external_wp_i18n_namespaceObject.__)('Back'),
showTooltip: false showTooltip: false
}), !isRoot && backPath && (0,external_wp_element_namespaceObject.createElement)(SidebarButton, { }), !isRoot && backPath && (0,external_wp_element_namespaceObject.createElement)(SidebarButton, {
onClick: () => goTo(backPath, { onClick: () => navigator.goTo(backPath, {
isBack: true isBack: true
}), }),
icon: icon, icon: icon,
@ -7173,7 +7179,7 @@ function TemplatePartHint() {
onRemove: () => { onRemove: () => {
setPreference('core', PREFERENCE_NAME, false); setPreference('core', PREFERENCE_NAME, false);
} }
}, (0,external_wp_i18n_namespaceObject.__)('Looking for template parts? You can now find them in the new "Patterns" page.')); }, (0,external_wp_i18n_namespaceObject.__)('Looking for template parts? Find them in "Patterns".'));
} }
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-main/index.js ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-main/index.js
@ -10420,8 +10426,7 @@ function SidebarNavigationScreenPatterns() {
hasPatterns hasPatterns
} = usePatternCategories(); } = usePatternCategories();
const { const {
myPatterns, myPatterns
hasPatterns: hasMyPatterns
} = useMyPatterns(); } = useMyPatterns();
const isTemplatePartsMode = (0,external_wp_data_namespaceObject.useSelect)(select => { const isTemplatePartsMode = (0,external_wp_data_namespaceObject.useSelect)(select => {
const settings = select(store_store).getSettings(); const settings = select(store_store).getSettings();
@ -10446,11 +10451,11 @@ function SidebarNavigationScreenPatterns() {
footer: footer, footer: footer,
content: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, isLoading && (0,external_wp_i18n_namespaceObject.__)('Loading patterns'), !isLoading && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, !hasTemplateParts && !hasPatterns && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, { content: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, isLoading && (0,external_wp_i18n_namespaceObject.__)('Loading patterns'), !isLoading && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, !hasTemplateParts && !hasPatterns && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, {
className: "edit-site-sidebar-navigation-screen-patterns__group" className: "edit-site-sidebar-navigation-screen-patterns__group"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalItem, null, (0,external_wp_i18n_namespaceObject.__)('No template parts or patterns found'))), hasMyPatterns && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, { }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalItem, null, (0,external_wp_i18n_namespaceObject.__)('No template parts or patterns found'))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, {
className: "edit-site-sidebar-navigation-screen-patterns__group" className: "edit-site-sidebar-navigation-screen-patterns__group"
}, (0,external_wp_element_namespaceObject.createElement)(CategoryItem, { }, (0,external_wp_element_namespaceObject.createElement)(CategoryItem, {
key: myPatterns.name, key: myPatterns.name,
count: myPatterns.count, count: !myPatterns.count ? '0' : myPatterns.count,
label: myPatterns.label, label: myPatterns.label,
icon: star_filled, icon: star_filled,
id: myPatterns.name, id: myPatterns.name,
@ -10871,8 +10876,9 @@ function TemplatePartNavigationMenu({
if (!id) return null; if (!id) return null;
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHeading, { return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHeading, {
className: "edit-site-sidebar-navigation-screen-template-part-navigation-menu__title", className: "edit-site-sidebar-navigation-screen-template-part-navigation-menu__title",
size: "12", size: "11",
upperCase: true upperCase: true,
weight: 500
}, title?.rendered || (0,external_wp_i18n_namespaceObject.__)('Navigation')), (0,external_wp_element_namespaceObject.createElement)(NavigationMenuEditor, { }, title?.rendered || (0,external_wp_i18n_namespaceObject.__)('Navigation')), (0,external_wp_element_namespaceObject.createElement)(NavigationMenuEditor, {
navigationMenuId: id navigationMenuId: id
})); }));
@ -10958,8 +10964,9 @@ function TemplatePartNavigationMenus({
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHeading, { return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHeading, {
className: "edit-site-sidebar-navigation-screen-template-part-navigation-menu__title", className: "edit-site-sidebar-navigation-screen-template-part-navigation-menu__title",
size: "12", size: "11",
upperCase: true upperCase: true,
weight: 500
}, (0,external_wp_i18n_namespaceObject.__)('Navigation')), (0,external_wp_element_namespaceObject.createElement)(TemplatePartNavigationMenuList, { }, (0,external_wp_i18n_namespaceObject.__)('Navigation')), (0,external_wp_element_namespaceObject.createElement)(TemplatePartNavigationMenuList, {
menus: menus menus: menus
})); }));
@ -11212,6 +11219,13 @@ function getPathFromURL(urlParams) {
return path; return path;
} }
function isSubset(subset, superset) {
return Object.entries(subset).every(([key, value]) => {
return superset[key] === value;
});
}
function useSyncPathWithURL() { function useSyncPathWithURL() {
const history = use_sync_path_with_url_useHistory(); const history = use_sync_path_with_url_useHistory();
const { const {
@ -11222,8 +11236,6 @@ function useSyncPathWithURL() {
params: navigatorParams, params: navigatorParams,
goTo goTo
} = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)(); } = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)();
const currentUrlParams = (0,external_wp_element_namespaceObject.useRef)(urlParams);
const currentPath = (0,external_wp_element_namespaceObject.useRef)(navigatorLocation.path);
const isMounting = (0,external_wp_element_namespaceObject.useRef)(true); const isMounting = (0,external_wp_element_namespaceObject.useRef)(true);
(0,external_wp_element_namespaceObject.useEffect)(() => { (0,external_wp_element_namespaceObject.useEffect)(() => {
// The navigatorParams are only initially filled properly when the // The navigatorParams are only initially filled properly when the
@ -11234,16 +11246,13 @@ function useSyncPathWithURL() {
} }
function updateUrlParams(newUrlParams) { function updateUrlParams(newUrlParams) {
if (Object.entries(newUrlParams).every(([key, value]) => { if (isSubset(newUrlParams, urlParams)) {
return currentUrlParams.current[key] === value;
})) {
return; return;
} }
const updatedParams = { ...currentUrlParams.current, const updatedParams = { ...urlParams,
...newUrlParams ...newUrlParams
}; };
currentUrlParams.current = updatedParams;
history.push(updatedParams); history.push(updatedParams);
} }
@ -11275,16 +11284,18 @@ function useSyncPathWithURL() {
path: navigatorLocation.path === '/' ? undefined : navigatorLocation.path path: navigatorLocation.path === '/' ? undefined : navigatorLocation.path
}); });
} }
}, [navigatorLocation?.path, navigatorParams, history]); }, // Trigger only when navigator changes to prevent infinite loops.
// eslint-disable-next-line react-hooks/exhaustive-deps
[navigatorLocation?.path, navigatorParams]);
(0,external_wp_element_namespaceObject.useEffect)(() => { (0,external_wp_element_namespaceObject.useEffect)(() => {
currentUrlParams.current = urlParams;
const path = getPathFromURL(urlParams); const path = getPathFromURL(urlParams);
if (currentPath.current !== path) { if (navigatorLocation.path !== path) {
currentPath.current = path;
goTo(path); goTo(path);
} }
}, [urlParams, goTo]); }, // Trigger only when URL changes to prevent infinite loops.
// eslint-disable-next-line react-hooks/exhaustive-deps
[urlParams]);
} }
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js
@ -11431,6 +11442,7 @@ function ScreenNavigationMoreMenu(props) {
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DropdownMenu, { return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DropdownMenu, {
className: "sidebar-navigation__more-menu", className: "sidebar-navigation__more-menu",
label: (0,external_wp_i18n_namespaceObject.__)('Actions'),
icon: more_vertical, icon: more_vertical,
popoverProps: more_menu_POPOVER_PROPS popoverProps: more_menu_POPOVER_PROPS
}, ({ }, ({
@ -11514,13 +11526,13 @@ function SingleNavigationMenu({
}) { }) {
const menuTitle = navigationMenu?.title?.rendered; const menuTitle = navigationMenu?.title?.rendered;
return (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreenWrapper, { return (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreenWrapper, {
actions: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(EditButton, { actions: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(ScreenNavigationMoreMenu, {
postId: navigationMenu?.id
}), (0,external_wp_element_namespaceObject.createElement)(ScreenNavigationMoreMenu, {
menuTitle: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(menuTitle), menuTitle: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(menuTitle),
onDelete: handleDelete, onDelete: handleDelete,
onSave: handleSave, onSave: handleSave,
onDuplicate: handleDuplicate onDuplicate: handleDuplicate
}), (0,external_wp_element_namespaceObject.createElement)(EditButton, {
postId: navigationMenu?.id
})), })),
title: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(menuTitle), title: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(menuTitle),
description: (0,external_wp_i18n_namespaceObject.__)('Navigation menus are a curated collection of blocks that allow visitors to get around your site.') description: (0,external_wp_i18n_namespaceObject.__)('Navigation menus are a curated collection of blocks that allow visitors to get around your site.')
@ -12336,6 +12348,9 @@ function SidebarNavigationScreenPages() {
slug slug
}) => ['404', 'search'].includes(slug)); }) => ['404', 'search'].includes(slug));
const homeTemplate = templates?.find(template => template.slug === 'front-page') || templates?.find(template => template.slug === 'home') || templates?.find(template => template.slug === 'index'); const homeTemplate = templates?.find(template => template.slug === 'front-page') || templates?.find(template => template.slug === 'home') || templates?.find(template => template.slug === 'index');
const getPostsPageTemplate = () => templates?.find(template => template.slug === 'home') || templates?.find(template => template.slug === 'index');
const pagesAndTemplates = pages?.concat(dynamicPageTemplates, [homeTemplate]); const pagesAndTemplates = pages?.concat(dynamicPageTemplates, [homeTemplate]);
const { const {
frontPage, frontPage,
@ -12378,6 +12393,27 @@ function SidebarNavigationScreenPages() {
setShowAddPage(false); setShowAddPage(false);
}; };
const getPageProps = id => {
let itemIcon = library_page;
const postsPageTemplateId = postsPage && postsPage === id ? getPostsPageTemplate()?.id : null;
switch (id) {
case frontPage:
itemIcon = library_home;
break;
case postsPage:
itemIcon = library_verse;
break;
}
return {
icon: itemIcon,
postType: postsPageTemplateId ? 'wp_template' : 'page',
postId: postsPageTemplateId || id
};
};
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, showAddPage && (0,external_wp_element_namespaceObject.createElement)(AddNewPageModal, { return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, showAddPage && (0,external_wp_element_namespaceObject.createElement)(AddNewPageModal, {
onSave: handleNewPage, onSave: handleNewPage,
onClose: () => setShowAddPage(false) onClose: () => setShowAddPage(false)
@ -12397,31 +12433,15 @@ function SidebarNavigationScreenPages() {
withChevron: true withChevron: true
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTruncate, { }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTruncate, {
numberOfLines: 1 numberOfLines: 1
}, (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(homeTemplate.title?.rendered || (0,external_wp_i18n_namespaceObject.__)('(no title)')))), reorderedPages?.map(item => { }, (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(homeTemplate.title?.rendered || (0,external_wp_i18n_namespaceObject.__)('(no title)')))), reorderedPages?.map(({
let itemIcon; id,
title
switch (item.id) { }) => (0,external_wp_element_namespaceObject.createElement)(PageItem, { ...getPageProps(id),
case frontPage: key: id,
itemIcon = library_home;
break;
case postsPage:
itemIcon = library_verse;
break;
default:
itemIcon = library_page;
}
return (0,external_wp_element_namespaceObject.createElement)(PageItem, {
postId: item.id,
key: item.id,
icon: itemIcon,
withChevron: true withChevron: true
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTruncate, { }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTruncate, {
numberOfLines: 1 numberOfLines: 1
}, (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item?.title?.rendered || (0,external_wp_i18n_namespaceObject.__)('(no title)')))); }, (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title?.rendered || (0,external_wp_i18n_namespaceObject.__)('(no title)'))))))),
}))),
footer: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalVStack, { footer: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalVStack, {
spacing: 0 spacing: 0
}, dynamicPageTemplates?.map(item => (0,external_wp_element_namespaceObject.createElement)(PageItem, { }, dynamicPageTemplates?.map(item => (0,external_wp_element_namespaceObject.createElement)(PageItem, {
@ -16945,22 +16965,28 @@ const inserterMediaCategories = [{
function useSiteEditorSettings(templateType) { function useSiteEditorSettings() {
var _storedSettings$__exp, _storedSettings$__exp2; var _storedSettings$__exp, _storedSettings$__exp2;
const {
setIsInserterOpened
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
const { const {
storedSettings, storedSettings,
canvasMode canvasMode,
templateType
} = (0,external_wp_data_namespaceObject.useSelect)(select => { } = (0,external_wp_data_namespaceObject.useSelect)(select => {
const { const {
getSettings, getSettings,
getCanvasMode getCanvasMode,
getEditedPostType
} = unlock(select(store_store)); } = unlock(select(store_store));
return { return {
storedSettings: getSettings(), storedSettings: getSettings(setIsInserterOpened),
canvasMode: getCanvasMode() canvasMode: getCanvasMode(),
templateType: getEditedPostType()
}; };
}, []); }, [setIsInserterOpened]);
const settingsBlockPatterns = (_storedSettings$__exp = storedSettings.__experimentalAdditionalBlockPatterns) !== null && _storedSettings$__exp !== void 0 ? _storedSettings$__exp : // WP 6.0 const settingsBlockPatterns = (_storedSettings$__exp = storedSettings.__experimentalAdditionalBlockPatterns) !== null && _storedSettings$__exp !== void 0 ? _storedSettings$__exp : // WP 6.0
storedSettings.__experimentalBlockPatterns; // WP 5.9 storedSettings.__experimentalBlockPatterns; // WP 5.9
@ -17547,10 +17573,6 @@ function getBlockEditorProvider(entityType) {
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/block-editor/index.js ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/block-editor/index.js
/**
* External dependencies
*/
/** /**
* WordPress dependencies * WordPress dependencies
*/ */
@ -20395,7 +20417,8 @@ const SiteHub = (0,external_wp_element_namespaceObject.forwardRef)((props, ref)
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_commands_namespaceObject.store); } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_commands_namespaceObject.store);
const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)();
const { const {
setCanvasMode setCanvasMode,
__experimentalSetPreviewDeviceType: setPreviewDeviceType
} = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store)); } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store));
const { const {
clearSelectedBlock clearSelectedBlock
@ -20414,6 +20437,7 @@ const SiteHub = (0,external_wp_element_namespaceObject.forwardRef)((props, ref)
if (canvasMode === 'edit') { if (canvasMode === 'edit') {
clearSelectedBlock(); clearSelectedBlock();
setPreviewDeviceType('desktop');
setCanvasMode('view'); setCanvasMode('view');
} }
} }
@ -20507,6 +20531,8 @@ const SiteHub = (0,external_wp_element_namespaceObject.forwardRef)((props, ref)
/** /**
* Internal dependencies * Internal dependencies
*/ */
@ -20526,7 +20552,7 @@ const resizable_frame_HANDLE_STYLES_OVERRIDE = {
left: undefined left: undefined
}; // The minimum width of the frame (in px) while resizing. }; // The minimum width of the frame (in px) while resizing.
const FRAME_MIN_WIDTH = 340; // The reference width of the frame (in px) used to calculate the aspect ratio. const FRAME_MIN_WIDTH = 320; // The reference width of the frame (in px) used to calculate the aspect ratio.
const FRAME_REFERENCE_WIDTH = 1300; // 9 : 19.5 is the target aspect ratio enforced (when possible) while resizing. const FRAME_REFERENCE_WIDTH = 1300; // 9 : 19.5 is the target aspect ratio enforced (when possible) while resizing.
@ -20534,7 +20560,12 @@ const FRAME_TARGET_ASPECT_RATIO = 9 / 19.5; // The minimum distance (in px) betw
// viewport's edge. If the frame is resized to be closer to the viewport's edge // viewport's edge. If the frame is resized to be closer to the viewport's edge
// than this distance, then "canvas mode" will be enabled. // than this distance, then "canvas mode" will be enabled.
const SNAP_TO_EDIT_CANVAS_MODE_THRESHOLD = 200; const SNAP_TO_EDIT_CANVAS_MODE_THRESHOLD = 200; // Default size for the `frameSize` state.
const INITIAL_FRAME_SIZE = {
width: '100%',
height: '100%'
};
function calculateNewHeight(width, initialAspectRatio) { function calculateNewHeight(width, initialAspectRatio) {
const lerp = (a, b, amount) => { const lerp = (a, b, amount) => {
@ -20556,16 +20587,14 @@ function ResizableFrame({
oversizedClassName, oversizedClassName,
innerContentStyle innerContentStyle
}) { }) {
const [frameSize, setFrameSize] = (0,external_wp_element_namespaceObject.useState)({ const [frameSize, setFrameSize] = (0,external_wp_element_namespaceObject.useState)(INITIAL_FRAME_SIZE); // The width of the resizable frame when a new resize gesture starts.
width: '100%',
height: '100%'
}); // The width of the resizable frame when a new resize gesture starts.
const [startingWidth, setStartingWidth] = (0,external_wp_element_namespaceObject.useState)(); const [startingWidth, setStartingWidth] = (0,external_wp_element_namespaceObject.useState)();
const [isResizing, setIsResizing] = (0,external_wp_element_namespaceObject.useState)(false); const [isResizing, setIsResizing] = (0,external_wp_element_namespaceObject.useState)(false);
const [isHovering, setIsHovering] = (0,external_wp_element_namespaceObject.useState)(false); const [shouldShowHandle, setShouldShowHandle] = (0,external_wp_element_namespaceObject.useState)(false);
const [isOversized, setIsOversized] = (0,external_wp_element_namespaceObject.useState)(false); const [isOversized, setIsOversized] = (0,external_wp_element_namespaceObject.useState)(false);
const [resizeRatio, setResizeRatio] = (0,external_wp_element_namespaceObject.useState)(1); const [resizeRatio, setResizeRatio] = (0,external_wp_element_namespaceObject.useState)(1);
const canvasMode = (0,external_wp_data_namespaceObject.useSelect)(select => unlock(select(store_store)).getCanvasMode(), []);
const { const {
setCanvasMode setCanvasMode
} = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store)); } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store));
@ -20576,7 +20605,8 @@ function ResizableFrame({
type: 'tween', type: 'tween',
duration: isResizing ? 0 : 0.5 duration: isResizing ? 0 : 0.5
}; };
const frameRef = (0,external_wp_element_namespaceObject.useRef)(null); // Remember frame dimensions on initial render. const frameRef = (0,external_wp_element_namespaceObject.useRef)(null);
const resizableHandleHelpId = (0,external_wp_compose_namespaceObject.useInstanceId)(ResizableFrame, 'edit-site-resizable-frame-handle-help'); // Remember frame dimensions on initial render.
(0,external_wp_element_namespaceObject.useEffect)(() => { (0,external_wp_element_namespaceObject.useEffect)(() => {
const { const {
@ -20626,14 +20656,27 @@ function ResizableFrame({
if (remainingWidth > SNAP_TO_EDIT_CANVAS_MODE_THRESHOLD) { if (remainingWidth > SNAP_TO_EDIT_CANVAS_MODE_THRESHOLD) {
// Reset the initial aspect ratio if the frame is resized slightly // Reset the initial aspect ratio if the frame is resized slightly
// above the sidebar but not far enough to trigger full screen. // above the sidebar but not far enough to trigger full screen.
setFrameSize({ setFrameSize(INITIAL_FRAME_SIZE);
width: '100%',
height: '100%'
});
} else { } else {
// Trigger full screen if the frame is resized far enough to the left. // Trigger full screen if the frame is resized far enough to the left.
setCanvasMode('edit'); setCanvasMode('edit');
} }
}; // Handle resize by arrow keys
const handleResizableHandleKeyDown = event => {
if (!['ArrowLeft', 'ArrowRight'].includes(event.key)) {
return;
}
event.preventDefault();
const step = 20 * (event.shiftKey ? 5 : 1);
const delta = step * (event.key === 'ArrowLeft' ? 1 : -1);
const newWidth = Math.min(Math.max(FRAME_MIN_WIDTH, frameRef.current.resizable.offsetWidth + delta), initialComputedWidthRef.current);
setFrameSize({
width: newWidth,
height: calculateNewHeight(newWidth, initialAspectRatioRef.current)
});
}; };
const frameAnimationVariants = { const frameAnimationVariants = {
@ -20647,16 +20690,29 @@ function ResizableFrame({
} }
}; };
const resizeHandleVariants = { const resizeHandleVariants = {
default: { hidden: {
opacity: 0,
left: 0
},
visible: {
opacity: 1, opacity: 1,
left: -16 left: -16
}, },
resizing: { active: {
opacity: 1, opacity: 1,
left: -16, left: -16,
scaleY: 1.3 scaleY: 1.3
} }
}; };
const currentResizeHandleVariant = (() => {
if (isResizing) {
return 'active';
}
return shouldShowHandle ? 'visible' : 'hidden';
})();
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, { return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, {
as: external_wp_components_namespaceObject.__unstableMotion.div, as: external_wp_components_namespaceObject.__unstableMotion.div,
ref: frameRef, ref: frameRef,
@ -20691,27 +20747,36 @@ function ResizableFrame({
minWidth: FRAME_MIN_WIDTH, minWidth: FRAME_MIN_WIDTH,
maxWidth: isFullWidth ? '100%' : '150%', maxWidth: isFullWidth ? '100%' : '150%',
maxHeight: '100%', maxHeight: '100%',
onMouseOver: () => setIsHovering(true), onFocus: () => setShouldShowHandle(true),
onMouseOut: () => setIsHovering(false), onBlur: () => setShouldShowHandle(false),
onMouseOver: () => setShouldShowHandle(true),
onMouseOut: () => setShouldShowHandle(false),
handleComponent: { handleComponent: {
left: isHovering || isResizing ? (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableMotion.div, { left: canvasMode === 'view' && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Tooltip, {
text: (0,external_wp_i18n_namespaceObject.__)('Drag to resize')
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableMotion.button, {
key: "handle", key: "handle",
className: "edit-site-resizable-frame__handle", role: "separator",
"aria-orientation": "vertical",
className: classnames_default()('edit-site-resizable-frame__handle', {
'is-resizing': isResizing
}),
variants: resizeHandleVariants, variants: resizeHandleVariants,
animate: isResizing ? 'resizing' : 'default', animate: currentResizeHandleVariant,
title: "Drag to resize", "aria-label": (0,external_wp_i18n_namespaceObject.__)('Drag to resize'),
initial: { "aria-describedby": resizableHandleHelpId,
opacity: 0, "aria-valuenow": frameRef.current?.resizable?.offsetWidth || undefined,
left: 0 "aria-valuemin": FRAME_MIN_WIDTH,
}, "aria-valuemax": initialComputedWidthRef.current,
exit: { onKeyDown: handleResizableHandleKeyDown,
opacity: 0, initial: "hidden",
left: 0 exit: "hidden",
}, whileFocus: "active",
whileHover: { whileHover: "active"
scaleY: 1.3 })), (0,external_wp_element_namespaceObject.createElement)("div", {
} hidden: true,
}) : null id: resizableHandleHelpId
}, (0,external_wp_i18n_namespaceObject.__)('Use left and right arrow keys to resize the canvas. Hold shift to resize in larger increments.')))
}, },
onResizeStart: handleResizeStart, onResizeStart: handleResizeStart,
onResize: handleResize, onResize: handleResize,
@ -22320,41 +22385,101 @@ function GridItem({
/** /**
* Internal dependencies * Internal dependencies
*/ */
const PAGE_SIZE = 100; const PAGE_SIZE = 20;
function Pagination({
currentPage,
numPages,
changePage,
totalItems
}) {
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
expanded: false,
spacing: 3,
className: "edit-site-patterns__grid-pagination"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalText, {
variant: "muted"
}, // translators: %s: Total number of patterns.
(0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Total number of patterns.
(0,external_wp_i18n_namespaceObject._n)('%s item', '%s items', totalItems), totalItems)), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
expanded: false,
spacing: 1
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
variant: "tertiary",
onClick: () => changePage(1),
disabled: currentPage === 1,
"aria-label": (0,external_wp_i18n_namespaceObject.__)('First page')
}, "\xAB"), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
variant: "tertiary",
onClick: () => changePage(currentPage - 1),
disabled: currentPage === 1,
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Previous page')
}, "\u2039")), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalText, {
variant: "muted"
}, (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %1$s: Current page number, %2$s: Total number of pages.
(0,external_wp_i18n_namespaceObject._x)('%1$s of %2$s', 'paging'), currentPage, numPages)), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
expanded: false,
spacing: 1
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
variant: "tertiary",
onClick: () => changePage(currentPage + 1),
disabled: currentPage === numPages,
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Next page')
}, "\u203A"), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
variant: "tertiary",
onClick: () => changePage(numPages),
disabled: currentPage === numPages,
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Last page')
}, "\xBB")));
}
function Grid({ function Grid({
categoryId, categoryId,
items, items,
...props ...props
}) { }) {
const [currentPage, setCurrentPage] = (0,external_wp_element_namespaceObject.useState)(1);
const gridRef = (0,external_wp_element_namespaceObject.useRef)(); const gridRef = (0,external_wp_element_namespaceObject.useRef)();
const totalItems = items.length;
const pageIndex = currentPage - 1;
const list = (0,external_wp_element_namespaceObject.useMemo)(() => items.slice(pageIndex * PAGE_SIZE, pageIndex * PAGE_SIZE + PAGE_SIZE), [pageIndex, items]);
const asyncList = (0,external_wp_compose_namespaceObject.useAsyncList)(list, {
step: 10
});
if (!items?.length) { if (!list?.length) {
return null; return null;
} }
const list = items.slice(0, PAGE_SIZE); const numPages = Math.ceil(items.length / PAGE_SIZE);
const restLength = items.length - PAGE_SIZE;
const changePage = page => {
const scrollContainer = document.querySelector('.edit-site-patterns');
scrollContainer?.scrollTo(0, 0);
setCurrentPage(page);
};
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("ul", { return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("ul", {
role: "listbox", role: "listbox",
className: "edit-site-patterns__grid", className: "edit-site-patterns__grid",
...props, ...props,
ref: gridRef ref: gridRef
}, list.map(item => (0,external_wp_element_namespaceObject.createElement)(grid_item, { }, asyncList.map(item => (0,external_wp_element_namespaceObject.createElement)(grid_item, {
key: item.name, key: item.name,
item: item, item: item,
categoryId: categoryId categoryId: categoryId
}))), restLength > 0 && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalText, { }))), numPages > 1 && (0,external_wp_element_namespaceObject.createElement)(Pagination, {
variant: "muted", currentPage,
as: "p", numPages,
align: "center" changePage,
}, (0,external_wp_i18n_namespaceObject.sprintf)( totalItems
/* translators: %d: number of patterns */ }));
(0,external_wp_i18n_namespaceObject.__)('+ %d more patterns discoverable by searching'), restLength)));
} }
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/no-patterns.js ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/no-patterns.js
@ -22833,7 +22958,6 @@ function PatternsList({
const hasPatterns = patterns.length; const hasPatterns = patterns.length;
const title = SYNC_FILTERS[syncFilter]; const title = SYNC_FILTERS[syncFilter];
const description = SYNC_DESCRIPTIONS[syncFilter]; const description = SYNC_DESCRIPTIONS[syncFilter];
const shownPatterns = (0,external_wp_compose_namespaceObject.useAsyncList)(patterns);
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalVStack, { return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalVStack, {
spacing: 6 spacing: 6
}, (0,external_wp_element_namespaceObject.createElement)(PatternsHeader, { }, (0,external_wp_element_namespaceObject.createElement)(PatternsHeader, {
@ -22884,7 +23008,7 @@ function PatternsList({
className: "edit-site-patterns__section-header" className: "edit-site-patterns__section-header"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHeading, { }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHeading, {
as: "h3", as: "h3",
level: 4, level: 5,
id: titleId id: titleId
}, title), description ? (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalText, { }, title), description ? (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalText, {
variant: "muted", variant: "muted",
@ -22892,7 +23016,7 @@ function PatternsList({
id: descriptionId id: descriptionId
}, description) : null), hasPatterns && (0,external_wp_element_namespaceObject.createElement)(Grid, { }, description) : null), hasPatterns && (0,external_wp_element_namespaceObject.createElement)(Grid, {
categoryId: categoryId, categoryId: categoryId,
items: shownPatterns, items: patterns,
"aria-labelledby": titleId, "aria-labelledby": titleId,
"aria-describedby": descriptionId "aria-describedby": descriptionId
}), !isResolving && !hasPatterns && (0,external_wp_element_namespaceObject.createElement)(NoPatterns, null)); }), !isResolving && !hasPatterns && (0,external_wp_element_namespaceObject.createElement)(NoPatterns, null));
@ -23007,7 +23131,7 @@ function Table({
}, column.cell(row)))))))); }, column.cell(row))))))));
} }
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/page-template-parts/index.js ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/page-template-parts/add-new-template-part.js
/** /**
@ -23025,6 +23149,63 @@ function Table({
const {
useHistory: add_new_template_part_useHistory
} = unlock(external_wp_router_namespaceObject.privateApis);
function AddNewTemplatePart() {
const {
canCreate,
postType
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
supportsTemplatePartsMode
} = select(store_store).getSettings();
return {
canCreate: !supportsTemplatePartsMode,
postType: select(external_wp_coreData_namespaceObject.store).getPostType('wp_template_part')
};
}, []);
const [isModalOpen, setIsModalOpen] = (0,external_wp_element_namespaceObject.useState)(false);
const history = add_new_template_part_useHistory();
if (!canCreate || !postType) {
return null;
}
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
variant: "primary",
onClick: () => setIsModalOpen(true)
}, postType.labels.add_new_item), isModalOpen && (0,external_wp_element_namespaceObject.createElement)(CreateTemplatePartModal, {
closeModal: () => setIsModalOpen(false),
blocks: [],
onCreate: templatePart => {
setIsModalOpen(false);
history.push({
postId: templatePart.id,
postType: 'wp_template_part',
canvas: 'edit'
});
},
onError: () => setIsModalOpen(false)
}));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/page-template-parts/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
@ -23035,17 +23216,6 @@ function PageTemplateParts() {
} = (0,external_wp_coreData_namespaceObject.useEntityRecords)('postType', 'wp_template_part', { } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('postType', 'wp_template_part', {
per_page: -1 per_page: -1
}); });
const {
canCreate
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
supportsTemplatePartsMode
} = select(store_store).getSettings();
return {
postType: select(external_wp_coreData_namespaceObject.store).getPostType('wp_template_part'),
canCreate: !supportsTemplatePartsMode
};
});
const columns = [{ const columns = [{
header: (0,external_wp_i18n_namespaceObject.__)('Template Part'), header: (0,external_wp_i18n_namespaceObject.__)('Template Part'),
cell: templatePart => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalVStack, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHeading, { cell: templatePart => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalVStack, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHeading, {
@ -23077,13 +23247,7 @@ function PageTemplateParts() {
}]; }];
return (0,external_wp_element_namespaceObject.createElement)(Page, { return (0,external_wp_element_namespaceObject.createElement)(Page, {
title: (0,external_wp_i18n_namespaceObject.__)('Template Parts'), title: (0,external_wp_i18n_namespaceObject.__)('Template Parts'),
actions: canCreate && (0,external_wp_element_namespaceObject.createElement)(AddNewTemplate, { actions: (0,external_wp_element_namespaceObject.createElement)(AddNewTemplatePart, null)
templateType: 'wp_template_part',
showIcon: false,
toggleProps: {
variant: 'primary'
}
})
}, templateParts && (0,external_wp_element_namespaceObject.createElement)(Table, { }, templateParts && (0,external_wp_element_namespaceObject.createElement)(Table, {
data: templateParts, data: templateParts,
columns: columns columns: columns

File diff suppressed because one or more lines are too long

View File

@ -1350,6 +1350,7 @@ __webpack_require__.d(__webpack_exports__, {
"PostStickyCheck": function() { return /* reexport */ post_sticky_check; }, "PostStickyCheck": function() { return /* reexport */ post_sticky_check; },
"PostSwitchToDraftButton": function() { return /* reexport */ post_switch_to_draft_button; }, "PostSwitchToDraftButton": function() { return /* reexport */ post_switch_to_draft_button; },
"PostSyncStatus": function() { return /* reexport */ PostSyncStatus; }, "PostSyncStatus": function() { return /* reexport */ PostSyncStatus; },
"PostSyncStatusModal": function() { return /* reexport */ PostSyncStatusModal; },
"PostTaxonomies": function() { return /* reexport */ post_taxonomies; }, "PostTaxonomies": function() { return /* reexport */ post_taxonomies; },
"PostTaxonomiesCheck": function() { return /* reexport */ post_taxonomies_check; }, "PostTaxonomiesCheck": function() { return /* reexport */ post_taxonomies_check; },
"PostTaxonomiesFlatTermSelector": function() { return /* reexport */ FlatTermSelector; }, "PostTaxonomiesFlatTermSelector": function() { return /* reexport */ FlatTermSelector; },
@ -11603,6 +11604,8 @@ function PostSwitchToDraftButton({
/** /**
* Internal dependencies * Internal dependencies
*/ */
@ -11611,25 +11614,95 @@ function PostSwitchToDraftButton({
function PostSyncStatus() { function PostSyncStatus() {
const { const {
syncStatus, syncStatus,
postType postType,
meta
} = (0,external_wp_data_namespaceObject.useSelect)(select => { } = (0,external_wp_data_namespaceObject.useSelect)(select => {
const { const {
getEditedPostAttribute getEditedPostAttribute
} = select(store_store); } = select(store_store);
return { return {
syncStatus: getEditedPostAttribute('wp_pattern_sync_status'), syncStatus: getEditedPostAttribute('wp_pattern_sync_status'),
meta: getEditedPostAttribute('meta'),
postType: getEditedPostAttribute('type') postType: getEditedPostAttribute('type')
}; };
}, []); });
if (postType !== 'wp_block') { if (postType !== 'wp_block') {
return null; return null;
} } // When the post is first created, the top level wp_pattern_sync_status is not set so get meta value instead.
const isFullySynced = !syncStatus;
const currentSyncStatus = meta?.wp_pattern_sync_status === 'unsynced' ? 'unsynced' : syncStatus;
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelRow, { return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelRow, {
className: "edit-post-sync-status" className: "edit-post-sync-status"
}, (0,external_wp_element_namespaceObject.createElement)("span", null, (0,external_wp_i18n_namespaceObject.__)('Sync status')), (0,external_wp_element_namespaceObject.createElement)("div", null, isFullySynced ? (0,external_wp_i18n_namespaceObject.__)('Fully synced') : (0,external_wp_i18n_namespaceObject.__)('Not synced'))); }, (0,external_wp_element_namespaceObject.createElement)("span", null, (0,external_wp_i18n_namespaceObject.__)('Sync status')), (0,external_wp_element_namespaceObject.createElement)("div", null, currentSyncStatus === 'unsynced' ? (0,external_wp_i18n_namespaceObject.__)('Not synced') : (0,external_wp_i18n_namespaceObject.__)('Fully synced')));
}
function PostSyncStatusModal() {
const {
editPost
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
const [isModalOpen, setIsModalOpen] = (0,external_wp_element_namespaceObject.useState)(false);
const [syncType, setSyncType] = (0,external_wp_element_namespaceObject.useState)(undefined);
const {
postType,
isNewPost
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getEditedPostAttribute,
isCleanNewPost
} = select(store_store);
return {
postType: getEditedPostAttribute('type'),
isNewPost: isCleanNewPost()
};
}, []);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (isNewPost && postType === 'wp_block') {
setIsModalOpen(true);
} // We only want the modal to open when the page is first loaded.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
const setSyncStatus = () => {
editPost({
meta: {
wp_pattern_sync_status: syncType
}
});
};
if (postType !== 'wp_block' || !isNewPost) {
return null;
}
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, isModalOpen && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
title: (0,external_wp_i18n_namespaceObject.__)('Set pattern sync status'),
onRequestClose: () => {
setIsModalOpen(false);
},
overlayClassName: "reusable-blocks-menu-items__convert-modal"
}, (0,external_wp_element_namespaceObject.createElement)("form", {
onSubmit: event => {
event.preventDefault();
setIsModalOpen(false);
setSyncStatus();
}
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalVStack, {
spacing: "5"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.ReusableBlocksRenameHint, null), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
label: (0,external_wp_i18n_namespaceObject.__)('Synced'),
help: (0,external_wp_i18n_namespaceObject.__)('Editing the pattern will update it anywhere it is used.'),
checked: !syncType,
onChange: () => {
setSyncType(!syncType ? 'unsynced' : undefined);
}
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
justify: "right"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
variant: "primary",
type: "submit"
}, (0,external_wp_i18n_namespaceObject.__)('Create')))))));
} }
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-taxonomies/index.js ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-taxonomies/index.js

File diff suppressed because one or more lines are too long

View File

@ -935,7 +935,7 @@ function InlineLinkUI({
function createButtonText(searchTerm) { function createButtonText(searchTerm) {
return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: search term. */ /* translators: %s: search term. */
(0,external_wp_i18n_namespaceObject.__)('Create Page: <mark>%s</mark>'), searchTerm), { (0,external_wp_i18n_namespaceObject.__)('Create page: <mark>%s</mark>'), searchTerm), {
mark: (0,external_wp_element_namespaceObject.createElement)("mark", null) mark: (0,external_wp_element_namespaceObject.createElement)("mark", null)
}); });
} }

File diff suppressed because one or more lines are too long

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.3-beta4-56228'; $wp_version = '6.3-beta4-56229';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.