Update @wordpress packages
Update packages to include these bug fixes from Gutenberg: - Navigation: Fix click-button size, submenu directions, scrollbars. - Group - Fix overzealous regex when restoring inner containers - Babel Preset: Update Babel packages to 7.16 version - theme.json: adds a setting property that enables some other ones - Polish metabox container. - Fix submenu justification and spacer orientation. - Fix Gutenberg 11.8.2 in WordPress trunk - Strip meta tags from pasted links in Chromium - Hide visilibility and status for navigation posts - Navigation: Refactor and simplify setup state. - Nav block menu switcher - decode HTML entities and utilise accessible markup pattern - Rename fse_navigation_area to wp_navigation_area - theme.json: adds a setting property that enables some other ones - Revert "theme.json: adds a setting property that enables some other ones" - Skip flaky image block test - WordPress/gutenberg@3c935c4 - React to any errors coming up in gutenberg_migrate_menu_to_navigation_post - Return wp error from wp_insert_post - Fix not transforming logical assignments for packages See #54337. Built from https://develop.svn.wordpress.org/trunk@52161 git-svn-id: http://core.svn.wordpress.org/trunk@51753 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5b85c73194
commit
c2d0fb2040
|
@ -62,7 +62,7 @@ $preload_paths = array(
|
|||
'/wp/v2/block-navigation-areas?context=edit',
|
||||
);
|
||||
|
||||
$areas = get_option( 'fse_navigation_areas', array() );
|
||||
$areas = get_option( 'wp_navigation_areas', array() );
|
||||
$active_areas = array_intersect_key( $areas, get_navigation_areas() );
|
||||
foreach ( $active_areas as $post_id ) {
|
||||
if ( $post_id ) {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -222,7 +222,7 @@ add_filter( 'render_block', 'wp_render_layout_support_flag', 10, 2 );
|
|||
function wp_restore_group_inner_container( $block_content, $block ) {
|
||||
$tag_name = isset( $block['attrs']['tagName'] ) ? $block['attrs']['tagName'] : 'div';
|
||||
$group_with_inner_container_regex = sprintf(
|
||||
'/(^\s*<%1$s\b[^>]*wp-block-group(\s|")[^>]*>)(\s*<div\b[^>]*wp-block-group__inner-container(\s|")[^>]*>)((.|\S|\s)*)/',
|
||||
'/(^\s*<%1$s\b[^>]*wp-block-group(\s|")[^>]*>)(\s*<div\b[^>]*wp-block-group__inner-container(\s|")[^>]*>)((.|\S|\s)*)/U',
|
||||
preg_quote( $tag_name, '/' )
|
||||
);
|
||||
|
||||
|
|
|
@ -107,15 +107,16 @@ function block_core_calendar_update_has_published_posts() {
|
|||
return $has_published_posts;
|
||||
}
|
||||
|
||||
// We only want to register these functions and actions when
|
||||
// we are on single sites. On multi sites we use `post_count` option.
|
||||
if ( ! is_multisite() ) {
|
||||
/**
|
||||
* Handler for updating the has published posts flag when a post is deleted.
|
||||
*
|
||||
* @param int $post_id Deleted post ID.
|
||||
*/
|
||||
function block_core_calendar_update_has_published_post_on_delete( $post_id ) {
|
||||
if ( is_multisite() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$post = get_post( $post_id );
|
||||
|
||||
if ( ! $post || 'publish' !== $post->post_status || 'post' !== $post->post_type ) {
|
||||
|
@ -133,6 +134,10 @@ if ( ! is_multisite() ) {
|
|||
* @param WP_Post $post Post object.
|
||||
*/
|
||||
function block_core_calendar_update_has_published_post_on_transition_post_status( $new_status, $old_status, $post ) {
|
||||
if ( is_multisite() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $new_status === $old_status ) {
|
||||
return;
|
||||
}
|
||||
|
@ -150,4 +155,3 @@ if ( ! is_multisite() ) {
|
|||
|
||||
add_action( 'delete_post', 'block_core_calendar_update_has_published_post_on_delete' );
|
||||
add_action( 'transition_post_status', 'block_core_calendar_update_has_published_post_on_transition_post_status', 10, 3 );
|
||||
}
|
||||
|
|
|
@ -147,7 +147,7 @@ function render_block_core_navigation( $attributes, $content, $block ) {
|
|||
|
||||
if ( ! empty( $block->context['navigationArea'] ) ) {
|
||||
$area = $block->context['navigationArea'];
|
||||
$mapping = get_option( 'fse_navigation_areas', array() );
|
||||
$mapping = get_option( 'wp_navigation_areas', array() );
|
||||
if ( ! empty( $mapping[ $area ] ) ) {
|
||||
$attributes['navigationMenuId'] = $mapping[ $area ];
|
||||
}
|
||||
|
@ -179,12 +179,24 @@ function render_block_core_navigation( $attributes, $content, $block ) {
|
|||
if ( empty( $inner_blocks ) ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
// Restore legacy classnames for submenu positioning.
|
||||
$layout_class = '';
|
||||
if ( isset( $attributes['layout']['justifyContent'] ) ) {
|
||||
if ( 'right' === $attributes['layout']['justifyContent'] ) {
|
||||
$layout_class .= 'items-justified-right';
|
||||
} elseif ( 'space-between' === $attributes['layout']['justifyContent'] ) {
|
||||
$layout_class .= 'items-justified-space-between';
|
||||
}
|
||||
}
|
||||
|
||||
$colors = block_core_navigation_build_css_colors( $attributes );
|
||||
$font_sizes = block_core_navigation_build_css_font_sizes( $attributes );
|
||||
$classes = array_merge(
|
||||
$colors['css_classes'],
|
||||
$font_sizes['css_classes'],
|
||||
$is_responsive_menu ? array( 'is-responsive' ) : array()
|
||||
$is_responsive_menu ? array( 'is-responsive' ) : array(),
|
||||
$layout_class ? array( $layout_class ) : array()
|
||||
);
|
||||
|
||||
$inner_blocks_html = '';
|
||||
|
|
|
@ -278,7 +278,7 @@
|
|||
flex-wrap: nowrap;
|
||||
flex: 0;
|
||||
}
|
||||
.is-vertical.is-selected .wp-block-navigation-placeholder__preview:not(.is-loading), .wp-block-navigation.is-selected .is-small .wp-block-navigation-placeholder__preview:not(.is-loading), .wp-block-navigation.is-selected .is-medium .wp-block-navigation-placeholder__preview:not(.is-loading) {
|
||||
.wp-block-navigation.is-selected .is-small .wp-block-navigation-placeholder__preview:not(.is-loading), .wp-block-navigation.is-selected .is-medium .wp-block-navigation-placeholder__preview:not(.is-loading) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
@ -301,62 +301,48 @@
|
|||
.wp-block-navigation.is-selected .wp-block-navigation-placeholder__controls {
|
||||
display: flex;
|
||||
}
|
||||
.is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions, .is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions, .is-vertical .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions {
|
||||
.is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions, .is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions {
|
||||
flex-direction: column;
|
||||
}
|
||||
.is-selected.is-vertical .wp-block-navigation-placeholder__controls {
|
||||
display: inline-flex;
|
||||
padding: 12px;
|
||||
.is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions hr, .is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions hr {
|
||||
display: none;
|
||||
}
|
||||
.wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__icon {
|
||||
margin-left: 12px;
|
||||
height: 36px;
|
||||
}
|
||||
.wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator {
|
||||
margin-left: 12px;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
padding: 0 0 0 6px;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
line-height: 0;
|
||||
margin-right: 5px;
|
||||
display: none;
|
||||
min-height: 36px;
|
||||
margin-right: 4px;
|
||||
}
|
||||
.wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator svg {
|
||||
margin-left: 4px;
|
||||
}
|
||||
.is-vertical .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator {
|
||||
margin-bottom: 4px;
|
||||
margin-right: 0;
|
||||
}
|
||||
.is-large .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator {
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.is-vertical .wp-block-navigation-placeholder,
|
||||
.is-vertical .wp-block-navigation-placeholder__preview,
|
||||
.is-vertical .wp-block-navigation-placeholder__controls {
|
||||
min-height: 156px;
|
||||
}
|
||||
|
||||
.is-vertical .wp-block-navigation-placeholder__preview,
|
||||
.is-vertical .wp-block-navigation-placeholder__controls {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.wp-block-navigation-placeholder__actions {
|
||||
display: flex;
|
||||
font-size: 13px;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
||||
}
|
||||
.wp-block-navigation-placeholder__actions .components-button.components-dropdown-menu__toggle.has-icon {
|
||||
padding: 6px 12px 6px 4px;
|
||||
display: flex;
|
||||
flex-direction: row-reverse;
|
||||
gap: 6px;
|
||||
height: 100%;
|
||||
}
|
||||
.wp-block-navigation-placeholder__actions .components-dropdown,
|
||||
.wp-block-navigation-placeholder__actions > .components-button {
|
||||
margin-left: 12px;
|
||||
margin-left: 0;
|
||||
}
|
||||
.wp-block-navigation-placeholder__actions.wp-block-navigation-placeholder__actions hr {
|
||||
border: 0;
|
||||
min-height: 1px;
|
||||
min-width: 1px;
|
||||
background-color: #1e1e1e;
|
||||
margin: auto 0;
|
||||
height: 100%;
|
||||
max-height: 16px;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -278,7 +278,7 @@
|
|||
flex-wrap: nowrap;
|
||||
flex: 0;
|
||||
}
|
||||
.is-vertical.is-selected .wp-block-navigation-placeholder__preview:not(.is-loading), .wp-block-navigation.is-selected .is-small .wp-block-navigation-placeholder__preview:not(.is-loading), .wp-block-navigation.is-selected .is-medium .wp-block-navigation-placeholder__preview:not(.is-loading) {
|
||||
.wp-block-navigation.is-selected .is-small .wp-block-navigation-placeholder__preview:not(.is-loading), .wp-block-navigation.is-selected .is-medium .wp-block-navigation-placeholder__preview:not(.is-loading) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
@ -301,62 +301,48 @@
|
|||
.wp-block-navigation.is-selected .wp-block-navigation-placeholder__controls {
|
||||
display: flex;
|
||||
}
|
||||
.is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions, .is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions, .is-vertical .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions {
|
||||
.is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions, .is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions {
|
||||
flex-direction: column;
|
||||
}
|
||||
.is-selected.is-vertical .wp-block-navigation-placeholder__controls {
|
||||
display: inline-flex;
|
||||
padding: 12px;
|
||||
.is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions hr, .is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions hr {
|
||||
display: none;
|
||||
}
|
||||
.wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__icon {
|
||||
margin-right: 12px;
|
||||
height: 36px;
|
||||
}
|
||||
.wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator {
|
||||
margin-right: 12px;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
padding: 0 6px 0 0;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
line-height: 0;
|
||||
margin-left: 5px;
|
||||
display: none;
|
||||
min-height: 36px;
|
||||
margin-left: 4px;
|
||||
}
|
||||
.wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator svg {
|
||||
margin-right: 4px;
|
||||
}
|
||||
.is-vertical .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator {
|
||||
margin-bottom: 4px;
|
||||
margin-left: 0;
|
||||
}
|
||||
.is-large .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator {
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.is-vertical .wp-block-navigation-placeholder,
|
||||
.is-vertical .wp-block-navigation-placeholder__preview,
|
||||
.is-vertical .wp-block-navigation-placeholder__controls {
|
||||
min-height: 156px;
|
||||
}
|
||||
|
||||
.is-vertical .wp-block-navigation-placeholder__preview,
|
||||
.is-vertical .wp-block-navigation-placeholder__controls {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.wp-block-navigation-placeholder__actions {
|
||||
display: flex;
|
||||
font-size: 13px;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
||||
}
|
||||
.wp-block-navigation-placeholder__actions .components-button.components-dropdown-menu__toggle.has-icon {
|
||||
padding: 6px 4px 6px 12px;
|
||||
display: flex;
|
||||
flex-direction: row-reverse;
|
||||
gap: 6px;
|
||||
height: 100%;
|
||||
}
|
||||
.wp-block-navigation-placeholder__actions .components-dropdown,
|
||||
.wp-block-navigation-placeholder__actions > .components-button {
|
||||
margin-right: 12px;
|
||||
margin-right: 0;
|
||||
}
|
||||
.wp-block-navigation-placeholder__actions.wp-block-navigation-placeholder__actions hr {
|
||||
border: 0;
|
||||
min-height: 1px;
|
||||
min-width: 1px;
|
||||
background-color: #1e1e1e;
|
||||
margin: auto 0;
|
||||
height: 100%;
|
||||
max-height: 16px;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -244,7 +244,6 @@
|
|||
/**
|
||||
* Justifications.
|
||||
*/
|
||||
@media (min-width: 782px) {
|
||||
.wp-block-navigation.items-justified-space-between .wp-block-page-list > .has-child:last-child .wp-block-navigation__submenu-container,
|
||||
.wp-block-navigation.items-justified-space-between > .wp-block-navigation__container > .has-child:last-child .wp-block-navigation__submenu-container,
|
||||
.wp-block-navigation.items-justified-right .wp-block-page-list > .has-child .wp-block-navigation__submenu-container,
|
||||
|
@ -255,11 +254,20 @@
|
|||
.wp-block-navigation.items-justified-space-between .wp-block-page-list > .has-child:last-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container,
|
||||
.wp-block-navigation.items-justified-space-between > .wp-block-navigation__container > .has-child:last-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container,
|
||||
.wp-block-navigation.items-justified-right .wp-block-page-list > .has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container,
|
||||
.wp-block-navigation.items-justified-right .wp-block-navigation__container .has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container {
|
||||
right: -1px;
|
||||
left: -1px;
|
||||
}
|
||||
@media (min-width: 782px) {
|
||||
.wp-block-navigation.items-justified-space-between .wp-block-page-list > .has-child:last-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container,
|
||||
.wp-block-navigation.items-justified-space-between > .wp-block-navigation__container > .has-child:last-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container,
|
||||
.wp-block-navigation.items-justified-right .wp-block-page-list > .has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container,
|
||||
.wp-block-navigation.items-justified-right .wp-block-navigation__container .has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container {
|
||||
right: auto;
|
||||
left: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.wp-block-navigation:not(.has-background) .wp-block-navigation__submenu-container {
|
||||
background-color: #fff;
|
||||
color: #000;
|
||||
|
@ -364,7 +372,7 @@
|
|||
display: block;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
z-index: auto;
|
||||
background-color: inherit;
|
||||
}
|
||||
.wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) .wp-block-navigation__responsive-container-close {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -244,7 +244,6 @@
|
|||
/**
|
||||
* Justifications.
|
||||
*/
|
||||
@media (min-width: 782px) {
|
||||
.wp-block-navigation.items-justified-space-between .wp-block-page-list > .has-child:last-child .wp-block-navigation__submenu-container,
|
||||
.wp-block-navigation.items-justified-space-between > .wp-block-navigation__container > .has-child:last-child .wp-block-navigation__submenu-container,
|
||||
.wp-block-navigation.items-justified-right .wp-block-page-list > .has-child .wp-block-navigation__submenu-container,
|
||||
|
@ -255,11 +254,20 @@
|
|||
.wp-block-navigation.items-justified-space-between .wp-block-page-list > .has-child:last-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container,
|
||||
.wp-block-navigation.items-justified-space-between > .wp-block-navigation__container > .has-child:last-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container,
|
||||
.wp-block-navigation.items-justified-right .wp-block-page-list > .has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container,
|
||||
.wp-block-navigation.items-justified-right .wp-block-navigation__container .has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container {
|
||||
left: -1px;
|
||||
right: -1px;
|
||||
}
|
||||
@media (min-width: 782px) {
|
||||
.wp-block-navigation.items-justified-space-between .wp-block-page-list > .has-child:last-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container,
|
||||
.wp-block-navigation.items-justified-space-between > .wp-block-navigation__container > .has-child:last-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container,
|
||||
.wp-block-navigation.items-justified-right .wp-block-page-list > .has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container,
|
||||
.wp-block-navigation.items-justified-right .wp-block-navigation__container .has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container {
|
||||
left: auto;
|
||||
right: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.wp-block-navigation:not(.has-background) .wp-block-navigation__submenu-container {
|
||||
background-color: #fff;
|
||||
color: #000;
|
||||
|
@ -364,7 +372,7 @@
|
|||
display: block;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
z-index: auto;
|
||||
background-color: inherit;
|
||||
}
|
||||
.wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) .wp-block-navigation__responsive-container-close {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1359,7 +1359,7 @@ figure.wp-block-image:not(.wp-block) {
|
|||
flex-wrap: nowrap;
|
||||
flex: 0;
|
||||
}
|
||||
.is-vertical.is-selected .wp-block-navigation-placeholder__preview:not(.is-loading), .wp-block-navigation.is-selected .is-small .wp-block-navigation-placeholder__preview:not(.is-loading), .wp-block-navigation.is-selected .is-medium .wp-block-navigation-placeholder__preview:not(.is-loading) {
|
||||
.wp-block-navigation.is-selected .is-small .wp-block-navigation-placeholder__preview:not(.is-loading), .wp-block-navigation.is-selected .is-medium .wp-block-navigation-placeholder__preview:not(.is-loading) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
@ -1382,62 +1382,48 @@ figure.wp-block-image:not(.wp-block) {
|
|||
.wp-block-navigation.is-selected .wp-block-navigation-placeholder__controls {
|
||||
display: flex;
|
||||
}
|
||||
.is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions, .is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions, .is-vertical .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions {
|
||||
.is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions, .is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions {
|
||||
flex-direction: column;
|
||||
}
|
||||
.is-selected.is-vertical .wp-block-navigation-placeholder__controls {
|
||||
display: inline-flex;
|
||||
padding: 12px;
|
||||
.is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions hr, .is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions hr {
|
||||
display: none;
|
||||
}
|
||||
.wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__icon {
|
||||
margin-left: 12px;
|
||||
height: 36px;
|
||||
}
|
||||
.wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator {
|
||||
margin-left: 12px;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
padding: 0 0 0 6px;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
line-height: 0;
|
||||
margin-right: 5px;
|
||||
display: none;
|
||||
min-height: 36px;
|
||||
margin-right: 4px;
|
||||
}
|
||||
.wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator svg {
|
||||
margin-left: 4px;
|
||||
}
|
||||
.is-vertical .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator {
|
||||
margin-bottom: 4px;
|
||||
margin-right: 0;
|
||||
}
|
||||
.is-large .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator {
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.is-vertical .wp-block-navigation-placeholder,
|
||||
.is-vertical .wp-block-navigation-placeholder__preview,
|
||||
.is-vertical .wp-block-navigation-placeholder__controls {
|
||||
min-height: 156px;
|
||||
}
|
||||
|
||||
.is-vertical .wp-block-navigation-placeholder__preview,
|
||||
.is-vertical .wp-block-navigation-placeholder__controls {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.wp-block-navigation-placeholder__actions {
|
||||
display: flex;
|
||||
font-size: 13px;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
||||
}
|
||||
.wp-block-navigation-placeholder__actions .components-button.components-dropdown-menu__toggle.has-icon {
|
||||
padding: 6px 12px 6px 4px;
|
||||
display: flex;
|
||||
flex-direction: row-reverse;
|
||||
gap: 6px;
|
||||
height: 100%;
|
||||
}
|
||||
.wp-block-navigation-placeholder__actions .components-dropdown,
|
||||
.wp-block-navigation-placeholder__actions > .components-button {
|
||||
margin-left: 12px;
|
||||
margin-left: 0;
|
||||
}
|
||||
.wp-block-navigation-placeholder__actions.wp-block-navigation-placeholder__actions hr {
|
||||
border: 0;
|
||||
min-height: 1px;
|
||||
min-width: 1px;
|
||||
background-color: #1e1e1e;
|
||||
margin: auto 0;
|
||||
height: 100%;
|
||||
max-height: 16px;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1364,7 +1364,7 @@ figure.wp-block-image:not(.wp-block) {
|
|||
flex-wrap: nowrap;
|
||||
flex: 0;
|
||||
}
|
||||
.is-vertical.is-selected .wp-block-navigation-placeholder__preview:not(.is-loading), .wp-block-navigation.is-selected .is-small .wp-block-navigation-placeholder__preview:not(.is-loading), .wp-block-navigation.is-selected .is-medium .wp-block-navigation-placeholder__preview:not(.is-loading) {
|
||||
.wp-block-navigation.is-selected .is-small .wp-block-navigation-placeholder__preview:not(.is-loading), .wp-block-navigation.is-selected .is-medium .wp-block-navigation-placeholder__preview:not(.is-loading) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
@ -1387,62 +1387,48 @@ figure.wp-block-image:not(.wp-block) {
|
|||
.wp-block-navigation.is-selected .wp-block-navigation-placeholder__controls {
|
||||
display: flex;
|
||||
}
|
||||
.is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions, .is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions, .is-vertical .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions {
|
||||
.is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions, .is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions {
|
||||
flex-direction: column;
|
||||
}
|
||||
.is-selected.is-vertical .wp-block-navigation-placeholder__controls {
|
||||
display: inline-flex;
|
||||
padding: 12px;
|
||||
.is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions hr, .is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions hr {
|
||||
display: none;
|
||||
}
|
||||
.wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__icon {
|
||||
margin-right: 12px;
|
||||
height: 36px;
|
||||
}
|
||||
.wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator {
|
||||
margin-right: 12px;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
padding: 0 6px 0 0;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
line-height: 0;
|
||||
margin-left: 5px;
|
||||
display: none;
|
||||
min-height: 36px;
|
||||
margin-left: 4px;
|
||||
}
|
||||
.wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator svg {
|
||||
margin-right: 4px;
|
||||
}
|
||||
.is-vertical .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator {
|
||||
margin-bottom: 4px;
|
||||
margin-left: 0;
|
||||
}
|
||||
.is-large .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator {
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.is-vertical .wp-block-navigation-placeholder,
|
||||
.is-vertical .wp-block-navigation-placeholder__preview,
|
||||
.is-vertical .wp-block-navigation-placeholder__controls {
|
||||
min-height: 156px;
|
||||
}
|
||||
|
||||
.is-vertical .wp-block-navigation-placeholder__preview,
|
||||
.is-vertical .wp-block-navigation-placeholder__controls {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.wp-block-navigation-placeholder__actions {
|
||||
display: flex;
|
||||
font-size: 13px;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
||||
}
|
||||
.wp-block-navigation-placeholder__actions .components-button.components-dropdown-menu__toggle.has-icon {
|
||||
padding: 6px 4px 6px 12px;
|
||||
display: flex;
|
||||
flex-direction: row-reverse;
|
||||
gap: 6px;
|
||||
height: 100%;
|
||||
}
|
||||
.wp-block-navigation-placeholder__actions .components-dropdown,
|
||||
.wp-block-navigation-placeholder__actions > .components-button {
|
||||
margin-right: 12px;
|
||||
margin-right: 0;
|
||||
}
|
||||
.wp-block-navigation-placeholder__actions.wp-block-navigation-placeholder__actions hr {
|
||||
border: 0;
|
||||
min-height: 1px;
|
||||
min-width: 1px;
|
||||
background-color: #1e1e1e;
|
||||
margin: auto 0;
|
||||
height: 100%;
|
||||
max-height: 16px;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1650,7 +1650,6 @@ ul.has-background {
|
|||
/**
|
||||
* Justifications.
|
||||
*/
|
||||
@media (min-width: 782px) {
|
||||
.wp-block-navigation.items-justified-space-between .wp-block-page-list > .has-child:last-child .wp-block-navigation__submenu-container,
|
||||
.wp-block-navigation.items-justified-space-between > .wp-block-navigation__container > .has-child:last-child .wp-block-navigation__submenu-container,
|
||||
.wp-block-navigation.items-justified-right .wp-block-page-list > .has-child .wp-block-navigation__submenu-container,
|
||||
|
@ -1661,11 +1660,20 @@ ul.has-background {
|
|||
.wp-block-navigation.items-justified-space-between .wp-block-page-list > .has-child:last-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container,
|
||||
.wp-block-navigation.items-justified-space-between > .wp-block-navigation__container > .has-child:last-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container,
|
||||
.wp-block-navigation.items-justified-right .wp-block-page-list > .has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container,
|
||||
.wp-block-navigation.items-justified-right .wp-block-navigation__container .has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container {
|
||||
right: -1px;
|
||||
left: -1px;
|
||||
}
|
||||
@media (min-width: 782px) {
|
||||
.wp-block-navigation.items-justified-space-between .wp-block-page-list > .has-child:last-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container,
|
||||
.wp-block-navigation.items-justified-space-between > .wp-block-navigation__container > .has-child:last-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container,
|
||||
.wp-block-navigation.items-justified-right .wp-block-page-list > .has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container,
|
||||
.wp-block-navigation.items-justified-right .wp-block-navigation__container .has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container {
|
||||
right: auto;
|
||||
left: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.wp-block-navigation:not(.has-background) .wp-block-navigation__submenu-container {
|
||||
background-color: #fff;
|
||||
color: #000;
|
||||
|
@ -1770,7 +1778,7 @@ ul.has-background {
|
|||
display: block;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
z-index: auto;
|
||||
background-color: inherit;
|
||||
}
|
||||
.wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) .wp-block-navigation__responsive-container-close {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1672,7 +1672,6 @@ ul.has-background {
|
|||
/**
|
||||
* Justifications.
|
||||
*/
|
||||
@media (min-width: 782px) {
|
||||
.wp-block-navigation.items-justified-space-between .wp-block-page-list > .has-child:last-child .wp-block-navigation__submenu-container,
|
||||
.wp-block-navigation.items-justified-space-between > .wp-block-navigation__container > .has-child:last-child .wp-block-navigation__submenu-container,
|
||||
.wp-block-navigation.items-justified-right .wp-block-page-list > .has-child .wp-block-navigation__submenu-container,
|
||||
|
@ -1683,11 +1682,20 @@ ul.has-background {
|
|||
.wp-block-navigation.items-justified-space-between .wp-block-page-list > .has-child:last-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container,
|
||||
.wp-block-navigation.items-justified-space-between > .wp-block-navigation__container > .has-child:last-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container,
|
||||
.wp-block-navigation.items-justified-right .wp-block-page-list > .has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container,
|
||||
.wp-block-navigation.items-justified-right .wp-block-navigation__container .has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container {
|
||||
left: -1px;
|
||||
right: -1px;
|
||||
}
|
||||
@media (min-width: 782px) {
|
||||
.wp-block-navigation.items-justified-space-between .wp-block-page-list > .has-child:last-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container,
|
||||
.wp-block-navigation.items-justified-space-between > .wp-block-navigation__container > .has-child:last-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container,
|
||||
.wp-block-navigation.items-justified-right .wp-block-page-list > .has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container,
|
||||
.wp-block-navigation.items-justified-right .wp-block-navigation__container .has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container {
|
||||
left: auto;
|
||||
right: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.wp-block-navigation:not(.has-background) .wp-block-navigation__submenu-container {
|
||||
background-color: #fff;
|
||||
color: #000;
|
||||
|
@ -1792,7 +1800,7 @@ ul.has-background {
|
|||
display: block;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
z-index: auto;
|
||||
background-color: inherit;
|
||||
}
|
||||
.wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) .wp-block-navigation__responsive-container-close {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -998,16 +998,8 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|||
|
||||
.edit-post-layout__metaboxes {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.edit-post-layout__metaboxes:not(:empty) {
|
||||
border-top: 1px solid #ddd;
|
||||
padding: 10px 0 10px;
|
||||
clear: both;
|
||||
}
|
||||
.edit-post-layout__metaboxes:not(:empty) .edit-post-meta-boxes-area {
|
||||
margin: auto 20px;
|
||||
}
|
||||
|
||||
.edit-post-layout .components-editor-notices__snackbar {
|
||||
position: fixed;
|
||||
|
@ -1234,6 +1226,10 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
|
|||
.edit-post-meta-boxes-area input {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.edit-post-meta-boxes-area .postbox-header {
|
||||
border-top: 1px solid #ddd;
|
||||
border-bottom: 0;
|
||||
}
|
||||
.edit-post-meta-boxes-area #poststuff {
|
||||
margin: 0 auto;
|
||||
padding-top: 0;
|
||||
|
@ -1247,7 +1243,7 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
|
|||
color: inherit;
|
||||
font-weight: 600;
|
||||
outline: none;
|
||||
padding: 15px;
|
||||
padding: 0 24px;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
|
@ -1257,9 +1253,8 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
|
|||
margin-bottom: 0;
|
||||
}
|
||||
.edit-post-meta-boxes-area .postbox > .inside {
|
||||
border-bottom: 1px solid #ddd;
|
||||
color: inherit;
|
||||
padding: 0 14px 14px;
|
||||
padding: 0 24px 24px;
|
||||
margin: 0;
|
||||
}
|
||||
.edit-post-meta-boxes-area .postbox .handlediv {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -998,16 +998,8 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|||
|
||||
.edit-post-layout__metaboxes {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.edit-post-layout__metaboxes:not(:empty) {
|
||||
border-top: 1px solid #ddd;
|
||||
padding: 10px 0 10px;
|
||||
clear: both;
|
||||
}
|
||||
.edit-post-layout__metaboxes:not(:empty) .edit-post-meta-boxes-area {
|
||||
margin: auto 20px;
|
||||
}
|
||||
|
||||
.edit-post-layout .components-editor-notices__snackbar {
|
||||
position: fixed;
|
||||
|
@ -1234,6 +1226,10 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
|
|||
.edit-post-meta-boxes-area input {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.edit-post-meta-boxes-area .postbox-header {
|
||||
border-top: 1px solid #ddd;
|
||||
border-bottom: 0;
|
||||
}
|
||||
.edit-post-meta-boxes-area #poststuff {
|
||||
margin: 0 auto;
|
||||
padding-top: 0;
|
||||
|
@ -1247,7 +1243,7 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
|
|||
color: inherit;
|
||||
font-weight: 600;
|
||||
outline: none;
|
||||
padding: 15px;
|
||||
padding: 0 24px;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
|
@ -1257,9 +1253,8 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
|
|||
margin-bottom: 0;
|
||||
}
|
||||
.edit-post-meta-boxes-area .postbox > .inside {
|
||||
border-bottom: 1px solid #ddd;
|
||||
color: inherit;
|
||||
padding: 0 14px 14px;
|
||||
padding: 0 24px 24px;
|
||||
margin: 0;
|
||||
}
|
||||
.edit-post-meta-boxes-area .postbox .handlediv {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -152,7 +152,8 @@ function addIntroText() {
|
|||
*
|
||||
* @return {HTMLDivElement} The ARIA live region HTML element.
|
||||
*/
|
||||
function addContainer(ariaLive = 'polite') {
|
||||
function addContainer() {
|
||||
let ariaLive = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'polite';
|
||||
const container = document.createElement('div');
|
||||
container.id = `a11y-speak-${ariaLive}`;
|
||||
container.className = 'a11y-speak-region';
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
/*! This file is auto-generated */
|
||||
this.wp=this.wp||{},this.wp.a11y=function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="jncB")}({Y8OO:function(t,e){t.exports=window.wp.domReady},jncB:function(t,e,n){"use strict";n.r(e),n.d(e,"setup",(function(){return u})),n.d(e,"speak",(function(){return d}));var i=n("Y8OO"),o=n.n(i),r=n("l3Sj");function a(t="polite"){const e=document.createElement("div");e.id="a11y-speak-"+t,e.className="a11y-speak-region",e.setAttribute("style","position: absolute;margin: -1px;padding: 0;height: 1px;width: 1px;overflow: hidden;clip: rect(1px, 1px, 1px, 1px);-webkit-clip-path: inset(50%);clip-path: inset(50%);border: 0;word-wrap: normal !important;"),e.setAttribute("aria-live",t),e.setAttribute("aria-relevant","additions text"),e.setAttribute("aria-atomic","true");const{body:n}=document;return n&&n.appendChild(e),e}let p="";function u(){const t=document.getElementById("a11y-speak-intro-text"),e=document.getElementById("a11y-speak-assertive"),n=document.getElementById("a11y-speak-polite");null===t&&function(){const t=document.createElement("p");t.id="a11y-speak-intro-text",t.className="a11y-speak-intro-text",t.textContent=Object(r.__)("Notifications"),t.setAttribute("style","position: absolute;margin: -1px;padding: 0;height: 1px;width: 1px;overflow: hidden;clip: rect(1px, 1px, 1px, 1px);-webkit-clip-path: inset(50%);clip-path: inset(50%);border: 0;word-wrap: normal !important;"),t.setAttribute("hidden","hidden");const{body:e}=document;e&&e.appendChild(t)}(),null===e&&a("assertive"),null===n&&a("polite")}function d(t,e){!function(){const t=document.getElementsByClassName("a11y-speak-region"),e=document.getElementById("a11y-speak-intro-text");for(let e=0;e<t.length;e++)t[e].textContent="";e&&e.setAttribute("hidden","hidden")}(),t=function(t){return t=t.replace(/<[^<>]+>/g," "),p===t&&(t+=" "),p=t,t}(t);const n=document.getElementById("a11y-speak-intro-text"),i=document.getElementById("a11y-speak-assertive"),o=document.getElementById("a11y-speak-polite");i&&"assertive"===e?i.textContent=t:o&&(o.textContent=t),n&&n.removeAttribute("hidden")}o()(u)},l3Sj:function(t,e){t.exports=window.wp.i18n}});
|
||||
this.wp=this.wp||{},this.wp.a11y=function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="jncB")}({Y8OO:function(t,e){t.exports=window.wp.domReady},jncB:function(t,e,n){"use strict";n.r(e),n.d(e,"setup",(function(){return u})),n.d(e,"speak",(function(){return d}));var i=n("Y8OO"),o=n.n(i),r=n("l3Sj");function a(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"polite";const e=document.createElement("div");e.id="a11y-speak-"+t,e.className="a11y-speak-region",e.setAttribute("style","position: absolute;margin: -1px;padding: 0;height: 1px;width: 1px;overflow: hidden;clip: rect(1px, 1px, 1px, 1px);-webkit-clip-path: inset(50%);clip-path: inset(50%);border: 0;word-wrap: normal !important;"),e.setAttribute("aria-live",t),e.setAttribute("aria-relevant","additions text"),e.setAttribute("aria-atomic","true");const{body:n}=document;return n&&n.appendChild(e),e}let p="";function u(){const t=document.getElementById("a11y-speak-intro-text"),e=document.getElementById("a11y-speak-assertive"),n=document.getElementById("a11y-speak-polite");null===t&&function(){const t=document.createElement("p");t.id="a11y-speak-intro-text",t.className="a11y-speak-intro-text",t.textContent=Object(r.__)("Notifications"),t.setAttribute("style","position: absolute;margin: -1px;padding: 0;height: 1px;width: 1px;overflow: hidden;clip: rect(1px, 1px, 1px, 1px);-webkit-clip-path: inset(50%);clip-path: inset(50%);border: 0;word-wrap: normal !important;"),t.setAttribute("hidden","hidden");const{body:e}=document;e&&e.appendChild(t)}(),null===e&&a("assertive"),null===n&&a("polite")}function d(t,e){!function(){const t=document.getElementsByClassName("a11y-speak-region"),e=document.getElementById("a11y-speak-intro-text");for(let e=0;e<t.length;e++)t[e].textContent="";e&&e.setAttribute("hidden","hidden")}(),t=function(t){return t=t.replace(/<[^<>]+>/g," "),p===t&&(t+=" "),p=t,t}(t);const n=document.getElementById("a11y-speak-intro-text"),i=document.getElementById("a11y-speak-assertive"),o=document.getElementById("a11y-speak-polite");i&&"assertive"===e?i.textContent=t:o&&(o.textContent=t),n&&n.removeAttribute("hidden")}o()(u)},l3Sj:function(t,e){t.exports=window.wp.i18n}});
|
|
@ -155,7 +155,8 @@ const ANNOTATION_ATTRIBUTE_PREFIX = 'annotation-text-';
|
|||
* @return {Object} A record with the annotations applied.
|
||||
*/
|
||||
|
||||
function applyAnnotations(record, annotations = []) {
|
||||
function applyAnnotations(record) {
|
||||
let annotations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
||||
annotations.forEach(annotation => {
|
||||
let {
|
||||
start,
|
||||
|
@ -235,10 +236,11 @@ function retrieveAnnotationPositions(formats) {
|
|||
*/
|
||||
|
||||
|
||||
function updateAnnotationsWithPositions(annotations, positions, {
|
||||
function updateAnnotationsWithPositions(annotations, positions, _ref) {
|
||||
let {
|
||||
removeAnnotation,
|
||||
updateAnnotationRange
|
||||
}) {
|
||||
} = _ref;
|
||||
annotations.forEach(currentAnnotation => {
|
||||
const position = positions[currentAnnotation.id]; // If we cannot find an annotation, delete it.
|
||||
|
||||
|
@ -274,18 +276,20 @@ const annotation_annotation = {
|
|||
return null;
|
||||
},
|
||||
|
||||
__experimentalGetPropsForEditableTreePreparation(select, {
|
||||
__experimentalGetPropsForEditableTreePreparation(select, _ref2) {
|
||||
let {
|
||||
richTextIdentifier,
|
||||
blockClientId
|
||||
}) {
|
||||
} = _ref2;
|
||||
return {
|
||||
annotations: select(STORE_NAME).__experimentalGetAnnotationsForRichText(blockClientId, richTextIdentifier)
|
||||
};
|
||||
},
|
||||
|
||||
__experimentalCreatePrepareEditableTree({
|
||||
__experimentalCreatePrepareEditableTree(_ref3) {
|
||||
let {
|
||||
annotations
|
||||
}) {
|
||||
} = _ref3;
|
||||
return (formats, text) => {
|
||||
if (annotations.length === 0) {
|
||||
return formats;
|
||||
|
@ -365,10 +369,12 @@ var external_wp_data_ = __webpack_require__("1ZqX");
|
|||
*/
|
||||
|
||||
const addAnnotationClassName = OriginalComponent => {
|
||||
return Object(external_wp_data_["withSelect"])((select, {
|
||||
return Object(external_wp_data_["withSelect"])((select, _ref) => {
|
||||
let {
|
||||
clientId,
|
||||
className
|
||||
}) => {
|
||||
} = _ref;
|
||||
|
||||
const annotations = select(STORE_NAME).__experimentalGetAnnotationsForBlock(clientId);
|
||||
|
||||
return {
|
||||
|
@ -424,9 +430,12 @@ function isValidAnnotationRange(annotation) {
|
|||
*/
|
||||
|
||||
|
||||
function reducer_annotations(state = {}, action) {
|
||||
function reducer_annotations() {
|
||||
var _state$blockClientId;
|
||||
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'ANNOTATION_ADD':
|
||||
const blockClientId = action.blockClientId;
|
||||
|
@ -612,14 +621,15 @@ var v4 = __webpack_require__("7Cbv");
|
|||
* @return {Object} Action object.
|
||||
*/
|
||||
|
||||
function __experimentalAddAnnotation({
|
||||
function __experimentalAddAnnotation(_ref) {
|
||||
let {
|
||||
blockClientId,
|
||||
richTextIdentifier = null,
|
||||
range = null,
|
||||
selector = 'range',
|
||||
source = 'default',
|
||||
id = Object(v4["a" /* default */])()
|
||||
}) {
|
||||
} = _ref;
|
||||
const action = {
|
||||
type: 'ANNOTATION_ADD',
|
||||
id,
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -288,14 +288,17 @@ function createPreloadingMiddleware(preloadedData) {
|
|||
* @return {import('../types').APIFetchOptions} The request with the modified query args
|
||||
*/
|
||||
|
||||
const modifyQuery = ({
|
||||
const modifyQuery = (_ref, queryArgs) => {
|
||||
let {
|
||||
path,
|
||||
url,
|
||||
...options
|
||||
}, queryArgs) => ({ ...options,
|
||||
} = _ref;
|
||||
return { ...options,
|
||||
url: url && Object(external_wp_url_["addQueryArgs"])(url, queryArgs),
|
||||
path: path && Object(external_wp_url_["addQueryArgs"])(path, queryArgs)
|
||||
});
|
||||
};
|
||||
};
|
||||
/**
|
||||
* Duplicates parsing functionality from apiFetch.
|
||||
*
|
||||
|
@ -495,7 +498,9 @@ const userLocaleMiddleware = (options, next) => {
|
|||
* @return {Promise<any> | null | Response} Parsed response.
|
||||
*/
|
||||
|
||||
const response_parseResponse = (response, shouldParseResponse = true) => {
|
||||
const response_parseResponse = function (response) {
|
||||
let shouldParseResponse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
||||
|
||||
if (shouldParseResponse) {
|
||||
if (response.status === 204) {
|
||||
return null;
|
||||
|
@ -539,7 +544,8 @@ const parseJsonAndNormalizeError = response => {
|
|||
*/
|
||||
|
||||
|
||||
const parseResponseAndNormalizeError = (response, shouldParseResponse = true) => {
|
||||
const parseResponseAndNormalizeError = function (response) {
|
||||
let shouldParseResponse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
||||
return Promise.resolve(response_parseResponse(response, shouldParseResponse)).catch(res => parseAndThrowError(res, shouldParseResponse));
|
||||
};
|
||||
/**
|
||||
|
@ -550,7 +556,9 @@ const parseResponseAndNormalizeError = (response, shouldParseResponse = true) =>
|
|||
* @return {Promise<any>} Parsed response.
|
||||
*/
|
||||
|
||||
function parseAndThrowError(response, shouldParseResponse = true) {
|
||||
function parseAndThrowError(response) {
|
||||
let shouldParseResponse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
||||
|
||||
if (!shouldParseResponse) {
|
||||
throw response;
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -219,7 +219,8 @@ function replaceInHtmlTags(haystack, replacePairs) {
|
|||
*/
|
||||
|
||||
|
||||
function autop(text, br = true) {
|
||||
function autop(text) {
|
||||
let br = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
||||
const preTags = [];
|
||||
|
||||
if (text.trim() === '') {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -199,7 +199,10 @@ var external_lodash_ = __webpack_require__("YLtl");
|
|||
* @return {Object} Updated state.
|
||||
*/
|
||||
|
||||
const downloadableBlocks = (state = {}, action) => {
|
||||
const downloadableBlocks = function () {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'FETCH_DOWNLOADABLE_BLOCKS':
|
||||
return { ...state,
|
||||
|
@ -228,10 +231,13 @@ const downloadableBlocks = (state = {}, action) => {
|
|||
* @return {Object} Updated state.
|
||||
*/
|
||||
|
||||
const blockManagement = (state = {
|
||||
const blockManagement = function () {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
||||
installedBlockTypes: [],
|
||||
isInstalling: {}
|
||||
}, action) => {
|
||||
};
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'ADD_INSTALLED_BLOCK_TYPE':
|
||||
return { ...state,
|
||||
|
@ -262,7 +268,10 @@ const blockManagement = (state = {
|
|||
* @return {Object} Updated state.
|
||||
*/
|
||||
|
||||
const errorNotices = (state = {}, action) => {
|
||||
const errorNotices = function () {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'SET_ERROR_NOTICE':
|
||||
return { ...state,
|
||||
|
@ -297,14 +306,19 @@ var external_wp_blockEditor_ = __webpack_require__("axFQ");
|
|||
*
|
||||
* @return {boolean} Whether the blockType is found.
|
||||
*/
|
||||
function hasBlockType(blockType, blocks = []) {
|
||||
function hasBlockType(blockType) {
|
||||
let blocks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
||||
|
||||
if (!blocks.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (blocks.some(({
|
||||
if (blocks.some(_ref => {
|
||||
let {
|
||||
name
|
||||
}) => name === blockType.name)) {
|
||||
} = _ref;
|
||||
return name === blockType.name;
|
||||
})) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -591,10 +605,11 @@ function receiveDownloadableBlocks(downloadableBlocks, filterValue) {
|
|||
* @return {boolean} Whether the block was successfully installed & loaded.
|
||||
*/
|
||||
|
||||
const actions_installBlockType = block => async ({
|
||||
const actions_installBlockType = block => async _ref => {
|
||||
let {
|
||||
registry,
|
||||
dispatch
|
||||
}) => {
|
||||
} = _ref;
|
||||
const {
|
||||
id
|
||||
} = block;
|
||||
|
@ -678,10 +693,12 @@ const actions_installBlockType = block => async ({
|
|||
* @param {Object} block The blockType object.
|
||||
*/
|
||||
|
||||
const actions_uninstallBlockType = block => async ({
|
||||
const actions_uninstallBlockType = block => async _ref2 => {
|
||||
let {
|
||||
registry,
|
||||
dispatch
|
||||
}) => {
|
||||
} = _ref2;
|
||||
|
||||
try {
|
||||
const url = getPluginUrl(block);
|
||||
await external_wp_apiFetch_default()({
|
||||
|
@ -756,7 +773,8 @@ function setIsInstalling(blockId, isInstalling) {
|
|||
* @return {Object} Action object.
|
||||
*/
|
||||
|
||||
function setErrorNotice(blockId, message, isFatal = false) {
|
||||
function setErrorNotice(blockId, message) {
|
||||
let isFatal = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
||||
return {
|
||||
type: 'SET_ERROR_NOTICE',
|
||||
blockId,
|
||||
|
@ -794,9 +812,11 @@ function clearErrorNotice(blockId) {
|
|||
*/
|
||||
|
||||
|
||||
const resolvers_getDownloadableBlocks = filterValue => async ({
|
||||
const resolvers_getDownloadableBlocks = filterValue => async _ref => {
|
||||
let {
|
||||
dispatch
|
||||
}) => {
|
||||
} = _ref;
|
||||
|
||||
if (!filterValue) {
|
||||
return;
|
||||
}
|
||||
|
@ -947,9 +967,10 @@ var star_empty = __webpack_require__("Xxwi");
|
|||
|
||||
|
||||
|
||||
function Stars({
|
||||
function Stars(_ref) {
|
||||
let {
|
||||
rating
|
||||
}) {
|
||||
} = _ref;
|
||||
const stars = Math.round(rating / 0.5) * 0.5;
|
||||
const fullStarCount = Math.floor(rating);
|
||||
const halfStarCount = Math.ceil(rating - fullStarCount);
|
||||
|
@ -985,13 +1006,16 @@ function Stars({
|
|||
* Internal dependencies
|
||||
*/
|
||||
|
||||
const BlockRatings = ({
|
||||
const BlockRatings = _ref => {
|
||||
let {
|
||||
rating
|
||||
}) => Object(external_wp_element_["createElement"])("span", {
|
||||
} = _ref;
|
||||
return Object(external_wp_element_["createElement"])("span", {
|
||||
className: "block-directory-block-ratings"
|
||||
}, Object(external_wp_element_["createElement"])(block_ratings_stars, {
|
||||
rating: rating
|
||||
}));
|
||||
};
|
||||
/* harmony default export */ var block_ratings = (BlockRatings);
|
||||
|
||||
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-icon/index.js
|
||||
|
@ -1002,9 +1026,10 @@ const BlockRatings = ({
|
|||
*/
|
||||
|
||||
|
||||
function DownloadableBlockIcon({
|
||||
function DownloadableBlockIcon(_ref) {
|
||||
let {
|
||||
icon
|
||||
}) {
|
||||
} = _ref;
|
||||
const className = 'block-directory-downloadable-block-icon';
|
||||
return icon.match(/\.(jpeg|jpg|gif|png|svg)(?:\?.*)?$/) !== null ? Object(external_wp_element_["createElement"])("img", {
|
||||
className: className,
|
||||
|
@ -1032,9 +1057,10 @@ function DownloadableBlockIcon({
|
|||
*/
|
||||
|
||||
|
||||
const DownloadableBlockNotice = ({
|
||||
const DownloadableBlockNotice = _ref => {
|
||||
let {
|
||||
block
|
||||
}) => {
|
||||
} = _ref;
|
||||
const errorNotice = Object(external_wp_data_["useSelect"])(select => select(store).getErrorNoticeForBlock(block.id), [block]);
|
||||
|
||||
if (!errorNotice) {
|
||||
|
@ -1071,15 +1097,17 @@ const DownloadableBlockNotice = ({
|
|||
|
||||
// Return the appropriate block item label, given the block data and status.
|
||||
|
||||
function getDownloadableBlockLabel({
|
||||
function getDownloadableBlockLabel(_ref, _ref2) {
|
||||
let {
|
||||
title,
|
||||
rating,
|
||||
ratingCount
|
||||
}, {
|
||||
} = _ref;
|
||||
let {
|
||||
hasNotice,
|
||||
isInstalled,
|
||||
isInstalling
|
||||
}) {
|
||||
} = _ref2;
|
||||
const stars = Math.round(rating / 0.5) * 0.5;
|
||||
|
||||
if (!isInstalled && hasNotice) {
|
||||
|
@ -1108,11 +1136,12 @@ function getDownloadableBlockLabel({
|
|||
Object(external_wp_i18n_["_n"])('Install %1$s. %2$s stars with %3$s review.', 'Install %1$s. %2$s stars with %3$s reviews.', ratingCount), Object(external_wp_htmlEntities_["decodeEntities"])(title), stars, ratingCount);
|
||||
}
|
||||
|
||||
function DownloadableBlockListItem({
|
||||
function DownloadableBlockListItem(_ref3) {
|
||||
let {
|
||||
composite,
|
||||
item,
|
||||
onClick
|
||||
}) {
|
||||
} = _ref3;
|
||||
const {
|
||||
author,
|
||||
description,
|
||||
|
@ -1216,11 +1245,12 @@ function DownloadableBlockListItem({
|
|||
|
||||
|
||||
|
||||
function DownloadableBlocksList({
|
||||
function DownloadableBlocksList(_ref) {
|
||||
let {
|
||||
items,
|
||||
onHover = external_lodash_["noop"],
|
||||
onSelect
|
||||
}) {
|
||||
} = _ref;
|
||||
const composite = Object(external_wp_components_["__unstableUseCompositeState"])();
|
||||
const {
|
||||
installBlockType
|
||||
|
@ -1275,11 +1305,12 @@ var external_wp_a11y_ = __webpack_require__("gdqT");
|
|||
|
||||
|
||||
|
||||
function DownloadableBlocksInserterPanel({
|
||||
function DownloadableBlocksInserterPanel(_ref) {
|
||||
let {
|
||||
children,
|
||||
downloadableItems,
|
||||
hasLocalBlocks
|
||||
}) {
|
||||
} = _ref;
|
||||
const count = downloadableItems.length;
|
||||
Object(external_wp_element_["useEffect"])(() => {
|
||||
Object(external_wp_a11y_["speak"])(Object(external_wp_i18n_["sprintf"])(
|
||||
|
@ -1347,7 +1378,8 @@ function DownloadableBlocksNoResults() {
|
|||
|
||||
|
||||
|
||||
function DownloadableBlocksPanel({
|
||||
function DownloadableBlocksPanel(_ref) {
|
||||
let {
|
||||
downloadableItems,
|
||||
onSelect,
|
||||
onHover,
|
||||
|
@ -1355,7 +1387,8 @@ function DownloadableBlocksPanel({
|
|||
hasPermission,
|
||||
isLoading,
|
||||
isTyping
|
||||
}) {
|
||||
} = _ref;
|
||||
|
||||
if (typeof hasPermission === 'undefined' || isLoading || isTyping) {
|
||||
return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, hasPermission && !hasLocalBlocks && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("p", {
|
||||
className: "block-directory-downloadable-blocks-panel__no-local"
|
||||
|
@ -1384,10 +1417,11 @@ function DownloadableBlocksPanel({
|
|||
})) : !hasLocalBlocks && Object(external_wp_element_["createElement"])(no_results, null);
|
||||
}
|
||||
|
||||
/* harmony default export */ var downloadable_blocks_panel = (Object(external_wp_compose_["compose"])([Object(external_wp_data_["withSelect"])((select, {
|
||||
/* harmony default export */ var downloadable_blocks_panel = (Object(external_wp_compose_["compose"])([Object(external_wp_data_["withSelect"])((select, _ref2) => {
|
||||
let {
|
||||
filterValue,
|
||||
rootClientId = null
|
||||
}) => {
|
||||
} = _ref2;
|
||||
const {
|
||||
getDownloadableBlocks,
|
||||
isRequestingDownloadableBlocks
|
||||
|
@ -1432,13 +1466,15 @@ function DownloadableBlocksPanel({
|
|||
function InserterMenuDownloadableBlocksPanel() {
|
||||
const [debouncedFilterValue, setFilterValue] = Object(external_wp_element_["useState"])('');
|
||||
const debouncedSetFilterValue = Object(external_lodash_["debounce"])(setFilterValue, 400);
|
||||
return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__unstableInserterMenuExtension"], null, ({
|
||||
return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__unstableInserterMenuExtension"], null, _ref => {
|
||||
let {
|
||||
onSelect,
|
||||
onHover,
|
||||
filterValue,
|
||||
hasItems,
|
||||
rootClientId
|
||||
}) => {
|
||||
} = _ref;
|
||||
|
||||
if (debouncedFilterValue !== filterValue) {
|
||||
debouncedSetFilterValue(filterValue);
|
||||
}
|
||||
|
@ -1475,21 +1511,25 @@ var external_wp_editPost_ = __webpack_require__("BLhE");
|
|||
*/
|
||||
|
||||
|
||||
function CompactList({
|
||||
function CompactList(_ref) {
|
||||
let {
|
||||
items
|
||||
}) {
|
||||
} = _ref;
|
||||
|
||||
if (!items.length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return Object(external_wp_element_["createElement"])("ul", {
|
||||
className: "block-directory-compact-list"
|
||||
}, items.map(({
|
||||
}, items.map(_ref2 => {
|
||||
let {
|
||||
icon,
|
||||
id,
|
||||
title,
|
||||
author
|
||||
}) => Object(external_wp_element_["createElement"])("li", {
|
||||
} = _ref2;
|
||||
return Object(external_wp_element_["createElement"])("li", {
|
||||
key: id,
|
||||
className: "block-directory-compact-list__item"
|
||||
}, Object(external_wp_element_["createElement"])(downloadable_block_icon, {
|
||||
|
@ -1503,7 +1543,8 @@ function CompactList({
|
|||
className: "block-directory-compact-list__item-author"
|
||||
}, Object(external_wp_i18n_["sprintf"])(
|
||||
/* translators: %s: Name of the block author. */
|
||||
Object(external_wp_i18n_["__"])('By %s'), author))))));
|
||||
Object(external_wp_i18n_["__"])('By %s'), author))));
|
||||
}));
|
||||
}
|
||||
|
||||
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/installed-blocks-pre-publish-panel/index.js
|
||||
|
@ -1557,11 +1598,12 @@ function InstalledBlocksPrePublishPanel() {
|
|||
*/
|
||||
|
||||
|
||||
function InstallButton({
|
||||
function InstallButton(_ref) {
|
||||
let {
|
||||
attributes,
|
||||
block,
|
||||
clientId
|
||||
}) {
|
||||
} = _ref;
|
||||
const isInstallingBlock = Object(external_wp_data_["useSelect"])(select => select(store).isInstalling(block.id), [block.id]);
|
||||
const {
|
||||
installBlockType
|
||||
|
@ -1622,9 +1664,12 @@ const getInstallMissing = OriginalComponent => props => {
|
|||
const {
|
||||
getDownloadableBlocks
|
||||
} = select(store);
|
||||
const blocks = getDownloadableBlocks('block:' + originalName).filter(({
|
||||
const blocks = getDownloadableBlocks('block:' + originalName).filter(_ref => {
|
||||
let {
|
||||
name
|
||||
}) => originalName === name);
|
||||
} = _ref;
|
||||
return originalName === name;
|
||||
});
|
||||
return {
|
||||
hasPermission: select(external_wp_coreData_["store"]).canUser('read', 'block-directory/search'),
|
||||
block: blocks.length && blocks[0]
|
||||
|
@ -1640,10 +1685,11 @@ const getInstallMissing = OriginalComponent => props => {
|
|||
}));
|
||||
};
|
||||
|
||||
const ModifiedWarning = ({
|
||||
const ModifiedWarning = _ref2 => {
|
||||
let {
|
||||
originalBlock,
|
||||
...props
|
||||
}) => {
|
||||
} = _ref2;
|
||||
const {
|
||||
originalName,
|
||||
originalUndelimitedContent
|
||||
|
@ -1873,11 +1919,12 @@ const starEmpty = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["create
|
|||
* @return {JSX.Element} Icon component
|
||||
*/
|
||||
|
||||
function Icon({
|
||||
function Icon(_ref) {
|
||||
let {
|
||||
icon,
|
||||
size = 24,
|
||||
...props
|
||||
}) {
|
||||
} = _ref;
|
||||
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["cloneElement"])(icon, {
|
||||
width: size,
|
||||
height: size,
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -275,7 +275,10 @@ const DEFAULT_CATEGORIES = [{
|
|||
* @return {Object} Updated state.
|
||||
*/
|
||||
|
||||
function reducer_unprocessedBlockTypes(state = {}, action) {
|
||||
function reducer_unprocessedBlockTypes() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'ADD_UNPROCESSED_BLOCK_TYPE':
|
||||
return { ...state,
|
||||
|
@ -298,7 +301,10 @@ function reducer_unprocessedBlockTypes(state = {}, action) {
|
|||
* @return {Object} Updated state.
|
||||
*/
|
||||
|
||||
function reducer_blockTypes(state = {}, action) {
|
||||
function reducer_blockTypes() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'ADD_BLOCK_TYPES':
|
||||
return { ...state,
|
||||
|
@ -320,16 +326,22 @@ function reducer_blockTypes(state = {}, action) {
|
|||
* @return {Object} Updated state.
|
||||
*/
|
||||
|
||||
function blockStyles(state = {}, action) {
|
||||
function blockStyles() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'ADD_BLOCK_TYPES':
|
||||
return { ...state,
|
||||
...Object(external_lodash_["mapValues"])(Object(external_lodash_["keyBy"])(action.blockTypes, 'name'), blockType => {
|
||||
return Object(external_lodash_["uniqBy"])([...Object(external_lodash_["get"])(blockType, ['styles'], []).map(style => ({ ...style,
|
||||
source: 'block'
|
||||
})), ...Object(external_lodash_["get"])(state, [blockType.name], []).filter(({
|
||||
})), ...Object(external_lodash_["get"])(state, [blockType.name], []).filter(_ref => {
|
||||
let {
|
||||
source
|
||||
}) => 'block' !== source)], style => style.name);
|
||||
} = _ref;
|
||||
return 'block' !== source;
|
||||
})], style => style.name);
|
||||
})
|
||||
};
|
||||
|
||||
|
@ -355,16 +367,22 @@ function blockStyles(state = {}, action) {
|
|||
* @return {Object} Updated state.
|
||||
*/
|
||||
|
||||
function blockVariations(state = {}, action) {
|
||||
function blockVariations() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'ADD_BLOCK_TYPES':
|
||||
return { ...state,
|
||||
...Object(external_lodash_["mapValues"])(Object(external_lodash_["keyBy"])(action.blockTypes, 'name'), blockType => {
|
||||
return Object(external_lodash_["uniqBy"])([...Object(external_lodash_["get"])(blockType, ['variations'], []).map(variation => ({ ...variation,
|
||||
source: 'block'
|
||||
})), ...Object(external_lodash_["get"])(state, [blockType.name], []).filter(({
|
||||
})), ...Object(external_lodash_["get"])(state, [blockType.name], []).filter(_ref2 => {
|
||||
let {
|
||||
source
|
||||
}) => 'block' !== source)], variation => variation.name);
|
||||
} = _ref2;
|
||||
return 'block' !== source;
|
||||
})], variation => variation.name);
|
||||
})
|
||||
};
|
||||
|
||||
|
@ -390,7 +408,10 @@ function blockVariations(state = {}, action) {
|
|||
*/
|
||||
|
||||
function createBlockNameSetterReducer(setActionType) {
|
||||
return (state = null, action) => {
|
||||
return function () {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'REMOVE_BLOCK_TYPES':
|
||||
if (action.names.indexOf(state) !== -1) {
|
||||
|
@ -419,7 +440,10 @@ const groupingBlockName = createBlockNameSetterReducer('SET_GROUPING_BLOCK_NAME'
|
|||
* @return {WPBlockCategory[]} Updated state.
|
||||
*/
|
||||
|
||||
function reducer_categories(state = DEFAULT_CATEGORIES, action) {
|
||||
function reducer_categories() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_CATEGORIES;
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'SET_CATEGORIES':
|
||||
return action.categories || [];
|
||||
|
@ -448,7 +472,10 @@ function reducer_categories(state = DEFAULT_CATEGORIES, action) {
|
|||
|
||||
return state;
|
||||
}
|
||||
function collections(state = {}, action) {
|
||||
function collections() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'ADD_BLOCK_COLLECTION':
|
||||
return { ...state,
|
||||
|
@ -707,9 +734,12 @@ function getGroupingBlockName(state) {
|
|||
const getChildBlockNames = Object(rememo["a" /* default */])((state, blockName) => {
|
||||
return Object(external_lodash_["map"])(Object(external_lodash_["filter"])(state.blockTypes, blockType => {
|
||||
return Object(external_lodash_["includes"])(blockType.parent, blockName);
|
||||
}), ({
|
||||
}), _ref => {
|
||||
let {
|
||||
name
|
||||
}) => name);
|
||||
} = _ref;
|
||||
return name;
|
||||
});
|
||||
}, state => [state.blockTypes]);
|
||||
/**
|
||||
* Returns the block support value for a feature, if defined.
|
||||
|
@ -1128,10 +1158,11 @@ function unstable__bootstrapServerSideBlockDefinitions(definitions) {
|
|||
* @return {Object} Block settings.
|
||||
*/
|
||||
|
||||
function getBlockSettingsFromMetadata({
|
||||
function getBlockSettingsFromMetadata(_ref) {
|
||||
let {
|
||||
textdomain,
|
||||
...metadata
|
||||
}) {
|
||||
} = _ref;
|
||||
const allowedFields = ['apiVersion', 'title', 'category', 'parent', 'icon', 'description', 'keywords', 'attributes', 'providesContext', 'usesContext', 'supports', 'styles', 'example', 'variations'];
|
||||
const settings = Object(external_lodash_["pick"])(metadata, allowedFields);
|
||||
|
||||
|
@ -1247,10 +1278,11 @@ function translateBlockSettingUsingI18nSchema(i18nSchema, settingValue, textdoma
|
|||
*/
|
||||
|
||||
|
||||
function registerBlockCollection(namespace, {
|
||||
function registerBlockCollection(namespace, _ref2) {
|
||||
let {
|
||||
title,
|
||||
icon
|
||||
}) {
|
||||
} = _ref2;
|
||||
Object(external_wp_data_["dispatch"])(store).addBlockCollection(namespace, title, icon);
|
||||
}
|
||||
/**
|
||||
|
@ -1550,7 +1582,10 @@ var v4 = __webpack_require__("7Cbv");
|
|||
* @return {Object} Block object.
|
||||
*/
|
||||
|
||||
function createBlock(name, attributes = {}, innerBlocks = []) {
|
||||
function createBlock(name) {
|
||||
let attributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
let innerBlocks = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
||||
|
||||
const sanitizedAttributes = __experimentalSanitizeBlockAttributes(name, attributes);
|
||||
|
||||
const clientId = Object(v4["a" /* default */])(); // Blocks are stored with a unique ID, the assigned type name, the block
|
||||
|
@ -1575,7 +1610,8 @@ function createBlock(name, attributes = {}, innerBlocks = []) {
|
|||
* @return {Object[]} Array of Block objects.
|
||||
*/
|
||||
|
||||
function createBlocksFromInnerBlocksTemplate(innerBlocksOrTemplate = []) {
|
||||
function createBlocksFromInnerBlocksTemplate() {
|
||||
let innerBlocksOrTemplate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
||||
return innerBlocksOrTemplate.map(innerBlock => {
|
||||
const innerBlockTemplate = Array.isArray(innerBlock) ? innerBlock : [innerBlock.name, innerBlock.attributes, innerBlock.innerBlocks];
|
||||
const [name, attributes, innerBlocks = []] = innerBlockTemplate;
|
||||
|
@ -1593,7 +1629,9 @@ function createBlocksFromInnerBlocksTemplate(innerBlocksOrTemplate = []) {
|
|||
* @return {Object} A cloned block.
|
||||
*/
|
||||
|
||||
function __experimentalCloneSanitizedBlock(block, mergeAttributes = {}, newInnerBlocks) {
|
||||
function __experimentalCloneSanitizedBlock(block) {
|
||||
let mergeAttributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
let newInnerBlocks = arguments.length > 2 ? arguments[2] : undefined;
|
||||
const clientId = Object(v4["a" /* default */])();
|
||||
|
||||
const sanitizedAttributes = __experimentalSanitizeBlockAttributes(block.name, { ...block.attributes,
|
||||
|
@ -1617,7 +1655,9 @@ function __experimentalCloneSanitizedBlock(block, mergeAttributes = {}, newInner
|
|||
* @return {Object} A cloned block.
|
||||
*/
|
||||
|
||||
function cloneBlock(block, mergeAttributes = {}, newInnerBlocks) {
|
||||
function cloneBlock(block) {
|
||||
let mergeAttributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
let newInnerBlocks = arguments.length > 2 ? arguments[2] : undefined;
|
||||
const clientId = Object(v4["a" /* default */])();
|
||||
return { ...block,
|
||||
clientId,
|
||||
|
@ -1836,9 +1876,12 @@ function findTransform(transforms, predicate) {
|
|||
function getBlockTransforms(direction, blockTypeOrName) {
|
||||
// When retrieving transforms for all block types, recurse into self.
|
||||
if (blockTypeOrName === undefined) {
|
||||
return Object(external_lodash_["flatMap"])(registration_getBlockTypes(), ({
|
||||
return Object(external_lodash_["flatMap"])(registration_getBlockTypes(), _ref => {
|
||||
let {
|
||||
name
|
||||
}) => getBlockTransforms(direction, name));
|
||||
} = _ref;
|
||||
return getBlockTransforms(direction, name);
|
||||
});
|
||||
} // Validate that block type exists and has array of direction.
|
||||
|
||||
|
||||
|
@ -2088,7 +2131,8 @@ function normalizeBlockType(blockTypeOrName) {
|
|||
* @return {string} The block label.
|
||||
*/
|
||||
|
||||
function getBlockLabel(blockType, attributes, context = 'visual') {
|
||||
function getBlockLabel(blockType, attributes) {
|
||||
let context = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'visual';
|
||||
const {
|
||||
__experimentalLabel: getLabel,
|
||||
title
|
||||
|
@ -2117,7 +2161,8 @@ function getBlockLabel(blockType, attributes, context = 'visual') {
|
|||
* @return {string} The block label.
|
||||
*/
|
||||
|
||||
function getAccessibleBlockLabel(blockType, attributes, position, direction = 'vertical') {
|
||||
function getAccessibleBlockLabel(blockType, attributes, position) {
|
||||
let direction = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'vertical';
|
||||
// `title` is already localized, `label` is a user-supplied value.
|
||||
const title = blockType === null || blockType === void 0 ? void 0 : blockType.title;
|
||||
const label = blockType ? getBlockLabel(blockType, attributes, 'accessibility') : '';
|
||||
|
@ -2706,7 +2751,8 @@ const innerBlocksPropsProvider = {};
|
|||
* @param {Object} props Optional. Props to pass to the element.
|
||||
*/
|
||||
|
||||
function getBlockProps(props = {}) {
|
||||
function getBlockProps() {
|
||||
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
const {
|
||||
blockType,
|
||||
attributes
|
||||
|
@ -2720,7 +2766,8 @@ function getBlockProps(props = {}) {
|
|||
* @param {Object} props Optional. Props to pass to the element.
|
||||
*/
|
||||
|
||||
function getInnerBlocksProps(props = {}) {
|
||||
function getInnerBlocksProps() {
|
||||
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
const {
|
||||
innerBlocks
|
||||
} = innerBlocksPropsProvider; // Value is an array of blocks, so defer to block serializer
|
||||
|
@ -2745,7 +2792,8 @@ function getInnerBlocksProps(props = {}) {
|
|||
* @return {Object|string} Save element or raw HTML string.
|
||||
*/
|
||||
|
||||
function getSaveElement(blockTypeOrName, attributes, innerBlocks = []) {
|
||||
function getSaveElement(blockTypeOrName, attributes) {
|
||||
let innerBlocks = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
||||
const blockType = normalizeBlockType(blockTypeOrName);
|
||||
let {
|
||||
save
|
||||
|
@ -2923,9 +2971,10 @@ function getCommentDelimitedContent(rawBlockName, attributes, content) {
|
|||
* @return {string} Serialized block.
|
||||
*/
|
||||
|
||||
function serializeBlock(block, {
|
||||
function serializeBlock(block) {
|
||||
let {
|
||||
isInnerBlocks = false
|
||||
} = {}) {
|
||||
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
const blockName = block.name;
|
||||
const saveContent = getBlockInnerHTML(block);
|
||||
|
||||
|
@ -3881,7 +3930,13 @@ function createLogger() {
|
|||
* @return {Function} Augmented logger function.
|
||||
*/
|
||||
function createLogHandler(logger) {
|
||||
let log = (message, ...args) => logger('Block validation: ' + message, ...args); // In test environments, pre-process string substitutions to improve
|
||||
let log = function (message) {
|
||||
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
||||
args[_key - 1] = arguments[_key];
|
||||
}
|
||||
|
||||
return logger('Block validation: ' + message, ...args);
|
||||
}; // In test environments, pre-process string substitutions to improve
|
||||
// readability of error messages. We'd prefer to avoid pulling in this
|
||||
// dependency in runtime environments, and it can be dropped by a combo
|
||||
// of Webpack env substitution + UglifyJS dead code elimination.
|
||||
|
@ -3913,14 +3968,22 @@ function createQueuedLogger() {
|
|||
const queue = [];
|
||||
const logger = createLogger();
|
||||
return {
|
||||
error(...args) {
|
||||
error() {
|
||||
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
||||
args[_key2] = arguments[_key2];
|
||||
}
|
||||
|
||||
queue.push({
|
||||
log: logger.error,
|
||||
args
|
||||
});
|
||||
},
|
||||
|
||||
warning(...args) {
|
||||
warning() {
|
||||
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
||||
args[_key3] = arguments[_key3];
|
||||
}
|
||||
|
||||
queue.push({
|
||||
log: logger.warning,
|
||||
args
|
||||
|
@ -4169,7 +4232,8 @@ function getMeaningfulAttributePairs(token) {
|
|||
* @return {boolean} Whether two text tokens are equivalent.
|
||||
*/
|
||||
|
||||
function isEquivalentTextTokens(actual, expected, logger = createLogger()) {
|
||||
function isEquivalentTextTokens(actual, expected) {
|
||||
let logger = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : createLogger();
|
||||
// This function is intentionally written as syntactically "ugly" as a hot
|
||||
// path optimization. Text is progressively normalized in order from least-
|
||||
// to-most operationally expensive, until the earliest point at which text
|
||||
|
@ -4277,7 +4341,9 @@ const isEqualAttributesOfName = {
|
|||
* @return {boolean} Whether attributes are equivalent.
|
||||
*/
|
||||
|
||||
function isEqualTagAttributePairs(actual, expected, logger = createLogger()) {
|
||||
function isEqualTagAttributePairs(actual, expected) {
|
||||
let logger = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : createLogger();
|
||||
|
||||
// Attributes is tokenized as tuples. Their lengths should match. This also
|
||||
// avoids us needing to check both attributes sets, since if A has any keys
|
||||
// which do not exist in B, we know the sets to be different.
|
||||
|
@ -4329,7 +4395,9 @@ function isEqualTagAttributePairs(actual, expected, logger = createLogger()) {
|
|||
*/
|
||||
|
||||
const isEqualTokensOfType = {
|
||||
StartTag: (actual, expected, logger = createLogger()) => {
|
||||
StartTag: function (actual, expected) {
|
||||
let logger = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : createLogger();
|
||||
|
||||
if (actual.tagName !== expected.tagName && // Optimization: Use short-circuit evaluation to defer case-
|
||||
// insensitive check on the assumption that the majority case will
|
||||
// have exactly equal tag names.
|
||||
|
@ -4377,7 +4445,9 @@ function getNextNonWhitespaceToken(tokens) {
|
|||
* @return {Object[]|null} Array of valid tokenized HTML elements, or null on error
|
||||
*/
|
||||
|
||||
function getHTMLTokens(html, logger = createLogger()) {
|
||||
function getHTMLTokens(html) {
|
||||
let logger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : createLogger();
|
||||
|
||||
try {
|
||||
return new Tokenizer(new validation_DecodeEntityParser()).tokenize(html);
|
||||
} catch (e) {
|
||||
|
@ -4421,7 +4491,9 @@ function isClosedByToken(currentToken, nextToken) {
|
|||
* @return {boolean} Whether HTML strings are equivalent.
|
||||
*/
|
||||
|
||||
function isEquivalentHTML(actual, expected, logger = createLogger()) {
|
||||
function isEquivalentHTML(actual, expected) {
|
||||
let logger = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : createLogger();
|
||||
|
||||
// Short-circuit if markup is identical.
|
||||
if (actual === expected) {
|
||||
return true;
|
||||
|
@ -4659,7 +4731,8 @@ function convertLegacyBlockNameAndAttributes(name, attributes) {
|
|||
* @return {string} An HTML string representing a block.
|
||||
*/
|
||||
|
||||
function serializeRawBlock(rawBlock, options = {}) {
|
||||
function serializeRawBlock(rawBlock) {
|
||||
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
const {
|
||||
isCommentDelimited = true
|
||||
} = options;
|
||||
|
@ -5095,11 +5168,11 @@ function getChildrenArray(children) {
|
|||
*/
|
||||
|
||||
|
||||
function concat(...blockNodes) {
|
||||
function concat() {
|
||||
const result = [];
|
||||
|
||||
for (let i = 0; i < blockNodes.length; i++) {
|
||||
const blockNode = Object(external_lodash_["castArray"])(blockNodes[i]);
|
||||
for (let i = 0; i < arguments.length; i++) {
|
||||
const blockNode = Object(external_lodash_["castArray"])(i < 0 || arguments.length <= i ? undefined : arguments[i]);
|
||||
|
||||
for (let j = 0; j < blockNode.length; j++) {
|
||||
const child = blockNode[j];
|
||||
|
@ -5432,7 +5505,8 @@ function parseWithAttributeSchema(innerHTML, attributeSchema) {
|
|||
* @return {Object} All block attributes.
|
||||
*/
|
||||
|
||||
function getBlockAttributes(blockTypeOrName, innerHTML, attributes = {}) {
|
||||
function getBlockAttributes(blockTypeOrName, innerHTML) {
|
||||
let attributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
||||
const blockType = normalizeBlockType(blockTypeOrName);
|
||||
const blockAttributes = Object(external_lodash_["mapValues"])(blockType.attributes, (attributeSchema, attributeKey) => {
|
||||
return getBlockAttribute(attributeKey, attributeSchema, innerHTML, attributes);
|
||||
|
@ -5823,10 +5897,13 @@ function parseRawBlock(rawBlock) {
|
|||
console.groupEnd();
|
||||
/* eslint-enable no-console */
|
||||
} else {
|
||||
validationIssues.forEach(({
|
||||
validationIssues.forEach(_ref => {
|
||||
let {
|
||||
log,
|
||||
args
|
||||
}) => log(...args));
|
||||
} = _ref;
|
||||
return log(...args);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5906,9 +5983,12 @@ function htmlToBlocks(html) {
|
|||
const doc = document.implementation.createHTMLDocument('');
|
||||
doc.body.innerHTML = html;
|
||||
return Array.from(doc.body.children).flatMap(node => {
|
||||
const rawTransform = findTransform(getRawTransforms(), ({
|
||||
const rawTransform = findTransform(getRawTransforms(), _ref => {
|
||||
let {
|
||||
isMatch
|
||||
}) => isMatch(node));
|
||||
} = _ref;
|
||||
return isMatch(node);
|
||||
});
|
||||
|
||||
if (!rawTransform) {
|
||||
return createBlock( // Should not be hardcoded.
|
||||
|
@ -6306,9 +6386,12 @@ function list_reducer_isList(node) {
|
|||
}
|
||||
|
||||
function shallowTextContent(element) {
|
||||
return Array.from(element.childNodes).map(({
|
||||
return Array.from(element.childNodes).map(_ref => {
|
||||
let {
|
||||
nodeValue = ''
|
||||
}) => nodeValue).join('');
|
||||
} = _ref;
|
||||
return nodeValue;
|
||||
}).join('');
|
||||
}
|
||||
|
||||
function listReducer(node) {
|
||||
|
@ -6485,7 +6568,8 @@ function canHaveAnchor(node, schema) {
|
|||
*/
|
||||
|
||||
|
||||
function wrapFigureContent(element, beforeElement = element) {
|
||||
function wrapFigureContent(element) {
|
||||
let beforeElement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : element;
|
||||
const figure = element.ownerDocument.createElement('figure');
|
||||
beforeElement.parentNode.insertBefore(figure, beforeElement);
|
||||
figure.appendChild(element);
|
||||
|
@ -6554,7 +6638,9 @@ var external_wp_shortcode_ = __webpack_require__("SVSp");
|
|||
|
||||
|
||||
|
||||
function segmentHTMLToShortcodeBlock(HTML, lastIndex = 0, excludedBlockNames = []) {
|
||||
function segmentHTMLToShortcodeBlock(HTML) {
|
||||
let lastIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
||||
let excludedBlockNames = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
||||
// Get all matches.
|
||||
const transformsFrom = getBlockTransforms('from');
|
||||
const transformation = findTransform(transformsFrom, transform => excludedBlockNames.indexOf(transform.blockName) === -1 && transform.type === 'shortcode' && Object(external_lodash_["some"])(Object(external_lodash_["castArray"])(transform.tag), tag => Object(external_wp_shortcode_["regexp"])(tag).test(HTML)));
|
||||
|
@ -6708,11 +6794,12 @@ function getBlockContentSchemaFromTransforms(transforms, context) {
|
|||
phrasingContentSchema,
|
||||
isPaste: context === 'paste'
|
||||
};
|
||||
const schemas = transforms.map(({
|
||||
const schemas = transforms.map(_ref => {
|
||||
let {
|
||||
isMatch,
|
||||
blockName,
|
||||
schema
|
||||
}) => {
|
||||
} = _ref;
|
||||
const hasAnchorSupport = registration_hasBlockSupport(blockName, 'anchor');
|
||||
schema = Object(external_lodash_["isFunction"])(schema) ? schema(schemaArgs) : schema; // If the block does not has anchor support and the transform does not
|
||||
// provides an isMatch we can return the schema right away.
|
||||
|
@ -6763,8 +6850,8 @@ function getBlockContentSchemaFromTransforms(transforms, context) {
|
|||
// that returns if one of the source functions returns true.
|
||||
|
||||
|
||||
return (...args) => {
|
||||
return objValue(...args) || srcValue(...args);
|
||||
return function () {
|
||||
return objValue(...arguments) || srcValue(...arguments);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -6828,7 +6915,9 @@ function deepFilterNodeList(nodeList, filters, doc, schema) {
|
|||
* @return {string} The filtered HTML.
|
||||
*/
|
||||
|
||||
function deepFilterHTML(HTML, filters = [], schema) {
|
||||
function deepFilterHTML(HTML) {
|
||||
let filters = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
||||
let schema = arguments.length > 2 ? arguments[2] : undefined;
|
||||
const doc = document.implementation.createHTMLDocument('');
|
||||
doc.body.innerHTML = HTML;
|
||||
deepFilterNodeList(doc.body.childNodes, filters, doc, schema);
|
||||
|
@ -7056,13 +7145,14 @@ function filterInlineHTML(HTML, preserveWhiteSpace) {
|
|||
*/
|
||||
|
||||
|
||||
function pasteHandler({
|
||||
function pasteHandler(_ref) {
|
||||
let {
|
||||
HTML = '',
|
||||
plainText = '',
|
||||
mode = 'AUTO',
|
||||
tagName,
|
||||
preserveWhiteSpace
|
||||
}) {
|
||||
} = _ref;
|
||||
// First of all, strip any meta tags.
|
||||
HTML = HTML.replace(/<meta[^>]+>/g, ''); // Strip Windows markers.
|
||||
|
||||
|
@ -7206,9 +7296,11 @@ function deprecatedGetPhrasingContentSchema(context) {
|
|||
* @return {Array} A list of blocks.
|
||||
*/
|
||||
|
||||
function rawHandler({
|
||||
function rawHandler(_ref) {
|
||||
let {
|
||||
HTML = ''
|
||||
}) {
|
||||
} = _ref;
|
||||
|
||||
// If we detect block delimiters, parse entirely as blocks.
|
||||
if (HTML.indexOf('<!-- wp:') !== -1) {
|
||||
return parser_parse(HTML);
|
||||
|
@ -7307,8 +7399,11 @@ function categories_updateCategory(slug, category) {
|
|||
* @return {boolean} Whether the list of blocks matches a templates.
|
||||
*/
|
||||
|
||||
function doBlocksMatchTemplate(blocks = [], template = []) {
|
||||
return blocks.length === template.length && Object(external_lodash_["every"])(template, ([name,, innerBlocksTemplate], index) => {
|
||||
function doBlocksMatchTemplate() {
|
||||
let blocks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
||||
let template = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
||||
return blocks.length === template.length && Object(external_lodash_["every"])(template, (_ref, index) => {
|
||||
let [name,, innerBlocksTemplate] = _ref;
|
||||
const block = blocks[index];
|
||||
return name === block.name && doBlocksMatchTemplate(block.innerBlocks, innerBlocksTemplate);
|
||||
});
|
||||
|
@ -7327,13 +7422,17 @@ function doBlocksMatchTemplate(blocks = [], template = []) {
|
|||
* @return {Array} Updated Block list.
|
||||
*/
|
||||
|
||||
function synchronizeBlocksWithTemplate(blocks = [], template) {
|
||||
function synchronizeBlocksWithTemplate() {
|
||||
let blocks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
||||
let template = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
// If no template is provided, return blocks unmodified.
|
||||
if (!template) {
|
||||
return blocks;
|
||||
}
|
||||
|
||||
return Object(external_lodash_["map"])(template, ([name, attributes, innerBlocksTemplate], index) => {
|
||||
return Object(external_lodash_["map"])(template, (_ref2, index) => {
|
||||
let [name, attributes, innerBlocksTemplate] = _ref2;
|
||||
const block = blocks[index];
|
||||
|
||||
if (block && block.name === name) {
|
||||
|
@ -7517,10 +7616,12 @@ const {
|
|||
* @return {WPComponent} Element with BlockContent injected via context.
|
||||
*/
|
||||
|
||||
const BlockContentProvider = ({
|
||||
const BlockContentProvider = _ref => {
|
||||
let {
|
||||
children,
|
||||
innerBlocks
|
||||
}) => {
|
||||
} = _ref;
|
||||
|
||||
const BlockContent = () => {
|
||||
// Value is an array of blocks, so defer to block serializer
|
||||
const html = serialize(innerBlocks, {
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -422,7 +422,9 @@ function withGlobalEvents(eventTypesToHandlers) {
|
|||
event) {
|
||||
const handler = eventTypesToHandlers[
|
||||
/** @type {keyof GlobalEventHandlersEventMap} */
|
||||
event.type];
|
||||
event.type
|
||||
/* eslint-enable jsdoc/no-undefined-types */
|
||||
];
|
||||
|
||||
if (typeof this.wrappedRef[handler] === 'function') {
|
||||
this.wrappedRef[handler](event);
|
||||
|
@ -495,7 +497,8 @@ function createId(object) {
|
|||
*/
|
||||
|
||||
|
||||
function useInstanceId(object, prefix, preferredId = '') {
|
||||
function useInstanceId(object, prefix) {
|
||||
let preferredId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
||||
return Object(external_wp_element_["useMemo"])(() => {
|
||||
if (preferredId) return preferredId;
|
||||
const id = createId(object);
|
||||
|
@ -619,7 +622,8 @@ const withSafeTimeout = create_higher_order_component(OriginalComponent => {
|
|||
* @return {any} A higher order component wrapper accepting a component that takes the state props + its own props + `setState` and returning a component that only accepts the own props.
|
||||
*/
|
||||
|
||||
function withState(initialState = {}) {
|
||||
function withState() {
|
||||
let initialState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
external_wp_deprecated_default()('wp.compose.withState', {
|
||||
alternative: 'wp.element.useState'
|
||||
});
|
||||
|
@ -724,9 +728,9 @@ function useRefEffect(callback, dependencies) {
|
|||
*/
|
||||
|
||||
function useConstrainedTabbing() {
|
||||
return useRefEffect(
|
||||
return useRefEffect((
|
||||
/** @type {HTMLElement} */
|
||||
node => {
|
||||
node) => {
|
||||
/** @type {number|undefined} */
|
||||
let timeoutId;
|
||||
|
||||
|
@ -808,7 +812,9 @@ var clipboard_default = /*#__PURE__*/__webpack_require__.n(dist_clipboard);
|
|||
* timeout.
|
||||
*/
|
||||
|
||||
function useCopyOnClick(ref, text, timeout = 4000) {
|
||||
function useCopyOnClick(ref, text) {
|
||||
let timeout = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 4000;
|
||||
|
||||
/* eslint-enable jsdoc/no-undefined-types */
|
||||
external_wp_deprecated_default()('wp.compose.useCopyOnClick', {
|
||||
since: '10.3',
|
||||
|
@ -831,10 +837,11 @@ function useCopyOnClick(ref, text, timeout = 4000) {
|
|||
clipboard.current = new clipboard_default.a(ref.current, {
|
||||
text: () => typeof text === 'function' ? text() : text
|
||||
});
|
||||
clipboard.current.on('success', ({
|
||||
clipboard.current.on('success', _ref => {
|
||||
let {
|
||||
clearSelection,
|
||||
trigger
|
||||
}) => {
|
||||
} = _ref;
|
||||
// Clearing selection will move focus back to the triggering button,
|
||||
// ensuring that it is not reset to the body, and further that it is
|
||||
// kept within the rendered node.
|
||||
|
@ -913,9 +920,10 @@ function useCopyToClipboard(text, onSuccess) {
|
|||
}
|
||||
|
||||
});
|
||||
clipboard.on('success', ({
|
||||
clipboard.on('success', _ref => {
|
||||
let {
|
||||
clearSelection
|
||||
}) => {
|
||||
} = _ref;
|
||||
// Clearing selection will move focus back to the triggering
|
||||
// button, ensuring that it is not reset to the body, and
|
||||
// further that it is kept within the rendered node.
|
||||
|
@ -962,7 +970,8 @@ function useCopyToClipboard(text, onSuccess) {
|
|||
* ```
|
||||
*/
|
||||
|
||||
function useFocusOnMount(focusOnMount = 'firstElement') {
|
||||
function useFocusOnMount() {
|
||||
let focusOnMount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'firstElement';
|
||||
const focusOnMountRef = Object(external_wp_element_["useRef"])(focusOnMount);
|
||||
Object(external_wp_element_["useEffect"])(() => {
|
||||
focusOnMountRef.current = focusOnMount;
|
||||
|
@ -1458,9 +1467,9 @@ function useDialog(options) {
|
|||
return;
|
||||
}
|
||||
|
||||
node.addEventListener('keydown',
|
||||
node.addEventListener('keydown', (
|
||||
/** @type {KeyboardEvent} */
|
||||
event => {
|
||||
event) => {
|
||||
var _currentOptions$curre3;
|
||||
|
||||
// Close on escape
|
||||
|
@ -1508,11 +1517,12 @@ const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? external_wp_el
|
|||
* @param {(e: MouseEvent) => void} props.onDragEnd
|
||||
*/
|
||||
|
||||
function useDragging({
|
||||
function useDragging(_ref) {
|
||||
let {
|
||||
onDragStart,
|
||||
onDragMove,
|
||||
onDragEnd
|
||||
}) {
|
||||
} = _ref;
|
||||
const [isDragging, setIsDragging] = Object(external_wp_element_["useState"])(false);
|
||||
const eventsRef = Object(external_wp_element_["useRef"])({
|
||||
onDragStart,
|
||||
|
@ -1524,12 +1534,12 @@ function useDragging({
|
|||
eventsRef.current.onDragMove = onDragMove;
|
||||
eventsRef.current.onDragEnd = onDragEnd;
|
||||
}, [onDragStart, onDragMove, onDragEnd]);
|
||||
const onMouseMove = Object(external_wp_element_["useCallback"])(
|
||||
const onMouseMove = Object(external_wp_element_["useCallback"])((
|
||||
/** @type {MouseEvent} */
|
||||
event => eventsRef.current.onDragMove && eventsRef.current.onDragMove(event), []);
|
||||
const endDrag = Object(external_wp_element_["useCallback"])(
|
||||
event) => eventsRef.current.onDragMove && eventsRef.current.onDragMove(event), []);
|
||||
const endDrag = Object(external_wp_element_["useCallback"])((
|
||||
/** @type {MouseEvent} */
|
||||
event => {
|
||||
event) => {
|
||||
if (eventsRef.current.onDragEnd) {
|
||||
eventsRef.current.onDragEnd(event);
|
||||
}
|
||||
|
@ -1538,9 +1548,9 @@ function useDragging({
|
|||
document.removeEventListener('mouseup', endDrag);
|
||||
setIsDragging(false);
|
||||
}, []);
|
||||
const startDrag = Object(external_wp_element_["useCallback"])(
|
||||
const startDrag = Object(external_wp_element_["useCallback"])((
|
||||
/** @type {MouseEvent} */
|
||||
event => {
|
||||
event) => {
|
||||
if (eventsRef.current.onDragStart) {
|
||||
eventsRef.current.onDragStart(event);
|
||||
}
|
||||
|
@ -1603,7 +1613,9 @@ var mousetrap_global_bind = __webpack_require__("VcSt");
|
|||
* @return {boolean} True if MacOS; false otherwise.
|
||||
*/
|
||||
|
||||
function isAppleOS(_window = window) {
|
||||
function isAppleOS() {
|
||||
let _window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
|
||||
|
||||
const {
|
||||
platform
|
||||
} = _window.navigator;
|
||||
|
@ -1624,13 +1636,14 @@ function isAppleOS(_window = window) {
|
|||
|
||||
function useKeyboardShortcut(
|
||||
/* eslint-enable jsdoc/valid-types */
|
||||
shortcuts, callback, {
|
||||
shortcuts, callback) {
|
||||
let {
|
||||
bindGlobal = false,
|
||||
eventName = 'keydown',
|
||||
isDisabled = false,
|
||||
// This is important for performance considerations.
|
||||
target
|
||||
} = {}) {
|
||||
} = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
||||
const currentCallback = Object(external_wp_element_["useRef"])(callback);
|
||||
Object(external_wp_element_["useEffect"])(() => {
|
||||
currentCallback.current = callback;
|
||||
|
@ -1663,13 +1676,12 @@ shortcuts, callback, {
|
|||
|
||||
const bindFn = bindGlobal ? 'bindGlobal' : 'bind'; // @ts-ignore `bindGlobal` is an undocumented property
|
||||
|
||||
mousetrap[bindFn](shortcut, (
|
||||
/* eslint-disable jsdoc/valid-types */
|
||||
|
||||
/** @type {[e: import('mousetrap').ExtendedKeyboardEvent, combo: string]} */
|
||||
...args) =>
|
||||
mousetrap[bindFn](shortcut, function () {
|
||||
return (
|
||||
/* eslint-enable jsdoc/valid-types */
|
||||
currentCallback.current(...args), eventName);
|
||||
currentCallback.current(...arguments)
|
||||
);
|
||||
}, eventName);
|
||||
});
|
||||
return () => {
|
||||
mousetrap.reset();
|
||||
|
@ -1823,7 +1835,8 @@ null);
|
|||
* @return {boolean} Whether viewport matches query.
|
||||
*/
|
||||
|
||||
const useViewportMatch = (breakpoint, operator = '>=') => {
|
||||
const useViewportMatch = function (breakpoint) {
|
||||
let operator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '>=';
|
||||
const simulatedWidth = Object(external_wp_element_["useContext"])(ViewportMatchWidthContext);
|
||||
const mediaQuery = !simulatedWidth && `(${CONDITIONS[operator]}: ${BREAKPOINTS[breakpoint]}px)`;
|
||||
const mediaQueryResult = useMediaQuery(mediaQuery || undefined);
|
||||
|
@ -1918,9 +1931,10 @@ function getFirstItemsPresentInState(list, state) {
|
|||
*/
|
||||
|
||||
|
||||
function useAsyncList(list, config = {
|
||||
function useAsyncList(list) {
|
||||
let config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
||||
step: 1
|
||||
}) {
|
||||
};
|
||||
const {
|
||||
step = 1
|
||||
} = config;
|
||||
|
@ -1983,9 +1997,12 @@ function useAsyncList(list, config = {
|
|||
* @param {string} prefix Just a prefix to show when console logging.
|
||||
*/
|
||||
|
||||
function useWarnOnChange(object, prefix = 'Change detection') {
|
||||
function useWarnOnChange(object) {
|
||||
let prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'Change detection';
|
||||
const previousValues = usePrevious(object);
|
||||
Object.entries(previousValues !== null && previousValues !== void 0 ? previousValues : []).forEach(([key, value]) => {
|
||||
Object.entries(previousValues !== null && previousValues !== void 0 ? previousValues : []).forEach(_ref => {
|
||||
let [key, value] = _ref;
|
||||
|
||||
if (value !== object[
|
||||
/** @type {keyof typeof object} */
|
||||
key]) {
|
||||
|
@ -2125,7 +2142,8 @@ function useFreshRef(value) {
|
|||
*/
|
||||
|
||||
|
||||
function useDropZone({
|
||||
function useDropZone(_ref) {
|
||||
let {
|
||||
isDisabled,
|
||||
onDrop: _onDrop,
|
||||
onDragStart: _onDragStart,
|
||||
|
@ -2133,7 +2151,7 @@ function useDropZone({
|
|||
onDragLeave: _onDragLeave,
|
||||
onDragEnd: _onDragEnd,
|
||||
onDragOver: _onDragOver
|
||||
}) {
|
||||
} = _ref;
|
||||
const onDropRef = useFreshRef(_onDrop);
|
||||
const onDragStartRef = useFreshRef(_onDragStart);
|
||||
const onDragEnterRef = useFreshRef(_onDragEnter);
|
||||
|
@ -2400,9 +2418,9 @@ function useFixedWindowList(elementRef, itemHeight, totalItems, options) {
|
|||
visibleItems: initWindowSize,
|
||||
start: 0,
|
||||
end: initWindowSize,
|
||||
itemInView:
|
||||
itemInView: (
|
||||
/** @type {number} */
|
||||
index => {
|
||||
index) => {
|
||||
return index >= 0 && index <= initWindowSize;
|
||||
}
|
||||
});
|
||||
|
@ -2415,9 +2433,9 @@ function useFixedWindowList(elementRef, itemHeight, totalItems, options) {
|
|||
|
||||
const scrollContainer = Object(external_wp_dom_["getScrollContainer"])(elementRef.current);
|
||||
|
||||
const measureWindow =
|
||||
const measureWindow = (
|
||||
/** @type {boolean | undefined} */
|
||||
initRender => {
|
||||
initRender) => {
|
||||
var _options$windowOversc;
|
||||
|
||||
if (!scrollContainer) {
|
||||
|
@ -2435,9 +2453,9 @@ function useFixedWindowList(elementRef, itemHeight, totalItems, options) {
|
|||
visibleItems,
|
||||
start,
|
||||
end,
|
||||
itemInView:
|
||||
itemInView: (
|
||||
/** @type {number} */
|
||||
index => {
|
||||
index) => {
|
||||
return start <= index && index <= end;
|
||||
}
|
||||
};
|
||||
|
@ -2473,9 +2491,9 @@ function useFixedWindowList(elementRef, itemHeight, totalItems, options) {
|
|||
|
||||
const scrollContainer = Object(external_wp_dom_["getScrollContainer"])(elementRef.current);
|
||||
|
||||
const handleKeyDown =
|
||||
const handleKeyDown = (
|
||||
/** @type {KeyboardEvent} */
|
||||
event => {
|
||||
event) => {
|
||||
switch (event.keyCode) {
|
||||
case external_wp_keycodes_["HOME"]:
|
||||
{
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -746,7 +746,9 @@ function conservativeMapItem(item, nextItem) {
|
|||
*
|
||||
* @return {Function} Higher-order reducer.
|
||||
*/
|
||||
const onSubKey = actionProperty => reducer => (state = {}, action) => {
|
||||
const onSubKey = actionProperty => reducer => function () {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
// Retrieve subkey from action. Do not track if undefined; useful for cases
|
||||
// where reducer is scoped by action shape.
|
||||
const key = action[actionProperty];
|
||||
|
@ -818,7 +820,8 @@ function receiveItems(items, edits) {
|
|||
* @return {Object} Action object.
|
||||
*/
|
||||
|
||||
function removeItems(kind, name, records, invalidateCache = false) {
|
||||
function removeItems(kind, name, records) {
|
||||
let invalidateCache = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
||||
return {
|
||||
type: 'REMOVE_ITEMS',
|
||||
itemIds: Object(external_lodash_["castArray"])(records),
|
||||
|
@ -838,7 +841,9 @@ function removeItems(kind, name, records, invalidateCache = false) {
|
|||
* @return {Object} Action object.
|
||||
*/
|
||||
|
||||
function receiveQueriedItems(items, query = {}, edits) {
|
||||
function receiveQueriedItems(items) {
|
||||
let query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
let edits = arguments.length > 2 ? arguments[2] : undefined;
|
||||
return { ...receiveItems(items, edits),
|
||||
query
|
||||
};
|
||||
|
@ -968,7 +973,8 @@ async function defaultProcessor(requests) {
|
|||
* either `output` or `error`.
|
||||
*/
|
||||
|
||||
function createBatch(processor = defaultProcessor) {
|
||||
function createBatch() {
|
||||
let processor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultProcessor;
|
||||
let lastId = 0;
|
||||
let queue = [];
|
||||
const pending = new ObservableSet();
|
||||
|
@ -1043,9 +1049,12 @@ function createBatch(processor = defaultProcessor) {
|
|||
let results;
|
||||
|
||||
try {
|
||||
results = await processor(queue.map(({
|
||||
results = await processor(queue.map(_ref => {
|
||||
let {
|
||||
input
|
||||
}) => input));
|
||||
} = _ref;
|
||||
return input;
|
||||
}));
|
||||
|
||||
if (results.length !== queue.length) {
|
||||
throw new Error('run: Array returned by processor must be same size as input array.');
|
||||
|
@ -1084,7 +1093,11 @@ function createBatch(processor = defaultProcessor) {
|
|||
}
|
||||
|
||||
class ObservableSet {
|
||||
constructor(...args) {
|
||||
constructor() {
|
||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
this.set = new Set(...args);
|
||||
this.subscribers = new Set();
|
||||
}
|
||||
|
@ -1093,14 +1106,14 @@ class ObservableSet {
|
|||
return this.set.size;
|
||||
}
|
||||
|
||||
add(...args) {
|
||||
this.set.add(...args);
|
||||
add() {
|
||||
this.set.add(...arguments);
|
||||
this.subscribers.forEach(subscriber => subscriber());
|
||||
return this;
|
||||
}
|
||||
|
||||
delete(...args) {
|
||||
const isSuccess = this.set.delete(...args);
|
||||
delete() {
|
||||
const isSuccess = this.set.delete(...arguments);
|
||||
this.subscribers.forEach(subscriber => subscriber());
|
||||
return isSuccess;
|
||||
}
|
||||
|
@ -1200,7 +1213,10 @@ function addEntities(entities) {
|
|||
* @return {Object} Action object.
|
||||
*/
|
||||
|
||||
function receiveEntityRecords(kind, name, records, query, invalidateCache = false, edits) {
|
||||
function receiveEntityRecords(kind, name, records, query) {
|
||||
let invalidateCache = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
||||
let edits = arguments.length > 5 ? arguments[5] : undefined;
|
||||
|
||||
// Auto drafts should not have titles, but some plugins rely on them so we can't filter this
|
||||
// on the server.
|
||||
if (kind === 'postType') {
|
||||
|
@ -1314,11 +1330,14 @@ function receiveEmbedPreview(url, preview) {
|
|||
* Must return a promise.
|
||||
*/
|
||||
|
||||
const deleteEntityRecord = (kind, name, recordId, query, {
|
||||
const deleteEntityRecord = function (kind, name, recordId, query) {
|
||||
let {
|
||||
__unstableFetch = external_wp_apiFetch_default.a
|
||||
} = {}) => async ({
|
||||
} = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
||||
return async _ref => {
|
||||
let {
|
||||
dispatch
|
||||
}) => {
|
||||
} = _ref;
|
||||
const entities = await dispatch(getKindEntities(kind));
|
||||
const entity = Object(external_lodash_["find"])(entities, {
|
||||
kind,
|
||||
|
@ -1371,6 +1390,7 @@ const deleteEntityRecord = (kind, name, recordId, query, {
|
|||
dispatch.__unstableReleaseStoreLock(lock);
|
||||
}
|
||||
};
|
||||
};
|
||||
/**
|
||||
* Returns an action object that triggers an
|
||||
* edit to an entity record.
|
||||
|
@ -1385,10 +1405,13 @@ const deleteEntityRecord = (kind, name, recordId, query, {
|
|||
* @return {Object} Action object.
|
||||
*/
|
||||
|
||||
const actions_editEntityRecord = (kind, name, recordId, edits, options = {}) => ({
|
||||
const actions_editEntityRecord = function (kind, name, recordId, edits) {
|
||||
let options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
||||
return _ref2 => {
|
||||
let {
|
||||
select,
|
||||
dispatch
|
||||
}) => {
|
||||
} = _ref2;
|
||||
const entity = select.getEntity(kind, name);
|
||||
|
||||
if (!entity) {
|
||||
|
@ -1432,6 +1455,7 @@ const actions_editEntityRecord = (kind, name, recordId, edits, options = {}) =>
|
|||
}
|
||||
});
|
||||
};
|
||||
};
|
||||
/**
|
||||
* Action triggered to undo the last edit to
|
||||
* an entity record, if any.
|
||||
|
@ -1439,10 +1463,11 @@ const actions_editEntityRecord = (kind, name, recordId, edits, options = {}) =>
|
|||
* @return {undefined}
|
||||
*/
|
||||
|
||||
const undo = () => ({
|
||||
const undo = () => _ref3 => {
|
||||
let {
|
||||
select,
|
||||
dispatch
|
||||
}) => {
|
||||
} = _ref3;
|
||||
const undoEdit = select.getUndoEdit();
|
||||
|
||||
if (!undoEdit) {
|
||||
|
@ -1464,10 +1489,11 @@ const undo = () => ({
|
|||
* @return {undefined}
|
||||
*/
|
||||
|
||||
const redo = () => ({
|
||||
const redo = () => _ref4 => {
|
||||
let {
|
||||
select,
|
||||
dispatch
|
||||
}) => {
|
||||
} = _ref4;
|
||||
const redoEdit = select.getRedoEdit();
|
||||
|
||||
if (!redoEdit) {
|
||||
|
@ -1506,14 +1532,17 @@ function actions_unstableCreateUndoLevel() {
|
|||
* Must return a promise.
|
||||
*/
|
||||
|
||||
const saveEntityRecord = (kind, name, record, {
|
||||
const saveEntityRecord = function (kind, name, record) {
|
||||
let {
|
||||
isAutosave = false,
|
||||
__unstableFetch = external_wp_apiFetch_default.a
|
||||
} = {}) => async ({
|
||||
} = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
||||
return async _ref5 => {
|
||||
let {
|
||||
select,
|
||||
resolveSelect,
|
||||
dispatch
|
||||
}) => {
|
||||
} = _ref5;
|
||||
const entities = await dispatch(getKindEntities(kind));
|
||||
const entity = Object(external_lodash_["find"])(entities, {
|
||||
kind,
|
||||
|
@ -1649,6 +1678,7 @@ const saveEntityRecord = (kind, name, record, {
|
|||
dispatch.__unstableReleaseStoreLock(lock);
|
||||
}
|
||||
};
|
||||
};
|
||||
/**
|
||||
* Runs multiple core-data actions at the same time using one API request.
|
||||
*
|
||||
|
@ -1672,9 +1702,10 @@ const saveEntityRecord = (kind, name, record, {
|
|||
* values of each function given in `requests`.
|
||||
*/
|
||||
|
||||
const __experimentalBatch = requests => async ({
|
||||
const __experimentalBatch = requests => async _ref6 => {
|
||||
let {
|
||||
dispatch
|
||||
}) => {
|
||||
} = _ref6;
|
||||
const batch = createBatch();
|
||||
const api = {
|
||||
saveEntityRecord(kind, name, record, options) {
|
||||
|
@ -1709,10 +1740,12 @@ const __experimentalBatch = requests => async ({
|
|||
* @param {Object} options Saving options.
|
||||
*/
|
||||
|
||||
const saveEditedEntityRecord = (kind, name, recordId, options) => async ({
|
||||
const saveEditedEntityRecord = (kind, name, recordId, options) => async _ref7 => {
|
||||
let {
|
||||
select,
|
||||
dispatch
|
||||
}) => {
|
||||
} = _ref7;
|
||||
|
||||
if (!select.hasEditsForEntityRecord(kind, name, recordId)) {
|
||||
return;
|
||||
}
|
||||
|
@ -1745,10 +1778,12 @@ const saveEditedEntityRecord = (kind, name, recordId, options) => async ({
|
|||
* @param {Object} options Saving options.
|
||||
*/
|
||||
|
||||
const __experimentalSaveSpecifiedEntityEdits = (kind, name, recordId, itemsToSave, options) => async ({
|
||||
const __experimentalSaveSpecifiedEntityEdits = (kind, name, recordId, itemsToSave, options) => async _ref8 => {
|
||||
let {
|
||||
select,
|
||||
dispatch
|
||||
}) => {
|
||||
} = _ref8;
|
||||
|
||||
if (!select.hasEditsForEntityRecord(kind, name, recordId)) {
|
||||
return;
|
||||
}
|
||||
|
@ -2098,7 +2133,9 @@ async function loadTaxonomyEntities() {
|
|||
*/
|
||||
|
||||
|
||||
const getMethodName = (kind, name, prefix = 'get', usePlural = false) => {
|
||||
const getMethodName = function (kind, name) {
|
||||
let prefix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'get';
|
||||
let usePlural = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
||||
const entity = Object(external_lodash_["find"])(defaultEntities, {
|
||||
kind,
|
||||
name
|
||||
|
@ -2116,10 +2153,11 @@ const getMethodName = (kind, name, prefix = 'get', usePlural = false) => {
|
|||
* @return {Array} Entities
|
||||
*/
|
||||
|
||||
const getKindEntities = kind => async ({
|
||||
const getKindEntities = kind => async _ref => {
|
||||
let {
|
||||
select,
|
||||
dispatch
|
||||
}) => {
|
||||
} = _ref;
|
||||
let entities = select.getEntitiesByKind(kind);
|
||||
|
||||
if (entities && entities.length !== 0) {
|
||||
|
@ -2378,7 +2416,10 @@ function getMergedItemIds(itemIds, nextItemIds, page, perPage) {
|
|||
* @return {Object} Next state.
|
||||
*/
|
||||
|
||||
function reducer_items(state = {}, action) {
|
||||
function reducer_items() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'RECEIVE_ITEMS':
|
||||
{
|
||||
|
@ -2416,7 +2457,10 @@ function reducer_items(state = {}, action) {
|
|||
* @return {Object<string,boolean>} Next state.
|
||||
*/
|
||||
|
||||
function itemIsComplete(state = {}, action) {
|
||||
function itemIsComplete() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'RECEIVE_ITEMS':
|
||||
{
|
||||
|
@ -2480,7 +2524,9 @@ replace_action(action => {
|
|||
return action;
|
||||
}), on_sub_key('context'), // Queries shape is shared, but keyed by query `stableKey` part. Original
|
||||
// reducer tracks only a single query object.
|
||||
on_sub_key('stableKey')])((state = null, action) => {
|
||||
on_sub_key('stableKey')])(function () {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
const {
|
||||
type,
|
||||
page,
|
||||
|
@ -2503,7 +2549,10 @@ on_sub_key('stableKey')])((state = null, action) => {
|
|||
* @return {Object} Next state.
|
||||
*/
|
||||
|
||||
const reducer_queries = (state = {}, action) => {
|
||||
const reducer_queries = function () {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'RECEIVE_ITEMS':
|
||||
return receiveQueries(state, action);
|
||||
|
@ -2562,7 +2611,10 @@ const reducer_queries = (state = {}, action) => {
|
|||
* @return {Object} Updated state.
|
||||
*/
|
||||
|
||||
function terms(state = {}, action) {
|
||||
function terms() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'RECEIVE_TERMS':
|
||||
return { ...state,
|
||||
|
@ -2581,10 +2633,13 @@ function terms(state = {}, action) {
|
|||
* @return {Object} Updated state.
|
||||
*/
|
||||
|
||||
function reducer_users(state = {
|
||||
function reducer_users() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
||||
byId: {},
|
||||
queries: {}
|
||||
}, action) {
|
||||
};
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'RECEIVE_USER_QUERY':
|
||||
return {
|
||||
|
@ -2608,7 +2663,10 @@ function reducer_users(state = {
|
|||
* @return {Object} Updated state.
|
||||
*/
|
||||
|
||||
function reducer_currentUser(state = {}, action) {
|
||||
function reducer_currentUser() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'RECEIVE_CURRENT_USER':
|
||||
return action.currentUser;
|
||||
|
@ -2625,7 +2683,10 @@ function reducer_currentUser(state = {}, action) {
|
|||
* @return {Object} Updated state.
|
||||
*/
|
||||
|
||||
function reducer_taxonomies(state = [], action) {
|
||||
function reducer_taxonomies() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'RECEIVE_TAXONOMIES':
|
||||
return action.taxonomies;
|
||||
|
@ -2642,7 +2703,10 @@ function reducer_taxonomies(state = [], action) {
|
|||
* @return {string} Updated state.
|
||||
*/
|
||||
|
||||
function reducer_currentTheme(state = undefined, action) {
|
||||
function reducer_currentTheme() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'RECEIVE_CURRENT_THEME':
|
||||
return action.currentTheme.stylesheet;
|
||||
|
@ -2659,7 +2723,10 @@ function reducer_currentTheme(state = undefined, action) {
|
|||
* @return {string} Updated state.
|
||||
*/
|
||||
|
||||
function currentGlobalStylesId(state = undefined, action) {
|
||||
function currentGlobalStylesId() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'RECEIVE_CURRENT_GLOBAL_STYLES_ID':
|
||||
return action.id;
|
||||
|
@ -2676,7 +2743,10 @@ function currentGlobalStylesId(state = undefined, action) {
|
|||
* @return {string} Updated state.
|
||||
*/
|
||||
|
||||
function themeBaseGlobalStyles(state = {}, action) {
|
||||
function themeBaseGlobalStyles() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'RECEIVE_THEME_GLOBAL_STYLES':
|
||||
return { ...state,
|
||||
|
@ -2708,9 +2778,12 @@ function reducer_entity(entityConfig) {
|
|||
};
|
||||
})])(Object(external_wp_data_["combineReducers"])({
|
||||
queriedData: reducer,
|
||||
edits: (state = {}, action) => {
|
||||
edits: function () {
|
||||
var _action$query$context, _action$query;
|
||||
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'RECEIVE_ITEMS':
|
||||
const context = (_action$query$context = action === null || action === void 0 ? void 0 : (_action$query = action.query) === null || _action$query === void 0 ? void 0 : _action$query.context) !== null && _action$query$context !== void 0 ? _action$query$context : 'default';
|
||||
|
@ -2772,7 +2845,10 @@ function reducer_entity(entityConfig) {
|
|||
|
||||
return state;
|
||||
},
|
||||
saving: (state = {}, action) => {
|
||||
saving: function () {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'SAVE_ENTITY_RECORD_START':
|
||||
case 'SAVE_ENTITY_RECORD_FINISH':
|
||||
|
@ -2787,7 +2863,10 @@ function reducer_entity(entityConfig) {
|
|||
|
||||
return state;
|
||||
},
|
||||
deleting: (state = {}, action) => {
|
||||
deleting: function () {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'DELETE_ENTITY_RECORD_START':
|
||||
case 'DELETE_ENTITY_RECORD_FINISH':
|
||||
|
@ -2813,7 +2892,10 @@ function reducer_entity(entityConfig) {
|
|||
*/
|
||||
|
||||
|
||||
function entitiesConfig(state = defaultEntities, action) {
|
||||
function entitiesConfig() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultEntities;
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'ADD_ENTITIES':
|
||||
return [...state, ...action.entities];
|
||||
|
@ -2830,14 +2912,17 @@ function entitiesConfig(state = defaultEntities, action) {
|
|||
* @return {Object} Updated state.
|
||||
*/
|
||||
|
||||
const reducer_entities = (state = {}, action) => {
|
||||
const reducer_entities = function () {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
const newConfig = entitiesConfig(state.config, action); // Generates a dynamic reducer for the entities
|
||||
|
||||
let entitiesDataReducer = state.reducer;
|
||||
|
||||
if (!entitiesDataReducer || newConfig !== state.config) {
|
||||
const entitiesByKind = Object(external_lodash_["groupBy"])(newConfig, 'kind');
|
||||
entitiesDataReducer = Object(external_wp_data_["combineReducers"])(Object.entries(entitiesByKind).reduce((memo, [kind, subEntities]) => {
|
||||
entitiesDataReducer = Object(external_wp_data_["combineReducers"])(Object.entries(entitiesByKind).reduce((memo, _ref) => {
|
||||
let [kind, subEntities] = _ref;
|
||||
const kindReducer = Object(external_wp_data_["combineReducers"])(subEntities.reduce((kindMemo, entityConfig) => ({ ...kindMemo,
|
||||
[entityConfig.name]: reducer_entity(entityConfig)
|
||||
}), {}));
|
||||
|
@ -2870,7 +2955,10 @@ const reducer_entities = (state = {}, action) => {
|
|||
const UNDO_INITIAL_STATE = [];
|
||||
UNDO_INITIAL_STATE.offset = 0;
|
||||
let lastEditAction;
|
||||
function reducer_undo(state = UNDO_INITIAL_STATE, action) {
|
||||
function reducer_undo() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : UNDO_INITIAL_STATE;
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'EDIT_ENTITY_RECORD':
|
||||
case 'CREATE_UNDO_LEVEL':
|
||||
|
@ -2975,7 +3063,10 @@ function reducer_undo(state = UNDO_INITIAL_STATE, action) {
|
|||
* @return {Object} Updated state.
|
||||
*/
|
||||
|
||||
function embedPreviews(state = {}, action) {
|
||||
function embedPreviews() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'RECEIVE_EMBED_PREVIEW':
|
||||
const {
|
||||
|
@ -2999,7 +3090,10 @@ function embedPreviews(state = {}, action) {
|
|||
* @return {Object} Updated state.
|
||||
*/
|
||||
|
||||
function userPermissions(state = {}, action) {
|
||||
function userPermissions() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'RECEIVE_USER_PERMISSION':
|
||||
return { ...state,
|
||||
|
@ -3018,7 +3112,10 @@ function userPermissions(state = {}, action) {
|
|||
* @return {Object} Updated state.
|
||||
*/
|
||||
|
||||
function reducer_autosaves(state = {}, action) {
|
||||
function reducer_autosaves() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'RECEIVE_AUTOSAVES':
|
||||
const {
|
||||
|
@ -3166,7 +3263,8 @@ function getQueriedItemsUncached(state, query) {
|
|||
*/
|
||||
|
||||
|
||||
const getQueriedItems = Object(rememo["a" /* default */])((state, query = {}) => {
|
||||
const getQueriedItems = Object(rememo["a" /* default */])(function (state) {
|
||||
let query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
let queriedItemsCache = queriedItemsCacheByState.get(state);
|
||||
|
||||
if (queriedItemsCache) {
|
||||
|
@ -4002,11 +4100,18 @@ function __experimentalGetCurrentThemeBaseGlobalStyles(state) {
|
|||
*
|
||||
* @return {Function} Enhanced resolver.
|
||||
*/
|
||||
const forwardResolver = resolverName => (...args) => async ({
|
||||
const forwardResolver = resolverName => function () {
|
||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
return async _ref => {
|
||||
let {
|
||||
resolveSelect
|
||||
}) => {
|
||||
} = _ref;
|
||||
await resolveSelect[resolverName](...args);
|
||||
};
|
||||
};
|
||||
|
||||
/* harmony default export */ var forward_resolver = (forwardResolver);
|
||||
|
||||
|
@ -4035,9 +4140,10 @@ const forwardResolver = resolverName => (...args) => async ({
|
|||
* include with request.
|
||||
*/
|
||||
|
||||
const resolvers_getAuthors = query => async ({
|
||||
const resolvers_getAuthors = query => async _ref => {
|
||||
let {
|
||||
dispatch
|
||||
}) => {
|
||||
} = _ref;
|
||||
const path = Object(external_wp_url_["addQueryArgs"])('/wp/v2/users/?who=authors&per_page=100', query);
|
||||
const users = await external_wp_apiFetch_default()({
|
||||
path
|
||||
|
@ -4048,9 +4154,10 @@ const resolvers_getAuthors = query => async ({
|
|||
* Requests the current user from the REST API.
|
||||
*/
|
||||
|
||||
const resolvers_getCurrentUser = () => async ({
|
||||
const resolvers_getCurrentUser = () => async _ref2 => {
|
||||
let {
|
||||
dispatch
|
||||
}) => {
|
||||
} = _ref2;
|
||||
const currentUser = await external_wp_apiFetch_default()({
|
||||
path: '/wp/v2/users/me'
|
||||
});
|
||||
|
@ -4066,10 +4173,14 @@ const resolvers_getCurrentUser = () => async ({
|
|||
* include with request.
|
||||
*/
|
||||
|
||||
const resolvers_getEntityRecord = (kind, name, key = '', query) => async ({
|
||||
const resolvers_getEntityRecord = function (kind, name) {
|
||||
let key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
||||
let query = arguments.length > 3 ? arguments[3] : undefined;
|
||||
return async _ref3 => {
|
||||
let {
|
||||
select,
|
||||
dispatch
|
||||
}) => {
|
||||
} = _ref3;
|
||||
const entities = await dispatch(getKindEntities(kind));
|
||||
const entity = Object(external_lodash_["find"])(entities, {
|
||||
kind,
|
||||
|
@ -4129,6 +4240,7 @@ const resolvers_getEntityRecord = (kind, name, key = '', query) => async ({
|
|||
dispatch.__unstableReleaseStoreLock(lock);
|
||||
}
|
||||
};
|
||||
};
|
||||
/**
|
||||
* Requests an entity's record from the REST API.
|
||||
*/
|
||||
|
@ -4147,9 +4259,12 @@ const resolvers_getEditedEntityRecord = forward_resolver('getEntityRecord');
|
|||
* @param {Object?} query Query Object.
|
||||
*/
|
||||
|
||||
const resolvers_getEntityRecords = (kind, name, query = {}) => async ({
|
||||
const resolvers_getEntityRecords = function (kind, name) {
|
||||
let query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
||||
return async _ref4 => {
|
||||
let {
|
||||
dispatch
|
||||
}) => {
|
||||
} = _ref4;
|
||||
const entities = await dispatch(getKindEntities(kind));
|
||||
const entity = Object(external_lodash_["find"])(entities, {
|
||||
kind,
|
||||
|
@ -4222,6 +4337,7 @@ const resolvers_getEntityRecords = (kind, name, query = {}) => async ({
|
|||
dispatch.__unstableReleaseStoreLock(lock);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
resolvers_getEntityRecords.shouldInvalidate = (action, kind, name) => {
|
||||
return (action.type === 'RECEIVE_ITEMS' || action.type === 'REMOVE_ITEMS') && action.invalidateCache && kind === action.kind && name === action.name;
|
||||
|
@ -4231,10 +4347,11 @@ resolvers_getEntityRecords.shouldInvalidate = (action, kind, name) => {
|
|||
*/
|
||||
|
||||
|
||||
const resolvers_getCurrentTheme = () => async ({
|
||||
const resolvers_getCurrentTheme = () => async _ref5 => {
|
||||
let {
|
||||
dispatch,
|
||||
resolveSelect
|
||||
}) => {
|
||||
} = _ref5;
|
||||
const activeThemes = await resolveSelect.getEntityRecords('root', 'theme', {
|
||||
status: 'active'
|
||||
});
|
||||
|
@ -4251,9 +4368,11 @@ const resolvers_getThemeSupports = forward_resolver('getCurrentTheme');
|
|||
* @param {string} url URL to get the preview for.
|
||||
*/
|
||||
|
||||
const resolvers_getEmbedPreview = url => async ({
|
||||
const resolvers_getEmbedPreview = url => async _ref6 => {
|
||||
let {
|
||||
dispatch
|
||||
}) => {
|
||||
} = _ref6;
|
||||
|
||||
try {
|
||||
const embedProxyResponse = await external_wp_apiFetch_default()({
|
||||
path: Object(external_wp_url_["addQueryArgs"])('/oembed/1.0/proxy', {
|
||||
|
@ -4276,9 +4395,10 @@ const resolvers_getEmbedPreview = url => async ({
|
|||
* @param {?string} id ID of the rest resource to check.
|
||||
*/
|
||||
|
||||
const resolvers_canUser = (action, resource, id) => async ({
|
||||
const resolvers_canUser = (action, resource, id) => async _ref7 => {
|
||||
let {
|
||||
dispatch
|
||||
}) => {
|
||||
} = _ref7;
|
||||
const methods = {
|
||||
create: 'POST',
|
||||
read: 'GET',
|
||||
|
@ -4335,9 +4455,10 @@ const resolvers_canUser = (action, resource, id) => async ({
|
|||
* @param {string} recordId Record's id.
|
||||
*/
|
||||
|
||||
const resolvers_canUserEditEntityRecord = (kind, name, recordId) => async ({
|
||||
const resolvers_canUserEditEntityRecord = (kind, name, recordId) => async _ref8 => {
|
||||
let {
|
||||
dispatch
|
||||
}) => {
|
||||
} = _ref8;
|
||||
const entities = await dispatch(getKindEntities(kind));
|
||||
const entity = Object(external_lodash_["find"])(entities, {
|
||||
kind,
|
||||
|
@ -4358,10 +4479,11 @@ const resolvers_canUserEditEntityRecord = (kind, name, recordId) => async ({
|
|||
* @param {number} postId The id of the parent post.
|
||||
*/
|
||||
|
||||
const resolvers_getAutosaves = (postType, postId) => async ({
|
||||
const resolvers_getAutosaves = (postType, postId) => async _ref9 => {
|
||||
let {
|
||||
dispatch,
|
||||
resolveSelect
|
||||
}) => {
|
||||
} = _ref9;
|
||||
const {
|
||||
rest_base: restBase
|
||||
} = await resolveSelect.getPostType(postType);
|
||||
|
@ -4383,9 +4505,10 @@ const resolvers_getAutosaves = (postType, postId) => async ({
|
|||
* @param {number} postId The id of the parent post.
|
||||
*/
|
||||
|
||||
const resolvers_getAutosave = (postType, postId) => async ({
|
||||
const resolvers_getAutosave = (postType, postId) => async _ref10 => {
|
||||
let {
|
||||
resolveSelect
|
||||
}) => {
|
||||
} = _ref10;
|
||||
await resolveSelect.getAutosaves(postType, postId);
|
||||
};
|
||||
/**
|
||||
|
@ -4394,10 +4517,11 @@ const resolvers_getAutosave = (postType, postId) => async ({
|
|||
* @param {string} link Link.
|
||||
*/
|
||||
|
||||
const resolvers_experimentalGetTemplateForLink = link => async ({
|
||||
const resolvers_experimentalGetTemplateForLink = link => async _ref11 => {
|
||||
let {
|
||||
dispatch,
|
||||
resolveSelect
|
||||
}) => {
|
||||
} = _ref11;
|
||||
// Ideally this should be using an apiFetch call
|
||||
// We could potentially do so by adding a "filter" to the `wp_template` end point.
|
||||
// Also it seems the returned object is not a regular REST API post type.
|
||||
|
@ -4406,9 +4530,12 @@ const resolvers_experimentalGetTemplateForLink = link => async ({
|
|||
try {
|
||||
template = await window.fetch(Object(external_wp_url_["addQueryArgs"])(link, {
|
||||
'_wp-find-template': true
|
||||
})).then(res => res.json()).then(({
|
||||
})).then(res => res.json()).then(_ref12 => {
|
||||
let {
|
||||
data
|
||||
}) => data);
|
||||
} = _ref12;
|
||||
return data;
|
||||
});
|
||||
} catch (e) {// For non-FSE themes, it is possible that this request returns an error.
|
||||
}
|
||||
|
||||
|
@ -4429,10 +4556,11 @@ resolvers_experimentalGetTemplateForLink.shouldInvalidate = action => {
|
|||
return (action.type === 'RECEIVE_ITEMS' || action.type === 'REMOVE_ITEMS') && action.invalidateCache && action.kind === 'postType' && action.name === 'wp_template';
|
||||
};
|
||||
|
||||
const resolvers_experimentalGetCurrentGlobalStylesId = () => async ({
|
||||
const resolvers_experimentalGetCurrentGlobalStylesId = () => async _ref13 => {
|
||||
let {
|
||||
dispatch,
|
||||
resolveSelect
|
||||
}) => {
|
||||
} = _ref13;
|
||||
const activeThemes = await resolveSelect.getEntityRecords('root', 'theme', {
|
||||
status: 'active'
|
||||
});
|
||||
|
@ -4446,10 +4574,11 @@ const resolvers_experimentalGetCurrentGlobalStylesId = () => async ({
|
|||
dispatch.__experimentalReceiveCurrentGlobalStylesId(globalStylesObject.id);
|
||||
}
|
||||
};
|
||||
const resolvers_experimentalGetCurrentThemeBaseGlobalStyles = () => async ({
|
||||
const resolvers_experimentalGetCurrentThemeBaseGlobalStyles = () => async _ref14 => {
|
||||
let {
|
||||
resolveSelect,
|
||||
dispatch
|
||||
}) => {
|
||||
} = _ref14;
|
||||
const currentTheme = await resolveSelect.getCurrentTheme();
|
||||
const themeGlobalStyles = await external_wp_apiFetch_default()({
|
||||
path: `/wp/v2/global-styles/themes/${currentTheme.stylesheet}`
|
||||
|
@ -4515,9 +4644,11 @@ function* iterateDescendants(node) {
|
|||
stack.push(...Object.values(childNode.children));
|
||||
}
|
||||
}
|
||||
function hasConflictingLock({
|
||||
function hasConflictingLock(_ref, locks) {
|
||||
let {
|
||||
exclusive
|
||||
}, locks) {
|
||||
} = _ref;
|
||||
|
||||
if (exclusive && locks.length) {
|
||||
return true;
|
||||
}
|
||||
|
@ -4550,7 +4681,10 @@ const DEFAULT_STATE = {
|
|||
* @return {Object} Updated state.
|
||||
*/
|
||||
|
||||
function reducer_locks(state = DEFAULT_STATE, action) {
|
||||
function reducer_locks() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_STATE;
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'ENQUEUE_LOCK_REQUEST':
|
||||
{
|
||||
|
@ -4608,9 +4742,10 @@ function reducer_locks(state = DEFAULT_STATE, action) {
|
|||
function getPendingLockRequests(state) {
|
||||
return state.requests;
|
||||
}
|
||||
function isLockAvailable(state, store, path, {
|
||||
function isLockAvailable(state, store, path, _ref) {
|
||||
let {
|
||||
exclusive
|
||||
}) {
|
||||
} = _ref;
|
||||
const storePath = [store, ...path];
|
||||
const locks = state.tree; // Validate all parents and the node itself
|
||||
|
||||
|
@ -4717,9 +4852,10 @@ function createLocks() {
|
|||
function createLocksActions() {
|
||||
const locks = createLocks();
|
||||
|
||||
function __unstableAcquireStoreLock(store, path, {
|
||||
function __unstableAcquireStoreLock(store, path, _ref) {
|
||||
let {
|
||||
exclusive
|
||||
}) {
|
||||
} = _ref;
|
||||
return () => locks.acquire(store, path, exclusive);
|
||||
}
|
||||
|
||||
|
@ -4803,12 +4939,13 @@ const entity_provider_getEntity = (kind, type) => {
|
|||
*/
|
||||
|
||||
|
||||
function EntityProvider({
|
||||
function EntityProvider(_ref) {
|
||||
let {
|
||||
kind,
|
||||
type,
|
||||
id,
|
||||
children
|
||||
}) {
|
||||
} = _ref;
|
||||
const Provider = entity_provider_getEntity(kind, type).context.Provider;
|
||||
return Object(external_wp_element_["createElement"])(Provider, {
|
||||
value: id
|
||||
|
@ -4891,9 +5028,10 @@ function useEntityProp(kind, type, prop, _id) {
|
|||
* @return {[WPBlock[], Function, Function]} The block array and setters.
|
||||
*/
|
||||
|
||||
function useEntityBlockEditor(kind, type, {
|
||||
function useEntityBlockEditor(kind, type) {
|
||||
let {
|
||||
id: _id
|
||||
} = {}) {
|
||||
} = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
||||
const providerId = useEntityId(kind, type);
|
||||
const id = _id !== null && _id !== void 0 ? _id : providerId;
|
||||
const {
|
||||
|
@ -4943,9 +5081,12 @@ function useEntityBlockEditor(kind, type, {
|
|||
// a new undo level.
|
||||
|
||||
|
||||
edits.content = ({
|
||||
edits.content = _ref2 => {
|
||||
let {
|
||||
blocks: blocksForSerialization = []
|
||||
}) => Object(external_wp_blocks_["__unstableSerializeAndClean"])(blocksForSerialization);
|
||||
} = _ref2;
|
||||
return Object(external_wp_blocks_["__unstableSerializeAndClean"])(blocksForSerialization);
|
||||
};
|
||||
|
||||
editEntityRecord(kind, type, id, edits);
|
||||
}, [kind, type, id, blocks]);
|
||||
|
@ -5035,7 +5176,9 @@ var external_wp_htmlEntities_ = __webpack_require__("rmEH");
|
|||
* @return {Promise< WPLinkSearchResult[] >} List of search suggestions
|
||||
*/
|
||||
|
||||
const fetchLinkSuggestions = async (search, searchOptions = {}, settings = {}) => {
|
||||
const fetchLinkSuggestions = async function (search) {
|
||||
let searchOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
let settings = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
||||
const {
|
||||
isInitialSuggestions = false,
|
||||
type = undefined,
|
||||
|
@ -5181,7 +5324,8 @@ const CACHE = new Map();
|
|||
* @return {Promise< WPRemoteUrlData[] >} Remote URL data.
|
||||
*/
|
||||
|
||||
const fetchUrlData = async (url, options = {}) => {
|
||||
const fetchUrlData = async function (url) {
|
||||
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
const endpoint = '/wp-block-editor/v1/url-details';
|
||||
const args = {
|
||||
url: Object(external_wp_url_["prependHTTP"])(url)
|
||||
|
@ -5246,7 +5390,13 @@ const entitySelectors = defaultEntities.reduce((result, entity) => {
|
|||
|
||||
result[getMethodName(kind, name)] = (state, key, query) => selectors_getEntityRecord(state, kind, name, key, query);
|
||||
|
||||
result[getMethodName(kind, name, 'get', true)] = (state, ...args) => getEntityRecords(state, kind, name, ...args);
|
||||
result[getMethodName(kind, name, 'get', true)] = function (state) {
|
||||
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
||||
args[_key - 1] = arguments[_key];
|
||||
}
|
||||
|
||||
return getEntityRecords(state, kind, name, ...args);
|
||||
};
|
||||
|
||||
return result;
|
||||
}, {});
|
||||
|
@ -5260,9 +5410,21 @@ const entityResolvers = defaultEntities.reduce((result, entity) => {
|
|||
|
||||
const pluralMethodName = getMethodName(kind, name, 'get', true);
|
||||
|
||||
result[pluralMethodName] = (...args) => resolvers_getEntityRecords(kind, name, ...args);
|
||||
result[pluralMethodName] = function () {
|
||||
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
||||
args[_key2] = arguments[_key2];
|
||||
}
|
||||
|
||||
result[pluralMethodName].shouldInvalidate = (action, ...args) => resolvers_getEntityRecords.shouldInvalidate(action, kind, name, ...args);
|
||||
return resolvers_getEntityRecords(kind, name, ...args);
|
||||
};
|
||||
|
||||
result[pluralMethodName].shouldInvalidate = function (action) {
|
||||
for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
|
||||
args[_key3 - 1] = arguments[_key3];
|
||||
}
|
||||
|
||||
return resolvers_getEntityRecords.shouldInvalidate(action, kind, name, ...args);
|
||||
};
|
||||
|
||||
return result;
|
||||
}, {});
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -174,10 +174,11 @@ var external_wp_compose_ = __webpack_require__("K9lf");
|
|||
|
||||
|
||||
|
||||
function CopyButton({
|
||||
function CopyButton(_ref) {
|
||||
let {
|
||||
text,
|
||||
children
|
||||
}) {
|
||||
} = _ref;
|
||||
const ref = Object(external_wp_compose_["useCopyToClipboard"])(text);
|
||||
return Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
|
||||
variant: "secondary",
|
||||
|
@ -244,11 +245,12 @@ var esm_extends = __webpack_require__("wx14");
|
|||
|
||||
|
||||
|
||||
function BlockInspectorButton({
|
||||
function BlockInspectorButton(_ref) {
|
||||
let {
|
||||
inspector,
|
||||
closeMenu,
|
||||
...props
|
||||
}) {
|
||||
} = _ref;
|
||||
const selectedBlockClientId = Object(external_wp_data_["useSelect"])(select => select(external_wp_blockEditor_["store"]).getSelectedBlockClientId(), []);
|
||||
const selectedBlock = Object(external_wp_element_["useMemo"])(() => document.getElementById(`block-${selectedBlockClientId}`), [selectedBlockClientId]);
|
||||
return Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], Object(esm_extends["a" /* default */])({
|
||||
|
@ -296,7 +298,10 @@ var close_small = __webpack_require__("bWcr");
|
|||
* @param {Object} action
|
||||
*/
|
||||
|
||||
function blockInserterPanel(state = false, action) {
|
||||
function blockInserterPanel() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'SET_IS_INSERTER_OPENED':
|
||||
return action.value;
|
||||
|
@ -422,9 +427,10 @@ Object(external_wp_data_["registerStore"])(STORE_NAME, storeConfig);
|
|||
|
||||
|
||||
|
||||
function Inserter({
|
||||
function Inserter(_ref) {
|
||||
let {
|
||||
setIsOpened
|
||||
}) {
|
||||
} = _ref;
|
||||
const inserterTitleId = Object(external_wp_compose_["useInstanceId"])(Inserter, 'customize-widget-layout__inserter-panel-title');
|
||||
const insertionPoint = Object(external_wp_data_["useSelect"])(select => select(store).__experimentalGetInsertionPoint(), []);
|
||||
return Object(external_wp_element_["createElement"])("div", {
|
||||
|
@ -506,10 +512,11 @@ const textFormattingShortcuts = [{
|
|||
|
||||
|
||||
|
||||
function KeyCombination({
|
||||
function KeyCombination(_ref) {
|
||||
let {
|
||||
keyCombination,
|
||||
forceAriaLabel
|
||||
}) {
|
||||
} = _ref;
|
||||
const shortcut = keyCombination.modifier ? external_wp_keycodes_["displayShortcutList"][keyCombination.modifier](keyCombination.character) : keyCombination.character;
|
||||
const ariaLabel = keyCombination.modifier ? external_wp_keycodes_["shortcutAriaLabel"][keyCombination.modifier](keyCombination.character) : keyCombination.character;
|
||||
return Object(external_wp_element_["createElement"])("kbd", {
|
||||
|
@ -529,12 +536,13 @@ function KeyCombination({
|
|||
}));
|
||||
}
|
||||
|
||||
function Shortcut({
|
||||
function Shortcut(_ref2) {
|
||||
let {
|
||||
description,
|
||||
keyCombination,
|
||||
aliases = [],
|
||||
ariaLabel
|
||||
}) {
|
||||
} = _ref2;
|
||||
return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("div", {
|
||||
className: "customize-widgets-keyboard-shortcut-help-modal__shortcut-description"
|
||||
}, description), Object(external_wp_element_["createElement"])("div", {
|
||||
|
@ -565,9 +573,10 @@ function Shortcut({
|
|||
|
||||
|
||||
|
||||
function DynamicShortcut({
|
||||
function DynamicShortcut(_ref) {
|
||||
let {
|
||||
name
|
||||
}) {
|
||||
} = _ref;
|
||||
const {
|
||||
keyCombination,
|
||||
description,
|
||||
|
@ -622,9 +631,11 @@ function DynamicShortcut({
|
|||
|
||||
|
||||
|
||||
const ShortcutList = ({
|
||||
const ShortcutList = _ref => {
|
||||
let {
|
||||
shortcuts
|
||||
}) =>
|
||||
} = _ref;
|
||||
return (
|
||||
/*
|
||||
* Disable reason: The `list` ARIA role is redundant but
|
||||
* Safari+VoiceOver won't announce the list otherwise.
|
||||
|
@ -641,25 +652,31 @@ Object(external_wp_element_["createElement"])("ul", {
|
|||
name: shortcut
|
||||
}) : Object(external_wp_element_["createElement"])(keyboard_shortcut_help_modal_shortcut, shortcut))))
|
||||
/* eslint-enable jsx-a11y/no-redundant-roles */
|
||||
;
|
||||
|
||||
const ShortcutSection = ({
|
||||
);
|
||||
};
|
||||
|
||||
const ShortcutSection = _ref2 => {
|
||||
let {
|
||||
title,
|
||||
shortcuts,
|
||||
className
|
||||
}) => Object(external_wp_element_["createElement"])("section", {
|
||||
} = _ref2;
|
||||
return Object(external_wp_element_["createElement"])("section", {
|
||||
className: classnames_default()('customize-widgets-keyboard-shortcut-help-modal__section', className)
|
||||
}, !!title && Object(external_wp_element_["createElement"])("h2", {
|
||||
className: "customize-widgets-keyboard-shortcut-help-modal__section-title"
|
||||
}, title), Object(external_wp_element_["createElement"])(ShortcutList, {
|
||||
shortcuts: shortcuts
|
||||
}));
|
||||
};
|
||||
|
||||
const ShortcutCategorySection = ({
|
||||
const ShortcutCategorySection = _ref3 => {
|
||||
let {
|
||||
title,
|
||||
categoryName,
|
||||
additionalShortcuts = []
|
||||
}) => {
|
||||
} = _ref3;
|
||||
const categoryShortcuts = Object(external_wp_data_["useSelect"])(select => {
|
||||
return select(external_wp_keyboardShortcuts_["store"]).getCategoryShortcuts(categoryName);
|
||||
}, [categoryName]);
|
||||
|
@ -669,10 +686,11 @@ const ShortcutCategorySection = ({
|
|||
});
|
||||
};
|
||||
|
||||
function KeyboardShortcutHelpModal({
|
||||
function KeyboardShortcutHelpModal(_ref4) {
|
||||
let {
|
||||
isModalActive,
|
||||
toggleModal
|
||||
}) {
|
||||
} = _ref4;
|
||||
const {
|
||||
registerShortcut
|
||||
} = Object(external_wp_data_["useDispatch"])(external_wp_keyboardShortcuts_["store"]);
|
||||
|
@ -823,13 +841,14 @@ function MoreMenu() {
|
|||
|
||||
|
||||
|
||||
function Header({
|
||||
function Header(_ref) {
|
||||
let {
|
||||
sidebar,
|
||||
inserter,
|
||||
isInserterOpened,
|
||||
setIsInserterOpened,
|
||||
isFixedToolbarActive
|
||||
}) {
|
||||
} = _ref;
|
||||
const [[hasUndo, hasRedo], setUndoRedo] = Object(external_wp_element_["useState"])([sidebar.hasUndo(), sidebar.hasRedo()]);
|
||||
Object(external_wp_element_["useEffect"])(() => {
|
||||
return sidebar.subscribeHistory(() => {
|
||||
|
@ -960,7 +979,8 @@ function settingIdToWidgetId(settingId) {
|
|||
* @return {Object} The transformed widget.
|
||||
*/
|
||||
|
||||
function blockToWidget(block, existingWidget = null) {
|
||||
function blockToWidget(block) {
|
||||
let existingWidget = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
||||
let widget;
|
||||
const isValidLegacyWidgetBlock = block.name === 'core/legacy-widget' && (block.attributes.id || block.attributes.instance);
|
||||
|
||||
|
@ -1018,12 +1038,13 @@ function blockToWidget(block, existingWidget = null) {
|
|||
* @return {WPBlock} The transformed block.
|
||||
*/
|
||||
|
||||
function widgetToBlock({
|
||||
function widgetToBlock(_ref) {
|
||||
let {
|
||||
id,
|
||||
idBase,
|
||||
number,
|
||||
instance
|
||||
}) {
|
||||
} = _ref;
|
||||
let block;
|
||||
const {
|
||||
encoded_serialized_instance: encoded,
|
||||
|
@ -1167,11 +1188,12 @@ function useSidebarBlockEditor(sidebar) {
|
|||
|
||||
|
||||
const FocusControlContext = Object(external_wp_element_["createContext"])();
|
||||
function FocusControl({
|
||||
function FocusControl(_ref) {
|
||||
let {
|
||||
api,
|
||||
sidebarControls,
|
||||
children
|
||||
}) {
|
||||
} = _ref;
|
||||
const [focusedWidgetIdRef, setFocusedWidgetIdRef] = Object(external_wp_element_["useState"])({
|
||||
current: null
|
||||
});
|
||||
|
@ -1270,11 +1292,12 @@ function useBlocksFocusControl(blocks) {
|
|||
|
||||
|
||||
|
||||
function SidebarEditorProvider({
|
||||
function SidebarEditorProvider(_ref) {
|
||||
let {
|
||||
sidebar,
|
||||
settings,
|
||||
children
|
||||
}) {
|
||||
} = _ref;
|
||||
const [blocks, onInput, onChange] = useSidebarBlockEditor(sidebar);
|
||||
useBlocksFocusControl(blocks);
|
||||
return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockEditorProvider"], {
|
||||
|
@ -1296,9 +1319,10 @@ function SidebarEditorProvider({
|
|||
|
||||
|
||||
|
||||
function WelcomeGuide({
|
||||
function WelcomeGuide(_ref) {
|
||||
let {
|
||||
sidebar
|
||||
}) {
|
||||
} = _ref;
|
||||
const {
|
||||
toggleFeature
|
||||
} = Object(external_wp_data_["useDispatch"])(build_module["i" /* store */]);
|
||||
|
@ -1346,11 +1370,12 @@ function WelcomeGuide({
|
|||
|
||||
|
||||
|
||||
function KeyboardShortcuts({
|
||||
function KeyboardShortcuts(_ref) {
|
||||
let {
|
||||
undo,
|
||||
redo,
|
||||
save
|
||||
}) {
|
||||
} = _ref;
|
||||
Object(external_wp_keyboardShortcuts_["useShortcut"])('core/customize-widgets/undo', event => {
|
||||
undo();
|
||||
event.preventDefault();
|
||||
|
@ -1470,12 +1495,13 @@ function BlockAppender(props) {
|
|||
|
||||
|
||||
|
||||
function SidebarBlockEditor({
|
||||
function SidebarBlockEditor(_ref) {
|
||||
let {
|
||||
blockEditorSettings,
|
||||
sidebar,
|
||||
inserter,
|
||||
inspector
|
||||
}) {
|
||||
} = _ref;
|
||||
const [isInserterOpened, setIsInserterOpened] = useInserter(inserter);
|
||||
const {
|
||||
hasUploadPermissions,
|
||||
|
@ -1497,15 +1523,19 @@ function SidebarBlockEditor({
|
|||
let mediaUploadBlockEditor;
|
||||
|
||||
if (hasUploadPermissions) {
|
||||
mediaUploadBlockEditor = ({
|
||||
mediaUploadBlockEditor = _ref2 => {
|
||||
let {
|
||||
onError,
|
||||
...argumentsObject
|
||||
}) => {
|
||||
} = _ref2;
|
||||
Object(external_wp_mediaUtils_["uploadMedia"])({
|
||||
wpAllowedMimeTypes: blockEditorSettings.allowedMimeTypes,
|
||||
onError: ({
|
||||
onError: _ref3 => {
|
||||
let {
|
||||
message
|
||||
}) => onError(message),
|
||||
} = _ref3;
|
||||
return onError(message);
|
||||
},
|
||||
...argumentsObject
|
||||
});
|
||||
};
|
||||
|
@ -1549,12 +1579,15 @@ function SidebarBlockEditor({
|
|||
// from submitting form when type="button" is not specified.
|
||||
Object(external_wp_element_["createElement"])("form", {
|
||||
onSubmit: event => event.preventDefault()
|
||||
}, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockInspector"], null)), inspector.contentContainer[0])), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__unstableBlockSettingsMenuFirstItem"], null, ({
|
||||
}, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockInspector"], null)), inspector.contentContainer[0])), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__unstableBlockSettingsMenuFirstItem"], null, _ref4 => {
|
||||
let {
|
||||
onClose
|
||||
}) => Object(external_wp_element_["createElement"])(block_inspector_button, {
|
||||
} = _ref4;
|
||||
return Object(external_wp_element_["createElement"])(block_inspector_button, {
|
||||
inspector: inspector,
|
||||
closeMenu: onClose
|
||||
})));
|
||||
});
|
||||
}));
|
||||
}
|
||||
|
||||
// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/components/sidebar-controls/index.js
|
||||
|
@ -1565,11 +1598,12 @@ function SidebarBlockEditor({
|
|||
*/
|
||||
|
||||
const SidebarControlsContext = Object(external_wp_element_["createContext"])();
|
||||
function SidebarControls({
|
||||
function SidebarControls(_ref) {
|
||||
let {
|
||||
sidebarControls,
|
||||
activeSidebarControl,
|
||||
children
|
||||
}) {
|
||||
} = _ref;
|
||||
const context = Object(external_wp_element_["useMemo"])(() => ({
|
||||
sidebarControls,
|
||||
activeSidebarControl
|
||||
|
@ -1678,11 +1712,12 @@ function useClearSelectedBlock(sidebarControl, popoverRef) {
|
|||
|
||||
|
||||
|
||||
function CustomizeWidgets({
|
||||
function CustomizeWidgets(_ref) {
|
||||
let {
|
||||
api,
|
||||
sidebarControls,
|
||||
blockEditorSettings
|
||||
}) {
|
||||
} = _ref;
|
||||
const [activeSidebarControl, setActiveSidebarControl] = Object(external_wp_element_["useState"])(null);
|
||||
const parentContainer = document.getElementById('customize-theme-controls');
|
||||
const popoverRef = Object(external_wp_element_["useRef"])();
|
||||
|
@ -1773,9 +1808,10 @@ function getInspectorSection() {
|
|||
}
|
||||
}
|
||||
|
||||
open({
|
||||
open() {
|
||||
let {
|
||||
returnFocusWhenClose
|
||||
} = {}) {
|
||||
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
this.isOpen = true;
|
||||
this.returnFocusWhenClose = returnFocusWhenClose;
|
||||
this.expand({
|
||||
|
@ -1952,7 +1988,11 @@ function debounce(leading, callback, timeout) {
|
|||
let isLeading = false;
|
||||
let timerID;
|
||||
|
||||
function debounced(...args) {
|
||||
function debounced() {
|
||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
const result = (isLeading ? callback : leading).apply(this, args);
|
||||
isLeading = true;
|
||||
clearTimeout(timerID);
|
||||
|
@ -2000,9 +2040,9 @@ class sidebar_adapter_SidebarAdapter {
|
|||
return this.history[this.historyIndex];
|
||||
}
|
||||
|
||||
_emit(...args) {
|
||||
_emit() {
|
||||
for (const callback of this.subscribers) {
|
||||
callback(...args);
|
||||
callback(...arguments);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2268,8 +2308,8 @@ function getInserterOuterSection() {
|
|||
|
||||
customize.sectionConstructor.outer = customize.OuterSection;
|
||||
return class InserterOuterSection extends customize.OuterSection {
|
||||
constructor(...args) {
|
||||
super(...args); // This is necessary since we're creating a new class which is not identical to the original OuterSection.
|
||||
constructor() {
|
||||
super(...arguments); // This is necessary since we're creating a new class which is not identical to the original OuterSection.
|
||||
// @See https://github.com/WordPress/wordpress-develop/blob/42b05c397c50d9dc244083eff52991413909d4bd/src/js/_enqueues/wp/customize/controls.js#L1427-L1436
|
||||
|
||||
this.params.type = 'outer';
|
||||
|
@ -2368,8 +2408,8 @@ function getSidebarControl() {
|
|||
}
|
||||
} = window;
|
||||
return class SidebarControl extends customize.Control {
|
||||
constructor(...args) {
|
||||
super(...args);
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.subscribers = new Set();
|
||||
}
|
||||
|
||||
|
@ -2956,12 +2996,15 @@ var external_lodash_ = __webpack_require__("YLtl");
|
|||
* @return {Object} Updated state.
|
||||
*/
|
||||
|
||||
function singleEnableItems(state = {}, {
|
||||
function singleEnableItems() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let {
|
||||
type,
|
||||
itemType,
|
||||
scope,
|
||||
item
|
||||
}) {
|
||||
} = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
if (type !== 'SET_SINGLE_ENABLE_ITEM' || !itemType || !scope) {
|
||||
return state;
|
||||
}
|
||||
|
@ -2986,13 +3029,16 @@ function singleEnableItems(state = {}, {
|
|||
* @return {Object} Updated state.
|
||||
*/
|
||||
|
||||
function multipleEnableItems(state = {}, {
|
||||
function multipleEnableItems() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let {
|
||||
type,
|
||||
itemType,
|
||||
scope,
|
||||
item,
|
||||
isEnable
|
||||
}) {
|
||||
} = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
if (type !== 'SET_MULTIPLE_ENABLE_ITEM' || !itemType || !scope || !item || Object(external_lodash_["get"])(state, [itemType, scope, item]) === isEnable) {
|
||||
return state;
|
||||
}
|
||||
|
@ -3020,7 +3066,10 @@ function multipleEnableItems(state = {}, {
|
|||
*/
|
||||
|
||||
const preferenceDefaults = Object(external_wp_data_["combineReducers"])({
|
||||
features(state = {}, action) {
|
||||
features() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
if (action.type === 'SET_FEATURE_DEFAULTS') {
|
||||
const {
|
||||
scope,
|
||||
|
@ -3047,7 +3096,10 @@ const preferenceDefaults = Object(external_wp_data_["combineReducers"])({
|
|||
*/
|
||||
|
||||
const preferences = Object(external_wp_data_["combineReducers"])({
|
||||
features(state = {}, action) {
|
||||
features() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
if (action.type === 'SET_FEATURE_VALUE') {
|
||||
const {
|
||||
scope,
|
||||
|
@ -3170,10 +3222,11 @@ function actions_unpinItem(scope, itemId) {
|
|||
*/
|
||||
|
||||
function actions_toggleFeature(scope, featureName) {
|
||||
return function ({
|
||||
return function (_ref) {
|
||||
let {
|
||||
select,
|
||||
dispatch
|
||||
}) {
|
||||
} = _ref;
|
||||
const currentValue = select.isFeatureActive(scope, featureName);
|
||||
dispatch.setFeatureValue(scope, featureName, !currentValue);
|
||||
};
|
||||
|
@ -3374,14 +3427,15 @@ var external_wp_plugins_ = __webpack_require__("TvNi");
|
|||
|
||||
|
||||
|
||||
function ComplementaryAreaToggle({
|
||||
function ComplementaryAreaToggle(_ref) {
|
||||
let {
|
||||
as = external_wp_components_["Button"],
|
||||
scope,
|
||||
identifier,
|
||||
icon,
|
||||
selectedIcon,
|
||||
...props
|
||||
}) {
|
||||
} = _ref;
|
||||
const ComponentToUse = as;
|
||||
const isSelected = Object(external_wp_data_["useSelect"])(select => select(store).getActiveComplementaryArea(scope) === identifier, [identifier]);
|
||||
const {
|
||||
|
@ -3421,12 +3475,13 @@ function ComplementaryAreaToggle({
|
|||
|
||||
|
||||
|
||||
const ComplementaryAreaHeader = ({
|
||||
const ComplementaryAreaHeader = _ref => {
|
||||
let {
|
||||
smallScreenTitle,
|
||||
children,
|
||||
className,
|
||||
toggleButtonProps
|
||||
}) => {
|
||||
} = _ref;
|
||||
const toggleButton = Object(external_wp_element_["createElement"])(complementary_area_toggle, Object(esm_extends["a" /* default */])({
|
||||
icon: close_small["a" /* default */]
|
||||
}, toggleButtonProps));
|
||||
|
@ -3457,13 +3512,14 @@ const ComplementaryAreaHeader = ({
|
|||
|
||||
|
||||
|
||||
function ActionItemSlot({
|
||||
function ActionItemSlot(_ref) {
|
||||
let {
|
||||
name,
|
||||
as: Component = external_wp_components_["ButtonGroup"],
|
||||
fillProps = {},
|
||||
bubblesVirtually,
|
||||
...props
|
||||
}) {
|
||||
} = _ref;
|
||||
return Object(external_wp_element_["createElement"])(external_wp_components_["Slot"], {
|
||||
name: name,
|
||||
bubblesVirtually: bubblesVirtually,
|
||||
|
@ -3479,12 +3535,14 @@ function ActionItemSlot({
|
|||
|
||||
|
||||
const initializedByPlugins = [];
|
||||
external_wp_element_["Children"].forEach(fills, ({
|
||||
external_wp_element_["Children"].forEach(fills, _ref2 => {
|
||||
let {
|
||||
props: {
|
||||
__unstableExplicitMenuItem,
|
||||
__unstableTarget
|
||||
}
|
||||
}) => {
|
||||
} = _ref2;
|
||||
|
||||
if (__unstableTarget && __unstableExplicitMenuItem) {
|
||||
initializedByPlugins.push(__unstableTarget);
|
||||
}
|
||||
|
@ -3500,21 +3558,23 @@ function ActionItemSlot({
|
|||
});
|
||||
}
|
||||
|
||||
function ActionItem({
|
||||
function ActionItem(_ref3) {
|
||||
let {
|
||||
name,
|
||||
as: Component = external_wp_components_["Button"],
|
||||
onClick,
|
||||
...props
|
||||
}) {
|
||||
} = _ref3;
|
||||
return Object(external_wp_element_["createElement"])(external_wp_components_["Fill"], {
|
||||
name: name
|
||||
}, ({
|
||||
}, _ref4 => {
|
||||
let {
|
||||
onClick: fpOnClick
|
||||
}) => {
|
||||
} = _ref4;
|
||||
return Object(external_wp_element_["createElement"])(Component, Object(esm_extends["a" /* default */])({
|
||||
onClick: onClick || fpOnClick ? (...args) => {
|
||||
(onClick || external_lodash_["noop"])(...args);
|
||||
(fpOnClick || external_lodash_["noop"])(...args);
|
||||
onClick: onClick || fpOnClick ? function () {
|
||||
(onClick || external_lodash_["noop"])(...arguments);
|
||||
(fpOnClick || external_lodash_["noop"])(...arguments);
|
||||
} : undefined
|
||||
}, props));
|
||||
});
|
||||
|
@ -3549,12 +3609,13 @@ const PluginsMenuItem = props => // Menu item is marked with unstable prop for b
|
|||
// @see https://github.com/WordPress/gutenberg/issues/14457
|
||||
Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], Object(external_lodash_["omit"])(props, ['__unstableExplicitMenuItem', '__unstableTarget']));
|
||||
|
||||
function ComplementaryAreaMoreMenuItem({
|
||||
function ComplementaryAreaMoreMenuItem(_ref) {
|
||||
let {
|
||||
scope,
|
||||
target,
|
||||
__unstableExplicitMenuItem,
|
||||
...props
|
||||
}) {
|
||||
} = _ref;
|
||||
return Object(external_wp_element_["createElement"])(complementary_area_toggle, Object(esm_extends["a" /* default */])({
|
||||
as: toggleProps => {
|
||||
return Object(external_wp_element_["createElement"])(action_item, Object(esm_extends["a" /* default */])({
|
||||
|
@ -3586,20 +3647,22 @@ function ComplementaryAreaMoreMenuItem({
|
|||
|
||||
|
||||
|
||||
function PinnedItems({
|
||||
function PinnedItems(_ref) {
|
||||
let {
|
||||
scope,
|
||||
...props
|
||||
}) {
|
||||
} = _ref;
|
||||
return Object(external_wp_element_["createElement"])(external_wp_components_["Fill"], Object(esm_extends["a" /* default */])({
|
||||
name: `PinnedItems/${scope}`
|
||||
}, props));
|
||||
}
|
||||
|
||||
function PinnedItemsSlot({
|
||||
function PinnedItemsSlot(_ref2) {
|
||||
let {
|
||||
scope,
|
||||
className,
|
||||
...props
|
||||
}) {
|
||||
} = _ref2;
|
||||
return Object(external_wp_element_["createElement"])(external_wp_components_["Slot"], Object(esm_extends["a" /* default */])({
|
||||
name: `PinnedItems/${scope}`
|
||||
}, props), fills => !Object(external_lodash_["isEmpty"])(fills) && Object(external_wp_element_["createElement"])("div", {
|
||||
|
@ -3639,20 +3702,22 @@ PinnedItems.Slot = PinnedItemsSlot;
|
|||
|
||||
|
||||
|
||||
function ComplementaryAreaSlot({
|
||||
function ComplementaryAreaSlot(_ref) {
|
||||
let {
|
||||
scope,
|
||||
...props
|
||||
}) {
|
||||
} = _ref;
|
||||
return Object(external_wp_element_["createElement"])(external_wp_components_["Slot"], Object(esm_extends["a" /* default */])({
|
||||
name: `ComplementaryArea/${scope}`
|
||||
}, props));
|
||||
}
|
||||
|
||||
function ComplementaryAreaFill({
|
||||
function ComplementaryAreaFill(_ref2) {
|
||||
let {
|
||||
scope,
|
||||
children,
|
||||
className
|
||||
}) {
|
||||
} = _ref2;
|
||||
return Object(external_wp_element_["createElement"])(external_wp_components_["Fill"], {
|
||||
name: `ComplementaryArea/${scope}`
|
||||
}, Object(external_wp_element_["createElement"])("div", {
|
||||
|
@ -3693,7 +3758,8 @@ function useAdjustComplementaryListener(scope, identifier, activeArea, isActive,
|
|||
}, [isActive, isSmall, scope, identifier, activeArea]);
|
||||
}
|
||||
|
||||
function ComplementaryArea({
|
||||
function ComplementaryArea(_ref3) {
|
||||
let {
|
||||
children,
|
||||
className,
|
||||
closeLabel = Object(external_wp_i18n_["__"])('Close plugin'),
|
||||
|
@ -3710,7 +3776,7 @@ function ComplementaryArea({
|
|||
toggleShortcut,
|
||||
isActiveByDefault,
|
||||
showIconLabels = false
|
||||
}) {
|
||||
} = _ref3;
|
||||
const {
|
||||
isActive,
|
||||
isPinned,
|
||||
|
@ -3796,9 +3862,10 @@ ComplementaryAreaWrapped.Slot = ComplementaryAreaSlot;
|
|||
*/
|
||||
|
||||
|
||||
const FullscreenMode = ({
|
||||
const FullscreenMode = _ref => {
|
||||
let {
|
||||
isActive
|
||||
}) => {
|
||||
} = _ref;
|
||||
Object(external_wp_element_["useEffect"])(() => {
|
||||
let isSticky = false; // `is-fullscreen-mode` is set in PHP as a body class by Gutenberg, and this causes
|
||||
// `sticky-menu` to be applied by WordPress and prevents the admin menu being scrolled
|
||||
|
@ -3873,7 +3940,8 @@ function useHTMLClass(className) {
|
|||
}, [className]);
|
||||
}
|
||||
|
||||
function InterfaceSkeleton({
|
||||
function InterfaceSkeleton(_ref, ref) {
|
||||
let {
|
||||
footer,
|
||||
header,
|
||||
sidebar,
|
||||
|
@ -3885,7 +3953,7 @@ function InterfaceSkeleton({
|
|||
labels,
|
||||
className,
|
||||
shortcuts
|
||||
}, ref) {
|
||||
} = _ref;
|
||||
const navigateRegionsProps = Object(external_wp_components_["__unstableUseNavigateRegions"])(shortcuts);
|
||||
useHTMLClass('interface-interface-skeleton__html-container');
|
||||
const defaultLabels = {
|
||||
|
@ -3978,7 +4046,8 @@ var more_vertical = __webpack_require__("VKE3");
|
|||
|
||||
|
||||
|
||||
function MoreMenuDropdown({
|
||||
function MoreMenuDropdown(_ref) {
|
||||
let {
|
||||
as: DropdownComponent = external_wp_components_["DropdownMenu"],
|
||||
className,
|
||||
|
||||
|
@ -3987,7 +4056,7 @@ function MoreMenuDropdown({
|
|||
popoverProps,
|
||||
toggleProps,
|
||||
children
|
||||
}) {
|
||||
} = _ref;
|
||||
return Object(external_wp_element_["createElement"])(DropdownComponent, {
|
||||
className: classnames_default()('interface-more-menu-dropdown', className),
|
||||
icon: more_vertical["a" /* default */],
|
||||
|
@ -4023,7 +4092,8 @@ var external_wp_a11y_ = __webpack_require__("gdqT");
|
|||
*/
|
||||
|
||||
|
||||
function MoreMenuFeatureToggle({
|
||||
function MoreMenuFeatureToggle(_ref) {
|
||||
let {
|
||||
scope,
|
||||
label,
|
||||
info,
|
||||
|
@ -4031,7 +4101,7 @@ function MoreMenuFeatureToggle({
|
|||
messageDeactivated,
|
||||
shortcut,
|
||||
feature
|
||||
}) {
|
||||
} = _ref;
|
||||
const isActive = Object(external_wp_data_["useSelect"])(select => select(store).isFeatureActive(scope, feature), [feature]);
|
||||
const {
|
||||
toggleFeature
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -150,12 +150,12 @@ function apiFetch(request) {
|
|||
* @param {Array} args Arguments passed without change to the `@wordpress/data` control.
|
||||
*/
|
||||
|
||||
function select(...args) {
|
||||
function select() {
|
||||
_wordpress_deprecated__WEBPACK_IMPORTED_MODULE_2___default()('`select` control in `@wordpress/data-controls`', {
|
||||
since: '5.7',
|
||||
alternative: 'built-in `resolveSelect` control in `@wordpress/data`'
|
||||
});
|
||||
return _wordpress_data__WEBPACK_IMPORTED_MODULE_1__["controls"].resolveSelect(...args);
|
||||
return _wordpress_data__WEBPACK_IMPORTED_MODULE_1__["controls"].resolveSelect(...arguments);
|
||||
}
|
||||
/**
|
||||
* Control for calling a selector in a registered data store.
|
||||
|
@ -164,12 +164,12 @@ function select(...args) {
|
|||
* @param {Array} args Arguments passed without change to the `@wordpress/data` control.
|
||||
*/
|
||||
|
||||
function syncSelect(...args) {
|
||||
function syncSelect() {
|
||||
_wordpress_deprecated__WEBPACK_IMPORTED_MODULE_2___default()('`syncSelect` control in `@wordpress/data-controls`', {
|
||||
since: '5.7',
|
||||
alternative: 'built-in `select` control in `@wordpress/data`'
|
||||
});
|
||||
return _wordpress_data__WEBPACK_IMPORTED_MODULE_1__["controls"].select(...args);
|
||||
return _wordpress_data__WEBPACK_IMPORTED_MODULE_1__["controls"].select(...arguments);
|
||||
}
|
||||
/**
|
||||
* Control for dispatching an action in a registered data store.
|
||||
|
@ -178,12 +178,12 @@ function syncSelect(...args) {
|
|||
* @param {Array} args Arguments passed without change to the `@wordpress/data` control.
|
||||
*/
|
||||
|
||||
function dispatch(...args) {
|
||||
function dispatch() {
|
||||
_wordpress_deprecated__WEBPACK_IMPORTED_MODULE_2___default()('`dispatch` control in `@wordpress/data-controls`', {
|
||||
since: '5.7',
|
||||
alternative: 'built-in `dispatch` control in `@wordpress/data`'
|
||||
});
|
||||
return _wordpress_data__WEBPACK_IMPORTED_MODULE_1__["controls"].dispatch(...args);
|
||||
return _wordpress_data__WEBPACK_IMPORTED_MODULE_1__["controls"].dispatch(...arguments);
|
||||
}
|
||||
/**
|
||||
* Dispatches a control action for awaiting on a promise to be resolved.
|
||||
|
@ -240,13 +240,17 @@ const __unstableAwaitPromise = function (promise) {
|
|||
*/
|
||||
|
||||
const controls = {
|
||||
AWAIT_PROMISE: ({
|
||||
AWAIT_PROMISE: _ref => {
|
||||
let {
|
||||
promise
|
||||
}) => promise,
|
||||
} = _ref;
|
||||
return promise;
|
||||
},
|
||||
|
||||
API_FETCH({
|
||||
API_FETCH(_ref2) {
|
||||
let {
|
||||
request
|
||||
}) {
|
||||
} = _ref2;
|
||||
return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default()(request);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
/*! This file is auto-generated */
|
||||
this.wp=this.wp||{},this.wp.dataControls=function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="71Oy")}({"1ZqX":function(t,e){t.exports=window.wp.data},"71Oy":function(t,e,n){"use strict";n.r(e),n.d(e,"apiFetch",(function(){return s})),n.d(e,"select",(function(){return l})),n.d(e,"syncSelect",(function(){return a})),n.d(e,"dispatch",(function(){return d})),n.d(e,"__unstableAwaitPromise",(function(){return p})),n.d(e,"controls",(function(){return f}));var r=n("ywyh"),o=n.n(r),i=n("1ZqX"),c=n("NMb1"),u=n.n(c);function s(t){return{type:"API_FETCH",request:t}}function l(...t){return u()("`select` control in `@wordpress/data-controls`",{since:"5.7",alternative:"built-in `resolveSelect` control in `@wordpress/data`"}),i.controls.resolveSelect(...t)}function a(...t){return u()("`syncSelect` control in `@wordpress/data-controls`",{since:"5.7",alternative:"built-in `select` control in `@wordpress/data`"}),i.controls.select(...t)}function d(...t){return u()("`dispatch` control in `@wordpress/data-controls`",{since:"5.7",alternative:"built-in `dispatch` control in `@wordpress/data`"}),i.controls.dispatch(...t)}const p=function(t){return{type:"AWAIT_PROMISE",promise:t}},f={AWAIT_PROMISE:({promise:t})=>t,API_FETCH:({request:t})=>o()(t)}},NMb1:function(t,e){t.exports=window.wp.deprecated},ywyh:function(t,e){t.exports=window.wp.apiFetch}});
|
||||
this.wp=this.wp||{},this.wp.dataControls=function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="71Oy")}({"1ZqX":function(t,e){t.exports=window.wp.data},"71Oy":function(t,e,n){"use strict";n.r(e),n.d(e,"apiFetch",(function(){return s})),n.d(e,"select",(function(){return l})),n.d(e,"syncSelect",(function(){return a})),n.d(e,"dispatch",(function(){return d})),n.d(e,"__unstableAwaitPromise",(function(){return p})),n.d(e,"controls",(function(){return f}));var r=n("ywyh"),o=n.n(r),i=n("1ZqX"),c=n("NMb1"),u=n.n(c);function s(t){return{type:"API_FETCH",request:t}}function l(){return u()("`select` control in `@wordpress/data-controls`",{since:"5.7",alternative:"built-in `resolveSelect` control in `@wordpress/data`"}),i.controls.resolveSelect(...arguments)}function a(){return u()("`syncSelect` control in `@wordpress/data-controls`",{since:"5.7",alternative:"built-in `select` control in `@wordpress/data`"}),i.controls.select(...arguments)}function d(){return u()("`dispatch` control in `@wordpress/data-controls`",{since:"5.7",alternative:"built-in `dispatch` control in `@wordpress/data`"}),i.controls.dispatch(...arguments)}const p=function(t){return{type:"AWAIT_PROMISE",promise:t}},f={AWAIT_PROMISE:t=>{let{promise:e}=t;return e},API_FETCH(t){let{request:e}=t;return o()(e)}}},NMb1:function(t,e){t.exports=window.wp.deprecated},ywyh:function(t,e){t.exports=window.wp.apiFetch}});
|
|
@ -1423,7 +1423,9 @@ function createRegistrySelector(registrySelector) {
|
|||
// create a selector function that is bound to the registry referenced by `selector.registry`
|
||||
// and that has the same API as a regular selector. Binding it in such a way makes it
|
||||
// possible to call the selector directly from another selector.
|
||||
const selector = (...args) => registrySelector(selector.registry.select)(...args);
|
||||
const selector = function () {
|
||||
return registrySelector(selector.registry.select)(...arguments);
|
||||
};
|
||||
/**
|
||||
* Flag indicating that the selector is a registry selector that needs the correct registry
|
||||
* reference to be assigned to `selecto.registry` to make it work correctly.
|
||||
|
@ -1501,7 +1503,11 @@ const DISPATCH = '@@data/DISPATCH';
|
|||
* @return {Object} The control descriptor.
|
||||
*/
|
||||
|
||||
function controls_select(storeNameOrDefinition, selectorName, ...args) {
|
||||
function controls_select(storeNameOrDefinition, selectorName) {
|
||||
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
||||
args[_key - 2] = arguments[_key];
|
||||
}
|
||||
|
||||
return {
|
||||
type: SELECT,
|
||||
storeKey: Object(external_lodash_["isObject"])(storeNameOrDefinition) ? storeNameOrDefinition.name : storeNameOrDefinition,
|
||||
|
@ -1535,7 +1541,11 @@ function controls_select(storeNameOrDefinition, selectorName, ...args) {
|
|||
*/
|
||||
|
||||
|
||||
function controls_resolveSelect(storeNameOrDefinition, selectorName, ...args) {
|
||||
function controls_resolveSelect(storeNameOrDefinition, selectorName) {
|
||||
for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
||||
args[_key2 - 2] = arguments[_key2];
|
||||
}
|
||||
|
||||
return {
|
||||
type: RESOLVE_SELECT,
|
||||
storeKey: Object(external_lodash_["isObject"])(storeNameOrDefinition) ? storeNameOrDefinition.name : storeNameOrDefinition,
|
||||
|
@ -1565,7 +1575,11 @@ function controls_resolveSelect(storeNameOrDefinition, selectorName, ...args) {
|
|||
*/
|
||||
|
||||
|
||||
function controls_dispatch(storeNameOrDefinition, actionName, ...args) {
|
||||
function controls_dispatch(storeNameOrDefinition, actionName) {
|
||||
for (var _len3 = arguments.length, args = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
|
||||
args[_key3 - 2] = arguments[_key3];
|
||||
}
|
||||
|
||||
return {
|
||||
type: DISPATCH,
|
||||
storeKey: Object(external_lodash_["isObject"])(storeNameOrDefinition) ? storeNameOrDefinition.name : storeNameOrDefinition,
|
||||
|
@ -1580,24 +1594,31 @@ const controls_controls = {
|
|||
dispatch: controls_dispatch
|
||||
};
|
||||
const builtinControls = {
|
||||
[SELECT]: createRegistryControl(registry => ({
|
||||
[SELECT]: createRegistryControl(registry => _ref => {
|
||||
let {
|
||||
storeKey,
|
||||
selectorName,
|
||||
args
|
||||
}) => registry.select(storeKey)[selectorName](...args)),
|
||||
[RESOLVE_SELECT]: createRegistryControl(registry => ({
|
||||
} = _ref;
|
||||
return registry.select(storeKey)[selectorName](...args);
|
||||
}),
|
||||
[RESOLVE_SELECT]: createRegistryControl(registry => _ref2 => {
|
||||
let {
|
||||
storeKey,
|
||||
selectorName,
|
||||
args
|
||||
}) => {
|
||||
} = _ref2;
|
||||
const method = registry.select(storeKey)[selectorName].hasResolver ? 'resolveSelect' : 'select';
|
||||
return registry[method](storeKey)[selectorName](...args);
|
||||
}),
|
||||
[DISPATCH]: createRegistryControl(registry => ({
|
||||
[DISPATCH]: createRegistryControl(registry => _ref3 => {
|
||||
let {
|
||||
storeKey,
|
||||
actionName,
|
||||
args
|
||||
}) => registry.dispatch(storeKey)[actionName](...args))
|
||||
} = _ref3;
|
||||
return registry.dispatch(storeKey)[actionName](...args);
|
||||
})
|
||||
};
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/is-promise/index.js
|
||||
|
@ -1662,7 +1683,8 @@ const STORE_NAME = 'core/data';
|
|||
|
||||
const createResolversCacheMiddleware = (registry, reducerKey) => () => next => action => {
|
||||
const resolvers = registry.select(STORE_NAME).getCachedResolvers(reducerKey);
|
||||
Object.entries(resolvers).forEach(([selectorName, resolversByArgs]) => {
|
||||
Object.entries(resolvers).forEach(_ref => {
|
||||
let [selectorName, resolversByArgs] = _ref;
|
||||
const resolver = Object(external_lodash_["get"])(registry.stores, [reducerKey, 'resolvers', selectorName]);
|
||||
|
||||
if (!resolver || !resolver.shouldInvalidate) {
|
||||
|
@ -1709,11 +1731,11 @@ function createThunkMiddleware(args) {
|
|||
*
|
||||
* @return {(reducer: import('redux').Reducer<TState, TAction>) => import('redux').Reducer<Record<string, TState>, TAction>} Higher-order reducer.
|
||||
*/
|
||||
const onSubKey = actionProperty => reducer => (
|
||||
/* eslint-disable jsdoc/no-undefined-types */
|
||||
state =
|
||||
const onSubKey = actionProperty => reducer => function () {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] :
|
||||
/** @type {Record<string, TState>} */
|
||||
{}, action) => {
|
||||
{};
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
// Retrieve subkey from action. Do not track if undefined; useful for cases
|
||||
// where reducer is scoped by action shape.
|
||||
|
||||
|
@ -1757,7 +1779,10 @@ state =
|
|||
*
|
||||
* selectorName -> EquivalentKeyMap<Array,boolean>
|
||||
*/
|
||||
const subKeysIsResolved = onSubKey('selectorName')((state = new equivalent_key_map_default.a(), action) => {
|
||||
const subKeysIsResolved = onSubKey('selectorName')(function () {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new equivalent_key_map_default.a();
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'START_RESOLUTION':
|
||||
case 'FINISH_RESOLUTION':
|
||||
|
@ -1802,7 +1827,10 @@ const subKeysIsResolved = onSubKey('selectorName')((state = new equivalent_key_m
|
|||
* @return Next state.
|
||||
*/
|
||||
|
||||
const isResolved = (state = {}, action) => {
|
||||
const isResolved = function () {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'INVALIDATE_RESOLUTION_FOR_STORE':
|
||||
return {};
|
||||
|
@ -1863,7 +1891,8 @@ function getIsResolving(state, selectorName, args) {
|
|||
* @return {boolean} Whether resolution has been triggered.
|
||||
*/
|
||||
|
||||
function hasStartedResolution(state, selectorName, args = []) {
|
||||
function hasStartedResolution(state, selectorName) {
|
||||
let args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
||||
return getIsResolving(state, selectorName, args) !== undefined;
|
||||
}
|
||||
/**
|
||||
|
@ -1877,7 +1906,8 @@ function hasStartedResolution(state, selectorName, args = []) {
|
|||
* @return {boolean} Whether resolution has completed.
|
||||
*/
|
||||
|
||||
function hasFinishedResolution(state, selectorName, args = []) {
|
||||
function hasFinishedResolution(state, selectorName) {
|
||||
let args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
||||
return getIsResolving(state, selectorName, args) === false;
|
||||
}
|
||||
/**
|
||||
|
@ -1891,7 +1921,8 @@ function hasFinishedResolution(state, selectorName, args = []) {
|
|||
* @return {boolean} Whether resolution is in progress.
|
||||
*/
|
||||
|
||||
function isResolving(state, selectorName, args = []) {
|
||||
function isResolving(state, selectorName) {
|
||||
let args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
||||
return getIsResolving(state, selectorName, args) === true;
|
||||
}
|
||||
/**
|
||||
|
@ -2144,13 +2175,25 @@ function createReduxStore(key, options) {
|
|||
const actions = mapActions({ ...actions_namespaceObject,
|
||||
...options.actions
|
||||
}, store);
|
||||
let selectors = mapSelectors({ ...Object(external_lodash_["mapValues"])(selectors_namespaceObject, selector => (state, ...args) => selector(state.metadata, ...args)),
|
||||
let selectors = mapSelectors({ ...Object(external_lodash_["mapValues"])(selectors_namespaceObject, selector => function (state) {
|
||||
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
||||
args[_key - 1] = arguments[_key];
|
||||
}
|
||||
|
||||
return selector(state.metadata, ...args);
|
||||
}),
|
||||
...Object(external_lodash_["mapValues"])(options.selectors, selector => {
|
||||
if (selector.isRegistrySelector) {
|
||||
selector.registry = registry;
|
||||
}
|
||||
|
||||
return (state, ...args) => selector(state.root, ...args);
|
||||
return function (state) {
|
||||
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
||||
args[_key2 - 1] = arguments[_key2];
|
||||
}
|
||||
|
||||
return selector(state.root, ...args);
|
||||
};
|
||||
})
|
||||
}, store);
|
||||
|
||||
|
@ -2301,8 +2344,8 @@ function mapSelectors(selectors, store) {
|
|||
|
||||
|
||||
function mapActions(actions, store) {
|
||||
const createBoundAction = action => (...args) => {
|
||||
return Promise.resolve(store.dispatch(action(...args)));
|
||||
const createBoundAction = action => function () {
|
||||
return Promise.resolve(store.dispatch(action(...arguments)));
|
||||
};
|
||||
|
||||
return Object(external_lodash_["mapValues"])(actions, createBoundAction);
|
||||
|
@ -2318,7 +2361,12 @@ function mapActions(actions, store) {
|
|||
|
||||
|
||||
function mapResolveSelectors(selectors, store) {
|
||||
return Object(external_lodash_["mapValues"])(Object(external_lodash_["omit"])(selectors, ['getIsResolving', 'hasStartedResolution', 'hasFinishedResolution', 'isResolving', 'getCachedResolvers']), (selector, selectorName) => (...args) => new Promise(resolve => {
|
||||
return Object(external_lodash_["mapValues"])(Object(external_lodash_["omit"])(selectors, ['getIsResolving', 'hasStartedResolution', 'hasFinishedResolution', 'isResolving', 'getCachedResolvers']), (selector, selectorName) => function () {
|
||||
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
||||
args[_key3] = arguments[_key3];
|
||||
}
|
||||
|
||||
return new Promise(resolve => {
|
||||
const hasFinished = () => selectors.hasFinishedResolution(selectorName, args);
|
||||
|
||||
const getResult = () => selector.apply(null, args); // trigger the selector (to trigger the resolver)
|
||||
|
@ -2336,7 +2384,8 @@ function mapResolveSelectors(selectors, store) {
|
|||
resolve(getResult());
|
||||
}
|
||||
});
|
||||
}));
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Returns resolvers with matched selectors for a given namespace.
|
||||
|
@ -2374,7 +2423,11 @@ function mapResolvers(resolvers, selectors, store, resolversCache) {
|
|||
return selector;
|
||||
}
|
||||
|
||||
const selectorResolver = (...args) => {
|
||||
const selectorResolver = function () {
|
||||
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
||||
args[_key4] = arguments[_key4];
|
||||
}
|
||||
|
||||
async function fulfillSelector() {
|
||||
const state = store.getState();
|
||||
|
||||
|
@ -2422,13 +2475,17 @@ function mapResolvers(resolvers, selectors, store, resolversCache) {
|
|||
*/
|
||||
|
||||
|
||||
async function fulfillResolver(store, resolvers, selectorName, ...args) {
|
||||
async function fulfillResolver(store, resolvers, selectorName) {
|
||||
const resolver = Object(external_lodash_["get"])(resolvers, [selectorName]);
|
||||
|
||||
if (!resolver) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (var _len5 = arguments.length, args = new Array(_len5 > 3 ? _len5 - 3 : 0), _key5 = 3; _key5 < _len5; _key5++) {
|
||||
args[_key5 - 3] = arguments[_key5];
|
||||
}
|
||||
|
||||
const action = resolver.fulfill(...args);
|
||||
|
||||
if (action) {
|
||||
|
@ -2438,11 +2495,19 @@ async function fulfillResolver(store, resolvers, selectorName, ...args) {
|
|||
|
||||
// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/store/index.js
|
||||
function createCoreDataStore(registry) {
|
||||
const getCoreDataSelector = selectorName => (key, ...args) => {
|
||||
const getCoreDataSelector = selectorName => function (key) {
|
||||
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
||||
args[_key - 1] = arguments[_key];
|
||||
}
|
||||
|
||||
return registry.select(key)[selectorName](...args);
|
||||
};
|
||||
|
||||
const getCoreDataAction = actionName => (key, ...args) => {
|
||||
const getCoreDataAction = actionName => function (key) {
|
||||
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
||||
args[_key2 - 1] = arguments[_key2];
|
||||
}
|
||||
|
||||
return registry.dispatch(key)[actionName](...args);
|
||||
};
|
||||
|
||||
|
@ -2574,7 +2639,9 @@ function createEmitter() {
|
|||
* @return {WPDataRegistry} Data registry.
|
||||
*/
|
||||
|
||||
function createRegistry(storeConfigs = {}, parent = null) {
|
||||
function createRegistry() {
|
||||
let storeConfigs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let parent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
||||
const stores = {};
|
||||
const emitter = createEmitter();
|
||||
|
||||
|
@ -2830,7 +2897,10 @@ function createRegistry(storeConfigs = {}, parent = null) {
|
|||
}
|
||||
|
||||
registerGenericStore(STORE_NAME, build_module_store(registry));
|
||||
Object.entries(storeConfigs).forEach(([name, config]) => registry.registerStore(name, config));
|
||||
Object.entries(storeConfigs).forEach(_ref => {
|
||||
let [name, config] = _ref;
|
||||
return registry.registerStore(name, config);
|
||||
});
|
||||
|
||||
if (parent) {
|
||||
parent.subscribe(globalListener);
|
||||
|
@ -3694,7 +3764,9 @@ const useDispatchWithMap = (dispatchMap, deps) => {
|
|||
console.warn(`Property ${propName} returned from dispatchMap in useDispatchWithMap must be a function.`);
|
||||
}
|
||||
|
||||
return (...args) => currentDispatchMap.current(registry.dispatch, registry)[propName](...args);
|
||||
return function () {
|
||||
return currentDispatchMap.current(registry.dispatch, registry)[propName](...arguments);
|
||||
};
|
||||
});
|
||||
}, [registry, ...deps]);
|
||||
};
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -136,7 +136,8 @@ const logged = Object.create(null);
|
|||
* ```
|
||||
*/
|
||||
|
||||
function deprecated(feature, options = {}) {
|
||||
function deprecated(feature) {
|
||||
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
const {
|
||||
since,
|
||||
version,
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
/*! This file is auto-generated */
|
||||
this.wp=this.wp||{},this.wp.deprecated=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="+BeG")}({"+BeG":function(e,t,n){"use strict";n.r(t),n.d(t,"logged",(function(){return o})),n.d(t,"default",(function(){return i}));var r=n("g56x");const o=Object.create(null);function i(e,t={}){const{since:n,version:i,alternative:u,plugin:c,link:l,hint:f}=t,a=`${e} is deprecated${n?" since version "+n:""}${i?` and will be removed${c?" from "+c:""} in version ${i}`:""}.${u?` Please use ${u} instead.`:""}${l?" See: "+l:""}${f?" Note: "+f:""}`;a in o||(Object(r.doAction)("deprecated",e,t,a),console.warn(a),o[a]=!0)}},g56x:function(e,t){e.exports=window.wp.hooks}}).default;
|
||||
this.wp=this.wp||{},this.wp.deprecated=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="+BeG")}({"+BeG":function(e,t,n){"use strict";n.r(t),n.d(t,"logged",(function(){return o})),n.d(t,"default",(function(){return i}));var r=n("g56x");const o=Object.create(null);function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{since:n,version:i,alternative:u,plugin:c,link:l,hint:d}=t,f=c?" from "+c:"",a=n?" since version "+n:"",s=i?` and will be removed${f} in version ${i}`:"",p=u?` Please use ${u} instead.`:"",b=l?" See: "+l:"",v=d?" Note: "+d:"",g=`${e} is deprecated${a}${s}.${p}${b}${v}`;g in o||(Object(r.doAction)("deprecated",e,t,g),console.warn(g),o[g]=!0)}},g56x:function(e,t){e.exports=window.wp.hooks}}).default;
|
|
@ -226,9 +226,11 @@ function isValidFocusableArea(element) {
|
|||
*/
|
||||
|
||||
|
||||
function find(context, {
|
||||
function find(context) {
|
||||
let {
|
||||
sequential = false
|
||||
} = {}) {
|
||||
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
|
||||
/* eslint-disable jsdoc/no-undefined-types */
|
||||
|
||||
/** @type {NodeListOf<HTMLElement>} */
|
||||
|
@ -480,9 +482,12 @@ function getRectangleFromRange(range) {
|
|||
} // Ignore tiny selection at the edge of a range.
|
||||
|
||||
|
||||
const filteredRects = rects.filter(({
|
||||
const filteredRects = rects.filter(_ref => {
|
||||
let {
|
||||
width
|
||||
}) => width > 1); // If it's full of tiny selections, return browser default.
|
||||
} = _ref;
|
||||
return width > 1;
|
||||
}); // If it's full of tiny selections, return browser default.
|
||||
|
||||
if (filteredRects.length === 0) {
|
||||
return range.getBoundingClientRect();
|
||||
|
@ -980,12 +985,18 @@ function getRangeHeight(range) {
|
|||
return;
|
||||
}
|
||||
|
||||
const highestTop = Math.min(...rects.map(({
|
||||
const highestTop = Math.min(...rects.map(_ref => {
|
||||
let {
|
||||
top
|
||||
}) => top));
|
||||
const lowestBottom = Math.max(...rects.map(({
|
||||
} = _ref;
|
||||
return top;
|
||||
}));
|
||||
const lowestBottom = Math.max(...rects.map(_ref2 => {
|
||||
let {
|
||||
bottom
|
||||
}) => bottom));
|
||||
} = _ref2;
|
||||
return bottom;
|
||||
}));
|
||||
return lowestBottom - highestTop;
|
||||
}
|
||||
|
||||
|
@ -1140,7 +1151,9 @@ function hiddenCaretRangeFromPoint(doc, x, y, container) {
|
|||
* @return {boolean} True if at the edge, false if not.
|
||||
*/
|
||||
|
||||
function isEdge(container, isReverse, onlyVertical = false) {
|
||||
function isEdge(container, isReverse) {
|
||||
let onlyVertical = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
||||
|
||||
if (isInputOrTextArea(container) && typeof container.selectionStart === 'number') {
|
||||
if (container.selectionStart !== container.selectionEnd) {
|
||||
return false;
|
||||
|
@ -1859,9 +1872,9 @@ function isElement(node) {
|
|||
*/
|
||||
|
||||
function cleanNodeList(nodeList, doc, schema, inline) {
|
||||
Array.from(nodeList).forEach(
|
||||
Array.from(nodeList).forEach((
|
||||
/** @type {Node & { nextElementSibling?: unknown }} */
|
||||
node => {
|
||||
node) => {
|
||||
var _schema$tag$isMatch, _schema$tag;
|
||||
|
||||
const tag = node.nodeName.toLowerCase(); // It's a valid child, if the tag exists in the schema without an isMatch
|
||||
|
@ -1885,9 +1898,11 @@ function cleanNodeList(nodeList, doc, schema, inline) {
|
|||
|
||||
if (node.hasAttributes()) {
|
||||
// Strip invalid attributes.
|
||||
Array.from(node.attributes).forEach(({
|
||||
Array.from(node.attributes).forEach(_ref => {
|
||||
let {
|
||||
name
|
||||
}) => {
|
||||
} = _ref;
|
||||
|
||||
if (name !== 'class' && !Object(external_lodash_["includes"])(attributes, name)) {
|
||||
node.removeAttribute(name);
|
||||
}
|
||||
|
@ -1900,13 +1915,11 @@ function cleanNodeList(nodeList, doc, schema, inline) {
|
|||
if (typeof item === 'string') {
|
||||
return (
|
||||
/** @type {string} */
|
||||
className => className === item
|
||||
);
|
||||
className) => className === item;
|
||||
} else if (item instanceof RegExp) {
|
||||
return (
|
||||
/** @type {string} */
|
||||
className => item.test(className)
|
||||
);
|
||||
className) => item.test(className);
|
||||
}
|
||||
|
||||
return external_lodash_["noop"];
|
||||
|
@ -2031,11 +2044,14 @@ function getFilesFromDataTransfer(dataTransfer) {
|
|||
Array.from(dataTransfer.items).forEach(item => {
|
||||
const file = item.getAsFile();
|
||||
|
||||
if (file && !files.find(({
|
||||
if (file && !files.find(_ref => {
|
||||
let {
|
||||
name,
|
||||
type,
|
||||
size
|
||||
}) => name === file.name && type === file.type && size === file.size)) {
|
||||
} = _ref;
|
||||
return name === file.name && type === file.type && size === file.size;
|
||||
})) {
|
||||
files.push(file);
|
||||
}
|
||||
});
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -255,7 +255,9 @@ var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_w
|
|||
* @return {Array} Updated state.
|
||||
*/
|
||||
|
||||
function reducer_widgetAreasOpenState(state = {}, action) {
|
||||
function reducer_widgetAreasOpenState() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
const {
|
||||
type
|
||||
} = action;
|
||||
|
@ -293,7 +295,10 @@ function reducer_widgetAreasOpenState(state = {}, action) {
|
|||
* @param {Object} action Dispatched action.
|
||||
*/
|
||||
|
||||
function blockInserterPanel(state = false, action) {
|
||||
function blockInserterPanel() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'SET_IS_LIST_VIEW_OPENED':
|
||||
return action.isOpen ? false : state;
|
||||
|
@ -314,7 +319,10 @@ function blockInserterPanel(state = false, action) {
|
|||
* @param {Object} action Dispatched action.
|
||||
*/
|
||||
|
||||
function listViewPanel(state = false, action) {
|
||||
function listViewPanel() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'SET_IS_INSERTER_OPENED':
|
||||
return action.value ? false : state;
|
||||
|
@ -387,7 +395,8 @@ function transformWidgetToBlock(widget) {
|
|||
* @return {Object} the widget object (converted from block).
|
||||
*/
|
||||
|
||||
function transformBlockToWidget(block, relatedWidget = {}) {
|
||||
function transformBlockToWidget(block) {
|
||||
let relatedWidget = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
let widget;
|
||||
const isValidLegacyWidgetBlock = block.name === 'core/legacy-widget' && (block.attributes.id || block.attributes.instance);
|
||||
|
||||
|
@ -527,9 +536,10 @@ const STORE_NAME = 'core/edit-widgets';
|
|||
* @return {Object} The post object.
|
||||
*/
|
||||
|
||||
const persistStubPost = (id, blocks) => ({
|
||||
const persistStubPost = (id, blocks) => _ref => {
|
||||
let {
|
||||
registry
|
||||
}) => {
|
||||
} = _ref;
|
||||
const stubPost = createStubPost(id, blocks);
|
||||
registry.dispatch(external_wp_coreData_["store"]).receiveEntityRecords(KIND, POST_TYPE, stubPost, {
|
||||
id: stubPost.id
|
||||
|
@ -545,11 +555,12 @@ const persistStubPost = (id, blocks) => ({
|
|||
* @return {Function} An action creator.
|
||||
*/
|
||||
|
||||
const actions_saveEditedWidgetAreas = () => async ({
|
||||
const actions_saveEditedWidgetAreas = () => async _ref2 => {
|
||||
let {
|
||||
select,
|
||||
dispatch,
|
||||
registry
|
||||
}) => {
|
||||
} = _ref2;
|
||||
const editedWidgetAreas = select.getEditedWidgetAreas();
|
||||
|
||||
if (!(editedWidgetAreas !== null && editedWidgetAreas !== void 0 && editedWidgetAreas.length)) {
|
||||
|
@ -577,10 +588,12 @@ const actions_saveEditedWidgetAreas = () => async ({
|
|||
* @return {Function} An action creator.
|
||||
*/
|
||||
|
||||
const saveWidgetAreas = widgetAreas => async ({
|
||||
const saveWidgetAreas = widgetAreas => async _ref3 => {
|
||||
let {
|
||||
dispatch,
|
||||
registry
|
||||
}) => {
|
||||
} = _ref3;
|
||||
|
||||
try {
|
||||
for (const widgetArea of widgetAreas) {
|
||||
await dispatch.saveWidgetArea(widgetArea.id);
|
||||
|
@ -598,17 +611,21 @@ const saveWidgetAreas = widgetAreas => async ({
|
|||
* @return {Function} An action creator.
|
||||
*/
|
||||
|
||||
const saveWidgetArea = widgetAreaId => async ({
|
||||
const saveWidgetArea = widgetAreaId => async _ref4 => {
|
||||
let {
|
||||
dispatch,
|
||||
select,
|
||||
registry
|
||||
}) => {
|
||||
} = _ref4;
|
||||
const widgets = select.getWidgets();
|
||||
const post = registry.select(external_wp_coreData_["store"]).getEditedEntityRecord(KIND, POST_TYPE, buildWidgetAreaPostId(widgetAreaId)); // Get all widgets from this area
|
||||
|
||||
const areaWidgets = Object.values(widgets).filter(({
|
||||
const areaWidgets = Object.values(widgets).filter(_ref5 => {
|
||||
let {
|
||||
sidebar
|
||||
}) => sidebar === widgetAreaId); // Remove all duplicate reference widget instances for legacy widgets.
|
||||
} = _ref5;
|
||||
return sidebar === widgetAreaId;
|
||||
}); // Remove all duplicate reference widget instances for legacy widgets.
|
||||
// Why? We filter out the widgets with duplicate IDs to prevent adding more than one instance of a widget
|
||||
// implemented using a function. WordPress doesn't support having more than one instance of these, if you try to
|
||||
// save multiple instances of these in different sidebars you will run into undefined behaviors.
|
||||
|
@ -669,16 +686,22 @@ const saveWidgetArea = widgetAreaId => async ({
|
|||
continue;
|
||||
}
|
||||
|
||||
batchTasks.push(({
|
||||
batchTasks.push(_ref6 => {
|
||||
let {
|
||||
saveEditedEntityRecord
|
||||
}) => saveEditedEntityRecord('root', 'widget', widgetId));
|
||||
} = _ref6;
|
||||
return saveEditedEntityRecord('root', 'widget', widgetId);
|
||||
});
|
||||
} else {
|
||||
// Create a new widget.
|
||||
batchTasks.push(({
|
||||
batchTasks.push(_ref7 => {
|
||||
let {
|
||||
saveEntityRecord
|
||||
}) => saveEntityRecord('root', 'widget', { ...widget,
|
||||
} = _ref7;
|
||||
return saveEntityRecord('root', 'widget', { ...widget,
|
||||
sidebar: widgetAreaId
|
||||
}));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
batchMeta.push({
|
||||
|
@ -689,11 +712,14 @@ const saveWidgetArea = widgetAreaId => async ({
|
|||
}
|
||||
|
||||
for (const widget of deletedWidgets) {
|
||||
batchTasks.push(({
|
||||
batchTasks.push(_ref8 => {
|
||||
let {
|
||||
deleteEntityRecord
|
||||
}) => deleteEntityRecord('root', 'widget', widget.id, {
|
||||
} = _ref8;
|
||||
return deleteEntityRecord('root', 'widget', widget.id, {
|
||||
force: true
|
||||
}));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
const records = await registry.dispatch(external_wp_coreData_["store"]).__experimentalBatch(batchTasks);
|
||||
|
@ -737,9 +763,10 @@ const saveWidgetArea = widgetAreaId => async ({
|
|||
registry.dispatch(external_wp_coreData_["store"]).receiveEntityRecords(KIND, POST_TYPE, post, undefined);
|
||||
};
|
||||
|
||||
const trySaveWidgetArea = widgetAreaId => ({
|
||||
const trySaveWidgetArea = widgetAreaId => _ref9 => {
|
||||
let {
|
||||
registry
|
||||
}) => {
|
||||
} = _ref9;
|
||||
const saveErrorBefore = registry.select(external_wp_coreData_["store"]).getLastEntitySaveError(KIND, WIDGET_AREA_ENTITY_TYPE, widgetAreaId);
|
||||
registry.dispatch(external_wp_coreData_["store"]).saveEditedEntityRecord(KIND, WIDGET_AREA_ENTITY_TYPE, widgetAreaId);
|
||||
const saveErrorAfter = registry.select(external_wp_coreData_["store"]).getLastEntitySaveError(KIND, WIDGET_AREA_ENTITY_TYPE, widgetAreaId);
|
||||
|
@ -833,9 +860,10 @@ function actions_setIsListViewOpened(isOpen) {
|
|||
* @return {Object} Action creator.
|
||||
*/
|
||||
|
||||
const actions_closeGeneralSidebar = () => ({
|
||||
const actions_closeGeneralSidebar = () => _ref10 => {
|
||||
let {
|
||||
registry
|
||||
}) => {
|
||||
} = _ref10;
|
||||
registry.dispatch(build_module["i" /* store */]).disableComplementaryArea(STORE_NAME);
|
||||
};
|
||||
/**
|
||||
|
@ -845,19 +873,23 @@ const actions_closeGeneralSidebar = () => ({
|
|||
* @param {string} widgetAreaId The id of the widget area to move the block to.
|
||||
*/
|
||||
|
||||
const actions_moveBlockToWidgetArea = (clientId, widgetAreaId) => async ({
|
||||
const actions_moveBlockToWidgetArea = (clientId, widgetAreaId) => async _ref11 => {
|
||||
let {
|
||||
dispatch,
|
||||
select,
|
||||
registry
|
||||
}) => {
|
||||
} = _ref11;
|
||||
const sourceRootClientId = registry.select(external_wp_blockEditor_["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.
|
||||
|
||||
const widgetAreas = registry.select(external_wp_blockEditor_["store"]).getBlocks();
|
||||
const destinationWidgetAreaBlock = widgetAreas.find(({
|
||||
const destinationWidgetAreaBlock = widgetAreas.find(_ref12 => {
|
||||
let {
|
||||
attributes
|
||||
}) => attributes.id === widgetAreaId);
|
||||
} = _ref12;
|
||||
return attributes.id === widgetAreaId;
|
||||
});
|
||||
const destinationRootClientId = destinationWidgetAreaBlock.clientId; // Get the index for moving to the end of the the destination widget area.
|
||||
|
||||
const destinationInnerBlocksClientIds = registry.select(external_wp_blockEditor_["store"]).getBlockOrder(destinationRootClientId);
|
||||
|
@ -896,10 +928,11 @@ const actions_moveBlockToWidgetArea = (clientId, widgetAreaId) => async ({
|
|||
* @return {Function} An action creator.
|
||||
*/
|
||||
|
||||
const getWidgetAreas = () => async ({
|
||||
const getWidgetAreas = () => async _ref => {
|
||||
let {
|
||||
dispatch,
|
||||
registry
|
||||
}) => {
|
||||
} = _ref;
|
||||
const query = buildWidgetAreasQuery();
|
||||
const widgetAreas = await registry.resolveSelect(external_wp_coreData_["store"]).getEntityRecords(KIND, WIDGET_AREA_ENTITY_TYPE, query);
|
||||
const widgetAreaBlocks = [];
|
||||
|
@ -942,10 +975,11 @@ const getWidgetAreas = () => async ({
|
|||
* @return {Function} An action creator.
|
||||
*/
|
||||
|
||||
const getWidgets = () => async ({
|
||||
const getWidgets = () => async _ref2 => {
|
||||
let {
|
||||
dispatch,
|
||||
registry
|
||||
}) => {
|
||||
} = _ref2;
|
||||
const query = buildWidgetsQuery();
|
||||
const widgets = await registry.resolveSelect(external_wp_coreData_["store"]).getEntityRecords('root', 'widget', query);
|
||||
const groupedBySidebar = {};
|
||||
|
@ -1065,16 +1099,25 @@ const selectors_getEditedWidgetAreas = Object(external_wp_data_["createRegistryS
|
|||
}
|
||||
|
||||
if (ids) {
|
||||
widgetAreas = widgetAreas.filter(({
|
||||
widgetAreas = widgetAreas.filter(_ref => {
|
||||
let {
|
||||
id
|
||||
}) => ids.includes(id));
|
||||
} = _ref;
|
||||
return ids.includes(id);
|
||||
});
|
||||
}
|
||||
|
||||
return widgetAreas.filter(({
|
||||
return widgetAreas.filter(_ref2 => {
|
||||
let {
|
||||
id
|
||||
}) => select(external_wp_coreData_["store"]).hasEditsForEntityRecord(KIND, POST_TYPE, buildWidgetAreaPostId(id))).map(({
|
||||
} = _ref2;
|
||||
return select(external_wp_coreData_["store"]).hasEditsForEntityRecord(KIND, POST_TYPE, buildWidgetAreaPostId(id));
|
||||
}).map(_ref3 => {
|
||||
let {
|
||||
id
|
||||
}) => select(external_wp_coreData_["store"]).getEditedEntityRecord(KIND, WIDGET_AREA_ENTITY_TYPE, id));
|
||||
} = _ref3;
|
||||
return select(external_wp_coreData_["store"]).getEditedEntityRecord(KIND, WIDGET_AREA_ENTITY_TYPE, id);
|
||||
});
|
||||
});
|
||||
/**
|
||||
* Returns all blocks representing reference widgets.
|
||||
|
@ -1083,7 +1126,8 @@ const selectors_getEditedWidgetAreas = Object(external_wp_data_["createRegistryS
|
|||
* @return {Array} List of all blocks representing reference widgets
|
||||
*/
|
||||
|
||||
const getReferenceWidgetBlocks = Object(external_wp_data_["createRegistrySelector"])(select => (state, referenceWidgetName = null) => {
|
||||
const getReferenceWidgetBlocks = Object(external_wp_data_["createRegistrySelector"])(select => function (state) {
|
||||
let referenceWidgetName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
||||
const results = [];
|
||||
const widgetAreas = select(STORE_NAME).getWidgetAreas();
|
||||
|
||||
|
@ -1110,9 +1154,12 @@ const getReferenceWidgetBlocks = Object(external_wp_data_["createRegistrySelecto
|
|||
const selectors_isSavingWidgetAreas = Object(external_wp_data_["createRegistrySelector"])(select => () => {
|
||||
var _select$getWidgetArea;
|
||||
|
||||
const widgetAreasIds = (_select$getWidgetArea = select(STORE_NAME).getWidgetAreas()) === null || _select$getWidgetArea === void 0 ? void 0 : _select$getWidgetArea.map(({
|
||||
const widgetAreasIds = (_select$getWidgetArea = select(STORE_NAME).getWidgetAreas()) === null || _select$getWidgetArea === void 0 ? void 0 : _select$getWidgetArea.map(_ref4 => {
|
||||
let {
|
||||
id
|
||||
}) => id);
|
||||
} = _ref4;
|
||||
return id;
|
||||
});
|
||||
|
||||
if (!widgetAreasIds) {
|
||||
return false;
|
||||
|
@ -1434,9 +1481,10 @@ const useIsDraggingWithin = elementRef => {
|
|||
*/
|
||||
|
||||
|
||||
function WidgetAreaInnerBlocks({
|
||||
function WidgetAreaInnerBlocks(_ref) {
|
||||
let {
|
||||
id
|
||||
}) {
|
||||
} = _ref;
|
||||
const [blocks, onInput, onChange] = Object(external_wp_coreData_["useEntityBlockEditor"])('root', 'postType');
|
||||
const innerBlocksRef = Object(external_wp_element_["useRef"])();
|
||||
const isDraggingWithinInnerBlocks = use_is_dragging_within(innerBlocksRef);
|
||||
|
@ -1478,14 +1526,15 @@ function WidgetAreaInnerBlocks({
|
|||
|
||||
/** @typedef {import('@wordpress/element').RefObject} RefObject */
|
||||
|
||||
function WidgetAreaEdit({
|
||||
function WidgetAreaEdit(_ref) {
|
||||
let {
|
||||
clientId,
|
||||
className,
|
||||
attributes: {
|
||||
id,
|
||||
name
|
||||
}
|
||||
}) {
|
||||
} = _ref;
|
||||
const isOpen = Object(external_wp_data_["useSelect"])(select => select(store).getIsWidgetAreaOpen(clientId), [clientId]);
|
||||
const {
|
||||
setIsWidgetAreaOpen
|
||||
|
@ -1518,9 +1567,11 @@ function WidgetAreaEdit({
|
|||
setIsWidgetAreaOpen(clientId, !isOpen);
|
||||
},
|
||||
scrollAfterOpen: !isDragging
|
||||
}, ({
|
||||
}, _ref2 => {
|
||||
let {
|
||||
opened
|
||||
}) => // This is required to ensure LegacyWidget blocks are not
|
||||
} = _ref2;
|
||||
return (// This is required to ensure LegacyWidget blocks are not
|
||||
// unmounted when the panel is collapsed. Unmounting legacy
|
||||
// widgets may have unintended consequences (e.g. TinyMCE
|
||||
// not being properly reinitialized)
|
||||
|
@ -1533,7 +1584,9 @@ function WidgetAreaEdit({
|
|||
id: `widget-area-${id}`
|
||||
}, Object(external_wp_element_["createElement"])(WidgetAreaInnerBlocks, {
|
||||
id: id
|
||||
})))));
|
||||
})))
|
||||
);
|
||||
}));
|
||||
}
|
||||
/**
|
||||
* A React hook to determine if dragging is active.
|
||||
|
@ -1607,9 +1660,12 @@ const {
|
|||
const widget_area_settings = {
|
||||
title: Object(external_wp_i18n_["__"])('Widget Area'),
|
||||
description: Object(external_wp_i18n_["__"])('A widget area container.'),
|
||||
__experimentalLabel: ({
|
||||
__experimentalLabel: _ref => {
|
||||
let {
|
||||
name: label
|
||||
}) => label,
|
||||
} = _ref;
|
||||
return label;
|
||||
},
|
||||
edit: WidgetAreaEdit
|
||||
};
|
||||
|
||||
|
@ -1628,10 +1684,11 @@ var external_wp_plugins_ = __webpack_require__("TvNi");
|
|||
|
||||
|
||||
|
||||
function CopyButton({
|
||||
function CopyButton(_ref) {
|
||||
let {
|
||||
text,
|
||||
children
|
||||
}) {
|
||||
} = _ref;
|
||||
const ref = Object(external_wp_compose_["useCopyToClipboard"])(text);
|
||||
return Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
|
||||
variant: "secondary",
|
||||
|
@ -1892,11 +1949,12 @@ const ENABLE_EXPERIMENTAL_FSE_BLOCKS = false;
|
|||
|
||||
|
||||
|
||||
function WidgetAreasBlockEditorProvider({
|
||||
function WidgetAreasBlockEditorProvider(_ref) {
|
||||
let {
|
||||
blockEditorSettings,
|
||||
children,
|
||||
...props
|
||||
}) {
|
||||
} = _ref;
|
||||
const {
|
||||
hasUploadPermissions,
|
||||
reusableBlocks,
|
||||
|
@ -1917,15 +1975,19 @@ function WidgetAreasBlockEditorProvider({
|
|||
let mediaUploadBlockEditor;
|
||||
|
||||
if (hasUploadPermissions) {
|
||||
mediaUploadBlockEditor = ({
|
||||
mediaUploadBlockEditor = _ref2 => {
|
||||
let {
|
||||
onError,
|
||||
...argumentsObject
|
||||
}) => {
|
||||
} = _ref2;
|
||||
Object(external_wp_mediaUtils_["uploadMedia"])({
|
||||
wpAllowedMimeTypes: blockEditorSettings.allowedMimeTypes,
|
||||
onError: ({
|
||||
onError: _ref3 => {
|
||||
let {
|
||||
message
|
||||
}) => onError(message),
|
||||
} = _ref3;
|
||||
return onError(message);
|
||||
},
|
||||
...argumentsObject
|
||||
});
|
||||
};
|
||||
|
@ -1986,9 +2048,10 @@ var external_wp_dom_ = __webpack_require__("1CF3");
|
|||
*/
|
||||
|
||||
|
||||
function WidgetAreas({
|
||||
function WidgetAreas(_ref) {
|
||||
let {
|
||||
selectedWidgetAreaId
|
||||
}) {
|
||||
} = _ref;
|
||||
const widgetAreas = Object(external_wp_data_["useSelect"])(select => select(store).getWidgetAreas(), []);
|
||||
const selectedWidgetArea = Object(external_wp_element_["useMemo"])(() => selectedWidgetAreaId && (widgetAreas === null || widgetAreas === void 0 ? void 0 : widgetAreas.find(widgetArea => widgetArea.id === selectedWidgetAreaId)), [selectedWidgetAreaId, widgetAreas]);
|
||||
let description;
|
||||
|
@ -2057,11 +2120,12 @@ const WIDGET_AREAS_IDENTIFIER = 'edit-widgets/block-areas';
|
|||
|
||||
|
||||
|
||||
function ComplementaryAreaTab({
|
||||
function ComplementaryAreaTab(_ref) {
|
||||
let {
|
||||
identifier,
|
||||
label,
|
||||
isActive
|
||||
}) {
|
||||
} = _ref;
|
||||
const {
|
||||
enableComplementaryArea
|
||||
} = Object(external_wp_data_["useDispatch"])(build_module["i" /* store */]);
|
||||
|
@ -2335,10 +2399,11 @@ const textFormattingShortcuts = [{
|
|||
|
||||
|
||||
|
||||
function KeyCombination({
|
||||
function KeyCombination(_ref) {
|
||||
let {
|
||||
keyCombination,
|
||||
forceAriaLabel
|
||||
}) {
|
||||
} = _ref;
|
||||
const shortcut = keyCombination.modifier ? external_wp_keycodes_["displayShortcutList"][keyCombination.modifier](keyCombination.character) : keyCombination.character;
|
||||
const ariaLabel = keyCombination.modifier ? external_wp_keycodes_["shortcutAriaLabel"][keyCombination.modifier](keyCombination.character) : keyCombination.character;
|
||||
return Object(external_wp_element_["createElement"])("kbd", {
|
||||
|
@ -2358,12 +2423,13 @@ function KeyCombination({
|
|||
}));
|
||||
}
|
||||
|
||||
function Shortcut({
|
||||
function Shortcut(_ref2) {
|
||||
let {
|
||||
description,
|
||||
keyCombination,
|
||||
aliases = [],
|
||||
ariaLabel
|
||||
}) {
|
||||
} = _ref2;
|
||||
return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("div", {
|
||||
className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-description"
|
||||
}, description), Object(external_wp_element_["createElement"])("div", {
|
||||
|
@ -2394,9 +2460,10 @@ function Shortcut({
|
|||
|
||||
|
||||
|
||||
function DynamicShortcut({
|
||||
function DynamicShortcut(_ref) {
|
||||
let {
|
||||
name
|
||||
}) {
|
||||
} = _ref;
|
||||
const {
|
||||
keyCombination,
|
||||
description,
|
||||
|
@ -2451,9 +2518,11 @@ function DynamicShortcut({
|
|||
|
||||
|
||||
|
||||
const ShortcutList = ({
|
||||
const ShortcutList = _ref => {
|
||||
let {
|
||||
shortcuts
|
||||
}) =>
|
||||
} = _ref;
|
||||
return (
|
||||
/*
|
||||
* Disable reason: The `list` ARIA role is redundant but
|
||||
* Safari+VoiceOver won't announce the list otherwise.
|
||||
|
@ -2470,25 +2539,31 @@ Object(external_wp_element_["createElement"])("ul", {
|
|||
name: shortcut
|
||||
}) : Object(external_wp_element_["createElement"])(keyboard_shortcut_help_modal_shortcut, shortcut))))
|
||||
/* eslint-enable jsx-a11y/no-redundant-roles */
|
||||
;
|
||||
|
||||
const ShortcutSection = ({
|
||||
);
|
||||
};
|
||||
|
||||
const ShortcutSection = _ref2 => {
|
||||
let {
|
||||
title,
|
||||
shortcuts,
|
||||
className
|
||||
}) => Object(external_wp_element_["createElement"])("section", {
|
||||
} = _ref2;
|
||||
return Object(external_wp_element_["createElement"])("section", {
|
||||
className: classnames_default()('edit-widgets-keyboard-shortcut-help-modal__section', className)
|
||||
}, !!title && Object(external_wp_element_["createElement"])("h2", {
|
||||
className: "edit-widgets-keyboard-shortcut-help-modal__section-title"
|
||||
}, title), Object(external_wp_element_["createElement"])(ShortcutList, {
|
||||
shortcuts: shortcuts
|
||||
}));
|
||||
};
|
||||
|
||||
const ShortcutCategorySection = ({
|
||||
const ShortcutCategorySection = _ref3 => {
|
||||
let {
|
||||
title,
|
||||
categoryName,
|
||||
additionalShortcuts = []
|
||||
}) => {
|
||||
} = _ref3;
|
||||
const categoryShortcuts = Object(external_wp_data_["useSelect"])(select => {
|
||||
return select(external_wp_keyboardShortcuts_["store"]).getCategoryShortcuts(categoryName);
|
||||
}, [categoryName]);
|
||||
|
@ -2498,10 +2573,11 @@ const ShortcutCategorySection = ({
|
|||
});
|
||||
};
|
||||
|
||||
function KeyboardShortcutHelpModal({
|
||||
function KeyboardShortcutHelpModal(_ref4) {
|
||||
let {
|
||||
isModalActive,
|
||||
toggleModal
|
||||
}) {
|
||||
} = _ref4;
|
||||
Object(external_wp_keyboardShortcuts_["useShortcut"])('core/edit-widgets/keyboard-shortcuts', toggleModal, {
|
||||
bindGlobal: true
|
||||
});
|
||||
|
@ -2813,9 +2889,10 @@ function Notices() {
|
|||
|
||||
|
||||
|
||||
function WidgetAreasBlockEditorContent({
|
||||
function WidgetAreasBlockEditorContent(_ref) {
|
||||
let {
|
||||
blockEditorSettings
|
||||
}) {
|
||||
} = _ref;
|
||||
const hasThemeStyles = Object(external_wp_data_["useSelect"])(select => select(build_module["i" /* store */]).isFeatureActive('core/edit-widgets', 'themeStyles'), []);
|
||||
const styles = Object(external_wp_element_["useMemo"])(() => {
|
||||
return hasThemeStyles ? blockEditorSettings.styles : [];
|
||||
|
@ -3099,9 +3176,10 @@ const interfaceLabels = {
|
|||
footer: Object(external_wp_i18n_["__"])('Widgets footer')
|
||||
};
|
||||
|
||||
function Interface({
|
||||
function Interface(_ref) {
|
||||
let {
|
||||
blockEditorSettings
|
||||
}) {
|
||||
} = _ref;
|
||||
const isMobileViewport = Object(external_wp_compose_["useViewportMatch"])('medium', '<');
|
||||
const isHugeViewport = Object(external_wp_compose_["useViewportMatch"])('huge', '>=');
|
||||
const {
|
||||
|
@ -3309,10 +3387,11 @@ function WelcomeGuide() {
|
|||
});
|
||||
}
|
||||
|
||||
function WelcomeGuideImage({
|
||||
function WelcomeGuideImage(_ref) {
|
||||
let {
|
||||
nonAnimatedSrc,
|
||||
animatedSrc
|
||||
}) {
|
||||
} = _ref;
|
||||
return Object(external_wp_element_["createElement"])("picture", {
|
||||
className: "edit-widgets-welcome-guide__image"
|
||||
}, Object(external_wp_element_["createElement"])("source", {
|
||||
|
@ -3345,10 +3424,11 @@ function WelcomeGuideImage({
|
|||
|
||||
|
||||
|
||||
function Layout({
|
||||
function Layout(_ref) {
|
||||
let {
|
||||
blockEditorSettings,
|
||||
onError
|
||||
}) {
|
||||
} = _ref;
|
||||
return Object(external_wp_element_["createElement"])(error_boundary_ErrorBoundary, {
|
||||
onError: onError
|
||||
}, Object(external_wp_element_["createElement"])(WidgetAreasBlockEditorProvider, {
|
||||
|
@ -3853,12 +3933,15 @@ var external_lodash_ = __webpack_require__("YLtl");
|
|||
* @return {Object} Updated state.
|
||||
*/
|
||||
|
||||
function singleEnableItems(state = {}, {
|
||||
function singleEnableItems() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let {
|
||||
type,
|
||||
itemType,
|
||||
scope,
|
||||
item
|
||||
}) {
|
||||
} = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
if (type !== 'SET_SINGLE_ENABLE_ITEM' || !itemType || !scope) {
|
||||
return state;
|
||||
}
|
||||
|
@ -3883,13 +3966,16 @@ function singleEnableItems(state = {}, {
|
|||
* @return {Object} Updated state.
|
||||
*/
|
||||
|
||||
function multipleEnableItems(state = {}, {
|
||||
function multipleEnableItems() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let {
|
||||
type,
|
||||
itemType,
|
||||
scope,
|
||||
item,
|
||||
isEnable
|
||||
}) {
|
||||
} = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
if (type !== 'SET_MULTIPLE_ENABLE_ITEM' || !itemType || !scope || !item || Object(external_lodash_["get"])(state, [itemType, scope, item]) === isEnable) {
|
||||
return state;
|
||||
}
|
||||
|
@ -3917,7 +4003,10 @@ function multipleEnableItems(state = {}, {
|
|||
*/
|
||||
|
||||
const preferenceDefaults = Object(external_wp_data_["combineReducers"])({
|
||||
features(state = {}, action) {
|
||||
features() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
if (action.type === 'SET_FEATURE_DEFAULTS') {
|
||||
const {
|
||||
scope,
|
||||
|
@ -3944,7 +4033,10 @@ const preferenceDefaults = Object(external_wp_data_["combineReducers"])({
|
|||
*/
|
||||
|
||||
const preferences = Object(external_wp_data_["combineReducers"])({
|
||||
features(state = {}, action) {
|
||||
features() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
if (action.type === 'SET_FEATURE_VALUE') {
|
||||
const {
|
||||
scope,
|
||||
|
@ -4067,10 +4159,11 @@ function actions_unpinItem(scope, itemId) {
|
|||
*/
|
||||
|
||||
function actions_toggleFeature(scope, featureName) {
|
||||
return function ({
|
||||
return function (_ref) {
|
||||
let {
|
||||
select,
|
||||
dispatch
|
||||
}) {
|
||||
} = _ref;
|
||||
const currentValue = select.isFeatureActive(scope, featureName);
|
||||
dispatch.setFeatureValue(scope, featureName, !currentValue);
|
||||
};
|
||||
|
@ -4271,14 +4364,15 @@ var external_wp_plugins_ = __webpack_require__("TvNi");
|
|||
|
||||
|
||||
|
||||
function ComplementaryAreaToggle({
|
||||
function ComplementaryAreaToggle(_ref) {
|
||||
let {
|
||||
as = external_wp_components_["Button"],
|
||||
scope,
|
||||
identifier,
|
||||
icon,
|
||||
selectedIcon,
|
||||
...props
|
||||
}) {
|
||||
} = _ref;
|
||||
const ComponentToUse = as;
|
||||
const isSelected = Object(external_wp_data_["useSelect"])(select => select(store).getActiveComplementaryArea(scope) === identifier, [identifier]);
|
||||
const {
|
||||
|
@ -4318,12 +4412,13 @@ function ComplementaryAreaToggle({
|
|||
|
||||
|
||||
|
||||
const ComplementaryAreaHeader = ({
|
||||
const ComplementaryAreaHeader = _ref => {
|
||||
let {
|
||||
smallScreenTitle,
|
||||
children,
|
||||
className,
|
||||
toggleButtonProps
|
||||
}) => {
|
||||
} = _ref;
|
||||
const toggleButton = Object(external_wp_element_["createElement"])(complementary_area_toggle, Object(esm_extends["a" /* default */])({
|
||||
icon: close_small["a" /* default */]
|
||||
}, toggleButtonProps));
|
||||
|
@ -4354,13 +4449,14 @@ const ComplementaryAreaHeader = ({
|
|||
|
||||
|
||||
|
||||
function ActionItemSlot({
|
||||
function ActionItemSlot(_ref) {
|
||||
let {
|
||||
name,
|
||||
as: Component = external_wp_components_["ButtonGroup"],
|
||||
fillProps = {},
|
||||
bubblesVirtually,
|
||||
...props
|
||||
}) {
|
||||
} = _ref;
|
||||
return Object(external_wp_element_["createElement"])(external_wp_components_["Slot"], {
|
||||
name: name,
|
||||
bubblesVirtually: bubblesVirtually,
|
||||
|
@ -4376,12 +4472,14 @@ function ActionItemSlot({
|
|||
|
||||
|
||||
const initializedByPlugins = [];
|
||||
external_wp_element_["Children"].forEach(fills, ({
|
||||
external_wp_element_["Children"].forEach(fills, _ref2 => {
|
||||
let {
|
||||
props: {
|
||||
__unstableExplicitMenuItem,
|
||||
__unstableTarget
|
||||
}
|
||||
}) => {
|
||||
} = _ref2;
|
||||
|
||||
if (__unstableTarget && __unstableExplicitMenuItem) {
|
||||
initializedByPlugins.push(__unstableTarget);
|
||||
}
|
||||
|
@ -4397,21 +4495,23 @@ function ActionItemSlot({
|
|||
});
|
||||
}
|
||||
|
||||
function ActionItem({
|
||||
function ActionItem(_ref3) {
|
||||
let {
|
||||
name,
|
||||
as: Component = external_wp_components_["Button"],
|
||||
onClick,
|
||||
...props
|
||||
}) {
|
||||
} = _ref3;
|
||||
return Object(external_wp_element_["createElement"])(external_wp_components_["Fill"], {
|
||||
name: name
|
||||
}, ({
|
||||
}, _ref4 => {
|
||||
let {
|
||||
onClick: fpOnClick
|
||||
}) => {
|
||||
} = _ref4;
|
||||
return Object(external_wp_element_["createElement"])(Component, Object(esm_extends["a" /* default */])({
|
||||
onClick: onClick || fpOnClick ? (...args) => {
|
||||
(onClick || external_lodash_["noop"])(...args);
|
||||
(fpOnClick || external_lodash_["noop"])(...args);
|
||||
onClick: onClick || fpOnClick ? function () {
|
||||
(onClick || external_lodash_["noop"])(...arguments);
|
||||
(fpOnClick || external_lodash_["noop"])(...arguments);
|
||||
} : undefined
|
||||
}, props));
|
||||
});
|
||||
|
@ -4446,12 +4546,13 @@ const PluginsMenuItem = props => // Menu item is marked with unstable prop for b
|
|||
// @see https://github.com/WordPress/gutenberg/issues/14457
|
||||
Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], Object(external_lodash_["omit"])(props, ['__unstableExplicitMenuItem', '__unstableTarget']));
|
||||
|
||||
function ComplementaryAreaMoreMenuItem({
|
||||
function ComplementaryAreaMoreMenuItem(_ref) {
|
||||
let {
|
||||
scope,
|
||||
target,
|
||||
__unstableExplicitMenuItem,
|
||||
...props
|
||||
}) {
|
||||
} = _ref;
|
||||
return Object(external_wp_element_["createElement"])(complementary_area_toggle, Object(esm_extends["a" /* default */])({
|
||||
as: toggleProps => {
|
||||
return Object(external_wp_element_["createElement"])(action_item, Object(esm_extends["a" /* default */])({
|
||||
|
@ -4483,20 +4584,22 @@ function ComplementaryAreaMoreMenuItem({
|
|||
|
||||
|
||||
|
||||
function PinnedItems({
|
||||
function PinnedItems(_ref) {
|
||||
let {
|
||||
scope,
|
||||
...props
|
||||
}) {
|
||||
} = _ref;
|
||||
return Object(external_wp_element_["createElement"])(external_wp_components_["Fill"], Object(esm_extends["a" /* default */])({
|
||||
name: `PinnedItems/${scope}`
|
||||
}, props));
|
||||
}
|
||||
|
||||
function PinnedItemsSlot({
|
||||
function PinnedItemsSlot(_ref2) {
|
||||
let {
|
||||
scope,
|
||||
className,
|
||||
...props
|
||||
}) {
|
||||
} = _ref2;
|
||||
return Object(external_wp_element_["createElement"])(external_wp_components_["Slot"], Object(esm_extends["a" /* default */])({
|
||||
name: `PinnedItems/${scope}`
|
||||
}, props), fills => !Object(external_lodash_["isEmpty"])(fills) && Object(external_wp_element_["createElement"])("div", {
|
||||
|
@ -4536,20 +4639,22 @@ PinnedItems.Slot = PinnedItemsSlot;
|
|||
|
||||
|
||||
|
||||
function ComplementaryAreaSlot({
|
||||
function ComplementaryAreaSlot(_ref) {
|
||||
let {
|
||||
scope,
|
||||
...props
|
||||
}) {
|
||||
} = _ref;
|
||||
return Object(external_wp_element_["createElement"])(external_wp_components_["Slot"], Object(esm_extends["a" /* default */])({
|
||||
name: `ComplementaryArea/${scope}`
|
||||
}, props));
|
||||
}
|
||||
|
||||
function ComplementaryAreaFill({
|
||||
function ComplementaryAreaFill(_ref2) {
|
||||
let {
|
||||
scope,
|
||||
children,
|
||||
className
|
||||
}) {
|
||||
} = _ref2;
|
||||
return Object(external_wp_element_["createElement"])(external_wp_components_["Fill"], {
|
||||
name: `ComplementaryArea/${scope}`
|
||||
}, Object(external_wp_element_["createElement"])("div", {
|
||||
|
@ -4590,7 +4695,8 @@ function useAdjustComplementaryListener(scope, identifier, activeArea, isActive,
|
|||
}, [isActive, isSmall, scope, identifier, activeArea]);
|
||||
}
|
||||
|
||||
function ComplementaryArea({
|
||||
function ComplementaryArea(_ref3) {
|
||||
let {
|
||||
children,
|
||||
className,
|
||||
closeLabel = Object(external_wp_i18n_["__"])('Close plugin'),
|
||||
|
@ -4607,7 +4713,7 @@ function ComplementaryArea({
|
|||
toggleShortcut,
|
||||
isActiveByDefault,
|
||||
showIconLabels = false
|
||||
}) {
|
||||
} = _ref3;
|
||||
const {
|
||||
isActive,
|
||||
isPinned,
|
||||
|
@ -4693,9 +4799,10 @@ ComplementaryAreaWrapped.Slot = ComplementaryAreaSlot;
|
|||
*/
|
||||
|
||||
|
||||
const FullscreenMode = ({
|
||||
const FullscreenMode = _ref => {
|
||||
let {
|
||||
isActive
|
||||
}) => {
|
||||
} = _ref;
|
||||
Object(external_wp_element_["useEffect"])(() => {
|
||||
let isSticky = false; // `is-fullscreen-mode` is set in PHP as a body class by Gutenberg, and this causes
|
||||
// `sticky-menu` to be applied by WordPress and prevents the admin menu being scrolled
|
||||
|
@ -4770,7 +4877,8 @@ function useHTMLClass(className) {
|
|||
}, [className]);
|
||||
}
|
||||
|
||||
function InterfaceSkeleton({
|
||||
function InterfaceSkeleton(_ref, ref) {
|
||||
let {
|
||||
footer,
|
||||
header,
|
||||
sidebar,
|
||||
|
@ -4782,7 +4890,7 @@ function InterfaceSkeleton({
|
|||
labels,
|
||||
className,
|
||||
shortcuts
|
||||
}, ref) {
|
||||
} = _ref;
|
||||
const navigateRegionsProps = Object(external_wp_components_["__unstableUseNavigateRegions"])(shortcuts);
|
||||
useHTMLClass('interface-interface-skeleton__html-container');
|
||||
const defaultLabels = {
|
||||
|
@ -4875,7 +4983,8 @@ var more_vertical = __webpack_require__("VKE3");
|
|||
|
||||
|
||||
|
||||
function MoreMenuDropdown({
|
||||
function MoreMenuDropdown(_ref) {
|
||||
let {
|
||||
as: DropdownComponent = external_wp_components_["DropdownMenu"],
|
||||
className,
|
||||
|
||||
|
@ -4884,7 +4993,7 @@ function MoreMenuDropdown({
|
|||
popoverProps,
|
||||
toggleProps,
|
||||
children
|
||||
}) {
|
||||
} = _ref;
|
||||
return Object(external_wp_element_["createElement"])(DropdownComponent, {
|
||||
className: classnames_default()('interface-more-menu-dropdown', className),
|
||||
icon: more_vertical["a" /* default */],
|
||||
|
@ -4920,7 +5029,8 @@ var external_wp_a11y_ = __webpack_require__("gdqT");
|
|||
*/
|
||||
|
||||
|
||||
function MoreMenuFeatureToggle({
|
||||
function MoreMenuFeatureToggle(_ref) {
|
||||
let {
|
||||
scope,
|
||||
label,
|
||||
info,
|
||||
|
@ -4928,7 +5038,7 @@ function MoreMenuFeatureToggle({
|
|||
messageDeactivated,
|
||||
shortcut,
|
||||
feature
|
||||
}) {
|
||||
} = _ref;
|
||||
const isActive = Object(external_wp_data_["useSelect"])(select => select(store).isFeatureActive(scope, feature), [feature]);
|
||||
const {
|
||||
toggleFeature
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -680,7 +680,11 @@ var external_lodash_ = __webpack_require__("YLtl");
|
|||
* @return {Array} The concatenated value.
|
||||
*/
|
||||
|
||||
function concatChildren(...childrenArguments) {
|
||||
function concatChildren() {
|
||||
for (var _len = arguments.length, childrenArguments = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
childrenArguments[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
return childrenArguments.reduce((accumulator, children, i) => {
|
||||
external_React_["Children"].forEach(children, (child, j) => {
|
||||
if (child && 'string' !== typeof child) {
|
||||
|
@ -848,10 +852,11 @@ var external_wp_escapeHtml_ = __webpack_require__("Vx3V");
|
|||
* @return {JSX.Element} Dangerously-rendering component.
|
||||
*/
|
||||
|
||||
function RawHTML({
|
||||
function RawHTML(_ref) {
|
||||
let {
|
||||
children,
|
||||
...props
|
||||
}) {
|
||||
} = _ref;
|
||||
let rawHtml = ''; // Cast children as an array, and concatenate each element if it is a string.
|
||||
|
||||
external_React_["Children"].toArray(children).forEach(child => {
|
||||
|
@ -1110,7 +1115,9 @@ function getNormalStylePropertyValue(property, value) {
|
|||
*/
|
||||
|
||||
|
||||
function renderElement(element, context, legacyContext = {}) {
|
||||
function renderElement(element, context) {
|
||||
let legacyContext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
||||
|
||||
if (null === element || undefined === element || false === element) {
|
||||
return '';
|
||||
}
|
||||
|
@ -1188,7 +1195,8 @@ function renderElement(element, context, legacyContext = {}) {
|
|||
* @return {string} Serialized element.
|
||||
*/
|
||||
|
||||
function renderNativeComponent(type, props, context, legacyContext = {}) {
|
||||
function renderNativeComponent(type, props, context) {
|
||||
let legacyContext = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
||||
let content = '';
|
||||
|
||||
if (type === 'textarea' && props.hasOwnProperty('value')) {
|
||||
|
@ -1229,7 +1237,8 @@ function renderNativeComponent(type, props, context, legacyContext = {}) {
|
|||
* @return {string} Serialized element
|
||||
*/
|
||||
|
||||
function renderComponent(Component, props, context, legacyContext = {}) {
|
||||
function renderComponent(Component, props, context) {
|
||||
let legacyContext = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
||||
const instance = new
|
||||
/** @type {import('react').ComponentClass} */
|
||||
Component(props, legacyContext);
|
||||
|
@ -1257,7 +1266,8 @@ function renderComponent(Component, props, context, legacyContext = {}) {
|
|||
* @return {string} Serialized children.
|
||||
*/
|
||||
|
||||
function renderChildren(children, context, legacyContext = {}) {
|
||||
function renderChildren(children, context) {
|
||||
let legacyContext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
||||
let result = '';
|
||||
children = Object(external_lodash_["castArray"])(children);
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -283,11 +283,12 @@ const keyboardReturn = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["c
|
|||
* @return {JSX.Element} Icon component
|
||||
*/
|
||||
|
||||
function Icon({
|
||||
function Icon(_ref) {
|
||||
let {
|
||||
icon,
|
||||
size = 24,
|
||||
...props
|
||||
}) {
|
||||
} = _ref;
|
||||
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["cloneElement"])(icon, {
|
||||
width: size,
|
||||
height: size,
|
||||
|
@ -403,12 +404,14 @@ const bold = {
|
|||
tagName: 'strong',
|
||||
className: null,
|
||||
|
||||
edit({
|
||||
edit(_ref) {
|
||||
let {
|
||||
isActive,
|
||||
value,
|
||||
onChange,
|
||||
onFocus
|
||||
}) {
|
||||
} = _ref;
|
||||
|
||||
function onToggle() {
|
||||
onChange(Object(external_wp_richText_["toggleFormat"])(value, {
|
||||
type: bold_name,
|
||||
|
@ -500,12 +503,14 @@ const code_code = {
|
|||
return value;
|
||||
},
|
||||
|
||||
edit({
|
||||
edit(_ref) {
|
||||
let {
|
||||
value,
|
||||
onChange,
|
||||
onFocus,
|
||||
isActive
|
||||
}) {
|
||||
} = _ref;
|
||||
|
||||
function onClick() {
|
||||
onChange(Object(external_wp_richText_["toggleFormat"])(value, {
|
||||
type: code_name,
|
||||
|
@ -564,12 +569,13 @@ const image_image = {
|
|||
edit: Edit
|
||||
};
|
||||
|
||||
function InlineUI({
|
||||
function InlineUI(_ref) {
|
||||
let {
|
||||
value,
|
||||
onChange,
|
||||
activeObjectAttributes,
|
||||
contentRef
|
||||
}) {
|
||||
} = _ref;
|
||||
const {
|
||||
style
|
||||
} = activeObjectAttributes;
|
||||
|
@ -613,14 +619,15 @@ function InlineUI({
|
|||
})));
|
||||
}
|
||||
|
||||
function Edit({
|
||||
function Edit(_ref2) {
|
||||
let {
|
||||
value,
|
||||
onChange,
|
||||
onFocus,
|
||||
isObjectActive,
|
||||
activeObjectAttributes,
|
||||
contentRef
|
||||
}) {
|
||||
} = _ref2;
|
||||
const [isModalOpen, setIsModalOpen] = Object(external_wp_element_["useState"])(false);
|
||||
|
||||
function openModal() {
|
||||
|
@ -643,12 +650,13 @@ function Edit({
|
|||
isActive: isObjectActive
|
||||
}), isModalOpen && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["MediaUpload"], {
|
||||
allowedTypes: ALLOWED_MEDIA_TYPES,
|
||||
onSelect: ({
|
||||
onSelect: _ref3 => {
|
||||
let {
|
||||
id,
|
||||
url,
|
||||
alt,
|
||||
width: imgWidth
|
||||
}) => {
|
||||
} = _ref3;
|
||||
closeModal();
|
||||
onChange(Object(external_wp_richText_["insertObject"])(value, {
|
||||
type: image_name,
|
||||
|
@ -662,9 +670,10 @@ function Edit({
|
|||
onFocus();
|
||||
},
|
||||
onClose: closeModal,
|
||||
render: ({
|
||||
render: _ref4 => {
|
||||
let {
|
||||
open
|
||||
}) => {
|
||||
} = _ref4;
|
||||
open();
|
||||
return null;
|
||||
}
|
||||
|
@ -711,12 +720,14 @@ const italic = {
|
|||
tagName: 'em',
|
||||
className: null,
|
||||
|
||||
edit({
|
||||
edit(_ref) {
|
||||
let {
|
||||
isActive,
|
||||
value,
|
||||
onChange,
|
||||
onFocus
|
||||
}) {
|
||||
} = _ref;
|
||||
|
||||
function onToggle() {
|
||||
onChange(Object(external_wp_richText_["toggleFormat"])(value, {
|
||||
type: italic_name,
|
||||
|
@ -859,12 +870,13 @@ function isValidHref(href) {
|
|||
* @return {Object} The final format object.
|
||||
*/
|
||||
|
||||
function createLinkFormat({
|
||||
function createLinkFormat(_ref) {
|
||||
let {
|
||||
url,
|
||||
type,
|
||||
id,
|
||||
opensInNewWindow
|
||||
}) {
|
||||
} = _ref;
|
||||
const format = {
|
||||
type: 'core/link',
|
||||
attributes: {
|
||||
|
@ -896,7 +908,9 @@ function createLinkFormat({
|
|||
|
||||
/* eslint-enable jsdoc/no-undefined-types */
|
||||
|
||||
function getFormatBoundary(value, format, startIndex = value.start, endIndex = value.end) {
|
||||
function getFormatBoundary(value, format) {
|
||||
let startIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : value.start;
|
||||
let endIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : value.end;
|
||||
const EMPTY_BOUNDARIES = {
|
||||
start: null,
|
||||
end: null
|
||||
|
@ -1046,7 +1060,8 @@ function useLinkInstanceKey(instance) {
|
|||
|
||||
|
||||
|
||||
function InlineLinkUI({
|
||||
function InlineLinkUI(_ref) {
|
||||
let {
|
||||
isActive,
|
||||
activeAttributes,
|
||||
addingLink,
|
||||
|
@ -1055,7 +1070,7 @@ function InlineLinkUI({
|
|||
speak,
|
||||
stopAddingLink,
|
||||
contentRef
|
||||
}) {
|
||||
} = _ref;
|
||||
const richLinkTextValue = getRichTextValueFromSelection(value, isActive); // Get the text content minus any HTML tags.
|
||||
|
||||
const richTextText = richLinkTextValue.text;
|
||||
|
@ -1283,14 +1298,15 @@ const link_name = 'core/link';
|
|||
|
||||
const link_title = Object(external_wp_i18n_["__"])('Link');
|
||||
|
||||
function link_Edit({
|
||||
function link_Edit(_ref) {
|
||||
let {
|
||||
isActive,
|
||||
activeAttributes,
|
||||
value,
|
||||
onChange,
|
||||
onFocus,
|
||||
contentRef
|
||||
}) {
|
||||
} = _ref;
|
||||
const [addingLink, setAddingLink] = Object(external_wp_element_["useState"])(false);
|
||||
|
||||
function addLink() {
|
||||
|
@ -1372,10 +1388,12 @@ const link_link = {
|
|||
target: 'target'
|
||||
},
|
||||
|
||||
__unstablePasteRule(value, {
|
||||
__unstablePasteRule(value, _ref2) {
|
||||
let {
|
||||
html,
|
||||
plainText
|
||||
}) {
|
||||
} = _ref2;
|
||||
|
||||
if (Object(external_wp_richText_["isCollapsed"])(value)) {
|
||||
return value;
|
||||
}
|
||||
|
@ -1422,12 +1440,14 @@ const strikethrough = {
|
|||
tagName: 's',
|
||||
className: null,
|
||||
|
||||
edit({
|
||||
edit(_ref) {
|
||||
let {
|
||||
isActive,
|
||||
value,
|
||||
onChange,
|
||||
onFocus
|
||||
}) {
|
||||
} = _ref;
|
||||
|
||||
function onClick() {
|
||||
onChange(Object(external_wp_richText_["toggleFormat"])(value, {
|
||||
type: strikethrough_name,
|
||||
|
@ -1469,10 +1489,12 @@ const underline = {
|
|||
style: 'style'
|
||||
},
|
||||
|
||||
edit({
|
||||
edit(_ref) {
|
||||
let {
|
||||
value,
|
||||
onChange
|
||||
}) {
|
||||
} = _ref;
|
||||
|
||||
const onToggle = () => {
|
||||
onChange(Object(external_wp_richText_["toggleFormat"])(value, {
|
||||
type: underline_name,
|
||||
|
@ -1536,7 +1558,8 @@ const textColor = Object(external_wp_element_["createElement"])(external_wp_prim
|
|||
|
||||
|
||||
|
||||
function parseCSS(css = '') {
|
||||
function parseCSS() {
|
||||
let css = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
||||
return css.split(';').reduce((accumulator, rule) => {
|
||||
if (rule) {
|
||||
const [property, value] = rule.split(':');
|
||||
|
@ -1548,7 +1571,9 @@ function parseCSS(css = '') {
|
|||
}, {});
|
||||
}
|
||||
|
||||
function parseClassName(className = '', colorSettings) {
|
||||
function parseClassName() {
|
||||
let className = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
||||
let colorSettings = arguments.length > 1 ? arguments[1] : undefined;
|
||||
return className.split(' ').reduce((accumulator, name) => {
|
||||
const match = name.match(/^has-([^-]+)-color$/);
|
||||
|
||||
|
@ -1615,12 +1640,13 @@ function setColors(value, name, colorSettings, colors) {
|
|||
});
|
||||
}
|
||||
|
||||
function ColorPicker({
|
||||
function ColorPicker(_ref) {
|
||||
let {
|
||||
name,
|
||||
property,
|
||||
value,
|
||||
onChange
|
||||
}) {
|
||||
} = _ref;
|
||||
const colors = Object(external_wp_data_["useSelect"])(select => {
|
||||
const {
|
||||
getSettings
|
||||
|
@ -1639,13 +1665,15 @@ function ColorPicker({
|
|||
});
|
||||
}
|
||||
|
||||
function InlineColorUI({
|
||||
function InlineColorUI(_ref2) {
|
||||
let {
|
||||
name,
|
||||
value,
|
||||
onChange,
|
||||
onClose,
|
||||
contentRef
|
||||
}) {
|
||||
} = _ref2;
|
||||
|
||||
/*
|
||||
As you change the text color by typing a HEX value into a field,
|
||||
the return value of document.getSelection jumps to the field you're editing,
|
||||
|
@ -1722,10 +1750,12 @@ function getComputedStyleProperty(element, property) {
|
|||
return value;
|
||||
}
|
||||
|
||||
function fillComputedColors(element, {
|
||||
function fillComputedColors(element, _ref) {
|
||||
let {
|
||||
color,
|
||||
backgroundColor
|
||||
}) {
|
||||
} = _ref;
|
||||
|
||||
if (!color && !backgroundColor) {
|
||||
return;
|
||||
}
|
||||
|
@ -1736,13 +1766,14 @@ function fillComputedColors(element, {
|
|||
};
|
||||
}
|
||||
|
||||
function TextColorEdit({
|
||||
function TextColorEdit(_ref2) {
|
||||
let {
|
||||
value,
|
||||
onChange,
|
||||
isActive,
|
||||
activeAttributes,
|
||||
contentRef
|
||||
}) {
|
||||
} = _ref2;
|
||||
const allowCustomControl = Object(external_wp_blockEditor_["useSetting"])('color.custom');
|
||||
const colors = Object(external_wp_blockEditor_["useSetting"])('color.palette') || EMPTY_ARRAY;
|
||||
const [isAddingColor, setIsAddingColor] = Object(external_wp_element_["useState"])(false);
|
||||
|
@ -1843,12 +1874,14 @@ const subscript_subscript = {
|
|||
tagName: 'sub',
|
||||
className: null,
|
||||
|
||||
edit({
|
||||
edit(_ref) {
|
||||
let {
|
||||
isActive,
|
||||
value,
|
||||
onChange,
|
||||
onFocus
|
||||
}) {
|
||||
} = _ref;
|
||||
|
||||
function onToggle() {
|
||||
onChange(Object(external_wp_richText_["toggleFormat"])(value, {
|
||||
type: subscript_name,
|
||||
|
@ -1907,12 +1940,14 @@ const superscript_superscript = {
|
|||
tagName: 'sup',
|
||||
className: null,
|
||||
|
||||
edit({
|
||||
edit(_ref) {
|
||||
let {
|
||||
isActive,
|
||||
value,
|
||||
onChange,
|
||||
onFocus
|
||||
}) {
|
||||
} = _ref;
|
||||
|
||||
function onToggle() {
|
||||
onChange(Object(external_wp_richText_["toggleFormat"])(value, {
|
||||
type: superscript_name,
|
||||
|
@ -1959,12 +1994,14 @@ const keyboard = {
|
|||
tagName: 'kbd',
|
||||
className: null,
|
||||
|
||||
edit({
|
||||
edit(_ref) {
|
||||
let {
|
||||
isActive,
|
||||
value,
|
||||
onChange,
|
||||
onFocus
|
||||
}) {
|
||||
} = _ref;
|
||||
|
||||
function onToggle() {
|
||||
onChange(Object(external_wp_richText_["toggleFormat"])(value, {
|
||||
type: keyboard_name,
|
||||
|
@ -2015,10 +2052,13 @@ const keyboard = {
|
|||
*/
|
||||
|
||||
|
||||
default_formats.forEach(({
|
||||
default_formats.forEach(_ref => {
|
||||
let {
|
||||
name,
|
||||
...settings
|
||||
}) => Object(external_wp_richText_["registerFormatType"])(name, settings));
|
||||
} = _ref;
|
||||
return Object(external_wp_richText_["registerFormatType"])(name, settings);
|
||||
});
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -204,7 +204,8 @@ function validateHookName(hookName) {
|
|||
*/
|
||||
|
||||
function createAddHook(hooks, storeKey) {
|
||||
return function addHook(hookName, namespace, callback, priority = 10) {
|
||||
return function addHook(hookName, namespace, callback) {
|
||||
let priority = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 10;
|
||||
const hooksStore = hooks[storeKey];
|
||||
|
||||
if (!build_module_validateHookName(hookName)) {
|
||||
|
@ -311,7 +312,8 @@ function createAddHook(hooks, storeKey) {
|
|||
* @return {RemoveHook} Function that removes hooks.
|
||||
*/
|
||||
|
||||
function createRemoveHook(hooks, storeKey, removeAll = false) {
|
||||
function createRemoveHook(hooks, storeKey) {
|
||||
let removeAll = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
||||
return function removeHook(hookName, namespace) {
|
||||
const hooksStore = hooks[storeKey];
|
||||
|
||||
|
@ -418,8 +420,9 @@ function createHasHook(hooks, storeKey) {
|
|||
*
|
||||
* @return {(hookName:string, ...args: unknown[]) => unknown} Function that runs hook callbacks.
|
||||
*/
|
||||
function createRunHook(hooks, storeKey, returnFirstArg = false) {
|
||||
return function runHooks(hookName, ...args) {
|
||||
function createRunHook(hooks, storeKey) {
|
||||
let returnFirstArg = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
||||
return function runHooks(hookName) {
|
||||
const hooksStore = hooks[storeKey];
|
||||
|
||||
if (!hooksStore[hookName]) {
|
||||
|
@ -434,6 +437,10 @@ function createRunHook(hooks, storeKey, returnFirstArg = false) {
|
|||
|
||||
if (false) {}
|
||||
|
||||
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
||||
args[_key - 1] = arguments[_key];
|
||||
}
|
||||
|
||||
if (!handlers || !handlers.length) {
|
||||
return returnFirstArg ? args[0] : undefined;
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -552,8 +552,12 @@ const logErrorOnce = memize_default()(console.error); // eslint-disable-line no-
|
|||
* @return {string} The formatted string.
|
||||
*/
|
||||
|
||||
function sprintf_sprintf(format, ...args) {
|
||||
function sprintf_sprintf(format) {
|
||||
try {
|
||||
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
||||
args[_key - 1] = arguments[_key];
|
||||
}
|
||||
|
||||
return sprintf_default.a.sprintf(format, ...args);
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
|
@ -1251,14 +1255,18 @@ const createI18n = (initialData, initialDomain, hooks) => {
|
|||
/** @type {GetLocaleData} */
|
||||
|
||||
|
||||
const getLocaleData = (domain = 'default') => tannin.data[domain];
|
||||
const getLocaleData = function () {
|
||||
let domain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default';
|
||||
return tannin.data[domain];
|
||||
};
|
||||
/**
|
||||
* @param {LocaleData} [data]
|
||||
* @param {string} [domain]
|
||||
*/
|
||||
|
||||
|
||||
const doSetLocaleData = (data, domain = 'default') => {
|
||||
const doSetLocaleData = function (data) {
|
||||
let domain = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
|
||||
tannin.data[domain] = { ...DEFAULT_LOCALE_DATA,
|
||||
...tannin.data[domain],
|
||||
...data
|
||||
|
@ -1303,7 +1311,13 @@ const createI18n = (initialData, initialDomain, hooks) => {
|
|||
*/
|
||||
|
||||
|
||||
const dcnpgettext = (domain = 'default', context, single, plural, number) => {
|
||||
const dcnpgettext = function () {
|
||||
let domain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default';
|
||||
let context = arguments.length > 1 ? arguments[1] : undefined;
|
||||
let single = arguments.length > 2 ? arguments[2] : undefined;
|
||||
let plural = arguments.length > 3 ? arguments[3] : undefined;
|
||||
let number = arguments.length > 4 ? arguments[4] : undefined;
|
||||
|
||||
if (!tannin.data[domain]) {
|
||||
// use `doSetLocaleData` to set silently, without notifying listeners
|
||||
doSetLocaleData(undefined, domain);
|
||||
|
@ -1314,7 +1328,10 @@ const createI18n = (initialData, initialDomain, hooks) => {
|
|||
/** @type {GetFilterDomain} */
|
||||
|
||||
|
||||
const getFilterDomain = (domain = 'default') => domain;
|
||||
const getFilterDomain = function () {
|
||||
let domain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default';
|
||||
return domain;
|
||||
};
|
||||
/** @type {__} */
|
||||
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -165,7 +165,10 @@ var external_lodash_ = __webpack_require__("YLtl");
|
|||
* @return {Object} Updated state.
|
||||
*/
|
||||
|
||||
function reducer(state = {}, action) {
|
||||
function reducer() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'REGISTER_SHORTCUT':
|
||||
return { ...state,
|
||||
|
@ -217,13 +220,14 @@ function reducer(state = {}, action) {
|
|||
*
|
||||
* @return {Object} action.
|
||||
*/
|
||||
function registerShortcut({
|
||||
function registerShortcut(_ref) {
|
||||
let {
|
||||
name,
|
||||
category,
|
||||
description,
|
||||
keyCombination,
|
||||
aliases
|
||||
}) {
|
||||
} = _ref;
|
||||
return {
|
||||
type: 'REGISTER_SHORTCUT',
|
||||
name,
|
||||
|
@ -331,7 +335,8 @@ function getShortcutKeyCombination(state, name) {
|
|||
* @return {string?} Shortcut representation.
|
||||
*/
|
||||
|
||||
function getShortcutRepresentation(state, name, representation = 'display') {
|
||||
function getShortcutRepresentation(state, name) {
|
||||
let representation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'display';
|
||||
const shortcut = getShortcutKeyCombination(state, name);
|
||||
return getKeyCombinationRepresentation(shortcut, representation);
|
||||
}
|
||||
|
@ -384,7 +389,13 @@ const getAllShortcutRawKeyCombinations = Object(rememo["a" /* default */])((stat
|
|||
*/
|
||||
|
||||
const getCategoryShortcuts = Object(rememo["a" /* default */])((state, categoryName) => {
|
||||
return Object.entries(state).filter(([, shortcut]) => shortcut.category === categoryName).map(([name]) => name);
|
||||
return Object.entries(state).filter(_ref => {
|
||||
let [, shortcut] = _ref;
|
||||
return shortcut.category === categoryName;
|
||||
}).map(_ref2 => {
|
||||
let [name] = _ref2;
|
||||
return name;
|
||||
});
|
||||
}, state => [state]);
|
||||
|
||||
// CONCATENATED MODULE: ./node_modules/@wordpress/keyboard-shortcuts/build-module/store/index.js
|
||||
|
@ -451,10 +462,11 @@ function useShortcutEventMatch() {
|
|||
*/
|
||||
|
||||
function isMatch(name, event) {
|
||||
return getAllShortcutKeyCombinations(name).some(({
|
||||
return getAllShortcutKeyCombinations(name).some(_ref => {
|
||||
let {
|
||||
modifier,
|
||||
character
|
||||
}) => {
|
||||
} = _ref;
|
||||
return external_wp_keycodes_["isKeyboardEvent"][modifier](event, character);
|
||||
});
|
||||
}
|
||||
|
@ -489,9 +501,10 @@ const context = Object(external_wp_element_["createContext"])();
|
|||
* @param {boolean} options.isDisabled Whether to disable to shortut.
|
||||
*/
|
||||
|
||||
function useShortcut(name, callback, {
|
||||
function useShortcut(name, callback) {
|
||||
let {
|
||||
isDisabled
|
||||
} = {}) {
|
||||
} = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
||||
const shortcuts = Object(external_wp_element_["useContext"])(context);
|
||||
const isMatch = useShortcutEventMatch();
|
||||
const callbackRef = Object(external_wp_element_["useRef"])();
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -155,7 +155,9 @@ var external_wp_i18n_ = __webpack_require__("l3Sj");
|
|||
* @return {boolean} True if MacOS; false otherwise.
|
||||
*/
|
||||
|
||||
function isAppleOS(_window = null) {
|
||||
function isAppleOS() {
|
||||
let _window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
||||
|
||||
if (!_window) {
|
||||
if (typeof window === 'undefined') {
|
||||
return false;
|
||||
|
@ -356,7 +358,9 @@ const modifiers = {
|
|||
const rawShortcut = Object(external_lodash_["mapValues"])(modifiers, modifier => {
|
||||
return (
|
||||
/** @type {WPKeyHandler<string>} */
|
||||
(character, _isApple = isAppleOS) => {
|
||||
function (character) {
|
||||
let _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isAppleOS;
|
||||
|
||||
return [...modifier(_isApple), character.toLowerCase()].join('+');
|
||||
}
|
||||
);
|
||||
|
@ -378,7 +382,9 @@ const rawShortcut = Object(external_lodash_["mapValues"])(modifiers, modifier =>
|
|||
const displayShortcutList = Object(external_lodash_["mapValues"])(modifiers, modifier => {
|
||||
return (
|
||||
/** @type {WPKeyHandler<string[]>} */
|
||||
(character, _isApple = isAppleOS) => {
|
||||
function (character) {
|
||||
let _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isAppleOS;
|
||||
|
||||
const isApple = _isApple();
|
||||
|
||||
const replacementKeyMap = {
|
||||
|
@ -421,7 +427,11 @@ const displayShortcutList = Object(external_lodash_["mapValues"])(modifiers, mod
|
|||
const displayShortcut = Object(external_lodash_["mapValues"])(displayShortcutList, shortcutList => {
|
||||
return (
|
||||
/** @type {WPKeyHandler<string>} */
|
||||
(character, _isApple = isAppleOS) => shortcutList(character, _isApple).join('')
|
||||
function (character) {
|
||||
let _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isAppleOS;
|
||||
|
||||
return shortcutList(character, _isApple).join('');
|
||||
}
|
||||
);
|
||||
});
|
||||
/**
|
||||
|
@ -442,7 +452,9 @@ const displayShortcut = Object(external_lodash_["mapValues"])(displayShortcutLis
|
|||
const shortcutAriaLabel = Object(external_lodash_["mapValues"])(modifiers, modifier => {
|
||||
return (
|
||||
/** @type {WPKeyHandler<string>} */
|
||||
(character, _isApple = isAppleOS) => {
|
||||
function (character) {
|
||||
let _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isAppleOS;
|
||||
|
||||
const isApple = _isApple();
|
||||
|
||||
const replacementKeyMap = {
|
||||
|
@ -500,7 +512,9 @@ function getEventModifiers(event) {
|
|||
const isKeyboardEvent = Object(external_lodash_["mapValues"])(modifiers, getModifiers => {
|
||||
return (
|
||||
/** @type {WPEventKeyHandler} */
|
||||
(event, character, _isApple = isAppleOS) => {
|
||||
function (event, character) {
|
||||
let _isApple = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : isAppleOS;
|
||||
|
||||
const mods = getModifiers(_isApple);
|
||||
const eventMods = getEventModifiers(event);
|
||||
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
/*! This file is auto-generated */
|
||||
this.wp=this.wp||{},this.wp.keycodes=function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s="z7pY")}({YLtl:function(t,n){t.exports=window.lodash},l3Sj:function(t,n){t.exports=window.wp.i18n},z7pY:function(t,n,e){"use strict";e.r(n),e.d(n,"BACKSPACE",(function(){return i})),e.d(n,"TAB",(function(){return c})),e.d(n,"ENTER",(function(){return f})),e.d(n,"ESCAPE",(function(){return d})),e.d(n,"SPACE",(function(){return a})),e.d(n,"PAGEUP",(function(){return l})),e.d(n,"PAGEDOWN",(function(){return s})),e.d(n,"END",(function(){return p})),e.d(n,"HOME",(function(){return b})),e.d(n,"LEFT",(function(){return O})),e.d(n,"UP",(function(){return j})),e.d(n,"RIGHT",(function(){return y})),e.d(n,"DOWN",(function(){return m})),e.d(n,"DELETE",(function(){return h})),e.d(n,"F10",(function(){return S})),e.d(n,"ALT",(function(){return w})),e.d(n,"CTRL",(function(){return C})),e.d(n,"COMMAND",(function(){return E})),e.d(n,"SHIFT",(function(){return P})),e.d(n,"ZERO",(function(){return A})),e.d(n,"modifiers",(function(){return g})),e.d(n,"rawShortcut",(function(){return L})),e.d(n,"displayShortcutList",(function(){return _})),e.d(n,"displayShortcut",(function(){return v})),e.d(n,"shortcutAriaLabel",(function(){return T})),e.d(n,"isKeyboardEvent",(function(){return x}));var r=e("YLtl"),o=e("l3Sj");function u(t=null){if(!t){if("undefined"==typeof window)return!1;t=window}const{platform:n}=t.navigator;return-1!==n.indexOf("Mac")||Object(r.includes)(["iPad","iPhone"],n)}const i=8,c=9,f=13,d=27,a=32,l=33,s=34,p=35,b=36,O=37,j=38,y=39,m=40,h=46,S=121,w="alt",C="ctrl",E="meta",P="shift",A=48,g={primary:t=>t()?[E]:[C],primaryShift:t=>t()?[P,E]:[C,P],primaryAlt:t=>t()?[w,E]:[C,w],secondary:t=>t()?[P,w,E]:[C,P,w],access:t=>t()?[C,w]:[P,w],ctrl:()=>[C],alt:()=>[w],ctrlShift:()=>[C,P],shift:()=>[P],shiftAlt:()=>[P,w],undefined:()=>[]},L=Object(r.mapValues)(g,t=>(n,e=u)=>[...t(e),n.toLowerCase()].join("+")),_=Object(r.mapValues)(g,t=>(n,e=u)=>{const o=e(),i={[w]:o?"⌥":"Alt",[C]:o?"⌃":"Ctrl",[E]:"⌘",[P]:o?"⇧":"Shift"};return[...t(e).reduce((t,n)=>{const e=Object(r.get)(i,n,n);return o?[...t,e]:[...t,e,"+"]},[]),Object(r.capitalize)(n)]}),v=Object(r.mapValues)(_,t=>(n,e=u)=>t(n,e).join("")),T=Object(r.mapValues)(g,t=>(n,e=u)=>{const i=e(),c={[P]:"Shift",[E]:i?"Command":"Control",[C]:"Control",[w]:i?"Option":"Alt",",":Object(o.__)("Comma"),".":Object(o.__)("Period"),"`":Object(o.__)("Backtick")};return[...t(e),n].map(t=>Object(r.capitalize)(Object(r.get)(c,t,t))).join(i?" ":" + ")});const x=Object(r.mapValues)(g,t=>(n,e,o=u)=>{const i=t(o),c=function(t){return[w,C,E,P].filter(n=>t[n+"Key"])}(n);if(Object(r.xor)(i,c).length)return!1;let f=n.key.toLowerCase();return e?(n.altKey&&1===e.length&&(f=String.fromCharCode(n.keyCode).toLowerCase()),"del"===e&&(e="delete"),f===e.toLowerCase()):Object(r.includes)(i,f)})}});
|
||||
this.wp=this.wp||{},this.wp.keycodes=function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s="z7pY")}({YLtl:function(t,n){t.exports=window.lodash},l3Sj:function(t,n){t.exports=window.wp.i18n},z7pY:function(t,n,e){"use strict";e.r(n),e.d(n,"BACKSPACE",(function(){return i})),e.d(n,"TAB",(function(){return c})),e.d(n,"ENTER",(function(){return f})),e.d(n,"ESCAPE",(function(){return l})),e.d(n,"SPACE",(function(){return d})),e.d(n,"PAGEUP",(function(){return a})),e.d(n,"PAGEDOWN",(function(){return s})),e.d(n,"END",(function(){return p})),e.d(n,"HOME",(function(){return b})),e.d(n,"LEFT",(function(){return O})),e.d(n,"UP",(function(){return j})),e.d(n,"RIGHT",(function(){return h})),e.d(n,"DOWN",(function(){return y})),e.d(n,"DELETE",(function(){return m})),e.d(n,"F10",(function(){return S})),e.d(n,"ALT",(function(){return g})),e.d(n,"CTRL",(function(){return w})),e.d(n,"COMMAND",(function(){return C})),e.d(n,"SHIFT",(function(){return v})),e.d(n,"ZERO",(function(){return E})),e.d(n,"modifiers",(function(){return P})),e.d(n,"rawShortcut",(function(){return A})),e.d(n,"displayShortcutList",(function(){return L})),e.d(n,"displayShortcut",(function(){return _})),e.d(n,"shortcutAriaLabel",(function(){return T})),e.d(n,"isKeyboardEvent",(function(){return M}));var r=e("YLtl"),o=e("l3Sj");function u(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!t){if("undefined"==typeof window)return!1;t=window}const{platform:n}=t.navigator;return-1!==n.indexOf("Mac")||Object(r.includes)(["iPad","iPhone"],n)}const i=8,c=9,f=13,l=27,d=32,a=33,s=34,p=35,b=36,O=37,j=38,h=39,y=40,m=46,S=121,g="alt",w="ctrl",C="meta",v="shift",E=48,P={primary:t=>t()?[C]:[w],primaryShift:t=>t()?[v,C]:[w,v],primaryAlt:t=>t()?[g,C]:[w,g],secondary:t=>t()?[v,g,C]:[w,v,g],access:t=>t()?[w,g]:[v,g],ctrl:()=>[w],alt:()=>[g],ctrlShift:()=>[w,v],shift:()=>[v],shiftAlt:()=>[v,g],undefined:()=>[]},A=Object(r.mapValues)(P,t=>function(n){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u;return[...t(e),n.toLowerCase()].join("+")}),L=Object(r.mapValues)(P,t=>function(n){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u;const o=e(),i={[g]:o?"⌥":"Alt",[w]:o?"⌃":"Ctrl",[C]:"⌘",[v]:o?"⇧":"Shift"},c=t(e).reduce((t,n)=>{const e=Object(r.get)(i,n,n);return o?[...t,e]:[...t,e,"+"]},[]),f=Object(r.capitalize)(n);return[...c,f]}),_=Object(r.mapValues)(L,t=>function(n){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u;return t(n,e).join("")}),T=Object(r.mapValues)(P,t=>function(n){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u;const i=e(),c={[v]:"Shift",[C]:i?"Command":"Control",[w]:"Control",[g]:i?"Option":"Alt",",":Object(o.__)("Comma"),".":Object(o.__)("Period"),"`":Object(o.__)("Backtick")};return[...t(e),n].map(t=>Object(r.capitalize)(Object(r.get)(c,t,t))).join(i?" ":" + ")});function x(t){return[g,w,C,v].filter(n=>t[n+"Key"])}const M=Object(r.mapValues)(P,t=>function(n,e){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u;const i=t(o),c=x(n);if(Object(r.xor)(i,c).length)return!1;let f=n.key.toLowerCase();return e?(n.altKey&&1===e.length&&(f=String.fromCharCode(n.keyCode).toLowerCase()),"del"===e&&(e="delete"),f===e.toLowerCase()):Object(r.includes)(i,f)})}});
|
|
@ -418,25 +418,32 @@ class import_form_ImportForm extends external_wp_element_["Component"] {
|
|||
|
||||
|
||||
|
||||
function ImportDropdown({
|
||||
function ImportDropdown(_ref) {
|
||||
let {
|
||||
onUpload
|
||||
}) {
|
||||
} = _ref;
|
||||
return Object(external_wp_element_["createElement"])(external_wp_components_["Dropdown"], {
|
||||
position: "bottom right",
|
||||
contentClassName: "list-reusable-blocks-import-dropdown__content",
|
||||
renderToggle: ({
|
||||
renderToggle: _ref2 => {
|
||||
let {
|
||||
isOpen,
|
||||
onToggle
|
||||
}) => Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
|
||||
} = _ref2;
|
||||
return Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
|
||||
"aria-expanded": isOpen,
|
||||
onClick: onToggle,
|
||||
variant: "primary"
|
||||
}, Object(external_wp_i18n_["__"])('Import from JSON')),
|
||||
renderContent: ({
|
||||
}, Object(external_wp_i18n_["__"])('Import from JSON'));
|
||||
},
|
||||
renderContent: _ref3 => {
|
||||
let {
|
||||
onClose
|
||||
}) => Object(external_wp_element_["createElement"])(import_form, {
|
||||
} = _ref3;
|
||||
return Object(external_wp_element_["createElement"])(import_form, {
|
||||
onUpload: Object(external_lodash_["flow"])(onClose, onUpload)
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -301,14 +301,15 @@ const getAttachmentsCollection = ids => {
|
|||
};
|
||||
|
||||
class media_upload_MediaUpload extends external_wp_element_["Component"] {
|
||||
constructor({
|
||||
constructor(_ref) {
|
||||
let {
|
||||
allowedTypes,
|
||||
gallery = false,
|
||||
unstableFeaturedImageFlow = false,
|
||||
modalClass,
|
||||
multiple = false,
|
||||
title = Object(external_wp_i18n_["__"])('Select or Upload Media')
|
||||
}) {
|
||||
} = _ref;
|
||||
super(...arguments);
|
||||
this.openModal = this.openModal.bind(this);
|
||||
this.onOpen = this.onOpen.bind(this);
|
||||
|
@ -600,7 +601,8 @@ function getMimeTypesArray(wpMimeTypesObject) {
|
|||
* @param {?Object} $0.wpAllowedMimeTypes List of allowed mime types and file extensions.
|
||||
*/
|
||||
|
||||
async function uploadMedia({
|
||||
async function uploadMedia(_ref) {
|
||||
let {
|
||||
allowedTypes,
|
||||
additionalData = {},
|
||||
filesList,
|
||||
|
@ -608,7 +610,7 @@ async function uploadMedia({
|
|||
onError = external_lodash_["noop"],
|
||||
onFileChange,
|
||||
wpAllowedMimeTypes = null
|
||||
}) {
|
||||
} = _ref;
|
||||
// Cast filesList to array
|
||||
const files = [...filesList];
|
||||
const filesSet = [];
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -134,7 +134,9 @@ var external_lodash_ = __webpack_require__("YLtl");
|
|||
*
|
||||
* @return {Function} Higher-order reducer.
|
||||
*/
|
||||
const onSubKey = actionProperty => reducer => (state = {}, action) => {
|
||||
const onSubKey = actionProperty => reducer => function () {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
// Retrieve subkey from action. Do not track if undefined; useful for cases
|
||||
// where reducer is scoped by action shape.
|
||||
const key = action[actionProperty];
|
||||
|
@ -177,7 +179,10 @@ const onSubKey = actionProperty => reducer => (state = {}, action) => {
|
|||
* @return {Object} Updated state.
|
||||
*/
|
||||
|
||||
const notices = on_sub_key('context')((state = [], action) => {
|
||||
const notices = on_sub_key('context')(function () {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'CREATE_NOTICE':
|
||||
// Avoid duplicates on ID.
|
||||
|
@ -264,7 +269,10 @@ const DEFAULT_STATUS = 'info';
|
|||
* @return {Object} Action object.
|
||||
*/
|
||||
|
||||
function createNotice(status = DEFAULT_STATUS, content, options = {}) {
|
||||
function createNotice() {
|
||||
let status = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_STATUS;
|
||||
let content = arguments.length > 1 ? arguments[1] : undefined;
|
||||
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
||||
const {
|
||||
speak = true,
|
||||
isDismissible = true,
|
||||
|
@ -369,7 +377,8 @@ function createWarningNotice(content, options) {
|
|||
* @return {Object} Action object.
|
||||
*/
|
||||
|
||||
function removeNotice(id, context = DEFAULT_CONTEXT) {
|
||||
function removeNotice(id) {
|
||||
let context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_CONTEXT;
|
||||
return {
|
||||
type: 'REMOVE_NOTICE',
|
||||
id,
|
||||
|
@ -431,7 +440,8 @@ const DEFAULT_NOTICES = [];
|
|||
* @return {WPNotice[]} Array of notices.
|
||||
*/
|
||||
|
||||
function getNotices(state, context = DEFAULT_CONTEXT) {
|
||||
function getNotices(state) {
|
||||
let context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_CONTEXT;
|
||||
return state[context] || DEFAULT_NOTICES;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
/*! This file is auto-generated */
|
||||
this.wp=this.wp||{},this.wp.notices=function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="Ko7W")}({"1ZqX":function(t,e){t.exports=window.wp.data},Ko7W:function(t,e,n){"use strict";n.r(e),n.d(e,"store",(function(){return j}));var r={};n.r(r),n.d(r,"createNotice",(function(){return f})),n.d(r,"createSuccessNotice",(function(){return a})),n.d(r,"createInfoNotice",(function(){return l})),n.d(r,"createErrorNotice",(function(){return d})),n.d(r,"createWarningNotice",(function(){return p})),n.d(r,"removeNotice",(function(){return b}));var o={};n.r(o),n.d(o,"getNotices",(function(){return y}));var i=n("1ZqX"),c=n("YLtl");var u=(t=>e=>(n={},r)=>{const o=r[t];if(void 0===o)return n;const i=e(n[o],r);return i===n[o]?n:{...n,[o]:i}})("context")((t=[],e)=>{switch(e.type){case"CREATE_NOTICE":return[...Object(c.reject)(t,{id:e.notice.id}),e.notice];case"REMOVE_NOTICE":return Object(c.reject)(t,{id:e.id})}return t});const s="global";function f(t="info",e,n={}){const{speak:r=!0,isDismissible:o=!0,context:i=s,id:u=Object(c.uniqueId)(i),actions:f=[],type:a="default",__unstableHTML:l,icon:d=null,explicitDismiss:p=!1,onDismiss:b}=n;return{type:"CREATE_NOTICE",context:i,notice:{id:u,status:t,content:e=String(e),spokenMessage:r?e:null,__unstableHTML:l,isDismissible:o,actions:f,type:a,icon:d,explicitDismiss:p,onDismiss:b}}}function a(t,e){return f("success",t,e)}function l(t,e){return f("info",t,e)}function d(t,e){return f("error",t,e)}function p(t,e){return f("warning",t,e)}function b(t,e=s){return{type:"REMOVE_NOTICE",id:t,context:e}}const O=[];function y(t,e=s){return t[e]||O}const j=Object(i.createReduxStore)("core/notices",{reducer:u,actions:r,selectors:o});Object(i.register)(j)},YLtl:function(t,e){t.exports=window.lodash}});
|
||||
this.wp=this.wp||{},this.wp.notices=function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="Ko7W")}({"1ZqX":function(t,e){t.exports=window.wp.data},Ko7W:function(t,e,n){"use strict";n.r(e),n.d(e,"store",(function(){return O}));var r={};n.r(r),n.d(r,"createNotice",(function(){return l})),n.d(r,"createSuccessNotice",(function(){return f})),n.d(r,"createInfoNotice",(function(){return d})),n.d(r,"createErrorNotice",(function(){return a})),n.d(r,"createWarningNotice",(function(){return p})),n.d(r,"removeNotice",(function(){return b}));var o={};n.r(o),n.d(o,"getNotices",(function(){return g}));var i=n("1ZqX"),c=n("YLtl");var u=(t=>e=>function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;const o=r[t];if(void 0===o)return n;const i=e(n[o],r);return i===n[o]?n:{...n,[o]:i}})("context")((function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0;switch(e.type){case"CREATE_NOTICE":return[...Object(c.reject)(t,{id:e.notice.id}),e.notice];case"REMOVE_NOTICE":return Object(c.reject)(t,{id:e.id})}return t}));const s="global";function l(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"info",e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{speak:r=!0,isDismissible:o=!0,context:i=s,id:u=Object(c.uniqueId)(i),actions:l=[],type:f="default",__unstableHTML:d,icon:a=null,explicitDismiss:p=!1,onDismiss:b}=n;return e=String(e),{type:"CREATE_NOTICE",context:i,notice:{id:u,status:t,content:e,spokenMessage:r?e:null,__unstableHTML:d,isDismissible:o,actions:l,type:f,icon:a,explicitDismiss:p,onDismiss:b}}}function f(t,e){return l("success",t,e)}function d(t,e){return l("info",t,e)}function a(t,e){return l("error",t,e)}function p(t,e){return l("warning",t,e)}function b(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return{type:"REMOVE_NOTICE",id:t,context:e}}const v=[];function g(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return t[e]||v}const O=Object(i.createReduxStore)("core/notices",{reducer:u,actions:r,selectors:o});Object(i.register)(O)},YLtl:function(t,e){t.exports=window.lodash}});
|
|
@ -142,7 +142,10 @@ var external_wp_data_ = __webpack_require__("1ZqX");
|
|||
* @return {Array} Updated state.
|
||||
*/
|
||||
|
||||
function guides(state = [], action) {
|
||||
function guides() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'TRIGGER_GUIDE':
|
||||
return [...state, action.tipIds];
|
||||
|
@ -159,7 +162,10 @@ function guides(state = [], action) {
|
|||
* @return {boolean} Updated state.
|
||||
*/
|
||||
|
||||
function areTipsEnabled(state = true, action) {
|
||||
function areTipsEnabled() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'DISABLE_TIPS':
|
||||
return false;
|
||||
|
@ -180,7 +186,10 @@ function areTipsEnabled(state = true, action) {
|
|||
* @return {Object} Updated state.
|
||||
*/
|
||||
|
||||
function dismissedTips(state = {}, action) {
|
||||
function dismissedTips() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'DISMISS_TIP':
|
||||
return { ...state,
|
||||
|
@ -417,14 +426,15 @@ function onClick(event) {
|
|||
event.stopPropagation();
|
||||
}
|
||||
|
||||
function DotTip({
|
||||
function DotTip(_ref) {
|
||||
let {
|
||||
position = 'middle right',
|
||||
children,
|
||||
isVisible,
|
||||
hasNextTip,
|
||||
onDismiss,
|
||||
onDisable
|
||||
}) {
|
||||
} = _ref;
|
||||
const anchorParent = Object(external_wp_element_["useRef"])(null);
|
||||
const onFocusOutsideCallback = Object(external_wp_element_["useCallback"])(event => {
|
||||
if (!anchorParent.current) {
|
||||
|
@ -462,9 +472,10 @@ function DotTip({
|
|||
onClick: onDisable
|
||||
}));
|
||||
}
|
||||
/* harmony default export */ var dot_tip = (Object(external_wp_compose_["compose"])(Object(external_wp_data_["withSelect"])((select, {
|
||||
/* harmony default export */ var dot_tip = (Object(external_wp_compose_["compose"])(Object(external_wp_data_["withSelect"])((select, _ref2) => {
|
||||
let {
|
||||
tipId
|
||||
}) => {
|
||||
} = _ref2;
|
||||
const {
|
||||
isTipVisible,
|
||||
getAssociatedGuide
|
||||
|
@ -474,9 +485,10 @@ function DotTip({
|
|||
isVisible: isTipVisible(tipId),
|
||||
hasNextTip: !!(associatedGuide && associatedGuide.nextTipId)
|
||||
};
|
||||
}), Object(external_wp_data_["withDispatch"])((dispatch, {
|
||||
}), Object(external_wp_data_["withDispatch"])((dispatch, _ref3) => {
|
||||
let {
|
||||
tipId
|
||||
}) => {
|
||||
} = _ref3;
|
||||
const {
|
||||
dismissTip,
|
||||
disableTips
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -663,11 +663,12 @@ class plugin_area_PluginArea extends external_wp_element_["Component"] {
|
|||
|
||||
getCurrentPluginsState() {
|
||||
return {
|
||||
plugins: Object(external_lodash_["map"])(getPlugins(this.props.scope), ({
|
||||
plugins: Object(external_lodash_["map"])(getPlugins(this.props.scope), _ref => {
|
||||
let {
|
||||
icon,
|
||||
name,
|
||||
render
|
||||
}) => {
|
||||
} = _ref;
|
||||
return {
|
||||
Plugin: render,
|
||||
context: this.memoizedContext(name, icon)
|
||||
|
@ -695,13 +696,16 @@ class plugin_area_PluginArea extends external_wp_element_["Component"] {
|
|||
style: {
|
||||
display: 'none'
|
||||
}
|
||||
}, Object(external_lodash_["map"])(this.state.plugins, ({
|
||||
}, Object(external_lodash_["map"])(this.state.plugins, _ref2 => {
|
||||
let {
|
||||
context,
|
||||
Plugin
|
||||
}) => Object(external_wp_element_["createElement"])(Provider, {
|
||||
} = _ref2;
|
||||
return Object(external_wp_element_["createElement"])(Provider, {
|
||||
key: context.name,
|
||||
value: context
|
||||
}, Object(external_wp_element_["createElement"])(Plugin, null))));
|
||||
}, Object(external_wp_element_["createElement"])(Plugin, null));
|
||||
}));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -199,11 +199,12 @@ const Stop = props => Object(external_wp_element_["createElement"])('stop', prop
|
|||
* @return {JSX.Element} Stop component
|
||||
*/
|
||||
|
||||
const SVG = ({
|
||||
const SVG = _ref => {
|
||||
let {
|
||||
className,
|
||||
isPressed,
|
||||
...props
|
||||
}) => {
|
||||
} = _ref;
|
||||
const appliedProps = { ...props,
|
||||
className: classnames_default()(className, {
|
||||
'is-pressed': isPressed
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*! This file is auto-generated */
|
||||
this.wp=this.wp||{},this.wp.primitives=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s="G8AQ")}({G8AQ:function(e,t,r){"use strict";r.r(t),r.d(t,"Circle",(function(){return u})),r.d(t,"G",(function(){return c})),r.d(t,"Path",(function(){return a})),r.d(t,"Polygon",(function(){return l})),r.d(t,"Rect",(function(){return f})),r.d(t,"Defs",(function(){return s})),r.d(t,"RadialGradient",(function(){return d})),r.d(t,"LinearGradient",(function(){return p})),r.d(t,"Stop",(function(){return b})),r.d(t,"SVG",(function(){return m})),r.d(t,"HorizontalRule",(function(){return v})),r.d(t,"BlockQuotation",(function(){return y})),r.d(t,"View",(function(){return j}));var n=r("TSYQ"),o=r.n(n),i=r("GRId");const u=e=>Object(i.createElement)("circle",e),c=e=>Object(i.createElement)("g",e),a=e=>Object(i.createElement)("path",e),l=e=>Object(i.createElement)("polygon",e),f=e=>Object(i.createElement)("rect",e),s=e=>Object(i.createElement)("defs",e),d=e=>Object(i.createElement)("radialGradient",e),p=e=>Object(i.createElement)("linearGradient",e),b=e=>Object(i.createElement)("stop",e),m=({className:e,isPressed:t,...r})=>{const n={...r,className:o()(e,{"is-pressed":t})||void 0,role:"img","aria-hidden":!0,focusable:!1};return Object(i.createElement)("svg",n)},v="hr",y="blockquote",j="div"},GRId:function(e,t){e.exports=window.wp.element},TSYQ:function(e,t,r){var n;
|
||||
this.wp=this.wp||{},this.wp.primitives=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s="G8AQ")}({G8AQ:function(e,t,r){"use strict";r.r(t),r.d(t,"Circle",(function(){return u})),r.d(t,"G",(function(){return c})),r.d(t,"Path",(function(){return a})),r.d(t,"Polygon",(function(){return l})),r.d(t,"Rect",(function(){return f})),r.d(t,"Defs",(function(){return s})),r.d(t,"RadialGradient",(function(){return d})),r.d(t,"LinearGradient",(function(){return p})),r.d(t,"Stop",(function(){return b})),r.d(t,"SVG",(function(){return m})),r.d(t,"HorizontalRule",(function(){return v})),r.d(t,"BlockQuotation",(function(){return y})),r.d(t,"View",(function(){return j}));var n=r("TSYQ"),o=r.n(n),i=r("GRId");const u=e=>Object(i.createElement)("circle",e),c=e=>Object(i.createElement)("g",e),a=e=>Object(i.createElement)("path",e),l=e=>Object(i.createElement)("polygon",e),f=e=>Object(i.createElement)("rect",e),s=e=>Object(i.createElement)("defs",e),d=e=>Object(i.createElement)("radialGradient",e),p=e=>Object(i.createElement)("linearGradient",e),b=e=>Object(i.createElement)("stop",e),m=e=>{let{className:t,isPressed:r,...n}=e;const u={...n,className:o()(t,{"is-pressed":r})||void 0,role:"img","aria-hidden":!0,focusable:!1};return Object(i.createElement)("svg",u)},v="hr",y="blockquote",j="div"},GRId:function(e,t){e.exports=window.wp.element},TSYQ:function(e,t,r){var n;
|
||||
/*!
|
||||
Copyright (c) 2018 Jed Watson.
|
||||
Licensed under the MIT License (MIT), see
|
||||
|
|
|
@ -178,7 +178,9 @@ function isActionOfType(object, expectedType) {
|
|||
* @param dispatch Unhandled action dispatch.
|
||||
*/
|
||||
|
||||
function createRuntime(controls = {}, dispatch) {
|
||||
function createRuntime() {
|
||||
let controls = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let dispatch = arguments.length > 1 ? arguments[1] : undefined;
|
||||
const rungenControls = Object(external_lodash_["map"])(controls, (control, actionType) => (value, next, iterate, yieldNext, yieldError) => {
|
||||
if (!isActionOfType(value, actionType)) {
|
||||
return false;
|
||||
|
@ -236,7 +238,8 @@ function createRuntime(controls = {}, dispatch) {
|
|||
* @return {import('redux').Middleware} Co-routine runtime
|
||||
*/
|
||||
|
||||
function createMiddleware(controls = {}) {
|
||||
function createMiddleware() {
|
||||
let controls = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
return store => {
|
||||
const runtime = createRuntime(controls, store.dispatch);
|
||||
return next => action => {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -193,9 +193,10 @@ var external_wp_i18n_ = __webpack_require__("l3Sj");
|
|||
* @param {string} clientId The client ID of the block to attach.
|
||||
*/
|
||||
|
||||
const __experimentalConvertBlockToStatic = clientId => ({
|
||||
const __experimentalConvertBlockToStatic = clientId => _ref => {
|
||||
let {
|
||||
registry
|
||||
}) => {
|
||||
} = _ref;
|
||||
const oldBlock = registry.select(external_wp_blockEditor_["store"]).getBlock(clientId);
|
||||
const reusableBlock = registry.select('core').getEditedEntityRecord('postType', 'wp_block', oldBlock.attributes.ref);
|
||||
const newBlocks = Object(external_wp_blocks_["parse"])(Object(external_lodash_["isFunction"])(reusableBlock.content) ? reusableBlock.content(reusableBlock) : reusableBlock.content);
|
||||
|
@ -208,10 +209,11 @@ const __experimentalConvertBlockToStatic = clientId => ({
|
|||
* @param {string} title Reusable block title.
|
||||
*/
|
||||
|
||||
const __experimentalConvertBlocksToReusable = (clientIds, title) => async ({
|
||||
const __experimentalConvertBlocksToReusable = (clientIds, title) => async _ref2 => {
|
||||
let {
|
||||
registry,
|
||||
dispatch
|
||||
}) => {
|
||||
} = _ref2;
|
||||
const reusableBlock = {
|
||||
title: title || Object(external_wp_i18n_["__"])('Untitled Reusable block'),
|
||||
content: Object(external_wp_blocks_["serialize"])(registry.select(external_wp_blockEditor_["store"]).getBlocksByClientId(clientIds)),
|
||||
|
@ -231,9 +233,10 @@ const __experimentalConvertBlocksToReusable = (clientIds, title) => async ({
|
|||
* @param {string} id The ID of the reusable block to delete.
|
||||
*/
|
||||
|
||||
const __experimentalDeleteReusableBlock = id => async ({
|
||||
const __experimentalDeleteReusableBlock = id => async _ref3 => {
|
||||
let {
|
||||
registry
|
||||
}) => {
|
||||
} = _ref3;
|
||||
const reusableBlock = registry.select('core').getEditedEntityRecord('postType', 'wp_block', id); // Don't allow a reusable block with a temporary ID to be deleted
|
||||
|
||||
if (!reusableBlock) {
|
||||
|
@ -272,7 +275,10 @@ function __experimentalSetEditingReusableBlock(clientId, isEditing) {
|
|||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
function isEditingReusableBlock(state = {}, action) {
|
||||
function isEditingReusableBlock() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
if ((action === null || action === void 0 ? void 0 : action.type) === 'SET_EDITING_REUSABLE_BLOCK') {
|
||||
return { ...state,
|
||||
[action.clientId]: action.isEditing
|
||||
|
@ -385,10 +391,11 @@ var external_wp_coreData_ = __webpack_require__("jZUy");
|
|||
* @return {import('@wordpress/element').WPComponent} The menu control or null.
|
||||
*/
|
||||
|
||||
function ReusableBlockConvertButton({
|
||||
function ReusableBlockConvertButton(_ref) {
|
||||
let {
|
||||
clientIds,
|
||||
rootClientId
|
||||
}) {
|
||||
} = _ref;
|
||||
const [isModalOpen, setIsModalOpen] = Object(external_wp_element_["useState"])(false);
|
||||
const [title, setTitle] = Object(external_wp_element_["useState"])('');
|
||||
const canConvert = Object(external_wp_data_["useSelect"])(select => {
|
||||
|
@ -438,9 +445,11 @@ function ReusableBlockConvertButton({
|
|||
return null;
|
||||
}
|
||||
|
||||
return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockSettingsMenuControls"], null, ({
|
||||
return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockSettingsMenuControls"], null, _ref2 => {
|
||||
let {
|
||||
onClose
|
||||
}) => Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], {
|
||||
} = _ref2;
|
||||
return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], {
|
||||
icon: reusable_block,
|
||||
onClick: () => {
|
||||
setIsModalOpen(true);
|
||||
|
@ -477,7 +486,8 @@ function ReusableBlockConvertButton({
|
|||
}, Object(external_wp_i18n_["__"])('Cancel'))), Object(external_wp_element_["createElement"])(external_wp_components_["FlexItem"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
|
||||
variant: "primary",
|
||||
type: "submit"
|
||||
}, Object(external_wp_i18n_["__"])('Save'))))))));
|
||||
}, Object(external_wp_i18n_["__"])('Save')))))));
|
||||
});
|
||||
}
|
||||
|
||||
// EXTERNAL MODULE: external ["wp","url"]
|
||||
|
@ -502,9 +512,10 @@ var external_wp_url_ = __webpack_require__("Mmq9");
|
|||
|
||||
|
||||
|
||||
function ReusableBlocksManageButton({
|
||||
function ReusableBlocksManageButton(_ref) {
|
||||
let {
|
||||
clientId
|
||||
}) {
|
||||
} = _ref;
|
||||
const {
|
||||
isVisible
|
||||
} = Object(external_wp_data_["useSelect"])(select => {
|
||||
|
@ -553,10 +564,11 @@ function ReusableBlocksManageButton({
|
|||
|
||||
|
||||
|
||||
function ReusableBlocksMenuItems({
|
||||
function ReusableBlocksMenuItems(_ref) {
|
||||
let {
|
||||
clientIds,
|
||||
rootClientId
|
||||
}) {
|
||||
} = _ref;
|
||||
return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(ReusableBlockConvertButton, {
|
||||
clientIds: clientIds,
|
||||
rootClientId: rootClientId
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -511,7 +511,10 @@ var external_lodash_ = __webpack_require__("YLtl");
|
|||
* @return {Object} Updated state.
|
||||
*/
|
||||
|
||||
function reducer_formatTypes(state = {}, action) {
|
||||
function reducer_formatTypes() {
|
||||
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
let action = arguments.length > 1 ? arguments[1] : undefined;
|
||||
|
||||
switch (action.type) {
|
||||
case 'ADD_FORMAT_TYPES':
|
||||
return { ...state,
|
||||
|
@ -569,10 +572,11 @@ function getFormatType(state, name) {
|
|||
*/
|
||||
|
||||
function getFormatTypeForBareElement(state, bareElementTagName) {
|
||||
return Object(external_lodash_["find"])(getFormatTypes(state), ({
|
||||
return Object(external_lodash_["find"])(getFormatTypes(state), _ref => {
|
||||
let {
|
||||
className,
|
||||
tagName
|
||||
}) => {
|
||||
} = _ref;
|
||||
return className === null && bareElementTagName === tagName;
|
||||
});
|
||||
}
|
||||
|
@ -586,9 +590,11 @@ function getFormatTypeForBareElement(state, bareElementTagName) {
|
|||
*/
|
||||
|
||||
function getFormatTypeForClassName(state, elementClassName) {
|
||||
return Object(external_lodash_["find"])(getFormatTypes(state), ({
|
||||
return Object(external_lodash_["find"])(getFormatTypes(state), _ref2 => {
|
||||
let {
|
||||
className
|
||||
}) => {
|
||||
} = _ref2;
|
||||
|
||||
if (className === null) {
|
||||
return false;
|
||||
}
|
||||
|
@ -789,7 +795,9 @@ function replace(array, index, value) {
|
|||
*/
|
||||
|
||||
|
||||
function applyFormat(value, format, startIndex = value.start, endIndex = value.end) {
|
||||
function applyFormat(value, format) {
|
||||
let startIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : value.start;
|
||||
let endIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : value.end;
|
||||
const {
|
||||
formats,
|
||||
activeFormats
|
||||
|
@ -823,9 +831,12 @@ function applyFormat(value, format, startIndex = value.start, endIndex = value.e
|
|||
|
||||
for (let index = startIndex; index < endIndex; index++) {
|
||||
if (newFormats[index]) {
|
||||
newFormats[index] = newFormats[index].filter(({
|
||||
newFormats[index] = newFormats[index].filter(_ref => {
|
||||
let {
|
||||
type
|
||||
}) => type !== format.type);
|
||||
} = _ref;
|
||||
return type !== format.type;
|
||||
});
|
||||
const length = newFormats[index].length;
|
||||
|
||||
if (length < position) {
|
||||
|
@ -866,9 +877,11 @@ function applyFormat(value, format, startIndex = value.start, endIndex = value.e
|
|||
*
|
||||
* @return {HTMLBodyElement} Body element with parsed HTML.
|
||||
*/
|
||||
function createElement({
|
||||
function createElement(_ref, html) {
|
||||
let {
|
||||
implementation
|
||||
}, html) {
|
||||
} = _ref;
|
||||
|
||||
// Because `createHTMLDocument` is an expensive operation, and with this
|
||||
// function being internal to `rich-text` (full control in avoiding a risk
|
||||
// of asynchronous operations on the shared reference), a single document
|
||||
|
@ -939,10 +952,11 @@ function createEmptyValue() {
|
|||
};
|
||||
}
|
||||
|
||||
function toFormat({
|
||||
function toFormat(_ref) {
|
||||
let {
|
||||
type,
|
||||
attributes
|
||||
}) {
|
||||
} = _ref;
|
||||
let formatType;
|
||||
|
||||
if (attributes && attributes.class) {
|
||||
|
@ -1058,7 +1072,8 @@ function toFormat({
|
|||
*/
|
||||
|
||||
|
||||
function create({
|
||||
function create() {
|
||||
let {
|
||||
element,
|
||||
text,
|
||||
html,
|
||||
|
@ -1067,7 +1082,8 @@ function create({
|
|||
multilineWrapperTags,
|
||||
__unstableIsEditableTree: isEditableTree,
|
||||
preserveWhiteSpace
|
||||
} = {}) {
|
||||
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
|
||||
if (typeof text === 'string' && text.length > 0) {
|
||||
return {
|
||||
formats: Array(text.length),
|
||||
|
@ -1235,7 +1251,8 @@ function removeReservedCharacters(string) {
|
|||
* @return {RichTextValue} A rich text value.
|
||||
*/
|
||||
|
||||
function createFromElement({
|
||||
function createFromElement(_ref2) {
|
||||
let {
|
||||
element,
|
||||
range,
|
||||
multilineTag,
|
||||
|
@ -1243,7 +1260,7 @@ function createFromElement({
|
|||
currentWrapperTags = [],
|
||||
isEditableTree,
|
||||
preserveWhiteSpace
|
||||
}) {
|
||||
} = _ref2;
|
||||
const accumulator = createEmptyValue();
|
||||
|
||||
if (!element) {
|
||||
|
@ -1404,7 +1421,8 @@ function createFromElement({
|
|||
*/
|
||||
|
||||
|
||||
function createFromMultilineElement({
|
||||
function createFromMultilineElement(_ref3) {
|
||||
let {
|
||||
element,
|
||||
range,
|
||||
multilineTag,
|
||||
|
@ -1412,7 +1430,7 @@ function createFromMultilineElement({
|
|||
currentWrapperTags = [],
|
||||
isEditableTree,
|
||||
preserveWhiteSpace
|
||||
}) {
|
||||
} = _ref3;
|
||||
const accumulator = createEmptyValue();
|
||||
|
||||
if (!element || !element.hasChildNodes()) {
|
||||
|
@ -1463,9 +1481,11 @@ function createFromMultilineElement({
|
|||
*/
|
||||
|
||||
|
||||
function getAttributes({
|
||||
function getAttributes(_ref4) {
|
||||
let {
|
||||
element
|
||||
}) {
|
||||
} = _ref4;
|
||||
|
||||
if (!element.hasAttributes()) {
|
||||
return;
|
||||
}
|
||||
|
@ -1524,7 +1544,11 @@ function mergePair(a, b) {
|
|||
* @return {RichTextValue} A new value combining all given records.
|
||||
*/
|
||||
|
||||
function concat(...values) {
|
||||
function concat() {
|
||||
for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
values[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
return normaliseFormats(values.reduce(mergePair, create()));
|
||||
}
|
||||
|
||||
|
@ -1542,12 +1566,15 @@ function concat(...values) {
|
|||
*
|
||||
* @return {RichTextFormatList} Active format objects.
|
||||
*/
|
||||
function getActiveFormats({
|
||||
function getActiveFormats(_ref) {
|
||||
let {
|
||||
formats,
|
||||
start,
|
||||
end,
|
||||
activeFormats
|
||||
}, EMPTY_ACTIVE_FORMATS = []) {
|
||||
} = _ref;
|
||||
let EMPTY_ACTIVE_FORMATS = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
||||
|
||||
if (start === undefined) {
|
||||
return EMPTY_ACTIVE_FORMATS;
|
||||
}
|
||||
|
@ -1623,12 +1650,14 @@ function getActiveFormat(value, formatType) {
|
|||
* @return {RichTextFormat|void} Active object, or undefined.
|
||||
*/
|
||||
|
||||
function getActiveObject({
|
||||
function getActiveObject(_ref) {
|
||||
let {
|
||||
start,
|
||||
end,
|
||||
replacements,
|
||||
text
|
||||
}) {
|
||||
} = _ref;
|
||||
|
||||
if (start + 1 !== end || text[start] !== OBJECT_REPLACEMENT_CHARACTER) {
|
||||
return;
|
||||
}
|
||||
|
@ -1652,9 +1681,10 @@ function getActiveObject({
|
|||
* @return {string} The text content.
|
||||
*/
|
||||
|
||||
function getTextContent({
|
||||
function getTextContent(_ref) {
|
||||
let {
|
||||
text
|
||||
}) {
|
||||
} = _ref;
|
||||
return text.replace(new RegExp(OBJECT_REPLACEMENT_CHARACTER, 'g'), '').replace(new RegExp(LINE_SEPARATOR, 'g'), '\n');
|
||||
}
|
||||
|
||||
|
@ -1677,10 +1707,12 @@ function getTextContent({
|
|||
* @return {number|void} The line index. Undefined if not found.
|
||||
*/
|
||||
|
||||
function getLineIndex({
|
||||
function getLineIndex(_ref) {
|
||||
let {
|
||||
start,
|
||||
text
|
||||
}, startIndex = start) {
|
||||
} = _ref;
|
||||
let startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : start;
|
||||
let index = startIndex;
|
||||
|
||||
while (index--) {
|
||||
|
@ -1764,10 +1796,12 @@ function isActiveListType(value, type, rootType) {
|
|||
* @return {boolean|undefined} True if the selection is collapsed, false if not,
|
||||
* undefined if there is no selection.
|
||||
*/
|
||||
function isCollapsed({
|
||||
function isCollapsed(_ref) {
|
||||
let {
|
||||
start,
|
||||
end
|
||||
}) {
|
||||
} = _ref;
|
||||
|
||||
if (start === undefined || end === undefined) {
|
||||
return;
|
||||
}
|
||||
|
@ -1791,9 +1825,10 @@ function isCollapsed({
|
|||
* @return {boolean} True if the value is empty, false if not.
|
||||
*/
|
||||
|
||||
function isEmpty({
|
||||
function isEmpty(_ref) {
|
||||
let {
|
||||
text
|
||||
}) {
|
||||
} = _ref;
|
||||
return text.length === 0;
|
||||
}
|
||||
/**
|
||||
|
@ -1805,11 +1840,13 @@ function isEmpty({
|
|||
* @return {boolean} True if the line is empty, false if not.
|
||||
*/
|
||||
|
||||
function isEmptyLine({
|
||||
function isEmptyLine(_ref2) {
|
||||
let {
|
||||
text,
|
||||
start,
|
||||
end
|
||||
}) {
|
||||
} = _ref2;
|
||||
|
||||
if (start !== end) {
|
||||
return false;
|
||||
}
|
||||
|
@ -1848,22 +1885,27 @@ function isEmptyLine({
|
|||
* @return {RichTextValue} A new combined value.
|
||||
*/
|
||||
|
||||
function join(values, separator = '') {
|
||||
function join(values) {
|
||||
let separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
||||
|
||||
if (typeof separator === 'string') {
|
||||
separator = create({
|
||||
text: separator
|
||||
});
|
||||
}
|
||||
|
||||
return normaliseFormats(values.reduce((accumlator, {
|
||||
return normaliseFormats(values.reduce((accumlator, _ref) => {
|
||||
let {
|
||||
formats,
|
||||
replacements,
|
||||
text
|
||||
}) => ({
|
||||
} = _ref;
|
||||
return {
|
||||
formats: accumlator.formats.concat(separator.formats, formats),
|
||||
replacements: accumlator.replacements.concat(separator.replacements, replacements),
|
||||
text: accumlator.text + separator.text + text
|
||||
})));
|
||||
};
|
||||
}));
|
||||
}
|
||||
|
||||
// CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/register-format-type.js
|
||||
|
@ -1996,7 +2038,9 @@ function registerFormatType(name, settings) {
|
|||
* @return {RichTextValue} A new value with the format applied.
|
||||
*/
|
||||
|
||||
function removeFormat(value, formatType, startIndex = value.start, endIndex = value.end) {
|
||||
function removeFormat(value, formatType) {
|
||||
let startIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : value.start;
|
||||
let endIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : value.end;
|
||||
const {
|
||||
formats,
|
||||
activeFormats
|
||||
|
@ -2039,9 +2083,12 @@ function removeFormat(value, formatType, startIndex = value.start, endIndex = va
|
|||
}
|
||||
|
||||
function filterFormats(formats, index, formatType) {
|
||||
const newFormats = formats[index].filter(({
|
||||
const newFormats = formats[index].filter(_ref => {
|
||||
let {
|
||||
type
|
||||
}) => type !== formatType);
|
||||
} = _ref;
|
||||
return type !== formatType;
|
||||
});
|
||||
|
||||
if (newFormats.length) {
|
||||
formats[index] = newFormats;
|
||||
|
@ -2072,7 +2119,9 @@ function filterFormats(formats, index, formatType) {
|
|||
* @return {RichTextValue} A new value with the value inserted.
|
||||
*/
|
||||
|
||||
function insert(value, valueToInsert, startIndex = value.start, endIndex = value.end) {
|
||||
function insert(value, valueToInsert) {
|
||||
let startIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : value.start;
|
||||
let endIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : value.end;
|
||||
const {
|
||||
formats,
|
||||
replacements,
|
||||
|
@ -2142,14 +2191,19 @@ function remove_remove(value, startIndex, endIndex) {
|
|||
* @return {RichTextValue} A new value with replacements applied.
|
||||
*/
|
||||
|
||||
function replace_replace({
|
||||
function replace_replace(_ref, pattern, replacement) {
|
||||
let {
|
||||
formats,
|
||||
replacements,
|
||||
text,
|
||||
start,
|
||||
end
|
||||
}, pattern, replacement) {
|
||||
text = text.replace(pattern, (match, ...rest) => {
|
||||
} = _ref;
|
||||
text = text.replace(pattern, function (match) {
|
||||
for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
||||
rest[_key - 1] = arguments[_key];
|
||||
}
|
||||
|
||||
const offset = rest[rest.length - 2];
|
||||
let newText = replacement;
|
||||
let newFormats;
|
||||
|
@ -2210,7 +2264,9 @@ function replace_replace({
|
|||
* @return {RichTextValue} A new value with the value inserted.
|
||||
*/
|
||||
|
||||
function insertLineSeparator(value, startIndex = value.start, endIndex = value.end) {
|
||||
function insertLineSeparator(value) {
|
||||
let startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : value.start;
|
||||
let endIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : value.end;
|
||||
const beforeText = value.text.slice(0, startIndex);
|
||||
const previousLineSeparatorIndex = beforeText.lastIndexOf(LINE_SEPARATOR);
|
||||
const previousLineSeparatorFormats = value.replacements[previousLineSeparatorIndex];
|
||||
|
@ -2251,7 +2307,8 @@ function insertLineSeparator(value, startIndex = value.start, endIndex = value.e
|
|||
* is found on the position.
|
||||
*/
|
||||
|
||||
function removeLineSeparator(value, backward = true) {
|
||||
function removeLineSeparator(value) {
|
||||
let backward = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
||||
const {
|
||||
replacements,
|
||||
text,
|
||||
|
@ -2335,7 +2392,9 @@ function insertObject(value, formatToInsert, startIndex, endIndex) {
|
|||
*
|
||||
* @return {RichTextValue} A new extracted value.
|
||||
*/
|
||||
function slice(value, startIndex = value.start, endIndex = value.end) {
|
||||
function slice(value) {
|
||||
let startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : value.start;
|
||||
let endIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : value.end;
|
||||
const {
|
||||
formats,
|
||||
replacements,
|
||||
|
@ -2372,13 +2431,15 @@ function slice(value, startIndex = value.start, endIndex = value.end) {
|
|||
* @return {Array<RichTextValue>|undefined} An array of new values.
|
||||
*/
|
||||
|
||||
function split({
|
||||
function split(_ref, string) {
|
||||
let {
|
||||
formats,
|
||||
replacements,
|
||||
text,
|
||||
start,
|
||||
end
|
||||
}, string) {
|
||||
} = _ref;
|
||||
|
||||
if (typeof string !== 'string') {
|
||||
return splitAtSelection(...arguments);
|
||||
}
|
||||
|
@ -2411,13 +2472,17 @@ function split({
|
|||
});
|
||||
}
|
||||
|
||||
function splitAtSelection({
|
||||
function splitAtSelection(_ref2) {
|
||||
let {
|
||||
formats,
|
||||
replacements,
|
||||
text,
|
||||
start,
|
||||
end
|
||||
}, startIndex = start, endIndex = end) {
|
||||
} = _ref2;
|
||||
let startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : start;
|
||||
let endIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : end;
|
||||
|
||||
if (start === undefined || end === undefined) {
|
||||
return;
|
||||
}
|
||||
|
@ -2508,14 +2573,15 @@ function restoreOnAttributes(attributes, isEditableTree) {
|
|||
*/
|
||||
|
||||
|
||||
function fromFormat({
|
||||
function fromFormat(_ref) {
|
||||
let {
|
||||
type,
|
||||
attributes,
|
||||
unregisteredAttributes,
|
||||
object,
|
||||
boundaryClass,
|
||||
isEditableTree
|
||||
}) {
|
||||
} = _ref;
|
||||
const formatType = get_format_type_getFormatType(type);
|
||||
let elementAttributes = {};
|
||||
|
||||
|
@ -2584,7 +2650,8 @@ function isEqualUntil(a, b, index) {
|
|||
return true;
|
||||
}
|
||||
|
||||
function toTree({
|
||||
function toTree(_ref2) {
|
||||
let {
|
||||
value,
|
||||
multilineTag,
|
||||
preserveWhiteSpace,
|
||||
|
@ -2600,7 +2667,7 @@ function toTree({
|
|||
onEndIndex,
|
||||
isEditableTree,
|
||||
placeholder
|
||||
}) {
|
||||
} = _ref2;
|
||||
const {
|
||||
formats,
|
||||
replacements,
|
||||
|
@ -2879,15 +2946,17 @@ function to_dom_appendText(node, text) {
|
|||
node.appendData(text);
|
||||
}
|
||||
|
||||
function to_dom_getLastChild({
|
||||
function to_dom_getLastChild(_ref) {
|
||||
let {
|
||||
lastChild
|
||||
}) {
|
||||
} = _ref;
|
||||
return lastChild;
|
||||
}
|
||||
|
||||
function to_dom_getParent({
|
||||
function to_dom_getParent(_ref2) {
|
||||
let {
|
||||
parentNode
|
||||
}) {
|
||||
} = _ref2;
|
||||
return parentNode;
|
||||
}
|
||||
|
||||
|
@ -2895,9 +2964,10 @@ function to_dom_isText(node) {
|
|||
return node.nodeType === node.TEXT_NODE;
|
||||
}
|
||||
|
||||
function to_dom_getText({
|
||||
function to_dom_getText(_ref3) {
|
||||
let {
|
||||
nodeValue
|
||||
}) {
|
||||
} = _ref3;
|
||||
return nodeValue;
|
||||
}
|
||||
|
||||
|
@ -2905,14 +2975,15 @@ function to_dom_remove(node) {
|
|||
return node.parentNode.removeChild(node);
|
||||
}
|
||||
|
||||
function toDom({
|
||||
function toDom(_ref4) {
|
||||
let {
|
||||
value,
|
||||
multilineTag,
|
||||
prepareEditableTree,
|
||||
isEditableTree = true,
|
||||
placeholder,
|
||||
doc = document
|
||||
}) {
|
||||
} = _ref4;
|
||||
let startPath = [];
|
||||
let endPath = [];
|
||||
|
||||
|
@ -2980,14 +3051,15 @@ function toDom({
|
|||
* @param {string} [$1.placeholder] Placeholder text.
|
||||
*/
|
||||
|
||||
function apply({
|
||||
function apply(_ref5) {
|
||||
let {
|
||||
value,
|
||||
current,
|
||||
multilineTag,
|
||||
prepareEditableTree,
|
||||
__unstableDomOnly,
|
||||
placeholder
|
||||
}) {
|
||||
} = _ref5;
|
||||
// Construct a new element tree in memory.
|
||||
const {
|
||||
body,
|
||||
|
@ -3078,10 +3150,11 @@ function isRangeEqual(a, b) {
|
|||
return a.startContainer === b.startContainer && a.startOffset === b.startOffset && a.endContainer === b.endContainer && a.endOffset === b.endOffset;
|
||||
}
|
||||
|
||||
function applySelection({
|
||||
function applySelection(_ref6, current) {
|
||||
let {
|
||||
startPath,
|
||||
endPath
|
||||
}, current) {
|
||||
} = _ref6;
|
||||
const {
|
||||
node: startContainer,
|
||||
offset: startOffset
|
||||
|
@ -3158,11 +3231,12 @@ var external_wp_escapeHtml_ = __webpack_require__("Vx3V");
|
|||
* @return {string} HTML string.
|
||||
*/
|
||||
|
||||
function toHTMLString({
|
||||
function toHTMLString(_ref) {
|
||||
let {
|
||||
value,
|
||||
multilineTag,
|
||||
preserveWhiteSpace
|
||||
}) {
|
||||
} = _ref;
|
||||
const tree = toTree({
|
||||
value,
|
||||
multilineTag,
|
||||
|
@ -3183,9 +3257,10 @@ function to_html_string_createEmpty() {
|
|||
return {};
|
||||
}
|
||||
|
||||
function to_html_string_getLastChild({
|
||||
function to_html_string_getLastChild(_ref2) {
|
||||
let {
|
||||
children
|
||||
}) {
|
||||
} = _ref2;
|
||||
return children && children[children.length - 1];
|
||||
}
|
||||
|
||||
|
@ -3206,21 +3281,24 @@ function to_html_string_appendText(object, text) {
|
|||
object.text += text;
|
||||
}
|
||||
|
||||
function to_html_string_getParent({
|
||||
function to_html_string_getParent(_ref3) {
|
||||
let {
|
||||
parent
|
||||
}) {
|
||||
} = _ref3;
|
||||
return parent;
|
||||
}
|
||||
|
||||
function to_html_string_isText({
|
||||
function to_html_string_isText(_ref4) {
|
||||
let {
|
||||
text
|
||||
}) {
|
||||
} = _ref4;
|
||||
return typeof text === 'string';
|
||||
}
|
||||
|
||||
function to_html_string_getText({
|
||||
function to_html_string_getText(_ref5) {
|
||||
let {
|
||||
text
|
||||
}) {
|
||||
} = _ref5;
|
||||
return text;
|
||||
}
|
||||
|
||||
|
@ -3234,12 +3312,13 @@ function to_html_string_remove(object) {
|
|||
return object;
|
||||
}
|
||||
|
||||
function createElementHTML({
|
||||
function createElementHTML(_ref6) {
|
||||
let {
|
||||
type,
|
||||
attributes,
|
||||
object,
|
||||
children
|
||||
}) {
|
||||
} = _ref6;
|
||||
let attributeString = '';
|
||||
|
||||
for (const key in attributes) {
|
||||
|
@ -3257,7 +3336,8 @@ function createElementHTML({
|
|||
return `<${type}${attributeString}>${createChildrenHTML(children)}</${type}>`;
|
||||
}
|
||||
|
||||
function createChildrenHTML(children = []) {
|
||||
function createChildrenHTML() {
|
||||
let children = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
||||
return children.map(child => {
|
||||
if (child.html !== undefined) {
|
||||
return child.html;
|
||||
|
@ -3431,10 +3511,11 @@ function canOutdentListItems(value) {
|
|||
* @return {number|void} The line index.
|
||||
*/
|
||||
|
||||
function getTargetLevelLineIndex({
|
||||
function getTargetLevelLineIndex(_ref, lineIndex) {
|
||||
let {
|
||||
text,
|
||||
replacements
|
||||
}, lineIndex) {
|
||||
} = _ref;
|
||||
const startFormats = replacements[lineIndex] || [];
|
||||
let index = lineIndex;
|
||||
|
||||
|
@ -3518,10 +3599,11 @@ function indentListItems(value, rootFormat) {
|
|||
* @return {number|void} The parent list line index.
|
||||
*/
|
||||
|
||||
function getParentLineIndex({
|
||||
function getParentLineIndex(_ref, lineIndex) {
|
||||
let {
|
||||
text,
|
||||
replacements
|
||||
}, lineIndex) {
|
||||
} = _ref;
|
||||
const startFormats = replacements[lineIndex] || [];
|
||||
let index = lineIndex;
|
||||
|
||||
|
@ -3554,10 +3636,11 @@ function getParentLineIndex({
|
|||
* @return {number} The index of the last child.
|
||||
*/
|
||||
|
||||
function getLastChildIndex({
|
||||
function getLastChildIndex(_ref, lineIndex) {
|
||||
let {
|
||||
text,
|
||||
replacements
|
||||
}, lineIndex) {
|
||||
} = _ref;
|
||||
const lineFormats = replacements[lineIndex] || []; // Use the given line index in case there are no next children.
|
||||
|
||||
let childIndex = lineIndex; // `lineIndex` could be `undefined` if it's the first line.
|
||||
|
@ -3743,11 +3826,12 @@ var external_wp_element_ = __webpack_require__("GRId");
|
|||
* @return {Element|Range} The active element or selection range.
|
||||
*/
|
||||
|
||||
function useAnchorRef({
|
||||
function useAnchorRef(_ref) {
|
||||
let {
|
||||
ref,
|
||||
value,
|
||||
settings = {}
|
||||
}) {
|
||||
} = _ref;
|
||||
const {
|
||||
tagName,
|
||||
className,
|
||||
|
@ -3839,9 +3923,10 @@ function useDefaultStyle() {
|
|||
* change.
|
||||
*/
|
||||
|
||||
function useBoundaryStyle({
|
||||
function useBoundaryStyle(_ref) {
|
||||
let {
|
||||
record
|
||||
}) {
|
||||
} = _ref;
|
||||
const ref = Object(external_wp_element_["useRef"])();
|
||||
const {
|
||||
activeFormats = []
|
||||
|
@ -4175,12 +4260,13 @@ function useIndentListItemOnSpace(props) {
|
|||
* @return {RichTextValue} Mutated value.
|
||||
*/
|
||||
|
||||
function updateFormats({
|
||||
function updateFormats(_ref) {
|
||||
let {
|
||||
value,
|
||||
start,
|
||||
end,
|
||||
formats
|
||||
}) {
|
||||
} = _ref;
|
||||
// Start and end may be switched in case of delete.
|
||||
const min = Math.min(start, end);
|
||||
const max = Math.max(start, end);
|
||||
|
@ -4627,7 +4713,8 @@ function useSpace() {
|
|||
|
||||
|
||||
|
||||
function useRichText({
|
||||
function useRichText(_ref) {
|
||||
let {
|
||||
value = '',
|
||||
selectionStart,
|
||||
selectionEnd,
|
||||
|
@ -4642,7 +4729,7 @@ function useRichText({
|
|||
__unstableAfterParse,
|
||||
__unstableBeforeSerialize,
|
||||
__unstableAddInvisibleFormats
|
||||
}) {
|
||||
} = _ref;
|
||||
const registry = Object(external_wp_data_["useRegistry"])();
|
||||
const [, forceRender] = Object(external_wp_element_["useReducer"])(() => ({}));
|
||||
const ref = Object(external_wp_element_["useRef"])();
|
||||
|
@ -4665,9 +4752,10 @@ function useRichText({
|
|||
});
|
||||
}
|
||||
|
||||
function applyRecord(newRecord, {
|
||||
function applyRecord(newRecord) {
|
||||
let {
|
||||
domOnly
|
||||
} = {}) {
|
||||
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
apply({
|
||||
value: newRecord,
|
||||
current: ref.current,
|
||||
|
@ -4862,13 +4950,14 @@ function __experimentalRichText() {}
|
|||
*/
|
||||
|
||||
|
||||
function FormatEdit({
|
||||
function FormatEdit(_ref) {
|
||||
let {
|
||||
formatTypes,
|
||||
onChange,
|
||||
onFocus,
|
||||
value,
|
||||
forwardedRef
|
||||
}) {
|
||||
} = _ref;
|
||||
return formatTypes.map(settings => {
|
||||
const {
|
||||
name,
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -155,7 +155,9 @@ var external_wp_blocks_ = __webpack_require__("HSyU");
|
|||
|
||||
|
||||
|
||||
function rendererPath(block, attributes = null, urlQueryArgs = {}) {
|
||||
function rendererPath(block) {
|
||||
let attributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
||||
let urlQueryArgs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
||||
return Object(external_wp_url_["addQueryArgs"])(`/wp/v2/block-renderer/${block}`, {
|
||||
context: 'edit',
|
||||
...(null !== attributes ? {
|
||||
|
@ -165,18 +167,20 @@ function rendererPath(block, attributes = null, urlQueryArgs = {}) {
|
|||
});
|
||||
}
|
||||
|
||||
function DefaultEmptyResponsePlaceholder({
|
||||
function DefaultEmptyResponsePlaceholder(_ref) {
|
||||
let {
|
||||
className
|
||||
}) {
|
||||
} = _ref;
|
||||
return Object(external_wp_element_["createElement"])(external_wp_components_["Placeholder"], {
|
||||
className: className
|
||||
}, Object(external_wp_i18n_["__"])('Block rendered as empty.'));
|
||||
}
|
||||
|
||||
function DefaultErrorResponsePlaceholder({
|
||||
function DefaultErrorResponsePlaceholder(_ref2) {
|
||||
let {
|
||||
response,
|
||||
className
|
||||
}) {
|
||||
} = _ref2;
|
||||
const errorMessage = Object(external_wp_i18n_["sprintf"])( // translators: %s: error message describing the problem
|
||||
Object(external_wp_i18n_["__"])('Error loading block: %s'), response.errorMsg);
|
||||
return Object(external_wp_element_["createElement"])(external_wp_components_["Placeholder"], {
|
||||
|
@ -184,10 +188,11 @@ function DefaultErrorResponsePlaceholder({
|
|||
}, errorMessage);
|
||||
}
|
||||
|
||||
function DefaultLoadingResponsePlaceholder({
|
||||
function DefaultLoadingResponsePlaceholder(_ref3) {
|
||||
let {
|
||||
children,
|
||||
showLoader
|
||||
}) {
|
||||
} = _ref3;
|
||||
return Object(external_wp_element_["createElement"])("div", {
|
||||
style: {
|
||||
position: 'relative'
|
||||
|
@ -365,11 +370,12 @@ const ExportedServerSideRender = Object(external_wp_data_["withSelect"])(select
|
|||
}
|
||||
|
||||
return EMPTY_OBJECT;
|
||||
})(({
|
||||
})(_ref => {
|
||||
let {
|
||||
urlQueryArgs = EMPTY_OBJECT,
|
||||
currentPostId,
|
||||
...props
|
||||
}) => {
|
||||
} = _ref;
|
||||
const newUrlQueryArgs = Object(external_wp_element_["useMemo"])(() => {
|
||||
if (!currentPostId) {
|
||||
return urlQueryArgs;
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
/*! This file is auto-generated */
|
||||
this.wp=this.wp||{},this.wp.serverSideRender=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s="4dqW")}({"1ZqX":function(e,t){e.exports=window.wp.data},"4dqW":function(e,t,r){"use strict";r.r(t);var n=r("wx14"),o=r("GRId"),c=r("1ZqX"),u=r("NMb1"),s=r.n(u),l=r("YLtl"),i=r("K9lf"),a=r("l3Sj"),d=r("ywyh"),p=r.n(d),f=r("Mmq9"),b=r("tI+e"),w=r("HSyU");function O({className:e}){return Object(o.createElement)(b.Placeholder,{className:e},Object(a.__)("Block rendered as empty."))}function j({response:e,className:t}){const r=Object(a.sprintf)(Object(a.__)("Error loading block: %s"),e.errorMsg);return Object(o.createElement)(b.Placeholder,{className:t},r)}function m({children:e,showLoader:t}){return Object(o.createElement)("div",{style:{position:"relative"}},t&&Object(o.createElement)("div",{style:{position:"absolute",top:"50%",left:"50%",marginTop:"-9px",marginLeft:"-9px"}},Object(o.createElement)(b.Spinner,null)),Object(o.createElement)("div",{style:{opacity:t?"0.3":1}},e))}function y(e){const{attributes:t,block:r,className:c,httpMethod:u="GET",urlQueryArgs:s,EmptyResponsePlaceholder:a=O,ErrorResponsePlaceholder:d=j,LoadingResponsePlaceholder:b=m}=e,y=Object(o.useRef)(!0),[h,v]=Object(o.useState)(!1),S=Object(o.useRef)(),[E,x]=Object(o.useState)(null),g=Object(i.usePrevious)(e),[P,M]=Object(o.useState)(!1);function R(){if(!y.current)return;M(!0);const e=t&&Object(w.__experimentalSanitizeBlockAttributes)(r,t),n="POST"===u,o=function(e,t=null,r={}){return Object(f.addQueryArgs)("/wp/v2/block-renderer/"+e,{context:"edit",...null!==t?{attributes:t}:{},...r})}(r,n?null:null!=e?e:null,s),c=n?{attributes:null!=e?e:null}:null,l=S.current=p()({path:o,data:c,method:n?"POST":"GET"}).then(e=>{y.current&&l===S.current&&e&&x(e.rendered)}).catch(e=>{y.current&&l===S.current&&x({error:!0,errorMsg:e.message})}).finally(()=>{y.current&&l===S.current&&M(!1)});return l}const _=Object(i.useDebounce)(R,500);Object(o.useEffect)(()=>()=>{y.current=!1},[]),Object(o.useEffect)(()=>{void 0===g?R():Object(l.isEqual)(g,e)||_()}),Object(o.useEffect)(()=>{if(!P)return;const e=setTimeout(()=>{v(!0)},1e3);return()=>clearTimeout(e)},[P]);const T=!!E,N=""===E,L=null==E?void 0:E.error;return N||!T?Object(o.createElement)(a,e):L?Object(o.createElement)(d,Object(n.a)({response:E},e)):P?Object(o.createElement)(b,Object(n.a)({},e,{showLoader:h}),T&&Object(o.createElement)(o.RawHTML,{className:c},E)):Object(o.createElement)(o.RawHTML,{className:c},E)}const h={},v=Object(c.withSelect)(e=>{const t=e("core/editor");if(t){const e=t.getCurrentPostId();if(e&&"number"==typeof e)return{currentPostId:e}}return h})(({urlQueryArgs:e=h,currentPostId:t,...r})=>{const c=Object(o.useMemo)(()=>t?{post_id:t,...e}:e,[t,e]);return Object(o.createElement)(y,Object(n.a)({urlQueryArgs:c},r))});window&&window.wp&&window.wp.components&&(window.wp.components.ServerSideRender=Object(o.forwardRef)((e,t)=>(s()("wp.components.ServerSideRender",{since:"5.3",alternative:"wp.serverSideRender"}),Object(o.createElement)(v,Object(n.a)({},e,{ref:t})))));t.default=v},GRId:function(e,t){e.exports=window.wp.element},HSyU:function(e,t){e.exports=window.wp.blocks},K9lf:function(e,t){e.exports=window.wp.compose},Mmq9:function(e,t){e.exports=window.wp.url},NMb1:function(e,t){e.exports=window.wp.deprecated},YLtl:function(e,t){e.exports=window.lodash},l3Sj:function(e,t){e.exports=window.wp.i18n},"tI+e":function(e,t){e.exports=window.wp.components},wx14:function(e,t,r){"use strict";function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}r.d(t,"a",(function(){return n}))},ywyh:function(e,t){e.exports=window.wp.apiFetch}}).default;
|
||||
this.wp=this.wp||{},this.wp.serverSideRender=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s="4dqW")}({"1ZqX":function(e,t){e.exports=window.wp.data},"4dqW":function(e,t,r){"use strict";r.r(t);var n=r("wx14"),o=r("GRId"),c=r("1ZqX"),u=r("NMb1"),l=r.n(u),s=r("YLtl"),i=r("K9lf"),a=r("l3Sj"),d=r("ywyh"),p=r.n(d),f=r("Mmq9"),b=r("tI+e"),w=r("HSyU");function O(e){let{className:t}=e;return Object(o.createElement)(b.Placeholder,{className:t},Object(a.__)("Block rendered as empty."))}function j(e){let{response:t,className:r}=e;const n=Object(a.sprintf)(Object(a.__)("Error loading block: %s"),t.errorMsg);return Object(o.createElement)(b.Placeholder,{className:r},n)}function m(e){let{children:t,showLoader:r}=e;return Object(o.createElement)("div",{style:{position:"relative"}},r&&Object(o.createElement)("div",{style:{position:"absolute",top:"50%",left:"50%",marginTop:"-9px",marginLeft:"-9px"}},Object(o.createElement)(b.Spinner,null)),Object(o.createElement)("div",{style:{opacity:r?"0.3":1}},t))}function y(e){const{attributes:t,block:r,className:c,httpMethod:u="GET",urlQueryArgs:l,EmptyResponsePlaceholder:a=O,ErrorResponsePlaceholder:d=j,LoadingResponsePlaceholder:b=m}=e,y=Object(o.useRef)(!0),[h,v]=Object(o.useState)(!1),S=Object(o.useRef)(),[g,E]=Object(o.useState)(null),x=Object(i.usePrevious)(e),[P,M]=Object(o.useState)(!1);function R(){if(!y.current)return;M(!0);const e=t&&Object(w.__experimentalSanitizeBlockAttributes)(r,t),n="POST"===u,o=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object(f.addQueryArgs)("/wp/v2/block-renderer/"+e,{context:"edit",...null!==t?{attributes:t}:{},...r})}(r,n?null:null!=e?e:null,l),c=n?{attributes:null!=e?e:null}:null,s=S.current=p()({path:o,data:c,method:n?"POST":"GET"}).then(e=>{y.current&&s===S.current&&e&&E(e.rendered)}).catch(e=>{y.current&&s===S.current&&E({error:!0,errorMsg:e.message})}).finally(()=>{y.current&&s===S.current&&M(!1)});return s}const _=Object(i.useDebounce)(R,500);Object(o.useEffect)(()=>()=>{y.current=!1},[]),Object(o.useEffect)(()=>{void 0===x?R():Object(s.isEqual)(x,e)||_()}),Object(o.useEffect)(()=>{if(!P)return;const e=setTimeout(()=>{v(!0)},1e3);return()=>clearTimeout(e)},[P]);const T=!!g,N=""===g,L=null==g?void 0:g.error;return N||!T?Object(o.createElement)(a,e):L?Object(o.createElement)(d,Object(n.a)({response:g},e)):P?Object(o.createElement)(b,Object(n.a)({},e,{showLoader:h}),T&&Object(o.createElement)(o.RawHTML,{className:c},g)):Object(o.createElement)(o.RawHTML,{className:c},g)}const h={},v=Object(c.withSelect)(e=>{const t=e("core/editor");if(t){const e=t.getCurrentPostId();if(e&&"number"==typeof e)return{currentPostId:e}}return h})(e=>{let{urlQueryArgs:t=h,currentPostId:r,...c}=e;const u=Object(o.useMemo)(()=>r?{post_id:r,...t}:t,[r,t]);return Object(o.createElement)(y,Object(n.a)({urlQueryArgs:u},c))});window&&window.wp&&window.wp.components&&(window.wp.components.ServerSideRender=Object(o.forwardRef)((e,t)=>(l()("wp.components.ServerSideRender",{since:"5.3",alternative:"wp.serverSideRender"}),Object(o.createElement)(v,Object(n.a)({},e,{ref:t})))));t.default=v},GRId:function(e,t){e.exports=window.wp.element},HSyU:function(e,t){e.exports=window.wp.blocks},K9lf:function(e,t){e.exports=window.wp.compose},Mmq9:function(e,t){e.exports=window.wp.url},NMb1:function(e,t){e.exports=window.wp.deprecated},YLtl:function(e,t){e.exports=window.lodash},l3Sj:function(e,t){e.exports=window.wp.i18n},"tI+e":function(e,t){e.exports=window.wp.components},wx14:function(e,t,r){"use strict";function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}r.d(t,"a",(function(){return n}))},ywyh:function(e,t){e.exports=window.wp.apiFetch}}).default;
|
|
@ -146,7 +146,8 @@ __webpack_require__.r(__webpack_exports__);
|
|||
* @return {?WPShortcodeMatch} Matched information.
|
||||
*/
|
||||
|
||||
function next(tag, text, index = 0) {
|
||||
function next(tag, text) {
|
||||
let index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
||||
const re = regexp(tag);
|
||||
re.lastIndex = index;
|
||||
const match = re.exec(text);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue