Block Editor: Updates the WordPress packages with all the fixes targetted for WP 6.2 beta1.

Includes the following changes

- Fix multi entities saved state in the post editor
- Adds a global save button to the site editor
- Shadow: move shadow to own panel
- [Block Editor]: Lock __experimentalBlockInspectorAnimation setting
- useBlockSync: change subscribed.current on unsubscribe
- [Block Library - Gallery]: Minor code quality update
- [Patterns]: Reorder pattern categories
- Fix inline preview infinite render
- Show a pointer/hint in the settings tab informing the user about the styles tab
- I18N: update string concatenation method in read more block
- LocalAutosaveNotice: use stable notice id to prevent double notices
- Navigation: Remove the IS_GUTENBERG_PLUGIN check around block_core_navigation_parse_blocks_from_menu_items

Props mamaduka, ntsekouras, kebbet.
See #57471.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54790 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
youknowriad 2023-02-07 13:00:09 +00:00
parent 65c71d1db4
commit 804fbe781a
34 changed files with 908 additions and 627 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

@ -99,12 +99,13 @@ function block_core_gallery_render( $attributes, $content ) {
} }
// Set the CSS variable to the column value, and the `gap` property to the combined gap value. // Set the CSS variable to the column value, and the `gap` property to the combined gap value.
$gallery_styles = array(); $gallery_styles = array(
$gallery_styles[] = array( array(
'selector' => ".wp-block-gallery.{$unique_gallery_classname}", 'selector' => ".wp-block-gallery.{$unique_gallery_classname}",
'declarations' => array( 'declarations' => array(
'--wp--style--unstable-gallery-gap' => $gap_column, '--wp--style--unstable-gallery-gap' => $gap_column,
'gap' => $gap_value, 'gap' => $gap_value,
),
), ),
); );

View File

@ -371,35 +371,3 @@ function register_block_core_navigation_link() {
); );
} }
add_action( 'init', 'register_block_core_navigation_link' ); add_action( 'init', 'register_block_core_navigation_link' );
/**
* Enables animation of the block inspector for the Navigation Link block.
*
* See:
* - https://github.com/WordPress/gutenberg/pull/46342
* - https://github.com/WordPress/gutenberg/issues/45884
*
* @param array $settings Default editor settings.
* @return array Filtered editor settings.
*/
function block_core_navigation_link_enable_inspector_animation( $settings ) {
$current_animation_settings = _wp_array_get(
$settings,
array( '__experimentalBlockInspectorAnimation' ),
array()
);
$settings['__experimentalBlockInspectorAnimation'] = array_merge(
$current_animation_settings,
array(
'core/navigation-link' =>
array(
'enterDirection' => 'rightToLeft',
),
)
);
return $settings;
}
add_filter( 'block_editor_settings_all', 'block_core_navigation_link_enable_inspector_animation' );

View File

@ -289,35 +289,3 @@ function register_block_core_navigation_submenu() {
); );
} }
add_action( 'init', 'register_block_core_navigation_submenu' ); add_action( 'init', 'register_block_core_navigation_submenu' );
/**
* Enables animation of the block inspector for the Navigation Submenu block.
*
* See:
* - https://github.com/WordPress/gutenberg/pull/46342
* - https://github.com/WordPress/gutenberg/issues/45884
*
* @param array $settings Default editor settings.
* @return array Filtered editor settings.
*/
function block_core_navigation_submenu_enable_inspector_animation( $settings ) {
$current_animation_settings = _wp_array_get(
$settings,
array( '__experimentalBlockInspectorAnimation' ),
array()
);
$settings['__experimentalBlockInspectorAnimation'] = array_merge(
$current_animation_settings,
array(
'core/navigation-submenu' =>
array(
'enterDirection' => 'rightToLeft',
),
)
);
return $settings;
}
add_filter( 'block_editor_settings_all', 'block_core_navigation_submenu_enable_inspector_animation' );

View File

@ -65,58 +65,58 @@ if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) {
return $menu_items_by_parent_id; return $menu_items_by_parent_id;
} }
}
/** /**
* Turns menu item data into a nested array of parsed blocks * Turns menu item data into a nested array of parsed blocks
* *
* @param array $menu_items An array of menu items that represent * @param array $menu_items An array of menu items that represent
* an individual level of a menu. * an individual level of a menu.
* @param array $menu_items_by_parent_id An array keyed by the id of the * @param array $menu_items_by_parent_id An array keyed by the id of the
* parent menu where each element is an * parent menu where each element is an
* array of menu items that belong to * array of menu items that belong to
* that parent. * that parent.
* @return array An array of parsed block data. * @return array An array of parsed block data.
*/ */
function block_core_navigation_parse_blocks_from_menu_items( $menu_items, $menu_items_by_parent_id ) { function block_core_navigation_parse_blocks_from_menu_items( $menu_items, $menu_items_by_parent_id ) {
if ( empty( $menu_items ) ) { if ( empty( $menu_items ) ) {
return array(); return array();
}
$blocks = array();
foreach ( $menu_items as $menu_item ) {
$class_name = ! empty( $menu_item->classes ) ? implode( ' ', (array) $menu_item->classes ) : null;
$id = ( null !== $menu_item->object_id && 'custom' !== $menu_item->object ) ? $menu_item->object_id : null;
$opens_in_new_tab = null !== $menu_item->target && '_blank' === $menu_item->target;
$rel = ( null !== $menu_item->xfn && '' !== $menu_item->xfn ) ? $menu_item->xfn : null;
$kind = null !== $menu_item->type ? str_replace( '_', '-', $menu_item->type ) : 'custom';
$block = array(
'blockName' => isset( $menu_items_by_parent_id[ $menu_item->ID ] ) ? 'core/navigation-submenu' : 'core/navigation-link',
'attrs' => array(
'className' => $class_name,
'description' => $menu_item->description,
'id' => $id,
'kind' => $kind,
'label' => $menu_item->title,
'opensInNewTab' => $opens_in_new_tab,
'rel' => $rel,
'title' => $menu_item->attr_title,
'type' => $menu_item->object,
'url' => $menu_item->url,
),
);
$block['innerBlocks'] = isset( $menu_items_by_parent_id[ $menu_item->ID ] )
? block_core_navigation_parse_blocks_from_menu_items( $menu_items_by_parent_id[ $menu_item->ID ], $menu_items_by_parent_id )
: array();
$block['innerContent'] = array_map( 'serialize_block', $block['innerBlocks'] );
$blocks[] = $block;
}
return $blocks;
} }
$blocks = array();
foreach ( $menu_items as $menu_item ) {
$class_name = ! empty( $menu_item->classes ) ? implode( ' ', (array) $menu_item->classes ) : null;
$id = ( null !== $menu_item->object_id && 'custom' !== $menu_item->object ) ? $menu_item->object_id : null;
$opens_in_new_tab = null !== $menu_item->target && '_blank' === $menu_item->target;
$rel = ( null !== $menu_item->xfn && '' !== $menu_item->xfn ) ? $menu_item->xfn : null;
$kind = null !== $menu_item->type ? str_replace( '_', '-', $menu_item->type ) : 'custom';
$block = array(
'blockName' => isset( $menu_items_by_parent_id[ $menu_item->ID ] ) ? 'core/navigation-submenu' : 'core/navigation-link',
'attrs' => array(
'className' => $class_name,
'description' => $menu_item->description,
'id' => $id,
'kind' => $kind,
'label' => $menu_item->title,
'opensInNewTab' => $opens_in_new_tab,
'rel' => $rel,
'title' => $menu_item->attr_title,
'type' => $menu_item->object,
'url' => $menu_item->url,
),
);
$block['innerBlocks'] = isset( $menu_items_by_parent_id[ $menu_item->ID ] )
? block_core_navigation_parse_blocks_from_menu_items( $menu_items_by_parent_id[ $menu_item->ID ], $menu_items_by_parent_id )
: array();
$block['innerContent'] = array_map( 'serialize_block', $block['innerBlocks'] );
$blocks[] = $block;
}
return $blocks;
} }
/** /**
@ -874,35 +874,3 @@ function block_core_navigation_typographic_presets_backcompatibility( $parsed_bl
} }
add_filter( 'render_block_data', 'block_core_navigation_typographic_presets_backcompatibility' ); add_filter( 'render_block_data', 'block_core_navigation_typographic_presets_backcompatibility' );
/**
* Enables animation of the block inspector for the Navigation block.
*
* See:
* - https://github.com/WordPress/gutenberg/pull/46342
* - https://github.com/WordPress/gutenberg/issues/45884
*
* @param array $settings Default editor settings.
* @return array Filtered editor settings.
*/
function block_core_navigation_enable_inspector_animation( $settings ) {
$current_animation_settings = _wp_array_get(
$settings,
array( '__experimentalBlockInspectorAnimation' ),
array()
);
$settings['__experimentalBlockInspectorAnimation'] = array_merge(
$current_animation_settings,
array(
'core/navigation' =>
array(
'enterDirection' => 'leftToRight',
),
)
);
return $settings;
}
add_filter( 'block_editor_settings_all', 'block_core_navigation_enable_inspector_animation' );

View File

@ -18,12 +18,19 @@ function render_block_core_read_more( $attributes, $content, $block ) {
return ''; return '';
} }
$post_ID = $block->context['postId']; $post_ID = $block->context['postId'];
$post_title = get_the_title( $post_ID ); $post_title = get_the_title( $post_ID );
if ( '' === $post_title ) {
$post_title = sprintf(
/* translators: %s is post ID to describe the link for screen readers. */
__( 'untitled post %s' ),
$post_ID
);
}
$screen_reader_text = sprintf( $screen_reader_text = sprintf(
/* translators: %s is either the post title or post ID to describe the link for screen readers. */ /* translators: %s is either the post title or post ID to describe the link for screen readers. */
__( ': %s' ), __( ': %s' ),
'' !== $post_title ? $post_title : __( 'untitled post ' ) . $post_ID $post_title
); );
$justify_class_name = empty( $attributes['justifyContent'] ) ? '' : "is-justified-{$attributes['justifyContent']}"; $justify_class_name = empty( $attributes['justifyContent'] ) ? '' : "is-justified-{$attributes['justifyContent']}";
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $justify_class_name ) ); $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $justify_class_name ) );

View File

@ -1432,6 +1432,24 @@
content:attr(aria-label); content:attr(aria-label);
} }
.block-editor-inspector-controls-tabs__hint{
align-items:top;
background:#f0f0f0;
border-radius:2px;
color:#1e1e1e;
display:flex;
flex-direction:row;
margin:16px;
}
.block-editor-inspector-controls-tabs__hint-content{
margin:12px 12px 12px 0;
}
.block-editor-inspector-controls-tabs__hint-dismiss{
margin:4px 0 4px 4px;
}
.block-editor-inspector-popover-header{ .block-editor-inspector-popover-header{
margin-bottom:16px; margin-bottom:16px;
} }

File diff suppressed because one or more lines are too long

View File

@ -1432,6 +1432,24 @@
content:attr(aria-label); content:attr(aria-label);
} }
.block-editor-inspector-controls-tabs__hint{
align-items:top;
background:#f0f0f0;
border-radius:2px;
color:#1e1e1e;
display:flex;
flex-direction:row;
margin:16px;
}
.block-editor-inspector-controls-tabs__hint-content{
margin:12px 0 12px 12px;
}
.block-editor-inspector-controls-tabs__hint-dismiss{
margin:4px 4px 4px 0;
}
.block-editor-inspector-popover-header{ .block-editor-inspector-popover-header{
margin-bottom:16px; margin-bottom:16px;
} }

File diff suppressed because one or more lines are too long

View File

@ -288,18 +288,33 @@ body.is-fullscreen-mode .interface-interface-skeleton{
} }
.interface-interface-skeleton__actions{ .interface-interface-skeleton__actions{
background:#fff;
bottom:auto; bottom:auto;
color:#1e1e1e; color:#1e1e1e;
left:0; left:0;
position:fixed !important; position:fixed !important;
right:auto; right:auto;
top:-9999em; top:-9999em;
width:280px; width:100vw;
z-index:100000; z-index:100000;
} }
@media (min-width:782px){
.interface-interface-skeleton__actions{
width:280px;
}
}
.interface-interface-skeleton__actions:focus,.interface-interface-skeleton__actions:focus-within{ .interface-interface-skeleton__actions:focus,.interface-interface-skeleton__actions:focus-within{
bottom:0; bottom:0;
top:auto; top:46px;
}
@media (min-width:782px){
.interface-interface-skeleton__actions:focus,.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{
top:0;
}
} }
.interface-more-menu-dropdown{ .interface-more-menu-dropdown{
@ -1019,6 +1034,10 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar{
top:auto; top:auto;
} }
.edit-post-layout .entities-saved-states__panel-header{
height:61px;
}
.edit-post-block-manager__no-results{ .edit-post-block-manager__no-results{
font-style:italic; font-style:italic;
padding:24px 0; padding:24px 0;

File diff suppressed because one or more lines are too long

View File

@ -288,18 +288,33 @@ body.is-fullscreen-mode .interface-interface-skeleton{
} }
.interface-interface-skeleton__actions{ .interface-interface-skeleton__actions{
background:#fff;
bottom:auto; bottom:auto;
color:#1e1e1e; color:#1e1e1e;
left:auto; left:auto;
position:fixed !important; position:fixed !important;
right:0; right:0;
top:-9999em; top:-9999em;
width:280px; width:100vw;
z-index:100000; z-index:100000;
} }
@media (min-width:782px){
.interface-interface-skeleton__actions{
width:280px;
}
}
.interface-interface-skeleton__actions:focus,.interface-interface-skeleton__actions:focus-within{ .interface-interface-skeleton__actions:focus,.interface-interface-skeleton__actions:focus-within{
bottom:0; bottom:0;
top:auto; top:46px;
}
@media (min-width:782px){
.interface-interface-skeleton__actions:focus,.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{
top:0;
}
} }
.interface-more-menu-dropdown{ .interface-more-menu-dropdown{
@ -1019,6 +1034,10 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar{
top:auto; top:auto;
} }
.edit-post-layout .entities-saved-states__panel-header{
height:61px;
}
.edit-post-block-manager__no-results{ .edit-post-block-manager__no-results{
font-style:italic; font-style:italic;
padding:24px 0; padding:24px 0;

File diff suppressed because one or more lines are too long

View File

@ -288,18 +288,33 @@ body.is-fullscreen-mode .interface-interface-skeleton{
} }
.interface-interface-skeleton__actions{ .interface-interface-skeleton__actions{
background:#fff;
bottom:auto; bottom:auto;
color:#1e1e1e; color:#1e1e1e;
left:0; left:0;
position:fixed !important; position:fixed !important;
right:auto; right:auto;
top:-9999em; top:-9999em;
width:280px; width:100vw;
z-index:100000; z-index:100000;
} }
@media (min-width:782px){
.interface-interface-skeleton__actions{
width:280px;
}
}
.interface-interface-skeleton__actions:focus,.interface-interface-skeleton__actions:focus-within{ .interface-interface-skeleton__actions:focus,.interface-interface-skeleton__actions:focus-within{
bottom:0; bottom:0;
top:auto; top:46px;
}
@media (min-width:782px){
.interface-interface-skeleton__actions:focus,.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{
top:0;
}
} }
.interface-more-menu-dropdown{ .interface-more-menu-dropdown{
@ -922,7 +937,6 @@ textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area:-ms-inp
.edit-site-global-styles__block-preview-panel{ .edit-site-global-styles__block-preview-panel{
border:1px solid #e0e0e0; border:1px solid #e0e0e0;
border-radius:2px; border-radius:2px;
height:152px;
overflow:auto; overflow:auto;
position:relative; position:relative;
width:100%; width:100%;
@ -1679,7 +1693,7 @@ h3.edit-site-template-card__template-areas-title{
padding:24px; padding:24px;
width:280px; width:280px;
} }
.interface-interface-skeleton__actions:focus .edit-site-editor__toggle-save-panel,.interface-interface-skeleton__actions:focus-within .edit-site-editor__toggle-save-panel{ .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; bottom:0;
top:auto; top:auto;
} }
@ -2033,28 +2047,9 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
top:0; top:0;
} }
.edit-site-layout__sidebar>div{ .edit-site-layout__sidebar>div{
min-height:100%; display:flex;
overflow-y:auto; flex-direction:column;
scrollbar-color:#757575 #1e1e1e; height:100%;
scrollbar-gutter:stable;
scrollbar-width:thin;
visibility:hidden;
}
.edit-site-layout__sidebar>div::-webkit-scrollbar{
height:12px;
width:12px;
}
.edit-site-layout__sidebar>div::-webkit-scrollbar-track{
background-color:#1e1e1e;
}
.edit-site-layout__sidebar>div::-webkit-scrollbar-thumb{
background-clip:padding-box;
background-color:#757575;
border:3px solid transparent;
border-radius:8px;
}
.edit-site-layout__sidebar>div:focus,.edit-site-layout__sidebar>div:hover,.edit-site-layout__sidebar>div>*{
visibility:visible;
} }
.edit-site-layout__sidebar .resizable-editor__drag-handle{ .edit-site-layout__sidebar .resizable-editor__drag-handle{
left:0; left:0;
@ -2154,6 +2149,67 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
display:flex; display:flex;
} }
.edit-site-layout__actions{
background:#fff;
bottom:auto;
color:#1e1e1e;
left:0;
position:fixed !important;
right:auto;
top:-9999em;
width:280px;
z-index:100000;
}
.edit-site-layout__actions:focus,.edit-site-layout__actions:focus-within{
bottom:0;
top:0;
}
@media (min-width:782px){
.edit-site-layout__actions{
border-right:1px solid #ddd;
}
}
@media (min-width:600px){
.edit-site-save-panel__modal{
width:600px;
}
}
.edit-site-sidebar__content{
flex-grow:1;
overflow-y:auto;
scrollbar-color:#757575 #1e1e1e;
scrollbar-gutter:stable;
scrollbar-width:thin;
visibility:hidden;
}
.edit-site-sidebar__content::-webkit-scrollbar{
height:12px;
width:12px;
}
.edit-site-sidebar__content::-webkit-scrollbar-track{
background-color:#1e1e1e;
}
.edit-site-sidebar__content::-webkit-scrollbar-thumb{
background-clip:padding-box;
background-color:#757575;
border:3px solid transparent;
border-radius:8px;
}
.edit-site-sidebar__content:focus,.edit-site-sidebar__content:hover,.edit-site-sidebar__content>*{
visibility:visible;
}
.edit-site-sidebar__footer{
border-top:1px solid #2f2f2f;
display:flex;
flex-shrink:0;
justify-content:flex-end;
margin:0 24px;
padding:24px 0;
}
.edit-site-sidebar__content.edit-site-sidebar__content{ .edit-site-sidebar__content.edit-site-sidebar__content{
overflow-x:unset; overflow-x:unset;
} }
@ -2252,6 +2308,7 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
} }
.edit-site-site-hub__edit-button{ .edit-site-site-hub__edit-button{
color:#fff;
height:32px; height:32px;
} }

File diff suppressed because one or more lines are too long

View File

@ -288,18 +288,33 @@ body.is-fullscreen-mode .interface-interface-skeleton{
} }
.interface-interface-skeleton__actions{ .interface-interface-skeleton__actions{
background:#fff;
bottom:auto; bottom:auto;
color:#1e1e1e; color:#1e1e1e;
left:auto; left:auto;
position:fixed !important; position:fixed !important;
right:0; right:0;
top:-9999em; top:-9999em;
width:280px; width:100vw;
z-index:100000; z-index:100000;
} }
@media (min-width:782px){
.interface-interface-skeleton__actions{
width:280px;
}
}
.interface-interface-skeleton__actions:focus,.interface-interface-skeleton__actions:focus-within{ .interface-interface-skeleton__actions:focus,.interface-interface-skeleton__actions:focus-within{
bottom:0; bottom:0;
top:auto; top:46px;
}
@media (min-width:782px){
.interface-interface-skeleton__actions:focus,.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{
top:0;
}
} }
.interface-more-menu-dropdown{ .interface-more-menu-dropdown{
@ -922,7 +937,6 @@ textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area:-ms-inp
.edit-site-global-styles__block-preview-panel{ .edit-site-global-styles__block-preview-panel{
border:1px solid #e0e0e0; border:1px solid #e0e0e0;
border-radius:2px; border-radius:2px;
height:152px;
overflow:auto; overflow:auto;
position:relative; position:relative;
width:100%; width:100%;
@ -1679,7 +1693,7 @@ h3.edit-site-template-card__template-areas-title{
padding:24px; padding:24px;
width:280px; width:280px;
} }
.interface-interface-skeleton__actions:focus .edit-site-editor__toggle-save-panel,.interface-interface-skeleton__actions:focus-within .edit-site-editor__toggle-save-panel{ .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; bottom:0;
top:auto; top:auto;
} }
@ -2033,28 +2047,9 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
top:0; top:0;
} }
.edit-site-layout__sidebar>div{ .edit-site-layout__sidebar>div{
min-height:100%; display:flex;
overflow-y:auto; flex-direction:column;
scrollbar-color:#757575 #1e1e1e; height:100%;
scrollbar-gutter:stable;
scrollbar-width:thin;
visibility:hidden;
}
.edit-site-layout__sidebar>div::-webkit-scrollbar{
height:12px;
width:12px;
}
.edit-site-layout__sidebar>div::-webkit-scrollbar-track{
background-color:#1e1e1e;
}
.edit-site-layout__sidebar>div::-webkit-scrollbar-thumb{
background-clip:padding-box;
background-color:#757575;
border:3px solid transparent;
border-radius:8px;
}
.edit-site-layout__sidebar>div:focus,.edit-site-layout__sidebar>div:hover,.edit-site-layout__sidebar>div>*{
visibility:visible;
} }
.edit-site-layout__sidebar .resizable-editor__drag-handle{ .edit-site-layout__sidebar .resizable-editor__drag-handle{
right:0; right:0;
@ -2154,6 +2149,67 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
display:flex; display:flex;
} }
.edit-site-layout__actions{
background:#fff;
bottom:auto;
color:#1e1e1e;
left:auto;
position:fixed !important;
right:0;
top:-9999em;
width:280px;
z-index:100000;
}
.edit-site-layout__actions:focus,.edit-site-layout__actions:focus-within{
bottom:0;
top:0;
}
@media (min-width:782px){
.edit-site-layout__actions{
border-left:1px solid #ddd;
}
}
@media (min-width:600px){
.edit-site-save-panel__modal{
width:600px;
}
}
.edit-site-sidebar__content{
flex-grow:1;
overflow-y:auto;
scrollbar-color:#757575 #1e1e1e;
scrollbar-gutter:stable;
scrollbar-width:thin;
visibility:hidden;
}
.edit-site-sidebar__content::-webkit-scrollbar{
height:12px;
width:12px;
}
.edit-site-sidebar__content::-webkit-scrollbar-track{
background-color:#1e1e1e;
}
.edit-site-sidebar__content::-webkit-scrollbar-thumb{
background-clip:padding-box;
background-color:#757575;
border:3px solid transparent;
border-radius:8px;
}
.edit-site-sidebar__content:focus,.edit-site-sidebar__content:hover,.edit-site-sidebar__content>*{
visibility:visible;
}
.edit-site-sidebar__footer{
border-top:1px solid #2f2f2f;
display:flex;
flex-shrink:0;
justify-content:flex-end;
margin:0 24px;
padding:24px 0;
}
.edit-site-sidebar__content.edit-site-sidebar__content{ .edit-site-sidebar__content.edit-site-sidebar__content{
overflow-x:unset; overflow-x:unset;
} }
@ -2252,6 +2308,7 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
} }
.edit-site-site-hub__edit-button{ .edit-site-site-hub__edit-button{
color:#fff;
height:32px; height:32px;
} }

File diff suppressed because one or more lines are too long

View File

@ -288,18 +288,33 @@ body.is-fullscreen-mode .interface-interface-skeleton{
} }
.interface-interface-skeleton__actions{ .interface-interface-skeleton__actions{
background:#fff;
bottom:auto; bottom:auto;
color:#1e1e1e; color:#1e1e1e;
left:0; left:0;
position:fixed !important; position:fixed !important;
right:auto; right:auto;
top:-9999em; top:-9999em;
width:280px; width:100vw;
z-index:100000; z-index:100000;
} }
@media (min-width:782px){
.interface-interface-skeleton__actions{
width:280px;
}
}
.interface-interface-skeleton__actions:focus,.interface-interface-skeleton__actions:focus-within{ .interface-interface-skeleton__actions:focus,.interface-interface-skeleton__actions:focus-within{
bottom:0; bottom:0;
top:auto; top:46px;
}
@media (min-width:782px){
.interface-interface-skeleton__actions:focus,.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{
top:0;
}
} }
.interface-more-menu-dropdown{ .interface-more-menu-dropdown{

File diff suppressed because one or more lines are too long

View File

@ -288,18 +288,33 @@ body.is-fullscreen-mode .interface-interface-skeleton{
} }
.interface-interface-skeleton__actions{ .interface-interface-skeleton__actions{
background:#fff;
bottom:auto; bottom:auto;
color:#1e1e1e; color:#1e1e1e;
left:auto; left:auto;
position:fixed !important; position:fixed !important;
right:0; right:0;
top:-9999em; top:-9999em;
width:280px; width:100vw;
z-index:100000; z-index:100000;
} }
@media (min-width:782px){
.interface-interface-skeleton__actions{
width:280px;
}
}
.interface-interface-skeleton__actions:focus,.interface-interface-skeleton__actions:focus-within{ .interface-interface-skeleton__actions:focus,.interface-interface-skeleton__actions:focus-within{
bottom:0; bottom:0;
top:auto; top:46px;
}
@media (min-width:782px){
.interface-interface-skeleton__actions:focus,.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{
top:0;
}
} }
.interface-more-menu-dropdown{ .interface-more-menu-dropdown{

File diff suppressed because one or more lines are too long

View File

@ -141,51 +141,34 @@
margin-top:12px; margin-top:12px;
} }
.entities-saved-states__panel{ .entities-saved-states__find-entity{
background:#fff;
bottom:0;
box-sizing:border-box;
left:0;
overflow:auto;
position:fixed;
right:0;
top:46px;
z-index:100001;
}
.entities-saved-states__panel *,.entities-saved-states__panel :after,.entities-saved-states__panel :before{
box-sizing:inherit;
}
.entities-saved-states__panel .entities-saved-states__find-entity{
display:none; display:none;
} }
.entities-saved-states__panel .entities-saved-states__find-entity-small{ @media (min-width:782px){
.entities-saved-states__find-entity{
display:block;
}
}
.entities-saved-states__find-entity-small{
display:block; display:block;
} }
@media (min-width:782px){ @media (min-width:782px){
.entities-saved-states__panel{ .entities-saved-states__find-entity-small{
border-right:1px solid #ddd;
right:auto;
top:32px;
width:280px;
}
body.is-fullscreen-mode .entities-saved-states__panel{
top:0;
}
.entities-saved-states__panel .entities-saved-states__find-entity{
display:block;
}
.entities-saved-states__panel .entities-saved-states__find-entity-small{
display:none; display:none;
} }
} }
.entities-saved-states__panel .entities-saved-states__panel-header{
.entities-saved-states__panel-header{
background:#fff; background:#fff;
border-bottom:1px solid #ddd; border-bottom:1px solid #ddd;
height:61px; box-sizing:border-box;
height:60px;
padding-left:8px; padding-left:8px;
padding-right:8px; padding-right:8px;
} }
.entities-saved-states__panel .entities-saved-states__text-prompt{
.entities-saved-states__text-prompt{
padding:16px 16px 4px; padding:16px 16px 4px;
} }

File diff suppressed because one or more lines are too long

View File

@ -141,51 +141,34 @@
margin-top:12px; margin-top:12px;
} }
.entities-saved-states__panel{ .entities-saved-states__find-entity{
background:#fff;
bottom:0;
box-sizing:border-box;
left:0;
overflow:auto;
position:fixed;
right:0;
top:46px;
z-index:100001;
}
.entities-saved-states__panel *,.entities-saved-states__panel :after,.entities-saved-states__panel :before{
box-sizing:inherit;
}
.entities-saved-states__panel .entities-saved-states__find-entity{
display:none; display:none;
} }
.entities-saved-states__panel .entities-saved-states__find-entity-small{ @media (min-width:782px){
.entities-saved-states__find-entity{
display:block;
}
}
.entities-saved-states__find-entity-small{
display:block; display:block;
} }
@media (min-width:782px){ @media (min-width:782px){
.entities-saved-states__panel{ .entities-saved-states__find-entity-small{
border-left:1px solid #ddd;
left:auto;
top:32px;
width:280px;
}
body.is-fullscreen-mode .entities-saved-states__panel{
top:0;
}
.entities-saved-states__panel .entities-saved-states__find-entity{
display:block;
}
.entities-saved-states__panel .entities-saved-states__find-entity-small{
display:none; display:none;
} }
} }
.entities-saved-states__panel .entities-saved-states__panel-header{
.entities-saved-states__panel-header{
background:#fff; background:#fff;
border-bottom:1px solid #ddd; border-bottom:1px solid #ddd;
height:61px; box-sizing:border-box;
height:60px;
padding-left:8px; padding-left:8px;
padding-right:8px; padding-right:8px;
} }
.entities-saved-states__panel .entities-saved-states__text-prompt{
.entities-saved-states__text-prompt{
padding:16px 16px 4px; padding:16px 16px 4px;
} }

File diff suppressed because one or more lines are too long

View File

@ -3856,6 +3856,18 @@ const SETTINGS_DEFAULTS = {
__experimentalBlockPatternCategories: [], __experimentalBlockPatternCategories: [],
__unstableGalleryWithImageBlocks: false, __unstableGalleryWithImageBlocks: false,
__unstableIsPreviewMode: false, __unstableIsPreviewMode: false,
// This setting is `private` now with `lock` API.
blockInspectorAnimation: {
'core/navigation': {
enterDirection: 'leftToRight'
},
'core/navigation-submenu': {
enterDirection: 'rightToLeft'
},
'core/navigation-link': {
enterDirection: 'rightToLeft'
}
},
generateAnchors: false, generateAnchors: false,
// gradients setting is not used anymore now defaults are passed from theme.json on the server and core has its own defaults. // gradients setting is not used anymore now defaults are passed from theme.json on the server and core has its own defaults.
// The setting is only kept for backward compatibility purposes. // The setting is only kept for backward compatibility purposes.
@ -8841,7 +8853,7 @@ function __unstableIsWithinBlockOverlay(state, clientId) {
* @see https://github.com/WordPress/gutenberg/pull/46131 * @see https://github.com/WordPress/gutenberg/pull/46131
*/ */
const privateSettings = ['inserterMediaCategories']; const privateSettings = ['inserterMediaCategories', 'blockInspectorAnimation'];
/** /**
* Action that updates the block editor settings and * Action that updates the block editor settings and
* conditionally preserves the experimental ones. * conditionally preserves the experimental ones.
@ -15805,7 +15817,10 @@ function useBlockSync(_ref) {
previousAreBlocksDifferent = areBlocksDifferent; previousAreBlocksDifferent = areBlocksDifferent;
}); });
return () => unsubscribe(); return () => {
subscribed.current = false;
unsubscribe();
};
}, [registry, clientId]); }, [registry, clientId]);
} }
@ -37054,7 +37069,10 @@ function MobileTabNavigation(_ref2) {
// Preffered order of pattern categories. Any other categories should
// be at the bottom without any re-ordering.
const patternCategoriesOrder = ['featured', 'posts', 'text', 'gallery', 'call-to-action', 'banner', 'header', 'footer'];
function usePatternsCategories(rootClientId) { function usePatternsCategories(rootClientId) {
const [allPatterns, allCategories] = use_patterns_state(undefined, rootClientId); const [allPatterns, allCategories] = use_patterns_state(undefined, rootClientId);
@ -37079,12 +37097,18 @@ function usePatternsCategories(rootClientId) {
name: nextName name: nextName
} = _ref2; } = _ref2;
if (![currentName, nextName].some(categoryName => ['featured', 'text'].includes(categoryName))) { // The pattern categories should be ordered as follows:
// 1. The categories from `patternCategoriesOrder` in that specific order should be at the top.
// 2. The rest categories should be at the bottom without any re-ordering.
if (![currentName, nextName].some(categoryName => patternCategoriesOrder.includes(categoryName))) {
return 0; return 0;
} // Move `featured` category to the top and `text` to the bottom. }
if ([currentName, nextName].every(categoryName => patternCategoriesOrder.includes(categoryName))) {
return patternCategoriesOrder.indexOf(currentName) - patternCategoriesOrder.indexOf(nextName);
}
return currentName === 'featured' || nextName === 'text' ? -1 : 1; return patternCategoriesOrder.includes(currentName) ? -1 : 1;
}); });
if (allPatterns.some(pattern => !hasRegisteredCategory(pattern)) && !categories.find(category => category.name === 'uncategorized')) { if (allPatterns.some(pattern => !hasRegisteredCategory(pattern)) && !categories.find(category => category.name === 'uncategorized')) {
@ -59668,6 +59692,57 @@ const PositionControls = () => {
/* harmony default export */ var position_controls_panel = (PositionControls); /* harmony default export */ var position_controls_panel = (PositionControls);
;// CONCATENATED MODULE: external ["wp","preferences"]
var external_wp_preferences_namespaceObject = window["wp"]["preferences"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls-tabs/settings-tab-hint.js
/**
* WordPress dependencies
*/
const PREFERENCE_NAME = 'isInspectorControlsTabsHintVisible';
function InspectorControlsTabsHint() {
const isInspectorControlsTabsHintVisible = (0,external_wp_data_namespaceObject.useSelect)(select => {
var _select$get;
return (_select$get = select(external_wp_preferences_namespaceObject.store).get('core', PREFERENCE_NAME)) !== null && _select$get !== void 0 ? _select$get : true;
}, []);
const ref = (0,external_wp_element_namespaceObject.useRef)();
const {
set: setPreference
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store);
if (!isInspectorControlsTabsHintVisible) {
return null;
}
return (0,external_wp_element_namespaceObject.createElement)("div", {
ref: ref,
className: "block-editor-inspector-controls-tabs__hint"
}, (0,external_wp_element_namespaceObject.createElement)("div", {
className: "block-editor-inspector-controls-tabs__hint-content"
}, (0,external_wp_i18n_namespaceObject.__)("Looking for other block settings? They've moved to the styles tab.")), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
className: "block-editor-inspector-controls-tabs__hint-dismiss",
icon: library_close,
iconSize: "16",
label: (0,external_wp_i18n_namespaceObject.__)('Dismiss hint'),
onClick: () => {
// Retain focus when dismissing the element.
const previousElement = external_wp_dom_namespaceObject.focus.tabbable.findPrevious(ref.current);
previousElement === null || previousElement === void 0 ? void 0 : previousElement.focus();
setPreference('core', PREFERENCE_NAME, false);
},
showTooltip: false
}));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls-tabs/settings-tab.js ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls-tabs/settings-tab.js
@ -59678,11 +59753,12 @@ const PositionControls = () => {
const SettingsTab = _ref => { const SettingsTab = _ref => {
let { let {
showAdvancedControls = false showAdvancedControls = false
} = _ref; } = _ref;
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(inspector_controls.Slot, null), (0,external_wp_element_namespaceObject.createElement)(position_controls_panel, null), showAdvancedControls && (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)(advanced_controls_panel, null))); return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(inspector_controls.Slot, null), (0,external_wp_element_namespaceObject.createElement)(position_controls_panel, null), showAdvancedControls && (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)(advanced_controls_panel, null)), (0,external_wp_element_namespaceObject.createElement)(InspectorControlsTabsHint, null));
}; };
/* harmony default export */ var settings_tab = (SettingsTab); /* harmony default export */ var settings_tab = (SettingsTab);
@ -60050,8 +60126,7 @@ const BlockInspector = _ref5 => {
const showTabs = (availableTabs === null || availableTabs === void 0 ? void 0 : availableTabs.length) > 1; const showTabs = (availableTabs === null || availableTabs === void 0 ? void 0 : availableTabs.length) > 1;
const blockInspectorAnimationSettings = (0,external_wp_data_namespaceObject.useSelect)(select => { const blockInspectorAnimationSettings = (0,external_wp_data_namespaceObject.useSelect)(select => {
if (blockType) { if (blockType) {
const globalBlockInspectorAnimationSettings = select(store).getSettings().__experimentalBlockInspectorAnimation; const globalBlockInspectorAnimationSettings = select(store).getSettings().blockInspectorAnimation;
return globalBlockInspectorAnimationSettings === null || globalBlockInspectorAnimationSettings === void 0 ? void 0 : globalBlockInspectorAnimationSettings[blockType.name]; return globalBlockInspectorAnimationSettings === null || globalBlockInspectorAnimationSettings === void 0 ? void 0 : globalBlockInspectorAnimationSettings[blockType.name];
} }

File diff suppressed because one or more lines are too long

View File

@ -7848,6 +7848,78 @@ function SidebarNavigationScreenNavigationMenus() {
}); });
} }
;// CONCATENATED MODULE: external ["wp","keycodes"]
var external_wp_keycodes_namespaceObject = window["wp"]["keycodes"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/save-button/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function SaveButton() {
const {
isDirty,
isSaving,
isSaveViewOpen
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
__experimentalGetDirtyEntityRecords,
isSavingEntityRecord
} = select(external_wp_coreData_namespaceObject.store);
const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
const {
isSaveViewOpened
} = select(store_store);
return {
isDirty: dirtyEntityRecords.length > 0,
isSaving: dirtyEntityRecords.some(record => isSavingEntityRecord(record.kind, record.name, record.key)),
isSaveViewOpen: isSaveViewOpened()
};
}, []);
const {
setIsSaveViewOpened
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
const disabled = !isDirty || isSaving;
const label = (0,external_wp_i18n_namespaceObject.__)('Save');
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
variant: "primary",
className: "edit-site-save-button__button",
"aria-disabled": disabled,
"aria-expanded": isSaveViewOpen,
isBusy: isSaving,
onClick: disabled ? undefined : () => setIsSaveViewOpened(true),
label: label
/*
* We want the tooltip to show the keyboard shortcut only when the
* button does something, i.e. when it's not disabled.
*/
,
shortcut: disabled ? undefined : external_wp_keycodes_namespaceObject.displayShortcut.primary('s')
/*
* Displaying the keyboard shortcut conditionally makes the tooltip
* itself show conditionally. This would trigger a full-rerendering
* of the button that we want to avoid. By setting `showTooltip`,
& the tooltip is always rendered even when there's no keyboard shortcut.
*/
,
showTooltip: true
}, label);
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar/index.js ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar/index.js
@ -7856,6 +7928,8 @@ function SidebarNavigationScreenNavigationMenus() {
*/ */
/** /**
* Internal dependencies * Internal dependencies
*/ */
@ -7865,6 +7939,7 @@ function SidebarNavigationScreenNavigationMenus() {
function SidebarScreens() { function SidebarScreens() {
useSyncSidebarPathWithURL(); useSyncSidebarPathWithURL();
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)(SidebarNavigationScreenTemplates, { 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)(SidebarNavigationScreenTemplates, {
@ -7875,10 +7950,27 @@ function SidebarScreens() {
} }
function Sidebar() { function Sidebar() {
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorProvider, { 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", className: "edit-site-sidebar__content",
initialPath: "/" initialPath: "/"
}, (0,external_wp_element_namespaceObject.createElement)(SidebarScreens, null)); }, (0,external_wp_element_namespaceObject.createElement)(SidebarScreens, null)), isDirty && (0,external_wp_element_namespaceObject.createElement)("div", {
className: "edit-site-sidebar__footer"
}, (0,external_wp_element_namespaceObject.createElement)(SaveButton, null)));
} }
/* harmony default export */ var sidebar = ((0,external_wp_element_namespaceObject.memo)(Sidebar)); /* harmony default export */ var sidebar = ((0,external_wp_element_namespaceObject.memo)(Sidebar));
@ -8105,6 +8197,21 @@ const border = (0,external_wp_element_namespaceObject.createElement)(external_wp
})); }));
/* harmony default export */ var library_border = (border); /* harmony default export */ var library_border = (border);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/shadow.js
/**
* WordPress dependencies
*/
const shadow = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
viewBox: "0 0 24 24",
xmlns: "http://www.w3.org/2000/svg"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M12 8c-2.2 0-4 1.8-4 4s1.8 4 4 4 4-1.8 4-4-1.8-4-4-4zm0 6.5c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5zM12.8 3h-1.5v3h1.5V3zm-1.6 18h1.5v-3h-1.5v3zm6.8-9.8v1.5h3v-1.5h-3zm-12 0H3v1.5h3v-1.5zm9.7 5.6 2.1 2.1 1.1-1.1-2.1-2.1-1.1 1.1zM8.3 7.2 6.2 5.1 5.1 6.2l2.1 2.1 1.1-1.1zM5.1 17.8l1.1 1.1 2.1-2.1-1.1-1.1-2.1 2.1zM18.9 6.2l-1.1-1.1-2.1 2.1 1.1 1.1 2.1-2.1z"
}));
/* harmony default export */ var library_shadow = (shadow);
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/border-panel.js ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/border-panel.js
@ -9283,7 +9390,6 @@ function ScreenHeader(_ref) {
const BlockPreviewPanel = _ref => { const BlockPreviewPanel = _ref => {
var _getBlockType; var _getBlockType;
@ -9291,10 +9397,6 @@ const BlockPreviewPanel = _ref => {
name, name,
variation = '' variation = ''
} = _ref; } = _ref;
const [containerResizeListener, {
width: containerWidth,
height: containerHeight
}] = (0,external_wp_compose_namespaceObject.useResizeObserver)();
const blockExample = (_getBlockType = (0,external_wp_blocks_namespaceObject.getBlockType)(name)) === null || _getBlockType === void 0 ? void 0 : _getBlockType.example; const blockExample = (_getBlockType = (0,external_wp_blocks_namespaceObject.getBlockType)(name)) === null || _getBlockType === void 0 ? void 0 : _getBlockType.example;
const blockExampleWithVariation = { ...blockExample, const blockExampleWithVariation = { ...blockExample,
attributes: { ...(blockExample === null || blockExample === void 0 ? void 0 : blockExample.attributes), attributes: { ...(blockExample === null || blockExample === void 0 ? void 0 : blockExample.attributes),
@ -9302,21 +9404,25 @@ const BlockPreviewPanel = _ref => {
} }
}; };
const blocks = blockExample && (0,external_wp_blocks_namespaceObject.getBlockFromExample)(name, variation ? blockExampleWithVariation : blockExample); const blocks = blockExample && (0,external_wp_blocks_namespaceObject.getBlockFromExample)(name, variation ? blockExampleWithVariation : blockExample);
const viewportWidth = (blockExample === null || blockExample === void 0 ? void 0 : blockExample.viewportWidth) || containerWidth; const viewportWidth = (blockExample === null || blockExample === void 0 ? void 0 : blockExample.viewportWidth) || null;
const minHeight = containerHeight; const previewHeight = '150px';
return !blockExample ? null : (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalSpacer, { return !blockExample ? null : (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalSpacer, {
marginX: 4, marginX: 4,
marginBottom: 4 marginBottom: 4
}, (0,external_wp_element_namespaceObject.createElement)("div", { }, (0,external_wp_element_namespaceObject.createElement)("div", {
className: "edit-site-global-styles__block-preview-panel" className: "edit-site-global-styles__block-preview-panel",
}, containerResizeListener, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockPreview, { style: {
maxHeight: previewHeight,
boxSizing: 'initial'
}
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockPreview, {
blocks: blocks, blocks: blocks,
viewportWidth: viewportWidth, viewportWidth: viewportWidth,
minHeight: minHeight, minHeight: previewHeight,
additionalStyles: [{ additionalStyles: [{
css: ` css: `
body{ body{
min-height:${minHeight}px; min-height:${previewHeight};
display:flex;align-items:center;justify-content:center; display:flex;align-items:center;justify-content:center;
} }
` `
@ -9401,6 +9507,184 @@ function ScreenVariation(_ref2) {
})); }));
} }
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/shadow-panel.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const {
useGlobalSetting: shadow_panel_useGlobalSetting,
useGlobalStyle: shadow_panel_useGlobalStyle
} = unlock(external_wp_blockEditor_namespaceObject.experiments);
function useHasShadowControl(name) {
const supports = getSupportedGlobalStylesPanels(name);
return supports.includes('shadow');
}
function ShadowPanel(_ref) {
let {
name,
variation = ''
} = _ref;
const prefix = variation ? `variations.${variation}.` : '';
const [shadow, setShadow] = shadow_panel_useGlobalStyle(`${prefix}shadow`, name);
const [userShadow] = shadow_panel_useGlobalStyle(`${prefix}shadow`, name, 'user');
const hasShadow = () => !!userShadow;
const resetShadow = () => setShadow(undefined);
const resetAll = (0,external_wp_element_namespaceObject.useCallback)(() => resetShadow(undefined), [resetShadow]);
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanel, {
label: (0,external_wp_i18n_namespaceObject.__)('Shadow'),
resetAll: resetAll
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
label: (0,external_wp_i18n_namespaceObject.__)('Shadow'),
hasValue: hasShadow,
onDeselect: resetShadow,
isShownByDefault: true
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, {
isBordered: true,
isSeparated: true
}, (0,external_wp_element_namespaceObject.createElement)(ShadowPopover, {
shadow: shadow,
onShadowChange: setShadow
}))));
}
const ShadowPopover = _ref2 => {
let {
shadow,
onShadowChange
} = _ref2;
const popoverProps = {
placement: 'left-start',
offset: 36,
shift: true
};
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, {
popoverProps: popoverProps,
className: "edit-site-global-styles__shadow-dropdown",
renderToggle: renderShadowToggle(),
renderContent: () => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalDropdownContentWrapper, {
paddingSize: "medium"
}, (0,external_wp_element_namespaceObject.createElement)(ShadowPopoverContainer, {
shadow: shadow,
onShadowChange: onShadowChange
}))
});
};
function renderShadowToggle() {
return _ref3 => {
let {
onToggle,
isOpen
} = _ref3;
const toggleProps = {
onClick: onToggle,
className: classnames_default()({
'is-open': isOpen
}),
'aria-expanded': isOpen
};
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, toggleProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
justify: "flex-start"
}, (0,external_wp_element_namespaceObject.createElement)(IconWithCurrentColor, {
icon: library_shadow,
size: 24
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, {
className: "edit-site-global-styles__shadow-label"
}, (0,external_wp_i18n_namespaceObject.__)('Shadow'))));
};
}
function ShadowPopoverContainer(_ref4) {
let {
shadow,
onShadowChange
} = _ref4;
const [defaultShadows] = shadow_panel_useGlobalSetting('shadow.presets.default');
const [themeShadows] = shadow_panel_useGlobalSetting('shadow.presets.theme');
const [defaultPresetsEnabled] = shadow_panel_useGlobalSetting('shadow.defaultPresets');
const shadows = [...(defaultPresetsEnabled ? defaultShadows : []), ...(themeShadows || [])];
return (0,external_wp_element_namespaceObject.createElement)("div", {
className: "edit-site-global-styles__shadow-panel"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalVStack, {
spacing: 4
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHeading, {
level: 5
}, (0,external_wp_i18n_namespaceObject.__)('Shadow')), (0,external_wp_element_namespaceObject.createElement)(ShadowPresets, {
presets: shadows,
activeShadow: shadow,
onSelect: onShadowChange
})));
}
function ShadowPresets(_ref5) {
let {
presets,
activeShadow,
onSelect
} = _ref5;
return !presets ? null : (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalGrid, {
columns: 6,
gap: 0,
align: "center",
justify: "center"
}, presets.map((_ref6, i) => {
let {
name,
shadow
} = _ref6;
return (0,external_wp_element_namespaceObject.createElement)(ShadowIndicator, {
key: i,
label: name,
isActive: shadow === activeShadow,
onSelect: () => onSelect(shadow === activeShadow ? undefined : shadow),
shadow: shadow
});
}));
}
function ShadowIndicator(_ref7) {
let {
label,
isActive,
onSelect,
shadow
} = _ref7;
return (0,external_wp_element_namespaceObject.createElement)("div", {
className: "edit-site-global-styles__shadow-indicator-wrapper"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
className: "edit-site-global-styles__shadow-indicator",
onClick: onSelect,
"aria-label": label,
style: {
boxShadow: shadow
}
}, isActive && (0,external_wp_element_namespaceObject.createElement)(build_module_icon, {
icon: library_check
})));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/context-menu.js ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/context-menu.js
@ -9425,6 +9709,7 @@ function ScreenVariation(_ref2) {
function ContextMenu(_ref) { function ContextMenu(_ref) {
let { let {
name, name,
@ -9433,6 +9718,7 @@ function ContextMenu(_ref) {
const hasTypographyPanel = useHasTypographyPanel(name); const hasTypographyPanel = useHasTypographyPanel(name);
const hasColorPanel = useHasColorPanel(name); const hasColorPanel = useHasColorPanel(name);
const hasBorderPanel = useHasBorderPanel(name); const hasBorderPanel = useHasBorderPanel(name);
const hasEffectsPanel = useHasShadowControl(name);
const hasDimensionsPanel = useHasDimensionsPanel(name); const hasDimensionsPanel = useHasDimensionsPanel(name);
const hasLayoutPanel = hasDimensionsPanel; const hasLayoutPanel = hasDimensionsPanel;
const hasVariationsPanel = useHasVariationsPanel(name, parentMenu); const hasVariationsPanel = useHasVariationsPanel(name, parentMenu);
@ -9465,8 +9751,12 @@ function ContextMenu(_ref) {
}, (0,external_wp_i18n_namespaceObject.__)('Colors')), hasBorderPanel && (0,external_wp_element_namespaceObject.createElement)(NavigationButtonAsItem, { }, (0,external_wp_i18n_namespaceObject.__)('Colors')), hasBorderPanel && (0,external_wp_element_namespaceObject.createElement)(NavigationButtonAsItem, {
icon: library_border, icon: library_border,
path: parentMenu + '/border', path: parentMenu + '/border',
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Border & shadow styles') "aria-label": (0,external_wp_i18n_namespaceObject.__)('Border')
}, (0,external_wp_i18n_namespaceObject.__)('Border & Shadow')), hasLayoutPanel && (0,external_wp_element_namespaceObject.createElement)(NavigationButtonAsItem, { }, (0,external_wp_i18n_namespaceObject.__)('Border')), hasEffectsPanel && (0,external_wp_element_namespaceObject.createElement)(NavigationButtonAsItem, {
icon: library_shadow,
path: parentMenu + '/effects',
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Shadow')
}, (0,external_wp_i18n_namespaceObject.__)('Shadow')), hasLayoutPanel && (0,external_wp_element_namespaceObject.createElement)(NavigationButtonAsItem, {
icon: library_layout, icon: library_layout,
path: parentMenu + '/layout', path: parentMenu + '/layout',
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Layout styles') "aria-label": (0,external_wp_i18n_namespaceObject.__)('Layout styles')
@ -11289,8 +11579,6 @@ function ScreenLayout(_ref) {
// EXTERNAL MODULE: ./node_modules/fast-deep-equal/es6/index.js // EXTERNAL MODULE: ./node_modules/fast-deep-equal/es6/index.js
var es6 = __webpack_require__(5619); var es6 = __webpack_require__(5619);
var es6_default = /*#__PURE__*/__webpack_require__.n(es6); var es6_default = /*#__PURE__*/__webpack_require__.n(es6);
;// CONCATENATED MODULE: external ["wp","keycodes"]
var external_wp_keycodes_namespaceObject = window["wp"]["keycodes"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/canvas-spinner/index.js ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/canvas-spinner/index.js
@ -11624,199 +11912,6 @@ function ScreenStyleVariations() {
/* harmony default export */ var screen_style_variations = (ScreenStyleVariations); /* harmony default export */ var screen_style_variations = (ScreenStyleVariations);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/shadow.js
/**
* WordPress dependencies
*/
const shadow = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
viewBox: "0 0 24 24",
xmlns: "http://www.w3.org/2000/svg"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M12 8c-2.2 0-4 1.8-4 4s1.8 4 4 4 4-1.8 4-4-1.8-4-4-4zm0 6.5c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5zM12.8 3h-1.5v3h1.5V3zm-1.6 18h1.5v-3h-1.5v3zm6.8-9.8v1.5h3v-1.5h-3zm-12 0H3v1.5h3v-1.5zm9.7 5.6 2.1 2.1 1.1-1.1-2.1-2.1-1.1 1.1zM8.3 7.2 6.2 5.1 5.1 6.2l2.1 2.1 1.1-1.1zM5.1 17.8l1.1 1.1 2.1-2.1-1.1-1.1-2.1 2.1zM18.9 6.2l-1.1-1.1-2.1 2.1 1.1 1.1 2.1-2.1z"
}));
/* harmony default export */ var library_shadow = (shadow);
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/shadow-panel.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const {
useGlobalSetting: shadow_panel_useGlobalSetting,
useGlobalStyle: shadow_panel_useGlobalStyle
} = unlock(external_wp_blockEditor_namespaceObject.experiments);
function useHasShadowControl(name) {
const supports = getSupportedGlobalStylesPanels(name);
return supports.includes('shadow');
}
function ShadowPanel(_ref) {
let {
name,
variation = ''
} = _ref;
const prefix = variation ? `variations.${variation}.` : '';
const [shadow, setShadow] = shadow_panel_useGlobalStyle(`${prefix}shadow`, name);
const [userShadow] = shadow_panel_useGlobalStyle(`${prefix}shadow`, name, 'user');
const hasShadow = () => !!userShadow;
const resetShadow = () => setShadow(undefined);
const resetAll = (0,external_wp_element_namespaceObject.useCallback)(() => resetShadow(undefined), [resetShadow]);
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanel, {
label: (0,external_wp_i18n_namespaceObject.__)('Shadow'),
resetAll: resetAll
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
label: (0,external_wp_i18n_namespaceObject.__)('Shadow'),
hasValue: hasShadow,
onDeselect: resetShadow,
isShownByDefault: true
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, {
isBordered: true,
isSeparated: true
}, (0,external_wp_element_namespaceObject.createElement)(ShadowPopover, {
shadow: shadow,
onShadowChange: setShadow
}))));
}
const ShadowPopover = _ref2 => {
let {
shadow,
onShadowChange
} = _ref2;
const popoverProps = {
placement: 'left-start',
offset: 36,
shift: true
};
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, {
popoverProps: popoverProps,
className: "edit-site-global-styles__shadow-dropdown",
renderToggle: renderShadowToggle(),
renderContent: () => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalDropdownContentWrapper, {
paddingSize: "medium"
}, (0,external_wp_element_namespaceObject.createElement)(ShadowPopoverContainer, {
shadow: shadow,
onShadowChange: onShadowChange
}))
});
};
function renderShadowToggle() {
return _ref3 => {
let {
onToggle,
isOpen
} = _ref3;
const toggleProps = {
onClick: onToggle,
className: classnames_default()({
'is-open': isOpen
}),
'aria-expanded': isOpen
};
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, toggleProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
justify: "flex-start"
}, (0,external_wp_element_namespaceObject.createElement)(IconWithCurrentColor, {
icon: library_shadow,
size: 24
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, {
className: "edit-site-global-styles__shadow-label"
}, (0,external_wp_i18n_namespaceObject.__)('Shadow'))));
};
}
function ShadowPopoverContainer(_ref4) {
let {
shadow,
onShadowChange
} = _ref4;
const [defaultShadows] = shadow_panel_useGlobalSetting('shadow.presets.default');
const [themeShadows] = shadow_panel_useGlobalSetting('shadow.presets.theme');
const [defaultPresetsEnabled] = shadow_panel_useGlobalSetting('shadow.defaultPresets');
const shadows = [...(defaultPresetsEnabled ? defaultShadows : []), ...(themeShadows || [])];
return (0,external_wp_element_namespaceObject.createElement)("div", {
className: "edit-site-global-styles__shadow-panel"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalVStack, {
spacing: 4
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHeading, {
level: 5
}, (0,external_wp_i18n_namespaceObject.__)('Shadows')), (0,external_wp_element_namespaceObject.createElement)(ShadowPresets, {
presets: shadows,
activeShadow: shadow,
onSelect: onShadowChange
})));
}
function ShadowPresets(_ref5) {
let {
presets,
activeShadow,
onSelect
} = _ref5;
return !presets ? null : (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalGrid, {
columns: 6,
gap: 0,
align: "center",
justify: "center"
}, presets.map((_ref6, i) => {
let {
name,
shadow
} = _ref6;
return (0,external_wp_element_namespaceObject.createElement)(ShadowIndicator, {
key: i,
label: name,
isActive: shadow === activeShadow,
onSelect: () => onSelect(shadow === activeShadow ? undefined : shadow),
shadow: shadow
});
}));
}
function ShadowIndicator(_ref7) {
let {
label,
isActive,
onSelect,
shadow
} = _ref7;
return (0,external_wp_element_namespaceObject.createElement)("div", {
className: "edit-site-global-styles__shadow-indicator-wrapper"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
className: "edit-site-global-styles__shadow-indicator",
onClick: onSelect,
"aria-label": label,
style: {
boxShadow: shadow
}
}, isActive && (0,external_wp_element_namespaceObject.createElement)(build_module_icon, {
icon: library_check
})));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-border.js ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-border.js
@ -11833,7 +11928,6 @@ function ShadowIndicator(_ref7) {
function ScreenBorder(_ref) { function ScreenBorder(_ref) {
let { let {
name, name,
@ -11841,7 +11935,6 @@ function ScreenBorder(_ref) {
} = _ref; } = _ref;
const hasBorderPanel = useHasBorderPanel(name); const hasBorderPanel = useHasBorderPanel(name);
const variationClassName = getVariationClassName(variation); const variationClassName = getVariationClassName(variation);
const hasShadowPanel = useHasShadowControl(name);
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(header, { 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 & Shadow')
}), (0,external_wp_element_namespaceObject.createElement)(block_preview_panel, { }), (0,external_wp_element_namespaceObject.createElement)(block_preview_panel, {
@ -11850,9 +11943,6 @@ function ScreenBorder(_ref) {
}), hasBorderPanel && (0,external_wp_element_namespaceObject.createElement)(BorderPanel, { }), hasBorderPanel && (0,external_wp_element_namespaceObject.createElement)(BorderPanel, {
name: name, name: name,
variation: variation variation: variation
}), hasShadowPanel && (0,external_wp_element_namespaceObject.createElement)(ShadowPanel, {
name: name,
variation: variation
})); }));
} }
@ -12173,6 +12263,42 @@ function ScreenCSS(_ref) {
/* harmony default export */ var screen_css = (ScreenCSS); /* harmony default export */ var screen_css = (ScreenCSS);
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-effects.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function ScreenEffects(_ref) {
let {
name,
variation = ''
} = _ref;
const variationClassName = getVariationClassName(variation);
const hasShadowPanel = useHasShadowControl(name);
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.__)('Shadow')
}), (0,external_wp_element_namespaceObject.createElement)(block_preview_panel, {
name: name,
variation: variationClassName
}), hasShadowPanel && (0,external_wp_element_namespaceObject.createElement)(ShadowPanel, {
name: name,
variation: variation
}));
}
/* harmony default export */ var screen_effects = (ScreenEffects);
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/ui.js ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/ui.js
@ -12210,6 +12336,7 @@ function ScreenCSS(_ref) {
const ui_SLOT_FILL_NAME = 'GlobalStylesMenu'; const ui_SLOT_FILL_NAME = 'GlobalStylesMenu';
const { const {
@ -12389,6 +12516,11 @@ function ContextScreens(_ref4) {
}, (0,external_wp_element_namespaceObject.createElement)(screen_border, { }, (0,external_wp_element_namespaceObject.createElement)(screen_border, {
name: name, name: name,
variation: variation variation: variation
})), (0,external_wp_element_namespaceObject.createElement)(GlobalStylesNavigationScreen, {
path: parentMenu + '/effects'
}, (0,external_wp_element_namespaceObject.createElement)(screen_effects, {
name: name,
variation: variation
})), (0,external_wp_element_namespaceObject.createElement)(GlobalStylesNavigationScreen, { })), (0,external_wp_element_namespaceObject.createElement)(GlobalStylesNavigationScreen, {
path: parentMenu + '/layout' path: parentMenu + '/layout'
}, (0,external_wp_element_namespaceObject.createElement)(screen_layout, { }, (0,external_wp_element_namespaceObject.createElement)(screen_layout, {
@ -14451,7 +14583,6 @@ function Editor() {
isRightSidebarOpen, isRightSidebarOpen,
isInserterOpen, isInserterOpen,
isListViewOpen, isListViewOpen,
isSaveViewOpen,
showIconLabels showIconLabels
} = (0,external_wp_data_namespaceObject.useSelect)(select => { } = (0,external_wp_data_namespaceObject.useSelect)(select => {
const { const {
@ -14461,8 +14592,7 @@ function Editor() {
getEditorMode, getEditorMode,
getCanvasMode, getCanvasMode,
isInserterOpened, isInserterOpened,
isListViewOpened, isListViewOpened
isSaveViewOpened
} = unlock(select(store_store)); } = unlock(select(store_store));
const { const {
hasFinishedResolution, hasFinishedResolution,
@ -14489,13 +14619,11 @@ function Editor() {
blockEditorMode: __unstableGetEditorMode(), blockEditorMode: __unstableGetEditorMode(),
isInserterOpen: isInserterOpened(), isInserterOpen: isInserterOpened(),
isListViewOpen: isListViewOpened(), isListViewOpen: isListViewOpened(),
isSaveViewOpen: isSaveViewOpened(),
isRightSidebarOpen: getActiveComplementaryArea(store_store.name), isRightSidebarOpen: getActiveComplementaryArea(store_store.name),
showIconLabels: select(external_wp_preferences_namespaceObject.store).get('core/edit-site', 'showIconLabels') showIconLabels: select(external_wp_preferences_namespaceObject.store).get('core/edit-site', 'showIconLabels')
}; };
}, []); }, []);
const { const {
setIsSaveViewOpened,
setEditedPostContext setEditedPostContext
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store); } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
const isViewMode = canvasMode === 'view'; const isViewMode = canvasMode === 'view';
@ -14544,16 +14672,6 @@ function Editor() {
sidebar: isEditMode && isRightSidebarOpen && (0,external_wp_element_namespaceObject.createElement)(complementary_area.Slot, { sidebar: isEditMode && isRightSidebarOpen && (0,external_wp_element_namespaceObject.createElement)(complementary_area.Slot, {
scope: "core/edit-site" scope: "core/edit-site"
}), }),
actions: isEditMode && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, isSaveViewOpen ? (0,external_wp_element_namespaceObject.createElement)(external_wp_editor_namespaceObject.EntitiesSavedStates, {
close: () => setIsSaveViewOpened(false)
}) : (0,external_wp_element_namespaceObject.createElement)("div", {
className: "edit-site-editor__toggle-save-panel"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
variant: "secondary",
className: "edit-site-editor__toggle-save-panel-button",
onClick: () => setIsSaveViewOpened(true),
"aria-expanded": false
}, (0,external_wp_i18n_namespaceObject.__)('Open save panel')))),
footer: showBlockBreakcrumb && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockBreadcrumb, { footer: showBlockBreakcrumb && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockBreadcrumb, {
rootLabelText: (0,external_wp_i18n_namespaceObject.__)('Template') rootLabelText: (0,external_wp_i18n_namespaceObject.__)('Template')
}), }),
@ -16084,76 +16202,6 @@ function MoreMenu(_ref) {
})); }));
} }
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/save-button/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function SaveButton() {
const {
isDirty,
isSaving,
isSaveViewOpen
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
__experimentalGetDirtyEntityRecords,
isSavingEntityRecord
} = select(external_wp_coreData_namespaceObject.store);
const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
const {
isSaveViewOpened
} = select(store_store);
return {
isDirty: dirtyEntityRecords.length > 0,
isSaving: dirtyEntityRecords.some(record => isSavingEntityRecord(record.kind, record.name, record.key)),
isSaveViewOpen: isSaveViewOpened()
};
}, []);
const {
setIsSaveViewOpened
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
const disabled = !isDirty || isSaving;
const label = (0,external_wp_i18n_namespaceObject.__)('Save');
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
variant: "primary",
className: "edit-site-save-button__button",
"aria-disabled": disabled,
"aria-expanded": isSaveViewOpen,
isBusy: isSaving,
onClick: disabled ? undefined : () => setIsSaveViewOpened(true),
label: label
/*
* We want the tooltip to show the keyboard shortcut only when the
* button does something, i.e. when it's not disabled.
*/
,
shortcut: disabled ? undefined : external_wp_keycodes_namespaceObject.displayShortcut.primary('s')
/*
* Displaying the keyboard shortcut conditionally makes the tooltip
* itself show conditionally. This would trigger a full-rerendering
* of the button that we want to avoid. By setting `showTooltip`,
& the tooltip is always rendered even when there's no keyboard shortcut.
*/
,
showTooltip: true
}, label);
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/undo.js ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/undo.js
@ -17251,6 +17299,70 @@ function useSyncCanvasModeWithURL() {
}, [canvasInUrl]); }, [canvasInUrl]);
} }
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/save-panel/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function SavePanel() {
const {
isSaveViewOpen,
canvasMode
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
isSaveViewOpened,
getCanvasMode
} = unlock(select(store_store)); // The currently selected entity to display.
// Typically template or template part in the site editor.
return {
isSaveViewOpen: isSaveViewOpened(),
canvasMode: getCanvasMode()
};
}, []);
const {
setIsSaveViewOpened
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
const onClose = () => setIsSaveViewOpened(false);
if (canvasMode === 'view') {
return isSaveViewOpen ? (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
className: "edit-site-save-panel__modal",
onRequestClose: onClose,
__experimentalHideHeader: true
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_editor_namespaceObject.EntitiesSavedStates, {
close: onClose
})) : null;
}
return (0,external_wp_element_namespaceObject.createElement)(NavigableRegion, {
className: "edit-site-layout__actions",
ariaLabel: (0,external_wp_i18n_namespaceObject.__)('Save sidebar')
}, isSaveViewOpen ? (0,external_wp_element_namespaceObject.createElement)(external_wp_editor_namespaceObject.EntitiesSavedStates, {
close: onClose
}) : (0,external_wp_element_namespaceObject.createElement)("div", {
className: "edit-site-editor__toggle-save-panel"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
variant: "secondary",
className: "edit-site-editor__toggle-save-panel-button",
onClick: () => setIsSaveViewOpened(true),
"aria-expanded": false
}, (0,external_wp_i18n_namespaceObject.__)('Open save panel'))));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/layout/index.js ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/layout/index.js
@ -17287,6 +17399,7 @@ function useSyncCanvasModeWithURL() {
const ANIMATION_DURATION = 0.5; const ANIMATION_DURATION = 0.5;
const emptyResizeHandleStyles = { const emptyResizeHandleStyles = {
position: undefined, position: undefined,
@ -17459,7 +17572,7 @@ function Layout() {
maxWidth: isResizingEnabled && fullSize ? fullSize.width - 360 : undefined maxWidth: isResizingEnabled && fullSize ? fullSize.width - 360 : undefined
}, (0,external_wp_element_namespaceObject.createElement)(NavigableRegion, { }, (0,external_wp_element_namespaceObject.createElement)(NavigableRegion, {
ariaLabel: (0,external_wp_i18n_namespaceObject.__)('Navigation sidebar') ariaLabel: (0,external_wp_i18n_namespaceObject.__)('Navigation sidebar')
}, (0,external_wp_element_namespaceObject.createElement)(sidebar, null)))), showCanvas && (0,external_wp_element_namespaceObject.createElement)("div", { }, (0,external_wp_element_namespaceObject.createElement)(sidebar, null)))), (0,external_wp_element_namespaceObject.createElement)(SavePanel, null), showCanvas && (0,external_wp_element_namespaceObject.createElement)("div", {
className: classnames_default()('edit-site-layout__canvas-container', { className: classnames_default()('edit-site-layout__canvas-container', {
'is-resizing': isResizing 'is-resizing': isResizing
}), }),

File diff suppressed because one or more lines are too long

View File

@ -6363,7 +6363,6 @@ class ErrorBoundary extends external_wp_element_namespaceObject.Component {
const requestIdleCallback = window.requestIdleCallback ? window.requestIdleCallback : window.requestAnimationFrame; const requestIdleCallback = window.requestIdleCallback ? window.requestIdleCallback : window.requestAnimationFrame;
let hasStorageSupport; let hasStorageSupport;
let uniqueId = 0;
/** /**
* Function which returns true if the current environment supports browser * Function which returns true if the current environment supports browser
* sessionStorage, or false otherwise. The result of this function is cached and * sessionStorage, or false otherwise. The result of this function is cached and
@ -6371,17 +6370,19 @@ let uniqueId = 0;
*/ */
const hasSessionStorageSupport = () => { const hasSessionStorageSupport = () => {
if (typeof hasStorageSupport === 'undefined') { if (hasStorageSupport !== undefined) {
try { return hasStorageSupport;
// Private Browsing in Safari 10 and earlier will throw an error when }
// attempting to set into sessionStorage. The test here is intentional in
// causing a thrown error as condition bailing from local autosave. try {
window.sessionStorage.setItem('__wpEditorTestSessionStorage', ''); // Private Browsing in Safari 10 and earlier will throw an error when
window.sessionStorage.removeItem('__wpEditorTestSessionStorage'); // attempting to set into sessionStorage. The test here is intentional in
hasStorageSupport = true; // causing a thrown error as condition bailing from local autosave.
} catch (error) { window.sessionStorage.setItem('__wpEditorTestSessionStorage', '');
hasStorageSupport = false; window.sessionStorage.removeItem('__wpEditorTestSessionStorage');
} hasStorageSupport = true;
} catch {
hasStorageSupport = false;
} }
return hasStorageSupport; return hasStorageSupport;
@ -6422,7 +6423,7 @@ function useAutosaveNotice() {
try { try {
localAutosave = JSON.parse(localAutosave); localAutosave = JSON.parse(localAutosave);
} catch (error) { } catch {
// Not usable if it can't be parsed. // Not usable if it can't be parsed.
return; return;
} }
@ -6455,9 +6456,9 @@ function useAutosaveNotice() {
return; return;
} }
const noticeId = `wpEditorAutosaveRestore${++uniqueId}`; const id = 'wpEditorAutosaveRestore';
createWarningNotice((0,external_wp_i18n_namespaceObject.__)('The backup of this post in your browser is different from the version below.'), { createWarningNotice((0,external_wp_i18n_namespaceObject.__)('The backup of this post in your browser is different from the version below.'), {
id: noticeId, id,
actions: [{ actions: [{
label: (0,external_wp_i18n_namespaceObject.__)('Restore the backup'), label: (0,external_wp_i18n_namespaceObject.__)('Restore the backup'),
@ -6468,7 +6469,7 @@ function useAutosaveNotice() {
} = edits; } = edits;
editPost(editsWithoutContent); editPost(editsWithoutContent);
resetEditorBlocks((0,external_wp_blocks_namespaceObject.parse)(edits.content)); resetEditorBlocks((0,external_wp_blocks_namespaceObject.parse)(edits.content));
removeNotice(noticeId); removeNotice(id);
} }
}] }]
@ -6525,11 +6526,7 @@ function LocalAutosaveMonitor() {
}, []); }, []);
useAutosaveNotice(); useAutosaveNotice();
useAutosavePurge(); useAutosavePurge();
const { const localAutosaveInterval = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getEditorSettings().localAutosaveInterval, []);
localAutosaveInterval
} = (0,external_wp_data_namespaceObject.useSelect)(select => ({
localAutosaveInterval: select(store_store).getEditorSettings().localAutosaveInterval
}), []);
return (0,external_wp_element_namespaceObject.createElement)(autosave_monitor, { return (0,external_wp_element_namespaceObject.createElement)(autosave_monitor, {
interval: localAutosaveInterval, interval: localAutosaveInterval,
autosave: deferredAutosave autosave: deferredAutosave
@ -13209,7 +13206,7 @@ function mediaUpload(_ref) {
const EMPTY_BLOCKS_LIST = []; const EMPTY_BLOCKS_LIST = [];
const BLOCK_EDITOR_SETTINGS = ['__experimentalBlockDirectory', '__experimentalBlockInspectorAnimation', '__experimentalDiscussionSettings', '__experimentalFeatures', '__experimentalGlobalStylesBaseStyles', '__experimentalPreferredStyleVariations', '__experimentalSetIsInserterOpened', '__unstableGalleryWithImageBlocks', 'alignWide', 'allowedBlockTypes', 'blockInspectorTabs', 'allowedMimeTypes', 'bodyPlaceholder', 'canLockBlocks', 'capabilities', 'clearBlockSelection', 'codeEditingEnabled', 'colors', 'disableCustomColors', 'disableCustomFontSizes', 'disableCustomSpacingSizes', 'disableCustomGradients', 'disableLayoutStyles', 'enableCustomLineHeight', 'enableCustomSpacing', 'enableCustomUnits', 'enableOpenverseMediaCategory', 'focusMode', 'fontSizes', 'gradients', 'generateAnchors', 'hasFixedToolbar', 'hasInlineToolbar', 'isDistractionFree', 'imageDefaultSize', 'imageDimensions', 'imageEditing', 'imageSizes', 'isRTL', 'keepCaretInsideBlock', 'locale', 'maxWidth', 'onUpdateDefaultBlockStyles', 'postsPerPage', 'readOnly', 'styles', 'template', 'templateLock', 'titlePlaceholder', 'supportsLayout', 'widgetTypesToHideFromLegacyWidgetBlock', '__unstableHasCustomAppender', '__unstableIsPreviewMode', '__unstableResolvedAssets']; const BLOCK_EDITOR_SETTINGS = ['__experimentalBlockDirectory', '__experimentalDiscussionSettings', '__experimentalFeatures', '__experimentalGlobalStylesBaseStyles', '__experimentalPreferredStyleVariations', '__experimentalSetIsInserterOpened', '__unstableGalleryWithImageBlocks', 'alignWide', 'allowedBlockTypes', 'blockInspectorTabs', 'allowedMimeTypes', 'bodyPlaceholder', 'canLockBlocks', 'capabilities', 'clearBlockSelection', 'codeEditingEnabled', 'colors', 'disableCustomColors', 'disableCustomFontSizes', 'disableCustomSpacingSizes', 'disableCustomGradients', 'disableLayoutStyles', 'enableCustomLineHeight', 'enableCustomSpacing', 'enableCustomUnits', 'enableOpenverseMediaCategory', 'focusMode', 'fontSizes', 'gradients', 'generateAnchors', 'hasFixedToolbar', 'hasInlineToolbar', 'isDistractionFree', 'imageDefaultSize', 'imageDimensions', 'imageEditing', 'imageSizes', 'isRTL', 'keepCaretInsideBlock', 'locale', 'maxWidth', 'onUpdateDefaultBlockStyles', 'postsPerPage', 'readOnly', 'styles', 'template', 'templateLock', 'titlePlaceholder', 'supportsLayout', 'widgetTypesToHideFromLegacyWidgetBlock', '__unstableHasCustomAppender', '__unstableIsPreviewMode', '__unstableResolvedAssets'];
/** /**
* React hook used to compute the block editor settings to use for the post editor. * React hook used to compute the block editor settings to use for the post editor.
* *

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.2-alpha-55256'; $wp_version = '6.2-alpha-55257';
/** /**
* 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.