Update the WP packages with fixes prior to WP 6.2 beta 3
Includes the following changes:
- Upgrade Playwright to 1.30.0
- [Block Editor - Inserter]: preload media categories empty check - client side
- Navigation: Fixes undo and redo for nesting operations in the navigation block's inspector
- Fix: OffCanvasEditor does not inserts submenu on collapsed items.
- OffCanvasEditor: Only allow some blocks to be converted to submenus
- Navigation: Updates "Add Submenu item" text to "Add Submenu link"
- Update: Make OffCanvasEditor use LeafMoreMenu by default.
- Template Part: Performance: Replace usage of wp_get_theme()->get_stylesheet() with get_stylesheet()
- Widget Editor: Fix a problem with 'Move to Widget Area' button not working
- Reusable Blocks: Use React 18 rendering for import dropdown
- useAsyncList: flush state updates when processing queue
- Refactor the site editor URLs for better backward compatibility
- Template editor: only disable the save button if no changes rather than hiding it
- [Quote]: Fix deprectated large style specificity rule
- Style Book: Allow button text labels for style book icon
- List View: Scroll selected block into view when single block selection changes
- Post editor: revert iframed editor for WP core only
- Fix the Publish region position and focus style.
- Remove "& Shadow" from the Border ScreenHeader title
- Site editor: specify focus state color for template navigation button
References: [1e2b2f680c
Gutenberg's commit for publishing the packages]
Props ntsekouras, ellatrix.
See #57471.
Built from https://develop.svn.wordpress.org/trunk@55392
git-svn-id: http://core.svn.wordpress.org/trunk@54925 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
770f413fe7
commit
2b08f8960b
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -2,16 +2,16 @@
|
|||
box-sizing:border-box;
|
||||
overflow-wrap:break-word;
|
||||
}
|
||||
.wp-block-quote.is-large:not(.is-style-plain),.wp-block-quote.is-style-large:not(.is-style-plain){
|
||||
.wp-block-quote.is-large:where(:not(.is-style-plain)),.wp-block-quote.is-style-large:where(:not(.is-style-plain)){
|
||||
margin-bottom:1em;
|
||||
padding:0 1em;
|
||||
}
|
||||
.wp-block-quote.is-large:not(.is-style-plain) p,.wp-block-quote.is-style-large:not(.is-style-plain) p{
|
||||
.wp-block-quote.is-large:where(:not(.is-style-plain)) p,.wp-block-quote.is-style-large:where(:not(.is-style-plain)) p{
|
||||
font-size:1.5em;
|
||||
font-style:italic;
|
||||
line-height:1.6;
|
||||
}
|
||||
.wp-block-quote.is-large:not(.is-style-plain) cite,.wp-block-quote.is-large:not(.is-style-plain) footer,.wp-block-quote.is-style-large:not(.is-style-plain) cite,.wp-block-quote.is-style-large:not(.is-style-plain) footer{
|
||||
.wp-block-quote.is-large:where(:not(.is-style-plain)) cite,.wp-block-quote.is-large:where(:not(.is-style-plain)) footer,.wp-block-quote.is-style-large:where(:not(.is-style-plain)) cite,.wp-block-quote.is-style-large:where(:not(.is-style-plain)) footer{
|
||||
font-size:1.125em;
|
||||
text-align:left;
|
||||
}
|
|
@ -1 +1 @@
|
|||
.wp-block-quote{box-sizing:border-box;overflow-wrap:break-word}.wp-block-quote.is-large:not(.is-style-plain),.wp-block-quote.is-style-large:not(.is-style-plain){margin-bottom:1em;padding:0 1em}.wp-block-quote.is-large:not(.is-style-plain) p,.wp-block-quote.is-style-large:not(.is-style-plain) p{font-size:1.5em;font-style:italic;line-height:1.6}.wp-block-quote.is-large:not(.is-style-plain) cite,.wp-block-quote.is-large:not(.is-style-plain) footer,.wp-block-quote.is-style-large:not(.is-style-plain) cite,.wp-block-quote.is-style-large:not(.is-style-plain) footer{font-size:1.125em;text-align:left}
|
||||
.wp-block-quote{box-sizing:border-box;overflow-wrap:break-word}.wp-block-quote.is-large:where(:not(.is-style-plain)),.wp-block-quote.is-style-large:where(:not(.is-style-plain)){margin-bottom:1em;padding:0 1em}.wp-block-quote.is-large:where(:not(.is-style-plain)) p,.wp-block-quote.is-style-large:where(:not(.is-style-plain)) p{font-size:1.5em;font-style:italic;line-height:1.6}.wp-block-quote.is-large:where(:not(.is-style-plain)) cite,.wp-block-quote.is-large:where(:not(.is-style-plain)) footer,.wp-block-quote.is-style-large:where(:not(.is-style-plain)) cite,.wp-block-quote.is-style-large:where(:not(.is-style-plain)) footer{font-size:1.125em;text-align:left}
|
|
@ -2,16 +2,16 @@
|
|||
box-sizing:border-box;
|
||||
overflow-wrap:break-word;
|
||||
}
|
||||
.wp-block-quote.is-large:not(.is-style-plain),.wp-block-quote.is-style-large:not(.is-style-plain){
|
||||
.wp-block-quote.is-large:where(:not(.is-style-plain)),.wp-block-quote.is-style-large:where(:not(.is-style-plain)){
|
||||
margin-bottom:1em;
|
||||
padding:0 1em;
|
||||
}
|
||||
.wp-block-quote.is-large:not(.is-style-plain) p,.wp-block-quote.is-style-large:not(.is-style-plain) p{
|
||||
.wp-block-quote.is-large:where(:not(.is-style-plain)) p,.wp-block-quote.is-style-large:where(:not(.is-style-plain)) p{
|
||||
font-size:1.5em;
|
||||
font-style:italic;
|
||||
line-height:1.6;
|
||||
}
|
||||
.wp-block-quote.is-large:not(.is-style-plain) cite,.wp-block-quote.is-large:not(.is-style-plain) footer,.wp-block-quote.is-style-large:not(.is-style-plain) cite,.wp-block-quote.is-style-large:not(.is-style-plain) footer{
|
||||
.wp-block-quote.is-large:where(:not(.is-style-plain)) cite,.wp-block-quote.is-large:where(:not(.is-style-plain)) footer,.wp-block-quote.is-style-large:where(:not(.is-style-plain)) cite,.wp-block-quote.is-style-large:where(:not(.is-style-plain)) footer{
|
||||
font-size:1.125em;
|
||||
text-align:right;
|
||||
}
|
|
@ -1 +1 @@
|
|||
.wp-block-quote{box-sizing:border-box;overflow-wrap:break-word}.wp-block-quote.is-large:not(.is-style-plain),.wp-block-quote.is-style-large:not(.is-style-plain){margin-bottom:1em;padding:0 1em}.wp-block-quote.is-large:not(.is-style-plain) p,.wp-block-quote.is-style-large:not(.is-style-plain) p{font-size:1.5em;font-style:italic;line-height:1.6}.wp-block-quote.is-large:not(.is-style-plain) cite,.wp-block-quote.is-large:not(.is-style-plain) footer,.wp-block-quote.is-style-large:not(.is-style-plain) cite,.wp-block-quote.is-style-large:not(.is-style-plain) footer{font-size:1.125em;text-align:right}
|
||||
.wp-block-quote{box-sizing:border-box;overflow-wrap:break-word}.wp-block-quote.is-large:where(:not(.is-style-plain)),.wp-block-quote.is-style-large:where(:not(.is-style-plain)){margin-bottom:1em;padding:0 1em}.wp-block-quote.is-large:where(:not(.is-style-plain)) p,.wp-block-quote.is-style-large:where(:not(.is-style-plain)) p{font-size:1.5em;font-style:italic;line-height:1.6}.wp-block-quote.is-large:where(:not(.is-style-plain)) cite,.wp-block-quote.is-large:where(:not(.is-style-plain)) footer,.wp-block-quote.is-style-large:where(:not(.is-style-plain)) cite,.wp-block-quote.is-style-large:where(:not(.is-style-plain)) footer{font-size:1.125em;text-align:right}
|
|
@ -22,7 +22,7 @@ function render_block_core_template_part( $attributes ) {
|
|||
if (
|
||||
isset( $attributes['slug'] ) &&
|
||||
isset( $attributes['theme'] ) &&
|
||||
wp_get_theme()->get_stylesheet() === $attributes['theme']
|
||||
get_stylesheet() === $attributes['theme']
|
||||
) {
|
||||
$template_part_id = $attributes['theme'] . '//' . $attributes['slug'];
|
||||
$template_part_query = new WP_Query(
|
||||
|
|
|
@ -2177,16 +2177,16 @@ p.has-background{
|
|||
.wp-block-quote{
|
||||
overflow-wrap:break-word;
|
||||
}
|
||||
.wp-block-quote.is-large:not(.is-style-plain),.wp-block-quote.is-style-large:not(.is-style-plain){
|
||||
.wp-block-quote.is-large:where(:not(.is-style-plain)),.wp-block-quote.is-style-large:where(:not(.is-style-plain)){
|
||||
margin-bottom:1em;
|
||||
padding:0 1em;
|
||||
}
|
||||
.wp-block-quote.is-large:not(.is-style-plain) p,.wp-block-quote.is-style-large:not(.is-style-plain) p{
|
||||
.wp-block-quote.is-large:where(:not(.is-style-plain)) p,.wp-block-quote.is-style-large:where(:not(.is-style-plain)) p{
|
||||
font-size:1.5em;
|
||||
font-style:italic;
|
||||
line-height:1.6;
|
||||
}
|
||||
.wp-block-quote.is-large:not(.is-style-plain) cite,.wp-block-quote.is-large:not(.is-style-plain) footer,.wp-block-quote.is-style-large:not(.is-style-plain) cite,.wp-block-quote.is-style-large:not(.is-style-plain) footer{
|
||||
.wp-block-quote.is-large:where(:not(.is-style-plain)) cite,.wp-block-quote.is-large:where(:not(.is-style-plain)) footer,.wp-block-quote.is-style-large:where(:not(.is-style-plain)) cite,.wp-block-quote.is-style-large:where(:not(.is-style-plain)) footer{
|
||||
font-size:1.125em;
|
||||
text-align:left;
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -2173,16 +2173,16 @@ p.has-background{
|
|||
.wp-block-quote{
|
||||
overflow-wrap:break-word;
|
||||
}
|
||||
.wp-block-quote.is-large:not(.is-style-plain),.wp-block-quote.is-style-large:not(.is-style-plain){
|
||||
.wp-block-quote.is-large:where(:not(.is-style-plain)),.wp-block-quote.is-style-large:where(:not(.is-style-plain)){
|
||||
margin-bottom:1em;
|
||||
padding:0 1em;
|
||||
}
|
||||
.wp-block-quote.is-large:not(.is-style-plain) p,.wp-block-quote.is-style-large:not(.is-style-plain) p{
|
||||
.wp-block-quote.is-large:where(:not(.is-style-plain)) p,.wp-block-quote.is-style-large:where(:not(.is-style-plain)) p{
|
||||
font-size:1.5em;
|
||||
font-style:italic;
|
||||
line-height:1.6;
|
||||
}
|
||||
.wp-block-quote.is-large:not(.is-style-plain) cite,.wp-block-quote.is-large:not(.is-style-plain) footer,.wp-block-quote.is-style-large:not(.is-style-plain) cite,.wp-block-quote.is-style-large:not(.is-style-plain) footer{
|
||||
.wp-block-quote.is-large:where(:not(.is-style-plain)) cite,.wp-block-quote.is-large:where(:not(.is-style-plain)) footer,.wp-block-quote.is-style-large:where(:not(.is-style-plain)) cite,.wp-block-quote.is-style-large:where(:not(.is-style-plain)) footer{
|
||||
font-size:1.125em;
|
||||
text-align:right;
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1497,7 +1497,7 @@ body.is-dragging-components-draggable{
|
|||
top:0;
|
||||
z-index:1000000;
|
||||
}
|
||||
.is-focusing-regions .editor-post-publish-panel,.is-focusing-regions .interface-interface-skeleton__actions .edit-post-layout__toggle-publish-panel,.is-focusing-regions .interface-interface-skeleton__sidebar .edit-post-layout__toggle-sidebar-panel,.is-focusing-regions [role=region]:focus:after,.is-focusing-regions.is-distraction-free .interface-interface-skeleton__header .edit-post-header{
|
||||
.is-focusing-regions .editor-post-publish-panel,.is-focusing-regions .interface-interface-skeleton__actions .edit-post-layout__toggle-entities-saved-states-panel,.is-focusing-regions .interface-interface-skeleton__actions .edit-post-layout__toggle-publish-panel,.is-focusing-regions .interface-interface-skeleton__sidebar .edit-post-layout__toggle-sidebar-panel,.is-focusing-regions [role=region]:focus:after,.is-focusing-regions.is-distraction-free .interface-interface-skeleton__header .edit-post-header{
|
||||
outline:4px solid var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));
|
||||
outline-offset:-4px;
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1497,7 +1497,7 @@ body.is-dragging-components-draggable{
|
|||
top:0;
|
||||
z-index:1000000;
|
||||
}
|
||||
.is-focusing-regions .editor-post-publish-panel,.is-focusing-regions .interface-interface-skeleton__actions .edit-post-layout__toggle-publish-panel,.is-focusing-regions .interface-interface-skeleton__sidebar .edit-post-layout__toggle-sidebar-panel,.is-focusing-regions [role=region]:focus:after,.is-focusing-regions.is-distraction-free .interface-interface-skeleton__header .edit-post-header{
|
||||
.is-focusing-regions .editor-post-publish-panel,.is-focusing-regions .interface-interface-skeleton__actions .edit-post-layout__toggle-entities-saved-states-panel,.is-focusing-regions .interface-interface-skeleton__actions .edit-post-layout__toggle-publish-panel,.is-focusing-regions .interface-interface-skeleton__sidebar .edit-post-layout__toggle-sidebar-panel,.is-focusing-regions [role=region]:focus:after,.is-focusing-regions.is-distraction-free .interface-interface-skeleton__header .edit-post-header{
|
||||
outline:4px solid var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));
|
||||
outline-offset:-4px;
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -305,14 +305,17 @@ body.is-fullscreen-mode .interface-interface-skeleton{
|
|||
}
|
||||
.interface-interface-skeleton__actions:focus,.interface-interface-skeleton__actions:focus-within{
|
||||
bottom:0;
|
||||
top:auto;
|
||||
}
|
||||
.is-entity-save-view-open .interface-interface-skeleton__actions:focus,.is-entity-save-view-open .interface-interface-skeleton__actions:focus-within{
|
||||
top:46px;
|
||||
}
|
||||
@media (min-width:782px){
|
||||
.interface-interface-skeleton__actions:focus,.interface-interface-skeleton__actions:focus-within{
|
||||
.is-entity-save-view-open .interface-interface-skeleton__actions:focus,.is-entity-save-view-open .interface-interface-skeleton__actions:focus-within{
|
||||
border-right:1px solid #ddd;
|
||||
top:32px;
|
||||
}
|
||||
.is-fullscreen-mode .interface-interface-skeleton__actions:focus,.is-fullscreen-mode .interface-interface-skeleton__actions:focus-within{
|
||||
.is-fullscreen-mode .is-entity-save-view-open .interface-interface-skeleton__actions:focus,.is-fullscreen-mode .is-entity-save-view-open .interface-interface-skeleton__actions:focus-within{
|
||||
top:0;
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -305,14 +305,17 @@ body.is-fullscreen-mode .interface-interface-skeleton{
|
|||
}
|
||||
.interface-interface-skeleton__actions:focus,.interface-interface-skeleton__actions:focus-within{
|
||||
bottom:0;
|
||||
top:auto;
|
||||
}
|
||||
.is-entity-save-view-open .interface-interface-skeleton__actions:focus,.is-entity-save-view-open .interface-interface-skeleton__actions:focus-within{
|
||||
top:46px;
|
||||
}
|
||||
@media (min-width:782px){
|
||||
.interface-interface-skeleton__actions:focus,.interface-interface-skeleton__actions:focus-within{
|
||||
.is-entity-save-view-open .interface-interface-skeleton__actions:focus,.is-entity-save-view-open .interface-interface-skeleton__actions:focus-within{
|
||||
border-left:1px solid #ddd;
|
||||
top:32px;
|
||||
}
|
||||
.is-fullscreen-mode .interface-interface-skeleton__actions:focus,.is-fullscreen-mode .interface-interface-skeleton__actions:focus-within{
|
||||
.is-fullscreen-mode .is-entity-save-view-open .interface-interface-skeleton__actions:focus,.is-fullscreen-mode .is-entity-save-view-open .interface-interface-skeleton__actions:focus-within{
|
||||
top:0;
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -305,14 +305,17 @@ body.is-fullscreen-mode .interface-interface-skeleton{
|
|||
}
|
||||
.interface-interface-skeleton__actions:focus,.interface-interface-skeleton__actions:focus-within{
|
||||
bottom:0;
|
||||
top:auto;
|
||||
}
|
||||
.is-entity-save-view-open .interface-interface-skeleton__actions:focus,.is-entity-save-view-open .interface-interface-skeleton__actions:focus-within{
|
||||
top:46px;
|
||||
}
|
||||
@media (min-width:782px){
|
||||
.interface-interface-skeleton__actions:focus,.interface-interface-skeleton__actions:focus-within{
|
||||
.is-entity-save-view-open .interface-interface-skeleton__actions:focus,.is-entity-save-view-open .interface-interface-skeleton__actions:focus-within{
|
||||
border-right:1px solid #ddd;
|
||||
top:32px;
|
||||
}
|
||||
.is-fullscreen-mode .interface-interface-skeleton__actions:focus,.is-fullscreen-mode .interface-interface-skeleton__actions:focus-within{
|
||||
.is-fullscreen-mode .is-entity-save-view-open .interface-interface-skeleton__actions:focus,.is-fullscreen-mode .is-entity-save-view-open .interface-interface-skeleton__actions:focus-within{
|
||||
top:0;
|
||||
}
|
||||
}
|
||||
|
@ -1544,6 +1547,14 @@ body.is-fullscreen-mode .edit-site-list-header{
|
|||
margin:0;
|
||||
}
|
||||
|
||||
.show-icon-labels .edit-site-global-styles-sidebar__header .components-button.has-icon svg{
|
||||
display:none;
|
||||
}
|
||||
.show-icon-labels .edit-site-global-styles-sidebar__header .components-button.has-icon:after{
|
||||
content:attr(aria-label);
|
||||
font-size:12px;
|
||||
}
|
||||
|
||||
.components-panel__header.edit-site-sidebar-edit-mode__panel-tabs{
|
||||
border-top:0;
|
||||
justify-content:flex-start;
|
||||
|
@ -1694,10 +1705,6 @@ h3.edit-site-template-card__template-areas-title{
|
|||
padding:24px;
|
||||
width:280px;
|
||||
}
|
||||
.edit-site-layout__actions:focus .edit-site-editor__toggle-save-panel,.edit-site-layout__actions:focus-within .edit-site-editor__toggle-save-panel{
|
||||
bottom:0;
|
||||
top:auto;
|
||||
}
|
||||
|
||||
.edit-site .components-editor-notices__snackbar{
|
||||
bottom:40px;
|
||||
|
@ -2156,6 +2163,9 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
|
|||
}
|
||||
.edit-site-layout__actions:focus,.edit-site-layout__actions:focus-within{
|
||||
bottom:0;
|
||||
top:auto;
|
||||
}
|
||||
.edit-site-layout__actions.is-entity-save-view-open:focus,.edit-site-layout__actions.is-entity-save-view-open:focus-within{
|
||||
top:0;
|
||||
}
|
||||
@media (min-width:782px){
|
||||
|
@ -2279,7 +2289,7 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
|
|||
.edit-site-sidebar-navigation-screen__back{
|
||||
color:#e0e0e0;
|
||||
}
|
||||
.edit-site-sidebar-navigation-screen__back:hover,.edit-site-sidebar-navigation-screen__back:not([aria-disabled=true]):active{
|
||||
.edit-site-sidebar-navigation-screen__back:focus,.edit-site-sidebar-navigation-screen__back:hover,.edit-site-sidebar-navigation-screen__back:not([aria-disabled=true]):active{
|
||||
color:#fff;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -305,14 +305,17 @@ body.is-fullscreen-mode .interface-interface-skeleton{
|
|||
}
|
||||
.interface-interface-skeleton__actions:focus,.interface-interface-skeleton__actions:focus-within{
|
||||
bottom:0;
|
||||
top:auto;
|
||||
}
|
||||
.is-entity-save-view-open .interface-interface-skeleton__actions:focus,.is-entity-save-view-open .interface-interface-skeleton__actions:focus-within{
|
||||
top:46px;
|
||||
}
|
||||
@media (min-width:782px){
|
||||
.interface-interface-skeleton__actions:focus,.interface-interface-skeleton__actions:focus-within{
|
||||
.is-entity-save-view-open .interface-interface-skeleton__actions:focus,.is-entity-save-view-open .interface-interface-skeleton__actions:focus-within{
|
||||
border-left:1px solid #ddd;
|
||||
top:32px;
|
||||
}
|
||||
.is-fullscreen-mode .interface-interface-skeleton__actions:focus,.is-fullscreen-mode .interface-interface-skeleton__actions:focus-within{
|
||||
.is-fullscreen-mode .is-entity-save-view-open .interface-interface-skeleton__actions:focus,.is-fullscreen-mode .is-entity-save-view-open .interface-interface-skeleton__actions:focus-within{
|
||||
top:0;
|
||||
}
|
||||
}
|
||||
|
@ -1544,6 +1547,14 @@ body.is-fullscreen-mode .edit-site-list-header{
|
|||
margin:0;
|
||||
}
|
||||
|
||||
.show-icon-labels .edit-site-global-styles-sidebar__header .components-button.has-icon svg{
|
||||
display:none;
|
||||
}
|
||||
.show-icon-labels .edit-site-global-styles-sidebar__header .components-button.has-icon:after{
|
||||
content:attr(aria-label);
|
||||
font-size:12px;
|
||||
}
|
||||
|
||||
.components-panel__header.edit-site-sidebar-edit-mode__panel-tabs{
|
||||
border-top:0;
|
||||
justify-content:flex-start;
|
||||
|
@ -1694,10 +1705,6 @@ h3.edit-site-template-card__template-areas-title{
|
|||
padding:24px;
|
||||
width:280px;
|
||||
}
|
||||
.edit-site-layout__actions:focus .edit-site-editor__toggle-save-panel,.edit-site-layout__actions:focus-within .edit-site-editor__toggle-save-panel{
|
||||
bottom:0;
|
||||
top:auto;
|
||||
}
|
||||
|
||||
.edit-site .components-editor-notices__snackbar{
|
||||
bottom:40px;
|
||||
|
@ -2156,6 +2163,9 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
|
|||
}
|
||||
.edit-site-layout__actions:focus,.edit-site-layout__actions:focus-within{
|
||||
bottom:0;
|
||||
top:auto;
|
||||
}
|
||||
.edit-site-layout__actions.is-entity-save-view-open:focus,.edit-site-layout__actions.is-entity-save-view-open:focus-within{
|
||||
top:0;
|
||||
}
|
||||
@media (min-width:782px){
|
||||
|
@ -2279,7 +2289,7 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
|
|||
.edit-site-sidebar-navigation-screen__back{
|
||||
color:#e0e0e0;
|
||||
}
|
||||
.edit-site-sidebar-navigation-screen__back:hover,.edit-site-sidebar-navigation-screen__back:not([aria-disabled=true]):active{
|
||||
.edit-site-sidebar-navigation-screen__back:focus,.edit-site-sidebar-navigation-screen__back:hover,.edit-site-sidebar-navigation-screen__back:not([aria-disabled=true]):active{
|
||||
color:#fff;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -305,14 +305,17 @@ body.is-fullscreen-mode .interface-interface-skeleton{
|
|||
}
|
||||
.interface-interface-skeleton__actions:focus,.interface-interface-skeleton__actions:focus-within{
|
||||
bottom:0;
|
||||
top:auto;
|
||||
}
|
||||
.is-entity-save-view-open .interface-interface-skeleton__actions:focus,.is-entity-save-view-open .interface-interface-skeleton__actions:focus-within{
|
||||
top:46px;
|
||||
}
|
||||
@media (min-width:782px){
|
||||
.interface-interface-skeleton__actions:focus,.interface-interface-skeleton__actions:focus-within{
|
||||
.is-entity-save-view-open .interface-interface-skeleton__actions:focus,.is-entity-save-view-open .interface-interface-skeleton__actions:focus-within{
|
||||
border-right:1px solid #ddd;
|
||||
top:32px;
|
||||
}
|
||||
.is-fullscreen-mode .interface-interface-skeleton__actions:focus,.is-fullscreen-mode .interface-interface-skeleton__actions:focus-within{
|
||||
.is-fullscreen-mode .is-entity-save-view-open .interface-interface-skeleton__actions:focus,.is-fullscreen-mode .is-entity-save-view-open .interface-interface-skeleton__actions:focus-within{
|
||||
top:0;
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -305,14 +305,17 @@ body.is-fullscreen-mode .interface-interface-skeleton{
|
|||
}
|
||||
.interface-interface-skeleton__actions:focus,.interface-interface-skeleton__actions:focus-within{
|
||||
bottom:0;
|
||||
top:auto;
|
||||
}
|
||||
.is-entity-save-view-open .interface-interface-skeleton__actions:focus,.is-entity-save-view-open .interface-interface-skeleton__actions:focus-within{
|
||||
top:46px;
|
||||
}
|
||||
@media (min-width:782px){
|
||||
.interface-interface-skeleton__actions:focus,.interface-interface-skeleton__actions:focus-within{
|
||||
.is-entity-save-view-open .interface-interface-skeleton__actions:focus,.is-entity-save-view-open .interface-interface-skeleton__actions:focus-within{
|
||||
border-left:1px solid #ddd;
|
||||
top:32px;
|
||||
}
|
||||
.is-fullscreen-mode .interface-interface-skeleton__actions:focus,.is-fullscreen-mode .interface-interface-skeleton__actions:focus-within{
|
||||
.is-fullscreen-mode .is-entity-save-view-open .interface-interface-skeleton__actions:focus,.is-fullscreen-mode .is-entity-save-view-open .interface-interface-skeleton__actions:focus-within{
|
||||
top:0;
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -29699,15 +29699,18 @@ function InserterMenu(_ref, ref) {
|
|||
});
|
||||
const {
|
||||
showPatterns,
|
||||
inserterItems
|
||||
inserterItems,
|
||||
enableOpenverseMediaCategory
|
||||
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
||||
const {
|
||||
__experimentalGetAllowedPatterns,
|
||||
getInserterItems
|
||||
getInserterItems,
|
||||
getSettings
|
||||
} = select(store);
|
||||
return {
|
||||
showPatterns: !!__experimentalGetAllowedPatterns(destinationRootClientId).length,
|
||||
inserterItems: getInserterItems(destinationRootClientId)
|
||||
inserterItems: getInserterItems(destinationRootClientId),
|
||||
enableOpenverseMediaCategory: getSettings().enableOpenverseMediaCategory
|
||||
};
|
||||
}, [destinationRootClientId]);
|
||||
const hasReusableBlocks = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
||||
|
@ -29719,7 +29722,7 @@ function InserterMenu(_ref, ref) {
|
|||
});
|
||||
}, [inserterItems]);
|
||||
const mediaCategories = useMediaCategories(destinationRootClientId);
|
||||
const showMedia = !!mediaCategories.length;
|
||||
const showMedia = !!mediaCategories.length || enableOpenverseMediaCategory;
|
||||
const onInsert = (0,external_wp_element_namespaceObject.useCallback)((blocks, meta, shouldForceFocusBlock) => {
|
||||
onInsertBlocks(blocks, meta, shouldForceFocusBlock);
|
||||
onSelect();
|
||||
|
@ -45819,13 +45822,15 @@ const listView = (0,external_wp_element_namespaceObject.createElement)(external_
|
|||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
||||
|
||||
const AnimatedTreeGridRow = animated(external_wp_components_namespaceObject.__experimentalTreeGridRow);
|
||||
function ListViewLeaf(_ref) {
|
||||
const ListViewLeaf = (0,external_wp_element_namespaceObject.forwardRef)((_ref, ref) => {
|
||||
let {
|
||||
isSelected,
|
||||
position,
|
||||
|
@ -45836,19 +45841,64 @@ function ListViewLeaf(_ref) {
|
|||
path,
|
||||
...props
|
||||
} = _ref;
|
||||
const ref = use_moving_animation({
|
||||
const animationRef = use_moving_animation({
|
||||
isSelected,
|
||||
adjustScrolling: false,
|
||||
enableAnimation: true,
|
||||
triggerAnimationOnChange: path
|
||||
});
|
||||
const mergedRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, animationRef]);
|
||||
return (0,external_wp_element_namespaceObject.createElement)(AnimatedTreeGridRow, _extends({
|
||||
ref: ref,
|
||||
ref: mergedRef,
|
||||
className: classnames_default()('block-editor-list-view-leaf', className),
|
||||
level: level,
|
||||
positionInSet: position,
|
||||
setSize: rowCount
|
||||
}, props), children);
|
||||
});
|
||||
/* harmony default export */ var leaf = (ListViewLeaf);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/use-list-view-scroll-into-view.js
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
|
||||
function useListViewScrollIntoView(_ref) {
|
||||
let {
|
||||
isSelected,
|
||||
selectedClientIds,
|
||||
rowItemRef
|
||||
} = _ref;
|
||||
const isSingleSelection = selectedClientIds.length === 1;
|
||||
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
|
||||
// Skip scrolling into view if this particular block isn't selected,
|
||||
// or if more than one block is selected overall. This is to avoid
|
||||
// scrolling the view in a multi selection where the user has intentionally
|
||||
// selected multiple blocks within the list view, but the initially
|
||||
// selected block may be out of view.
|
||||
if (!isSelected || !isSingleSelection || !rowItemRef.current) {
|
||||
return;
|
||||
}
|
||||
|
||||
const scrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(rowItemRef.current);
|
||||
const {
|
||||
ownerDocument
|
||||
} = rowItemRef.current;
|
||||
const windowScroll = scrollContainer === ownerDocument.body || scrollContainer === ownerDocument.documentElement; // If the there is no scroll container, of if the scroll container is the window,
|
||||
// do not scroll into view, as the block is already in view.
|
||||
|
||||
if (windowScroll || !scrollContainer) {
|
||||
return;
|
||||
}
|
||||
|
||||
const rowRect = rowItemRef.current.getBoundingClientRect();
|
||||
const scrollContainerRect = scrollContainer.getBoundingClientRect(); // If the selected block is not currently visible, scroll to it.
|
||||
|
||||
if (rowRect.top < scrollContainerRect.top || rowRect.bottom > scrollContainerRect.bottom) {
|
||||
rowItemRef.current.scrollIntoView();
|
||||
}
|
||||
}, [isSelected, isSingleSelection, rowItemRef]);
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/lock-small.js
|
||||
|
@ -46189,6 +46239,7 @@ function getCommonDepthClientIds(startId, endId, startParents, endParents) {
|
|||
|
||||
|
||||
|
||||
|
||||
function ListViewBlock(_ref) {
|
||||
let {
|
||||
block,
|
||||
|
@ -46208,6 +46259,7 @@ function ListViewBlock(_ref) {
|
|||
isSyncedBranch
|
||||
} = _ref;
|
||||
const cellRef = (0,external_wp_element_namespaceObject.useRef)(null);
|
||||
const rowRef = (0,external_wp_element_namespaceObject.useRef)(null);
|
||||
const [isHovered, setIsHovered] = (0,external_wp_element_namespaceObject.useState)(false);
|
||||
const {
|
||||
clientId
|
||||
|
@ -46323,8 +46375,16 @@ function ListViewBlock(_ref) {
|
|||
// to alter a block that isn't part of the selection, they're still able
|
||||
// to do so.
|
||||
|
||||
const dropdownClientIds = selectedClientIds.includes(clientId) ? selectedClientIds : [clientId];
|
||||
return (0,external_wp_element_namespaceObject.createElement)(ListViewLeaf, {
|
||||
const dropdownClientIds = selectedClientIds.includes(clientId) ? selectedClientIds : [clientId]; // Pass in a ref to the row, so that it can be scrolled
|
||||
// into view when selected. For long lists, the placeholder for the
|
||||
// selected block is also observed, within ListViewLeafPlaceholder.
|
||||
|
||||
useListViewScrollIntoView({
|
||||
isSelected,
|
||||
rowItemRef: rowRef,
|
||||
selectedClientIds
|
||||
});
|
||||
return (0,external_wp_element_namespaceObject.createElement)(leaf, {
|
||||
className: classes,
|
||||
onMouseEnter: onMouseEnter,
|
||||
onMouseLeave: onMouseLeave,
|
||||
|
@ -46337,7 +46397,8 @@ function ListViewBlock(_ref) {
|
|||
id: `list-view-block-${clientId}`,
|
||||
"data-block": clientId,
|
||||
isExpanded: canExpand ? isExpanded : undefined,
|
||||
"aria-selected": !!isSelected || forceSelectionContentLock
|
||||
"aria-selected": !!isSelected || forceSelectionContentLock,
|
||||
ref: rowRef
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTreeGridCell, {
|
||||
className: "block-editor-list-view-block__contents-cell",
|
||||
colSpan: colSpan,
|
||||
|
@ -46556,12 +46617,12 @@ function ListViewBranch(props) {
|
|||
const updatedPath = path.length > 0 ? `${path}_${position}` : `${position}`;
|
||||
const hasNestedBlocks = !!(innerBlocks !== null && innerBlocks !== void 0 && innerBlocks.length);
|
||||
const shouldExpand = hasNestedBlocks && shouldShowInnerBlocks ? (_expandedState$client = expandedState[clientId]) !== null && _expandedState$client !== void 0 ? _expandedState$client : isExpanded : undefined;
|
||||
const isDragged = !!(draggedClientIds !== null && draggedClientIds !== void 0 && draggedClientIds.includes(clientId));
|
||||
const showBlock = isDragged || blockInView; // Make updates to the selected or dragged blocks synchronous,
|
||||
const isDragged = !!(draggedClientIds !== null && draggedClientIds !== void 0 && draggedClientIds.includes(clientId)); // Make updates to the selected or dragged blocks synchronous,
|
||||
// but asynchronous for any other block.
|
||||
|
||||
const isSelected = isClientIdSelected(clientId, selectedClientIds);
|
||||
const isSelectedBranch = isBranchSelected || isSelected && hasNestedBlocks;
|
||||
const showBlock = isDragged || blockInView || isSelected;
|
||||
return (0,external_wp_element_namespaceObject.createElement)(external_wp_data_namespaceObject.AsyncModeProvider, {
|
||||
key: clientId,
|
||||
value: !isSelected
|
||||
|
@ -61720,6 +61781,130 @@ function OffCanvasEditor(_ref, ref) {
|
|||
|
||||
/* harmony default export */ var off_canvas_editor = ((0,external_wp_element_namespaceObject.forwardRef)(OffCanvasEditor));
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/add-submenu.js
|
||||
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
const addSubmenu = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
||||
xmlns: "http://www.w3.org/2000/svg",
|
||||
viewBox: "0 0 24 24"
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
||||
d: "M2 12c0 3.6 2.4 5.5 6 5.5h.5V19l3-2.5-3-2.5v2H8c-2.5 0-4.5-1.5-4.5-4s2-4.5 4.5-4.5h3.5V6H8c-3.6 0-6 2.4-6 6zm19.5-1h-8v1.5h8V11zm0 5h-8v1.5h8V16zm0-10h-8v1.5h8V6z"
|
||||
}));
|
||||
/* harmony default export */ var add_submenu = (addSubmenu);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/off-canvas-editor/leaf-more-menu.js
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
const leaf_more_menu_POPOVER_PROPS = {
|
||||
className: 'block-editor-block-settings-menu__popover',
|
||||
position: 'bottom right',
|
||||
variant: 'toolbar'
|
||||
};
|
||||
const BLOCKS_THAT_CAN_BE_CONVERTED_TO_SUBMENU = ['core/navigation-link', 'core/navigation-submenu'];
|
||||
|
||||
function AddSubmenuItem(_ref) {
|
||||
let {
|
||||
block,
|
||||
onClose
|
||||
} = _ref;
|
||||
const {
|
||||
expandedState,
|
||||
expand
|
||||
} = context_useListViewContext();
|
||||
const {
|
||||
insertBlock,
|
||||
replaceBlock,
|
||||
replaceInnerBlocks
|
||||
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
||||
const clientId = block.clientId;
|
||||
const isDisabled = !BLOCKS_THAT_CAN_BE_CONVERTED_TO_SUBMENU.includes(block.name);
|
||||
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
|
||||
icon: add_submenu,
|
||||
disabled: isDisabled,
|
||||
onClick: () => {
|
||||
const updateSelectionOnInsert = false;
|
||||
const newLink = (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link');
|
||||
|
||||
if (block.name === 'core/navigation-submenu') {
|
||||
insertBlock(newLink, block.innerBlocks.length, clientId, updateSelectionOnInsert);
|
||||
} else {
|
||||
// Convert to a submenu if the block currently isn't one.
|
||||
const newSubmenu = (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-submenu', block.attributes, block.innerBlocks); // The following must happen as two independent actions.
|
||||
// Why? Because the offcanvas editor relies on the getLastInsertedBlocksClientIds
|
||||
// selector to determine which block is "active". As the UX needs the newLink to be
|
||||
// the "active" block it must be the last block to be inserted.
|
||||
// Therefore the Submenu is first created and **then** the newLink is inserted
|
||||
// thus ensuring it is the last inserted block.
|
||||
|
||||
replaceBlock(clientId, newSubmenu);
|
||||
replaceInnerBlocks(newSubmenu.clientId, [newLink], updateSelectionOnInsert);
|
||||
}
|
||||
|
||||
if (!expandedState[block.clientId]) {
|
||||
expand(block.clientId);
|
||||
}
|
||||
|
||||
onClose();
|
||||
}
|
||||
}, (0,external_wp_i18n_namespaceObject.__)('Add submenu link'));
|
||||
}
|
||||
|
||||
function LeafMoreMenu(props) {
|
||||
const {
|
||||
clientId,
|
||||
block
|
||||
} = props;
|
||||
const {
|
||||
removeBlocks
|
||||
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
||||
const label = (0,external_wp_i18n_namespaceObject.sprintf)(
|
||||
/* translators: %s: block name */
|
||||
(0,external_wp_i18n_namespaceObject.__)('Remove %s'), BlockTitle({
|
||||
clientId,
|
||||
maximumLength: 25
|
||||
}));
|
||||
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DropdownMenu, _extends({
|
||||
icon: more_vertical,
|
||||
label: (0,external_wp_i18n_namespaceObject.__)('Options'),
|
||||
className: "block-editor-block-settings-menu",
|
||||
popoverProps: leaf_more_menu_POPOVER_PROPS,
|
||||
noIcons: true
|
||||
}, props), _ref2 => {
|
||||
let {
|
||||
onClose
|
||||
} = _ref2;
|
||||
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, null, (0,external_wp_element_namespaceObject.createElement)(AddSubmenuItem, {
|
||||
block: block,
|
||||
onClose: onClose
|
||||
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
|
||||
onClick: () => {
|
||||
removeBlocks([clientId], false);
|
||||
onClose();
|
||||
}
|
||||
}, label));
|
||||
});
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/private-apis.js
|
||||
/**
|
||||
* Internal dependencies
|
||||
|
@ -61728,6 +61913,7 @@ function OffCanvasEditor(_ref, ref) {
|
|||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Private @wordpress/block-editor APIs.
|
||||
*/
|
||||
|
@ -61735,6 +61921,7 @@ function OffCanvasEditor(_ref, ref) {
|
|||
const privateApis = {};
|
||||
lock(privateApis, { ...global_styles_namespaceObject,
|
||||
ExperimentalBlockEditorProvider: ExperimentalBlockEditorProvider,
|
||||
LeafMoreMenu: LeafMoreMenu,
|
||||
OffCanvasEditor: off_canvas_editor
|
||||
});
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -31772,98 +31772,6 @@ const ManageMenusButton = _ref => {
|
|||
|
||||
/* harmony default export */ var manage_menus_button = (ManageMenusButton);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/add-submenu.js
|
||||
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
const addSubmenu = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
||||
xmlns: "http://www.w3.org/2000/svg",
|
||||
viewBox: "0 0 24 24"
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
||||
d: "M2 12c0 3.6 2.4 5.5 6 5.5h.5V19l3-2.5-3-2.5v2H8c-2.5 0-4.5-1.5-4.5-4s2-4.5 4.5-4.5h3.5V6H8c-3.6 0-6 2.4-6 6zm19.5-1h-8v1.5h8V11zm0 5h-8v1.5h8V16zm0-10h-8v1.5h8V6z"
|
||||
}));
|
||||
/* harmony default export */ var add_submenu = (addSubmenu);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/leaf-more-menu.js
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const leaf_more_menu_POPOVER_PROPS = {
|
||||
className: 'block-editor-block-settings-menu__popover',
|
||||
position: 'bottom right',
|
||||
variant: 'toolbar'
|
||||
};
|
||||
const LeafMoreMenu = props => {
|
||||
const {
|
||||
clientId,
|
||||
block
|
||||
} = props;
|
||||
const {
|
||||
insertBlock,
|
||||
replaceBlock,
|
||||
removeBlocks,
|
||||
replaceInnerBlocks
|
||||
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
|
||||
const label = (0,external_wp_i18n_namespaceObject.sprintf)(
|
||||
/* translators: %s: block name */
|
||||
(0,external_wp_i18n_namespaceObject.__)('Remove %s'), (0,external_wp_blockEditor_namespaceObject.BlockTitle)({
|
||||
clientId,
|
||||
maximumLength: 25
|
||||
}));
|
||||
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DropdownMenu, _extends({
|
||||
icon: more_vertical,
|
||||
label: (0,external_wp_i18n_namespaceObject.__)('Options'),
|
||||
className: "block-editor-block-settings-menu",
|
||||
popoverProps: leaf_more_menu_POPOVER_PROPS,
|
||||
noIcons: true
|
||||
}, props), _ref => {
|
||||
let {
|
||||
onClose
|
||||
} = _ref;
|
||||
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
|
||||
icon: add_submenu,
|
||||
onClick: () => {
|
||||
const updateSelectionOnInsert = false;
|
||||
const newLink = (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link');
|
||||
|
||||
if (block.name === 'core/navigation-submenu') {
|
||||
insertBlock(newLink, block.innerBlocks.length, clientId, updateSelectionOnInsert);
|
||||
} else {
|
||||
// Convert to a submenu if the block currently isn't one.
|
||||
const newSubmenu = (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-submenu', block.attributes, block.innerBlocks); // The following must happen as two independent actions.
|
||||
// Why? Because the offcanvas editor relies on the getLastInsertedBlocksClientIds
|
||||
// selector to determine which block is "active". As the UX needs the newLink to be
|
||||
// the "active" block it must be the last block to be inserted.
|
||||
// Therefore the Submenu is first created and **then** the newLink is inserted
|
||||
// thus ensuring it is the last inserted block.
|
||||
|
||||
replaceBlock(clientId, newSubmenu);
|
||||
replaceInnerBlocks(newSubmenu.clientId, [newLink], updateSelectionOnInsert);
|
||||
}
|
||||
|
||||
onClose();
|
||||
}
|
||||
}, (0,external_wp_i18n_namespaceObject.__)('Add submenu item')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
|
||||
onClick: () => {
|
||||
removeBlocks([clientId], false);
|
||||
onClose();
|
||||
}
|
||||
}, label));
|
||||
});
|
||||
};
|
||||
|
||||
;// CONCATENATED MODULE: external ["wp","privateApis"]
|
||||
var external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/private-apis.js
|
||||
|
@ -31916,7 +31824,6 @@ function DeletedNavigationWarning(_ref) {
|
|||
|
||||
|
||||
|
||||
|
||||
/* translators: %s: The name of a menu. */
|
||||
|
||||
const actionLabel = (0,external_wp_i18n_namespaceObject.__)("Switch to '%s'");
|
||||
|
@ -31930,7 +31837,8 @@ const MainContent = _ref => {
|
|||
onCreateNew
|
||||
} = _ref;
|
||||
const {
|
||||
OffCanvasEditor
|
||||
OffCanvasEditor,
|
||||
LeafMoreMenu
|
||||
} = unlock(external_wp_blockEditor_namespaceObject.privateApis); // Provide a hierarchy of clientIds for the given Navigation block (clientId).
|
||||
// This is required else the list view will display the entire block tree.
|
||||
|
||||
|
@ -33441,6 +33349,21 @@ const customLink = (0,external_wp_element_namespaceObject.createElement)(externa
|
|||
}));
|
||||
/* harmony default export */ var custom_link = (customLink);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/add-submenu.js
|
||||
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
const addSubmenu = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
||||
xmlns: "http://www.w3.org/2000/svg",
|
||||
viewBox: "0 0 24 24"
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
||||
d: "M2 12c0 3.6 2.4 5.5 6 5.5h.5V19l3-2.5-3-2.5v2H8c-2.5 0-4.5-1.5-4.5-4s2-4.5 4.5-4.5h3.5V6H8c-3.6 0-6 2.4-6 6zm19.5-1h-8v1.5h8V11zm0 5h-8v1.5h8V16zm0-10h-8v1.5h8V6z"
|
||||
}));
|
||||
/* harmony default export */ var add_submenu = (addSubmenu);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/link-ui.js
|
||||
|
||||
|
||||
|
@ -34052,6 +33975,10 @@ function NavigationLinkEdit(_ref) {
|
|||
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
||||
// If block has inner blocks, transform to Submenu.
|
||||
if (hasChildren) {
|
||||
// This side-effect should not create an undo level as those should
|
||||
// only be created via user interactions.
|
||||
__unstableMarkNextChangeAsNotPersistent();
|
||||
|
||||
transformToSubmenu();
|
||||
}
|
||||
}, [hasChildren]);
|
||||
|
@ -35101,6 +35028,10 @@ function NavigationSubmenuEdit(_ref) {
|
|||
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
||||
// If block becomes empty, transform to Navigation Link.
|
||||
if (!hasChildren && prevHasChildren) {
|
||||
// This side-effect should not create an undo level as those should
|
||||
// only be created via user interactions.
|
||||
__unstableMarkNextChangeAsNotPersistent();
|
||||
|
||||
transformToLink();
|
||||
}
|
||||
}, [hasChildren, prevHasChildren]);
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -4944,16 +4944,14 @@ function useAsyncList(list) {
|
|||
setCurrent(firstItems);
|
||||
const asyncQueue = (0,external_wp_priorityQueue_namespaceObject.createQueue)();
|
||||
|
||||
const append = nextIndex => () => {
|
||||
if (list.length <= nextIndex) {
|
||||
return;
|
||||
}
|
||||
for (let i = firstItems.length; i < list.length; i += step) {
|
||||
asyncQueue.add({}, () => {
|
||||
(0,external_wp_element_namespaceObject.flushSync)(() => {
|
||||
setCurrent(state => [...state, ...list.slice(i, i + step)]);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
setCurrent(state => [...state, ...list.slice(nextIndex, nextIndex + step)]);
|
||||
asyncQueue.add({}, append(nextIndex + step));
|
||||
};
|
||||
|
||||
asyncQueue.add({}, append(firstItems.length));
|
||||
return () => asyncQueue.reset();
|
||||
}, [list]);
|
||||
return current;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -3713,6 +3713,7 @@ const arrowLeft = (0,external_wp_element_namespaceObject.createElement)(external
|
|||
*/
|
||||
|
||||
|
||||
const isGutenbergPlugin = false ? 0 : false;
|
||||
|
||||
function MaybeIframe(_ref) {
|
||||
let {
|
||||
|
@ -3976,7 +3977,7 @@ function VisualEditor(_ref2) {
|
|||
initial: desktopCanvasStyles,
|
||||
className: previewMode
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(MaybeIframe, {
|
||||
shouldIframe: isBlockBasedTheme && !hasMetaBoxes || isTemplateMode || deviceType === 'Tablet' || deviceType === 'Mobile',
|
||||
shouldIframe: isGutenbergPlugin && isBlockBasedTheme && !hasMetaBoxes || isTemplateMode || deviceType === 'Tablet' || deviceType === 'Mobile',
|
||||
contentRef: contentRef,
|
||||
styles: styles
|
||||
}, themeSupportsLayout && !themeHasDisabledLayoutStyles && !isTemplateMode && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalLayoutStyle, {
|
||||
|
@ -9341,13 +9342,6 @@ function Layout(_ref) {
|
|||
};
|
||||
}, []);
|
||||
const isDistractionFree = isDistractionFreeMode && isLargeViewport;
|
||||
const className = classnames_default()('edit-post-layout', 'is-mode-' + mode, {
|
||||
'is-sidebar-opened': sidebarIsOpened,
|
||||
'has-fixed-toolbar': hasFixedToolbar,
|
||||
'has-metaboxes': hasActiveMetaboxes,
|
||||
'show-icon-labels': showIconLabels,
|
||||
'is-distraction-free': isDistractionFree
|
||||
});
|
||||
|
||||
const openSidebarPanel = () => openGeneralSidebar(hasBlockSelected ? 'edit-post/block' : 'edit-post/document'); // Inserter and Sidebars are mutually exclusive
|
||||
|
||||
|
@ -9372,6 +9366,14 @@ function Layout(_ref) {
|
|||
|
||||
setEntitiesSavedStatesCallback(false);
|
||||
}, [entitiesSavedStatesCallback]);
|
||||
const className = classnames_default()('edit-post-layout', 'is-mode-' + mode, {
|
||||
'is-sidebar-opened': sidebarIsOpened,
|
||||
'has-fixed-toolbar': hasFixedToolbar,
|
||||
'has-metaboxes': hasActiveMetaboxes,
|
||||
'show-icon-labels': showIconLabels,
|
||||
'is-distraction-free': isDistractionFree,
|
||||
'is-entity-save-view-open': !!entitiesSavedStatesCallback
|
||||
});
|
||||
const secondarySidebarLabel = isListViewOpened ? (0,external_wp_i18n_namespaceObject.__)('Document Overview') : (0,external_wp_i18n_namespaceObject.__)('Block Library');
|
||||
|
||||
const secondarySidebar = () => {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -5614,7 +5614,7 @@ const symbolFilled = (0,external_wp_element_namespaceObject.createElement)(exter
|
|||
|
||||
function SidebarNavigationScreen(_ref) {
|
||||
let {
|
||||
path,
|
||||
isRoot,
|
||||
title,
|
||||
actions,
|
||||
content
|
||||
|
@ -5629,16 +5629,13 @@ function SidebarNavigationScreen(_ref) {
|
|||
dashboardLink: getSettings().__experimentalDashboardLink
|
||||
};
|
||||
}, []);
|
||||
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorScreen, {
|
||||
className: "edit-site-sidebar-navigation-screen",
|
||||
path: path
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalVStack, {
|
||||
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalVStack, {
|
||||
spacing: 2
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
|
||||
spacing: 4,
|
||||
justify: "flex-start",
|
||||
className: "edit-site-sidebar-navigation-screen__title-icon"
|
||||
}, path !== '/' ? (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorToParentButton, {
|
||||
}, !isRoot ? (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorToParentButton, {
|
||||
className: "edit-site-sidebar-navigation-screen__back",
|
||||
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right : chevron_left,
|
||||
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Back')
|
||||
|
@ -5652,7 +5649,7 @@ function SidebarNavigationScreen(_ref) {
|
|||
className: "edit-site-sidebar-navigation-screen__title"
|
||||
}, title), actions), (0,external_wp_element_namespaceObject.createElement)("nav", {
|
||||
className: "edit-site-sidebar-navigation-screen__content"
|
||||
}, content)));
|
||||
}, content));
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-item/index.js
|
||||
|
@ -5728,7 +5725,7 @@ function SidebarNavigationScreenMain() {
|
|||
};
|
||||
});
|
||||
return (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreen, {
|
||||
path: "/",
|
||||
isRoot: true,
|
||||
title: (0,external_wp_i18n_namespaceObject.__)('Design'),
|
||||
content: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, null, !!navigationMenus && navigationMenus.length > 0 && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorButton, {
|
||||
as: SidebarNavigationItem,
|
||||
|
@ -5737,12 +5734,12 @@ function SidebarNavigationScreenMain() {
|
|||
icon: library_navigation
|
||||
}, (0,external_wp_i18n_namespaceObject.__)('Navigation')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorButton, {
|
||||
as: SidebarNavigationItem,
|
||||
path: "/templates",
|
||||
path: "/wp_template",
|
||||
withChevron: true,
|
||||
icon: library_layout
|
||||
}, (0,external_wp_i18n_namespaceObject.__)('Templates')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorButton, {
|
||||
as: SidebarNavigationItem,
|
||||
path: "/template-parts",
|
||||
path: "/wp_template_part",
|
||||
withChevron: true,
|
||||
icon: symbol_filled
|
||||
}, (0,external_wp_i18n_namespaceObject.__)('Template Parts')))
|
||||
|
@ -6997,12 +6994,9 @@ function NewTemplate(_ref) {
|
|||
|
||||
setCanvasMode('edit'); // Navigate to the created template editor.
|
||||
|
||||
window.queueMicrotask(() => {
|
||||
history.push({
|
||||
postId: newTemplate.id,
|
||||
postType: newTemplate.type,
|
||||
path: '/templates/single'
|
||||
});
|
||||
history.push({
|
||||
postId: newTemplate.id,
|
||||
postType: newTemplate.type
|
||||
});
|
||||
createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Title of the created template e.g: "Category".
|
||||
(0,external_wp_i18n_namespaceObject.__)('"%s" successfully created.'), title), {
|
||||
|
@ -7352,12 +7346,9 @@ function NewTemplatePart(_ref) {
|
|||
|
||||
setCanvasMode('edit'); // Navigate to the created template part editor.
|
||||
|
||||
window.queueMicrotask(() => {
|
||||
history.push({
|
||||
postId: templatePart.id,
|
||||
postType: 'wp_template_part',
|
||||
path: '/template-parts/single'
|
||||
});
|
||||
history.push({
|
||||
postId: templatePart.id,
|
||||
postType: 'wp_template_part'
|
||||
}); // TODO: Add a success notice?
|
||||
} catch (error) {
|
||||
const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('An error occurred while creating the template part.');
|
||||
|
@ -7441,7 +7432,6 @@ function AddNewTemplate(_ref) {
|
|||
|
||||
const config = {
|
||||
wp_template: {
|
||||
path: '/templates',
|
||||
labels: {
|
||||
title: (0,external_wp_i18n_namespaceObject.__)('Templates'),
|
||||
loading: (0,external_wp_i18n_namespaceObject.__)('Loading templates'),
|
||||
|
@ -7450,7 +7440,6 @@ const config = {
|
|||
}
|
||||
},
|
||||
wp_template_part: {
|
||||
path: '/template-parts',
|
||||
labels: {
|
||||
title: (0,external_wp_i18n_namespaceObject.__)('Template parts'),
|
||||
loading: (0,external_wp_i18n_namespaceObject.__)('Loading template parts'),
|
||||
|
@ -7468,16 +7457,17 @@ const TemplateItem = _ref => {
|
|||
} = _ref;
|
||||
const linkInfo = useLink({
|
||||
postType,
|
||||
postId,
|
||||
path: config[postType].path + '/single'
|
||||
postId
|
||||
});
|
||||
return (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationItem, extends_extends({}, linkInfo, props));
|
||||
};
|
||||
|
||||
function SidebarNavigationScreenTemplates(_ref2) {
|
||||
let {
|
||||
postType = 'wp_template'
|
||||
} = _ref2;
|
||||
function SidebarNavigationScreenTemplates() {
|
||||
const {
|
||||
params: {
|
||||
postType
|
||||
}
|
||||
} = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)();
|
||||
const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<');
|
||||
const {
|
||||
records: templates,
|
||||
|
@ -7486,12 +7476,9 @@ function SidebarNavigationScreenTemplates(_ref2) {
|
|||
per_page: -1
|
||||
});
|
||||
const browseAllLink = useLink({
|
||||
postType,
|
||||
postId: undefined,
|
||||
path: config[postType].path + '/all'
|
||||
path: '/' + postType + '/all'
|
||||
});
|
||||
return (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreen, {
|
||||
path: config[postType].path,
|
||||
title: config[postType].labels.title,
|
||||
actions: !isMobileViewport && (0,external_wp_element_namespaceObject.createElement)(AddNewTemplate, {
|
||||
templateType: postType,
|
||||
|
@ -7585,18 +7572,7 @@ function useEditedEntityRecord() {
|
|||
|
||||
|
||||
|
||||
const sidebar_navigation_screen_template_config = {
|
||||
wp_template: {
|
||||
path: '/templates/single'
|
||||
},
|
||||
wp_template_part: {
|
||||
path: '/template-parts/single'
|
||||
}
|
||||
};
|
||||
function SidebarNavigationScreenTemplate(_ref) {
|
||||
let {
|
||||
postType = 'wp_template'
|
||||
} = _ref;
|
||||
function SidebarNavigationScreenTemplate() {
|
||||
const {
|
||||
setCanvasMode
|
||||
} = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store));
|
||||
|
@ -7612,7 +7588,6 @@ function SidebarNavigationScreenTemplate(_ref) {
|
|||
}
|
||||
|
||||
return (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreen, {
|
||||
path: sidebar_navigation_screen_template_config[postType].path,
|
||||
title: getTitle(),
|
||||
actions: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
|
||||
variant: "primary",
|
||||
|
@ -7636,34 +7611,83 @@ function SidebarNavigationScreenTemplate(_ref) {
|
|||
function useSyncPathWithURL() {
|
||||
const history = useHistory();
|
||||
const {
|
||||
params
|
||||
params: urlParams
|
||||
} = useLocation();
|
||||
const {
|
||||
path = '/'
|
||||
} = params;
|
||||
const {
|
||||
location,
|
||||
location: navigatorLocation,
|
||||
params: navigatorParams,
|
||||
goTo
|
||||
} = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)();
|
||||
const currentPath = (0,external_wp_element_namespaceObject.useRef)(path);
|
||||
const currentNavigatorLocation = (0,external_wp_element_namespaceObject.useRef)(location.path);
|
||||
const currentUrlParams = (0,external_wp_element_namespaceObject.useRef)(urlParams);
|
||||
const currentPath = (0,external_wp_element_namespaceObject.useRef)();
|
||||
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
||||
currentPath.current = path;
|
||||
|
||||
if (path !== currentNavigatorLocation.current) {
|
||||
goTo(path);
|
||||
// Don't trust the navigator path on initial render.
|
||||
if (currentPath.current === null) {
|
||||
return;
|
||||
}
|
||||
}, [path]);
|
||||
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
||||
currentNavigatorLocation.current = location.path;
|
||||
|
||||
if (location.path !== currentPath.current) {
|
||||
history.push({ ...params,
|
||||
path: location.path
|
||||
function updateUrlParams(newUrlParams) {
|
||||
if (Object.entries(newUrlParams).every(_ref => {
|
||||
let [key, value] = _ref;
|
||||
return currentUrlParams.current[key] === value;
|
||||
})) {
|
||||
return;
|
||||
}
|
||||
|
||||
const updatedParams = { ...currentUrlParams.current,
|
||||
...newUrlParams
|
||||
};
|
||||
currentUrlParams.current = updatedParams;
|
||||
history.push(updatedParams);
|
||||
}
|
||||
|
||||
if (navigatorParams !== null && navigatorParams !== void 0 && navigatorParams.postType && navigatorParams !== null && navigatorParams !== void 0 && navigatorParams.postId) {
|
||||
updateUrlParams({
|
||||
postType: navigatorParams === null || navigatorParams === void 0 ? void 0 : navigatorParams.postType,
|
||||
postId: navigatorParams === null || navigatorParams === void 0 ? void 0 : navigatorParams.postId,
|
||||
path: undefined
|
||||
});
|
||||
} else if (navigatorParams !== null && navigatorParams !== void 0 && navigatorParams.postType && !(navigatorParams !== null && navigatorParams !== void 0 && navigatorParams.postId)) {
|
||||
updateUrlParams({
|
||||
postType: navigatorParams === null || navigatorParams === void 0 ? void 0 : navigatorParams.postType,
|
||||
path: navigatorLocation.path,
|
||||
postId: undefined
|
||||
});
|
||||
} else {
|
||||
updateUrlParams({
|
||||
postType: undefined,
|
||||
postId: undefined,
|
||||
path: navigatorLocation.path
|
||||
});
|
||||
}
|
||||
}, [location.path, history]);
|
||||
return path;
|
||||
}, [navigatorLocation === null || navigatorLocation === void 0 ? void 0 : navigatorLocation.path, navigatorParams, history]);
|
||||
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
||||
var _urlParams$path;
|
||||
|
||||
currentUrlParams.current = urlParams;
|
||||
let path = (_urlParams$path = urlParams === null || urlParams === void 0 ? void 0 : urlParams.path) !== null && _urlParams$path !== void 0 ? _urlParams$path : '/'; // Compute the navigator path based on the URL params.
|
||||
|
||||
if (urlParams !== null && urlParams !== void 0 && urlParams.postType && urlParams !== null && urlParams !== void 0 && urlParams.postId && // This is just a special case to support old WP versions that perform redirects.
|
||||
// This code should be removed when we minimum WP version becomes 6.2.
|
||||
(urlParams === null || urlParams === void 0 ? void 0 : urlParams.postId) !== 'none') {
|
||||
switch (urlParams.postType) {
|
||||
case 'wp_template':
|
||||
case 'wp_template_part':
|
||||
path = `/${encodeURIComponent(urlParams.postType)}/${encodeURIComponent(urlParams.postId)}`;
|
||||
break;
|
||||
|
||||
default:
|
||||
path = `/navigation/${encodeURIComponent(urlParams.postType)}/${encodeURIComponent(urlParams.postId)}`;
|
||||
}
|
||||
}
|
||||
|
||||
if (currentPath.current !== path) {
|
||||
currentPath.current = path;
|
||||
goTo(path);
|
||||
}
|
||||
|
||||
goTo(path);
|
||||
}, [urlParams, goTo]);
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/navigation-inspector/navigation-menu.js
|
||||
|
@ -7695,7 +7719,8 @@ function NavigationMenu(_ref) {
|
|||
updateBlockListSettings
|
||||
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
|
||||
const {
|
||||
OffCanvasEditor
|
||||
OffCanvasEditor,
|
||||
LeafMoreMenu
|
||||
} = unlock(external_wp_blockEditor_namespaceObject.privateApis); //TODO: Block settings are normally updated as a side effect of rendering InnerBlocks in BlockList
|
||||
//Think through a better way of doing this, possible with adding allowed blocks to block library metadata
|
||||
|
||||
|
@ -7713,7 +7738,8 @@ function NavigationMenu(_ref) {
|
|||
}, [updateBlockListSettings, innerBlocks]);
|
||||
return (0,external_wp_element_namespaceObject.createElement)(OffCanvasEditor, {
|
||||
blocks: innerBlocks,
|
||||
onSelect: onSelect
|
||||
onSelect: onSelect,
|
||||
LeafMoreMenu: LeafMoreMenu
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -7916,13 +7942,11 @@ function SidebarNavigationScreenNavigationMenus() {
|
|||
if (attributes.kind === 'post-type' && attributes.id && attributes.type && history) {
|
||||
history.push({
|
||||
postType: attributes.type,
|
||||
postId: attributes.id,
|
||||
path: '/navigation/single'
|
||||
postId: attributes.id
|
||||
});
|
||||
}
|
||||
}, [history]);
|
||||
return (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreen, {
|
||||
path: "/navigation",
|
||||
title: (0,external_wp_i18n_namespaceObject.__)('Navigation'),
|
||||
content: (0,external_wp_element_namespaceObject.createElement)("div", {
|
||||
className: "edit-site-sidebar-navigation-screen-navigation-menus"
|
||||
|
@ -7939,6 +7963,7 @@ function SidebarNavigationScreenNavigationMenus() {
|
|||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
@ -7946,20 +7971,19 @@ function SidebarNavigationScreenNavigationMenus() {
|
|||
|
||||
const sidebar_navigation_screen_templates_browse_config = {
|
||||
wp_template: {
|
||||
path: '/templates/all',
|
||||
title: (0,external_wp_i18n_namespaceObject.__)('All templates')
|
||||
},
|
||||
wp_template_part: {
|
||||
path: '/template-parts/all',
|
||||
title: (0,external_wp_i18n_namespaceObject.__)('All template parts')
|
||||
}
|
||||
};
|
||||
function SidebarNavigationScreenTemplatesBrowse(_ref) {
|
||||
let {
|
||||
postType = 'wp_template'
|
||||
} = _ref;
|
||||
function SidebarNavigationScreenTemplatesBrowse() {
|
||||
const {
|
||||
params: {
|
||||
postType
|
||||
}
|
||||
} = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)();
|
||||
return (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreen, {
|
||||
path: sidebar_navigation_screen_templates_browse_config[postType].path,
|
||||
title: sidebar_navigation_screen_templates_browse_config[postType].title
|
||||
});
|
||||
}
|
||||
|
@ -8061,28 +8085,24 @@ function SidebarNavigationScreenNavigationItem() {
|
|||
setCanvasMode
|
||||
} = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store));
|
||||
const {
|
||||
post
|
||||
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
||||
var _getEditedPostContext;
|
||||
|
||||
const {
|
||||
getEditedPostContext
|
||||
} = select(store_store);
|
||||
const {
|
||||
getEntityRecord
|
||||
} = select(external_wp_coreData_namespaceObject.store);
|
||||
const {
|
||||
params: {
|
||||
postType,
|
||||
postId
|
||||
} = (_getEditedPostContext = getEditedPostContext()) !== null && _getEditedPostContext !== void 0 ? _getEditedPostContext : {}; // The currently selected entity to display.
|
||||
}
|
||||
} = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)();
|
||||
const {
|
||||
post
|
||||
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
||||
const {
|
||||
getEntityRecord
|
||||
} = select(external_wp_coreData_namespaceObject.store); // The currently selected entity to display.
|
||||
// Typically template or template part in the site editor.
|
||||
|
||||
return {
|
||||
post: postId && postType ? getEntityRecord('postType', postType, postId) : null
|
||||
};
|
||||
}, []);
|
||||
}, [postType, postId]);
|
||||
return (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreen, {
|
||||
path: "/navigation/single",
|
||||
title: post ? (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(post === null || post === void 0 ? void 0 : (_post$title = post.title) === null || _post$title === void 0 ? void 0 : _post$title.rendered) : null,
|
||||
actions: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
|
||||
variant: "primary",
|
||||
|
@ -8100,8 +8120,6 @@ function SidebarNavigationScreenNavigationItem() {
|
|||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
@ -8117,41 +8135,26 @@ function SidebarNavigationScreenNavigationItem() {
|
|||
|
||||
function SidebarScreens() {
|
||||
useSyncPathWithURL();
|
||||
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreenMain, null), (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreenNavigationMenus, null), (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreenNavigationItem, null), (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreenTemplates, {
|
||||
postType: "wp_template"
|
||||
}), (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreenTemplates, {
|
||||
postType: "wp_template_part"
|
||||
}), (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreenTemplate, {
|
||||
postType: "wp_template"
|
||||
}), (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreenTemplate, {
|
||||
postType: "wp_template_part"
|
||||
}), (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreenTemplatesBrowse, {
|
||||
postType: "wp_template"
|
||||
}), (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreenTemplatesBrowse, {
|
||||
postType: "wp_template_part"
|
||||
}));
|
||||
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorScreen, {
|
||||
path: "/"
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreenMain, null)), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorScreen, {
|
||||
path: "/navigation"
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreenNavigationMenus, null)), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorScreen, {
|
||||
path: "/navigation/:postType/:postId"
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreenNavigationItem, null)), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorScreen, {
|
||||
path: "/:postType(wp_template|wp_template_part)"
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreenTemplates, null)), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorScreen, {
|
||||
path: "/:postType(wp_template|wp_template_part)/all"
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreenTemplatesBrowse, null)), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorScreen, {
|
||||
path: "/:postType(wp_template|wp_template_part)/:postId"
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreenTemplate, null)));
|
||||
}
|
||||
|
||||
function Sidebar() {
|
||||
const {
|
||||
isDirty
|
||||
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
||||
const {
|
||||
__experimentalGetDirtyEntityRecords
|
||||
} = select(external_wp_coreData_namespaceObject.store);
|
||||
|
||||
const dirtyEntityRecords = __experimentalGetDirtyEntityRecords(); // The currently selected entity to display.
|
||||
// Typically template or template part in the site editor.
|
||||
|
||||
|
||||
return {
|
||||
isDirty: dirtyEntityRecords.length > 0
|
||||
};
|
||||
}, []);
|
||||
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorProvider, {
|
||||
className: "edit-site-sidebar__content",
|
||||
initialPath: "/"
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(SidebarScreens, null)), isDirty && (0,external_wp_element_namespaceObject.createElement)("div", {
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(SidebarScreens, null)), (0,external_wp_element_namespaceObject.createElement)("div", {
|
||||
className: "edit-site-sidebar__footer"
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(SaveButton, null)));
|
||||
}
|
||||
|
@ -12119,7 +12122,7 @@ function ScreenBorder(_ref) {
|
|||
const hasBorderPanel = useHasBorderPanel(name);
|
||||
const variationClassName = getVariationClassName(variation);
|
||||
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(header, {
|
||||
title: (0,external_wp_i18n_namespaceObject.__)('Border & Shadow')
|
||||
title: (0,external_wp_i18n_namespaceObject.__)('Border')
|
||||
}), (0,external_wp_element_namespaceObject.createElement)(block_preview_panel, {
|
||||
name: name,
|
||||
variation: variationClassName
|
||||
|
@ -12567,7 +12570,7 @@ function GlobalStylesActionMenu() {
|
|||
|
||||
return (0,external_wp_element_namespaceObject.createElement)(GlobalStylesMenuFill, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DropdownMenu, {
|
||||
icon: more_vertical,
|
||||
label: (0,external_wp_i18n_namespaceObject.__)('More Styles actions'),
|
||||
label: (0,external_wp_i18n_namespaceObject.__)('Styles actions'),
|
||||
controls: [{
|
||||
title: (0,external_wp_i18n_namespaceObject.__)('Reset to defaults'),
|
||||
onClick: onReset,
|
||||
|
@ -12822,9 +12825,15 @@ function GlobalStylesSidebar() {
|
|||
icon: library_styles,
|
||||
closeLabel: (0,external_wp_i18n_namespaceObject.__)('Close Styles sidebar'),
|
||||
panelClassName: "edit-site-global-styles-sidebar__panel",
|
||||
header: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexBlock, null, (0,external_wp_element_namespaceObject.createElement)("strong", null, (0,external_wp_i18n_namespaceObject.__)('Styles'))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
|
||||
header: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, {
|
||||
className: "edit-site-global-styles-sidebar__header"
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexBlock, {
|
||||
style: {
|
||||
minWidth: 'min-content'
|
||||
}
|
||||
}, (0,external_wp_element_namespaceObject.createElement)("strong", null, (0,external_wp_i18n_namespaceObject.__)('Styles'))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
|
||||
icon: library_seen,
|
||||
label: isStyleBookOpened ? (0,external_wp_i18n_namespaceObject.__)('Close Style Book') : (0,external_wp_i18n_namespaceObject.__)('Open Style Book'),
|
||||
label: (0,external_wp_i18n_namespaceObject.__)('Style Book'),
|
||||
isPressed: isStyleBookOpened,
|
||||
disabled: editorMode !== 'visual',
|
||||
onClick: () => {
|
||||
|
@ -15451,7 +15460,6 @@ function Table(_ref) {
|
|||
level: 4
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(Link, {
|
||||
params: {
|
||||
path: template.type === 'wp_template' ? '/templates/single' : '/template-parts/single',
|
||||
postId: template.id,
|
||||
postType: template.type
|
||||
}
|
||||
|
@ -15634,7 +15642,7 @@ function getIsListPage(_ref) {
|
|||
let {
|
||||
path
|
||||
} = _ref;
|
||||
return path === '/templates/all' || path === '/template-parts/all';
|
||||
return path === '/wp_template/all' || path === '/wp_template_part/all';
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/list-view.js
|
||||
|
@ -17167,8 +17175,7 @@ function useInitEditedEntityFromURL() {
|
|||
const {
|
||||
params: {
|
||||
postId,
|
||||
postType,
|
||||
path = '/'
|
||||
postType
|
||||
} = {}
|
||||
} = useLocation();
|
||||
const {
|
||||
|
@ -17190,41 +17197,44 @@ function useInitEditedEntityFromURL() {
|
|||
setPage
|
||||
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
|
||||
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
||||
switch (path) {
|
||||
case '/templates/single':
|
||||
setTemplate(postId);
|
||||
break;
|
||||
if (postType && postId && // This is just a special case to support old WP versions that perform redirects.
|
||||
// This code should be removed when we minimum WP version becomes 6.2.
|
||||
postId !== 'none') {
|
||||
switch (postType) {
|
||||
case 'wp_template':
|
||||
setTemplate(postId);
|
||||
break;
|
||||
|
||||
case '/template-parts/single':
|
||||
setTemplatePart(postId);
|
||||
break;
|
||||
case 'wp_template_part':
|
||||
setTemplatePart(postId);
|
||||
break;
|
||||
|
||||
case '/navigation/single':
|
||||
setPage({
|
||||
context: {
|
||||
postType,
|
||||
postId
|
||||
}
|
||||
});
|
||||
break;
|
||||
default:
|
||||
setPage({
|
||||
context: {
|
||||
postType,
|
||||
postId
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
if (homepageId) {
|
||||
setPage({
|
||||
context: {
|
||||
postType: 'page',
|
||||
postId: homepageId
|
||||
}
|
||||
});
|
||||
} else if (!isRequestingSite) {
|
||||
setPage({
|
||||
path: '/'
|
||||
});
|
||||
}
|
||||
return;
|
||||
} // In all other cases, we need to set the home page in the site editor view.
|
||||
|
||||
|
||||
if (homepageId) {
|
||||
setPage({
|
||||
context: {
|
||||
postType: 'page',
|
||||
postId: homepageId
|
||||
}
|
||||
});
|
||||
} else if (!isRequestingSite) {
|
||||
setPage({
|
||||
path: '/'
|
||||
});
|
||||
}
|
||||
}, [path, postId, homepageId, isRequestingSite, setPage, setTemplate, setTemplatePart]);
|
||||
}, [postId, postType, homepageId, isRequestingSite, setPage, setTemplate, setTemplatePart]);
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/wordpress.js
|
||||
|
@ -17442,6 +17452,10 @@ function useSyncCanvasModeWithURL() {
|
|||
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/save-panel/index.js
|
||||
|
||||
|
||||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
@ -17450,6 +17464,7 @@ function useSyncCanvasModeWithURL() {
|
|||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
@ -17490,7 +17505,9 @@ function SavePanel() {
|
|||
}
|
||||
|
||||
return (0,external_wp_element_namespaceObject.createElement)(NavigableRegion, {
|
||||
className: "edit-site-layout__actions",
|
||||
className: classnames_default()('edit-site-layout__actions', {
|
||||
'is-entity-save-view-open': isSaveViewOpen
|
||||
}),
|
||||
ariaLabel: (0,external_wp_i18n_namespaceObject.__)('Save sidebar')
|
||||
}, isSaveViewOpen ? (0,external_wp_element_namespaceObject.createElement)(external_wp_editor_namespaceObject.EntitiesSavedStates, {
|
||||
close: onClose
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1994,7 +1994,7 @@ const moveBlockToWidgetArea = (clientId, widgetAreaId) => async _ref11 => {
|
|||
select,
|
||||
registry
|
||||
} = _ref11;
|
||||
const sourceRootClientId = registry.select(external_wp_blockEditor_namespaceObject.store).getBlockRootClientId([clientId]); // Search the top level blocks (widget areas) for the one with the matching
|
||||
const sourceRootClientId = registry.select(external_wp_blockEditor_namespaceObject.store).getBlockRootClientId(clientId); // Search the top level blocks (widget areas) for the one with the matching
|
||||
// id attribute. Makes the assumption that all top-level blocks are widget
|
||||
// areas.
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -103,6 +103,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|||
"createRef": function() { return /* reexport */ external_React_namespaceObject.createRef; },
|
||||
"createRoot": function() { return /* reexport */ client/* createRoot */.s; },
|
||||
"findDOMNode": function() { return /* reexport */ external_ReactDOM_.findDOMNode; },
|
||||
"flushSync": function() { return /* reexport */ external_ReactDOM_.flushSync; },
|
||||
"forwardRef": function() { return /* reexport */ external_React_namespaceObject.forwardRef; },
|
||||
"hydrate": function() { return /* reexport */ external_ReactDOM_.hydrate; },
|
||||
"hydrateRoot": function() { return /* reexport */ client/* hydrateRoot */.a; },
|
||||
|
@ -753,6 +754,13 @@ var client = __webpack_require__(4470);
|
|||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Forces React to flush any updates inside the provided callback synchronously.
|
||||
*
|
||||
* @param {Function} callback Callback to run synchronously.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Renders a given element into the target DOM node.
|
||||
*
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -729,9 +729,9 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||
const container = document.createElement('div');
|
||||
container.className = 'list-reusable-blocks__container';
|
||||
button.parentNode.insertBefore(container, button);
|
||||
(0,external_wp_element_namespaceObject.render)((0,external_wp_element_namespaceObject.createElement)(import_dropdown, {
|
||||
(0,external_wp_element_namespaceObject.createRoot)(container).render((0,external_wp_element_namespaceObject.createElement)(import_dropdown, {
|
||||
onUpload: showNotice
|
||||
}), container);
|
||||
}));
|
||||
});
|
||||
|
||||
(window.wp = window.wp || {}).listReusableBlocks = __webpack_exports__;
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
/*! This file is auto-generated */
|
||||
!function(){"use strict";var e={n:function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,{a:n}),n},d:function(t,n){for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t);var n=window.wp.element,o=window.wp.i18n;var r=function(){return r=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},r.apply(this,arguments)};Object.create;Object.create;function a(e){return e.toLowerCase()}var i=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],l=/[^A-Z0-9]+/gi;function c(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}function s(e,t){return void 0===t&&(t={}),function(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,o=void 0===n?i:n,r=t.stripRegexp,s=void 0===r?l:r,d=t.transform,u=void 0===d?a:d,p=t.delimiter,m=void 0===p?" ":p,f=c(c(e,o,"$1\0$2"),s,"\0"),w=0,b=f.length;"\0"===f.charAt(w);)w++;for(;"\0"===f.charAt(b-1);)b--;return f.slice(w,b).split("\0").map(u).join(m)}(e,r({delimiter:"."},t))}var d=window.wp.apiFetch,u=e.n(d);var p=async function(e){const t=await u()({path:"/wp/v2/types/wp_block"}),n=await u()({path:`/wp/v2/${t.rest_base}/${e}?context=edit`}),o=n.title.raw,a=n.content.raw,i=JSON.stringify({__file:"wp_block",title:o,content:a},null,2);var l;!function(e,t,n){const o=new window.Blob([t],{type:n});if(window.navigator.msSaveOrOpenBlob)window.navigator.msSaveOrOpenBlob(o,e);else{const t=document.createElement("a");t.href=URL.createObjectURL(o),t.download=e,t.style.display="none",document.body.appendChild(t),t.click(),document.body.removeChild(t)}}((void 0===l&&(l={}),s(o,r({delimiter:"-"},l))+".json"),i,"application/json")},m=window.wp.compose,f=window.wp.components;var w=async function(e){const t=await function(e){const t=new window.FileReader;return new Promise((n=>{t.onload=()=>{n(t.result)},t.readAsText(e)}))}(e);let n;try{n=JSON.parse(t)}catch(e){throw new Error("Invalid JSON file")}if("wp_block"!==n.__file||!n.title||!n.content||"string"!=typeof n.title||"string"!=typeof n.content)throw new Error("Invalid Reusable block JSON file");const o=await u()({path:"/wp/v2/types/wp_block"});return await u()({path:`/wp/v2/${o.rest_base}`,data:{title:n.title,content:n.content,status:"publish"},method:"POST"})};var b=(0,m.withInstanceId)((function(e){let{instanceId:t,onUpload:r}=e;const a="list-reusable-blocks-import-form-"+t,i=(0,n.useRef)(),[l,c]=(0,n.useState)(!1),[s,d]=(0,n.useState)(null),[u,p]=(0,n.useState)(null);return(0,n.createElement)("form",{className:"list-reusable-blocks-import-form",onSubmit:e=>{e.preventDefault(),u&&(c({isLoading:!0}),w(u).then((e=>{i&&(c(!1),r(e))})).catch((e=>{if(!i)return;let t;switch(e.message){case"Invalid JSON file":t=(0,o.__)("Invalid JSON file");break;case"Invalid Reusable block JSON file":t=(0,o.__)("Invalid Reusable block JSON file");break;default:t=(0,o.__)("Unknown error")}c(!1),d(t)})))},ref:i},s&&(0,n.createElement)(f.Notice,{status:"error",onRemove:()=>{d(null)}},s),(0,n.createElement)("label",{htmlFor:a,className:"list-reusable-blocks-import-form__label"},(0,o.__)("File")),(0,n.createElement)("input",{id:a,type:"file",onChange:e=>{p(e.target.files[0]),d(null)}}),(0,n.createElement)(f.Button,{type:"submit",isBusy:l,disabled:!u||l,variant:"secondary",className:"list-reusable-blocks-import-form__button"},(0,o._x)("Import","button label")))}));var v=function(e){let{onUpload:t}=e;return(0,n.createElement)(f.Dropdown,{popoverProps:{placement:"bottom-start"},contentClassName:"list-reusable-blocks-import-dropdown__content",renderToggle:e=>{let{isOpen:t,onToggle:r}=e;return(0,n.createElement)(f.Button,{"aria-expanded":t,onClick:r,variant:"primary"},(0,o.__)("Import from JSON"))},renderContent:e=>{let{onClose:o}=e;return(0,n.createElement)(b,{onUpload:(0,m.pipe)(o,t)})}})};document.body.addEventListener("click",(e=>{e.target.classList.contains("wp-list-reusable-blocks__export")&&(e.preventDefault(),p(e.target.dataset.id))})),document.addEventListener("DOMContentLoaded",(()=>{const e=document.querySelector(".page-title-action");if(!e)return;const t=document.createElement("div");t.className="list-reusable-blocks__container",e.parentNode.insertBefore(t,e),(0,n.render)((0,n.createElement)(v,{onUpload:()=>{const e=document.createElement("div");e.className="notice notice-success is-dismissible",e.innerHTML=`<p>${(0,o.__)("Reusable block imported successfully!")}</p>`;const t=document.querySelector(".wp-header-end");t&&t.parentNode.insertBefore(e,t)}}),t)})),(window.wp=window.wp||{}).listReusableBlocks=t}();
|
||||
!function(){"use strict";var e={n:function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,{a:n}),n},d:function(t,n){for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t);var n=window.wp.element,o=window.wp.i18n;var r=function(){return r=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},r.apply(this,arguments)};Object.create;Object.create;function a(e){return e.toLowerCase()}var i=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],l=/[^A-Z0-9]+/gi;function c(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}function s(e,t){return void 0===t&&(t={}),function(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,o=void 0===n?i:n,r=t.stripRegexp,s=void 0===r?l:r,d=t.transform,u=void 0===d?a:d,p=t.delimiter,m=void 0===p?" ":p,f=c(c(e,o,"$1\0$2"),s,"\0"),w=0,b=f.length;"\0"===f.charAt(w);)w++;for(;"\0"===f.charAt(b-1);)b--;return f.slice(w,b).split("\0").map(u).join(m)}(e,r({delimiter:"."},t))}var d=window.wp.apiFetch,u=e.n(d);var p=async function(e){const t=await u()({path:"/wp/v2/types/wp_block"}),n=await u()({path:`/wp/v2/${t.rest_base}/${e}?context=edit`}),o=n.title.raw,a=n.content.raw,i=JSON.stringify({__file:"wp_block",title:o,content:a},null,2);var l;!function(e,t,n){const o=new window.Blob([t],{type:n});if(window.navigator.msSaveOrOpenBlob)window.navigator.msSaveOrOpenBlob(o,e);else{const t=document.createElement("a");t.href=URL.createObjectURL(o),t.download=e,t.style.display="none",document.body.appendChild(t),t.click(),document.body.removeChild(t)}}((void 0===l&&(l={}),s(o,r({delimiter:"-"},l))+".json"),i,"application/json")},m=window.wp.compose,f=window.wp.components;var w=async function(e){const t=await function(e){const t=new window.FileReader;return new Promise((n=>{t.onload=()=>{n(t.result)},t.readAsText(e)}))}(e);let n;try{n=JSON.parse(t)}catch(e){throw new Error("Invalid JSON file")}if("wp_block"!==n.__file||!n.title||!n.content||"string"!=typeof n.title||"string"!=typeof n.content)throw new Error("Invalid Reusable block JSON file");const o=await u()({path:"/wp/v2/types/wp_block"});return await u()({path:`/wp/v2/${o.rest_base}`,data:{title:n.title,content:n.content,status:"publish"},method:"POST"})};var b=(0,m.withInstanceId)((function(e){let{instanceId:t,onUpload:r}=e;const a="list-reusable-blocks-import-form-"+t,i=(0,n.useRef)(),[l,c]=(0,n.useState)(!1),[s,d]=(0,n.useState)(null),[u,p]=(0,n.useState)(null);return(0,n.createElement)("form",{className:"list-reusable-blocks-import-form",onSubmit:e=>{e.preventDefault(),u&&(c({isLoading:!0}),w(u).then((e=>{i&&(c(!1),r(e))})).catch((e=>{if(!i)return;let t;switch(e.message){case"Invalid JSON file":t=(0,o.__)("Invalid JSON file");break;case"Invalid Reusable block JSON file":t=(0,o.__)("Invalid Reusable block JSON file");break;default:t=(0,o.__)("Unknown error")}c(!1),d(t)})))},ref:i},s&&(0,n.createElement)(f.Notice,{status:"error",onRemove:()=>{d(null)}},s),(0,n.createElement)("label",{htmlFor:a,className:"list-reusable-blocks-import-form__label"},(0,o.__)("File")),(0,n.createElement)("input",{id:a,type:"file",onChange:e=>{p(e.target.files[0]),d(null)}}),(0,n.createElement)(f.Button,{type:"submit",isBusy:l,disabled:!u||l,variant:"secondary",className:"list-reusable-blocks-import-form__button"},(0,o._x)("Import","button label")))}));var v=function(e){let{onUpload:t}=e;return(0,n.createElement)(f.Dropdown,{popoverProps:{placement:"bottom-start"},contentClassName:"list-reusable-blocks-import-dropdown__content",renderToggle:e=>{let{isOpen:t,onToggle:r}=e;return(0,n.createElement)(f.Button,{"aria-expanded":t,onClick:r,variant:"primary"},(0,o.__)("Import from JSON"))},renderContent:e=>{let{onClose:o}=e;return(0,n.createElement)(b,{onUpload:(0,m.pipe)(o,t)})}})};document.body.addEventListener("click",(e=>{e.target.classList.contains("wp-list-reusable-blocks__export")&&(e.preventDefault(),p(e.target.dataset.id))})),document.addEventListener("DOMContentLoaded",(()=>{const e=document.querySelector(".page-title-action");if(!e)return;const t=document.createElement("div");t.className="list-reusable-blocks__container",e.parentNode.insertBefore(t,e),(0,n.createRoot)(t).render((0,n.createElement)(v,{onUpload:()=>{const e=document.createElement("div");e.className="notice notice-success is-dismissible",e.innerHTML=`<p>${(0,o.__)("Reusable block imported successfully!")}</p>`;const t=document.querySelector(".wp-header-end");t&&t.parentNode.insertBefore(e,t)}}))})),(window.wp=window.wp||{}).listReusableBlocks=t}();
|
|
@ -16,7 +16,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.2-beta2-55370';
|
||||
$wp_version = '6.2-beta2-55392';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue