Editor: Update packages.

The following package versions were changed:

@wordpress/block-directory: 1.17.2 -> 1.17.3
@wordpress/block-editor: 5.1.2 -> 5.1.3
@wordpress/block-library: 2.26.2 -> 2.26.3
@wordpress/edit-post: 3.25.2 -> 3.25.3
@wordpress/editor: 9.24.2 -> 9.24.3
@wordpress/format-library: 1.25.2 -> 1.25.3
@wordpress/reusable-blocks: 1.0.2 -> 1.0.3

See https://github.com/WordPress/gutenberg/pull/26874 for the list of fixed bugs.

Props isabel_brison.
Fixes #51696.
Built from https://develop.svn.wordpress.org/trunk@49579


git-svn-id: http://core.svn.wordpress.org/trunk@49317 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2020-11-12 19:36:36 +00:00
parent 6703f8efee
commit 1d738052b1
19 changed files with 368 additions and 323 deletions

File diff suppressed because one or more lines are too long

View File

@ -15,7 +15,7 @@
* @return string Rendered HTML of the referenced block. * @return string Rendered HTML of the referenced block.
*/ */
function render_block_core_social_link( $attributes, $content, $block ) { function render_block_core_social_link( $attributes, $content, $block ) {
$open_in_new_tab = $block->context['openInNewTab']; $open_in_new_tab = isset( $block->context['openInNewTab'] ) ? $block->context['openInNewTab'] : false;
$service = ( isset( $attributes['service'] ) ) ? $attributes['service'] : 'Icon'; $service = ( isset( $attributes['service'] ) ) ? $attributes['service'] : 'Icon';
$url = ( isset( $attributes['url'] ) ) ? $attributes['url'] : false; $url = ( isset( $attributes['url'] ) ) ? $attributes['url'] : false;

View File

@ -726,6 +726,16 @@ figure.wp-block-image:not(.wp-block) {
[data-align="full"] > .wp-block-image img { [data-align="full"] > .wp-block-image img {
width: 100%; } width: 100%; }
.wp-block[data-align="left"] > .wp-block-image,
.wp-block[data-align="center"] > .wp-block-image,
.wp-block[data-align="right"] > .wp-block-image {
display: table; }
.wp-block[data-align="left"] > .wp-block-image > figcaption,
.wp-block[data-align="center"] > .wp-block-image > figcaption,
.wp-block[data-align="right"] > .wp-block-image > figcaption {
display: table-caption;
caption-side: bottom; }
.wp-block[data-align="left"] > .wp-block-image { .wp-block[data-align="left"] > .wp-block-image {
margin-left: 1em; margin-left: 1em;
margin-right: 0; margin-right: 0;

File diff suppressed because one or more lines are too long

View File

@ -731,6 +731,16 @@ figure.wp-block-image:not(.wp-block) {
[data-align="full"] > .wp-block-image img { [data-align="full"] > .wp-block-image img {
width: 100%; } width: 100%; }
.wp-block[data-align="left"] > .wp-block-image,
.wp-block[data-align="center"] > .wp-block-image,
.wp-block[data-align="right"] > .wp-block-image {
display: table; }
.wp-block[data-align="left"] > .wp-block-image > figcaption,
.wp-block[data-align="center"] > .wp-block-image > figcaption,
.wp-block[data-align="right"] > .wp-block-image > figcaption {
display: table-caption;
caption-side: bottom; }
.wp-block[data-align="left"] > .wp-block-image { .wp-block[data-align="left"] > .wp-block-image {
margin-right: 1em; margin-right: 1em;
margin-left: 0; margin-left: 0;

File diff suppressed because one or more lines are too long

View File

@ -106,10 +106,16 @@
.is-style-outline > .wp-block-button__link, .is-style-outline > .wp-block-button__link,
.wp-block-button__link.is-style-outline { .wp-block-button__link.is-style-outline {
color: #32373c;
background-color: transparent;
border: 2px solid; } border: 2px solid; }
.is-style-outline > .wp-block-button__link:not(.has-text-color),
.wp-block-button__link.is-style-outline:not(.has-text-color) {
color: #32373c; }
.is-style-outline > .wp-block-button__link:not(.has-background),
.wp-block-button__link.is-style-outline:not(.has-background) {
background-color: transparent; }
.wp-block-buttons .wp-block-button { .wp-block-buttons .wp-block-button {
display: inline-block; display: inline-block;
margin-left: 0.5em; margin-left: 0.5em;
@ -225,7 +231,17 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
padding: 1em; padding: 1em;
box-sizing: border-box; } box-sizing: border-box;
/**
* Set a default background color for has-background-dim _unless_ it includes another
* background-color class (e.g. has-green-background-color). The presence of another
* background-color class implies that another style will provide the background color
* for the overlay.
*
* See:
* - Issue with background color specificity: https://github.com/WordPress/gutenberg/issues/26545
* - Issue with alternative fix: https://github.com/WordPress/gutenberg/issues/26545
*/ }
.wp-block-cover-image.has-parallax, .wp-block-cover-image.has-parallax,
.wp-block-cover.has-parallax { .wp-block-cover.has-parallax {
background-attachment: fixed; } background-attachment: fixed; }
@ -241,6 +257,9 @@
.wp-block-cover.is-repeated { .wp-block-cover.is-repeated {
background-repeat: repeat; background-repeat: repeat;
background-size: auto; } background-size: auto; }
.wp-block-cover-image.has-background-dim:not([class*="-background-color"]),
.wp-block-cover.has-background-dim:not([class*="-background-color"]) {
background-color: #000; }
.wp-block-cover-image.has-background-dim::before, .wp-block-cover-image.has-background-dim::before,
.wp-block-cover.has-background-dim::before { .wp-block-cover.has-background-dim::before {
content: ""; content: "";
@ -743,11 +762,11 @@ h6.has-background {
width: 100%; } width: 100%; }
.wp-block-image .alignleft, .wp-block-image .alignleft,
.wp-block-image .alignright, .wp-block-image .alignright,
.wp-block-image .aligncenter, .wp-block-image.is-resized { .wp-block-image .aligncenter {
display: table; } display: table; }
.wp-block-image .alignleft > figcaption, .wp-block-image .alignleft > figcaption,
.wp-block-image .alignright > figcaption, .wp-block-image .alignright > figcaption,
.wp-block-image .aligncenter > figcaption, .wp-block-image.is-resized > figcaption { .wp-block-image .aligncenter > figcaption {
display: table-caption; display: table-caption;
caption-side: bottom; } caption-side: bottom; }
.wp-block-image .alignleft { .wp-block-image .alignleft {
@ -1195,7 +1214,7 @@ p.has-text-color a {
color: inherit; } color: inherit; }
.wp-block-quote.is-style-large, .wp-block-quote.is-large { .wp-block-quote.is-style-large, .wp-block-quote.is-large {
margin: 0 0 1em; margin-bottom: 1em;
padding: 0 1em; } padding: 0 1em; }
.wp-block-quote.is-style-large p, .wp-block-quote.is-large p { .wp-block-quote.is-style-large p, .wp-block-quote.is-large p {
font-size: 1.5em; font-size: 1.5em;

File diff suppressed because one or more lines are too long

View File

@ -107,10 +107,16 @@
.is-style-outline > .wp-block-button__link, .is-style-outline > .wp-block-button__link,
.wp-block-button__link.is-style-outline { .wp-block-button__link.is-style-outline {
color: #32373c;
background-color: transparent;
border: 2px solid; } border: 2px solid; }
.is-style-outline > .wp-block-button__link:not(.has-text-color),
.wp-block-button__link.is-style-outline:not(.has-text-color) {
color: #32373c; }
.is-style-outline > .wp-block-button__link:not(.has-background),
.wp-block-button__link.is-style-outline:not(.has-background) {
background-color: transparent; }
.wp-block-buttons .wp-block-button { .wp-block-buttons .wp-block-button {
display: inline-block; display: inline-block;
margin-right: 0.5em; margin-right: 0.5em;
@ -232,7 +238,17 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
padding: 1em; padding: 1em;
box-sizing: border-box; } box-sizing: border-box;
/**
* Set a default background color for has-background-dim _unless_ it includes another
* background-color class (e.g. has-green-background-color). The presence of another
* background-color class implies that another style will provide the background color
* for the overlay.
*
* See:
* - Issue with background color specificity: https://github.com/WordPress/gutenberg/issues/26545
* - Issue with alternative fix: https://github.com/WordPress/gutenberg/issues/26545
*/ }
.wp-block-cover-image.has-parallax, .wp-block-cover-image.has-parallax,
.wp-block-cover.has-parallax { .wp-block-cover.has-parallax {
background-attachment: fixed; } background-attachment: fixed; }
@ -248,6 +264,9 @@
.wp-block-cover.is-repeated { .wp-block-cover.is-repeated {
background-repeat: repeat; background-repeat: repeat;
background-size: auto; } background-size: auto; }
.wp-block-cover-image.has-background-dim:not([class*="-background-color"]),
.wp-block-cover.has-background-dim:not([class*="-background-color"]) {
background-color: #000; }
.wp-block-cover-image.has-background-dim::before, .wp-block-cover-image.has-background-dim::before,
.wp-block-cover.has-background-dim::before { .wp-block-cover.has-background-dim::before {
content: ""; content: "";
@ -751,11 +770,11 @@ h6.has-background {
width: 100%; } width: 100%; }
.wp-block-image .alignleft, .wp-block-image .alignleft,
.wp-block-image .alignright, .wp-block-image .alignright,
.wp-block-image .aligncenter, .wp-block-image.is-resized { .wp-block-image .aligncenter {
display: table; } display: table; }
.wp-block-image .alignleft > figcaption, .wp-block-image .alignleft > figcaption,
.wp-block-image .alignright > figcaption, .wp-block-image .alignright > figcaption,
.wp-block-image .aligncenter > figcaption, .wp-block-image.is-resized > figcaption { .wp-block-image .aligncenter > figcaption {
display: table-caption; display: table-caption;
caption-side: bottom; } caption-side: bottom; }
.wp-block-image .alignleft { .wp-block-image .alignleft {
@ -1221,7 +1240,7 @@ p.has-text-color a {
color: inherit; } color: inherit; }
.wp-block-quote.is-style-large, .wp-block-quote.is-large { .wp-block-quote.is-style-large, .wp-block-quote.is-large {
margin: 0 0 1em; margin-bottom: 1em;
padding: 0 1em; } padding: 0 1em; }
.wp-block-quote.is-style-large p, .wp-block-quote.is-large p { .wp-block-quote.is-style-large p, .wp-block-quote.is-large p {
font-size: 1.5em; font-size: 1.5em;

File diff suppressed because one or more lines are too long

View File

@ -192,7 +192,8 @@ html.interface-interface-skeleton__html-container {
.interface-interface-skeleton__editor { .interface-interface-skeleton__editor {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
flex-grow: 1; } flex-grow: 1;
max-width: 100%; }
.interface-interface-skeleton { .interface-interface-skeleton {
/* Set left position when auto-fold is not on the body element. */ /* Set left position when auto-fold is not on the body element. */
@ -648,6 +649,13 @@ body.is-fullscreen-mode .interface-interface-skeleton {
.show-icon-labels .edit-post-header-toolbar .edit-post-header-toolbar__left > .edit-post-header-toolbar__inserter-toggle.has-icon { .show-icon-labels .edit-post-header-toolbar .edit-post-header-toolbar__left > .edit-post-header-toolbar__inserter-toggle.has-icon {
height: 36px; } height: 36px; }
.edit-post-header-toolbar .edit-post-header-toolbar__left > .edit-post-header-toolbar__inserter-toggle.has-text.has-icon {
width: auto;
padding: 0 8px; }
.show-icon-labels .edit-post-header-toolbar__left > * + * {
margin-right: 8px; }
@media (min-width: 1280px) { @media (min-width: 1280px) {
.show-icon-labels .edit-post-header-toolbar__block-toolbar { .show-icon-labels .edit-post-header-toolbar__block-toolbar {
position: absolute; position: absolute;

File diff suppressed because one or more lines are too long

View File

@ -192,7 +192,8 @@ html.interface-interface-skeleton__html-container {
.interface-interface-skeleton__editor { .interface-interface-skeleton__editor {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
flex-grow: 1; } flex-grow: 1;
max-width: 100%; }
.interface-interface-skeleton { .interface-interface-skeleton {
/* Set left position when auto-fold is not on the body element. */ /* Set left position when auto-fold is not on the body element. */
@ -648,6 +649,13 @@ body.is-fullscreen-mode .interface-interface-skeleton {
.show-icon-labels .edit-post-header-toolbar .edit-post-header-toolbar__left > .edit-post-header-toolbar__inserter-toggle.has-icon { .show-icon-labels .edit-post-header-toolbar .edit-post-header-toolbar__left > .edit-post-header-toolbar__inserter-toggle.has-icon {
height: 36px; } height: 36px; }
.edit-post-header-toolbar .edit-post-header-toolbar__left > .edit-post-header-toolbar__inserter-toggle.has-text.has-icon {
width: auto;
padding: 0 8px; }
.show-icon-labels .edit-post-header-toolbar__left > * + * {
margin-left: 8px; }
@media (min-width: 1280px) { @media (min-width: 1280px) {
.show-icon-labels .edit-post-header-toolbar__block-toolbar { .show-icon-labels .edit-post-header-toolbar__block-toolbar {
position: absolute; position: absolute;

File diff suppressed because one or more lines are too long

View File

@ -13843,6 +13843,7 @@ __webpack_require__.d(actions_namespaceObject, "moveBlocksToPosition", function(
__webpack_require__.d(actions_namespaceObject, "moveBlockToPosition", function() { return actions_moveBlockToPosition; }); __webpack_require__.d(actions_namespaceObject, "moveBlockToPosition", function() { return actions_moveBlockToPosition; });
__webpack_require__.d(actions_namespaceObject, "insertBlock", function() { return actions_insertBlock; }); __webpack_require__.d(actions_namespaceObject, "insertBlock", function() { return actions_insertBlock; });
__webpack_require__.d(actions_namespaceObject, "insertBlocks", function() { return actions_insertBlocks; }); __webpack_require__.d(actions_namespaceObject, "insertBlocks", function() { return actions_insertBlocks; });
__webpack_require__.d(actions_namespaceObject, "__unstableSetInsertionPoint", function() { return actions_unstableSetInsertionPoint; });
__webpack_require__.d(actions_namespaceObject, "showInsertionPoint", function() { return actions_showInsertionPoint; }); __webpack_require__.d(actions_namespaceObject, "showInsertionPoint", function() { return actions_showInsertionPoint; });
__webpack_require__.d(actions_namespaceObject, "hideInsertionPoint", function() { return actions_hideInsertionPoint; }); __webpack_require__.d(actions_namespaceObject, "hideInsertionPoint", function() { return actions_hideInsertionPoint; });
__webpack_require__.d(actions_namespaceObject, "setTemplateValidity", function() { return setTemplateValidity; }); __webpack_require__.d(actions_namespaceObject, "setTemplateValidity", function() { return setTemplateValidity; });
@ -13894,11 +13895,11 @@ __webpack_require__.d(selectors_namespaceObject, "getBlockCount", function() { r
__webpack_require__.d(selectors_namespaceObject, "getSelectionStart", function() { return selectors_getSelectionStart; }); __webpack_require__.d(selectors_namespaceObject, "getSelectionStart", function() { return selectors_getSelectionStart; });
__webpack_require__.d(selectors_namespaceObject, "getSelectionEnd", function() { return selectors_getSelectionEnd; }); __webpack_require__.d(selectors_namespaceObject, "getSelectionEnd", function() { return selectors_getSelectionEnd; });
__webpack_require__.d(selectors_namespaceObject, "getBlockSelectionStart", function() { return getBlockSelectionStart; }); __webpack_require__.d(selectors_namespaceObject, "getBlockSelectionStart", function() { return getBlockSelectionStart; });
__webpack_require__.d(selectors_namespaceObject, "getBlockSelectionEnd", function() { return selectors_getBlockSelectionEnd; }); __webpack_require__.d(selectors_namespaceObject, "getBlockSelectionEnd", function() { return getBlockSelectionEnd; });
__webpack_require__.d(selectors_namespaceObject, "getSelectedBlockCount", function() { return selectors_getSelectedBlockCount; }); __webpack_require__.d(selectors_namespaceObject, "getSelectedBlockCount", function() { return selectors_getSelectedBlockCount; });
__webpack_require__.d(selectors_namespaceObject, "hasSelectedBlock", function() { return hasSelectedBlock; }); __webpack_require__.d(selectors_namespaceObject, "hasSelectedBlock", function() { return hasSelectedBlock; });
__webpack_require__.d(selectors_namespaceObject, "getSelectedBlockClientId", function() { return selectors_getSelectedBlockClientId; }); __webpack_require__.d(selectors_namespaceObject, "getSelectedBlockClientId", function() { return selectors_getSelectedBlockClientId; });
__webpack_require__.d(selectors_namespaceObject, "getSelectedBlock", function() { return selectors_getSelectedBlock; }); __webpack_require__.d(selectors_namespaceObject, "getSelectedBlock", function() { return getSelectedBlock; });
__webpack_require__.d(selectors_namespaceObject, "getBlockRootClientId", function() { return selectors_getBlockRootClientId; }); __webpack_require__.d(selectors_namespaceObject, "getBlockRootClientId", function() { return selectors_getBlockRootClientId; });
__webpack_require__.d(selectors_namespaceObject, "getBlockParents", function() { return selectors_getBlockParents; }); __webpack_require__.d(selectors_namespaceObject, "getBlockParents", function() { return selectors_getBlockParents; });
__webpack_require__.d(selectors_namespaceObject, "getBlockParentsByBlockName", function() { return getBlockParentsByBlockName; }); __webpack_require__.d(selectors_namespaceObject, "getBlockParentsByBlockName", function() { return getBlockParentsByBlockName; });
@ -21756,9 +21757,31 @@ function blocksMode() {
return state; return state;
} }
/** /**
* Reducer returning the block insertion point visibility, either null if there * A helper for resetting the insertion point state.
* is not an explicit insertion point assigned, or an object of its `index` and *
* `rootClientId`. * @param {Object} state Current state.
* @param {Object} action Dispatched action.
* @param {*} defaultValue The default value for the reducer.
*
* @return {*} Either the default value if a reset is required, or the state.
*/
function resetInsertionPoint(state, action, defaultValue) {
switch (action.type) {
case 'CLEAR_SELECTED_BLOCK':
case 'SELECT_BLOCK':
case 'REPLACE_INNER_BLOCKS':
case 'INSERT_BLOCKS':
case 'REMOVE_BLOCKS':
case 'REPLACE_BLOCKS':
return defaultValue;
}
return state;
}
/**
* Reducer returning the insertion point position, consisting of the
* rootClientId and an index.
* *
* @param {Object} state Current state. * @param {Object} state Current state.
* @param {Object} action Dispatched action. * @param {Object} action Dispatched action.
@ -21766,24 +21789,48 @@ function blocksMode() {
* @return {Object} Updated state. * @return {Object} Updated state.
*/ */
function insertionPoint() { function insertionPoint() {
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
var action = arguments.length > 1 ? arguments[1] : undefined; var action = arguments.length > 1 ? arguments[1] : undefined;
switch (action.type) { switch (action.type) {
case 'SET_INSERTION_POINT':
case 'SHOW_INSERTION_POINT': case 'SHOW_INSERTION_POINT':
{
var rootClientId = action.rootClientId, var rootClientId = action.rootClientId,
index = action.index; index = action.index;
return { return {
rootClientId: rootClientId, rootClientId: rootClientId,
index: index index: index
}; };
}
case 'HIDE_INSERTION_POINT':
return null;
} }
return state; return resetInsertionPoint(state, action, null);
}
/**
* Reducer returning the visibility of the insertion point.
*
* @param {Object} state Current state.
* @param {Object} action Dispatched action.
*
* @return {Object} Updated state.
*/
function insertionPointVisibility() {
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
var action = arguments.length > 1 ? arguments[1] : undefined;
switch (action.type) {
case 'SHOW_INSERTION_POINT':
return true;
case 'HIDE_INSERTION_POINT':
return false;
}
return resetInsertionPoint(state, action, false);
} }
/** /**
* Reducer returning whether the post blocks match the defined template or not. * Reducer returning whether the post blocks match the defined template or not.
@ -22068,6 +22115,7 @@ function highlightedBlock(state, action) {
blocksMode: blocksMode, blocksMode: blocksMode,
blockListSettings: reducer_blockListSettings, blockListSettings: reducer_blockListSettings,
insertionPoint: insertionPoint, insertionPoint: insertionPoint,
insertionPointVisibility: insertionPointVisibility,
template: reducer_template, template: reducer_template,
settings: reducer_settings, settings: reducer_settings,
preferences: preferences, preferences: preferences,
@ -22818,12 +22866,34 @@ function actions_insertBlocks(blocks, index, rootClientId) {
}, _marked7, null, [[10, 22, 25, 28]]); }, _marked7, null, [[10, 22, 25, 28]]);
} }
/** /**
* Returns an action object used in signalling that the insertion point should * Sets the insertion point without showing it to users.
* be shown.
* *
* @param {?string} rootClientId Optional root client ID of block list on * Components like <Inserter> will default to inserting blocks at this point.
* which to insert. *
* @param {?number} index Index at which block should be inserted. * @param {?string} rootClientId Root client ID of block list in which to
* insert. Use `undefined` for the root block
* list.
* @param {number} index Index at which block should be inserted.
*
* @return {Object} Action object.
*/
function actions_unstableSetInsertionPoint(rootClientId, index) {
return {
type: 'SET_INSERTION_POINT',
rootClientId: rootClientId,
index: index
};
}
/**
* Sets the insertion point and shows it to users.
*
* Components like <Inserter> will default to inserting blocks at this point.
*
* @param {?string} rootClientId Root client ID of block list in which to
* insert. Use `undefined` for the root block
* list.
* @param {number} index Index at which block should be inserted.
* *
* @return {Object} Action object. * @return {Object} Action object.
*/ */
@ -22836,7 +22906,7 @@ function actions_showInsertionPoint(rootClientId, index) {
}; };
} }
/** /**
* Returns an action object hiding the insertion point. * Hides the insertion point for users.
* *
* @return {Object} Action object. * @return {Object} Action object.
*/ */
@ -23941,7 +24011,7 @@ function getBlockSelectionStart(state) {
* @return {?string} Client ID of block selection end. * @return {?string} Client ID of block selection end.
*/ */
function selectors_getBlockSelectionEnd(state) { function getBlockSelectionEnd(state) {
return state.selectionEnd.clientId; return state.selectionEnd.clientId;
} }
/** /**
@ -24002,7 +24072,7 @@ function selectors_getSelectedBlockClientId(state) {
* @return {?Object} Selected block. * @return {?Object} Selected block.
*/ */
function selectors_getSelectedBlock(state) { function getSelectedBlock(state) {
var clientId = selectors_getSelectedBlockClientId(state); var clientId = selectors_getSelectedBlockClientId(state);
return clientId ? selectors_getBlock(state, clientId) : null; return clientId ? selectors_getBlock(state, clientId) : null;
} }
@ -24657,12 +24727,18 @@ function selectors_isCaretWithinFormattedText(state) {
return state.isCaretWithinFormattedText; return state.isCaretWithinFormattedText;
} }
/** /**
* Returns the insertion point, the index at which the new inserted block would * Returns the insertion point. This will be:
* be placed. Defaults to the last index.
* *
* @param {Object} state Editor state. * 1) The insertion point manually set using setInsertionPoint() or
* showInsertionPoint(); or
* 2) The point after the current block selection, if there is a selection; or
* 3) The point at the end of the block list.
* *
* @return {Object} Insertion point object with `rootClientId`, `index`. * Components like <Inserter> will default to inserting blocks at this point.
*
* @param {Object} state Global application state.
*
* @return {Object} Insertion point object with `rootClientId` and `index`.
*/ */
function getBlockInsertionPoint(state) { function getBlockInsertionPoint(state) {
@ -24689,15 +24765,16 @@ function getBlockInsertionPoint(state) {
}; };
} }
/** /**
* Returns true if we should show the block insertion point. * Whether or not the insertion point should be shown to users. This is set
* using showInsertionPoint() or hideInsertionPoint().
* *
* @param {Object} state Global application state. * @param {Object} state Global application state.
* *
* @return {?boolean} Whether the insertion point is visible or not. * @return {?boolean} Whether the insertion point should be shown.
*/ */
function isBlockInsertionPointVisible(state) { function isBlockInsertionPointVisible(state) {
return state.insertionPoint !== null; return state.insertionPointVisibility;
} }
/** /**
* Returns whether the blocks matches the template or not. * Returns whether the blocks matches the template or not.
@ -27837,16 +27914,6 @@ function ReusableBlocksTab(_ref3) {
/* harmony default export */ var reusable_blocks_tab = (Object(external_this_wp_components_["withSpokenMessages"])(ReusableBlocksTab)); /* harmony default export */ var reusable_blocks_tab = (Object(external_this_wp_components_["withSpokenMessages"])(ReusableBlocksTab));
// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/hooks/use-insertion-point.js // CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/hooks/use-insertion-point.js
function use_insertion_point_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function use_insertion_point_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { use_insertion_point_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { use_insertion_point_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
/**
* External dependencies
*/
/** /**
* WordPress dependencies * WordPress dependencies
*/ */
@ -27854,14 +27921,20 @@ function use_insertion_point_objectSpread(target) { for (var i = 1; i < argument
/** /**
* @typedef WPInserterConfig * @typedef WPInserterConfig
* *
* @property {string=} rootClientId Inserter Root Client ID. * @property {string=} rootClientId If set, insertion will be into the
* @property {string=} clientId Inserter Client ID. * block with this ID.
* @property {boolean} isAppender Whether the inserter is an appender or not. * @property {number=} insertionIndex If set, insertion will be into this
* @property {boolean} selectBlockOnInsert Whether the block should be selected on insert. * explicit position.
* @property {string=} clientId If set, insertion will be after the
* block with this ID.
* @property {boolean=} isAppender Whether the inserter is an appender
* or not.
* @property {boolean=} selectBlockOnInsert Whether the block should be
* selected on insert.
* @property {Function=} onSelect Called after insertion.
*/ */
/** /**
@ -27872,41 +27945,54 @@ function use_insertion_point_objectSpread(target) { for (var i = 1; i < argument
*/ */
function useInsertionPoint(_ref) { function useInsertionPoint(_ref) {
var onSelect = _ref.onSelect, var rootClientId = _ref.rootClientId,
rootClientId = _ref.rootClientId, insertionIndex = _ref.insertionIndex,
clientId = _ref.clientId, clientId = _ref.clientId,
isAppender = _ref.isAppender, isAppender = _ref.isAppender,
selectBlockOnInsert = _ref.selectBlockOnInsert, selectBlockOnInsert = _ref.selectBlockOnInsert,
insertionIndex = _ref.insertionIndex; onSelect = _ref.onSelect;
var _useSelect = Object(external_this_wp_data_["useSelect"])(function (select) { var _useSelect = Object(external_this_wp_data_["useSelect"])(function (select) {
var _getSettings$__experi;
var _select = select('core/block-editor'), var _select = select('core/block-editor'),
getSettings = _select.getSettings, getSelectedBlock = _select.getSelectedBlock,
getBlockRootClientId = _select.getBlockRootClientId, getBlockIndex = _select.getBlockIndex,
_getBlockSelectionEnd = _select.getBlockSelectionEnd; getBlockOrder = _select.getBlockOrder,
getBlockInsertionPoint = _select.getBlockInsertionPoint;
var destRootClientId = rootClientId; var _destinationRootClientId, _destinationIndex;
if (!destRootClientId && !clientId && !isAppender) { if (rootClientId || insertionIndex || clientId || isAppender) {
var end = _getBlockSelectionEnd(); // If any of these arguments are set, we're in "manual mode"
// meaning the insertion point is set by the caller.
_destinationRootClientId = rootClientId;
if (end) { if (insertionIndex) {
destRootClientId = getBlockRootClientId(end); // Insert into a specific index.
_destinationIndex = insertionIndex;
} else if (clientId) {
// Insert after a specific client ID.
_destinationIndex = getBlockIndex(clientId, _destinationRootClientId);
} else {
// Insert at the end of the list.
_destinationIndex = getBlockOrder(_destinationRootClientId).length;
} }
} else {
// Otherwise, we're in "auto mode" where the insertion point is
// decided by getBlockInsertionPoint().
var insertionPoint = getBlockInsertionPoint();
_destinationRootClientId = insertionPoint.rootClientId;
_destinationIndex = insertionPoint.index;
} }
return use_insertion_point_objectSpread({ return {
hasPatterns: !!((_getSettings$__experi = getSettings().__experimentalBlockPatterns) === null || _getSettings$__experi === void 0 ? void 0 : _getSettings$__experi.length), selectedBlock: getSelectedBlock(),
destinationRootClientId: destRootClientId destinationRootClientId: _destinationRootClientId,
}, Object(external_this_lodash_["pick"])(select('core/block-editor'), ['getSelectedBlock', 'getBlockIndex', 'getBlockSelectionEnd', 'getBlockOrder'])); destinationIndex: _destinationIndex
}, [isAppender, clientId, rootClientId]), };
}, [rootClientId, insertionIndex, clientId, isAppender]),
selectedBlock = _useSelect.selectedBlock,
destinationRootClientId = _useSelect.destinationRootClientId, destinationRootClientId = _useSelect.destinationRootClientId,
getSelectedBlock = _useSelect.getSelectedBlock, destinationIndex = _useSelect.destinationIndex;
getBlockIndex = _useSelect.getBlockIndex,
getBlockSelectionEnd = _useSelect.getBlockSelectionEnd,
getBlockOrder = _useSelect.getBlockOrder;
var _useDispatch = Object(external_this_wp_data_["useDispatch"])('core/block-editor'), var _useDispatch = Object(external_this_wp_data_["useDispatch"])('core/block-editor'),
replaceBlocks = _useDispatch.replaceBlocks, replaceBlocks = _useDispatch.replaceBlocks,
@ -27914,34 +28000,11 @@ function useInsertionPoint(_ref) {
showInsertionPoint = _useDispatch.showInsertionPoint, showInsertionPoint = _useDispatch.showInsertionPoint,
hideInsertionPoint = _useDispatch.hideInsertionPoint; hideInsertionPoint = _useDispatch.hideInsertionPoint;
function getInsertionIndex() {
if (insertionIndex !== undefined) {
return insertionIndex;
} // If the clientId is defined, we insert at the position of the block.
if (clientId) {
return getBlockIndex(clientId, destinationRootClientId);
} // If there's a selected block, and the selected block is not the destination root block, we insert after the selected block.
var end = getBlockSelectionEnd();
if (!isAppender && end) {
return getBlockIndex(end, destinationRootClientId) + 1;
} // Otherwise, we insert at the end of the current rootClientId
return getBlockOrder(destinationRootClientId).length;
}
var onInsertBlocks = function onInsertBlocks(blocks, meta) { var onInsertBlocks = function onInsertBlocks(blocks, meta) {
var selectedBlock = getSelectedBlock();
if (!isAppender && selectedBlock && Object(external_this_wp_blocks_["isUnmodifiedDefaultBlock"])(selectedBlock)) { if (!isAppender && selectedBlock && Object(external_this_wp_blocks_["isUnmodifiedDefaultBlock"])(selectedBlock)) {
replaceBlocks(selectedBlock.clientId, blocks, null, null, meta); replaceBlocks(selectedBlock.clientId, blocks, null, null, meta);
} else { } else {
insertBlocks(blocks, getInsertionIndex(), destinationRootClientId, selectBlockOnInsert, meta); insertBlocks(blocks, destinationIndex, destinationRootClientId, selectBlockOnInsert, meta);
} }
if (!selectBlockOnInsert) { if (!selectBlockOnInsert) {
@ -27958,8 +28021,7 @@ function useInsertionPoint(_ref) {
var onToggleInsertionPoint = function onToggleInsertionPoint(show) { var onToggleInsertionPoint = function onToggleInsertionPoint(show) {
if (show) { if (show) {
var index = getInsertionIndex(); showInsertionPoint(destinationRootClientId, destinationIndex);
showInsertionPoint(destinationRootClientId, index);
} else { } else {
hideInsertionPoint(); hideInsertionPoint();
} }
@ -28344,12 +28406,20 @@ function QuickInserter(_ref2) {
var filteredBlockPatterns = Object(external_this_wp_element_["useMemo"])(function () { var filteredBlockPatterns = Object(external_this_wp_element_["useMemo"])(function () {
return search_items_searchItems(patterns, filterValue); return search_items_searchItems(patterns, filterValue);
}, [filterValue, patterns]); }, [filterValue, patterns]);
var setInserterIsOpened = Object(external_this_wp_data_["useSelect"])(function (select) {
return select('core/block-editor').getSettings().__experimentalSetIsInserterOpened; var _useSelect = Object(external_this_wp_data_["useSelect"])(function (select) {
}, []); var _select = select('core/block-editor'),
var previousBlockClientId = Object(external_this_wp_data_["useSelect"])(function (select) { getSettings = _select.getSettings,
return select('core/block-editor').getPreviousBlockClientId(clientId); getBlockIndex = _select.getBlockIndex;
}, [clientId]);
return {
setInserterIsOpened: getSettings().__experimentalSetIsInserterOpened,
blockIndex: getBlockIndex(clientId, rootClientId)
};
}, [clientId, rootClientId]),
setInserterIsOpened = _useSelect.setInserterIsOpened,
blockIndex = _useSelect.blockIndex;
Object(external_this_wp_element_["useEffect"])(function () { Object(external_this_wp_element_["useEffect"])(function () {
if (setInserterIsOpened) { if (setInserterIsOpened) {
setInserterIsOpened(false); setInserterIsOpened(false);
@ -28357,7 +28427,7 @@ function QuickInserter(_ref2) {
}, [setInserterIsOpened]); }, [setInserterIsOpened]);
var _useDispatch = Object(external_this_wp_data_["useDispatch"])('core/block-editor'), var _useDispatch = Object(external_this_wp_data_["useDispatch"])('core/block-editor'),
selectBlock = _useDispatch.selectBlock; // Announce search results on change __unstableSetInsertionPoint = _useDispatch.__unstableSetInsertionPoint; // Announce search results on change
Object(external_this_wp_element_["useEffect"])(function () { Object(external_this_wp_element_["useEffect"])(function () {
@ -28370,18 +28440,12 @@ function QuickInserter(_ref2) {
/* translators: %d: number of results. */ /* translators: %d: number of results. */
Object(external_this_wp_i18n_["_n"])('%d result found.', '%d results found.', count), count); Object(external_this_wp_i18n_["_n"])('%d result found.', '%d results found.', count), count);
debouncedSpeak(resultsFoundMessage); debouncedSpeak(resultsFoundMessage);
}, [filterValue, debouncedSpeak]); // When clicking Browse All select the appropriate block so as }, [filterValue, debouncedSpeak]);
// the insertion point can work as expected
var onBrowseAll = function onBrowseAll() { var onBrowseAll = function onBrowseAll() {
// We have to select the previous block because the menu inserter __unstableSetInsertionPoint(rootClientId, blockIndex);
// inserts the new block after the selected one.
// Ideally, this selection shouldn't focus the block to avoid the setTimeout.
selectBlock(previousBlockClientId); // eslint-disable-next-line @wordpress/react-no-unsafe-timeout
setTimeout(function () {
setInserterIsOpened(true); setInserterIsOpened(true);
});
}; // Disable reason (no-autofocus): The inserter menu is a modal display, not one which }; // Disable reason (no-autofocus): The inserter menu is a modal display, not one which
// is always visible, and one which already incurs this behavior of autoFocus via // is always visible, and one which already incurs this behavior of autoFocus via
// Popover's focusOnMount. // Popover's focusOnMount.

File diff suppressed because one or more lines are too long

View File

@ -3967,16 +3967,42 @@ function (_super) {
_this.props.onZoomChange(newZoom); _this.props.onZoomChange(newZoom);
}; };
_this.emitCropData = function () { _this.getCropData = function () {
if (!_this.state.cropSize) return; // this is to ensure the crop is correctly restricted after a zoom back (https://github.com/ricardo-ch/react-easy-crop/issues/6) if (!_this.state.cropSize) {
return null;
} // this is to ensure the crop is correctly restricted after a zoom back (https://github.com/ricardo-ch/react-easy-crop/issues/6)
var restrictedPosition = _this.props.restrictPosition ? index_module_restrictPosition(_this.props.crop, _this.mediaSize, _this.state.cropSize, _this.props.zoom, _this.props.rotation) : _this.props.crop; var restrictedPosition = _this.props.restrictPosition ? index_module_restrictPosition(_this.props.crop, _this.mediaSize, _this.state.cropSize, _this.props.zoom, _this.props.rotation) : _this.props.crop;
return computeCroppedArea(restrictedPosition, _this.mediaSize, _this.state.cropSize, _this.getAspect(), _this.props.zoom, _this.props.rotation, _this.props.restrictPosition);
};
var _a = computeCroppedArea(restrictedPosition, _this.mediaSize, _this.state.cropSize, _this.getAspect(), _this.props.zoom, _this.props.rotation, _this.props.restrictPosition), _this.emitCropData = function () {
croppedAreaPercentages = _a.croppedAreaPercentages, var cropData = _this.getCropData();
croppedAreaPixels = _a.croppedAreaPixels;
_this.props.onCropComplete && _this.props.onCropComplete(croppedAreaPercentages, croppedAreaPixels); if (!cropData) return;
var croppedAreaPercentages = cropData.croppedAreaPercentages,
croppedAreaPixels = cropData.croppedAreaPixels;
if (_this.props.onCropComplete) {
_this.props.onCropComplete(croppedAreaPercentages, croppedAreaPixels);
}
if (_this.props.onCropAreaChange) {
_this.props.onCropAreaChange(croppedAreaPercentages, croppedAreaPixels);
}
};
_this.emitCropAreaChange = function () {
var cropData = _this.getCropData();
if (!cropData) return;
var croppedAreaPercentages = cropData.croppedAreaPercentages,
croppedAreaPixels = cropData.croppedAreaPixels;
if (_this.props.onCropAreaChange) {
_this.props.onCropAreaChange(croppedAreaPercentages, croppedAreaPixels);
}
}; };
_this.recomputeCropPosition = function () { _this.recomputeCropPosition = function () {
@ -4032,7 +4058,7 @@ function (_super) {
}; };
Cropper.prototype.componentDidUpdate = function (prevProps) { Cropper.prototype.componentDidUpdate = function (prevProps) {
var _a, _b, _c, _d; var _a, _b, _c, _d, _e, _f, _g, _h;
if (prevProps.rotation !== this.props.rotation) { if (prevProps.rotation !== this.props.rotation) {
this.computeSizes(); this.computeSizes();
@ -4043,6 +4069,8 @@ function (_super) {
this.recomputeCropPosition(); this.recomputeCropPosition();
} else if (((_a = prevProps.cropSize) === null || _a === void 0 ? void 0 : _a.height) !== ((_b = this.props.cropSize) === null || _b === void 0 ? void 0 : _b.height) || ((_c = prevProps.cropSize) === null || _c === void 0 ? void 0 : _c.width) !== ((_d = this.props.cropSize) === null || _d === void 0 ? void 0 : _d.width)) { } else if (((_a = prevProps.cropSize) === null || _a === void 0 ? void 0 : _a.height) !== ((_b = this.props.cropSize) === null || _b === void 0 ? void 0 : _b.height) || ((_c = prevProps.cropSize) === null || _c === void 0 ? void 0 : _c.width) !== ((_d = this.props.cropSize) === null || _d === void 0 ? void 0 : _d.width)) {
this.computeSizes(); this.computeSizes();
} else if (((_e = prevProps.crop) === null || _e === void 0 ? void 0 : _e.x) !== ((_f = this.props.crop) === null || _f === void 0 ? void 0 : _f.x) || ((_g = prevProps.crop) === null || _g === void 0 ? void 0 : _g.y) !== ((_h = this.props.crop) === null || _h === void 0 ? void 0 : _h.y)) {
this.emitCropAreaChange();
} }
if (prevProps.zoomWithScroll !== this.props.zoomWithScroll && this.containerRef) { if (prevProps.zoomWithScroll !== this.props.zoomWithScroll && this.containerRef) {
@ -7095,11 +7123,6 @@ var shared_pickRelevantMediaFiles = function pickRelevantMediaFiles(image) {
return imageProps; return imageProps;
}; };
// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/constants.js
var constants_LINK_DESTINATION_NONE = 'none';
var constants_LINK_DESTINATION_MEDIA = 'file';
var constants_LINK_DESTINATION_ATTACHMENT = 'post';
// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/deprecated.js // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/deprecated.js
@ -7123,132 +7146,7 @@ function gallery_deprecated_objectSpread(target) { for (var i = 1; i < arguments
*/ */
var gallery_deprecated_deprecated = [{ var gallery_deprecated_deprecated = [{
attributes: {
images: {
type: 'array',
default: [],
source: 'query',
selector: '.blocks-gallery-item',
query: {
url: {
type: 'string',
source: 'attribute',
selector: 'img',
attribute: 'src'
},
fullUrl: {
type: 'string',
source: 'attribute',
selector: 'img',
attribute: 'data-full-url'
},
link: {
type: 'string',
source: 'attribute',
selector: 'img',
attribute: 'data-link'
},
alt: {
type: 'string',
source: 'attribute',
selector: 'img',
attribute: 'alt',
default: ''
},
id: {
type: 'string',
source: 'attribute',
selector: 'img',
attribute: 'data-id'
},
caption: {
type: 'string',
source: 'html',
selector: '.blocks-gallery-item__caption'
}
}
},
ids: {
type: 'array',
items: {
type: 'number'
},
default: []
},
columns: {
type: 'number',
minimum: 1,
maximum: 8
},
caption: {
type: 'string',
source: 'html',
selector: '.blocks-gallery-caption'
},
imageCrop: {
type: 'boolean',
default: true
},
linkTo: {
type: 'string'
},
sizeSlug: {
type: 'string',
default: 'large'
}
},
save: function save(_ref) {
var attributes = _ref.attributes;
var images = attributes.images,
_attributes$columns = attributes.columns,
columns = _attributes$columns === void 0 ? defaultColumnsNumber(attributes) : _attributes$columns,
imageCrop = attributes.imageCrop,
caption = attributes.caption,
linkTo = attributes.linkTo;
return Object(external_this_wp_element_["createElement"])("figure", {
className: "columns-".concat(columns, " ").concat(imageCrop ? 'is-cropped' : '')
}, Object(external_this_wp_element_["createElement"])("ul", {
className: "blocks-gallery-grid"
}, images.map(function (image) {
var href;
switch (linkTo) {
case constants_LINK_DESTINATION_MEDIA:
href = image.fullUrl || image.url;
break;
case constants_LINK_DESTINATION_ATTACHMENT:
href = image.link;
break;
}
var img = Object(external_this_wp_element_["createElement"])("img", {
src: image.url,
alt: image.alt,
"data-id": image.id,
"data-full-url": image.fullUrl,
"data-link": image.link,
className: image.id ? "wp-image-".concat(image.id) : null
});
return Object(external_this_wp_element_["createElement"])("li", {
key: image.id || image.url,
className: "blocks-gallery-item"
}, Object(external_this_wp_element_["createElement"])("figure", null, href ? Object(external_this_wp_element_["createElement"])("a", {
href: href
}, img) : img, !external_this_wp_blockEditor_["RichText"].isEmpty(image.caption) && Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichText"].Content, {
tagName: "figcaption",
className: "blocks-gallery-item__caption",
value: image.caption
})));
})), !external_this_wp_blockEditor_["RichText"].isEmpty(caption) && Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["RichText"].Content, {
tagName: "figcaption",
className: "blocks-gallery-caption",
value: caption
}));
}
}, {
attributes: { attributes: {
images: { images: {
type: 'array', type: 'array',
@ -7327,8 +7225,8 @@ var gallery_deprecated_deprecated = [{
supports: { supports: {
align: true align: true
}, },
isEligible: function isEligible(_ref2) { isEligible: function isEligible(_ref) {
var linkTo = _ref2.linkTo; var linkTo = _ref.linkTo;
return !linkTo || linkTo === 'attachment' || linkTo === 'media'; return !linkTo || linkTo === 'attachment' || linkTo === 'media';
}, },
migrate: function migrate(attributes) { migrate: function migrate(attributes) {
@ -7346,11 +7244,11 @@ var gallery_deprecated_deprecated = [{
linkTo: linkTo linkTo: linkTo
}); });
}, },
save: function save(_ref3) { save: function save(_ref2) {
var attributes = _ref3.attributes; var attributes = _ref2.attributes;
var images = attributes.images, var images = attributes.images,
_attributes$columns2 = attributes.columns, _attributes$columns = attributes.columns,
columns = _attributes$columns2 === void 0 ? defaultColumnsNumber(attributes) : _attributes$columns2, columns = _attributes$columns === void 0 ? defaultColumnsNumber(attributes) : _attributes$columns,
imageCrop = attributes.imageCrop, imageCrop = attributes.imageCrop,
caption = attributes.caption, caption = attributes.caption,
linkTo = attributes.linkTo; linkTo = attributes.linkTo;
@ -7460,8 +7358,8 @@ var gallery_deprecated_deprecated = [{
supports: { supports: {
align: true align: true
}, },
isEligible: function isEligible(_ref4) { isEligible: function isEligible(_ref3) {
var ids = _ref4.ids; var ids = _ref3.ids;
return ids && ids.some(function (id) { return ids && ids.some(function (id) {
return typeof id === 'string'; return typeof id === 'string';
}); });
@ -7474,11 +7372,11 @@ var gallery_deprecated_deprecated = [{
}) })
}); });
}, },
save: function save(_ref5) { save: function save(_ref4) {
var attributes = _ref5.attributes; var attributes = _ref4.attributes;
var images = attributes.images, var images = attributes.images,
_attributes$columns3 = attributes.columns, _attributes$columns2 = attributes.columns,
columns = _attributes$columns3 === void 0 ? defaultColumnsNumber(attributes) : _attributes$columns3, columns = _attributes$columns2 === void 0 ? defaultColumnsNumber(attributes) : _attributes$columns2,
imageCrop = attributes.imageCrop, imageCrop = attributes.imageCrop,
caption = attributes.caption, caption = attributes.caption,
linkTo = attributes.linkTo; linkTo = attributes.linkTo;
@ -7583,11 +7481,11 @@ var gallery_deprecated_deprecated = [{
supports: { supports: {
align: true align: true
}, },
save: function save(_ref6) { save: function save(_ref5) {
var attributes = _ref6.attributes; var attributes = _ref5.attributes;
var images = attributes.images, var images = attributes.images,
_attributes$columns4 = attributes.columns, _attributes$columns3 = attributes.columns,
columns = _attributes$columns4 === void 0 ? defaultColumnsNumber(attributes) : _attributes$columns4, columns = _attributes$columns3 === void 0 ? defaultColumnsNumber(attributes) : _attributes$columns3,
imageCrop = attributes.imageCrop, imageCrop = attributes.imageCrop,
linkTo = attributes.linkTo; linkTo = attributes.linkTo;
return Object(external_this_wp_element_["createElement"])("ul", { return Object(external_this_wp_element_["createElement"])("ul", {
@ -7672,9 +7570,9 @@ var gallery_deprecated_deprecated = [{
default: 'none' default: 'none'
} }
}, },
isEligible: function isEligible(_ref7) { isEligible: function isEligible(_ref6) {
var images = _ref7.images, var images = _ref6.images,
ids = _ref7.ids; ids = _ref6.ids;
return images && images.length > 0 && (!ids && images || ids && images && ids.length !== images.length || Object(external_this_lodash_["some"])(images, function (id, index) { return images && images.length > 0 && (!ids && images || ids && images && ids.length !== images.length || Object(external_this_lodash_["some"])(images, function (id, index) {
if (!id && ids[index] !== null) { if (!id && ids[index] !== null) {
return true; return true;
@ -7685,8 +7583,8 @@ var gallery_deprecated_deprecated = [{
}, },
migrate: function migrate(attributes) { migrate: function migrate(attributes) {
return gallery_deprecated_objectSpread(gallery_deprecated_objectSpread({}, attributes), {}, { return gallery_deprecated_objectSpread(gallery_deprecated_objectSpread({}, attributes), {}, {
ids: Object(external_this_lodash_["map"])(attributes.images, function (_ref8) { ids: Object(external_this_lodash_["map"])(attributes.images, function (_ref7) {
var id = _ref8.id; var id = _ref7.id;
if (!id) { if (!id) {
return null; return null;
@ -7699,11 +7597,11 @@ var gallery_deprecated_deprecated = [{
supports: { supports: {
align: true align: true
}, },
save: function save(_ref9) { save: function save(_ref8) {
var attributes = _ref9.attributes; var attributes = _ref8.attributes;
var images = attributes.images, var images = attributes.images,
_attributes$columns5 = attributes.columns, _attributes$columns4 = attributes.columns,
columns = _attributes$columns5 === void 0 ? defaultColumnsNumber(attributes) : _attributes$columns5, columns = _attributes$columns4 === void 0 ? defaultColumnsNumber(attributes) : _attributes$columns4,
imageCrop = attributes.imageCrop, imageCrop = attributes.imageCrop,
linkTo = attributes.linkTo; linkTo = attributes.linkTo;
return Object(external_this_wp_element_["createElement"])("ul", { return Object(external_this_wp_element_["createElement"])("ul", {
@ -7781,11 +7679,11 @@ var gallery_deprecated_deprecated = [{
supports: { supports: {
align: true align: true
}, },
save: function save(_ref10) { save: function save(_ref9) {
var attributes = _ref10.attributes; var attributes = _ref9.attributes;
var images = attributes.images, var images = attributes.images,
_attributes$columns6 = attributes.columns, _attributes$columns5 = attributes.columns,
columns = _attributes$columns6 === void 0 ? defaultColumnsNumber(attributes) : _attributes$columns6, columns = _attributes$columns5 === void 0 ? defaultColumnsNumber(attributes) : _attributes$columns5,
align = attributes.align, align = attributes.align,
imageCrop = attributes.imageCrop, imageCrop = attributes.imageCrop,
linkTo = attributes.linkTo; linkTo = attributes.linkTo;
@ -7869,6 +7767,11 @@ var library_edit = __webpack_require__(274);
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/close-small.js // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/close-small.js
var close_small = __webpack_require__(159); var close_small = __webpack_require__(159);
// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/constants.js
var constants_LINK_DESTINATION_NONE = 'none';
var constants_LINK_DESTINATION_MEDIA = 'file';
var constants_LINK_DESTINATION_ATTACHMENT = 'post';
// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/gallery-image.js // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/gallery-image.js
@ -8774,7 +8677,7 @@ function gallery_save_save(_ref) {
var img = Object(external_this_wp_element_["createElement"])("img", { var img = Object(external_this_wp_element_["createElement"])("img", {
src: image.url, src: image.url,
alt: image.alt !== '' ? image.alt : image.caption, alt: image.alt,
"data-id": image.id, "data-id": image.id,
"data-full-url": image.fullUrl, "data-full-url": image.fullUrl,
"data-link": image.link, "data-link": image.link,
@ -11633,7 +11536,8 @@ var columns_deprecated_migrateCustomColors = function migrateCustomColors(attrib
*/ */
var toWidthPrecision = function toWidthPrecision(value) { var toWidthPrecision = function toWidthPrecision(value) {
return Number.isFinite(value) ? parseFloat(value.toFixed(2)) : undefined; var unitlessValue = parseFloat(value);
return Number.isFinite(unitlessValue) ? parseFloat(unitlessValue.toFixed(2)) : undefined;
}; };
/** /**
* Returns an effective width for a given block. An effective width is equal to * Returns an effective width for a given block. An effective width is equal to
@ -11714,9 +11618,12 @@ function getRedistributedColumnWidths(blocks, availableWidth) {
* @return {boolean} Whether columns have explicit widths. * @return {boolean} Whether columns have explicit widths.
*/ */
function hasExplicitColumnWidths(blocks) { function hasExplicitPercentColumnWidths(blocks) {
return blocks.every(function (block) { return blocks.every(function (block) {
return Number.isFinite(block.attributes.width); var _blockWidth$endsWith;
var blockWidth = block.attributes.width;
return Number.isFinite((blockWidth === null || blockWidth === void 0 ? void 0 : (_blockWidth$endsWith = blockWidth.endsWith) === null || _blockWidth$endsWith === void 0 ? void 0 : _blockWidth$endsWith.call(blockWidth, '%')) ? parseFloat(blockWidth) : blockWidth);
}); });
} }
/** /**
@ -11864,7 +11771,7 @@ var ColumnsEditContainerWrapper = Object(external_this_wp_data_["withDispatch"])
getBlocks = _registry$select2.getBlocks; getBlocks = _registry$select2.getBlocks;
var innerBlocks = getBlocks(clientId); var innerBlocks = getBlocks(clientId);
var hasExplicitWidths = hasExplicitColumnWidths(innerBlocks); // Redistribute available width for existing inner blocks. var hasExplicitWidths = hasExplicitPercentColumnWidths(innerBlocks); // Redistribute available width for existing inner blocks.
var isAddingColumn = newColumns > previousColumns; var isAddingColumn = newColumns > previousColumns;
@ -12271,24 +12178,23 @@ var column_deprecated_deprecated = [{
max: 100 max: 100
} }
}, },
isEligible: function isEligible(_ref) {
var width = _ref.width;
return isFinite(width);
},
migrate: function migrate(attributes) { migrate: function migrate(attributes) {
return column_deprecated_objectSpread(column_deprecated_objectSpread({}, attributes), {}, { return column_deprecated_objectSpread(column_deprecated_objectSpread({}, attributes), {}, {
width: "".concat(attributes.width, "%") width: "".concat(attributes.width, "%")
}); });
}, },
save: function save(_ref) { save: function save(_ref2) {
var attributes = _ref.attributes; var attributes = _ref2.attributes;
var verticalAlignment = attributes.verticalAlignment, var verticalAlignment = attributes.verticalAlignment,
width = attributes.width; width = attributes.width;
var wrapperClasses = classnames_default()(Object(defineProperty["a" /* default */])({}, "is-vertically-aligned-".concat(verticalAlignment), verticalAlignment)); var wrapperClasses = classnames_default()(Object(defineProperty["a" /* default */])({}, "is-vertically-aligned-".concat(verticalAlignment), verticalAlignment));
var style; var style = {
if (Number.isFinite(width)) {
style = {
flexBasis: width + '%' flexBasis: width + '%'
}; };
}
return Object(external_this_wp_element_["createElement"])("div", { return Object(external_this_wp_element_["createElement"])("div", {
className: wrapperClasses, className: wrapperClasses,
style: style style: style
@ -12351,10 +12257,11 @@ function ColumnEdit(_ref) {
}); });
}; };
var widthWithUnit = Number.isFinite(width) ? width + '%' : width;
var blockProps = Object(external_this_wp_blockEditor_["useBlockProps"])({ var blockProps = Object(external_this_wp_blockEditor_["useBlockProps"])({
className: classes, className: classes,
style: width ? { style: widthWithUnit ? {
flexBasis: width flexBasis: widthWithUnit
} : undefined } : undefined
}); });
var innerBlocksProps = Object(external_this_wp_blockEditor_["__experimentalUseInnerBlocksProps"])(blockProps, { var innerBlocksProps = Object(external_this_wp_blockEditor_["__experimentalUseInnerBlocksProps"])(blockProps, {
@ -12424,8 +12331,9 @@ function column_save_save(_ref) {
var style; var style;
if (width) { if (width) {
// Numbers are handled for backward compatibility as they can be still provided with templates.
style = { style = {
flexBasis: width flexBasis: Number.isFinite(width) ? width + '%' : width
}; };
} }
@ -13301,7 +13209,6 @@ function CoverEdit(_ref3) {
} }
} }
var canDim = !!url && (overlayColor.color || gradientValue);
var hasBackground = !!(url || overlayColor.color || gradientValue); var hasBackground = !!(url || overlayColor.color || gradientValue);
var showFocalPointPicker = isVideoBackground || isImageBackground && (!hasParallax || isRepeated); var showFocalPointPicker = isVideoBackground || isImageBackground && (!hasParallax || isRepeated);
var controls = Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["BlockControls"], null, hasBackground && Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["__experimentalBlockAlignmentMatrixToolbar"], { var controls = Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["BlockControls"], null, hasBackground && Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["__experimentalBlockAlignmentMatrixToolbar"], {
@ -13377,7 +13284,7 @@ function CoverEdit(_ref3) {
onGradientChange: setGradient, onGradientChange: setGradient,
label: Object(external_this_wp_i18n_["__"])('Color') label: Object(external_this_wp_i18n_["__"])('Color')
}] }]
}, canDim && Object(external_this_wp_element_["createElement"])(external_this_wp_components_["RangeControl"], { }, !!url && Object(external_this_wp_element_["createElement"])(external_this_wp_components_["RangeControl"], {
label: Object(external_this_wp_i18n_["__"])('Opacity'), label: Object(external_this_wp_i18n_["__"])('Opacity'),
value: dimRatio, value: dimRatio,
onChange: function onChange(newDimRation) { onChange: function onChange(newDimRation) {

File diff suppressed because one or more lines are too long

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.6-beta3-49578'; $wp_version = '5.6-beta3-49579';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.