Block Editor: Update packages with latest fixes for 5.8 RC2

Includes the following fixes:

 - [Block Library]: Less warnings when blocks try to render themselves.
 - Reset z-index on focused widget form
 - Refactor appender margin.
 - Fix slash inserter for widgets screen.
 - Widget screens: set html block as freeform content handler.
 - Widget Block: widget_id is undefined when a widget is placed.
 - Add <CopyHandler> to WidgetAreasBlockEditorProvider
 - Add width: 100% to components-base-control inside wp-block-legacy-widget
 - [Widgets editor] Replace the "technical" error notice a more user-friendly one
 - Fix legacy widget height overflow 
 - Fix "Select all" behavior in the editor 
 - Increase specificity of the NoPreview CSS rules to avoid conflicts with theme styles
 - Fix move to widget area checkmark
 - Replace legacy widget icon with its new version
 - [Block Library - Query Loop]: Set default block variations not to inherit from global query

See #53397.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50953 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
youknowriad 2021-07-06 14:38:40 +00:00
parent 833382b2c9
commit 5ab81a5f38
32 changed files with 233 additions and 465 deletions

File diff suppressed because one or more lines are too long

View File

@ -25,17 +25,6 @@ function render_block_core_block( $attributes ) {
}
if ( isset( $seen_refs[ $attributes['ref'] ] ) ) {
if ( ! is_admin() ) {
trigger_error(
sprintf(
// translators: %s is the user-provided title of the reusable block.
__( 'Could not render Reusable Block <strong>%s</strong>. Block cannot be rendered inside itself.' ),
$reusable_block->post_title
),
E_USER_WARNING
);
}
// WP_DEBUG_DISPLAY must only be honored when WP_DEBUG. This precedent
// is set in `wp_debug_mode()`.
$is_debug = defined( 'WP_DEBUG' ) && WP_DEBUG &&

View File

@ -23,19 +23,11 @@ function render_block_core_post_content( $attributes, $content, $block ) {
$post_id = $block->context['postId'];
if ( isset( $seen_ids[ $post_id ] ) ) {
if ( ! is_admin() ) {
trigger_error(
sprintf(
// translators: %s is a post ID (integer).
__( 'Could not render Post Content block with post ID: <code>%s</code>. Block cannot be rendered inside itself.' ),
$post_id
),
E_USER_WARNING
);
}
// WP_DEBUG_DISPLAY must only be honored when WP_DEBUG. This precedent
// is set in `wp_debug_mode()`.
$is_debug = defined( 'WP_DEBUG' ) && WP_DEBUG &&
defined( 'WP_DEBUG_DISPLAY' ) && WP_DEBUG_DISPLAY;
return $is_debug ?
// translators: Visible only in the front end, this warning takes the place of a faulty block.
__( '[block rendering halted]' ) :
@ -44,7 +36,7 @@ function render_block_core_post_content( $attributes, $content, $block ) {
$seen_ids[ $post_id ] = true;
if ( ! in_the_loop() ) {
if ( ! in_the_loop() && have_posts() ) {
the_post();
}

View File

@ -737,14 +737,11 @@
align-self: center;
padding: 0;
list-style: none;
margin: 0 8px 0 auto;
margin: 0 0 0 auto;
}
.block-editor-block-list__block .block-list-appender.wp-block {
max-width: none;
}
.block-editor-block-list__block .block-list-appender:first-child {
margin-right: 0;
}
.block-editor-block-list__block .block-list-appender .block-editor-default-block-appender {
margin: 8px 0;
}
@ -753,6 +750,7 @@
opacity: 1;
transform: scale(1);
transition: all 0.1s ease;
margin-right: 8px;
}
@media (prefers-reduced-motion: reduce) {
.block-editor-block-list__block .block-list-appender .block-list-appender__toggle {
@ -760,6 +758,9 @@
transition-delay: 0s;
}
}
.block-editor-block-list__block .block-list-appender:first-of-type .block-list-appender__toggle {
margin-right: 0;
}
.is-vertical .block-list-appender {
width: 24px;
@ -2176,16 +2177,6 @@
.block-editor-link-control .block-editor-link-control__search-input.block-editor-link-control__search-input input[type=text]:-ms-input-placeholder {
color: rgba(30, 30, 30, 0.62);
}
.is-dark-theme .block-editor-link-control .block-editor-link-control__search-input.block-editor-link-control__search-input input[type=text]::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .block-editor-link-control .block-editor-link-control__search-input.block-editor-link-control__search-input input[type=text]::-moz-placeholder {
opacity: 1;
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .block-editor-link-control .block-editor-link-control__search-input.block-editor-link-control__search-input input[type=text]:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.block-editor-link-control .block-editor-link-control__search-input .components-base-control__field {
margin-bottom: 0;
}
@ -2952,16 +2943,6 @@ figcaption.block-editor-rich-text__editable [data-rich-text-placeholder]::before
.block-editor-url-input__input[type=text]:-ms-input-placeholder {
color: rgba(30, 30, 30, 0.62);
}
.is-dark-theme .block-editor-url-input__input[type=text]::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .block-editor-url-input__input[type=text]::-moz-placeholder {
opacity: 1;
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .block-editor-url-input__input[type=text]:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.block-editor-url-input__suggestions {
max-height: 200px;
@ -3511,16 +3492,6 @@ figcaption.block-editor-rich-text__editable [data-rich-text-placeholder]::before
.block-editor-inserter__search input[type=search].block-editor-inserter__search-input:-ms-input-placeholder {
color: rgba(30, 30, 30, 0.62);
}
.is-dark-theme .block-editor-inserter__search input[type=search].block-editor-inserter__search-input::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .block-editor-inserter__search input[type=search].block-editor-inserter__search-input::-moz-placeholder {
opacity: 1;
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .block-editor-inserter__search input[type=search].block-editor-inserter__search-input:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
@media (min-width: 600px) {
.block-editor-inserter__search input[type=search].block-editor-inserter__search-input {
font-size: 13px;

File diff suppressed because one or more lines are too long

View File

@ -737,14 +737,11 @@
align-self: center;
padding: 0;
list-style: none;
margin: 0 auto 0 8px;
margin: 0 auto 0 0;
}
.block-editor-block-list__block .block-list-appender.wp-block {
max-width: none;
}
.block-editor-block-list__block .block-list-appender:first-child {
margin-left: 0;
}
.block-editor-block-list__block .block-list-appender .block-editor-default-block-appender {
margin: 8px 0;
}
@ -753,6 +750,7 @@
opacity: 1;
transform: scale(1);
transition: all 0.1s ease;
margin-left: 8px;
}
@media (prefers-reduced-motion: reduce) {
.block-editor-block-list__block .block-list-appender .block-list-appender__toggle {
@ -760,6 +758,9 @@
transition-delay: 0s;
}
}
.block-editor-block-list__block .block-list-appender:first-of-type .block-list-appender__toggle {
margin-left: 0;
}
.is-vertical .block-list-appender {
width: 24px;
@ -2176,16 +2177,6 @@
.block-editor-link-control .block-editor-link-control__search-input.block-editor-link-control__search-input input[type=text]:-ms-input-placeholder {
color: rgba(30, 30, 30, 0.62);
}
.is-dark-theme .block-editor-link-control .block-editor-link-control__search-input.block-editor-link-control__search-input input[type=text]::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .block-editor-link-control .block-editor-link-control__search-input.block-editor-link-control__search-input input[type=text]::-moz-placeholder {
opacity: 1;
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .block-editor-link-control .block-editor-link-control__search-input.block-editor-link-control__search-input input[type=text]:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.block-editor-link-control .block-editor-link-control__search-input .components-base-control__field {
margin-bottom: 0;
}
@ -2952,16 +2943,6 @@ figcaption.block-editor-rich-text__editable [data-rich-text-placeholder]::before
.block-editor-url-input__input[type=text]:-ms-input-placeholder {
color: rgba(30, 30, 30, 0.62);
}
.is-dark-theme .block-editor-url-input__input[type=text]::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .block-editor-url-input__input[type=text]::-moz-placeholder {
opacity: 1;
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .block-editor-url-input__input[type=text]:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.block-editor-url-input__suggestions {
max-height: 200px;
@ -3511,16 +3492,6 @@ figcaption.block-editor-rich-text__editable [data-rich-text-placeholder]::before
.block-editor-inserter__search input[type=search].block-editor-inserter__search-input:-ms-input-placeholder {
color: rgba(30, 30, 30, 0.62);
}
.is-dark-theme .block-editor-inserter__search input[type=search].block-editor-inserter__search-input::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .block-editor-inserter__search input[type=search].block-editor-inserter__search-input::-moz-placeholder {
opacity: 1;
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .block-editor-inserter__search input[type=search].block-editor-inserter__search-input:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
@media (min-width: 600px) {
.block-editor-inserter__search input[type=search].block-editor-inserter__search-input {
font-size: 13px;

File diff suppressed because one or more lines are too long

View File

@ -507,16 +507,6 @@
.components-checkbox-control__input[type=checkbox]:-ms-input-placeholder {
color: rgba(30, 30, 30, 0.62);
}
.is-dark-theme .components-checkbox-control__input[type=checkbox]::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .components-checkbox-control__input[type=checkbox]::-moz-placeholder {
opacity: 1;
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .components-checkbox-control__input[type=checkbox]:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.components-checkbox-control__input[type=checkbox]:focus {
box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--wp-admin-theme-color);
outline: 2px solid transparent;
@ -1116,16 +1106,6 @@ input.components-combobox-control__input[type=text]:focus {
.components-combobox-control__suggestions-container:-ms-input-placeholder {
color: rgba(30, 30, 30, 0.62);
}
.is-dark-theme .components-combobox-control__suggestions-container::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .components-combobox-control__suggestions-container::-moz-placeholder {
opacity: 1;
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .components-combobox-control__suggestions-container:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.components-combobox-control__suggestions-container:focus-within {
border-color: var(--wp-admin-theme-color);
box-shadow: 0 0 0 1px var(--wp-admin-theme-color);
@ -2774,16 +2754,6 @@ body.is-dragging-components-draggable {
.components-font-size-picker__controls .components-font-size-picker__number:-ms-input-placeholder {
color: rgba(30, 30, 30, 0.62);
}
.is-dark-theme .components-font-size-picker__controls .components-font-size-picker__number::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .components-font-size-picker__controls .components-font-size-picker__number::-moz-placeholder {
opacity: 1;
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .components-font-size-picker__controls .components-font-size-picker__number:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.components-font-size-picker__controls .components-font-size-picker__number[value=""] + .components-button {
cursor: default;
opacity: 0.3;
@ -2938,16 +2908,6 @@ body.is-dragging-components-draggable {
.components-form-token-field__input-container:-ms-input-placeholder {
color: rgba(30, 30, 30, 0.62);
}
.is-dark-theme .components-form-token-field__input-container::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .components-form-token-field__input-container::-moz-placeholder {
opacity: 1;
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .components-form-token-field__input-container:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.components-form-token-field__input-container.is-disabled {
background: #ddd;
border-color: #ddd;
@ -3822,16 +3782,6 @@ body.rtl .components-panel__body-toggle.components-button .dashicons-arrow-right
.components-placeholder__input[type=url]:-ms-input-placeholder {
color: rgba(30, 30, 30, 0.62);
}
.is-dark-theme .components-placeholder__input[type=url]::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .components-placeholder__input[type=url]::-moz-placeholder {
opacity: 1;
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .components-placeholder__input[type=url]:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.components-placeholder__instructions {
margin-bottom: 1em;
@ -4131,16 +4081,6 @@ body.rtl .components-panel__body-toggle.components-button .dashicons-arrow-right
.components-radio-control__input[type=radio]:-ms-input-placeholder {
color: rgba(30, 30, 30, 0.62);
}
.is-dark-theme .components-radio-control__input[type=radio]::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .components-radio-control__input[type=radio]::-moz-placeholder {
opacity: 1;
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .components-radio-control__input[type=radio]:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
@media (min-width: 600px) {
.components-radio-control__input[type=radio] {
height: 20px;
@ -4669,55 +4609,6 @@ body.lockscroll {
.components-text-control__input[type=number]:-ms-input-placeholder {
color: rgba(30, 30, 30, 0.62);
}
.is-dark-theme .components-text-control__input::-webkit-input-placeholder,
.is-dark-theme .components-text-control__input[type=text]::-webkit-input-placeholder,
.is-dark-theme .components-text-control__input[type=tel]::-webkit-input-placeholder,
.is-dark-theme .components-text-control__input[type=time]::-webkit-input-placeholder,
.is-dark-theme .components-text-control__input[type=url]::-webkit-input-placeholder,
.is-dark-theme .components-text-control__input[type=week]::-webkit-input-placeholder,
.is-dark-theme .components-text-control__input[type=password]::-webkit-input-placeholder,
.is-dark-theme .components-text-control__input[type=color]::-webkit-input-placeholder,
.is-dark-theme .components-text-control__input[type=date]::-webkit-input-placeholder,
.is-dark-theme .components-text-control__input[type=datetime]::-webkit-input-placeholder,
.is-dark-theme .components-text-control__input[type=datetime-local]::-webkit-input-placeholder,
.is-dark-theme .components-text-control__input[type=email]::-webkit-input-placeholder,
.is-dark-theme .components-text-control__input[type=month]::-webkit-input-placeholder,
.is-dark-theme .components-text-control__input[type=number]::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .components-text-control__input::-moz-placeholder,
.is-dark-theme .components-text-control__input[type=text]::-moz-placeholder,
.is-dark-theme .components-text-control__input[type=tel]::-moz-placeholder,
.is-dark-theme .components-text-control__input[type=time]::-moz-placeholder,
.is-dark-theme .components-text-control__input[type=url]::-moz-placeholder,
.is-dark-theme .components-text-control__input[type=week]::-moz-placeholder,
.is-dark-theme .components-text-control__input[type=password]::-moz-placeholder,
.is-dark-theme .components-text-control__input[type=color]::-moz-placeholder,
.is-dark-theme .components-text-control__input[type=date]::-moz-placeholder,
.is-dark-theme .components-text-control__input[type=datetime]::-moz-placeholder,
.is-dark-theme .components-text-control__input[type=datetime-local]::-moz-placeholder,
.is-dark-theme .components-text-control__input[type=email]::-moz-placeholder,
.is-dark-theme .components-text-control__input[type=month]::-moz-placeholder,
.is-dark-theme .components-text-control__input[type=number]::-moz-placeholder {
opacity: 1;
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .components-text-control__input:-ms-input-placeholder,
.is-dark-theme .components-text-control__input[type=text]:-ms-input-placeholder,
.is-dark-theme .components-text-control__input[type=tel]:-ms-input-placeholder,
.is-dark-theme .components-text-control__input[type=time]:-ms-input-placeholder,
.is-dark-theme .components-text-control__input[type=url]:-ms-input-placeholder,
.is-dark-theme .components-text-control__input[type=week]:-ms-input-placeholder,
.is-dark-theme .components-text-control__input[type=password]:-ms-input-placeholder,
.is-dark-theme .components-text-control__input[type=color]:-ms-input-placeholder,
.is-dark-theme .components-text-control__input[type=date]:-ms-input-placeholder,
.is-dark-theme .components-text-control__input[type=datetime]:-ms-input-placeholder,
.is-dark-theme .components-text-control__input[type=datetime-local]:-ms-input-placeholder,
.is-dark-theme .components-text-control__input[type=email]:-ms-input-placeholder,
.is-dark-theme .components-text-control__input[type=month]:-ms-input-placeholder,
.is-dark-theme .components-text-control__input[type=number]:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.components-tip {
display: flex;

File diff suppressed because one or more lines are too long

View File

@ -507,16 +507,6 @@
.components-checkbox-control__input[type=checkbox]:-ms-input-placeholder {
color: rgba(30, 30, 30, 0.62);
}
.is-dark-theme .components-checkbox-control__input[type=checkbox]::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .components-checkbox-control__input[type=checkbox]::-moz-placeholder {
opacity: 1;
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .components-checkbox-control__input[type=checkbox]:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.components-checkbox-control__input[type=checkbox]:focus {
box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--wp-admin-theme-color);
outline: 2px solid transparent;
@ -1120,16 +1110,6 @@ input.components-combobox-control__input[type=text]:focus {
.components-combobox-control__suggestions-container:-ms-input-placeholder {
color: rgba(30, 30, 30, 0.62);
}
.is-dark-theme .components-combobox-control__suggestions-container::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .components-combobox-control__suggestions-container::-moz-placeholder {
opacity: 1;
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .components-combobox-control__suggestions-container:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.components-combobox-control__suggestions-container:focus-within {
border-color: var(--wp-admin-theme-color);
box-shadow: 0 0 0 1px var(--wp-admin-theme-color);
@ -2784,16 +2764,6 @@ body.is-dragging-components-draggable {
.components-font-size-picker__controls .components-font-size-picker__number:-ms-input-placeholder {
color: rgba(30, 30, 30, 0.62);
}
.is-dark-theme .components-font-size-picker__controls .components-font-size-picker__number::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .components-font-size-picker__controls .components-font-size-picker__number::-moz-placeholder {
opacity: 1;
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .components-font-size-picker__controls .components-font-size-picker__number:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.components-font-size-picker__controls .components-font-size-picker__number[value=""] + .components-button {
cursor: default;
opacity: 0.3;
@ -2948,16 +2918,6 @@ body.is-dragging-components-draggable {
.components-form-token-field__input-container:-ms-input-placeholder {
color: rgba(30, 30, 30, 0.62);
}
.is-dark-theme .components-form-token-field__input-container::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .components-form-token-field__input-container::-moz-placeholder {
opacity: 1;
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .components-form-token-field__input-container:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.components-form-token-field__input-container.is-disabled {
background: #ddd;
border-color: #ddd;
@ -3834,16 +3794,6 @@ body.rtl .components-panel__body-toggle.components-button .dashicons-arrow-right
.components-placeholder__input[type=url]:-ms-input-placeholder {
color: rgba(30, 30, 30, 0.62);
}
.is-dark-theme .components-placeholder__input[type=url]::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .components-placeholder__input[type=url]::-moz-placeholder {
opacity: 1;
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .components-placeholder__input[type=url]:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.components-placeholder__instructions {
margin-bottom: 1em;
@ -4147,16 +4097,6 @@ body.rtl .components-panel__body-toggle.components-button .dashicons-arrow-right
.components-radio-control__input[type=radio]:-ms-input-placeholder {
color: rgba(30, 30, 30, 0.62);
}
.is-dark-theme .components-radio-control__input[type=radio]::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .components-radio-control__input[type=radio]::-moz-placeholder {
opacity: 1;
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .components-radio-control__input[type=radio]:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
@media (min-width: 600px) {
.components-radio-control__input[type=radio] {
height: 20px;
@ -4688,55 +4628,6 @@ body.lockscroll {
.components-text-control__input[type=number]:-ms-input-placeholder {
color: rgba(30, 30, 30, 0.62);
}
.is-dark-theme .components-text-control__input::-webkit-input-placeholder,
.is-dark-theme .components-text-control__input[type=text]::-webkit-input-placeholder,
.is-dark-theme .components-text-control__input[type=tel]::-webkit-input-placeholder,
.is-dark-theme .components-text-control__input[type=time]::-webkit-input-placeholder,
.is-dark-theme .components-text-control__input[type=url]::-webkit-input-placeholder,
.is-dark-theme .components-text-control__input[type=week]::-webkit-input-placeholder,
.is-dark-theme .components-text-control__input[type=password]::-webkit-input-placeholder,
.is-dark-theme .components-text-control__input[type=color]::-webkit-input-placeholder,
.is-dark-theme .components-text-control__input[type=date]::-webkit-input-placeholder,
.is-dark-theme .components-text-control__input[type=datetime]::-webkit-input-placeholder,
.is-dark-theme .components-text-control__input[type=datetime-local]::-webkit-input-placeholder,
.is-dark-theme .components-text-control__input[type=email]::-webkit-input-placeholder,
.is-dark-theme .components-text-control__input[type=month]::-webkit-input-placeholder,
.is-dark-theme .components-text-control__input[type=number]::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .components-text-control__input::-moz-placeholder,
.is-dark-theme .components-text-control__input[type=text]::-moz-placeholder,
.is-dark-theme .components-text-control__input[type=tel]::-moz-placeholder,
.is-dark-theme .components-text-control__input[type=time]::-moz-placeholder,
.is-dark-theme .components-text-control__input[type=url]::-moz-placeholder,
.is-dark-theme .components-text-control__input[type=week]::-moz-placeholder,
.is-dark-theme .components-text-control__input[type=password]::-moz-placeholder,
.is-dark-theme .components-text-control__input[type=color]::-moz-placeholder,
.is-dark-theme .components-text-control__input[type=date]::-moz-placeholder,
.is-dark-theme .components-text-control__input[type=datetime]::-moz-placeholder,
.is-dark-theme .components-text-control__input[type=datetime-local]::-moz-placeholder,
.is-dark-theme .components-text-control__input[type=email]::-moz-placeholder,
.is-dark-theme .components-text-control__input[type=month]::-moz-placeholder,
.is-dark-theme .components-text-control__input[type=number]::-moz-placeholder {
opacity: 1;
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .components-text-control__input:-ms-input-placeholder,
.is-dark-theme .components-text-control__input[type=text]:-ms-input-placeholder,
.is-dark-theme .components-text-control__input[type=tel]:-ms-input-placeholder,
.is-dark-theme .components-text-control__input[type=time]:-ms-input-placeholder,
.is-dark-theme .components-text-control__input[type=url]:-ms-input-placeholder,
.is-dark-theme .components-text-control__input[type=week]:-ms-input-placeholder,
.is-dark-theme .components-text-control__input[type=password]:-ms-input-placeholder,
.is-dark-theme .components-text-control__input[type=color]:-ms-input-placeholder,
.is-dark-theme .components-text-control__input[type=date]:-ms-input-placeholder,
.is-dark-theme .components-text-control__input[type=datetime]:-ms-input-placeholder,
.is-dark-theme .components-text-control__input[type=datetime-local]:-ms-input-placeholder,
.is-dark-theme .components-text-control__input[type=email]:-ms-input-placeholder,
.is-dark-theme .components-text-control__input[type=month]:-ms-input-placeholder,
.is-dark-theme .components-text-control__input[type=number]:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.components-tip {
display: flex;

File diff suppressed because one or more lines are too long

View File

@ -789,19 +789,6 @@
.editor-post-visibility__dialog-fieldset .editor-post-visibility__dialog-radio[type=radio]:-ms-input-placeholder {
color: rgba(30, 30, 30, 0.62);
}
.is-dark-theme .edit-post-post-visibility__dialog .editor-post-visibility__dialog-radio[type=radio]::-webkit-input-placeholder,
.is-dark-theme .editor-post-visibility__dialog-fieldset .editor-post-visibility__dialog-radio[type=radio]::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .edit-post-post-visibility__dialog .editor-post-visibility__dialog-radio[type=radio]::-moz-placeholder,
.is-dark-theme .editor-post-visibility__dialog-fieldset .editor-post-visibility__dialog-radio[type=radio]::-moz-placeholder {
opacity: 1;
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .edit-post-post-visibility__dialog .editor-post-visibility__dialog-radio[type=radio]:-ms-input-placeholder,
.is-dark-theme .editor-post-visibility__dialog-fieldset .editor-post-visibility__dialog-radio[type=radio]:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
@media (min-width: 600px) {
.edit-post-post-visibility__dialog .editor-post-visibility__dialog-radio[type=radio],
.editor-post-visibility__dialog-fieldset .editor-post-visibility__dialog-radio[type=radio] {
@ -891,16 +878,6 @@
.editor-post-visibility__dialog-password .editor-post-visibility__dialog-password-input[type=text]:-ms-input-placeholder {
color: rgba(30, 30, 30, 0.62);
}
.is-dark-theme .editor-post-visibility__dialog-password .editor-post-visibility__dialog-password-input[type=text]::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .editor-post-visibility__dialog-password .editor-post-visibility__dialog-password-input[type=text]::-moz-placeholder {
opacity: 1;
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .editor-post-visibility__dialog-password .editor-post-visibility__dialog-password-input[type=text]:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.editor-post-title {
position: relative;

File diff suppressed because one or more lines are too long

View File

@ -789,19 +789,6 @@
.editor-post-visibility__dialog-fieldset .editor-post-visibility__dialog-radio[type=radio]:-ms-input-placeholder {
color: rgba(30, 30, 30, 0.62);
}
.is-dark-theme .edit-post-post-visibility__dialog .editor-post-visibility__dialog-radio[type=radio]::-webkit-input-placeholder,
.is-dark-theme .editor-post-visibility__dialog-fieldset .editor-post-visibility__dialog-radio[type=radio]::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .edit-post-post-visibility__dialog .editor-post-visibility__dialog-radio[type=radio]::-moz-placeholder,
.is-dark-theme .editor-post-visibility__dialog-fieldset .editor-post-visibility__dialog-radio[type=radio]::-moz-placeholder {
opacity: 1;
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .edit-post-post-visibility__dialog .editor-post-visibility__dialog-radio[type=radio]:-ms-input-placeholder,
.is-dark-theme .editor-post-visibility__dialog-fieldset .editor-post-visibility__dialog-radio[type=radio]:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
@media (min-width: 600px) {
.edit-post-post-visibility__dialog .editor-post-visibility__dialog-radio[type=radio],
.editor-post-visibility__dialog-fieldset .editor-post-visibility__dialog-radio[type=radio] {
@ -891,16 +878,6 @@
.editor-post-visibility__dialog-password .editor-post-visibility__dialog-password-input[type=text]:-ms-input-placeholder {
color: rgba(30, 30, 30, 0.62);
}
.is-dark-theme .editor-post-visibility__dialog-password .editor-post-visibility__dialog-password-input[type=text]::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .editor-post-visibility__dialog-password .editor-post-visibility__dialog-password-input[type=text]::-moz-placeholder {
opacity: 1;
color: rgba(255, 255, 255, 0.65);
}
.is-dark-theme .editor-post-visibility__dialog-password .editor-post-visibility__dialog-password-input[type=text]:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.65);
}
.editor-post-title {
position: relative;

File diff suppressed because one or more lines are too long

View File

@ -149,7 +149,8 @@
.wp-block-legacy-widget__edit-form .widget-inside.widget-inside select {
padding-right: 4px;
}
.wp-block-legacy-widget__edit-form .widget.open {
.wp-block-legacy-widget__edit-form .widget.open,
.wp-block-legacy-widget__edit-form .widget.open:focus-within {
z-index: 0;
}
@ -186,18 +187,20 @@
width: 100%;
}
.wp-block-legacy-widget__edit-no-preview {
.wp-block-legacy-widget__edit-no-preview.wp-block-legacy-widget__edit-no-preview.wp-block-legacy-widget__edit-no-preview {
background: #f0f0f0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
font-size: 13px;
padding: 8px 12px;
}
.wp-block-legacy-widget__edit-no-preview h3 {
.wp-block-legacy-widget__edit-no-preview.wp-block-legacy-widget__edit-no-preview.wp-block-legacy-widget__edit-no-preview, .wp-block-legacy-widget__edit-no-preview.wp-block-legacy-widget__edit-no-preview.wp-block-legacy-widget__edit-no-preview h3, .wp-block-legacy-widget__edit-no-preview.wp-block-legacy-widget__edit-no-preview.wp-block-legacy-widget__edit-no-preview p {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
font-size: 13px;
}
.wp-block-legacy-widget__edit-no-preview.wp-block-legacy-widget__edit-no-preview.wp-block-legacy-widget__edit-no-preview h3 {
font-size: 14px;
font-weight: 600;
margin: 4px 0;
}
.wp-block-legacy-widget__edit-no-preview p {
.wp-block-legacy-widget__edit-no-preview.wp-block-legacy-widget__edit-no-preview.wp-block-legacy-widget__edit-no-preview p {
margin: 4px 0;
}
@ -219,6 +222,9 @@
min-width: 400px;
}
.wp-block-legacy-widget .components-base-control {
width: 100%;
}
.wp-block-legacy-widget .components-select-control__input {
padding: 0;
font-family: system-ui;

File diff suppressed because one or more lines are too long

View File

@ -149,7 +149,8 @@
.wp-block-legacy-widget__edit-form .widget-inside.widget-inside select {
padding-left: 4px;
}
.wp-block-legacy-widget__edit-form .widget.open {
.wp-block-legacy-widget__edit-form .widget.open,
.wp-block-legacy-widget__edit-form .widget.open:focus-within {
z-index: 0;
}
@ -186,18 +187,20 @@
width: 100%;
}
.wp-block-legacy-widget__edit-no-preview {
.wp-block-legacy-widget__edit-no-preview.wp-block-legacy-widget__edit-no-preview.wp-block-legacy-widget__edit-no-preview {
background: #f0f0f0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
font-size: 13px;
padding: 8px 12px;
}
.wp-block-legacy-widget__edit-no-preview h3 {
.wp-block-legacy-widget__edit-no-preview.wp-block-legacy-widget__edit-no-preview.wp-block-legacy-widget__edit-no-preview, .wp-block-legacy-widget__edit-no-preview.wp-block-legacy-widget__edit-no-preview.wp-block-legacy-widget__edit-no-preview h3, .wp-block-legacy-widget__edit-no-preview.wp-block-legacy-widget__edit-no-preview.wp-block-legacy-widget__edit-no-preview p {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
font-size: 13px;
}
.wp-block-legacy-widget__edit-no-preview.wp-block-legacy-widget__edit-no-preview.wp-block-legacy-widget__edit-no-preview h3 {
font-size: 14px;
font-weight: 600;
margin: 4px 0;
}
.wp-block-legacy-widget__edit-no-preview p {
.wp-block-legacy-widget__edit-no-preview.wp-block-legacy-widget__edit-no-preview.wp-block-legacy-widget__edit-no-preview p {
margin: 4px 0;
}
@ -219,6 +222,9 @@
min-width: 400px;
}
.wp-block-legacy-widget .components-base-control {
width: 100%;
}
.wp-block-legacy-widget .components-select-control__input {
padding: 0;
font-family: system-ui;

File diff suppressed because one or more lines are too long

View File

@ -10320,17 +10320,7 @@ function selectors_getBlockInsertionPoint(state) {
*/
function selectors_isBlockInsertionPointVisible(state) {
const insertionPoint = state.insertionPoint;
if (!state.insertionPoint) {
return false;
}
if (selectors_getTemplateLock(state, insertionPoint.rootClientId)) {
return false;
}
return true;
return state.insertionPoint !== null;
}
/**
* Returns whether the blocks matches the template or not.
@ -24820,7 +24810,8 @@ function useInBetweenInserter() {
getBlockIndex,
isBlockInsertionPointVisible,
isMultiSelecting,
getSelectedBlockClientIds
getSelectedBlockClientIds,
getTemplateLock
} = Object(external_wp_data_["useSelect"])(store);
const {
showInsertionPoint,
@ -24855,6 +24846,11 @@ function useInBetweenInserter() {
if (!event.target.classList.contains('is-root-container')) {
const blockElement = !!event.target.getAttribute('data-block') ? event.target : event.target.closest('[data-block]');
rootClientId = blockElement.getAttribute('data-block');
} // Don't set the insertion point if the template is locked.
if (getTemplateLock(rootClientId)) {
return;
}
const orientation = ((_getBlockListSettings = getBlockListSettings(rootClientId)) === null || _getBlockListSettings === void 0 ? void 0 : _getBlockListSettings.orientation) || 'vertical';

File diff suppressed because one or more lines are too long

View File

@ -3814,7 +3814,7 @@ function (_super) {
};
Cropper.prototype.componentDidUpdate = function (prevProps) {
var _a, _b, _c, _d, _e, _f, _g, _h;
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
if (prevProps.rotation !== this.props.rotation) {
this.computeSizes();
@ -3834,6 +3834,10 @@ function (_super) {
passive: false
}) : this.clearScrollEvent();
}
if (prevProps.video !== this.props.video) {
(_j = this.videoRef) === null || _j === void 0 ? void 0 : _j.load();
}
};
Cropper.prototype.getAspect = function () {
@ -29523,6 +29527,23 @@ const imageDateTitle = Object(external_wp_element_["createElement"])(external_wp
*/
const QUERY_DEFAULT_ATTRIBUTES = {
query: {
perPage: 3,
pages: 0,
offset: 0,
postType: 'post',
categoryIds: [],
tagIds: [],
order: 'desc',
orderBy: 'date',
author: '',
search: '',
exclude: [],
sticky: '',
inherit: false
}
};
const query_variations_variations = [{
name: 'posts-list',
title: Object(external_wp_i18n_["__"])('Posts List'),
@ -29549,24 +29570,32 @@ const query_variations_variations = [{
name: 'title-date',
title: Object(external_wp_i18n_["__"])('Title & Date'),
icon: titleDate,
attributes: { ...QUERY_DEFAULT_ATTRIBUTES
},
innerBlocks: [['core/post-template', {}, [['core/post-title'], ['core/post-date']]]],
scope: ['block']
}, {
name: 'title-excerpt',
title: Object(external_wp_i18n_["__"])('Title & Excerpt'),
icon: titleExcerpt,
attributes: { ...QUERY_DEFAULT_ATTRIBUTES
},
innerBlocks: [['core/post-template', {}, [['core/post-title'], ['core/post-excerpt']]]],
scope: ['block']
}, {
name: 'title-date-excerpt',
title: Object(external_wp_i18n_["__"])('Title, Date, & Excerpt'),
icon: titleDateExcerpt,
attributes: { ...QUERY_DEFAULT_ATTRIBUTES
},
innerBlocks: [['core/post-template', {}, [['core/post-title'], ['core/post-date'], ['core/post-excerpt']]]],
scope: ['block']
}, {
name: 'image-date-title',
title: Object(external_wp_i18n_["__"])('Image, Date, & Title'),
icon: imageDateTitle,
attributes: { ...QUERY_DEFAULT_ATTRIBUTES
},
innerBlocks: [['core/post-template', {}, [['core/post-featured-image'], ['core/post-date'], ['core/post-title']]]],
scope: ['block']
}];

File diff suppressed because one or more lines are too long

View File

@ -137,6 +137,9 @@ var external_wp_blockLibrary_ = __webpack_require__("QyPg");
// EXTERNAL MODULE: external ["wp","widgets"]
var external_wp_widgets_ = __webpack_require__("GLVC");
// EXTERNAL MODULE: external ["wp","blocks"]
var external_wp_blocks_ = __webpack_require__("HSyU");
// EXTERNAL MODULE: external ["wp","components"]
var external_wp_components_ = __webpack_require__("tI+e");
@ -931,9 +934,6 @@ function useInserter(inserter) {
}, [inserter])];
}
// EXTERNAL MODULE: external ["wp","blocks"]
var external_wp_blocks_ = __webpack_require__("HSyU");
// EXTERNAL MODULE: external ["wp","isShallowEqual"]
var external_wp_isShallowEqual_ = __webpack_require__("rl8x");
var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_);
@ -1531,9 +1531,9 @@ function SidebarBlockEditor({
isInserterOpened: isInserterOpened,
setIsInserterOpened: setIsInserterOpened,
isFixedToolbarActive: isFixedToolbarActive
}), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockTools"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockSelectionClearer"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["WritingFlow"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["ObserveTyping"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockList"], {
}), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["CopyHandler"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockTools"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockSelectionClearer"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["WritingFlow"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["ObserveTyping"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockList"], {
renderAppender: BlockAppender
}))))), Object(external_wp_element_["createPortal"])( // This is a temporary hack to prevent button component inside <BlockInspector>
})))))), Object(external_wp_element_["createPortal"])( // This is a temporary hack to prevent button component inside <BlockInspector>
// from submitting form when type="button" is not specified.
Object(external_wp_element_["createElement"])("form", {
onSubmit: event => event.preventDefault()
@ -2435,6 +2435,7 @@ Object(external_wp_hooks_["addFilter"])('editor.BlockEdit', 'core/customize-widg
/**
* Internal dependencies
*/
@ -2465,7 +2466,12 @@ function initialize(editorName, blockEditorSettings) {
if (false) {}
Object(external_wp_widgets_["registerLegacyWidgetVariations"])(blockEditorSettings);
Object(external_wp_widgets_["registerLegacyWidgetVariations"])(blockEditorSettings); // As we are unregistering `core/freeform` to avoid the Classic block, we must
// replace it with something as the default freeform content handler. Failure to
// do this will result in errors in the default block parser.
// see: https://github.com/WordPress/gutenberg/issues/33097
Object(external_wp_blocks_["setFreeformContentHandlerName"])('core/html');
const SidebarControl = getSidebarControl(blockEditorSettings);
build_module_wp.customize.sectionConstructor.sidebar = getSidebarSection();
build_module_wp.customize.controlConstructor.sidebar_block_editor = SidebarControl;

File diff suppressed because one or more lines are too long

View File

@ -905,10 +905,35 @@ function isEntirelySelected(element) {
const lastChild = element.lastChild;
assertIsDefined(lastChild, 'lastChild');
const lastChildContentLength = lastChild.nodeType === lastChild.TEXT_NODE ?
const endContainerContentLength = endContainer.nodeType === endContainer.TEXT_NODE ?
/** @type {Text} */
lastChild.data.length : lastChild.childNodes.length;
return startContainer === element.firstChild && endContainer === element.lastChild && startOffset === 0 && endOffset === lastChildContentLength;
endContainer.data.length : endContainer.childNodes.length;
return isDeepChild(startContainer, element, 'firstChild') && isDeepChild(endContainer, element, 'lastChild') && startOffset === 0 && endOffset === endContainerContentLength;
}
/**
* Check whether the contents of the element have been entirely selected.
* Returns true if there is no possibility of selection.
*
* @param {HTMLElement|Node} query The element to check.
* @param {HTMLElement} container The container that we suspect "query" may be a first or last child of.
* @param {"firstChild"|"lastChild"} propName "firstChild" or "lastChild"
*
* @return {boolean} True if query is a deep first/last child of container, false otherwise.
*/
function isDeepChild(query, container, propName) {
/** @type {HTMLElement | ChildNode | null} */
let candidate = container;
do {
if (query === candidate) {
return true;
}
candidate = candidate[propName];
} while (candidate);
return false;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/is-rtl.js

File diff suppressed because one or more lines are too long

View File

@ -191,6 +191,7 @@ __webpack_require__.d(selectors_namespaceObject, "getWidgets", function() { retu
__webpack_require__.d(selectors_namespaceObject, "getWidget", function() { return getWidget; });
__webpack_require__.d(selectors_namespaceObject, "getWidgetAreas", function() { return selectors_getWidgetAreas; });
__webpack_require__.d(selectors_namespaceObject, "getWidgetAreaForWidgetId", function() { return getWidgetAreaForWidgetId; });
__webpack_require__.d(selectors_namespaceObject, "getParentWidgetAreaBlock", function() { return selectors_getParentWidgetAreaBlock; });
__webpack_require__.d(selectors_namespaceObject, "getEditedWidgetAreas", function() { return selectors_getEditedWidgetAreas; });
__webpack_require__.d(selectors_namespaceObject, "getReferenceWidgetBlocks", function() { return getReferenceWidgetBlocks; });
__webpack_require__.d(selectors_namespaceObject, "isSavingWidgetAreas", function() { return selectors_isSavingWidgetAreas; });
@ -1127,6 +1128,24 @@ const getWidgetAreaForWidgetId = Object(external_wp_data_["createRegistrySelecto
return blockWidgetIds.includes(widgetId);
});
});
/**
* Given a child client id, returns the parent widget area block.
*
* @param {string} clientId The client id of a block in a widget area.
*
* @return {WPBlock} The widget area block.
*/
const selectors_getParentWidgetAreaBlock = Object(external_wp_data_["createRegistrySelector"])(select => (state, clientId) => {
const {
getBlock,
getBlockName,
getBlockParents
} = select('core/block-editor');
const blockParents = getBlockParents(clientId);
const widgetAreaClientId = blockParents.find(parentClientId => getBlockName(parentClientId) === 'core/widget-area');
return getBlock(widgetAreaClientId);
});
const selectors_getEditedWidgetAreas = Object(external_wp_data_["createRegistrySelector"])(select => (state, ids) => {
let widgetAreas = select(STORE_NAME).getWidgetAreas();
@ -1346,14 +1365,16 @@ var external_wp_hooks_ = __webpack_require__("g56x");
const withMoveToWidgetAreaToolbarItem = Object(external_wp_compose_["createHigherOrderComponent"])(BlockEdit => props => {
const widgetId = Object(external_wp_widgets_["getWidgetIdFromBlock"])(props);
const blockName = props.name;
const {
clientId,
name: blockName
} = props;
const {
widgetAreas,
currentWidgetAreaId,
canInsertBlockInWidgetArea
} = Object(external_wp_data_["useSelect"])(select => {
var _selectors$getWidgetA;
var _widgetAreaBlock$attr;
// Component won't display for a widget area, so don't run selectors.
if (blockName === 'core/widget-area') {
@ -1361,12 +1382,13 @@ const withMoveToWidgetAreaToolbarItem = Object(external_wp_compose_["createHighe
}
const selectors = select(store);
const widgetAreaBlock = selectors.getParentWidgetAreaBlock(clientId);
return {
widgetAreas: selectors.getWidgetAreas(),
currentWidgetAreaId: widgetId ? (_selectors$getWidgetA = selectors.getWidgetAreaForWidgetId(widgetId)) === null || _selectors$getWidgetA === void 0 ? void 0 : _selectors$getWidgetA.id : undefined,
currentWidgetAreaId: widgetAreaBlock === null || widgetAreaBlock === void 0 ? void 0 : (_widgetAreaBlock$attr = widgetAreaBlock.attributes) === null || _widgetAreaBlock$attr === void 0 ? void 0 : _widgetAreaBlock$attr.id,
canInsertBlockInWidgetArea: selectors.canInsertBlockInWidgetArea(blockName)
};
}, [widgetId, blockName]);
}, [clientId, blockName]);
const {
moveBlockToWidgetArea
} = Object(external_wp_data_["useDispatch"])(store);
@ -1801,6 +1823,7 @@ KeyboardShortcuts.Register = KeyboardShortcutsRegister;
*/
/**
* A react hook that returns the client id of the last widget area to have
* been selected, or to have a selected block within it.
@ -1813,22 +1836,22 @@ const useLastSelectedWidgetArea = () => Object(external_wp_data_["useSelect"])(s
const {
getBlockSelectionEnd,
getBlockParents,
getBlockName
} = select('core/block-editor');
const blockSelectionEndClientId = getBlockSelectionEnd(); // If the selected block is a widget area, return its clientId.
const selectionEndClientId = getBlockSelectionEnd(); // If the selected block is a widget area, return its clientId.
if (getBlockName(blockSelectionEndClientId) === 'core/widget-area') {
return blockSelectionEndClientId;
} // Otherwise, find the clientId of the top-level widget area by looking
// through the selected block's parents.
if (getBlockName(selectionEndClientId) === 'core/widget-area') {
return selectionEndClientId;
}
const {
getParentWidgetAreaBlock
} = select(store);
const widgetAreaBlock = getParentWidgetAreaBlock(selectionEndClientId);
const widgetAreaBlockClientId = widgetAreaBlock === null || widgetAreaBlock === void 0 ? void 0 : widgetAreaBlock.clientId;
const blockParents = getBlockParents(blockSelectionEndClientId);
const rootWidgetAreaClientId = blockParents.find(clientId => getBlockName(clientId) === 'core/widget-area');
if (rootWidgetAreaClientId) {
return rootWidgetAreaClientId;
if (widgetAreaBlockClientId) {
return widgetAreaBlockClientId;
} // If no widget area has been selected, return the clientId of the first
// area.
@ -1932,7 +1955,7 @@ function WidgetAreasBlockEditorProvider({
onChange: onChange,
settings: settings,
useSubRegistry: false
}, props), children, Object(external_wp_element_["createElement"])(external_wp_reusableBlocks_["ReusableBlocksMenuItems"], {
}, props), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["CopyHandler"], null, children), Object(external_wp_element_["createElement"])(external_wp_reusableBlocks_["ReusableBlocksMenuItems"], {
rootClientId: widgetAreaId
}))));
}
@ -3258,8 +3281,13 @@ function initialize(id, settings) {
Object(external_wp_widgets_["registerLegacyWidgetVariations"])(settings);
registerBlock(widget_area_namespaceObject);
settings.__experimentalFetchLinkSuggestions = (search, searchOptions) => Object(external_wp_coreData_["__experimentalFetchLinkSuggestions"])(search, searchOptions, settings);
settings.__experimentalFetchLinkSuggestions = (search, searchOptions) => Object(external_wp_coreData_["__experimentalFetchLinkSuggestions"])(search, searchOptions, settings); // As we are unregistering `core/freeform` to avoid the Classic block, we must
// replace it with something as the default freeform content handler. Failure to
// do this will result in errors in the default block parser.
// see: https://github.com/WordPress/gutenberg/issues/33097
Object(external_wp_blocks_["setFreeformContentHandlerName"])('core/html');
Object(external_wp_element_["render"])(Object(external_wp_element_["createElement"])(layout, {
blockEditorSettings: settings
}), document.getElementById(id));

File diff suppressed because one or more lines are too long

View File

@ -132,10 +132,10 @@ var external_wp_primitives_ = __webpack_require__("Tqx9");
*/
const widget_widget = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
viewBox: "0 0 24 24",
xmlns: "http://www.w3.org/2000/svg"
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24"
}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
d: "M7 11h2v2H7v-2zm14-5v14l-2 2H5l-2-2V6l2-2h1V2h2v2h8V2h2v2h1l2 2zM5 8h14V6H5v2zm14 12V10H5v10h14zm-4-7h2v-2h-2v2zm-4 0h2v-2h-2v2z"
d: "M6 3H8V5H16V3H18V5C19.1046 5 20 5.89543 20 7V19C20 20.1046 19.1046 21 18 21H6C4.89543 21 4 20.1046 4 19V7C4 5.89543 4.89543 5 6 5V3ZM18 6.5H6C5.72386 6.5 5.5 6.72386 5.5 7V8H18.5V7C18.5 6.72386 18.2761 6.5 18 6.5ZM18.5 9.5H5.5V19C5.5 19.2761 5.72386 19.5 6 19.5H18C18.2761 19.5 18.5 19.2761 18.5 19V9.5ZM11 11H13V13H11V11ZM7 11V13H9V11H7ZM15 13V11H17V13H15Z"
}));
/* harmony default export */ var library_widget = (widget_widget);
@ -760,9 +760,10 @@ function Form({
onChangeHasPreview,
onError(error) {
var _error$message;
createNotice('error', (_error$message = error === null || error === void 0 ? void 0 : error.message) !== null && _error$message !== void 0 ? _error$message : Object(external_wp_i18n_["__"])('An error occured while fetching or updating the widget.'));
window.console.error(error);
createNotice('error', Object(external_wp_i18n_["sprintf"])(
/* translators: %s: the name of the affected block. */
Object(external_wp_i18n_["__"])('The "%s" block was affected by errors and may not function properly. Check the developer tools for more details.'), idBase || id));
}
});
@ -828,21 +829,19 @@ function Preview({
instance,
isVisible
}) {
const [iframeHeight, setIframeHeight] = Object(external_wp_element_["useState"])(); // Resize the iframe on either the load event, or when the iframe becomes visible.
const [isLoaded, setIsLoaded] = Object(external_wp_element_["useState"])(false); // Resize the iframe on either the load event, or when the iframe becomes visible.
const ref = Object(external_wp_compose_["useRefEffect"])(iframe => {
function onChange() {
var _iframe$contentDocume, _iframe$contentDocume2;
const boundingRect = iframe === null || iframe === void 0 ? void 0 : (_iframe$contentDocume = iframe.contentDocument) === null || _iframe$contentDocume === void 0 ? void 0 : (_iframe$contentDocume2 = _iframe$contentDocume.body) === null || _iframe$contentDocume2 === void 0 ? void 0 : _iframe$contentDocume2.getBoundingClientRect();
if (boundingRect) {
// Include `top` in the height calculation to avoid the bottom
// of widget previews being cut-off. Most widgets have a
// heading at the top that has top margin, and the `height`
// alone doesn't take that margin into account.
setIframeHeight(boundingRect.top + boundingRect.height);
}
// Only set height if the iframe is loaded,
// or it will grow to an unexpected large height in Safari if it's hidden initially.
if (isLoaded) {
// If the preview frame has another origin then this won't work.
// One possible solution is to add custom script to call `postMessage` in the preview frame.
// Or, better yet, we migrate away from iframe.
function setHeight() {
// Pick the maximum of these two values to account for margin collapsing.
const height = Math.max(iframe.contentDocument.documentElement.offsetHeight, iframe.contentDocument.body.offsetHeight);
iframe.style.height = `${height}px`;
}
const {
@ -850,18 +849,24 @@ function Preview({
} = iframe.ownerDocument.defaultView; // Observe for intersections that might cause a change in the height of
// the iframe, e.g. a Widget Area becoming expanded.
const intersectionObserver = new IntersectionObserver(onChange, {
const intersectionObserver = new IntersectionObserver(([entry]) => {
if (entry.isIntersecting) {
setHeight();
}
}, {
threshold: 1
});
intersectionObserver.observe(iframe);
iframe.addEventListener('load', onChange);
iframe.addEventListener('load', setHeight);
return () => {
iframe.removeEventListener('load', onChange);
intersectionObserver.disconnect();
iframe.removeEventListener('load', setHeight);
};
}, []);
return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, isVisible && iframeHeight === null && Object(external_wp_element_["createElement"])(external_wp_components_["Placeholder"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null)), Object(external_wp_element_["createElement"])("div", {
}
}, [isLoaded]);
return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, isVisible && !isLoaded && Object(external_wp_element_["createElement"])(external_wp_components_["Placeholder"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null)), Object(external_wp_element_["createElement"])("div", {
className: classnames_default()('wp-block-legacy-widget__edit-preview', {
'is-offscreen': !isVisible || iframeHeight === null
'is-offscreen': !isVisible || !isLoaded
})
}, Object(external_wp_element_["createElement"])(external_wp_components_["Disabled"], null, Object(external_wp_element_["createElement"])("iframe", {
ref: ref,
@ -876,7 +881,15 @@ function Preview({
instance
}
}),
height: iframeHeight || 100
onLoad: event => {
// To hide the scrollbars of the preview frame for some edge cases,
// such as negative margins in the Gallery Legacy Widget.
// It can't be scrolled anyway.
// TODO: Ideally, this should be fixed in core.
event.target.contentDocument.body.style.overflow = 'hidden';
setIsLoaded(true);
},
height: 100
}))));
}

File diff suppressed because one or more lines are too long

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.9-alpha-51343';
$wp_version = '5.9-alpha-51344';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.