summaryrefslogtreecommitdiffstats
path: root/wp-includes/js/dist/edit-widgets.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:57:26 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:57:26 +0000
commit30883c26bdceb9eaf32c8d4a1b0c1bce223b5226 (patch)
tree39a02e2aeb21ab5b7923c6f5757d66d55b708912 /wp-includes/js/dist/edit-widgets.js
parentAdding upstream version 6.4.3+dfsg1. (diff)
downloadwordpress-30883c26bdceb9eaf32c8d4a1b0c1bce223b5226.tar.xz
wordpress-30883c26bdceb9eaf32c8d4a1b0c1bce223b5226.zip
Adding upstream version 6.5+dfsg1.upstream/6.5+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--wp-includes/js/dist/edit-widgets.js1233
1 files changed, 678 insertions, 555 deletions
diff --git a/wp-includes/js/dist/edit-widgets.js b/wp-includes/js/dist/edit-widgets.js
index 67132c2..d030778 100644
--- a/wp-includes/js/dist/edit-widgets.js
+++ b/wp-includes/js/dist/edit-widgets.js
@@ -1,8 +1,8 @@
-/******/ (function() { // webpackBootstrap
+/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
-/***/ 4403:
-/***/ (function(module, exports) {
+/***/ 5755:
+/***/ ((module, exports) => {
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
Copyright (c) 2018 Jed Watson.
@@ -95,160 +95,169 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
-/******/ !function() {
+/******/ (() => {
/******/ // getDefaultExport function for compatibility with non-harmony modules
-/******/ __webpack_require__.n = function(module) {
+/******/ __webpack_require__.n = (module) => {
/******/ var getter = module && module.__esModule ?
-/******/ function() { return module['default']; } :
-/******/ function() { return module; };
+/******/ () => (module['default']) :
+/******/ () => (module);
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
-/******/ }();
+/******/ })();
/******/
/******/ /* webpack/runtime/define property getters */
-/******/ !function() {
+/******/ (() => {
/******/ // define getter functions for harmony exports
-/******/ __webpack_require__.d = function(exports, definition) {
+/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
-/******/ }();
+/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
-/******/ !function() {
-/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
-/******/ }();
+/******/ (() => {
+/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
+/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
-/******/ !function() {
+/******/ (() => {
/******/ // define __esModule on exports
-/******/ __webpack_require__.r = function(exports) {
+/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
-/******/ }();
+/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
-!function() {
+(() => {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
- initialize: function() { return /* binding */ initialize; },
- initializeEditor: function() { return /* binding */ initializeEditor; },
- reinitializeEditor: function() { return /* binding */ reinitializeEditor; },
- store: function() { return /* reexport */ store_store; }
+ initialize: () => (/* binding */ initialize),
+ initializeEditor: () => (/* binding */ initializeEditor),
+ reinitializeEditor: () => (/* binding */ reinitializeEditor),
+ store: () => (/* reexport */ store_store)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/store/actions.js
var actions_namespaceObject = {};
__webpack_require__.r(actions_namespaceObject);
__webpack_require__.d(actions_namespaceObject, {
- closeModal: function() { return closeModal; },
- disableComplementaryArea: function() { return disableComplementaryArea; },
- enableComplementaryArea: function() { return enableComplementaryArea; },
- openModal: function() { return openModal; },
- pinItem: function() { return pinItem; },
- setDefaultComplementaryArea: function() { return setDefaultComplementaryArea; },
- setFeatureDefaults: function() { return setFeatureDefaults; },
- setFeatureValue: function() { return setFeatureValue; },
- toggleFeature: function() { return toggleFeature; },
- unpinItem: function() { return unpinItem; }
+ closeModal: () => (closeModal),
+ disableComplementaryArea: () => (disableComplementaryArea),
+ enableComplementaryArea: () => (enableComplementaryArea),
+ openModal: () => (openModal),
+ pinItem: () => (pinItem),
+ setDefaultComplementaryArea: () => (setDefaultComplementaryArea),
+ setFeatureDefaults: () => (setFeatureDefaults),
+ setFeatureValue: () => (setFeatureValue),
+ toggleFeature: () => (toggleFeature),
+ unpinItem: () => (unpinItem)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/store/selectors.js
var selectors_namespaceObject = {};
__webpack_require__.r(selectors_namespaceObject);
__webpack_require__.d(selectors_namespaceObject, {
- getActiveComplementaryArea: function() { return getActiveComplementaryArea; },
- isComplementaryAreaLoading: function() { return isComplementaryAreaLoading; },
- isFeatureActive: function() { return isFeatureActive; },
- isItemPinned: function() { return isItemPinned; },
- isModalActive: function() { return isModalActive; }
+ getActiveComplementaryArea: () => (getActiveComplementaryArea),
+ isComplementaryAreaLoading: () => (isComplementaryAreaLoading),
+ isFeatureActive: () => (isFeatureActive),
+ isItemPinned: () => (isItemPinned),
+ isModalActive: () => (isModalActive)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/store/actions.js
var store_actions_namespaceObject = {};
__webpack_require__.r(store_actions_namespaceObject);
__webpack_require__.d(store_actions_namespaceObject, {
- closeGeneralSidebar: function() { return closeGeneralSidebar; },
- moveBlockToWidgetArea: function() { return moveBlockToWidgetArea; },
- persistStubPost: function() { return persistStubPost; },
- saveEditedWidgetAreas: function() { return saveEditedWidgetAreas; },
- saveWidgetArea: function() { return saveWidgetArea; },
- saveWidgetAreas: function() { return saveWidgetAreas; },
- setIsInserterOpened: function() { return setIsInserterOpened; },
- setIsListViewOpened: function() { return setIsListViewOpened; },
- setIsWidgetAreaOpen: function() { return setIsWidgetAreaOpen; },
- setWidgetAreasOpenState: function() { return setWidgetAreasOpenState; },
- setWidgetIdForClientId: function() { return setWidgetIdForClientId; }
+ closeGeneralSidebar: () => (closeGeneralSidebar),
+ moveBlockToWidgetArea: () => (moveBlockToWidgetArea),
+ persistStubPost: () => (persistStubPost),
+ saveEditedWidgetAreas: () => (saveEditedWidgetAreas),
+ saveWidgetArea: () => (saveWidgetArea),
+ saveWidgetAreas: () => (saveWidgetAreas),
+ setIsInserterOpened: () => (setIsInserterOpened),
+ setIsListViewOpened: () => (setIsListViewOpened),
+ setIsWidgetAreaOpen: () => (setIsWidgetAreaOpen),
+ setWidgetAreasOpenState: () => (setWidgetAreasOpenState),
+ setWidgetIdForClientId: () => (setWidgetIdForClientId)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/store/resolvers.js
var resolvers_namespaceObject = {};
__webpack_require__.r(resolvers_namespaceObject);
__webpack_require__.d(resolvers_namespaceObject, {
- getWidgetAreas: function() { return getWidgetAreas; },
- getWidgets: function() { return getWidgets; }
+ getWidgetAreas: () => (getWidgetAreas),
+ getWidgets: () => (getWidgets)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/store/selectors.js
var store_selectors_namespaceObject = {};
__webpack_require__.r(store_selectors_namespaceObject);
__webpack_require__.d(store_selectors_namespaceObject, {
- __experimentalGetInsertionPoint: function() { return __experimentalGetInsertionPoint; },
- canInsertBlockInWidgetArea: function() { return canInsertBlockInWidgetArea; },
- getEditedWidgetAreas: function() { return getEditedWidgetAreas; },
- getIsWidgetAreaOpen: function() { return getIsWidgetAreaOpen; },
- getParentWidgetAreaBlock: function() { return getParentWidgetAreaBlock; },
- getReferenceWidgetBlocks: function() { return getReferenceWidgetBlocks; },
- getWidget: function() { return getWidget; },
- getWidgetAreaForWidgetId: function() { return getWidgetAreaForWidgetId; },
- getWidgetAreas: function() { return selectors_getWidgetAreas; },
- getWidgets: function() { return selectors_getWidgets; },
- isInserterOpened: function() { return isInserterOpened; },
- isListViewOpened: function() { return isListViewOpened; },
- isSavingWidgetAreas: function() { return isSavingWidgetAreas; }
+ __experimentalGetInsertionPoint: () => (__experimentalGetInsertionPoint),
+ canInsertBlockInWidgetArea: () => (canInsertBlockInWidgetArea),
+ getEditedWidgetAreas: () => (getEditedWidgetAreas),
+ getIsWidgetAreaOpen: () => (getIsWidgetAreaOpen),
+ getParentWidgetAreaBlock: () => (getParentWidgetAreaBlock),
+ getReferenceWidgetBlocks: () => (getReferenceWidgetBlocks),
+ getWidget: () => (getWidget),
+ getWidgetAreaForWidgetId: () => (getWidgetAreaForWidgetId),
+ getWidgetAreas: () => (selectors_getWidgetAreas),
+ getWidgets: () => (selectors_getWidgets),
+ isInserterOpened: () => (isInserterOpened),
+ isListViewOpened: () => (isListViewOpened),
+ isSavingWidgetAreas: () => (isSavingWidgetAreas)
+});
+
+// NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/store/private-selectors.js
+var private_selectors_namespaceObject = {};
+__webpack_require__.r(private_selectors_namespaceObject);
+__webpack_require__.d(private_selectors_namespaceObject, {
+ getListViewToggleRef: () => (getListViewToggleRef)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/blocks/widget-area/index.js
var widget_area_namespaceObject = {};
__webpack_require__.r(widget_area_namespaceObject);
__webpack_require__.d(widget_area_namespaceObject, {
- metadata: function() { return metadata; },
- name: function() { return widget_area_name; },
- settings: function() { return settings; }
+ metadata: () => (metadata),
+ name: () => (widget_area_name),
+ settings: () => (settings)
});
-;// CONCATENATED MODULE: external ["wp","element"]
-var external_wp_element_namespaceObject = window["wp"]["element"];
+;// CONCATENATED MODULE: external "React"
+const external_React_namespaceObject = window["React"];
;// CONCATENATED MODULE: external ["wp","blocks"]
-var external_wp_blocks_namespaceObject = window["wp"]["blocks"];
+const external_wp_blocks_namespaceObject = window["wp"]["blocks"];
;// CONCATENATED MODULE: external ["wp","data"]
-var external_wp_data_namespaceObject = window["wp"]["data"];
+const external_wp_data_namespaceObject = window["wp"]["data"];
;// CONCATENATED MODULE: external ["wp","deprecated"]
-var external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
+const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
+;// CONCATENATED MODULE: external ["wp","element"]
+const external_wp_element_namespaceObject = window["wp"]["element"];
;// CONCATENATED MODULE: external ["wp","blockLibrary"]
-var external_wp_blockLibrary_namespaceObject = window["wp"]["blockLibrary"];
+const external_wp_blockLibrary_namespaceObject = window["wp"]["blockLibrary"];
;// CONCATENATED MODULE: external ["wp","coreData"]
-var external_wp_coreData_namespaceObject = window["wp"]["coreData"];
+const external_wp_coreData_namespaceObject = window["wp"]["coreData"];
;// CONCATENATED MODULE: external ["wp","widgets"]
-var external_wp_widgets_namespaceObject = window["wp"]["widgets"];
+const external_wp_widgets_namespaceObject = window["wp"]["widgets"];
;// CONCATENATED MODULE: external ["wp","preferences"]
-var external_wp_preferences_namespaceObject = window["wp"]["preferences"];
+const external_wp_preferences_namespaceObject = window["wp"]["preferences"];
;// CONCATENATED MODULE: external ["wp","apiFetch"]
-var external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
+const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject);
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/store/reducer.js
/**
@@ -328,36 +337,49 @@ function listViewPanel(state = false, action) {
}
return state;
}
-/* harmony default export */ var reducer = ((0,external_wp_data_namespaceObject.combineReducers)({
+
+/**
+ * This reducer does nothing aside initializing a ref to the list view toggle.
+ * We will have a unique ref per "editor" instance.
+ *
+ * @param {Object} state
+ * @return {Object} Reference to the list view toggle button.
+ */
+function listViewToggleRef(state = {
+ current: null
+}) {
+ return state;
+}
+/* harmony default export */ const reducer = ((0,external_wp_data_namespaceObject.combineReducers)({
blockInserterPanel,
listViewPanel,
widgetAreasOpenState
}));
;// CONCATENATED MODULE: external ["wp","i18n"]
-var external_wp_i18n_namespaceObject = window["wp"]["i18n"];
+const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
;// CONCATENATED MODULE: external ["wp","notices"]
-var external_wp_notices_namespaceObject = window["wp"]["notices"];
+const external_wp_notices_namespaceObject = window["wp"]["notices"];
// EXTERNAL MODULE: ./node_modules/classnames/index.js
-var classnames = __webpack_require__(4403);
+var classnames = __webpack_require__(5755);
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
;// CONCATENATED MODULE: external ["wp","components"]
-var external_wp_components_namespaceObject = window["wp"]["components"];
+const external_wp_components_namespaceObject = window["wp"]["components"];
;// CONCATENATED MODULE: external ["wp","primitives"]
-var external_wp_primitives_namespaceObject = window["wp"]["primitives"];
+const external_wp_primitives_namespaceObject = window["wp"]["primitives"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/check.js
/**
* WordPress dependencies
*/
-const check = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
+const check = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24"
-}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
+}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"
}));
-/* harmony default export */ var library_check = (check);
+/* harmony default export */ const library_check = (check);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/star-filled.js
@@ -365,13 +387,13 @@ const check = (0,external_wp_element_namespaceObject.createElement)(external_wp_
* WordPress dependencies
*/
-const starFilled = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
+const starFilled = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24"
-}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
+}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"
}));
-/* harmony default export */ var star_filled = (starFilled);
+/* harmony default export */ const star_filled = (starFilled);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/star-empty.js
@@ -379,31 +401,31 @@ const starFilled = (0,external_wp_element_namespaceObject.createElement)(externa
* WordPress dependencies
*/
-const starEmpty = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
+const starEmpty = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24"
-}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
+}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
fillRule: "evenodd",
d: "M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z",
clipRule: "evenodd"
}));
-/* harmony default export */ var star_empty = (starEmpty);
+/* harmony default export */ const star_empty = (starEmpty);
;// CONCATENATED MODULE: external ["wp","viewport"]
-var external_wp_viewport_namespaceObject = window["wp"]["viewport"];
+const external_wp_viewport_namespaceObject = window["wp"]["viewport"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close-small.js
/**
* WordPress dependencies
*/
-const closeSmall = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
+const closeSmall = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24"
-}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
+}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"
}));
-/* harmony default export */ var close_small = (closeSmall);
+/* harmony default export */ const close_small = (closeSmall);
;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/actions.js
/**
@@ -735,7 +757,7 @@ function activeModal(state = null, action) {
}
return state;
}
-/* harmony default export */ var store_reducer = ((0,external_wp_data_namespaceObject.combineReducers)({
+/* harmony default export */ const store_reducer = ((0,external_wp_data_namespaceObject.combineReducers)({
complementaryAreas,
activeModal
}));
@@ -780,13 +802,13 @@ const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME,
(0,external_wp_data_namespaceObject.register)(store);
;// CONCATENATED MODULE: external ["wp","plugins"]
-var external_wp_plugins_namespaceObject = window["wp"]["plugins"];
+const external_wp_plugins_namespaceObject = window["wp"]["plugins"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area-context/index.js
/**
* WordPress dependencies
*/
-/* harmony default export */ var complementary_area_context = ((0,external_wp_plugins_namespaceObject.withPluginContext)((context, ownProps) => {
+/* harmony default export */ const complementary_area_context = ((0,external_wp_plugins_namespaceObject.withPluginContext)((context, ownProps) => {
return {
icon: ownProps.icon || context.icon,
identifier: ownProps.identifier || `${context.name}/${ownProps.name}`
@@ -821,7 +843,7 @@ function ComplementaryAreaToggle({
enableComplementaryArea,
disableComplementaryArea
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
- return (0,external_wp_element_namespaceObject.createElement)(ComponentToUse, {
+ return (0,external_React_namespaceObject.createElement)(ComponentToUse, {
icon: selectedIcon && isSelected ? selectedIcon : icon,
"aria-controls": identifier.replace('/', ':'),
onClick: () => {
@@ -834,7 +856,7 @@ function ComplementaryAreaToggle({
...props
});
}
-/* harmony default export */ var complementary_area_toggle = (complementary_area_context(ComplementaryAreaToggle));
+/* harmony default export */ const complementary_area_toggle = (complementary_area_context(ComplementaryAreaToggle));
;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area-header/index.js
@@ -858,20 +880,20 @@ const ComplementaryAreaHeader = ({
className,
toggleButtonProps
}) => {
- const toggleButton = (0,external_wp_element_namespaceObject.createElement)(complementary_area_toggle, {
+ const toggleButton = (0,external_React_namespaceObject.createElement)(complementary_area_toggle, {
icon: close_small,
...toggleButtonProps
});
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", {
+ return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)("div", {
className: "components-panel__header interface-complementary-area-header__small"
- }, smallScreenTitle && (0,external_wp_element_namespaceObject.createElement)("span", {
+ }, smallScreenTitle && (0,external_React_namespaceObject.createElement)("span", {
className: "interface-complementary-area-header__small-title"
- }, smallScreenTitle), toggleButton), (0,external_wp_element_namespaceObject.createElement)("div", {
+ }, smallScreenTitle), toggleButton), (0,external_React_namespaceObject.createElement)("div", {
className: classnames_default()('components-panel__header', 'interface-complementary-area-header', className),
tabIndex: -1
}, children, toggleButton));
};
-/* harmony default export */ var complementary_area_header = (ComplementaryAreaHeader);
+/* harmony default export */ const complementary_area_header = (ComplementaryAreaHeader);
;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/action-item/index.js
@@ -888,7 +910,7 @@ function ActionItemSlot({
bubblesVirtually,
...props
}) {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Slot, {
+ return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Slot, {
name: name,
bubblesVirtually: bubblesVirtually,
fillProps: fillProps
@@ -919,7 +941,7 @@ function ActionItemSlot({
}
return child;
});
- return (0,external_wp_element_namespaceObject.createElement)(Component, {
+ return (0,external_React_namespaceObject.createElement)(Component, {
...props
}, children);
});
@@ -930,12 +952,12 @@ function ActionItem({
onClick,
...props
}) {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Fill, {
+ return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Fill, {
name: name
}, ({
onClick: fpOnClick
}) => {
- return (0,external_wp_element_namespaceObject.createElement)(Component, {
+ return (0,external_React_namespaceObject.createElement)(Component, {
onClick: onClick || fpOnClick ? (...args) => {
(onClick || noop)(...args);
(fpOnClick || noop)(...args);
@@ -945,7 +967,7 @@ function ActionItem({
});
}
ActionItem.Slot = ActionItemSlot;
-/* harmony default export */ var action_item = (ActionItem);
+/* harmony default export */ const action_item = (ActionItem);
;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area-more-menu-item/index.js
@@ -967,7 +989,7 @@ const PluginsMenuItem = ({
__unstableExplicitMenuItem,
__unstableTarget,
...restProps
-}) => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
+}) => (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
...restProps
});
function ComplementaryAreaMoreMenuItem({
@@ -976,9 +998,9 @@ function ComplementaryAreaMoreMenuItem({
__unstableExplicitMenuItem,
...props
}) {
- return (0,external_wp_element_namespaceObject.createElement)(complementary_area_toggle, {
+ return (0,external_React_namespaceObject.createElement)(complementary_area_toggle, {
as: toggleProps => {
- return (0,external_wp_element_namespaceObject.createElement)(action_item, {
+ return (0,external_React_namespaceObject.createElement)(action_item, {
__unstableExplicitMenuItem: __unstableExplicitMenuItem,
__unstableTarget: `${scope}/${target}`,
as: PluginsMenuItem,
@@ -1009,7 +1031,7 @@ function PinnedItems({
scope,
...props
}) {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Fill, {
+ return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Fill, {
name: `PinnedItems/${scope}`,
...props
});
@@ -1019,15 +1041,15 @@ function PinnedItemsSlot({
className,
...props
}) {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Slot, {
+ return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Slot, {
name: `PinnedItems/${scope}`,
...props
- }, fills => fills?.length > 0 && (0,external_wp_element_namespaceObject.createElement)("div", {
+ }, fills => fills?.length > 0 && (0,external_React_namespaceObject.createElement)("div", {
className: classnames_default()(className, 'interface-pinned-items')
}, fills));
}
PinnedItems.Slot = PinnedItemsSlot;
-/* harmony default export */ var pinned_items = (PinnedItems);
+/* harmony default export */ const pinned_items = (PinnedItems);
;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area/index.js
@@ -1046,6 +1068,7 @@ PinnedItems.Slot = PinnedItemsSlot;
+
/**
* Internal dependencies
*/
@@ -1059,7 +1082,7 @@ function ComplementaryAreaSlot({
scope,
...props
}) {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Slot, {
+ return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Slot, {
name: `ComplementaryArea/${scope}`,
...props
});
@@ -1070,9 +1093,9 @@ function ComplementaryAreaFill({
className,
id
}) {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Fill, {
+ return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Fill, {
name: `ComplementaryArea/${scope}`
- }, (0,external_wp_element_namespaceObject.createElement)("div", {
+ }, (0,external_React_namespaceObject.createElement)("div", {
id: id,
className: className
}, children));
@@ -1128,8 +1151,7 @@ function ComplementaryArea({
smallScreenTitle,
title,
toggleShortcut,
- isActiveByDefault,
- showIconLabels = false
+ isActiveByDefault
}) {
const {
isLoading,
@@ -1137,13 +1159,17 @@ function ComplementaryArea({
isPinned,
activeArea,
isSmall,
- isLarge
+ isLarge,
+ showIconLabels
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getActiveComplementaryArea,
isComplementaryAreaLoading,
isItemPinned
} = select(store);
+ const {
+ get
+ } = select(external_wp_preferences_namespaceObject.store);
const _activeArea = getActiveComplementaryArea(scope);
return {
isLoading: isComplementaryAreaLoading(scope),
@@ -1151,7 +1177,8 @@ function ComplementaryArea({
isPinned: isItemPinned(scope, identifier),
activeArea: _activeArea,
isSmall: select(external_wp_viewport_namespaceObject.store).isViewportMatch('< medium'),
- isLarge: select(external_wp_viewport_namespaceObject.store).isViewportMatch('large')
+ isLarge: select(external_wp_viewport_namespaceObject.store).isViewportMatch('large'),
+ showIconLabels: get('core', 'showIconLabels')
};
}, [identifier, scope]);
useAdjustComplementaryListener(scope, identifier, activeArea, isActive, isSmall);
@@ -1170,9 +1197,9 @@ function ComplementaryArea({
disableComplementaryArea(scope, identifier);
}
}, [activeArea, isActiveByDefault, scope, identifier, isSmall, enableComplementaryArea, disableComplementaryArea]);
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, isPinnable && (0,external_wp_element_namespaceObject.createElement)(pinned_items, {
+ return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, isPinnable && (0,external_React_namespaceObject.createElement)(pinned_items, {
scope: scope
- }, isPinned && (0,external_wp_element_namespaceObject.createElement)(complementary_area_toggle, {
+ }, isPinned && (0,external_React_namespaceObject.createElement)(complementary_area_toggle, {
scope: scope,
identifier: identifier,
isPressed: isActive && (!showIconLabels || isLarge),
@@ -1181,16 +1208,17 @@ function ComplementaryArea({
label: title,
icon: showIconLabels ? library_check : icon,
showTooltip: !showIconLabels,
- variant: showIconLabels ? 'tertiary' : undefined
- })), name && isPinnable && (0,external_wp_element_namespaceObject.createElement)(ComplementaryAreaMoreMenuItem, {
+ variant: showIconLabels ? 'tertiary' : undefined,
+ size: "compact"
+ })), name && isPinnable && (0,external_React_namespaceObject.createElement)(ComplementaryAreaMoreMenuItem, {
target: name,
scope: scope,
icon: icon
- }, title), isActive && (0,external_wp_element_namespaceObject.createElement)(ComplementaryAreaFill, {
+ }, title), isActive && (0,external_React_namespaceObject.createElement)(ComplementaryAreaFill, {
className: classnames_default()('interface-complementary-area', className),
scope: scope,
id: identifier.replace('/', ':')
- }, (0,external_wp_element_namespaceObject.createElement)(complementary_area_header, {
+ }, (0,external_React_namespaceObject.createElement)(complementary_area_header, {
className: headerClassName,
closeLabel: closeLabel,
onClose: () => disableComplementaryArea(scope),
@@ -1201,23 +1229,23 @@ function ComplementaryArea({
scope,
identifier
}
- }, header || (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("strong", null, title), isPinnable && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
+ }, header || (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)("strong", null, title), isPinnable && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
className: "interface-complementary-area__pin-unpin-item",
icon: isPinned ? star_filled : star_empty,
label: isPinned ? (0,external_wp_i18n_namespaceObject.__)('Unpin from toolbar') : (0,external_wp_i18n_namespaceObject.__)('Pin to toolbar'),
onClick: () => (isPinned ? unpinItem : pinItem)(scope, identifier),
isPressed: isPinned,
"aria-expanded": isPinned
- }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Panel, {
+ }))), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Panel, {
className: panelClassName
}, children)));
}
const ComplementaryAreaWrapped = complementary_area_context(ComplementaryArea);
ComplementaryAreaWrapped.Slot = ComplementaryAreaSlot;
-/* harmony default export */ var complementary_area = (ComplementaryAreaWrapped);
+/* harmony default export */ const complementary_area = (ComplementaryAreaWrapped);
;// CONCATENATED MODULE: external ["wp","compose"]
-var external_wp_compose_namespaceObject = window["wp"]["compose"];
+const external_wp_compose_namespaceObject = window["wp"]["compose"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/navigable-region/index.js
/**
@@ -1231,7 +1259,7 @@ function NavigableRegion({
as: Tag = 'div',
...props
}) {
- return (0,external_wp_element_namespaceObject.createElement)(Tag, {
+ return (0,external_React_namespaceObject.createElement)(Tag, {
className: classnames_default()('interface-navigable-region', className),
"aria-label": ariaLabel,
role: "region",
@@ -1299,7 +1327,6 @@ function InterfaceSkeleton({
secondarySidebar,
notices,
content,
- contentProps,
actions,
labels,
className,
@@ -1312,7 +1339,7 @@ function InterfaceSkeleton({
useHTMLClass('interface-interface-skeleton__html-container');
const defaultLabels = {
/* translators: accessibility text for the top bar landmark region. */
- header: (0,external_wp_i18n_namespaceObject.__)('Header'),
+ header: (0,external_wp_i18n_namespaceObject._x)('Header', 'header landmark area'),
/* translators: accessibility text for the content landmark region. */
body: (0,external_wp_i18n_namespaceObject.__)('Content'),
/* translators: accessibility text for the secondary sidebar landmark region. */
@@ -1328,13 +1355,13 @@ function InterfaceSkeleton({
...defaultLabels,
...labels
};
- return (0,external_wp_element_namespaceObject.createElement)("div", {
+ return (0,external_React_namespaceObject.createElement)("div", {
...(enableRegionNavigation ? navigateRegionsProps : {}),
ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, enableRegionNavigation ? navigateRegionsProps.ref : undefined]),
className: classnames_default()(className, 'interface-interface-skeleton', navigateRegionsProps.className, !!footer && 'has-footer')
- }, (0,external_wp_element_namespaceObject.createElement)("div", {
+ }, (0,external_React_namespaceObject.createElement)("div", {
className: "interface-interface-skeleton__editor"
- }, !!header && (0,external_wp_element_namespaceObject.createElement)(NavigableRegion, {
+ }, !!header && (0,external_React_namespaceObject.createElement)(NavigableRegion, {
as: external_wp_components_namespaceObject.__unstableMotion.div,
className: "interface-interface-skeleton__header",
"aria-label": mergedLabels.header,
@@ -1346,31 +1373,30 @@ function InterfaceSkeleton({
type: 'tween',
delay: 0.8
} : undefined
- }, header), isDistractionFree && (0,external_wp_element_namespaceObject.createElement)("div", {
+ }, header), isDistractionFree && (0,external_React_namespaceObject.createElement)("div", {
className: "interface-interface-skeleton__header"
- }, editorNotices), (0,external_wp_element_namespaceObject.createElement)("div", {
+ }, editorNotices), (0,external_React_namespaceObject.createElement)("div", {
className: "interface-interface-skeleton__body"
- }, !!secondarySidebar && (0,external_wp_element_namespaceObject.createElement)(NavigableRegion, {
+ }, !!secondarySidebar && (0,external_React_namespaceObject.createElement)(NavigableRegion, {
className: "interface-interface-skeleton__secondary-sidebar",
ariaLabel: mergedLabels.secondarySidebar
- }, secondarySidebar), !!notices && (0,external_wp_element_namespaceObject.createElement)("div", {
+ }, secondarySidebar), !!notices && (0,external_React_namespaceObject.createElement)("div", {
className: "interface-interface-skeleton__notices"
- }, notices), (0,external_wp_element_namespaceObject.createElement)(NavigableRegion, {
+ }, notices), (0,external_React_namespaceObject.createElement)(NavigableRegion, {
className: "interface-interface-skeleton__content",
- ariaLabel: mergedLabels.body,
- ...contentProps
- }, content), !!sidebar && (0,external_wp_element_namespaceObject.createElement)(NavigableRegion, {
+ ariaLabel: mergedLabels.body
+ }, content), !!sidebar && (0,external_React_namespaceObject.createElement)(NavigableRegion, {
className: "interface-interface-skeleton__sidebar",
ariaLabel: mergedLabels.sidebar
- }, sidebar), !!actions && (0,external_wp_element_namespaceObject.createElement)(NavigableRegion, {
+ }, sidebar), !!actions && (0,external_React_namespaceObject.createElement)(NavigableRegion, {
className: "interface-interface-skeleton__actions",
ariaLabel: mergedLabels.actions
- }, actions))), !!footer && (0,external_wp_element_namespaceObject.createElement)(NavigableRegion, {
+ }, actions))), !!footer && (0,external_React_namespaceObject.createElement)(NavigableRegion, {
className: "interface-interface-skeleton__footer",
ariaLabel: mergedLabels.footer
}, footer));
}
-/* harmony default export */ var interface_skeleton = ((0,external_wp_element_namespaceObject.forwardRef)(InterfaceSkeleton));
+/* harmony default export */ const interface_skeleton = ((0,external_wp_element_namespaceObject.forwardRef)(InterfaceSkeleton));
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/more-vertical.js
@@ -1378,13 +1404,13 @@ function InterfaceSkeleton({
* WordPress dependencies
*/
-const moreVertical = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
+const moreVertical = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24"
-}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
+}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"
}));
-/* harmony default export */ var more_vertical = (moreVertical);
+/* harmony default export */ const more_vertical = (moreVertical);
;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/more-menu-dropdown/index.js
@@ -1408,7 +1434,7 @@ function MoreMenuDropdown({
toggleProps,
children
}) {
- return (0,external_wp_element_namespaceObject.createElement)(DropdownComponent, {
+ return (0,external_React_namespaceObject.createElement)(DropdownComponent, {
className: classnames_default()('interface-more-menu-dropdown', className),
icon: more_vertical,
label: label,
@@ -1419,7 +1445,8 @@ function MoreMenuDropdown({
},
toggleProps: {
tooltipPosition: 'bottom',
- ...toggleProps
+ ...toggleProps,
+ size: 'compact'
}
}, onClose => children(onClose));
}
@@ -1435,16 +1462,12 @@ function MoreMenuDropdown({
-
-
-
-
;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/index.js
;// CONCATENATED MODULE: external ["wp","blockEditor"]
-var external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"];
+const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/store/transformers.js
/**
* WordPress dependencies
@@ -2192,7 +2215,6 @@ const isSavingWidgetAreas = (0,external_wp_data_namespaceObject.createRegistrySe
}
const widgetIds = [...Object.keys(select(constants_STORE_NAME).getWidgets()), undefined // account for new widgets without an ID
];
-
for (const id of widgetIds) {
const isSaving = select(external_wp_coreData_namespaceObject.store).isSavingEntityRecord('root', 'widget', id);
if (isSaving) {
@@ -2272,6 +2294,23 @@ function isListViewOpened(state) {
return state.listViewPanel;
}
+;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/store/private-selectors.js
+function getListViewToggleRef(state) {
+ return state.listViewToggleRef;
+}
+
+;// CONCATENATED MODULE: external ["wp","privateApis"]
+const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
+;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/lock-unlock.js
+/**
+ * WordPress dependencies
+ */
+
+const {
+ lock,
+ unlock
+} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', '@wordpress/edit-widgets');
+
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/store/index.js
/**
* WordPress dependencies
@@ -2288,6 +2327,8 @@ function isListViewOpened(state) {
+
+
/**
* Block editor data store configuration.
*
@@ -2321,9 +2362,10 @@ external_wp_apiFetch_default().use(function (options, next) {
}
return next(options);
});
+unlock(store_store).registerPrivateSelectors(private_selectors_namespaceObject);
;// CONCATENATED MODULE: external ["wp","hooks"]
-var external_wp_hooks_namespaceObject = window["wp"]["hooks"];
+const external_wp_hooks_namespaceObject = window["wp"]["hooks"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/filters/move-to-widget-area.js
/**
@@ -2367,9 +2409,9 @@ const withMoveToWidgetAreaToolbarItem = (0,external_wp_compose_namespaceObject.c
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
const hasMultipleWidgetAreas = widgetAreas?.length > 1;
const isMoveToWidgetAreaVisible = blockName !== 'core/widget-area' && hasMultipleWidgetAreas && canInsertBlockInWidgetArea;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(BlockEdit, {
+ return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(BlockEdit, {
...props
- }), isMoveToWidgetAreaVisible && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_widgets_namespaceObject.MoveToWidgetArea, {
+ }), isMoveToWidgetAreaVisible && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_React_namespaceObject.createElement)(external_wp_widgets_namespaceObject.MoveToWidgetArea, {
widgetAreas: widgetAreas,
currentWidgetAreaId: currentWidgetAreaId,
onSelect: widgetAreaId => {
@@ -2380,7 +2422,7 @@ const withMoveToWidgetAreaToolbarItem = (0,external_wp_compose_namespaceObject.c
(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/edit-widgets/block-edit', withMoveToWidgetAreaToolbarItem);
;// CONCATENATED MODULE: external ["wp","mediaUtils"]
-var external_wp_mediaUtils_namespaceObject = window["wp"]["mediaUtils"];
+const external_wp_mediaUtils_namespaceObject = window["wp"]["mediaUtils"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/filters/replace-media-upload.js
/**
* WordPress dependencies
@@ -2449,7 +2491,7 @@ const useIsDraggingWithin = elementRef => {
}, []);
return isDraggingWithin;
};
-/* harmony default export */ var use_is_dragging_within = (useIsDraggingWithin);
+/* harmony default export */ const use_is_dragging_within = (useIsDraggingWithin);
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/blocks/widget-area/edit/inner-blocks.js
@@ -2486,12 +2528,12 @@ function WidgetAreaInnerBlocks({
templateLock: false,
renderAppender: external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender
});
- return (0,external_wp_element_namespaceObject.createElement)("div", {
+ return (0,external_React_namespaceObject.createElement)("div", {
"data-widget-area-id": id,
className: classnames_default()('wp-block-widget-area__inner-blocks block-editor-inner-blocks editor-styles-wrapper', {
'wp-block-widget-area__highlight-drop-zone': shouldHighlightDropZone
})
- }, (0,external_wp_element_namespaceObject.createElement)("div", {
+ }, (0,external_React_namespaceObject.createElement)("div", {
...innerBlocksProps
}));
}
@@ -2544,10 +2586,10 @@ function WidgetAreaEdit({
setOpen(false);
}
}, [isOpen, isDragging, isDraggingWithin, openedWhileDragging]);
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Panel, {
+ return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Panel, {
className: className,
ref: wrapper
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
+ }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
title: name,
opened: isOpen,
onToggle: () => {
@@ -2561,14 +2603,14 @@ function WidgetAreaEdit({
// unmounted when the panel is collapsed. Unmounting legacy
// widgets may have unintended consequences (e.g. TinyMCE
// not being properly reinitialized)
- (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableDisclosureContent, {
+ (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableDisclosureContent, {
className: "wp-block-widget-area__panel-body-content",
visible: opened
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_coreData_namespaceObject.EntityProvider, {
+ }, (0,external_React_namespaceObject.createElement)(external_wp_coreData_namespaceObject.EntityProvider, {
kind: "root",
type: "postType",
id: `widget-area-${id}`
- }, (0,external_wp_element_namespaceObject.createElement)(WidgetAreaInnerBlocks, {
+ }, (0,external_React_namespaceObject.createElement)(WidgetAreaInnerBlocks, {
id: id
})))));
}
@@ -2612,6 +2654,7 @@ const useIsDragging = elementRef => {
* Internal dependencies
*/
const metadata = {
+ $schema: "https://schemas.wp.org/trunk/block.json",
name: "core/widget-area",
category: "widgets",
attributes: {
@@ -2664,7 +2707,7 @@ function CopyButton({
children
}) {
const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(text);
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
+ return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
variant: "secondary",
ref: ref
}, children);
@@ -2673,11 +2716,11 @@ function ErrorBoundaryWarning({
message,
error
}) {
- const actions = [(0,external_wp_element_namespaceObject.createElement)(CopyButton, {
+ const actions = [(0,external_React_namespaceObject.createElement)(CopyButton, {
key: "copy-error",
text: error.stack
}, (0,external_wp_i18n_namespaceObject.__)('Copy Error'))];
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, {
+ return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, {
className: "edit-widgets-error-boundary",
actions: actions
}, message);
@@ -2701,7 +2744,7 @@ class ErrorBoundary extends external_wp_element_namespaceObject.Component {
if (!this.state.error) {
return this.props.children;
}
- return (0,external_wp_element_namespaceObject.createElement)(ErrorBoundaryWarning, {
+ return (0,external_React_namespaceObject.createElement)(ErrorBoundaryWarning, {
message: (0,external_wp_i18n_namespaceObject.__)('The editor has encountered an unexpected error.'),
error: this.state.error
});
@@ -2709,11 +2752,11 @@ class ErrorBoundary extends external_wp_element_namespaceObject.Component {
}
;// CONCATENATED MODULE: external ["wp","patterns"]
-var external_wp_patterns_namespaceObject = window["wp"]["patterns"];
+const external_wp_patterns_namespaceObject = window["wp"]["patterns"];
;// CONCATENATED MODULE: external ["wp","keyboardShortcuts"]
-var external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShortcuts"];
+const external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShortcuts"];
;// CONCATENATED MODULE: external ["wp","keycodes"]
-var external_wp_keycodes_namespaceObject = window["wp"]["keycodes"];
+const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/keyboard-shortcuts/index.js
/**
* WordPress dependencies
@@ -2893,7 +2936,7 @@ function KeyboardShortcutsRegister() {
return null;
}
KeyboardShortcuts.Register = KeyboardShortcutsRegister;
-/* harmony default export */ var keyboard_shortcuts = (KeyboardShortcuts);
+/* harmony default export */ const keyboard_shortcuts = (KeyboardShortcuts);
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/hooks/use-last-selected-widget-area.js
/**
@@ -2943,24 +2986,12 @@ const useLastSelectedWidgetArea = () => (0,external_wp_data_namespaceObject.useS
const widgetAreasPost = getEntityRecord(KIND, POST_TYPE, buildWidgetAreasPostId());
return widgetAreasPost?.blocks[0]?.clientId;
}, []);
-/* harmony default export */ var use_last_selected_widget_area = (useLastSelectedWidgetArea);
+/* harmony default export */ const use_last_selected_widget_area = (useLastSelectedWidgetArea);
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/constants.js
const ALLOW_REUSABLE_BLOCKS = false;
const ENABLE_EXPERIMENTAL_FSE_BLOCKS = false;
-;// CONCATENATED MODULE: external ["wp","privateApis"]
-var external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
-;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/lock-unlock.js
-/**
- * WordPress dependencies
- */
-
-const {
- lock,
- unlock
-} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', '@wordpress/edit-widgets');
-
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/widget-areas-block-editor-provider/index.js
/**
@@ -2975,6 +3006,7 @@ const {
+
/**
* Internal dependencies
*/
@@ -2996,17 +3028,30 @@ function WidgetAreasBlockEditorProvider({
...props
}) {
const mediaPermissions = (0,external_wp_coreData_namespaceObject.useResourcePermissions)('media');
+ const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium');
const {
reusableBlocks,
isFixedToolbarActive,
- keepCaretInsideBlock
- } = (0,external_wp_data_namespaceObject.useSelect)(select => ({
- widgetAreas: select(store_store).getWidgetAreas(),
- widgets: select(store_store).getWidgets(),
- reusableBlocks: ALLOW_REUSABLE_BLOCKS ? select(external_wp_coreData_namespaceObject.store).getEntityRecords('postType', 'wp_block') : [],
- isFixedToolbarActive: !!select(external_wp_preferences_namespaceObject.store).get('core/edit-widgets', 'fixedToolbar'),
- keepCaretInsideBlock: !!select(external_wp_preferences_namespaceObject.store).get('core/edit-widgets', 'keepCaretInsideBlock')
- }), []);
+ keepCaretInsideBlock,
+ pageOnFront,
+ pageForPosts
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
+ const {
+ canUser,
+ getEntityRecord,
+ getEntityRecords
+ } = select(external_wp_coreData_namespaceObject.store);
+ const siteSettings = canUser('read', 'settings') ? getEntityRecord('root', 'site') : undefined;
+ return {
+ widgetAreas: select(store_store).getWidgetAreas(),
+ widgets: select(store_store).getWidgets(),
+ reusableBlocks: ALLOW_REUSABLE_BLOCKS ? getEntityRecords('postType', 'wp_block') : [],
+ isFixedToolbarActive: !!select(external_wp_preferences_namespaceObject.store).get('core/edit-widgets', 'fixedToolbar'),
+ keepCaretInsideBlock: !!select(external_wp_preferences_namespaceObject.store).get('core/edit-widgets', 'keepCaretInsideBlock'),
+ pageOnFront: siteSettings?.page_on_front,
+ pageForPosts: siteSettings?.page_for_posts
+ };
+ }, []);
const {
setIsInserterOpened
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
@@ -3029,25 +3074,27 @@ function WidgetAreasBlockEditorProvider({
return {
...blockEditorSettings,
__experimentalReusableBlocks: reusableBlocks,
- hasFixedToolbar: isFixedToolbarActive,
+ hasFixedToolbar: isFixedToolbarActive || !isLargeViewport,
keepCaretInsideBlock,
mediaUpload: mediaUploadBlockEditor,
templateLock: 'all',
- __experimentalSetIsInserterOpened: setIsInserterOpened
+ __experimentalSetIsInserterOpened: setIsInserterOpened,
+ pageOnFront,
+ pageForPosts
};
- }, [blockEditorSettings, isFixedToolbarActive, keepCaretInsideBlock, mediaPermissions.canCreate, reusableBlocks, setIsInserterOpened]);
+ }, [blockEditorSettings, isFixedToolbarActive, isLargeViewport, keepCaretInsideBlock, mediaPermissions.canCreate, reusableBlocks, setIsInserterOpened, pageOnFront, pageForPosts]);
const widgetAreaId = use_last_selected_widget_area();
const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)(KIND, POST_TYPE, {
id: buildWidgetAreasPostId()
});
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SlotFillProvider, null, (0,external_wp_element_namespaceObject.createElement)(keyboard_shortcuts.Register, null), (0,external_wp_element_namespaceObject.createElement)(ExperimentalBlockEditorProvider, {
+ return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SlotFillProvider, null, (0,external_React_namespaceObject.createElement)(keyboard_shortcuts.Register, null), (0,external_React_namespaceObject.createElement)(ExperimentalBlockEditorProvider, {
value: blocks,
onInput: onInput,
onChange: onChange,
settings: settings,
useSubRegistry: false,
...props
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.CopyHandler, null, children), (0,external_wp_element_namespaceObject.createElement)(PatternsMenuItems, {
+ }, children, (0,external_React_namespaceObject.createElement)(PatternsMenuItems, {
rootClientId: widgetAreaId
})));
}
@@ -3058,17 +3105,17 @@ function WidgetAreasBlockEditorProvider({
* WordPress dependencies
*/
-const drawerLeft = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
+const drawerLeft = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24"
-}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
+}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM8.5 18.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h2.5v13zm10-.5c0 .3-.2.5-.5.5h-8v-13h8c.3 0 .5.2.5.5v12z"
}));
-/* harmony default export */ var drawer_left = (drawerLeft);
+/* harmony default export */ const drawer_left = (drawerLeft);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/drawer-right.js
@@ -3076,17 +3123,17 @@ const drawerLeft = (0,external_wp_element_namespaceObject.createElement)(externa
* WordPress dependencies
*/
-const drawerRight = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
+const drawerRight = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24"
-}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
+}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z"
}));
-/* harmony default export */ var drawer_right = (drawerRight);
+/* harmony default export */ const drawer_right = (drawerRight);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/block-default.js
@@ -3094,18 +3141,18 @@ const drawerRight = (0,external_wp_element_namespaceObject.createElement)(extern
* WordPress dependencies
*/
-const blockDefault = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
+const blockDefault = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24"
-}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
+}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"
}));
-/* harmony default export */ var block_default = (blockDefault);
+/* harmony default export */ const block_default = (blockDefault);
;// CONCATENATED MODULE: external ["wp","url"]
-var external_wp_url_namespaceObject = window["wp"]["url"];
+const external_wp_url_namespaceObject = window["wp"]["url"];
;// CONCATENATED MODULE: external ["wp","dom"]
-var external_wp_dom_namespaceObject = window["wp"]["dom"];
+const external_wp_dom_namespaceObject = window["wp"]["dom"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/sidebar/widget-areas.js
/**
@@ -3137,13 +3184,13 @@ function WidgetAreas({
} else {
description = selectedWidgetArea.description;
}
- return (0,external_wp_element_namespaceObject.createElement)("div", {
+ return (0,external_React_namespaceObject.createElement)("div", {
className: "edit-widgets-widget-areas"
- }, (0,external_wp_element_namespaceObject.createElement)("div", {
+ }, (0,external_React_namespaceObject.createElement)("div", {
className: "edit-widgets-widget-areas__top-container"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
+ }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
icon: block_default
- }), (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)("p", {
+ }), (0,external_React_namespaceObject.createElement)("div", null, (0,external_React_namespaceObject.createElement)("p", {
// Use `dangerouslySetInnerHTML` to keep backwards
// compatibility. Basic markup in the description is an
// established feature of WordPress.
@@ -3151,7 +3198,7 @@ function WidgetAreas({
dangerouslySetInnerHTML: {
__html: (0,external_wp_dom_namespaceObject.safeHTML)(description)
}
- }), widgetAreas?.length === 0 && (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('Your theme does not contain any Widget Areas.')), !selectedWidgetArea && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
+ }), widgetAreas?.length === 0 && (0,external_React_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('Your theme does not contain any Widget Areas.')), !selectedWidgetArea && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
href: (0,external_wp_url_namespaceObject.addQueryArgs)('customize.php', {
'autofocus[panel]': 'widgets',
return: window.location.pathname
@@ -3163,11 +3210,6 @@ function WidgetAreas({
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/sidebar/index.js
/**
- * External dependencies
- */
-
-
-/**
* WordPress dependencies
*/
@@ -3192,30 +3234,75 @@ const WIDGET_AREAS_IDENTIFIER = 'edit-widgets/block-areas';
*/
-function ComplementaryAreaTab({
- identifier,
- label,
- isActive
+
+const {
+ Tabs
+} = unlock(external_wp_components_namespaceObject.privateApis);
+function SidebarHeader({
+ selectedWidgetAreaBlock
+}) {
+ return (0,external_React_namespaceObject.createElement)(Tabs.TabList, null, (0,external_React_namespaceObject.createElement)(Tabs.Tab, {
+ tabId: WIDGET_AREAS_IDENTIFIER
+ }, selectedWidgetAreaBlock ? selectedWidgetAreaBlock.attributes.name : (0,external_wp_i18n_namespaceObject.__)('Widget Areas')), (0,external_React_namespaceObject.createElement)(Tabs.Tab, {
+ tabId: BLOCK_INSPECTOR_IDENTIFIER
+ }, (0,external_wp_i18n_namespaceObject.__)('Block')));
+}
+function SidebarContent({
+ hasSelectedNonAreaBlock,
+ currentArea,
+ isGeneralSidebarOpen,
+ selectedWidgetAreaBlock
}) {
const {
enableComplementaryArea
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- onClick: () => enableComplementaryArea(store_store.name, identifier),
- className: classnames_default()('edit-widgets-sidebar__panel-tab', {
- 'is-active': isActive
- }),
- "aria-label": isActive ?
- // translators: %s: sidebar label e.g: "Widget Areas".
- (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('%s (selected)'), label) : label,
- "data-label": label
- }, label);
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
+ if (hasSelectedNonAreaBlock && currentArea === WIDGET_AREAS_IDENTIFIER && isGeneralSidebarOpen) {
+ enableComplementaryArea('core/edit-widgets', BLOCK_INSPECTOR_IDENTIFIER);
+ }
+ if (!hasSelectedNonAreaBlock && currentArea === BLOCK_INSPECTOR_IDENTIFIER && isGeneralSidebarOpen) {
+ enableComplementaryArea('core/edit-widgets', WIDGET_AREAS_IDENTIFIER);
+ }
+ // We're intentionally leaving `currentArea` and `isGeneralSidebarOpen`
+ // out of the dep array because we want this effect to run based on
+ // block selection changes, not sidebar state changes.
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [hasSelectedNonAreaBlock, enableComplementaryArea]);
+ const tabsContextValue = (0,external_wp_element_namespaceObject.useContext)(Tabs.Context);
+ return (0,external_React_namespaceObject.createElement)(complementary_area, {
+ className: "edit-widgets-sidebar",
+ header: (0,external_React_namespaceObject.createElement)(Tabs.Context.Provider, {
+ value: tabsContextValue
+ }, (0,external_React_namespaceObject.createElement)(SidebarHeader, {
+ selectedWidgetAreaBlock: selectedWidgetAreaBlock
+ })),
+ headerClassName: "edit-widgets-sidebar__panel-tabs"
+ /* translators: button label text should, if possible, be under 16 characters. */,
+ title: (0,external_wp_i18n_namespaceObject.__)('Settings'),
+ closeLabel: (0,external_wp_i18n_namespaceObject.__)('Close Settings'),
+ scope: "core/edit-widgets",
+ identifier: currentArea,
+ icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? drawer_left : drawer_right,
+ isActiveByDefault: SIDEBAR_ACTIVE_BY_DEFAULT
+ }, (0,external_React_namespaceObject.createElement)(Tabs.Context.Provider, {
+ value: tabsContextValue
+ }, (0,external_React_namespaceObject.createElement)(Tabs.TabPanel, {
+ tabId: WIDGET_AREAS_IDENTIFIER,
+ focusable: false
+ }, (0,external_React_namespaceObject.createElement)(WidgetAreas, {
+ selectedWidgetAreaId: selectedWidgetAreaBlock?.attributes.id
+ })), (0,external_React_namespaceObject.createElement)(Tabs.TabPanel, {
+ tabId: BLOCK_INSPECTOR_IDENTIFIER,
+ focusable: false
+ }, hasSelectedNonAreaBlock ? (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockInspector, null) :
+ // Pretend that Widget Areas are part of the UI by not
+ // showing the Block Inspector when one is selected.
+ (0,external_React_namespaceObject.createElement)("span", {
+ className: "block-editor-block-inspector__no-blocks"
+ }, (0,external_wp_i18n_namespaceObject.__)('No block selected.')))));
}
function Sidebar() {
const {
- enableComplementaryArea
- } = (0,external_wp_data_namespaceObject.useDispatch)(store);
- const {
currentArea,
hasSelectedNonAreaBlock,
isGeneralSidebarOpen,
@@ -3254,44 +3341,35 @@ function Sidebar() {
selectedWidgetAreaBlock: widgetAreaBlock
};
}, []);
+ const {
+ enableComplementaryArea
+ } = (0,external_wp_data_namespaceObject.useDispatch)(store);
- // currentArea, and isGeneralSidebarOpen are intentionally left out from the dependencies,
- // because we want to run the effect when a block is selected/unselected and not when the sidebar state changes.
- (0,external_wp_element_namespaceObject.useEffect)(() => {
- if (hasSelectedNonAreaBlock && currentArea === WIDGET_AREAS_IDENTIFIER && isGeneralSidebarOpen) {
- enableComplementaryArea('core/edit-widgets', BLOCK_INSPECTOR_IDENTIFIER);
- }
- if (!hasSelectedNonAreaBlock && currentArea === BLOCK_INSPECTOR_IDENTIFIER && isGeneralSidebarOpen) {
- enableComplementaryArea('core/edit-widgets', WIDGET_AREAS_IDENTIFIER);
+ // `newSelectedTabId` could technically be falsey if no tab is selected (i.e.
+ // the initial render) or when we don't want a tab displayed (i.e. the
+ // sidebar is closed). These cases should both be covered by the `!!` check
+ // below, so we shouldn't need any additional falsey handling.
+ const onTabSelect = (0,external_wp_element_namespaceObject.useCallback)(newSelectedTabId => {
+ if (!!newSelectedTabId) {
+ enableComplementaryArea(store_store.name, newSelectedTabId);
}
- }, [hasSelectedNonAreaBlock, enableComplementaryArea]);
- return (0,external_wp_element_namespaceObject.createElement)(complementary_area, {
- className: "edit-widgets-sidebar",
- header: (0,external_wp_element_namespaceObject.createElement)("ul", null, (0,external_wp_element_namespaceObject.createElement)("li", null, (0,external_wp_element_namespaceObject.createElement)(ComplementaryAreaTab, {
- identifier: WIDGET_AREAS_IDENTIFIER,
- label: selectedWidgetAreaBlock ? selectedWidgetAreaBlock.attributes.name : (0,external_wp_i18n_namespaceObject.__)('Widget Areas'),
- isActive: currentArea === WIDGET_AREAS_IDENTIFIER
- })), (0,external_wp_element_namespaceObject.createElement)("li", null, (0,external_wp_element_namespaceObject.createElement)(ComplementaryAreaTab, {
- identifier: BLOCK_INSPECTOR_IDENTIFIER,
- label: (0,external_wp_i18n_namespaceObject.__)('Block'),
- isActive: currentArea === BLOCK_INSPECTOR_IDENTIFIER
- }))),
- headerClassName: "edit-widgets-sidebar__panel-tabs"
- /* translators: button label text should, if possible, be under 16 characters. */,
- title: (0,external_wp_i18n_namespaceObject.__)('Settings'),
- closeLabel: (0,external_wp_i18n_namespaceObject.__)('Close Settings'),
- scope: "core/edit-widgets",
- identifier: currentArea,
- icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? drawer_left : drawer_right,
- isActiveByDefault: SIDEBAR_ACTIVE_BY_DEFAULT
- }, currentArea === WIDGET_AREAS_IDENTIFIER && (0,external_wp_element_namespaceObject.createElement)(WidgetAreas, {
- selectedWidgetAreaId: selectedWidgetAreaBlock?.attributes.id
- }), currentArea === BLOCK_INSPECTOR_IDENTIFIER && (hasSelectedNonAreaBlock ? (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockInspector, null) :
- // Pretend that Widget Areas are part of the UI by not
- // showing the Block Inspector when one is selected.
- (0,external_wp_element_namespaceObject.createElement)("span", {
- className: "block-editor-block-inspector__no-blocks"
- }, (0,external_wp_i18n_namespaceObject.__)('No block selected.'))));
+ }, [enableComplementaryArea]);
+ return (0,external_React_namespaceObject.createElement)(Tabs
+ // Due to how this component is controlled (via a value from the
+ // `interfaceStore`), when the sidebar closes the currently selected
+ // tab can't be found. This causes the component to continuously reset
+ // the selection to `null` in an infinite loop. Proactively setting
+ // the selected tab to `null` avoids that.
+ , {
+ selectedTabId: isGeneralSidebarOpen ? currentArea : null,
+ onSelect: onTabSelect,
+ selectOnMove: false
+ }, (0,external_React_namespaceObject.createElement)(SidebarContent, {
+ hasSelectedNonAreaBlock: hasSelectedNonAreaBlock,
+ currentArea: currentArea,
+ isGeneralSidebarOpen: isGeneralSidebarOpen,
+ selectedWidgetAreaBlock: selectedWidgetAreaBlock
+ }));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/plus.js
@@ -3300,13 +3378,13 @@ function Sidebar() {
* WordPress dependencies
*/
-const plus = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
+const plus = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24"
-}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"
+}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
+ d: "M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"
}));
-/* harmony default export */ var library_plus = (plus);
+/* harmony default export */ const library_plus = (plus);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/list-view.js
@@ -3314,53 +3392,13 @@ const plus = (0,external_wp_element_namespaceObject.createElement)(external_wp_p
* WordPress dependencies
*/
-const listView = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
+const listView = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
viewBox: "0 0 24 24",
xmlns: "http://www.w3.org/2000/svg"
-}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
+}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"
}));
-/* harmony default export */ var list_view = (listView);
-
-;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/save-button/index.js
-
-/**
- * WordPress dependencies
- */
-
-
-
-
-/**
- * Internal dependencies
- */
-
-function SaveButton() {
- const {
- hasEditedWidgetAreaIds,
- isSaving
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- getEditedWidgetAreas,
- isSavingWidgetAreas
- } = select(store_store);
- return {
- hasEditedWidgetAreaIds: getEditedWidgetAreas()?.length > 0,
- isSaving: isSavingWidgetAreas()
- };
- }, []);
- const {
- saveEditedWidgetAreas
- } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- variant: "primary",
- isBusy: isSaving,
- "aria-disabled": isSaving,
- onClick: isSaving ? undefined : saveEditedWidgetAreas,
- disabled: !hasEditedWidgetAreaIds
- }, isSaving ? (0,external_wp_i18n_namespaceObject.__)('Saving…') : (0,external_wp_i18n_namespaceObject.__)('Update'));
-}
-/* harmony default export */ var save_button = (SaveButton);
+/* harmony default export */ const list_view = (listView);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/undo.js
@@ -3368,13 +3406,13 @@ function SaveButton() {
* WordPress dependencies
*/
-const undo = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
+const undo = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24"
-}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
+}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"
}));
-/* harmony default export */ var library_undo = (undo);
+/* harmony default export */ const library_undo = (undo);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/redo.js
@@ -3382,13 +3420,13 @@ const undo = (0,external_wp_element_namespaceObject.createElement)(external_wp_p
* WordPress dependencies
*/
-const redo = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
+const redo = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24"
-}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
+}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M15.6 6.5l-1.1 1 2.9 3.3H8c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.3-.5h9.2L14.5 15l1.1 1.1 4.6-4.6-4.6-5z"
}));
-/* harmony default export */ var library_redo = (redo);
+/* harmony default export */ const library_redo = (redo);
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/header/undo-redo/undo.js
@@ -3401,12 +3439,15 @@ const redo = (0,external_wp_element_namespaceObject.createElement)(external_wp_p
-function UndoButton() {
+
+function UndoButton(props, ref) {
const hasUndo = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).hasUndo(), []);
const {
undo
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
+ return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
+ ...props,
+ ref: ref,
icon: !(0,external_wp_i18n_namespaceObject.isRTL)() ? library_undo : library_redo,
label: (0,external_wp_i18n_namespaceObject.__)('Undo'),
shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary('z')
@@ -3418,6 +3459,7 @@ function UndoButton() {
onClick: hasUndo ? undo : undefined
});
}
+/* harmony default export */ const undo_redo_undo = ((0,external_wp_element_namespaceObject.forwardRef)(UndoButton));
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/header/undo-redo/redo.js
@@ -3430,13 +3472,16 @@ function UndoButton() {
-function RedoButton() {
+
+function RedoButton(props, ref) {
const shortcut = (0,external_wp_keycodes_namespaceObject.isAppleOS)() ? external_wp_keycodes_namespaceObject.displayShortcut.primaryShift('z') : external_wp_keycodes_namespaceObject.displayShortcut.primary('y');
const hasRedo = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).hasRedo(), []);
const {
redo
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
+ return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
+ ...props,
+ ref: ref,
icon: !(0,external_wp_i18n_namespaceObject.isRTL)() ? library_redo : library_undo,
label: (0,external_wp_i18n_namespaceObject.__)('Redo'),
shortcut: shortcut
@@ -3448,6 +3493,159 @@ function RedoButton() {
onClick: hasRedo ? redo : undefined
});
}
+/* harmony default export */ const undo_redo_redo = ((0,external_wp_element_namespaceObject.forwardRef)(RedoButton));
+
+;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/header/document-tools/index.js
+
+/**
+ * WordPress dependencies
+ */
+
+
+
+
+
+
+
+
+/**
+ * Internal dependencies
+ */
+
+
+
+
+
+const {
+ useCanBlockToolbarBeFocused
+} = unlock(external_wp_blockEditor_namespaceObject.privateApis);
+function DocumentTools() {
+ const isMediumViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium');
+ const inserterButton = (0,external_wp_element_namespaceObject.useRef)();
+ const widgetAreaClientId = use_last_selected_widget_area();
+ const isLastSelectedWidgetAreaOpen = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getIsWidgetAreaOpen(widgetAreaClientId), [widgetAreaClientId]);
+ const {
+ isInserterOpen,
+ isListViewOpen,
+ listViewToggleRef
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
+ const {
+ isInserterOpened,
+ isListViewOpened,
+ getListViewToggleRef
+ } = unlock(select(store_store));
+ return {
+ isInserterOpen: isInserterOpened(),
+ isListViewOpen: isListViewOpened(),
+ listViewToggleRef: getListViewToggleRef()
+ };
+ }, []);
+ const {
+ setIsWidgetAreaOpen,
+ setIsInserterOpened,
+ setIsListViewOpened
+ } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
+ const {
+ selectBlock
+ } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
+ const handleClick = () => {
+ if (isInserterOpen) {
+ // Focusing the inserter button closes the inserter popover.
+ setIsInserterOpened(false);
+ } else {
+ if (!isLastSelectedWidgetAreaOpen) {
+ // Select the last selected block if hasn't already.
+ selectBlock(widgetAreaClientId);
+ // Open the last selected widget area when opening the inserter.
+ setIsWidgetAreaOpen(widgetAreaClientId, true);
+ }
+ // The DOM updates resulting from selectBlock() and setIsInserterOpened() calls are applied the
+ // same tick and pretty much in a random order. The inserter is closed if any other part of the
+ // app receives focus. If selectBlock() happens to take effect after setIsInserterOpened() then
+ // the inserter is visible for a brief moment and then gets auto-closed due to focus moving to
+ // the selected block.
+ window.requestAnimationFrame(() => setIsInserterOpened(true));
+ }
+ };
+ const toggleListView = (0,external_wp_element_namespaceObject.useCallback)(() => setIsListViewOpened(!isListViewOpen), [setIsListViewOpened, isListViewOpen]);
+
+ // If there's a block toolbar to be focused, disable the focus shortcut for the document toolbar.
+ const blockToolbarCanBeFocused = useCanBlockToolbarBeFocused();
+ return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.NavigableToolbar, {
+ className: "edit-widgets-header-toolbar",
+ "aria-label": (0,external_wp_i18n_namespaceObject.__)('Document tools'),
+ shouldUseKeyboardFocusShortcut: !blockToolbarCanBeFocused,
+ variant: "unstyled"
+ }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarItem, {
+ ref: inserterButton,
+ as: external_wp_components_namespaceObject.Button,
+ className: "edit-widgets-header-toolbar__inserter-toggle",
+ variant: "primary",
+ isPressed: isInserterOpen,
+ onMouseDown: event => {
+ event.preventDefault();
+ },
+ onClick: handleClick,
+ icon: library_plus
+ /* translators: button label text should, if possible, be under 16
+ characters. */,
+ label: (0,external_wp_i18n_namespaceObject._x)('Toggle block inserter', 'Generic label for block inserter button')
+ }), isMediumViewport && (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarItem, {
+ as: undo_redo_undo
+ }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarItem, {
+ as: undo_redo_redo
+ }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarItem, {
+ as: external_wp_components_namespaceObject.Button,
+ className: "edit-widgets-header-toolbar__list-view-toggle",
+ icon: list_view,
+ isPressed: isListViewOpen
+ /* translators: button label text should, if possible, be under 16 characters. */,
+ label: (0,external_wp_i18n_namespaceObject.__)('List View'),
+ onClick: toggleListView,
+ ref: listViewToggleRef
+ })));
+}
+/* harmony default export */ const document_tools = (DocumentTools);
+
+;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/save-button/index.js
+
+/**
+ * WordPress dependencies
+ */
+
+
+
+
+/**
+ * Internal dependencies
+ */
+
+function SaveButton() {
+ const {
+ hasEditedWidgetAreaIds,
+ isSaving
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
+ const {
+ getEditedWidgetAreas,
+ isSavingWidgetAreas
+ } = select(store_store);
+ return {
+ hasEditedWidgetAreaIds: getEditedWidgetAreas()?.length > 0,
+ isSaving: isSavingWidgetAreas()
+ };
+ }, []);
+ const {
+ saveEditedWidgetAreas
+ } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
+ const isDisabled = isSaving || !hasEditedWidgetAreaIds;
+ return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
+ variant: "primary",
+ isBusy: isSaving,
+ "aria-disabled": isDisabled,
+ onClick: isDisabled ? undefined : saveEditedWidgetAreas
+ }, isSaving ? (0,external_wp_i18n_namespaceObject.__)('Saving…') : (0,external_wp_i18n_namespaceObject.__)('Update'));
+}
+/* harmony default export */ const save_button = (SaveButton);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/external.js
@@ -3455,13 +3653,13 @@ function RedoButton() {
* WordPress dependencies
*/
-const external = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
+const external = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24"
-}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
+}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"
}));
-/* harmony default export */ var library_external = (external);
+/* harmony default export */ const library_external = (external);
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/keyboard-shortcut-help-modal/config.js
/**
@@ -3543,16 +3741,16 @@ function KeyCombination({
const shortcut = keyCombination.modifier ? external_wp_keycodes_namespaceObject.displayShortcutList[keyCombination.modifier](keyCombination.character) : keyCombination.character;
const ariaLabel = keyCombination.modifier ? external_wp_keycodes_namespaceObject.shortcutAriaLabel[keyCombination.modifier](keyCombination.character) : keyCombination.character;
const shortcuts = Array.isArray(shortcut) ? shortcut : [shortcut];
- return (0,external_wp_element_namespaceObject.createElement)("kbd", {
+ return (0,external_React_namespaceObject.createElement)("kbd", {
className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-key-combination",
"aria-label": forceAriaLabel || ariaLabel
}, shortcuts.map((character, index) => {
if (character === '+') {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, {
+ return (0,external_React_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, {
key: index
}, character);
}
- return (0,external_wp_element_namespaceObject.createElement)("kbd", {
+ return (0,external_React_namespaceObject.createElement)("kbd", {
key: index,
className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-key"
}, character);
@@ -3564,20 +3762,20 @@ function Shortcut({
aliases = [],
ariaLabel
}) {
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", {
+ return (0,external_React_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)("div", {
className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-description"
- }, description), (0,external_wp_element_namespaceObject.createElement)("div", {
+ }, description), (0,external_React_namespaceObject.createElement)("div", {
className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-term"
- }, (0,external_wp_element_namespaceObject.createElement)(KeyCombination, {
+ }, (0,external_React_namespaceObject.createElement)(KeyCombination, {
keyCombination: keyCombination,
forceAriaLabel: ariaLabel
- }), aliases.map((alias, index) => (0,external_wp_element_namespaceObject.createElement)(KeyCombination, {
+ }), aliases.map((alias, index) => (0,external_React_namespaceObject.createElement)(KeyCombination, {
keyCombination: alias,
forceAriaLabel: ariaLabel,
key: index
}))));
}
-/* harmony default export */ var keyboard_shortcut_help_modal_shortcut = (Shortcut);
+/* harmony default export */ const keyboard_shortcut_help_modal_shortcut = (Shortcut);
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js
@@ -3613,13 +3811,13 @@ function DynamicShortcut({
if (!keyCombination) {
return null;
}
- return (0,external_wp_element_namespaceObject.createElement)(keyboard_shortcut_help_modal_shortcut, {
+ return (0,external_React_namespaceObject.createElement)(keyboard_shortcut_help_modal_shortcut, {
keyCombination: keyCombination,
description: description,
aliases: aliases
});
}
-/* harmony default export */ var dynamic_shortcut = (DynamicShortcut);
+/* harmony default export */ const dynamic_shortcut = (DynamicShortcut);
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/keyboard-shortcut-help-modal/index.js
@@ -3650,28 +3848,27 @@ const ShortcutList = ({
* Safari+VoiceOver won't announce the list otherwise.
*/
/* eslint-disable jsx-a11y/no-redundant-roles */
-(0,external_wp_element_namespaceObject.createElement)("ul", {
+(0,external_React_namespaceObject.createElement)("ul", {
className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-list",
role: "list"
-}, shortcuts.map((shortcut, index) => (0,external_wp_element_namespaceObject.createElement)("li", {
+}, shortcuts.map((shortcut, index) => (0,external_React_namespaceObject.createElement)("li", {
className: "edit-widgets-keyboard-shortcut-help-modal__shortcut",
key: index
-}, typeof shortcut === 'string' ? (0,external_wp_element_namespaceObject.createElement)(dynamic_shortcut, {
+}, typeof shortcut === 'string' ? (0,external_React_namespaceObject.createElement)(dynamic_shortcut, {
name: shortcut
-}) : (0,external_wp_element_namespaceObject.createElement)(keyboard_shortcut_help_modal_shortcut, {
+}) : (0,external_React_namespaceObject.createElement)(keyboard_shortcut_help_modal_shortcut, {
...shortcut
}))))
/* eslint-enable jsx-a11y/no-redundant-roles */;
-
const ShortcutSection = ({
title,
shortcuts,
className
-}) => (0,external_wp_element_namespaceObject.createElement)("section", {
+}) => (0,external_React_namespaceObject.createElement)("section", {
className: classnames_default()('edit-widgets-keyboard-shortcut-help-modal__section', className)
-}, !!title && (0,external_wp_element_namespaceObject.createElement)("h2", {
+}, !!title && (0,external_React_namespaceObject.createElement)("h2", {
className: "edit-widgets-keyboard-shortcut-help-modal__section-title"
-}, title), (0,external_wp_element_namespaceObject.createElement)(ShortcutList, {
+}, title), (0,external_React_namespaceObject.createElement)(ShortcutList, {
shortcuts: shortcuts
}));
const ShortcutCategorySection = ({
@@ -3682,7 +3879,7 @@ const ShortcutCategorySection = ({
const categoryShortcuts = (0,external_wp_data_namespaceObject.useSelect)(select => {
return select(external_wp_keyboardShortcuts_namespaceObject.store).getCategoryShortcuts(categoryName);
}, [categoryName]);
- return (0,external_wp_element_namespaceObject.createElement)(ShortcutSection, {
+ return (0,external_React_namespaceObject.createElement)(ShortcutSection, {
title: title,
shortcuts: categoryShortcuts.concat(additionalShortcuts)
});
@@ -3697,20 +3894,20 @@ function KeyboardShortcutHelpModal({
if (!isModalActive) {
return null;
}
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
+ return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
className: "edit-widgets-keyboard-shortcut-help-modal",
title: (0,external_wp_i18n_namespaceObject.__)('Keyboard shortcuts'),
onRequestClose: toggleModal
- }, (0,external_wp_element_namespaceObject.createElement)(ShortcutSection, {
+ }, (0,external_React_namespaceObject.createElement)(ShortcutSection, {
className: "edit-widgets-keyboard-shortcut-help-modal__main-shortcuts",
shortcuts: ['core/edit-widgets/keyboard-shortcuts']
- }), (0,external_wp_element_namespaceObject.createElement)(ShortcutCategorySection, {
+ }), (0,external_React_namespaceObject.createElement)(ShortcutCategorySection, {
title: (0,external_wp_i18n_namespaceObject.__)('Global shortcuts'),
categoryName: "global"
- }), (0,external_wp_element_namespaceObject.createElement)(ShortcutCategorySection, {
+ }), (0,external_React_namespaceObject.createElement)(ShortcutCategorySection, {
title: (0,external_wp_i18n_namespaceObject.__)('Selection shortcuts'),
categoryName: "selection"
- }), (0,external_wp_element_namespaceObject.createElement)(ShortcutCategorySection, {
+ }), (0,external_React_namespaceObject.createElement)(ShortcutCategorySection, {
title: (0,external_wp_i18n_namespaceObject.__)('Block shortcuts'),
categoryName: "block",
additionalShortcuts: [{
@@ -3721,7 +3918,7 @@ function KeyboardShortcutHelpModal({
/* translators: The forward-slash character. e.g. '/'. */
ariaLabel: (0,external_wp_i18n_namespaceObject.__)('Forward-slash')
}]
- }), (0,external_wp_element_namespaceObject.createElement)(ShortcutSection, {
+ }), (0,external_React_namespaceObject.createElement)(ShortcutSection, {
title: (0,external_wp_i18n_namespaceObject.__)('Text formatting'),
shortcuts: textFormattingShortcuts
}));
@@ -3739,10 +3936,10 @@ const {
} = (0,external_wp_components_namespaceObject.createSlotFill)('EditWidgetsToolsMoreMenuGroup');
ToolsMoreMenuGroup.Slot = ({
fillProps
-}) => (0,external_wp_element_namespaceObject.createElement)(Slot, {
+}) => (0,external_React_namespaceObject.createElement)(Slot, {
fillProps: fillProps
}, fills => fills.length > 0 && fills);
-/* harmony default export */ var tools_more_menu_group = (ToolsMoreMenuGroup);
+/* harmony default export */ const tools_more_menu_group = (ToolsMoreMenuGroup);
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/more-menu/index.js
@@ -3769,61 +3966,61 @@ function MoreMenu() {
const toggleKeyboardShortcutsModal = () => setIsKeyboardShortcutsModalVisible(!isKeyboardShortcutsModalActive);
(0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/edit-widgets/keyboard-shortcuts', toggleKeyboardShortcutsModal);
const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium');
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(MoreMenuDropdown, null, onClose => (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, isLargeViewport && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
+ return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(MoreMenuDropdown, null, onClose => (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, isLargeViewport && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
label: (0,external_wp_i18n_namespaceObject._x)('View', 'noun')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, {
+ }, (0,external_React_namespaceObject.createElement)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, {
scope: "core/edit-widgets",
name: "fixedToolbar",
label: (0,external_wp_i18n_namespaceObject.__)('Top toolbar'),
info: (0,external_wp_i18n_namespaceObject.__)('Access all block and document tools in a single place'),
messageActivated: (0,external_wp_i18n_namespaceObject.__)('Top toolbar activated'),
messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Top toolbar deactivated')
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
+ })), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
label: (0,external_wp_i18n_namespaceObject.__)('Tools')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
+ }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
onClick: () => {
setIsKeyboardShortcutsModalVisible(true);
},
shortcut: external_wp_keycodes_namespaceObject.displayShortcut.access('h')
- }, (0,external_wp_i18n_namespaceObject.__)('Keyboard shortcuts')), (0,external_wp_element_namespaceObject.createElement)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, {
+ }, (0,external_wp_i18n_namespaceObject.__)('Keyboard shortcuts')), (0,external_React_namespaceObject.createElement)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, {
scope: "core/edit-widgets",
name: "welcomeGuide",
label: (0,external_wp_i18n_namespaceObject.__)('Welcome Guide')
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
+ }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
role: "menuitem",
icon: library_external,
href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/documentation/article/block-based-widgets-editor/'),
target: "_blank",
rel: "noopener noreferrer"
- }, (0,external_wp_i18n_namespaceObject.__)('Help'), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, {
+ }, (0,external_wp_i18n_namespaceObject.__)('Help'), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, {
as: "span"
}, /* translators: accessibility text */
- (0,external_wp_i18n_namespaceObject.__)('(opens in a new tab)'))), (0,external_wp_element_namespaceObject.createElement)(tools_more_menu_group.Slot, {
+ (0,external_wp_i18n_namespaceObject.__)('(opens in a new tab)'))), (0,external_React_namespaceObject.createElement)(tools_more_menu_group.Slot, {
fillProps: {
onClose
}
- })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
+ })), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
label: (0,external_wp_i18n_namespaceObject.__)('Preferences')
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, {
+ }, (0,external_React_namespaceObject.createElement)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, {
scope: "core/edit-widgets",
name: "keepCaretInsideBlock",
label: (0,external_wp_i18n_namespaceObject.__)('Contain text cursor inside block'),
info: (0,external_wp_i18n_namespaceObject.__)('Aids screen readers by stopping text caret from leaving blocks.'),
messageActivated: (0,external_wp_i18n_namespaceObject.__)('Contain text cursor inside block activated'),
messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Contain text cursor inside block deactivated')
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, {
+ }), (0,external_React_namespaceObject.createElement)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, {
scope: "core/edit-widgets",
name: "themeStyles",
info: (0,external_wp_i18n_namespaceObject.__)('Make the editor look like your theme.'),
label: (0,external_wp_i18n_namespaceObject.__)('Use theme styles')
- }), isLargeViewport && (0,external_wp_element_namespaceObject.createElement)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, {
+ }), isLargeViewport && (0,external_React_namespaceObject.createElement)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, {
scope: "core/edit-widgets",
name: "showBlockBreadcrumbs",
label: (0,external_wp_i18n_namespaceObject.__)('Display block breadcrumbs'),
info: (0,external_wp_i18n_namespaceObject.__)('Shows block breadcrumbs at the bottom of the editor.'),
messageActivated: (0,external_wp_i18n_namespaceObject.__)('Display block breadcrumbs activated'),
messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Display block breadcrumbs deactivated')
- })))), (0,external_wp_element_namespaceObject.createElement)(KeyboardShortcutHelpModal, {
+ })))), (0,external_React_namespaceObject.createElement)(KeyboardShortcutHelpModal, {
isModalActive: isKeyboardShortcutsModalActive,
toggleModal: toggleKeyboardShortcutsModal
}));
@@ -3849,112 +4046,37 @@ function MoreMenu() {
-
-
-
-
-const {
- useShouldContextualToolbarShow
-} = unlock(external_wp_blockEditor_namespaceObject.privateApis);
-function Header({
- setListViewToggleElement
-}) {
- const isMediumViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium');
- const inserterButton = (0,external_wp_element_namespaceObject.useRef)();
- const widgetAreaClientId = use_last_selected_widget_area();
- const isLastSelectedWidgetAreaOpen = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getIsWidgetAreaOpen(widgetAreaClientId), [widgetAreaClientId]);
- const {
- isInserterOpen,
- isListViewOpen
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
- const {
- isInserterOpened,
- isListViewOpened
- } = select(store_store);
- return {
- isInserterOpen: isInserterOpened(),
- isListViewOpen: isListViewOpened()
- };
- }, []);
- const {
- setIsWidgetAreaOpen,
- setIsInserterOpened,
- setIsListViewOpened
- } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
- const {
- selectBlock
- } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
- const handleClick = () => {
- if (isInserterOpen) {
- // Focusing the inserter button closes the inserter popover.
- setIsInserterOpened(false);
- } else {
- if (!isLastSelectedWidgetAreaOpen) {
- // Select the last selected block if hasn't already.
- selectBlock(widgetAreaClientId);
- // Open the last selected widget area when opening the inserter.
- setIsWidgetAreaOpen(widgetAreaClientId, true);
- }
- // The DOM updates resulting from selectBlock() and setIsInserterOpened() calls are applied the
- // same tick and pretty much in a random order. The inserter is closed if any other part of the
- // app receives focus. If selectBlock() happens to take effect after setIsInserterOpened() then
- // the inserter is visible for a brief moment and then gets auto-closed due to focus moving to
- // the selected block.
- window.requestAnimationFrame(() => setIsInserterOpened(true));
- }
- };
- const toggleListView = (0,external_wp_element_namespaceObject.useCallback)(() => setIsListViewOpened(!isListViewOpen), [setIsListViewOpened, isListViewOpen]);
+function Header() {
+ const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium');
+ const blockToolbarRef = (0,external_wp_element_namespaceObject.useRef)();
const {
- shouldShowContextualToolbar,
- canFocusHiddenToolbar,
- fixedToolbarCanBeFocused
- } = useShouldContextualToolbarShow();
- // If there's a block toolbar to be focused, disable the focus shortcut for the document toolbar.
- // There's a fixed block toolbar when the fixed toolbar option is enabled or when the browser width is less than the large viewport.
- const blockToolbarCanBeFocused = shouldShowContextualToolbar || canFocusHiddenToolbar || fixedToolbarCanBeFocused;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", {
+ hasFixedToolbar
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => ({
+ hasFixedToolbar: !!select(external_wp_preferences_namespaceObject.store).get('core/edit-widgets', 'fixedToolbar')
+ }), []);
+ return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)("div", {
className: "edit-widgets-header"
- }, (0,external_wp_element_namespaceObject.createElement)("div", {
+ }, (0,external_React_namespaceObject.createElement)("div", {
className: "edit-widgets-header__navigable-toolbar-wrapper"
- }, isMediumViewport && (0,external_wp_element_namespaceObject.createElement)("h1", {
+ }, isLargeViewport && (0,external_React_namespaceObject.createElement)("h1", {
className: "edit-widgets-header__title"
- }, (0,external_wp_i18n_namespaceObject.__)('Widgets')), !isMediumViewport && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, {
+ }, (0,external_wp_i18n_namespaceObject.__)('Widgets')), !isLargeViewport && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, {
as: "h1",
className: "edit-widgets-header__title"
- }, (0,external_wp_i18n_namespaceObject.__)('Widgets')), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.NavigableToolbar, {
- className: "edit-widgets-header-toolbar",
- "aria-label": (0,external_wp_i18n_namespaceObject.__)('Document tools'),
- shouldUseKeyboardFocusShortcut: !blockToolbarCanBeFocused
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarItem, {
- ref: inserterButton,
- as: external_wp_components_namespaceObject.Button,
- className: "edit-widgets-header-toolbar__inserter-toggle",
- variant: "primary",
- isPressed: isInserterOpen,
- onMouseDown: event => {
- event.preventDefault();
- },
- onClick: handleClick,
- icon: library_plus
- /* translators: button label text should, if possible, be under 16
- characters. */,
- label: (0,external_wp_i18n_namespaceObject._x)('Toggle block inserter', 'Generic label for block inserter button')
- }), isMediumViewport && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(UndoButton, null), (0,external_wp_element_namespaceObject.createElement)(RedoButton, null), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarItem, {
- as: external_wp_components_namespaceObject.Button,
- className: "edit-widgets-header-toolbar__list-view-toggle",
- icon: list_view,
- isPressed: isListViewOpen
- /* translators: button label text should, if possible, be under 16 characters. */,
- label: (0,external_wp_i18n_namespaceObject.__)('List View'),
- onClick: toggleListView,
- ref: setListViewToggleElement
- })))), (0,external_wp_element_namespaceObject.createElement)("div", {
+ }, (0,external_wp_i18n_namespaceObject.__)('Widgets')), (0,external_React_namespaceObject.createElement)(document_tools, null), hasFixedToolbar && isLargeViewport && (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)("div", {
+ className: "selected-block-tools-wrapper"
+ }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockToolbar, {
+ hideDragHandle: true
+ })), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover.Slot, {
+ ref: blockToolbarRef,
+ name: "block-toolbar"
+ }))), (0,external_React_namespaceObject.createElement)("div", {
className: "edit-widgets-header__actions"
- }, (0,external_wp_element_namespaceObject.createElement)(save_button, null), (0,external_wp_element_namespaceObject.createElement)(pinned_items.Slot, {
+ }, (0,external_React_namespaceObject.createElement)(save_button, null), (0,external_React_namespaceObject.createElement)(pinned_items.Slot, {
scope: "core/edit-widgets"
- }), (0,external_wp_element_namespaceObject.createElement)(MoreMenu, null))));
+ }), (0,external_React_namespaceObject.createElement)(MoreMenu, null))));
}
-/* harmony default export */ var header = (Header);
+/* harmony default export */ const header = (Header);
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/notices/index.js
@@ -3964,6 +4086,9 @@ function Header({
+
+// Last three notices. Slices from the tail end of the list.
+const MAX_VISIBLE_NOTICES = -3;
function Notices() {
const {
removeNotice
@@ -3985,21 +4110,21 @@ function Notices() {
}) => !isDismissible && type === 'default');
const snackbarNotices = notices.filter(({
type
- }) => type === 'snackbar');
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.NoticeList, {
+ }) => type === 'snackbar').slice(MAX_VISIBLE_NOTICES);
+ return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.NoticeList, {
notices: nonDismissibleNotices,
className: "edit-widgets-notices__pinned"
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.NoticeList, {
+ }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.NoticeList, {
notices: dismissibleNotices,
className: "edit-widgets-notices__dismissible",
onRemove: removeNotice
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SnackbarList, {
+ }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SnackbarList, {
notices: snackbarNotices,
className: "edit-widgets-notices__snackbar",
onRemove: removeNotice
}));
}
-/* harmony default export */ var notices = (Notices);
+/* harmony default export */ const notices = (Notices);
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/widget-areas-block-editor-content/index.js
@@ -4011,6 +4136,7 @@ function Notices() {
+
/**
* Internal dependencies
*/
@@ -4020,15 +4146,18 @@ function WidgetAreasBlockEditorContent({
blockEditorSettings
}) {
const hasThemeStyles = (0,external_wp_data_namespaceObject.useSelect)(select => !!select(external_wp_preferences_namespaceObject.store).get('core/edit-widgets', 'themeStyles'), []);
+ const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium');
const styles = (0,external_wp_element_namespaceObject.useMemo)(() => {
return hasThemeStyles ? blockEditorSettings.styles : [];
}, [blockEditorSettings, hasThemeStyles]);
- return (0,external_wp_element_namespaceObject.createElement)("div", {
+ return (0,external_React_namespaceObject.createElement)("div", {
className: "edit-widgets-block-editor"
- }, (0,external_wp_element_namespaceObject.createElement)(notices, null), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockTools, null, (0,external_wp_element_namespaceObject.createElement)(keyboard_shortcuts, null), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__unstableEditorStyles, {
+ }, (0,external_React_namespaceObject.createElement)(notices, null), !isLargeViewport && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockToolbar, {
+ hideDragHandle: true
+ }), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockTools, null, (0,external_React_namespaceObject.createElement)(keyboard_shortcuts, null), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__unstableEditorStyles, {
styles: styles,
scope: ".editor-styles-wrapper"
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockSelectionClearer, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.WritingFlow, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockList, {
+ }), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockSelectionClearer, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.WritingFlow, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockList, {
className: "edit-widgets-main-block-list"
})))));
}
@@ -4039,13 +4168,13 @@ function WidgetAreasBlockEditorContent({
* WordPress dependencies
*/
-const close_close = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
+const close_close = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24"
-}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
+}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"
}));
-/* harmony default export */ var library_close = (close_close);
+/* harmony default export */ const library_close = (close_close);
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/hooks/use-widget-library-insertion-point.js
/**
@@ -4101,7 +4230,7 @@ const useWidgetLibraryInsertionPoint = () => {
};
}, [firstRootId]);
};
-/* harmony default export */ var use_widget_library_insertion_point = (useWidgetLibraryInsertionPoint);
+/* harmony default export */ const use_widget_library_insertion_point = (useWidgetLibraryInsertionPoint);
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/secondary-sidebar/inserter-sidebar.js
@@ -4142,19 +4271,19 @@ function InserterSidebar() {
(0,external_wp_element_namespaceObject.useEffect)(() => {
libraryRef.current.focusSearch();
}, []);
- return (0,external_wp_element_namespaceObject.createElement)("div", {
+ return (0,external_React_namespaceObject.createElement)("div", {
ref: inserterDialogRef,
...inserterDialogProps,
className: "edit-widgets-layout__inserter-panel"
- }, (0,external_wp_element_namespaceObject.createElement)(TagName, {
+ }, (0,external_React_namespaceObject.createElement)(TagName, {
className: "edit-widgets-layout__inserter-panel-header"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
+ }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
icon: library_close,
onClick: closeInserter,
label: (0,external_wp_i18n_namespaceObject.__)('Close block inserter')
- })), (0,external_wp_element_namespaceObject.createElement)("div", {
+ })), (0,external_React_namespaceObject.createElement)("div", {
className: "edit-widgets-layout__inserter-panel-content"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalLibrary, {
+ }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalLibrary, {
showInserterHelpPanel: true,
shouldFocusBlock: isMobileViewport,
rootClientId: rootClientId,
@@ -4181,12 +4310,14 @@ function InserterSidebar() {
* Internal dependencies
*/
-function ListViewSidebar({
- listViewToggleElement
-}) {
+
+function ListViewSidebar() {
const {
setIsListViewOpened
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
+ const {
+ getListViewToggleRef
+ } = unlock((0,external_wp_data_namespaceObject.useSelect)(store_store));
// Use internal state instead of a ref to make sure that the component
// re-renders when the dropZoneElement updates.
@@ -4196,8 +4327,8 @@ function ListViewSidebar({
// When closing the list view, focus should return to the toggle button.
const closeListView = (0,external_wp_element_namespaceObject.useCallback)(() => {
setIsListViewOpened(false);
- listViewToggleElement?.focus();
- }, [listViewToggleElement, setIsListViewOpened]);
+ getListViewToggleRef().current?.focus();
+ }, [getListViewToggleRef, setIsListViewOpened]);
const closeOnEscape = (0,external_wp_element_namespaceObject.useCallback)(event => {
if (event.keyCode === external_wp_keycodes_namespaceObject.ESCAPE && !event.defaultPrevented) {
event.preventDefault();
@@ -4206,19 +4337,19 @@ function ListViewSidebar({
}, [closeListView]);
return (
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
- (0,external_wp_element_namespaceObject.createElement)("div", {
+ (0,external_React_namespaceObject.createElement)("div", {
className: "edit-widgets-editor__list-view-panel",
onKeyDown: closeOnEscape
- }, (0,external_wp_element_namespaceObject.createElement)("div", {
+ }, (0,external_React_namespaceObject.createElement)("div", {
className: "edit-widgets-editor__list-view-panel-header"
- }, (0,external_wp_element_namespaceObject.createElement)("strong", null, (0,external_wp_i18n_namespaceObject.__)('List View')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
+ }, (0,external_React_namespaceObject.createElement)("strong", null, (0,external_wp_i18n_namespaceObject.__)('List View')), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
icon: close_small,
label: (0,external_wp_i18n_namespaceObject.__)('Close'),
onClick: closeListView
- })), (0,external_wp_element_namespaceObject.createElement)("div", {
+ })), (0,external_React_namespaceObject.createElement)("div", {
className: "edit-widgets-editor__list-view-panel-content",
ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([focusOnMountRef, setDropZoneElement])
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalListView, {
+ }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalListView, {
dropZoneElement: dropZoneElement
})))
);
@@ -4240,9 +4371,7 @@ function ListViewSidebar({
*/
-function SecondarySidebar({
- listViewToggleElement
-}) {
+function SecondarySidebar() {
const {
isInserterOpen,
isListViewOpen
@@ -4257,12 +4386,10 @@ function SecondarySidebar({
};
}, []);
if (isInserterOpen) {
- return (0,external_wp_element_namespaceObject.createElement)(InserterSidebar, null);
+ return (0,external_React_namespaceObject.createElement)(InserterSidebar, null);
}
if (isListViewOpen) {
- return (0,external_wp_element_namespaceObject.createElement)(ListViewSidebar, {
- listViewToggleElement: listViewToggleElement
- });
+ return (0,external_React_namespaceObject.createElement)(ListViewSidebar, null);
}
return null;
}
@@ -4323,7 +4450,6 @@ function Interface({
previousShortcut: select(external_wp_keyboardShortcuts_namespaceObject.store).getAllShortcutKeyCombinations('core/edit-widgets/previous-region'),
nextShortcut: select(external_wp_keyboardShortcuts_namespaceObject.store).getAllShortcutKeyCombinations('core/edit-widgets/next-region')
}), []);
- const [listViewToggleElement, setListViewToggleElement] = (0,external_wp_element_namespaceObject.useState)(null);
// Inserter and Sidebars are mutually exclusive
(0,external_wp_element_namespaceObject.useEffect)(() => {
@@ -4339,26 +4465,22 @@ function Interface({
}, [isInserterOpened, isListViewOpened, isHugeViewport]);
const secondarySidebarLabel = isListViewOpened ? (0,external_wp_i18n_namespaceObject.__)('List View') : (0,external_wp_i18n_namespaceObject.__)('Block Library');
const hasSecondarySidebar = isListViewOpened || isInserterOpened;
- return (0,external_wp_element_namespaceObject.createElement)(interface_skeleton, {
+ return (0,external_React_namespaceObject.createElement)(interface_skeleton, {
labels: {
...interfaceLabels,
secondarySidebar: secondarySidebarLabel
},
- header: (0,external_wp_element_namespaceObject.createElement)(header, {
- setListViewToggleElement: setListViewToggleElement
- }),
- secondarySidebar: hasSecondarySidebar && (0,external_wp_element_namespaceObject.createElement)(SecondarySidebar, {
- listViewToggleElement: listViewToggleElement
- }),
- sidebar: hasSidebarEnabled && (0,external_wp_element_namespaceObject.createElement)(complementary_area.Slot, {
+ header: (0,external_React_namespaceObject.createElement)(header, null),
+ secondarySidebar: hasSecondarySidebar && (0,external_React_namespaceObject.createElement)(SecondarySidebar, null),
+ sidebar: hasSidebarEnabled && (0,external_React_namespaceObject.createElement)(complementary_area.Slot, {
scope: "core/edit-widgets"
}),
- content: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(WidgetAreasBlockEditorContent, {
+ content: (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(WidgetAreasBlockEditorContent, {
blockEditorSettings: blockEditorSettings
})),
- footer: hasBlockBreadCrumbsEnabled && !isMobileViewport && (0,external_wp_element_namespaceObject.createElement)("div", {
+ footer: hasBlockBreadCrumbsEnabled && !isMobileViewport && (0,external_React_namespaceObject.createElement)("div", {
className: "edit-widgets-layout__footer"
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockBreadcrumb, {
+ }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockBreadcrumb, {
rootLabelText: (0,external_wp_i18n_namespaceObject.__)('Widgets')
})),
shortcuts: {
@@ -4367,7 +4489,7 @@ function Interface({
}
});
}
-/* harmony default export */ var layout_interface = (Interface);
+/* harmony default export */ const layout_interface = (Interface);
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/layout/unsaved-changes-warning.js
/**
@@ -4388,7 +4510,7 @@ function Interface({
* This is a duplicate of the component implemented in the editor package.
* Duplicated here as edit-widgets doesn't depend on editor.
*
- * @return {WPComponent} The component.
+ * @return {Component} The component.
*/
function UnsavedChangesWarning() {
const isDirty = (0,external_wp_data_namespaceObject.useSelect)(select => {
@@ -4449,65 +4571,65 @@ function WelcomeGuide() {
}
const isEntirelyBlockWidgets = widgetAreas?.every(widgetArea => widgetArea.id === 'wp_inactive_widgets' || widgetArea.widgets.every(widgetId => widgetId.startsWith('block-')));
const numWidgetAreas = (_widgetAreas$filter$l = widgetAreas?.filter(widgetArea => widgetArea.id !== 'wp_inactive_widgets').length) !== null && _widgetAreas$filter$l !== void 0 ? _widgetAreas$filter$l : 0;
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Guide, {
+ return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Guide, {
className: "edit-widgets-welcome-guide",
contentLabel: (0,external_wp_i18n_namespaceObject.__)('Welcome to block Widgets'),
finishButtonText: (0,external_wp_i18n_namespaceObject.__)('Get started'),
onFinish: () => toggle('core/edit-widgets', 'welcomeGuide'),
pages: [{
- image: (0,external_wp_element_namespaceObject.createElement)(WelcomeGuideImage, {
+ image: (0,external_React_namespaceObject.createElement)(WelcomeGuideImage, {
nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.svg",
animatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.gif"
}),
- content: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("h1", {
+ content: (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)("h1", {
className: "edit-widgets-welcome-guide__heading"
- }, (0,external_wp_i18n_namespaceObject.__)('Welcome to block Widgets')), isEntirelyBlockWidgets ? (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("p", {
+ }, (0,external_wp_i18n_namespaceObject.__)('Welcome to block Widgets')), isEntirelyBlockWidgets ? (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)("p", {
className: "edit-widgets-welcome-guide__text"
}, (0,external_wp_i18n_namespaceObject.sprintf)(
// Translators: %s: Number of block areas in the current theme.
- (0,external_wp_i18n_namespaceObject._n)('Your theme provides %s “block” area for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.', 'Your theme provides %s different “block” areas for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.', numWidgetAreas), numWidgetAreas))) : (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("p", {
+ (0,external_wp_i18n_namespaceObject._n)('Your theme provides %s “block” area for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.', 'Your theme provides %s different “block” areas for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.', numWidgetAreas), numWidgetAreas))) : (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)("p", {
className: "edit-widgets-welcome-guide__text"
- }, (0,external_wp_i18n_namespaceObject.__)('You can now add any block to your site’s widget areas. Don’t worry, all of your favorite widgets still work flawlessly.')), (0,external_wp_element_namespaceObject.createElement)("p", {
+ }, (0,external_wp_i18n_namespaceObject.__)('You can now add any block to your site’s widget areas. Don’t worry, all of your favorite widgets still work flawlessly.')), (0,external_React_namespaceObject.createElement)("p", {
className: "edit-widgets-welcome-guide__text"
- }, (0,external_wp_element_namespaceObject.createElement)("strong", null, (0,external_wp_i18n_namespaceObject.__)('Want to stick with the old widgets?')), ' ', (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, {
+ }, (0,external_React_namespaceObject.createElement)("strong", null, (0,external_wp_i18n_namespaceObject.__)('Want to stick with the old widgets?')), ' ', (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, {
href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/plugins/classic-widgets/')
}, (0,external_wp_i18n_namespaceObject.__)('Get the Classic Widgets plugin.')))))
}, {
- image: (0,external_wp_element_namespaceObject.createElement)(WelcomeGuideImage, {
+ image: (0,external_React_namespaceObject.createElement)(WelcomeGuideImage, {
nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-editor.svg",
animatedSrc: "https://s.w.org/images/block-editor/welcome-editor.gif"
}),
- content: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("h1", {
+ content: (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)("h1", {
className: "edit-widgets-welcome-guide__heading"
- }, (0,external_wp_i18n_namespaceObject.__)('Make each block your own')), (0,external_wp_element_namespaceObject.createElement)("p", {
+ }, (0,external_wp_i18n_namespaceObject.__)('Make each block your own')), (0,external_React_namespaceObject.createElement)("p", {
className: "edit-widgets-welcome-guide__text"
}, (0,external_wp_i18n_namespaceObject.__)('Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.')))
}, {
- image: (0,external_wp_element_namespaceObject.createElement)(WelcomeGuideImage, {
+ image: (0,external_React_namespaceObject.createElement)(WelcomeGuideImage, {
nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-library.svg",
animatedSrc: "https://s.w.org/images/block-editor/welcome-library.gif"
}),
- content: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("h1", {
+ content: (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)("h1", {
className: "edit-widgets-welcome-guide__heading"
- }, (0,external_wp_i18n_namespaceObject.__)('Get to know the block library')), (0,external_wp_element_namespaceObject.createElement)("p", {
+ }, (0,external_wp_i18n_namespaceObject.__)('Get to know the block library')), (0,external_React_namespaceObject.createElement)("p", {
className: "edit-widgets-welcome-guide__text"
}, (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('All of the blocks available to you live in the block library. You’ll find it wherever you see the <InserterIconImage /> icon.'), {
- InserterIconImage: (0,external_wp_element_namespaceObject.createElement)("img", {
+ InserterIconImage: (0,external_React_namespaceObject.createElement)("img", {
className: "edit-widgets-welcome-guide__inserter-icon",
alt: (0,external_wp_i18n_namespaceObject.__)('inserter'),
src: "data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A"
})
})))
}, {
- image: (0,external_wp_element_namespaceObject.createElement)(WelcomeGuideImage, {
+ image: (0,external_React_namespaceObject.createElement)(WelcomeGuideImage, {
nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.svg",
animatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.gif"
}),
- content: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("h1", {
+ content: (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)("h1", {
className: "edit-widgets-welcome-guide__heading"
- }, (0,external_wp_i18n_namespaceObject.__)('Learn how to use the block editor')), (0,external_wp_element_namespaceObject.createElement)("p", {
+ }, (0,external_wp_i18n_namespaceObject.__)('Learn how to use the block editor')), (0,external_React_namespaceObject.createElement)("p", {
className: "edit-widgets-welcome-guide__text"
- }, (0,external_wp_i18n_namespaceObject.__)('New to the block editor? Want to learn more about using it? '), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, {
+ }, (0,external_wp_i18n_namespaceObject.__)('New to the block editor? Want to learn more about using it? '), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, {
href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/documentation/article/wordpress-block-editor/')
}, (0,external_wp_i18n_namespaceObject.__)("Here's a detailed guide."))))
}]
@@ -4517,12 +4639,12 @@ function WelcomeGuideImage({
nonAnimatedSrc,
animatedSrc
}) {
- return (0,external_wp_element_namespaceObject.createElement)("picture", {
+ return (0,external_React_namespaceObject.createElement)("picture", {
className: "edit-widgets-welcome-guide__image"
- }, (0,external_wp_element_namespaceObject.createElement)("source", {
+ }, (0,external_React_namespaceObject.createElement)("source", {
srcSet: nonAnimatedSrc,
media: "(prefers-reduced-motion: reduce)"
- }), (0,external_wp_element_namespaceObject.createElement)("img", {
+ }), (0,external_React_namespaceObject.createElement)("img", {
src: animatedSrc,
width: "312",
height: "240",
@@ -4559,15 +4681,15 @@ function Layout({
createErrorNotice((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: plugin name */
(0,external_wp_i18n_namespaceObject.__)('The "%s" plugin has encountered an error and cannot be rendered.'), name));
}
- return (0,external_wp_element_namespaceObject.createElement)(ErrorBoundary, null, (0,external_wp_element_namespaceObject.createElement)(WidgetAreasBlockEditorProvider, {
+ return (0,external_React_namespaceObject.createElement)(ErrorBoundary, null, (0,external_React_namespaceObject.createElement)(WidgetAreasBlockEditorProvider, {
blockEditorSettings: blockEditorSettings
- }, (0,external_wp_element_namespaceObject.createElement)(layout_interface, {
+ }, (0,external_React_namespaceObject.createElement)(layout_interface, {
blockEditorSettings: blockEditorSettings
- }), (0,external_wp_element_namespaceObject.createElement)(Sidebar, null), (0,external_wp_element_namespaceObject.createElement)(external_wp_plugins_namespaceObject.PluginArea, {
+ }), (0,external_React_namespaceObject.createElement)(Sidebar, null), (0,external_React_namespaceObject.createElement)(external_wp_plugins_namespaceObject.PluginArea, {
onError: onPluginAreaError
- }), (0,external_wp_element_namespaceObject.createElement)(UnsavedChangesWarning, null), (0,external_wp_element_namespaceObject.createElement)(WelcomeGuide, null)));
+ }), (0,external_React_namespaceObject.createElement)(UnsavedChangesWarning, null), (0,external_React_namespaceObject.createElement)(WelcomeGuide, null)));
}
-/* harmony default export */ var layout = (Layout);
+/* harmony default export */ const layout = (Layout);
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/index.js
@@ -4625,7 +4747,7 @@ function initializeEditor(id, settings) {
// do this will result in errors in the default block parser.
// see: https://github.com/WordPress/gutenberg/issues/33097
(0,external_wp_blocks_namespaceObject.setFreeformContentHandlerName)('core/html');
- root.render((0,external_wp_element_namespaceObject.createElement)(layout, {
+ root.render((0,external_React_namespaceObject.createElement)(layout, {
blockEditorSettings: settings
}));
return root;
@@ -4665,7 +4787,8 @@ const registerBlock = block => {
};
-}();
+})();
+
(window.wp = window.wp || {}).editWidgets = __webpack_exports__;
/******/ })()
; \ No newline at end of file