Editor: Update block editor packages for WordPress 5.8.1.

The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`

Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Merges [51719] to the 5.8 branch.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/branches/5.8@51721


git-svn-id: http://core.svn.wordpress.org/branches/5.8@51327 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
desrosj 2021-09-01 19:28:24 +00:00
parent 9134e272c6
commit 00c29d0f49
31 changed files with 1303 additions and 425 deletions

File diff suppressed because one or more lines are too long

View File

@ -737,7 +737,7 @@
align-self: center;
padding: 0;
list-style: none;
margin: 0 0 0 auto;
margin: 8px;
}
.block-editor-block-list__block .block-list-appender.wp-block {
max-width: none;

File diff suppressed because one or more lines are too long

View File

@ -737,7 +737,7 @@
align-self: center;
padding: 0;
list-style: none;
margin: 0 auto 0 0;
margin: 8px;
}
.block-editor-block-list__block .block-list-appender.wp-block {
max-width: none;

File diff suppressed because one or more lines are too long

View File

@ -439,6 +439,14 @@ body.is-dragging-components-draggable .wp-block[data-type="core/widget-area"] .c
pointer-events: none;
}
.edit-widgets-error-boundary {
margin: auto;
max-width: 780px;
padding: 20px;
margin-top: 60px;
box-shadow: 0 10px 10px rgba(0, 0, 0, 0.25);
}
.edit-widgets-header {
display: flex;
align-items: center;

File diff suppressed because one or more lines are too long

View File

@ -439,6 +439,14 @@ body.is-dragging-components-draggable .wp-block[data-type="core/widget-area"] .c
pointer-events: none;
}
.edit-widgets-error-boundary {
margin: auto;
max-width: 780px;
padding: 20px;
margin-top: 60px;
box-shadow: 0 10px 10px rgba(0, 0, 0, 0.25);
}
.edit-widgets-header {
display: flex;
align-items: center;

File diff suppressed because one or more lines are too long

View File

@ -145,6 +145,8 @@
line-height: 1;
min-height: 30px;
padding-right: 8px;
padding-top: 8px;
padding-bottom: 8px;
}
.wp-block-legacy-widget__edit-form .widget-inside.widget-inside select {
padding-right: 4px;

File diff suppressed because one or more lines are too long

View File

@ -145,6 +145,8 @@
line-height: 1;
min-height: 30px;
padding-left: 8px;
padding-top: 8px;
padding-bottom: 8px;
}
.wp-block-legacy-widget__edit-form .widget-inside.widget-inside select {
padding-left: 4px;

File diff suppressed because one or more lines are too long

View File

@ -17122,6 +17122,26 @@ function DuotoneControl({
/* harmony default export */ var duotone_control = (DuotoneControl);
// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/head.js
/**
* WordPress dependencies
*/
const head_context = Object(external_wp_element_["createContext"])();
function Head({
children
}) {
const [element, setElement] = Object(external_wp_element_["useState"])();
return Object(external_wp_element_["createElement"])(head_context.Provider, {
value: element
}, Object(external_wp_element_["createElement"])("div", {
ref: setElement
}), children);
}
Head.context = head_context;
// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/duotone.js
@ -17139,11 +17159,13 @@ function DuotoneControl({
/**
* Internal dependencies
*/
const duotone_EMPTY_ARRAY = [];
/**
* Convert a list of colors to an object of R, G, and B values.
@ -17334,11 +17356,12 @@ const withDuotoneStyles = Object(external_wp_compose_["createHigherOrderComponen
const selectorsScoped = selectors.map(selector => `.${id} ${selector.trim()}`);
const selectorsGroup = selectorsScoped.join(', ');
const className = classnames_default()(props === null || props === void 0 ? void 0 : props.className, id);
return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(DuotoneFilter, {
const element = Object(external_wp_element_["useContext"])(Head.context);
return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, element && Object(external_wp_element_["createPortal"])(Object(external_wp_element_["createElement"])(DuotoneFilter, {
selector: selectorsGroup,
id: id,
values: getValuesFromColors(values)
}), Object(external_wp_element_["createElement"])(BlockListBlock, Object(esm_extends["a" /* default */])({}, props, {
}), element), Object(external_wp_element_["createElement"])(BlockListBlock, Object(esm_extends["a" /* default */])({}, props, {
className: className
})));
}, 'withDuotoneStyles');
@ -17369,6 +17392,7 @@ var build_module_icon = __webpack_require__("iClF");
/**
* Internal dependencies
*/
@ -17378,6 +17402,7 @@ var build_module_icon = __webpack_require__("iClF");
function LayoutPanel({
setAttributes,
attributes
@ -17536,10 +17561,11 @@ const withLayoutStyles = Object(external_wp_compose_["createHigherOrderComponent
} = attributes;
const usedLayout = !!layout && layout.inherit ? defaultLayout : layout;
const className = classnames_default()(props === null || props === void 0 ? void 0 : props.className, `wp-container-${id}`);
return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(LayoutStyle, {
const element = Object(external_wp_element_["useContext"])(Head.context);
return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, element && Object(external_wp_element_["createPortal"])(Object(external_wp_element_["createElement"])(LayoutStyle, {
selector: `.wp-container-${id}`,
layout: usedLayout
}), Object(external_wp_element_["createElement"])(BlockListBlock, Object(esm_extends["a" /* default */])({}, props, {
}), element), Object(external_wp_element_["createElement"])(BlockListBlock, Object(esm_extends["a" /* default */])({}, props, {
className: className
})));
});
@ -28264,6 +28290,7 @@ function BlockSelectionClearer(props) {
const IntersectionObserver = Object(external_wp_element_["createContext"])();
function Root({
@ -28290,14 +28317,14 @@ function Root({
isNavigationMode: _isNavigationMode()
};
}, []);
return Object(external_wp_element_["createElement"])("div", {
return Object(external_wp_element_["createElement"])(Head, null, Object(external_wp_element_["createElement"])("div", {
ref: Object(external_wp_compose_["useMergeRefs"])([useBlockSelectionClearer(), useBlockDropZone(), useInBetweenInserter()]),
className: classnames_default()('block-editor-block-list__layout is-root-container', className, {
'is-outline-mode': isOutlineMode,
'is-focus-mode': isFocusMode && isLargeViewport,
'is-navigate-mode': isNavigationMode
})
}, children);
}, children));
}
function BlockList({
@ -39156,12 +39183,11 @@ function useSelectAll() {
return;
}
const selectedClientIds = getSelectedBlockClientIds();
if (selectedClientIds.length === 1 && !Object(external_wp_dom_["isEntirelySelected"])(event.target)) {
if (!Object(external_wp_dom_["isEntirelySelected"])(event.target)) {
return;
}
const selectedClientIds = getSelectedBlockClientIds();
const [firstSelectedClientId] = selectedClientIds;
const rootClientId = getBlockRootClientId(firstSelectedClientId);
let blockClientIds = getBlockOrder(rootClientId); // If we have selected all sibling nested blocks, try selecting up a

File diff suppressed because one or more lines are too long

View File

@ -10439,30 +10439,42 @@ function URLPicker({
setAttributes,
opensInNewTab,
onToggleOpenInNewTab,
anchorRef
anchorRef,
richTextRef
}) {
const [isURLPickerOpen, setIsURLPickerOpen] = Object(external_wp_element_["useState"])(false);
const urlIsSet = !!url;
const urlIsSetandSelected = urlIsSet && isSelected;
const [isEditingURL, setIsEditingURL] = Object(external_wp_element_["useState"])(false);
const isURLSet = !!url;
const openLinkControl = () => {
setIsURLPickerOpen(true);
return false; // prevents default behaviour for event
const startEditing = event => {
event.preventDefault();
setIsEditingURL(true);
};
const unlinkButton = () => {
const unlink = () => {
setAttributes({
url: undefined,
linkTarget: undefined,
rel: undefined
});
setIsURLPickerOpen(false);
setIsEditingURL(false);
};
const linkControl = (isURLPickerOpen || urlIsSetandSelected) && Object(external_wp_element_["createElement"])(external_wp_components_["Popover"], {
Object(external_wp_element_["useEffect"])(() => {
if (!isSelected) {
setIsEditingURL(false);
}
}, [isSelected]);
const isLinkControlVisible = isSelected && (isEditingURL || isURLSet);
const linkControl = isLinkControlVisible && Object(external_wp_element_["createElement"])(external_wp_components_["Popover"], {
position: "bottom center",
onClose: () => setIsURLPickerOpen(false),
anchorRef: anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current
onClose: () => {
var _richTextRef$current;
setIsEditingURL(false);
(_richTextRef$current = richTextRef.current) === null || _richTextRef$current === void 0 ? void 0 : _richTextRef$current.focus();
},
anchorRef: anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current,
focusOnMount: isEditingURL ? 'firstElement' : false
}, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalLinkControl"], {
className: "wp-block-navigation-link__inline-link-input",
value: {
@ -10480,28 +10492,40 @@ function URLPicker({
if (opensInNewTab !== newOpensInNewTab) {
onToggleOpenInNewTab(newOpensInNewTab);
}
}
},
onRemove: () => {
var _richTextRef$current2;
unlink();
(_richTextRef$current2 = richTextRef.current) === null || _richTextRef$current2 === void 0 ? void 0 : _richTextRef$current2.focus();
},
forceIsEditingLink: isEditingURL
}));
return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], {
group: "block"
}, !urlIsSet && Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], {
}, !isURLSet && Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], {
name: "link",
icon: library_link["a" /* default */],
title: Object(external_wp_i18n_["__"])('Link'),
shortcut: external_wp_keycodes_["displayShortcut"].primary('k'),
onClick: openLinkControl
}), urlIsSetandSelected && Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], {
onClick: startEditing
}), isURLSet && Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], {
name: "link",
icon: link_off["a" /* default */],
title: Object(external_wp_i18n_["__"])('Unlink'),
shortcut: external_wp_keycodes_["displayShortcut"].primaryShift('k'),
onClick: unlinkButton,
onClick: unlink,
isActive: true
})), isSelected && Object(external_wp_element_["createElement"])(external_wp_components_["KeyboardShortcuts"], {
bindGlobal: true,
shortcuts: {
[external_wp_keycodes_["rawShortcut"].primary('k')]: openLinkControl,
[external_wp_keycodes_["rawShortcut"].primaryShift('k')]: unlinkButton
[external_wp_keycodes_["rawShortcut"].primary('k')]: startEditing,
[external_wp_keycodes_["rawShortcut"].primaryShift('k')]: () => {
var _richTextRef$current3;
unlink();
(_richTextRef$current3 = richTextRef.current) === null || _richTextRef$current3 === void 0 ? void 0 : _richTextRef$current3.focus();
}
}
}), linkControl);
}
@ -10557,6 +10581,7 @@ function ButtonEdit(props) {
const borderRadius = style === null || style === void 0 ? void 0 : (_style$border = style.border) === null || _style$border === void 0 ? void 0 : _style$border.radius;
const colorProps = Object(external_wp_blockEditor_["__experimentalUseColorProps"])(attributes);
const ref = Object(external_wp_element_["useRef"])();
const richTextRef = Object(external_wp_element_["useRef"])();
const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({
ref
});
@ -10566,6 +10591,7 @@ function ButtonEdit(props) {
[`has-custom-font-size`]: blockProps.style.fontSize
})
}), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], {
ref: richTextRef,
"aria-label": Object(external_wp_i18n_["__"])('Button text'),
placeholder: placeholder || Object(external_wp_i18n_["__"])('Add text…'),
value: text,
@ -10590,7 +10616,8 @@ function ButtonEdit(props) {
isSelected: isSelected,
opensInNewTab: linkTarget === '_blank',
onToggleOpenInNewTab: onToggleOpenInNewTab,
anchorRef: ref
anchorRef: ref,
richTextRef: richTextRef
}), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], null, Object(external_wp_element_["createElement"])(WidthPanel, {
selectedWidth: width,
setAttributes: setAttributes

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -927,11 +927,24 @@ var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_w
// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/batch/default-processor.js
/**
* WordPress dependencies
* External dependencies
*/
/**
* Default batch processor. Sends its input requests to /v1/batch.
* WordPress dependencies
*/
/**
* Maximum number of requests to place in a single batch request. Obtained by
* sending a preflight OPTIONS request to /batch/v1/.
*
* @type {number?}
*/
let maxItems = null;
/**
* Default batch processor. Sends its input requests to /batch/v1.
*
* @param {Array} requests List of API requests to perform at once.
*
@ -941,38 +954,55 @@ var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_w
*/
async function defaultProcessor(requests) {
const batchResponse = await external_wp_apiFetch_default()({
path: '/batch/v1',
method: 'POST',
data: {
validation: 'require-all-validate',
requests: requests.map(request => ({
path: request.path,
body: request.data,
// Rename 'data' to 'body'.
method: request.method,
headers: request.headers
}))
}
});
if (batchResponse.failed) {
return batchResponse.responses.map(response => ({
error: response === null || response === void 0 ? void 0 : response.body
}));
if (maxItems === null) {
const preflightResponse = await external_wp_apiFetch_default()({
path: '/batch/v1',
method: 'OPTIONS'
});
maxItems = preflightResponse.endpoints[0].args.requests.maxItems;
}
return batchResponse.responses.map(response => {
const result = {};
const results = [];
if (response.status >= 200 && response.status < 300) {
result.output = response.body;
for (const batchRequests of Object(external_lodash_["chunk"])(requests, maxItems)) {
const batchResponse = await external_wp_apiFetch_default()({
path: '/batch/v1',
method: 'POST',
data: {
validation: 'require-all-validate',
requests: batchRequests.map(request => ({
path: request.path,
body: request.data,
// Rename 'data' to 'body'.
method: request.method,
headers: request.headers
}))
}
});
let batchResults;
if (batchResponse.failed) {
batchResults = batchResponse.responses.map(response => ({
error: response === null || response === void 0 ? void 0 : response.body
}));
} else {
result.error = response.body;
batchResults = batchResponse.responses.map(response => {
const result = {};
if (response.status >= 200 && response.status < 300) {
result.output = response.body;
} else {
result.error = response.body;
}
return result;
});
}
return result;
});
results.push(...batchResults);
}
return results;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/batch/create-batch.js

File diff suppressed because one or more lines are too long

View File

@ -122,11 +122,14 @@ __webpack_require__.d(__webpack_exports__, "initialize", function() { return /*
var selectors_namespaceObject = {};
__webpack_require__.r(selectors_namespaceObject);
__webpack_require__.d(selectors_namespaceObject, "__unstableIsFeatureActive", function() { return __unstableIsFeatureActive; });
__webpack_require__.d(selectors_namespaceObject, "isInserterOpened", function() { return selectors_isInserterOpened; });
__webpack_require__.d(selectors_namespaceObject, "__experimentalGetInsertionPoint", function() { return __experimentalGetInsertionPoint; });
// NAMESPACE OBJECT: ./node_modules/@wordpress/customize-widgets/build-module/store/actions.js
var actions_namespaceObject = {};
__webpack_require__.r(actions_namespaceObject);
__webpack_require__.d(actions_namespaceObject, "__unstableToggleFeature", function() { return __unstableToggleFeature; });
__webpack_require__.d(actions_namespaceObject, "setIsInserterOpened", function() { return actions_setIsInserterOpened; });
// EXTERNAL MODULE: external ["wp","element"]
var external_wp_element_ = __webpack_require__("GRId");
@ -143,6 +146,72 @@ var external_wp_blocks_ = __webpack_require__("HSyU");
// EXTERNAL MODULE: external ["wp","components"]
var external_wp_components_ = __webpack_require__("tI+e");
// EXTERNAL MODULE: external ["wp","i18n"]
var external_wp_i18n_ = __webpack_require__("l3Sj");
// EXTERNAL MODULE: external ["wp","blockEditor"]
var external_wp_blockEditor_ = __webpack_require__("axFQ");
// EXTERNAL MODULE: external ["wp","compose"]
var external_wp_compose_ = __webpack_require__("K9lf");
// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/components/error-boundary/index.js
/**
* WordPress dependencies
*/
function CopyButton({
text,
children
}) {
const ref = Object(external_wp_compose_["useCopyToClipboard"])(text);
return Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
variant: "secondary",
ref: ref
}, children);
}
class error_boundary_ErrorBoundary extends external_wp_element_["Component"] {
constructor() {
super(...arguments);
this.state = {
error: null
};
}
componentDidCatch(error) {
this.setState({
error
});
}
render() {
const {
error
} = this.state;
if (!error) {
return this.props.children;
}
return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["Warning"], {
className: "customize-widgets-error-boundary",
actions: [Object(external_wp_element_["createElement"])(CopyButton, {
key: "copy-error",
text: error.stack
}, Object(external_wp_i18n_["__"])('Copy Error'))]
}, Object(external_wp_i18n_["__"])('The editor has encountered an unexpected error.'));
}
}
// EXTERNAL MODULE: external "lodash"
var external_lodash_ = __webpack_require__("YLtl");
@ -152,18 +221,12 @@ var external_wp_coreData_ = __webpack_require__("jZUy");
// EXTERNAL MODULE: external ["wp","data"]
var external_wp_data_ = __webpack_require__("1ZqX");
// EXTERNAL MODULE: external ["wp","blockEditor"]
var external_wp_blockEditor_ = __webpack_require__("axFQ");
// EXTERNAL MODULE: external ["wp","mediaUtils"]
var external_wp_mediaUtils_ = __webpack_require__("6aBm");
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
var esm_extends = __webpack_require__("wx14");
// EXTERNAL MODULE: external ["wp","i18n"]
var external_wp_i18n_ = __webpack_require__("l3Sj");
// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/components/block-inspector-button/index.js
@ -214,66 +277,9 @@ var library_redo = __webpack_require__("K2cm");
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/plus.js
var plus = __webpack_require__("Q4Sy");
// EXTERNAL MODULE: external ["wp","compose"]
var external_wp_compose_ = __webpack_require__("K9lf");
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/close-small.js
var close_small = __webpack_require__("bWcr");
// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/components/inserter/index.js
/**
* WordPress dependencies
*/
function Inserter({
setIsOpened
}) {
const inserterTitleId = Object(external_wp_compose_["useInstanceId"])(Inserter, 'customize-widget-layout__inserter-panel-title');
return Object(external_wp_element_["createElement"])("div", {
className: "customize-widgets-layout__inserter-panel",
"aria-labelledby": inserterTitleId
}, Object(external_wp_element_["createElement"])("div", {
className: "customize-widgets-layout__inserter-panel-header"
}, Object(external_wp_element_["createElement"])("h2", {
id: inserterTitleId,
className: "customize-widgets-layout__inserter-panel-header-title"
}, Object(external_wp_i18n_["__"])('Add a block')), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
className: "customize-widgets-layout__inserter-panel-header-close-button",
icon: close_small["a" /* default */],
onClick: () => setIsOpened(false),
"aria-label": Object(external_wp_i18n_["__"])('Close inserter')
})), Object(external_wp_element_["createElement"])("div", {
className: "customize-widgets-layout__inserter-panel-content"
}, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalLibrary"], {
showInserterHelpPanel: true,
onSelect: () => setIsOpened(false)
})));
}
/* harmony default export */ var components_inserter = (Inserter);
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/more-vertical.js
var more_vertical = __webpack_require__("VKE3");
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/external.js
var external = __webpack_require__("K+tz");
// EXTERNAL MODULE: external ["wp","keyboardShortcuts"]
var external_wp_keyboardShortcuts_ = __webpack_require__("hF7m");
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/check.js
var check = __webpack_require__("RMJe");
// EXTERNAL MODULE: external ["wp","a11y"]
var external_wp_a11y_ = __webpack_require__("gdqT");
// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/store/defaults.js
const PREFERENCES_DEFAULTS = {
features: {
@ -309,6 +315,22 @@ const PREFERENCES_DEFAULTS = {
const createWithInitialState = initialState => reducer => {
return (state = initialState, action) => reducer(state, action);
};
/**
* Reducer tracking whether the inserter is open.
*
* @param {boolean|Object} state
* @param {Object} action
*/
function blockInserterPanel(state = false, action) {
switch (action.type) {
case 'SET_IS_INSERTER_OPENED':
return action.value;
}
return state;
}
/**
* Reducer returning the user preferences.
*
@ -332,6 +354,7 @@ const preferences = Object(external_lodash_["flow"])([external_wp_data_["combine
});
/* harmony default export */ var reducer = (Object(external_wp_data_["combineReducers"])({
blockInserterPanel,
preferences
}));
@ -356,6 +379,35 @@ const preferences = Object(external_lodash_["flow"])([external_wp_data_["combine
function __unstableIsFeatureActive(state, feature) {
return Object(external_lodash_["get"])(state.preferences.features, [feature], false);
}
/**
* Returns true if the inserter is opened.
*
* @param {Object} state Global application state.
*
* @return {boolean} Whether the inserter is opened.
*/
function selectors_isInserterOpened(state) {
return !!state.blockInserterPanel;
}
/**
* Get the insertion point for the inserter.
*
* @param {Object} state Global application state.
*
* @return {Object} The root client ID and index to insert at.
*/
function __experimentalGetInsertionPoint(state) {
const {
rootClientId,
insertionIndex
} = state.blockInserterPanel;
return {
rootClientId,
insertionIndex
};
}
// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/store/actions.js
/**
@ -375,6 +427,25 @@ function __unstableToggleFeature(feature) {
feature
};
}
/**
* Returns an action object used to open/close the inserter.
*
* @param {boolean|Object} value Whether the inserter should be
* opened (true) or closed (false).
* To specify an insertion point,
* use an object.
* @param {string} value.rootClientId The root client ID to insert at.
* @param {number} value.insertionIndex The index to insert at.
*
* @return {Object} Action object.
*/
function actions_setIsInserterOpened(value) {
return {
type: 'SET_IS_INSERTER_OPENED',
value
};
}
// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/store/constants.js
/**
@ -422,6 +493,69 @@ const store = Object(external_wp_data_["createReduxStore"])(STORE_NAME, storeCon
Object(external_wp_data_["registerStore"])(STORE_NAME, storeConfig);
// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/components/inserter/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function Inserter({
setIsOpened
}) {
const inserterTitleId = Object(external_wp_compose_["useInstanceId"])(Inserter, 'customize-widget-layout__inserter-panel-title');
const insertionPoint = Object(external_wp_data_["useSelect"])(select => select(store).__experimentalGetInsertionPoint());
return Object(external_wp_element_["createElement"])("div", {
className: "customize-widgets-layout__inserter-panel",
"aria-labelledby": inserterTitleId
}, Object(external_wp_element_["createElement"])("div", {
className: "customize-widgets-layout__inserter-panel-header"
}, Object(external_wp_element_["createElement"])("h2", {
id: inserterTitleId,
className: "customize-widgets-layout__inserter-panel-header-title"
}, Object(external_wp_i18n_["__"])('Add a block')), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
className: "customize-widgets-layout__inserter-panel-header-close-button",
icon: close_small["a" /* default */],
onClick: () => setIsOpened(false),
"aria-label": Object(external_wp_i18n_["__"])('Close inserter')
})), Object(external_wp_element_["createElement"])("div", {
className: "customize-widgets-layout__inserter-panel-content"
}, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalLibrary"], {
rootClientId: insertionPoint.rootClientId,
__experimentalInsertionIndex: insertionPoint.insertionIndex,
showInserterHelpPanel: true,
onSelect: () => setIsOpened(false)
})));
}
/* harmony default export */ var components_inserter = (Inserter);
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/more-vertical.js
var more_vertical = __webpack_require__("VKE3");
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/external.js
var external = __webpack_require__("K+tz");
// EXTERNAL MODULE: external ["wp","keyboardShortcuts"]
var external_wp_keyboardShortcuts_ = __webpack_require__("hF7m");
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/check.js
var check = __webpack_require__("RMJe");
// EXTERNAL MODULE: external ["wp","a11y"]
var external_wp_a11y_ = __webpack_require__("gdqT");
// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/components/more-menu/feature-toggle.js
@ -804,7 +938,7 @@ function MoreMenu() {
}), Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], {
role: "menuitem",
icon: external["a" /* default */],
href: Object(external_wp_i18n_["__"])('https://wordpress.org/support/article/wordpress-editor/'),
href: Object(external_wp_i18n_["__"])('https://wordpress.org/support/article/block-based-widgets-editor/'),
target: "_blank",
rel: "noopener noreferrer"
}, Object(external_wp_i18n_["__"])('Help'), Object(external_wp_element_["createElement"])(external_wp_components_["VisuallyHidden"], {
@ -914,24 +1048,33 @@ function Header({
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function useInserter(inserter) {
const [isInserterOpened, setIsInserterOpened] = Object(external_wp_element_["useState"])(() => inserter.isOpen);
const isInserterOpened = Object(external_wp_data_["useSelect"])(select => select(store).isInserterOpened());
const {
setIsInserterOpened
} = Object(external_wp_data_["useDispatch"])(store);
Object(external_wp_element_["useEffect"])(() => {
return inserter.subscribe(setIsInserterOpened);
}, [inserter]);
return [isInserterOpened, Object(external_wp_element_["useCallback"])(updater => {
let isOpen = updater;
if (typeof updater === 'function') {
isOpen = updater(inserter.isOpen);
}
if (isOpen) {
if (isInserterOpened) {
inserter.open();
} else {
inserter.close();
}
}, [inserter])];
}, [inserter, isInserterOpened]);
return [isInserterOpened, Object(external_wp_element_["useCallback"])(updater => {
let isOpen = updater;
if (typeof updater === 'function') {
isOpen = updater(Object(external_wp_data_["select"])(store).isInserterOpened());
}
setIsInserterOpened(isOpen);
}, [setIsInserterOpened])];
}
// EXTERNAL MODULE: external ["wp","isShallowEqual"]
@ -1542,7 +1685,7 @@ function SidebarBlockEditor({
keepCaretInsideBlock,
__unstableHasCustomAppender: true
};
}, [hasUploadPermissions, blockEditorSettings, isFixedToolbarActive, keepCaretInsideBlock]);
}, [hasUploadPermissions, blockEditorSettings, isFixedToolbarActive, keepCaretInsideBlock, setIsInserterOpened]);
if (isWelcomeGuideActive) {
return Object(external_wp_element_["createElement"])(WelcomeGuide, {
@ -1696,6 +1839,7 @@ function useClearSelectedBlock(sidebarControl, popoverRef) {
function CustomizeWidgets({
api,
sidebarControls,
@ -1715,13 +1859,13 @@ function CustomizeWidgets({
unsubscribers.forEach(unsubscriber => unsubscriber());
};
}, [sidebarControls]);
const activeSidebar = activeSidebarControl && Object(external_wp_element_["createPortal"])(Object(external_wp_element_["createElement"])(SidebarBlockEditor, {
const activeSidebar = activeSidebarControl && Object(external_wp_element_["createPortal"])(Object(external_wp_element_["createElement"])(error_boundary_ErrorBoundary, null, Object(external_wp_element_["createElement"])(SidebarBlockEditor, {
key: activeSidebarControl.id,
blockEditorSettings: blockEditorSettings,
sidebar: activeSidebarControl.sidebarAdapter,
inserter: activeSidebarControl.inserter,
inspector: activeSidebarControl.inspector
}), activeSidebarControl.container[0]); // We have to portal this to the parent of both the editor and the inspector,
})), activeSidebarControl.container[0]); // We have to portal this to the parent of both the editor and the inspector,
// so that the popovers will appear above both of them.
const popover = parentContainer && Object(external_wp_element_["createPortal"])(Object(external_wp_element_["createElement"])("div", {
@ -1838,7 +1982,9 @@ function getSidebarSection() {
var _args$completeCallbac;
controls.forEach(control => {
control.onChangeSectionExpanded(expanded, args);
var _control$onChangeSect;
(_control$onChangeSect = control.onChangeSectionExpanded) === null || _control$onChangeSect === void 0 ? void 0 : _control$onChangeSect.call(control, expanded, args);
});
(_args$completeCallbac = _args.completeCallback) === null || _args$completeCallbac === void 0 ? void 0 : _args$completeCallbac.call(_args);
}
@ -2204,6 +2350,12 @@ var external_wp_dom_ = __webpack_require__("1CF3");
*/
/**
* Internal dependencies
*/
function getInserterOuterSection() {
const {
wp: {
@ -2242,28 +2394,31 @@ function getInserterOuterSection() {
const ownerWindow = this.contentContainer[0].ownerDocument.defaultView; // Handle closing the inserter when pressing the Escape key.
ownerWindow.addEventListener('keydown', event => {
if (this.isOpen && (event.keyCode === external_wp_keycodes_["ESCAPE"] || event.code === 'Escape')) {
if (this.expanded() && (event.keyCode === external_wp_keycodes_["ESCAPE"] || event.code === 'Escape')) {
event.stopPropagation();
this.close();
Object(external_wp_data_["dispatch"])(store).setIsInserterOpened(false);
}
}, // Use capture mode to make this run before other event listeners.
true);
this.contentContainer.addClass('widgets-inserter');
}
this.contentContainer.addClass('widgets-inserter'); // Set a flag if the state is being changed from open() or close().
// Don't propagate the event if it's an internal action to prevent infinite loop.
get isOpen() {
return this.expanded();
}
this.isFromInternalAction = false;
this.expanded.bind(() => {
if (!this.isFromInternalAction) {
// Propagate the event to React to sync the state.
Object(external_wp_data_["dispatch"])(store).setIsInserterOpened(this.expanded());
}
subscribe(handler) {
this.expanded.bind(handler);
return () => this.expanded.unbind(handler);
this.isFromInternalAction = false;
});
}
open() {
if (!this.isOpen) {
if (!this.expanded()) {
const contentContainer = this.contentContainer[0];
this.activeElementBeforeExpanded = contentContainer.ownerDocument.activeElement;
this.isFromInternalAction = true;
this.expand({
completeCallback() {
// We have to do this in a "completeCallback" or else the elements will not yet be visible/tabbable.
@ -2281,9 +2436,10 @@ function getInserterOuterSection() {
}
close() {
if (this.isOpen) {
if (this.expanded()) {
const contentContainer = this.contentContainer[0];
const activeElement = contentContainer.ownerDocument.activeElement;
this.isFromInternalAction = true;
this.collapse({
completeCallback() {
// Return back the focus when closing the inserter.
@ -2307,12 +2463,18 @@ function getInserterOuterSection() {
}
// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/controls/sidebar-control.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const getInserterId = controlId => `widgets-inserter-${controlId}`;
function getSidebarControl() {
@ -2347,7 +2509,7 @@ function getSidebarControl() {
if (!args.unchanged) {
// Close the inserter when the section collapses.
if (!expanded) {
this.inserter.close();
Object(external_wp_data_["dispatch"])(store).setIsInserterOpened(false);
}
this.subscribers.forEach(subscriber => subscriber(expanded, args));

File diff suppressed because one or more lines are too long

View File

@ -755,6 +755,55 @@ function isPlainObject(obj) {
return Object.getPrototypeOf(obj) === proto;
}
// Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of
function miniKindOf(val) {
if (val === void 0) return 'undefined';
if (val === null) return 'null';
var type = typeof val;
switch (type) {
case 'boolean':
case 'string':
case 'number':
case 'symbol':
case 'function':
{
return type;
}
}
if (Array.isArray(val)) return 'array';
if (isDate(val)) return 'date';
if (isError(val)) return 'error';
var constructorName = ctorName(val);
switch (constructorName) {
case 'Symbol':
case 'Promise':
case 'WeakMap':
case 'WeakSet':
case 'Map':
case 'Set':
return constructorName;
} // other
return type.slice(8, -1).toLowerCase().replace(/\s/g, '');
}
function ctorName(val) {
return typeof val.constructor === 'function' ? val.constructor.name : null;
}
function isError(val) {
return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number';
}
function isDate(val) {
if (val instanceof Date) return true;
return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function';
}
function kindOf(val) {
var typeOfVal = typeof val;

View File

@ -634,6 +634,7 @@ __webpack_require__.d(actions_namespaceObject, "setIsInserterOpened", function()
__webpack_require__.d(actions_namespaceObject, "setIsListViewOpened", function() { return setIsListViewOpened; });
__webpack_require__.d(actions_namespaceObject, "setIsEditingTemplate", function() { return setIsEditingTemplate; });
__webpack_require__.d(actions_namespaceObject, "__unstableSwitchToTemplateMode", function() { return __unstableSwitchToTemplateMode; });
__webpack_require__.d(actions_namespaceObject, "initializeMetaBoxes", function() { return initializeMetaBoxes; });
// NAMESPACE OBJECT: ./node_modules/@wordpress/edit-post/build-module/store/selectors.js
var selectors_namespaceObject = {};
@ -656,13 +657,14 @@ __webpack_require__.d(selectors_namespaceObject, "isMetaBoxLocationVisible", fun
__webpack_require__.d(selectors_namespaceObject, "isMetaBoxLocationActive", function() { return isMetaBoxLocationActive; });
__webpack_require__.d(selectors_namespaceObject, "getMetaBoxesPerLocation", function() { return getMetaBoxesPerLocation; });
__webpack_require__.d(selectors_namespaceObject, "getAllMetaBoxes", function() { return getAllMetaBoxes; });
__webpack_require__.d(selectors_namespaceObject, "hasMetaBoxes", function() { return hasMetaBoxes; });
__webpack_require__.d(selectors_namespaceObject, "hasMetaBoxes", function() { return selectors_hasMetaBoxes; });
__webpack_require__.d(selectors_namespaceObject, "isSavingMetaBoxes", function() { return selectors_isSavingMetaBoxes; });
__webpack_require__.d(selectors_namespaceObject, "__experimentalGetPreviewDeviceType", function() { return __experimentalGetPreviewDeviceType; });
__webpack_require__.d(selectors_namespaceObject, "isInserterOpened", function() { return isInserterOpened; });
__webpack_require__.d(selectors_namespaceObject, "__experimentalGetInsertionPoint", function() { return __experimentalGetInsertionPoint; });
__webpack_require__.d(selectors_namespaceObject, "isListViewOpened", function() { return isListViewOpened; });
__webpack_require__.d(selectors_namespaceObject, "isEditingTemplate", function() { return selectors_isEditingTemplate; });
__webpack_require__.d(selectors_namespaceObject, "areMetaBoxesInitialized", function() { return areMetaBoxesInitialized; });
__webpack_require__.d(selectors_namespaceObject, "getEditedPostTemplate", function() { return getEditedPostTemplate; });
// EXTERNAL MODULE: external ["wp","data"]
@ -1005,10 +1007,29 @@ function isEditingTemplate(state = false, action) {
return state;
}
/**
* Reducer tracking whether meta boxes are initialized.
*
* @param {boolean} state
* @param {Object} action
*
* @return {boolean} Updated state.
*/
function metaBoxesInitialized(state = false, action) {
switch (action.type) {
case 'META_BOXES_INITIALIZED':
return true;
}
return state;
}
const metaBoxes = Object(external_wp_data_["combineReducers"])({
isSaving: isSavingMetaBoxes,
locations: metaBoxLocations
locations: metaBoxLocations,
initialized: metaBoxesInitialized
});
/* harmony default export */ var reducer = (Object(external_wp_data_["combineReducers"])({
activeModal,
@ -1301,7 +1322,6 @@ function showBlockTypes(blockNames) {
blockNames: Object(external_lodash_["castArray"])(blockNames)
};
}
let saveMetaboxUnsubscribe;
/**
* Returns an action object used in signaling
* what Meta boxes are available in which location.
@ -1316,38 +1336,6 @@ function* setAvailableMetaBoxesPerLocation(metaBoxesPerLocation) {
type: 'SET_META_BOXES_PER_LOCATIONS',
metaBoxesPerLocation
};
const postType = yield external_wp_data_["controls"].select('core/editor', 'getCurrentPostType');
if (window.postboxes.page !== postType) {
window.postboxes.add_postbox_toggles(postType);
}
let wasSavingPost = yield external_wp_data_["controls"].select('core/editor', 'isSavingPost');
let wasAutosavingPost = yield external_wp_data_["controls"].select('core/editor', 'isAutosavingPost'); // Meta boxes are initialized once at page load. It is not necessary to
// account for updates on each state change.
//
// See: https://github.com/WordPress/WordPress/blob/5.1.1/wp-admin/includes/post.php#L2307-L2309
const hasActiveMetaBoxes = yield external_wp_data_["controls"].select(store.name, 'hasMetaBoxes'); // First remove any existing subscription in order to prevent multiple saves
if (!!saveMetaboxUnsubscribe) {
saveMetaboxUnsubscribe();
} // Save metaboxes when performing a full save on the post.
saveMetaboxUnsubscribe = Object(external_wp_data_["subscribe"])(() => {
const isSavingPost = Object(external_wp_data_["select"])('core/editor').isSavingPost();
const isAutosavingPost = Object(external_wp_data_["select"])('core/editor').isAutosavingPost(); // Save metaboxes on save completion, except for autosaves that are not a post preview.
const shouldTriggerMetaboxesSave = hasActiveMetaBoxes && wasSavingPost && !isSavingPost && !wasAutosavingPost; // Save current state for next inspection.
wasSavingPost = isSavingPost;
wasAutosavingPost = isAutosavingPost;
if (shouldTriggerMetaboxesSave) {
Object(external_wp_data_["dispatch"])(store.name).requestMetaBoxUpdates();
}
});
}
/**
* Returns an action object used to request meta box update.
@ -1485,6 +1473,55 @@ function* __unstableSwitchToTemplateMode(template) {
});
}
}
let actions_metaBoxesInitialized = false;
/**
* Initializes WordPress `postboxes` script and the logic for saving meta boxes.
*/
function* initializeMetaBoxes() {
const isEditorReady = yield external_wp_data_["controls"].select('core/editor', '__unstableIsEditorReady');
if (!isEditorReady) {
return;
}
const postType = yield external_wp_data_["controls"].select('core/editor', 'getCurrentPostType'); // Only initialize once.
if (actions_metaBoxesInitialized) {
return;
}
if (window.postboxes.page !== postType) {
window.postboxes.add_postbox_toggles(postType);
}
actions_metaBoxesInitialized = true;
let wasSavingPost = yield external_wp_data_["controls"].select('core/editor', 'isSavingPost');
let wasAutosavingPost = yield external_wp_data_["controls"].select('core/editor', 'isAutosavingPost');
const hasMetaBoxes = yield external_wp_data_["controls"].select(store, 'hasMetaBoxes'); // Save metaboxes when performing a full save on the post.
Object(external_wp_data_["subscribe"])(() => {
const isSavingPost = Object(external_wp_data_["select"])('core/editor').isSavingPost();
const isAutosavingPost = Object(external_wp_data_["select"])('core/editor').isAutosavingPost(); // Save metaboxes on save completion, except for autosaves that are not a post preview.
//
// Meta boxes are initialized once at page load. It is not necessary to
// account for updates on each state change.
//
// See: https://github.com/WordPress/WordPress/blob/5.1.1/wp-admin/includes/post.php#L2307-L2309
const shouldTriggerMetaboxesSave = hasMetaBoxes && wasSavingPost && !isSavingPost && !wasAutosavingPost; // Save current state for next inspection.
wasSavingPost = isSavingPost;
wasAutosavingPost = isAutosavingPost;
if (shouldTriggerMetaboxesSave) {
Object(external_wp_data_["dispatch"])(store).requestMetaBoxUpdates();
}
});
return {
type: 'META_BOXES_INITIALIZED'
};
}
// EXTERNAL MODULE: ./node_modules/rememo/es/rememo.js
var rememo = __webpack_require__("pPDe");
@ -1744,7 +1781,7 @@ const getAllMetaBoxes = Object(rememo["a" /* default */])(state => {
* @return {boolean} Whether there are metaboxes or not.
*/
function hasMetaBoxes(state) {
function selectors_hasMetaBoxes(state) {
return getActiveMetaBoxLocations(state).length > 0;
}
/**
@ -1820,6 +1857,17 @@ function isListViewOpened(state) {
function selectors_isEditingTemplate(state) {
return state.isEditingTemplate;
}
/**
* Returns true if meta boxes are initialized.
*
* @param {Object} state Global application state.
*
* @return {boolean} Whether meta boxes are initialized.
*/
function areMetaBoxesInitialized(state) {
return state.metaBoxes.initialized;
}
/**
* Retrieves the template of the currently edited post.
*
@ -3348,7 +3396,6 @@ const arrowLeft = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["create
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, "store", function() { return /* reexport */ store["a" /* store */]; });
__webpack_require__.d(__webpack_exports__, "reinitializeEditor", function() { return /* binding */ reinitializeEditor; });
__webpack_require__.d(__webpack_exports__, "initializeEditor", function() { return /* binding */ initializeEditor; });
__webpack_require__.d(__webpack_exports__, "PluginBlockSettingsMenuItem", function() { return /* reexport */ plugin_block_settings_menu_item; });
@ -3361,6 +3408,7 @@ __webpack_require__.d(__webpack_exports__, "PluginSidebar", function() { return
__webpack_require__.d(__webpack_exports__, "PluginSidebarMoreMenuItem", function() { return /* reexport */ PluginSidebarMoreMenuItem; });
__webpack_require__.d(__webpack_exports__, "__experimentalFullscreenModeClose", function() { return /* reexport */ fullscreen_mode_close; });
__webpack_require__.d(__webpack_exports__, "__experimentalMainDashboardButton", function() { return /* reexport */ main_dashboard_button; });
__webpack_require__.d(__webpack_exports__, "store", function() { return /* reexport */ store["a" /* store */]; });
// EXTERNAL MODULE: external ["wp","element"]
var external_wp_element_ = __webpack_require__("GRId");
@ -4000,7 +4048,7 @@ function __spreadArray(to, from, pack) {
ar[i] = from[i];
}
}
return to.concat(ar || from);
return to.concat(ar || Array.prototype.slice.call(from));
}
function __await(v) {
@ -5053,7 +5101,7 @@ function tslib_es6_spreadArray(to, from, pack) {
ar[i] = from[i];
}
}
return to.concat(ar || from);
return to.concat(ar || Array.prototype.slice.call(from));
}
function tslib_es6_await(v) {
@ -6601,7 +6649,7 @@ function tslib_tslib_es6_spreadArray(to, from, pack) {
ar[i] = from[i];
}
}
return to.concat(ar || from);
return to.concat(ar || Array.prototype.slice.call(from));
}
function tslib_tslib_es6_await(v) {
@ -16626,6 +16674,8 @@ class meta_box_visibility_MetaBoxVisibility extends external_wp_element_["Compon
*/
/**
* Internal dependencies
*/
@ -16633,12 +16683,44 @@ class meta_box_visibility_MetaBoxVisibility extends external_wp_element_["Compon
function MetaBoxes({
location,
isVisible,
metaBoxes
location
}) {
const registry = Object(external_wp_data_["useRegistry"])();
const {
metaBoxes,
isVisible,
areMetaBoxesInitialized,
isEditorReady
} = Object(external_wp_data_["useSelect"])(select => {
const {
__unstableIsEditorReady
} = select(external_wp_editor_["store"]);
const {
isMetaBoxLocationVisible,
getMetaBoxesPerLocation,
areMetaBoxesInitialized: _areMetaBoxesInitialized
} = select(store["a" /* store */]);
return {
metaBoxes: getMetaBoxesPerLocation(location),
isVisible: isMetaBoxLocationVisible(location),
areMetaBoxesInitialized: _areMetaBoxesInitialized(),
isEditorReady: __unstableIsEditorReady()
};
}, [location]); // When editor is ready, initialize postboxes (wp core script) and metabox
// saving. This initializes all meta box locations, not just this specific
// one.
Object(external_wp_element_["useEffect"])(() => {
if (isEditorReady && !areMetaBoxesInitialized) {
registry.dispatch(store["a" /* store */]).initializeMetaBoxes();
}
}, [isEditorReady, areMetaBoxesInitialized]);
if (!areMetaBoxesInitialized) {
return null;
}
return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_lodash_["map"])(metaBoxes, ({
id
}) => Object(external_wp_element_["createElement"])(meta_box_visibility, {
@ -16649,19 +16731,6 @@ function MetaBoxes({
}));
}
/* harmony default export */ var meta_boxes = (Object(external_wp_data_["withSelect"])((select, {
location
}) => {
const {
isMetaBoxLocationVisible,
getMetaBoxesPerLocation
} = select(store["a" /* store */]);
return {
metaBoxes: getMetaBoxesPerLocation(location),
isVisible: isMetaBoxLocationVisible(location)
};
})(MetaBoxes));
// EXTERNAL MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/plugin-document-setting-panel/index.js
var plugin_document_setting_panel = __webpack_require__("xrib");
@ -17158,7 +17227,7 @@ const SettingsSidebar = () => {
toggleShortcut: keyboardShortcut,
icon: cog["a" /* default */],
isActiveByDefault: SIDEBAR_ACTIVE_BY_DEFAULT
}, !isTemplateMode && sidebarName === 'edit-post/document' && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(post_status, null), Object(external_wp_element_["createElement"])(sidebar_template, null), Object(external_wp_element_["createElement"])(plugin_document_setting_panel["a" /* default */].Slot, null), Object(external_wp_element_["createElement"])(last_revision, null), Object(external_wp_element_["createElement"])(post_link, null), Object(external_wp_element_["createElement"])(post_taxonomies, null), Object(external_wp_element_["createElement"])(featured_image, null), Object(external_wp_element_["createElement"])(post_excerpt, null), Object(external_wp_element_["createElement"])(discussion_panel, null), Object(external_wp_element_["createElement"])(page_attributes, null), Object(external_wp_element_["createElement"])(meta_boxes, {
}, !isTemplateMode && sidebarName === 'edit-post/document' && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(post_status, null), Object(external_wp_element_["createElement"])(sidebar_template, null), Object(external_wp_element_["createElement"])(plugin_document_setting_panel["a" /* default */].Slot, null), Object(external_wp_element_["createElement"])(last_revision, null), Object(external_wp_element_["createElement"])(post_link, null), Object(external_wp_element_["createElement"])(post_taxonomies, null), Object(external_wp_element_["createElement"])(featured_image, null), Object(external_wp_element_["createElement"])(post_excerpt, null), Object(external_wp_element_["createElement"])(discussion_panel, null), Object(external_wp_element_["createElement"])(page_attributes, null), Object(external_wp_element_["createElement"])(MetaBoxes, {
location: "side"
})), isTemplateMode && sidebarName === 'edit-post/document' && Object(external_wp_element_["createElement"])(template_summary, null), sidebarName === 'edit-post/block' && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockInspector"], null));
};
@ -17769,9 +17838,9 @@ function Layout({
styles: styles
}), !isTemplateMode && Object(external_wp_element_["createElement"])("div", {
className: "edit-post-layout__metaboxes"
}, Object(external_wp_element_["createElement"])(meta_boxes, {
}, Object(external_wp_element_["createElement"])(MetaBoxes, {
location: "normal"
}), Object(external_wp_element_["createElement"])(meta_boxes, {
}), Object(external_wp_element_["createElement"])(MetaBoxes, {
location: "advanced"
})), isMobileViewport && sidebarIsOpened && Object(external_wp_element_["createElement"])(external_wp_components_["ScrollLock"], null)),
footer: !hasReducedUI && showBlockBreadcrumbs && !isMobileViewport && isRichEditingEnabled && mode === 'visual' && Object(external_wp_element_["createElement"])("div", {
@ -18306,7 +18375,6 @@ function PluginSidebarMoreMenuItem(props) {
/**
* Reinitializes the editor after the user chooses to reboot the editor after
* an unhandled error occurs, replacing previously mounted editor element using
@ -18336,11 +18404,8 @@ function reinitializeEditor(postType, postId, target, settings, initialEdits) {
/**
* Initializes and returns an instance of Editor.
*
* The return value of this function is not necessary if we change where we
* call initializeEditor(). This is due to metaBox timing.
*
* @param {string} id Unique identifier for editor instance.
* @param {Object} postType Post type of the post to edit.
* @param {string} postType Post type of the post to edit.
* @param {Object} postId ID of the post to edit.
* @param {?Object} settings Editor settings object.
* @param {Object} initialEdits Programmatic edits to apply initially, to be
@ -18410,6 +18475,7 @@ function initializeEditor(id, postType, postId, settings, initialEdits) {
/***/ }),
/***/ "g56x":

File diff suppressed because one or more lines are too long

View File

@ -110,6 +110,13 @@ const blockDefault = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["cre
/* harmony default export */ __webpack_exports__["a"] = (blockDefault);
/***/ }),
/***/ "1CF3":
/***/ (function(module, exports) {
(function() { module.exports = window["wp"]["dom"]; }());
/***/ }),
/***/ "1ZqX":
@ -161,6 +168,7 @@ const cog = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElemen
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, "reinitializeEditor", function() { return /* binding */ reinitializeEditor; });
__webpack_require__.d(__webpack_exports__, "initialize", function() { return /* binding */ initialize; });
// NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/store/actions.js
@ -197,6 +205,7 @@ __webpack_require__.d(selectors_namespaceObject, "getReferenceWidgetBlocks", fun
__webpack_require__.d(selectors_namespaceObject, "isSavingWidgetAreas", function() { return selectors_isSavingWidgetAreas; });
__webpack_require__.d(selectors_namespaceObject, "getIsWidgetAreaOpen", function() { return getIsWidgetAreaOpen; });
__webpack_require__.d(selectors_namespaceObject, "isInserterOpened", function() { return selectors_isInserterOpened; });
__webpack_require__.d(selectors_namespaceObject, "__experimentalGetInsertionPoint", function() { return __experimentalGetInsertionPoint; });
__webpack_require__.d(selectors_namespaceObject, "canInsertBlockInWidgetArea", function() { return selectors_canInsertBlockInWidgetArea; });
__webpack_require__.d(selectors_namespaceObject, "__unstableIsFeatureActive", function() { return __unstableIsFeatureActive; });
@ -1247,6 +1256,24 @@ const getIsWidgetAreaOpen = (state, clientId) => {
function selectors_isInserterOpened(state) {
return !!state.blockInserterPanel;
}
/**
* Get the insertion point for the inserter.
*
* @param {Object} state Global application state.
*
* @return {Object} The root client ID and index to insert at.
*/
function __experimentalGetInsertionPoint(state) {
const {
rootClientId,
insertionIndex
} = state.blockInserterPanel;
return {
rootClientId,
insertionIndex
};
}
/**
* Returns true if a block can be inserted into a widget area.
*
@ -1691,6 +1718,72 @@ const widget_area_settings = {
// EXTERNAL MODULE: external ["wp","plugins"]
var external_wp_plugins_ = __webpack_require__("TvNi");
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/error-boundary/index.js
/**
* WordPress dependencies
*/
function CopyButton({
text,
children
}) {
const ref = Object(external_wp_compose_["useCopyToClipboard"])(text);
return Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
variant: "secondary",
ref: ref
}, children);
}
class error_boundary_ErrorBoundary extends external_wp_element_["Component"] {
constructor() {
super(...arguments);
this.reboot = this.reboot.bind(this);
this.state = {
error: null
};
}
componentDidCatch(error) {
this.setState({
error
});
}
reboot() {
this.props.onError();
}
render() {
const {
error
} = this.state;
if (!error) {
return this.props.children;
}
return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["Warning"], {
className: "edit-widgets-error-boundary",
actions: [Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
key: "recovery",
onClick: this.reboot,
variant: "secondary"
}, Object(external_wp_i18n_["__"])('Attempt Recovery')), Object(external_wp_element_["createElement"])(CopyButton, {
key: "copy-error",
text: error.stack
}, Object(external_wp_i18n_["__"])('Copy Error'))]
}, Object(external_wp_i18n_["__"])('The editor has encountered an unexpected error.'));
}
}
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
var esm_extends = __webpack_require__("wx14");
@ -1974,6 +2067,9 @@ var block_default = __webpack_require__("//Lo");
// EXTERNAL MODULE: external ["wp","url"]
var external_wp_url_ = __webpack_require__("Mmq9");
// EXTERNAL MODULE: external ["wp","dom"]
var external_wp_dom_ = __webpack_require__("1CF3");
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/sidebar/widget-areas.js
@ -1987,6 +2083,7 @@ var external_wp_url_ = __webpack_require__("Mmq9");
/**
* Internal dependencies
*/
@ -2013,7 +2110,15 @@ function WidgetAreas({
className: "edit-widgets-widget-areas__top-container"
}, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockIcon"], {
icon: block_default["a" /* default */]
}), Object(external_wp_element_["createElement"])("div", null, Object(external_wp_element_["createElement"])("p", null, description), (widgetAreas === null || widgetAreas === void 0 ? void 0 : widgetAreas.length) === 0 && Object(external_wp_element_["createElement"])("p", null, Object(external_wp_i18n_["__"])('Your theme does not contain any Widget Areas.')), !selectedWidgetArea && Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
}), Object(external_wp_element_["createElement"])("div", null, Object(external_wp_element_["createElement"])("p", {
// Use `dangerouslySetInnerHTML` to keep backwards
// compatibility. Basic markup in the description is an
// established feature of WordPress.
// @see https://github.com/WordPress/gutenberg/issues/33106
dangerouslySetInnerHTML: {
__html: Object(external_wp_dom_["safeHTML"])(description)
}
}), (widgetAreas === null || widgetAreas === void 0 ? void 0 : widgetAreas.length) === 0 && Object(external_wp_element_["createElement"])("p", null, Object(external_wp_i18n_["__"])('Your theme does not contain any Widget Areas.')), !selectedWidgetArea && Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
href: Object(external_wp_url_["addQueryArgs"])('customize.php', {
'autofocus[panel]': 'widgets',
return: window.location.pathname
@ -2663,7 +2768,7 @@ function MoreMenu() {
}), Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], {
role: "menuitem",
icon: external["a" /* default */],
href: Object(external_wp_i18n_["__"])('https://wordpress.org/support/article/wordpress-editor/'),
href: Object(external_wp_i18n_["__"])('https://wordpress.org/support/article/block-based-widgets-editor/'),
target: "_blank",
rel: "noopener noreferrer"
}, Object(external_wp_i18n_["__"])('Help'), Object(external_wp_element_["createElement"])(external_wp_components_["VisuallyHidden"], {
@ -2893,6 +2998,7 @@ function WidgetAreasBlockEditorContent({
const useWidgetLibraryInsertionPoint = () => {
const firstRootId = Object(external_wp_data_["useSelect"])(select => {
var _widgetAreasPost$bloc;
@ -2911,6 +3017,15 @@ const useWidgetLibraryInsertionPoint = () => {
getBlockOrder,
getBlockIndex
} = select(external_wp_blockEditor_["store"]);
const insertionPoint = select(store).__experimentalGetInsertionPoint(); // "Browse all" in the quick inserter will set the rootClientId to the current block.
// Otherwise, it will just be undefined, and we'll have to handle it differently below.
if (insertionPoint.rootClientId) {
return insertionPoint;
}
const clientId = getBlockSelectionEnd() || firstRootId;
const rootClientId = getBlockRootClientId(clientId); // If the selected block is at the root level, it's a widget area and
// blocks can't be inserted here. Return this block as the root and the
@ -3233,14 +3348,18 @@ function WelcomeGuideImage({
function Layout({
blockEditorSettings
blockEditorSettings,
onError
}) {
return Object(external_wp_element_["createElement"])(WidgetAreasBlockEditorProvider, {
return Object(external_wp_element_["createElement"])(error_boundary_ErrorBoundary, {
onError: onError
}, Object(external_wp_element_["createElement"])(WidgetAreasBlockEditorProvider, {
blockEditorSettings: blockEditorSettings
}, Object(external_wp_element_["createElement"])(layout_interface, {
blockEditorSettings: blockEditorSettings
}), Object(external_wp_element_["createElement"])(Sidebar, null), Object(external_wp_element_["createElement"])(external_wp_components_["Popover"].Slot, null), Object(external_wp_element_["createElement"])(external_wp_plugins_["PluginArea"], null), Object(external_wp_element_["createElement"])(UnsavedChangesWarning, null), Object(external_wp_element_["createElement"])(WelcomeGuide, null));
}), Object(external_wp_element_["createElement"])(Sidebar, null), Object(external_wp_element_["createElement"])(external_wp_components_["Popover"].Slot, null), Object(external_wp_element_["createElement"])(external_wp_plugins_["PluginArea"], null), Object(external_wp_element_["createElement"])(UnsavedChangesWarning, null), Object(external_wp_element_["createElement"])(WelcomeGuide, null)));
}
/* harmony default export */ var layout = (Layout);
@ -3266,6 +3385,23 @@ function Layout({
const disabledBlocks = ['core/more', 'core/freeform', ...(!ALLOW_REUSABLE_BLOCKS && ['core/block'])];
/**
* Reinitializes the editor after the user chooses to reboot the editor after
* an unhandled error occurs, replacing previously mounted editor element using
* an initial state from prior to the crash.
*
* @param {Element} target DOM node in which editor is rendered.
* @param {?Object} settings Editor settings object.
*/
function reinitializeEditor(target, settings) {
Object(external_wp_element_["unmountComponentAtNode"])(target);
const reboot = reinitializeEditor.bind(null, target, settings);
Object(external_wp_element_["render"])(Object(external_wp_element_["createElement"])(layout, {
blockEditorSettings: settings,
onError: reboot
}), target);
}
/**
* Initializes the block editor in the widgets screen.
*
@ -3274,6 +3410,9 @@ const disabledBlocks = ['core/more', 'core/freeform', ...(!ALLOW_REUSABLE_BLOCKS
*/
function initialize(id, settings) {
const target = document.getElementById(id);
const reboot = reinitializeEditor.bind(null, target, settings);
const coreBlocks = Object(external_wp_blockLibrary_["__experimentalGetCoreBlocks"])().filter(block => {
return !(disabledBlocks.includes(block.name) || block.name.startsWith('core/post') || block.name.startsWith('core/query') || block.name.startsWith('core/site'));
});
@ -3294,8 +3433,9 @@ function initialize(id, settings) {
Object(external_wp_blocks_["setFreeformContentHandlerName"])('core/html');
Object(external_wp_element_["render"])(Object(external_wp_element_["createElement"])(layout, {
blockEditorSettings: settings
}), document.getElementById(id));
blockEditorSettings: settings,
onError: reboot
}), target);
}
/**
* Function to register an individual block.

File diff suppressed because one or more lines are too long

View File

@ -8074,6 +8074,7 @@ const DEFAULT_QUERY = {
per_page: MAX_MOST_USED_TERMS,
orderby: 'count',
order: 'desc',
hide_empty: true,
_fields: 'id,name,count'
};
function MostUsedTerms({

File diff suppressed because one or more lines are too long

View File

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