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:
noisysocks 2021-11-15 12:50:17 +00:00
parent 5b85c73194
commit c2d0fb2040
115 changed files with 16929 additions and 12278 deletions

View File

@ -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

View File

@ -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, '/' )
);

View File

@ -107,47 +107,51 @@ 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 ) {
$post = get_post( $post_id );
if ( ! $post || 'publish' !== $post->post_status || 'post' !== $post->post_type ) {
return;
}
block_core_calendar_update_has_published_posts();
/**
* 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;
}
/**
* Handler for updating the has published posts flag when a post status changes.
*
* @param string $new_status The status the post is changing to.
* @param string $old_status The status the post is changing from.
* @param WP_Post $post Post object.
*/
function block_core_calendar_update_has_published_post_on_transition_post_status( $new_status, $old_status, $post ) {
if ( $new_status === $old_status ) {
return;
}
$post = get_post( $post_id );
if ( 'post' !== get_post_type( $post ) ) {
return;
}
if ( 'publish' !== $new_status && 'publish' !== $old_status ) {
return;
}
block_core_calendar_update_has_published_posts();
if ( ! $post || 'publish' !== $post->post_status || 'post' !== $post->post_type ) {
return;
}
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 );
block_core_calendar_update_has_published_posts();
}
/**
* Handler for updating the has published posts flag when a post status changes.
*
* @param string $new_status The status the post is changing to.
* @param string $old_status The status the post is changing from.
* @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;
}
if ( 'post' !== get_post_type( $post ) ) {
return;
}
if ( 'publish' !== $new_status && 'publish' !== $old_status ) {
return;
}
block_core_calendar_update_has_published_posts();
}
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 );

View File

@ -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 = '';

View File

@ -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

View File

@ -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

View File

@ -244,14 +244,21 @@
/**
* 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-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,
.wp-block-navigation.items-justified-right .wp-block-navigation__container .has-child .wp-block-navigation__submenu-container {
right: auto;
left: 0;
}
right: auto;
left: 0;
}
.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,
@ -260,6 +267,7 @@
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

View File

@ -244,14 +244,21 @@
/**
* 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-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,
.wp-block-navigation.items-justified-right .wp-block-navigation__container .has-child .wp-block-navigation__submenu-container {
left: auto;
right: 0;
}
left: auto;
right: 0;
}
.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,
@ -260,6 +267,7 @@
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

View File

@ -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

View File

@ -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

View File

@ -1650,14 +1650,21 @@ 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-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,
.wp-block-navigation.items-justified-right .wp-block-navigation__container .has-child .wp-block-navigation__submenu-container {
right: auto;
left: 0;
}
right: auto;
left: 0;
}
.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,
@ -1666,6 +1673,7 @@ ul.has-background {
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

View File

@ -1672,14 +1672,21 @@ 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-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,
.wp-block-navigation.items-justified-right .wp-block-navigation__container .has-child .wp-block-navigation__submenu-container {
left: auto;
right: 0;
}
left: auto;
right: 0;
}
.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,
@ -1688,6 +1695,7 @@ ul.has-background {
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

View File

@ -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

View File

@ -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

View File

@ -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';

View File

@ -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}});

View File

@ -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, {
removeAnnotation,
updateAnnotationRange
}) {
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, {
richTextIdentifier,
blockClientId
}) {
__experimentalGetPropsForEditableTreePreparation(select, _ref2) {
let {
richTextIdentifier,
blockClientId
} = _ref2;
return {
annotations: select(STORE_NAME).__experimentalGetAnnotationsForRichText(blockClientId, richTextIdentifier)
};
},
__experimentalCreatePrepareEditableTree({
annotations
}) {
__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, {
clientId,
className
}) => {
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({
blockClientId,
richTextIdentifier = null,
range = null,
selector = 'range',
source = 'default',
id = Object(v4["a" /* default */])()
}) {
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

View File

@ -288,14 +288,17 @@ function createPreloadingMiddleware(preloadedData) {
* @return {import('../types').APIFetchOptions} The request with the modified query args
*/
const modifyQuery = ({
path,
url,
...options
}, queryArgs) => ({ ...options,
url: url && Object(external_wp_url_["addQueryArgs"])(url, queryArgs),
path: path && Object(external_wp_url_["addQueryArgs"])(path, queryArgs)
});
const modifyQuery = (_ref, queryArgs) => {
let {
path,
url,
...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

View File

@ -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

View File

@ -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 = {
installedBlockTypes: [],
isInstalling: {}
}, action) => {
const blockManagement = function () {
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
installedBlockTypes: [],
isInstalling: {}
};
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(({
name
}) => name === blockType.name)) {
if (blocks.some(_ref => {
let {
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 ({
registry,
dispatch
}) => {
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 ({
registry,
dispatch
}) => {
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 ({
dispatch
}) => {
const resolvers_getDownloadableBlocks = filterValue => async _ref => {
let {
dispatch
} = _ref;
if (!filterValue) {
return;
}
@ -947,9 +967,10 @@ var star_empty = __webpack_require__("Xxwi");
function Stars({
rating
}) {
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 = ({
rating
}) => Object(external_wp_element_["createElement"])("span", {
className: "block-directory-block-ratings"
}, Object(external_wp_element_["createElement"])(block_ratings_stars, {
rating: rating
}));
const BlockRatings = _ref => {
let {
rating
} = _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({
icon
}) {
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 = ({
block
}) => {
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({
title,
rating,
ratingCount
}, {
hasNotice,
isInstalled,
isInstalling
}) {
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({
composite,
item,
onClick
}) {
function DownloadableBlockListItem(_ref3) {
let {
composite,
item,
onClick
} = _ref3;
const {
author,
description,
@ -1216,11 +1245,12 @@ function DownloadableBlockListItem({
function DownloadableBlocksList({
items,
onHover = external_lodash_["noop"],
onSelect
}) {
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({
children,
downloadableItems,
hasLocalBlocks
}) {
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,15 +1378,17 @@ function DownloadableBlocksNoResults() {
function DownloadableBlocksPanel({
downloadableItems,
onSelect,
onHover,
hasLocalBlocks,
hasPermission,
isLoading,
isTyping
}) {
function DownloadableBlocksPanel(_ref) {
let {
downloadableItems,
onSelect,
onHover,
hasLocalBlocks,
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, {
filterValue,
rootClientId = null
}) => {
/* 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, ({
onSelect,
onHover,
filterValue,
hasItems,
rootClientId
}) => {
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,35 +1511,40 @@ var external_wp_editPost_ = __webpack_require__("BLhE");
*/
function CompactList({
items
}) {
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(({
icon,
id,
title,
author
}) => Object(external_wp_element_["createElement"])("li", {
key: id,
className: "block-directory-compact-list__item"
}, Object(external_wp_element_["createElement"])(downloadable_block_icon, {
icon: icon,
title: title
}), Object(external_wp_element_["createElement"])("div", {
className: "block-directory-compact-list__item-details"
}, Object(external_wp_element_["createElement"])("div", {
className: "block-directory-compact-list__item-title"
}, title), Object(external_wp_element_["createElement"])("div", {
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))))));
}, items.map(_ref2 => {
let {
icon,
id,
title,
author
} = _ref2;
return Object(external_wp_element_["createElement"])("li", {
key: id,
className: "block-directory-compact-list__item"
}, Object(external_wp_element_["createElement"])(downloadable_block_icon, {
icon: icon,
title: title
}), Object(external_wp_element_["createElement"])("div", {
className: "block-directory-compact-list__item-details"
}, Object(external_wp_element_["createElement"])("div", {
className: "block-directory-compact-list__item-title"
}, title), Object(external_wp_element_["createElement"])("div", {
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))));
}));
}
// 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({
attributes,
block,
clientId
}) {
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(({
name
}) => originalName === name);
const blocks = getDownloadableBlocks('block:' + originalName).filter(_ref => {
let {
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 = ({
originalBlock,
...props
}) => {
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({
icon,
size = 24,
...props
}) {
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

View File

@ -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(({
source
}) => 'block' !== source)], style => style.name);
})), ...Object(external_lodash_["get"])(state, [blockType.name], []).filter(_ref => {
let {
source
} = _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(({
source
}) => 'block' !== source)], variation => variation.name);
})), ...Object(external_lodash_["get"])(state, [blockType.name], []).filter(_ref2 => {
let {
source
} = _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);
}), ({
name
}) => name);
}), _ref => {
let {
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({
textdomain,
...metadata
}) {
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, {
title,
icon
}) {
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(), ({
name
}) => getBlockTransforms(direction, name));
return Object(external_lodash_["flatMap"])(registration_getBlockTypes(), _ref => {
let {
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, {
isInnerBlocks = false
} = {}) {
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(({
log,
args
}) => log(...args));
validationIssues.forEach(_ref => {
let {
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(), ({
isMatch
}) => isMatch(node));
const rawTransform = findTransform(getRawTransforms(), _ref => {
let {
isMatch
} = _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(({
nodeValue = ''
}) => nodeValue).join('');
return Array.from(element.childNodes).map(_ref => {
let {
nodeValue = ''
} = _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(({
isMatch,
blockName,
schema
}) => {
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({
HTML = '',
plainText = '',
mode = 'AUTO',
tagName,
preserveWhiteSpace
}) {
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({
HTML = ''
}) {
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 = ({
children,
innerBlocks
}) => {
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

View File

@ -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', ({
clearSelection,
trigger
}) => {
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', ({
clearSelection
}) => {
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({
onDragStart,
onDragMove,
onDragEnd
}) {
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, {
bindGlobal = false,
eventName = 'keydown',
isDisabled = false,
// This is important for performance considerations.
target
} = {}) {
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) =>
/* eslint-enable jsdoc/valid-types */
currentCallback.current(...args), eventName);
mousetrap[bindFn](shortcut, function () {
return (
/* eslint-enable jsdoc/valid-types */
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 = {
step: 1
}) {
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,15 +2142,16 @@ function useFreshRef(value) {
*/
function useDropZone({
isDisabled,
onDrop: _onDrop,
onDragStart: _onDragStart,
onDragEnter: _onDragEnter,
onDragLeave: _onDragLeave,
onDragEnd: _onDragEnd,
onDragOver: _onDragOver
}) {
function useDropZone(_ref) {
let {
isDisabled,
onDrop: _onDrop,
onDragStart: _onDragStart,
onDragEnter: _onDragEnter,
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

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -174,10 +174,11 @@ var external_wp_compose_ = __webpack_require__("K9lf");
function CopyButton({
text,
children
}) {
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({
inspector,
closeMenu,
...props
}) {
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({
setIsOpened
}) {
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({
keyCombination,
forceAriaLabel
}) {
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({
description,
keyCombination,
aliases = [],
ariaLabel
}) {
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({
name
}) {
function DynamicShortcut(_ref) {
let {
name
} = _ref;
const {
keyCombination,
description,
@ -622,44 +631,52 @@ function DynamicShortcut({
const ShortcutList = ({
shortcuts
}) =>
/*
* Disable reason: The `list` ARIA role is redundant but
* Safari+VoiceOver won't announce the list otherwise.
*/
const ShortcutList = _ref => {
let {
shortcuts
} = _ref;
return (
/*
* Disable reason: The `list` ARIA role is redundant but
* Safari+VoiceOver won't announce the list otherwise.
*/
/* eslint-disable jsx-a11y/no-redundant-roles */
Object(external_wp_element_["createElement"])("ul", {
className: "customize-widgets-keyboard-shortcut-help-modal__shortcut-list",
role: "list"
}, shortcuts.map((shortcut, index) => Object(external_wp_element_["createElement"])("li", {
className: "customize-widgets-keyboard-shortcut-help-modal__shortcut",
key: index
}, Object(external_lodash_["isString"])(shortcut) ? Object(external_wp_element_["createElement"])(dynamic_shortcut, {
name: shortcut
}) : Object(external_wp_element_["createElement"])(keyboard_shortcut_help_modal_shortcut, shortcut))))
/* eslint-enable jsx-a11y/no-redundant-roles */
;
/* eslint-disable jsx-a11y/no-redundant-roles */
Object(external_wp_element_["createElement"])("ul", {
className: "customize-widgets-keyboard-shortcut-help-modal__shortcut-list",
role: "list"
}, shortcuts.map((shortcut, index) => Object(external_wp_element_["createElement"])("li", {
className: "customize-widgets-keyboard-shortcut-help-modal__shortcut",
key: index
}, Object(external_lodash_["isString"])(shortcut) ? Object(external_wp_element_["createElement"])(dynamic_shortcut, {
name: shortcut
}) : Object(external_wp_element_["createElement"])(keyboard_shortcut_help_modal_shortcut, shortcut))))
/* eslint-enable jsx-a11y/no-redundant-roles */
const ShortcutSection = ({
title,
shortcuts,
className
}) => 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 = ({
title,
categoryName,
additionalShortcuts = []
}) => {
const ShortcutSection = _ref2 => {
let {
title,
shortcuts,
className
} = _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 = _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({
isModalActive,
toggleModal
}) {
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({
sidebar,
inserter,
isInserterOpened,
setIsInserterOpened,
isFixedToolbarActive
}) {
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({
id,
idBase,
number,
instance
}) {
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({
api,
sidebarControls,
children
}) {
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({
sidebar,
settings,
children
}) {
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({
sidebar
}) {
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({
undo,
redo,
save
}) {
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({
blockEditorSettings,
sidebar,
inserter,
inspector
}) {
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 = ({
onError,
...argumentsObject
}) => {
mediaUploadBlockEditor = _ref2 => {
let {
onError,
...argumentsObject
} = _ref2;
Object(external_wp_mediaUtils_["uploadMedia"])({
wpAllowedMimeTypes: blockEditorSettings.allowedMimeTypes,
onError: ({
message
}) => onError(message),
onError: _ref3 => {
let {
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, ({
onClose
}) => Object(external_wp_element_["createElement"])(block_inspector_button, {
inspector: inspector,
closeMenu: onClose
})));
}, 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
} = _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({
sidebarControls,
activeSidebarControl,
children
}) {
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({
api,
sidebarControls,
blockEditorSettings
}) {
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({
returnFocusWhenClose
} = {}) {
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 = {}, {
type,
itemType,
scope,
item
}) {
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 = {}, {
type,
itemType,
scope,
item,
isEnable
}) {
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 ({
select,
dispatch
}) {
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({
as = external_wp_components_["Button"],
scope,
identifier,
icon,
selectedIcon,
...props
}) {
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 = ({
smallScreenTitle,
children,
className,
toggleButtonProps
}) => {
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({
name,
as: Component = external_wp_components_["ButtonGroup"],
fillProps = {},
bubblesVirtually,
...props
}) {
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, ({
props: {
__unstableExplicitMenuItem,
__unstableTarget
}
}) => {
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({
name,
as: Component = external_wp_components_["Button"],
onClick,
...props
}) {
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
}, ({
onClick: fpOnClick
}) => {
}, _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({
scope,
target,
__unstableExplicitMenuItem,
...props
}) {
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({
scope,
...props
}) {
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({
scope,
className,
...props
}) {
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({
scope,
...props
}) {
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({
scope,
children,
className
}) {
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,24 +3758,25 @@ function useAdjustComplementaryListener(scope, identifier, activeArea, isActive,
}, [isActive, isSmall, scope, identifier, activeArea]);
}
function ComplementaryArea({
children,
className,
closeLabel = Object(external_wp_i18n_["__"])('Close plugin'),
identifier,
header,
headerClassName,
icon,
isPinnable = true,
panelClassName,
scope,
name,
smallScreenTitle,
title,
toggleShortcut,
isActiveByDefault,
showIconLabels = false
}) {
function ComplementaryArea(_ref3) {
let {
children,
className,
closeLabel = Object(external_wp_i18n_["__"])('Close plugin'),
identifier,
header,
headerClassName,
icon,
isPinnable = true,
panelClassName,
scope,
name,
smallScreenTitle,
title,
toggleShortcut,
isActiveByDefault,
showIconLabels = false
} = _ref3;
const {
isActive,
isPinned,
@ -3796,9 +3862,10 @@ ComplementaryAreaWrapped.Slot = ComplementaryAreaSlot;
*/
const FullscreenMode = ({
isActive
}) => {
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,19 +3940,20 @@ function useHTMLClass(className) {
}, [className]);
}
function InterfaceSkeleton({
footer,
header,
sidebar,
secondarySidebar,
notices,
content,
drawer,
actions,
labels,
className,
shortcuts
}, ref) {
function InterfaceSkeleton(_ref, ref) {
let {
footer,
header,
sidebar,
secondarySidebar,
notices,
content,
drawer,
actions,
labels,
className,
shortcuts
} = _ref;
const navigateRegionsProps = Object(external_wp_components_["__unstableUseNavigateRegions"])(shortcuts);
useHTMLClass('interface-interface-skeleton__html-container');
const defaultLabels = {
@ -3978,16 +4046,17 @@ var more_vertical = __webpack_require__("VKE3");
function MoreMenuDropdown({
as: DropdownComponent = external_wp_components_["DropdownMenu"],
className,
function MoreMenuDropdown(_ref) {
let {
as: DropdownComponent = external_wp_components_["DropdownMenu"],
className,
/* translators: button label text should, if possible, be under 16 characters. */
label = Object(external_wp_i18n_["__"])('Options'),
popoverProps,
toggleProps,
children
}) {
/* translators: button label text should, if possible, be under 16 characters. */
label = Object(external_wp_i18n_["__"])('Options'),
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,15 +4092,16 @@ var external_wp_a11y_ = __webpack_require__("gdqT");
*/
function MoreMenuFeatureToggle({
scope,
label,
info,
messageActivated,
messageDeactivated,
shortcut,
feature
}) {
function MoreMenuFeatureToggle(_ref) {
let {
scope,
label,
info,
messageActivated,
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

View File

@ -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: ({
promise
}) => promise,
AWAIT_PROMISE: _ref => {
let {
promise
} = _ref;
return promise;
},
API_FETCH({
request
}) {
API_FETCH(_ref2) {
let {
request
} = _ref2;
return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default()(request);
}

View File

@ -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}});

View File

@ -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 => ({
storeKey,
selectorName,
args
}) => registry.select(storeKey)[selectorName](...args)),
[RESOLVE_SELECT]: createRegistryControl(registry => ({
storeKey,
selectorName,
args
}) => {
[SELECT]: createRegistryControl(registry => _ref => {
let {
storeKey,
selectorName,
args
} = _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 => ({
storeKey,
actionName,
args
}) => registry.dispatch(storeKey)[actionName](...args))
[DISPATCH]: createRegistryControl(registry => _ref3 => {
let {
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 =
/** @type {Record<string, TState>} */
{}, action) => {
const onSubKey = actionProperty => reducer => function () {
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] :
/** @type {Record<string, TState>} */
{};
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,25 +2361,31 @@ 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 => {
const hasFinished = () => selectors.hasFinishedResolution(selectorName, args);
const getResult = () => selector.apply(null, args); // trigger the selector (to trigger the resolver)
const result = getResult();
if (hasFinished()) {
return resolve(result);
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];
}
const unsubscribe = store.subscribe(() => {
return new Promise(resolve => {
const hasFinished = () => selectors.hasFinishedResolution(selectorName, args);
const getResult = () => selector.apply(null, args); // trigger the selector (to trigger the resolver)
const result = getResult();
if (hasFinished()) {
unsubscribe();
resolve(getResult());
return resolve(result);
}
const unsubscribe = store.subscribe(() => {
if (hasFinished()) {
unsubscribe();
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

View File

@ -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,

View File

@ -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;

View File

@ -131,8 +131,8 @@ function domReady(callback) {
if (document.readyState === 'complete' || // DOMContentLoaded + Images/Styles/etc loaded, so we call directly.
document.readyState === 'interactive' // DOMContentLoaded fires at this point, so we call directly.
) {
return void callback();
} // DOMContentLoaded has not fired yet, delay callback until then.
return void callback();
} // DOMContentLoaded has not fired yet, delay callback until then.
document.addEventListener('DOMContentLoaded', callback);

View File

@ -226,9 +226,11 @@ function isValidFocusableArea(element) {
*/
function find(context, {
sequential = false
} = {}) {
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(({
width
}) => width > 1); // If it's full of tiny selections, return browser default.
const filteredRects = rects.filter(_ref => {
let {
width
} = _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(({
top
}) => top));
const lowestBottom = Math.max(...rects.map(({
bottom
}) => bottom));
const highestTop = Math.min(...rects.map(_ref => {
let {
top
} = _ref;
return top;
}));
const lowestBottom = Math.max(...rects.map(_ref2 => {
let {
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(({
name
}) => {
Array.from(node.attributes).forEach(_ref => {
let {
name
} = _ref;
if (name !== 'class' && !Object(external_lodash_["includes"])(attributes, name)) {
node.removeAttribute(name);
}
@ -1899,14 +1914,12 @@ function cleanNodeList(nodeList, doc, schema, inline) {
const mattchers = classes.map(item => {
if (typeof item === 'string') {
return (
/** @type {string} */
className => className === item
);
/** @type {string} */
className) => className === item;
} else if (item instanceof RegExp) {
return (
/** @type {string} */
className => item.test(className)
);
/** @type {string} */
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(({
name,
type,
size
}) => name === file.name && type === file.type && size === file.size)) {
if (file && !files.find(_ref => {
let {
name,
type,
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

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

View File

@ -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({
children,
...props
}) {
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

View File

@ -283,11 +283,12 @@ const keyboardReturn = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["c
* @return {JSX.Element} Icon component
*/
function Icon({
icon,
size = 24,
...props
}) {
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({
isActive,
value,
onChange,
onFocus
}) {
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({
value,
onChange,
onFocus,
isActive
}) {
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({
value,
onChange,
activeObjectAttributes,
contentRef
}) {
function InlineUI(_ref) {
let {
value,
onChange,
activeObjectAttributes,
contentRef
} = _ref;
const {
style
} = activeObjectAttributes;
@ -613,14 +619,15 @@ function InlineUI({
})));
}
function Edit({
value,
onChange,
onFocus,
isObjectActive,
activeObjectAttributes,
contentRef
}) {
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: ({
id,
url,
alt,
width: imgWidth
}) => {
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: ({
open
}) => {
render: _ref4 => {
let {
open
} = _ref4;
open();
return null;
}
@ -711,12 +720,14 @@ const italic = {
tagName: 'em',
className: null,
edit({
isActive,
value,
onChange,
onFocus
}) {
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({
url,
type,
id,
opensInNewWindow
}) {
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,16 +1060,17 @@ function useLinkInstanceKey(instance) {
function InlineLinkUI({
isActive,
activeAttributes,
addingLink,
value,
onChange,
speak,
stopAddingLink,
contentRef
}) {
function InlineLinkUI(_ref) {
let {
isActive,
activeAttributes,
addingLink,
value,
onChange,
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({
isActive,
activeAttributes,
value,
onChange,
onFocus,
contentRef
}) {
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, {
html,
plainText
}) {
__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({
isActive,
value,
onChange,
onFocus
}) {
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({
value,
onChange
}) {
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({
name,
property,
value,
onChange
}) {
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({
name,
value,
onChange,
onClose,
contentRef
}) {
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, {
color,
backgroundColor
}) {
function fillComputedColors(element, _ref) {
let {
color,
backgroundColor
} = _ref;
if (!color && !backgroundColor) {
return;
}
@ -1736,13 +1766,14 @@ function fillComputedColors(element, {
};
}
function TextColorEdit({
value,
onChange,
isActive,
activeAttributes,
contentRef
}) {
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({
isActive,
value,
onChange,
onFocus
}) {
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({
isActive,
value,
onChange,
onFocus
}) {
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({
isActive,
value,
onChange,
onFocus
}) {
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(({
name,
...settings
}) => Object(external_wp_richText_["registerFormatType"])(name, settings));
default_formats.forEach(_ref => {
let {
name,
...settings
} = _ref;
return Object(external_wp_richText_["registerFormatType"])(name, settings);
});
/***/ }),

File diff suppressed because one or more lines are too long

View File

@ -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

View File

@ -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

View File

@ -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({
name,
category,
description,
keyCombination,
aliases
}) {
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(({
modifier,
character
}) => {
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, {
isDisabled
} = {}) {
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

View File

@ -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);

View File

@ -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)})}});

View File

@ -418,25 +418,32 @@ class import_form_ImportForm extends external_wp_element_["Component"] {
function ImportDropdown({
onUpload
}) {
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: ({
isOpen,
onToggle
}) => Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
"aria-expanded": isOpen,
onClick: onToggle,
variant: "primary"
}, Object(external_wp_i18n_["__"])('Import from JSON')),
renderContent: ({
onClose
}) => Object(external_wp_element_["createElement"])(import_form, {
onUpload: Object(external_lodash_["flow"])(onClose, onUpload)
})
renderToggle: _ref2 => {
let {
isOpen,
onToggle
} = _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: _ref3 => {
let {
onClose
} = _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

View File

@ -301,14 +301,15 @@ const getAttachmentsCollection = ids => {
};
class media_upload_MediaUpload extends external_wp_element_["Component"] {
constructor({
allowedTypes,
gallery = false,
unstableFeaturedImageFlow = false,
modalClass,
multiple = false,
title = Object(external_wp_i18n_["__"])('Select or Upload Media')
}) {
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,15 +601,16 @@ function getMimeTypesArray(wpMimeTypesObject) {
* @param {?Object} $0.wpAllowedMimeTypes List of allowed mime types and file extensions.
*/
async function uploadMedia({
allowedTypes,
additionalData = {},
filesList,
maxUploadFileSize,
onError = external_lodash_["noop"],
onFileChange,
wpAllowedMimeTypes = null
}) {
async function uploadMedia(_ref) {
let {
allowedTypes,
additionalData = {},
filesList,
maxUploadFileSize,
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

View File

@ -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;
}

View File

@ -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}});

View File

@ -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({
position = 'middle right',
children,
isVisible,
hasNextTip,
onDismiss,
onDisable
}) {
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, {
tipId
}) => {
/* 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, {
tipId
}) => {
}), Object(external_wp_data_["withDispatch"])((dispatch, _ref3) => {
let {
tipId
} = _ref3;
const {
dismissTip,
disableTips

File diff suppressed because one or more lines are too long

View File

@ -663,11 +663,12 @@ class plugin_area_PluginArea extends external_wp_element_["Component"] {
getCurrentPluginsState() {
return {
plugins: Object(external_lodash_["map"])(getPlugins(this.props.scope), ({
icon,
name,
render
}) => {
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, ({
context,
Plugin
}) => Object(external_wp_element_["createElement"])(Provider, {
key: context.name,
value: context
}, Object(external_wp_element_["createElement"])(Plugin, null))));
}, Object(external_lodash_["map"])(this.state.plugins, _ref2 => {
let {
context,
Plugin
} = _ref2;
return Object(external_wp_element_["createElement"])(Provider, {
key: context.name,
value: context
}, Object(external_wp_element_["createElement"])(Plugin, null));
}));
}
}

File diff suppressed because one or more lines are too long

View File

@ -199,11 +199,12 @@ const Stop = props => Object(external_wp_element_["createElement"])('stop', prop
* @return {JSX.Element} Stop component
*/
const SVG = ({
className,
isPressed,
...props
}) => {
const SVG = _ref => {
let {
className,
isPressed,
...props
} = _ref;
const appliedProps = { ...props,
className: classnames_default()(className, {
'is-pressed': isPressed

View File

@ -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

View File

@ -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

View File

@ -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 => ({
registry
}) => {
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 ({
registry,
dispatch
}) => {
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 ({
registry
}) => {
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({
clientIds,
rootClientId
}) {
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,46 +445,49 @@ function ReusableBlockConvertButton({
return null;
}
return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockSettingsMenuControls"], null, ({
onClose
}) => 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);
}
}, Object(external_wp_i18n_["__"])('Add to Reusable blocks')), isModalOpen && Object(external_wp_element_["createElement"])(external_wp_components_["Modal"], {
title: Object(external_wp_i18n_["__"])('Create Reusable block'),
closeLabel: Object(external_wp_i18n_["__"])('Close'),
onRequestClose: () => {
setIsModalOpen(false);
setTitle('');
},
overlayClassName: "reusable-blocks-menu-items__convert-modal"
}, Object(external_wp_element_["createElement"])("form", {
onSubmit: event => {
event.preventDefault();
onConvert(title);
setIsModalOpen(false);
setTitle('');
onClose();
}
}, Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], {
label: Object(external_wp_i18n_["__"])('Name'),
value: title,
onChange: setTitle
}), Object(external_wp_element_["createElement"])(external_wp_components_["Flex"], {
className: "reusable-blocks-menu-items__convert-modal-actions",
justify: "flex-end"
}, Object(external_wp_element_["createElement"])(external_wp_components_["FlexItem"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
variant: "secondary",
onClick: () => {
setIsModalOpen(false);
setTitle('');
}
}, 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'))))))));
return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockSettingsMenuControls"], null, _ref2 => {
let {
onClose
} = _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);
}
}, Object(external_wp_i18n_["__"])('Add to Reusable blocks')), isModalOpen && Object(external_wp_element_["createElement"])(external_wp_components_["Modal"], {
title: Object(external_wp_i18n_["__"])('Create Reusable block'),
closeLabel: Object(external_wp_i18n_["__"])('Close'),
onRequestClose: () => {
setIsModalOpen(false);
setTitle('');
},
overlayClassName: "reusable-blocks-menu-items__convert-modal"
}, Object(external_wp_element_["createElement"])("form", {
onSubmit: event => {
event.preventDefault();
onConvert(title);
setIsModalOpen(false);
setTitle('');
onClose();
}
}, Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], {
label: Object(external_wp_i18n_["__"])('Name'),
value: title,
onChange: setTitle
}), Object(external_wp_element_["createElement"])(external_wp_components_["Flex"], {
className: "reusable-blocks-menu-items__convert-modal-actions",
justify: "flex-end"
}, Object(external_wp_element_["createElement"])(external_wp_components_["FlexItem"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
variant: "secondary",
onClick: () => {
setIsModalOpen(false);
setTitle('');
}
}, 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')))))));
});
}
// EXTERNAL MODULE: external ["wp","url"]
@ -502,9 +512,10 @@ var external_wp_url_ = __webpack_require__("Mmq9");
function ReusableBlocksManageButton({
clientId
}) {
function ReusableBlocksManageButton(_ref) {
let {
clientId
} = _ref;
const {
isVisible
} = Object(external_wp_data_["useSelect"])(select => {
@ -553,10 +564,11 @@ function ReusableBlocksManageButton({
function ReusableBlocksMenuItems({
clientIds,
rootClientId
}) {
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

View File

@ -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), ({
className,
tagName
}) => {
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), ({
className
}) => {
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(({
type
}) => type !== format.type);
newFormats[index] = newFormats[index].filter(_ref => {
let {
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({
implementation
}, html) {
function createElement(_ref, html) {
let {
implementation
} = _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({
type,
attributes
}) {
function toFormat(_ref) {
let {
type,
attributes
} = _ref;
let formatType;
if (attributes && attributes.class) {
@ -1058,16 +1072,18 @@ function toFormat({
*/
function create({
element,
text,
html,
range,
multilineTag,
multilineWrapperTags,
__unstableIsEditableTree: isEditableTree,
preserveWhiteSpace
} = {}) {
function create() {
let {
element,
text,
html,
range,
multilineTag,
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,15 +1251,16 @@ function removeReservedCharacters(string) {
* @return {RichTextValue} A rich text value.
*/
function createFromElement({
element,
range,
multilineTag,
multilineWrapperTags,
currentWrapperTags = [],
isEditableTree,
preserveWhiteSpace
}) {
function createFromElement(_ref2) {
let {
element,
range,
multilineTag,
multilineWrapperTags,
currentWrapperTags = [],
isEditableTree,
preserveWhiteSpace
} = _ref2;
const accumulator = createEmptyValue();
if (!element) {
@ -1404,15 +1421,16 @@ function createFromElement({
*/
function createFromMultilineElement({
element,
range,
multilineTag,
multilineWrapperTags,
currentWrapperTags = [],
isEditableTree,
preserveWhiteSpace
}) {
function createFromMultilineElement(_ref3) {
let {
element,
range,
multilineTag,
multilineWrapperTags,
currentWrapperTags = [],
isEditableTree,
preserveWhiteSpace
} = _ref3;
const accumulator = createEmptyValue();
if (!element || !element.hasChildNodes()) {
@ -1463,9 +1481,11 @@ function createFromMultilineElement({
*/
function getAttributes({
element
}) {
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({
formats,
start,
end,
activeFormats
}, EMPTY_ACTIVE_FORMATS = []) {
function getActiveFormats(_ref) {
let {
formats,
start,
end,
activeFormats
} = _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({
start,
end,
replacements,
text
}) {
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({
text
}) {
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({
start,
text
}, startIndex = start) {
function getLineIndex(_ref) {
let {
start,
text
} = _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({
start,
end
}) {
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({
text
}) {
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({
text,
start,
end
}) {
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, {
formats,
replacements,
text
}) => ({
formats: accumlator.formats.concat(separator.formats, formats),
replacements: accumlator.replacements.concat(separator.replacements, replacements),
text: accumlator.text + separator.text + text
})));
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(({
type
}) => type !== formatType);
const newFormats = formats[index].filter(_ref => {
let {
type
} = _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({
formats,
replacements,
text,
start,
end
}, pattern, replacement) {
text = text.replace(pattern, (match, ...rest) => {
function replace_replace(_ref, pattern, replacement) {
let {
formats,
replacements,
text,
start,
end
} = _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({
formats,
replacements,
text,
start,
end
}, string) {
function split(_ref, string) {
let {
formats,
replacements,
text,
start,
end
} = _ref;
if (typeof string !== 'string') {
return splitAtSelection(...arguments);
}
@ -2411,13 +2472,17 @@ function split({
});
}
function splitAtSelection({
formats,
replacements,
text,
start,
end
}, startIndex = start, endIndex = end) {
function splitAtSelection(_ref2) {
let {
formats,
replacements,
text,
start,
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({
type,
attributes,
unregisteredAttributes,
object,
boundaryClass,
isEditableTree
}) {
function fromFormat(_ref) {
let {
type,
attributes,
unregisteredAttributes,
object,
boundaryClass,
isEditableTree
} = _ref;
const formatType = get_format_type_getFormatType(type);
let elementAttributes = {};
@ -2584,23 +2650,24 @@ function isEqualUntil(a, b, index) {
return true;
}
function toTree({
value,
multilineTag,
preserveWhiteSpace,
createEmpty,
append,
getLastChild,
getParent,
isText,
getText,
remove,
appendText,
onStartIndex,
onEndIndex,
isEditableTree,
placeholder
}) {
function toTree(_ref2) {
let {
value,
multilineTag,
preserveWhiteSpace,
createEmpty,
append,
getLastChild,
getParent,
isText,
getText,
remove,
appendText,
onStartIndex,
onEndIndex,
isEditableTree,
placeholder
} = _ref2;
const {
formats,
replacements,
@ -2879,15 +2946,17 @@ function to_dom_appendText(node, text) {
node.appendData(text);
}
function to_dom_getLastChild({
lastChild
}) {
function to_dom_getLastChild(_ref) {
let {
lastChild
} = _ref;
return lastChild;
}
function to_dom_getParent({
parentNode
}) {
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({
nodeValue
}) {
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({
value,
multilineTag,
prepareEditableTree,
isEditableTree = true,
placeholder,
doc = document
}) {
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({
value,
current,
multilineTag,
prepareEditableTree,
__unstableDomOnly,
placeholder
}) {
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({
startPath,
endPath
}, current) {
function applySelection(_ref6, current) {
let {
startPath,
endPath
} = _ref6;
const {
node: startContainer,
offset: startOffset
@ -3158,11 +3231,12 @@ var external_wp_escapeHtml_ = __webpack_require__("Vx3V");
* @return {string} HTML string.
*/
function toHTMLString({
value,
multilineTag,
preserveWhiteSpace
}) {
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({
children
}) {
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({
parent
}) {
function to_html_string_getParent(_ref3) {
let {
parent
} = _ref3;
return parent;
}
function to_html_string_isText({
text
}) {
function to_html_string_isText(_ref4) {
let {
text
} = _ref4;
return typeof text === 'string';
}
function to_html_string_getText({
text
}) {
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({
type,
attributes,
object,
children
}) {
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({
text,
replacements
}, lineIndex) {
function getTargetLevelLineIndex(_ref, lineIndex) {
let {
text,
replacements
} = _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({
text,
replacements
}, lineIndex) {
function getParentLineIndex(_ref, lineIndex) {
let {
text,
replacements
} = _ref;
const startFormats = replacements[lineIndex] || [];
let index = lineIndex;
@ -3554,10 +3636,11 @@ function getParentLineIndex({
* @return {number} The index of the last child.
*/
function getLastChildIndex({
text,
replacements
}, lineIndex) {
function getLastChildIndex(_ref, lineIndex) {
let {
text,
replacements
} = _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({
ref,
value,
settings = {}
}) {
function useAnchorRef(_ref) {
let {
ref,
value,
settings = {}
} = _ref;
const {
tagName,
className,
@ -3839,9 +3923,10 @@ function useDefaultStyle() {
* change.
*/
function useBoundaryStyle({
record
}) {
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({
value,
start,
end,
formats
}) {
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,22 +4713,23 @@ function useSpace() {
function useRichText({
value = '',
selectionStart,
selectionEnd,
placeholder,
preserveWhiteSpace,
onSelectionChange,
onChange,
__unstableMultilineTag: multilineTag,
__unstableDisableFormats: disableFormats,
__unstableIsSelected: isSelected,
__unstableDependencies = [],
__unstableAfterParse,
__unstableBeforeSerialize,
__unstableAddInvisibleFormats
}) {
function useRichText(_ref) {
let {
value = '',
selectionStart,
selectionEnd,
placeholder,
preserveWhiteSpace,
onSelectionChange,
onChange,
__unstableMultilineTag: multilineTag,
__unstableDisableFormats: disableFormats,
__unstableIsSelected: isSelected,
__unstableDependencies = [],
__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, {
domOnly
} = {}) {
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({
formatTypes,
onChange,
onFocus,
value,
forwardedRef
}) {
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

View File

@ -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({
className
}) {
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({
response,
className
}) {
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({
children,
showLoader
}) {
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;
})(({
urlQueryArgs = EMPTY_OBJECT,
currentPostId,
...props
}) => {
})(_ref => {
let {
urlQueryArgs = EMPTY_OBJECT,
currentPostId,
...props
} = _ref;
const newUrlQueryArgs = Object(external_wp_element_["useMemo"])(() => {
if (!currentPostId) {
return urlQueryArgs;

View File

@ -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;

Some files were not shown because too many files have changed in this diff Show More