PluginProbe
Gutenberg / 14.5.2
Gutenberg v14.5.2
24.0.0 23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 12.6.0 All 403 releases
← All changes | build/edit-widgets/index.js +614 -734 12.6.0 → 14.5.2 View file →
@@ -1,9 +1,9 @@
1 -/******/ (function() { // webpackBootstrap
1 +/******/ (() => { // webpackBootstrap
2 2 /******/ var __webpack_modules__ = ({
3 3
4 -/***/ 4184:
5 -/***/ (function(module, exports) {
4 +/***/ 4403:
5 +/***/ ((module, exports) => {
6 6
7 7 var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
8 8 Copyright (c) 2018 Jed Watson.
9 9 Licensed under the MIT License (MIT), see
@@ -92,23 +92,23 @@
92 92 /******/ }
93 93 /******/
94 94 /************************************************************************/
95 95 /******/ /* webpack/runtime/compat get default export */
96 -/******/ !function() {
96 +/******/ (() => {
97 97 /******/ // getDefaultExport function for compatibility with non-harmony modules
98 -/******/ __webpack_require__.n = function(module) {
98 +/******/ __webpack_require__.n = (module) => {
99 99 /******/ var getter = module && module.__esModule ?
100 -/******/ function() { return module['default']; } :
101 -/******/ function() { return module; };
100 +/******/ () => (module['default']) :
101 +/******/ () => (module);
102 102 /******/ __webpack_require__.d(getter, { a: getter });
103 103 /******/ return getter;
104 104 /******/ };
105 -/******/ }();
105 +/******/ })();
106 106 /******/
107 107 /******/ /* webpack/runtime/define property getters */
108 -/******/ !function() {
108 +/******/ (() => {
109 109 /******/ // define getter functions for harmony exports
110 -/******/ __webpack_require__.d = function(exports, definition) {
110 +/******/ __webpack_require__.d = (exports, definition) => {
111 111 /******/ for(var key in definition) {
112 112 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
113 113 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
114 114 /******/ }
@@ -113,30 +113,30 @@
113 113 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
114 114 /******/ }
115 115 /******/ }
116 116 /******/ };
117 -/******/ }();
117 +/******/ })();
118 118 /******/
119 119 /******/ /* webpack/runtime/hasOwnProperty shorthand */
120 -/******/ !function() {
121 -/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
122 -/******/ }();
120 +/******/ (() => {
121 +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
122 +/******/ })();
123 123 /******/
124 124 /******/ /* webpack/runtime/make namespace object */
125 -/******/ !function() {
125 +/******/ (() => {
126 126 /******/ // define __esModule on exports
127 -/******/ __webpack_require__.r = function(exports) {
127 +/******/ __webpack_require__.r = (exports) => {
128 128 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
129 129 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
130 130 /******/ }
131 131 /******/ Object.defineProperty(exports, '__esModule', { value: true });
132 132 /******/ };
133 -/******/ }();
133 +/******/ })();
134 134 /******/
135 135 /************************************************************************/
136 136 var __webpack_exports__ = {};
137 137 // This entry need to be wrapped in an IIFE because it need to be in strict mode.
138 -!function() {
138 +(() => {
139 139 "use strict";
140 140 // ESM COMPAT FLAG
141 141 __webpack_require__.r(__webpack_exports__);
142 142
@@ -141,10 +141,10 @@
141 141 __webpack_require__.r(__webpack_exports__);
142 142
143 143 // EXPORTS
144 144 __webpack_require__.d(__webpack_exports__, {
145 - "initialize": function() { return /* binding */ initialize; },
146 - "reinitializeEditor": function() { return /* binding */ reinitializeEditor; }
145 + "initialize": () => (/* binding */ initialize),
146 + "reinitializeEditor": () => (/* binding */ reinitializeEditor)
147 147 });
148 148
149 149 // NAMESPACE OBJECT: ./packages/interface/build-module/store/actions.js
150 150 var actions_namespaceObject = {};
@@ -149,15 +149,16 @@
149 149 // NAMESPACE OBJECT: ./packages/interface/build-module/store/actions.js
150 150 var actions_namespaceObject = {};
151 151 __webpack_require__.r(actions_namespaceObject);
152 152 __webpack_require__.d(actions_namespaceObject, {
153 - "disableComplementaryArea": function() { return disableComplementaryArea; },
154 - "enableComplementaryArea": function() { return enableComplementaryArea; },
155 - "pinItem": function() { return pinItem; },
156 - "setFeatureDefaults": function() { return setFeatureDefaults; },
157 - "setFeatureValue": function() { return setFeatureValue; },
158 - "toggleFeature": function() { return toggleFeature; },
159 - "unpinItem": function() { return unpinItem; }
153 + "disableComplementaryArea": () => (disableComplementaryArea),
154 + "enableComplementaryArea": () => (enableComplementaryArea),
155 + "pinItem": () => (pinItem),
156 + "setDefaultComplementaryArea": () => (setDefaultComplementaryArea),
157 + "setFeatureDefaults": () => (setFeatureDefaults),
158 + "setFeatureValue": () => (setFeatureValue),
159 + "toggleFeature": () => (toggleFeature),
160 + "unpinItem": () => (unpinItem)
160 161 });
161 162
162 163 // NAMESPACE OBJECT: ./packages/interface/build-module/store/selectors.js
163 164 var selectors_namespaceObject = {};
@@ -162,11 +163,11 @@
162 163 // NAMESPACE OBJECT: ./packages/interface/build-module/store/selectors.js
163 164 var selectors_namespaceObject = {};
164 165 __webpack_require__.r(selectors_namespaceObject);
165 166 __webpack_require__.d(selectors_namespaceObject, {
166 - "getActiveComplementaryArea": function() { return getActiveComplementaryArea; },
167 - "isFeatureActive": function() { return isFeatureActive; },
168 - "isItemPinned": function() { return isItemPinned; }
167 + "getActiveComplementaryArea": () => (getActiveComplementaryArea),
168 + "isFeatureActive": () => (isFeatureActive),
169 + "isItemPinned": () => (isItemPinned)
169 170 });
170 171
171 172 // NAMESPACE OBJECT: ./packages/edit-widgets/build-module/store/actions.js
172 173 var store_actions_namespaceObject = {};
@@ -171,19 +172,19 @@
171 172 // NAMESPACE OBJECT: ./packages/edit-widgets/build-module/store/actions.js
172 173 var store_actions_namespaceObject = {};
173 174 __webpack_require__.r(store_actions_namespaceObject);
174 175 __webpack_require__.d(store_actions_namespaceObject, {
175 - "closeGeneralSidebar": function() { return closeGeneralSidebar; },
176 - "moveBlockToWidgetArea": function() { return moveBlockToWidgetArea; },
177 - "persistStubPost": function() { return persistStubPost; },
178 - "saveEditedWidgetAreas": function() { return saveEditedWidgetAreas; },
179 - "saveWidgetArea": function() { return saveWidgetArea; },
180 - "saveWidgetAreas": function() { return saveWidgetAreas; },
181 - "setIsInserterOpened": function() { return setIsInserterOpened; },
182 - "setIsListViewOpened": function() { return setIsListViewOpened; },
183 - "setIsWidgetAreaOpen": function() { return setIsWidgetAreaOpen; },
184 - "setWidgetAreasOpenState": function() { return setWidgetAreasOpenState; },
185 - "setWidgetIdForClientId": function() { return setWidgetIdForClientId; }
176 + "closeGeneralSidebar": () => (closeGeneralSidebar),
177 + "moveBlockToWidgetArea": () => (moveBlockToWidgetArea),
178 + "persistStubPost": () => (persistStubPost),
179 + "saveEditedWidgetAreas": () => (saveEditedWidgetAreas),
180 + "saveWidgetArea": () => (saveWidgetArea),
181 + "saveWidgetAreas": () => (saveWidgetAreas),
182 + "setIsInserterOpened": () => (setIsInserterOpened),
183 + "setIsListViewOpened": () => (setIsListViewOpened),
184 + "setIsWidgetAreaOpen": () => (setIsWidgetAreaOpen),
185 + "setWidgetAreasOpenState": () => (setWidgetAreasOpenState),
186 + "setWidgetIdForClientId": () => (setWidgetIdForClientId)
186 187 });
187 188
188 189 // NAMESPACE OBJECT: ./packages/edit-widgets/build-module/store/resolvers.js
189 190 var resolvers_namespaceObject = {};
@@ -188,10 +189,10 @@
188 189 // NAMESPACE OBJECT: ./packages/edit-widgets/build-module/store/resolvers.js
189 190 var resolvers_namespaceObject = {};
190 191 __webpack_require__.r(resolvers_namespaceObject);
191 192 __webpack_require__.d(resolvers_namespaceObject, {
192 - "getWidgetAreas": function() { return getWidgetAreas; },
193 - "getWidgets": function() { return getWidgets; }
193 + "getWidgetAreas": () => (getWidgetAreas),
194 + "getWidgets": () => (getWidgets)
194 195 });
195 196
196 197 // NAMESPACE OBJECT: ./packages/edit-widgets/build-module/store/selectors.js
197 198 var store_selectors_namespaceObject = {};
@@ -196,21 +197,21 @@
196 197 // NAMESPACE OBJECT: ./packages/edit-widgets/build-module/store/selectors.js
197 198 var store_selectors_namespaceObject = {};
198 199 __webpack_require__.r(store_selectors_namespaceObject);
199 200 __webpack_require__.d(store_selectors_namespaceObject, {
200 - "__experimentalGetInsertionPoint": function() { return __experimentalGetInsertionPoint; },
201 - "canInsertBlockInWidgetArea": function() { return canInsertBlockInWidgetArea; },
202 - "getEditedWidgetAreas": function() { return getEditedWidgetAreas; },
203 - "getIsWidgetAreaOpen": function() { return getIsWidgetAreaOpen; },
204 - "getParentWidgetAreaBlock": function() { return getParentWidgetAreaBlock; },
205 - "getReferenceWidgetBlocks": function() { return getReferenceWidgetBlocks; },
206 - "getWidget": function() { return getWidget; },
207 - "getWidgetAreaForWidgetId": function() { return getWidgetAreaForWidgetId; },
208 - "getWidgetAreas": function() { return selectors_getWidgetAreas; },
209 - "getWidgets": function() { return selectors_getWidgets; },
210 - "isInserterOpened": function() { return isInserterOpened; },
211 - "isListViewOpened": function() { return isListViewOpened; },
212 - "isSavingWidgetAreas": function() { return isSavingWidgetAreas; }
201 + "__experimentalGetInsertionPoint": () => (__experimentalGetInsertionPoint),
202 + "canInsertBlockInWidgetArea": () => (canInsertBlockInWidgetArea),
203 + "getEditedWidgetAreas": () => (getEditedWidgetAreas),
204 + "getIsWidgetAreaOpen": () => (getIsWidgetAreaOpen),
205 + "getParentWidgetAreaBlock": () => (getParentWidgetAreaBlock),
206 + "getReferenceWidgetBlocks": () => (getReferenceWidgetBlocks),
207 + "getWidget": () => (getWidget),
208 + "getWidgetAreaForWidgetId": () => (getWidgetAreaForWidgetId),
209 + "getWidgetAreas": () => (selectors_getWidgetAreas),
210 + "getWidgets": () => (selectors_getWidgets),
211 + "isInserterOpened": () => (isInserterOpened),
212 + "isListViewOpened": () => (isListViewOpened),
213 + "isSavingWidgetAreas": () => (isSavingWidgetAreas)
213 214 });
214 215
215 216 // NAMESPACE OBJECT: ./packages/edit-widgets/build-module/blocks/widget-area/index.js
216 217 var widget_area_namespaceObject = {};
@@ -215,25 +216,132 @@
215 216 // NAMESPACE OBJECT: ./packages/edit-widgets/build-module/blocks/widget-area/index.js
216 217 var widget_area_namespaceObject = {};
217 218 __webpack_require__.r(widget_area_namespaceObject);
218 219 __webpack_require__.d(widget_area_namespaceObject, {
219 - "metadata": function() { return metadata; },
220 - "name": function() { return widget_area_name; },
221 - "settings": function() { return settings; }
220 + "metadata": () => (metadata),
221 + "name": () => (widget_area_name),
222 + "settings": () => (settings)
222 223 });
223 224
224 225 ;// CONCATENATED MODULE: external ["wp","element"]
225 -var external_wp_element_namespaceObject = window["wp"]["element"];
226 +const external_wp_element_namespaceObject = window["wp"]["element"];
226 227 ;// CONCATENATED MODULE: external ["wp","blocks"]
227 -var external_wp_blocks_namespaceObject = window["wp"]["blocks"];
228 +const external_wp_blocks_namespaceObject = window["wp"]["blocks"];
228 229 ;// CONCATENATED MODULE: external ["wp","data"]
229 -var external_wp_data_namespaceObject = window["wp"]["data"];
230 +const external_wp_data_namespaceObject = window["wp"]["data"];
230 231 ;// CONCATENATED MODULE: external ["wp","blockLibrary"]
231 -var external_wp_blockLibrary_namespaceObject = window["wp"]["blockLibrary"];
232 +const external_wp_blockLibrary_namespaceObject = window["wp"]["blockLibrary"];
232 233 ;// CONCATENATED MODULE: external ["wp","coreData"]
233 -var external_wp_coreData_namespaceObject = window["wp"]["coreData"];
234 +const external_wp_coreData_namespaceObject = window["wp"]["coreData"];
234 235 ;// CONCATENATED MODULE: external ["wp","widgets"]
235 -var external_wp_widgets_namespaceObject = window["wp"]["widgets"];
236 +const external_wp_widgets_namespaceObject = window["wp"]["widgets"];
237 +;// CONCATENATED MODULE: external ["wp","preferences"]
238 +const external_wp_preferences_namespaceObject = window["wp"]["preferences"];
239 +;// CONCATENATED MODULE: external ["wp","apiFetch"]
240 +const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
241 +var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject);
242 +;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/store/reducer.js
243 +/**
244 + * WordPress dependencies
245 + */
246 +
247 +/**
248 + * Controls the open state of the widget areas.
249 + *
250 + * @param {Object} state Redux state.
251 + * @param {Object} action Redux action.
252 + *
253 + * @return {Array} Updated state.
254 + */
255 +
256 +function widgetAreasOpenState() {
257 + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
258 + let action = arguments.length > 1 ? arguments[1] : undefined;
259 + const {
260 + type
261 + } = action;
262 +
263 + switch (type) {
264 + case 'SET_WIDGET_AREAS_OPEN_STATE':
265 + {
266 + return action.widgetAreasOpenState;
267 + }
268 +
269 + case 'SET_IS_WIDGET_AREA_OPEN':
270 + {
271 + const {
272 + clientId,
273 + isOpen
274 + } = action;
275 + return { ...state,
276 + [clientId]: isOpen
277 + };
278 + }
279 +
280 + default:
281 + {
282 + return state;
283 + }
284 + }
285 +}
286 +/**
287 + * Reducer to set the block inserter panel open or closed.
288 + *
289 + * Note: this reducer interacts with the list view panel reducer
290 + * to make sure that only one of the two panels is open at the same time.
291 + *
292 + * @param {Object} state Current state.
293 + * @param {Object} action Dispatched action.
294 + */
295 +
296 +function blockInserterPanel() {
297 + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
298 + let action = arguments.length > 1 ? arguments[1] : undefined;
299 +
300 + switch (action.type) {
301 + case 'SET_IS_LIST_VIEW_OPENED':
302 + return action.isOpen ? false : state;
303 +
304 + case 'SET_IS_INSERTER_OPENED':
305 + return action.value;
306 + }
307 +
308 + return state;
309 +}
310 +/**
311 + * Reducer to set the list view panel open or closed.
312 + *
313 + * Note: this reducer interacts with the inserter panel reducer
314 + * to make sure that only one of the two panels is open at the same time.
315 + *
316 + * @param {Object} state Current state.
317 + * @param {Object} action Dispatched action.
318 + */
319 +
320 +function listViewPanel() {
321 + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
322 + let action = arguments.length > 1 ? arguments[1] : undefined;
323 +
324 + switch (action.type) {
325 + case 'SET_IS_INSERTER_OPENED':
326 + return action.value ? false : state;
327 +
328 + case 'SET_IS_LIST_VIEW_OPENED':
329 + return action.isOpen;
330 + }
331 +
332 + return state;
333 +}
334 +/* harmony default export */ const reducer = ((0,external_wp_data_namespaceObject.combineReducers)({
335 + blockInserterPanel,
336 + listViewPanel,
337 + widgetAreasOpenState
338 +}));
339 +
340 +;// CONCATENATED MODULE: external ["wp","i18n"]
341 +const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
342 +;// CONCATENATED MODULE: external ["wp","notices"]
343 +const external_wp_notices_namespaceObject = window["wp"]["notices"];
236 344 ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
237 345 function _extends() {
238 346 _extends = Object.assign || function (target) {
239 347 for (var i = 1; i < arguments.length; i++) {
@@ -251,16 +359,14 @@
251 359
252 360 return _extends.apply(this, arguments);
253 361 }
254 362 // EXTERNAL MODULE: ./node_modules/classnames/index.js
255 -var classnames = __webpack_require__(4184);
363 +var classnames = __webpack_require__(4403);
256 364 var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
257 365 ;// CONCATENATED MODULE: external ["wp","components"]
258 -var external_wp_components_namespaceObject = window["wp"]["components"];
259 -;// CONCATENATED MODULE: external ["wp","i18n"]
260 -var external_wp_i18n_namespaceObject = window["wp"]["i18n"];
366 +const external_wp_components_namespaceObject = window["wp"]["components"];
261 367 ;// CONCATENATED MODULE: external ["wp","primitives"]
262 -var external_wp_primitives_namespaceObject = window["wp"]["primitives"];
368 +const external_wp_primitives_namespaceObject = window["wp"]["primitives"];
263 369 ;// CONCATENATED MODULE: ./packages/icons/build-module/library/check.js
264 370
265 371
266 372 /**
@@ -272,10 +378,10 @@
272 378 viewBox: "0 0 24 24"
273 379 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
274 380 d: "M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"
275 381 }));
276 -/* harmony default export */ var library_check = (check);
277 -//# sourceMappingURL=check.js.map
382 +/* harmony default export */ const library_check = (check);
383 +
278 384 ;// CONCATENATED MODULE: ./packages/icons/build-module/library/star-filled.js
279 385
280 386
281 387 /**
@@ -287,10 +393,10 @@
287 393 viewBox: "0 0 24 24"
288 394 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
289 395 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"
290 396 }));
291 -/* harmony default export */ var star_filled = (starFilled);
292 -//# sourceMappingURL=star-filled.js.map
397 +/* harmony default export */ const star_filled = (starFilled);
398 +
293 399 ;// CONCATENATED MODULE: ./packages/icons/build-module/library/star-empty.js
294 400
295 401
296 402 /**
@@ -304,12 +410,12 @@
304 410 fillRule: "evenodd",
305 411 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",
306 412 clipRule: "evenodd"
307 413 }));
308 -/* harmony default export */ var star_empty = (starEmpty);
309 -//# sourceMappingURL=star-empty.js.map
414 +/* harmony default export */ const star_empty = (starEmpty);
415 +
310 416 ;// CONCATENATED MODULE: external ["wp","viewport"]
311 -var external_wp_viewport_namespaceObject = window["wp"]["viewport"];
417 +const external_wp_viewport_namespaceObject = window["wp"]["viewport"];
312 418 ;// CONCATENATED MODULE: ./packages/icons/build-module/library/close-small.js
313 419
314 420
315 421 /**
@@ -321,17 +427,14 @@
321 427 viewBox: "0 0 24 24"
322 428 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
323 429 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"
324 430 }));
325 -/* harmony default export */ var close_small = (closeSmall);
326 -//# sourceMappingURL=close-small.js.map
327 -;// CONCATENATED MODULE: external "lodash"
328 -var external_lodash_namespaceObject = window["lodash"];
329 -;// CONCATENATED MODULE: ./packages/interface/build-module/store/reducer.js
330 -/**
331 - * External dependencies
332 - */
431 +/* harmony default export */ const close_small = (closeSmall);
333 432
433 +;// CONCATENATED MODULE: external ["wp","deprecated"]
434 +const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
435 +var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
436 +;// CONCATENATED MODULE: ./packages/interface/build-module/store/actions.js
334 437 /**
335 438 * WordPress dependencies
336 439 */
337 440
@@ -336,238 +439,118 @@
336 439 */
337 440
338 441
339 442 /**
340 - * Reducer to keep tract of the active area per scope.
443 + * Set a default complementary area.
341 444 *
342 - * @param {boolean} state Previous state.
343 - * @param {Object} action Action object.
344 - * @param {string} action.type Action type.
345 - * @param {string} action.itemType Type of item.
346 - * @param {string} action.scope Item scope.
347 - * @param {string} action.item Item name.
445 + * @param {string} scope Complementary area scope.
446 + * @param {string} area Area identifier.
348 447 *
349 - * @return {Object} Updated state.
448 + * @return {Object} Action object.
350 449 */
351 450
352 -function singleEnableItems() {
353 - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
354 - let {
355 - type,
356 - itemType,
357 - scope,
358 - item
359 - } = arguments.length > 1 ? arguments[1] : undefined;
360 -
361 - if (type !== 'SET_SINGLE_ENABLE_ITEM' || !itemType || !scope) {
362 - return state;
363 - }
364 -
365 - return { ...state,
366 - [itemType]: { ...state[itemType],
367 - [scope]: item || null
368 - }
369 - };
370 -}
451 +const setDefaultComplementaryArea = (scope, area) => ({
452 + type: 'SET_DEFAULT_COMPLEMENTARY_AREA',
453 + scope,
454 + area
455 +});
371 456 /**
372 - * Reducer keeping track of the "pinned" items per scope.
457 + * Enable the complementary area.
373 458 *
374 - * @param {boolean} state Previous state.
375 - * @param {Object} action Action object.
376 - * @param {string} action.type Action type.
377 - * @param {string} action.itemType Type of item.
378 - * @param {string} action.scope Item scope.
379 - * @param {string} action.item Item name.
380 - * @param {boolean} action.isEnable Whether the item is pinned.
381 - *
382 - * @return {Object} Updated state.
459 + * @param {string} scope Complementary area scope.
460 + * @param {string} area Area identifier.
383 461 */
384 462
385 -function multipleEnableItems() {
386 - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
463 +const enableComplementaryArea = (scope, area) => _ref => {
387 464 let {
388 - type,
389 - itemType,
390 - scope,
391 - item,
392 - isEnable
393 - } = arguments.length > 1 ? arguments[1] : undefined;
465 + registry,
466 + dispatch
467 + } = _ref;
394 468
395 - if (type !== 'SET_MULTIPLE_ENABLE_ITEM' || !itemType || !scope || !item || (0,external_lodash_namespaceObject.get)(state, [itemType, scope, item]) === isEnable) {
396 - return state;
469 + // Return early if there's no area.
470 + if (!area) {
471 + return;
397 472 }
398 473
399 - const currentTypeState = state[itemType] || {};
400 - const currentScopeState = currentTypeState[scope] || {};
401 - return { ...state,
402 - [itemType]: { ...currentTypeState,
403 - [scope]: { ...currentScopeState,
404 - [item]: isEnable || false
405 - }
406 - }
407 - };
408 -}
409 -/**
410 - * Reducer returning the defaults for user preferences.
411 - *
412 - * This is kept intentionally separate from the preferences
413 - * themselves so that defaults are not persisted.
414 - *
415 - * @param {Object} state Current state.
416 - * @param {Object} action Dispatched action.
417 - *
418 - * @return {Object} Updated state.
419 - */
474 + const isComplementaryAreaVisible = registry.select(external_wp_preferences_namespaceObject.store).get(scope, 'isComplementaryAreaVisible');
420 475
421 -const preferenceDefaults = (0,external_wp_data_namespaceObject.combineReducers)({
422 - features() {
423 - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
424 - let action = arguments.length > 1 ? arguments[1] : undefined;
425 -
426 - if (action.type === 'SET_FEATURE_DEFAULTS') {
427 - const {
428 - scope,
429 - defaults
430 - } = action;
431 - return { ...state,
432 - [scope]: { ...state[scope],
433 - ...defaults
434 - }
435 - };
436 - }
437 -
438 - return state;
476 + if (!isComplementaryAreaVisible) {
477 + registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'isComplementaryAreaVisible', true);
439 478 }
440 479
441 -});
480 + dispatch({
481 + type: 'ENABLE_COMPLEMENTARY_AREA',
482 + scope,
483 + area
484 + });
485 +};
442 486 /**
443 - * Reducer returning the user preferences.
487 + * Disable the complementary area.
444 488 *
445 - * @param {Object} state Current state.
446 - * @param {Object} action Dispatched action.
447 - *
448 - * @return {Object} Updated state.
489 + * @param {string} scope Complementary area scope.
449 490 */
450 491
451 -const preferences = (0,external_wp_data_namespaceObject.combineReducers)({
452 - features() {
453 - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
454 - let action = arguments.length > 1 ? arguments[1] : undefined;
492 +const disableComplementaryArea = scope => _ref2 => {
493 + let {
494 + registry
495 + } = _ref2;
496 + const isComplementaryAreaVisible = registry.select(external_wp_preferences_namespaceObject.store).get(scope, 'isComplementaryAreaVisible');
455 497
456 - if (action.type === 'SET_FEATURE_VALUE') {
457 - const {
458 - scope,
459 - featureName,
460 - value
461 - } = action;
462 - return { ...state,
463 - [scope]: { ...state[scope],
464 - [featureName]: value
465 - }
466 - };
467 - }
468 -
469 - return state;
498 + if (isComplementaryAreaVisible) {
499 + registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'isComplementaryAreaVisible', false);
470 500 }
471 -
472 -});
473 -const enableItems = (0,external_wp_data_namespaceObject.combineReducers)({
474 - singleEnableItems,
475 - multipleEnableItems
476 -});
477 -/* harmony default export */ var reducer = ((0,external_wp_data_namespaceObject.combineReducers)({
478 - enableItems,
479 - preferenceDefaults,
480 - preferences
481 -}));
482 -//# sourceMappingURL=reducer.js.map
483 -;// CONCATENATED MODULE: ./packages/interface/build-module/store/actions.js
501 +};
484 502 /**
485 - * Returns an action object used in signalling that an active area should be changed.
503 + * Pins an item.
486 504 *
487 - * @param {string} itemType Type of item.
488 - * @param {string} scope Item scope.
489 - * @param {string} item Item identifier.
505 + * @param {string} scope Item scope.
506 + * @param {string} item Item identifier.
490 507 *
491 508 * @return {Object} Action object.
492 509 */
493 -function setSingleEnableItem(itemType, scope, item) {
494 - return {
495 - type: 'SET_SINGLE_ENABLE_ITEM',
496 - itemType,
497 - scope,
498 - item
499 - };
500 -}
501 -/**
502 - * Returns an action object used in signalling that a complementary item should be enabled.
503 - *
504 - * @param {string} scope Complementary area scope.
505 - * @param {string} area Area identifier.
506 - *
507 - * @return {Object} Action object.
508 - */
509 510
511 +const pinItem = (scope, item) => _ref3 => {
512 + let {
513 + registry
514 + } = _ref3;
510 515
511 -function enableComplementaryArea(scope, area) {
512 - return setSingleEnableItem('complementaryArea', scope, area);
513 -}
514 -/**
515 - * Returns an action object used in signalling that the complementary area of a given scope should be disabled.
516 - *
517 - * @param {string} scope Complementary area scope.
518 - *
519 - * @return {Object} Action object.
520 - */
516 + // Return early if there's no item.
517 + if (!item) {
518 + return;
519 + }
521 520
522 -function disableComplementaryArea(scope) {
523 - return setSingleEnableItem('complementaryArea', scope, undefined);
524 -}
525 -/**
526 - * Returns an action object to make an area enabled/disabled.
527 - *
528 - * @param {string} itemType Type of item.
529 - * @param {string} scope Item scope.
530 - * @param {string} item Item identifier.
531 - * @param {boolean} isEnable Boolean indicating if an area should be pinned or not.
532 - *
533 - * @return {Object} Action object.
534 - */
521 + const pinnedItems = registry.select(external_wp_preferences_namespaceObject.store).get(scope, 'pinnedItems'); // The item is already pinned, there's nothing to do.
535 522
536 -function setMultipleEnableItem(itemType, scope, item, isEnable) {
537 - return {
538 - type: 'SET_MULTIPLE_ENABLE_ITEM',
539 - itemType,
540 - scope,
541 - item,
542 - isEnable
543 - };
544 -}
523 + if ((pinnedItems === null || pinnedItems === void 0 ? void 0 : pinnedItems[item]) === true) {
524 + return;
525 + }
526 +
527 + registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'pinnedItems', { ...pinnedItems,
528 + [item]: true
529 + });
530 +};
545 531 /**
546 - * Returns an action object used in signalling that an item should be pinned.
532 + * Unpins an item.
547 533 *
548 - * @param {string} scope Item scope.
549 - * @param {string} itemId Item identifier.
550 - *
551 - * @return {Object} Action object.
534 + * @param {string} scope Item scope.
535 + * @param {string} item Item identifier.
552 536 */
553 537
538 +const unpinItem = (scope, item) => _ref4 => {
539 + let {
540 + registry
541 + } = _ref4;
554 542
555 -function pinItem(scope, itemId) {
556 - return setMultipleEnableItem('pinnedItems', scope, itemId, true);
557 -}
558 -/**
559 - * Returns an action object used in signalling that an item should be unpinned.
560 - *
561 - * @param {string} scope Item scope.
562 - * @param {string} itemId Item identifier.
563 - *
564 - * @return {Object} Action object.
565 - */
543 + // Return early if there's no item.
544 + if (!item) {
545 + return;
546 + }
566 547
567 -function unpinItem(scope, itemId) {
568 - return setMultipleEnableItem('pinnedItems', scope, itemId, false);
569 -}
548 + const pinnedItems = registry.select(external_wp_preferences_namespaceObject.store).get(scope, 'pinnedItems');
549 + registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'pinnedItems', { ...pinnedItems,
550 + [item]: false
551 + });
552 +};
570 553 /**
571 554 * Returns an action object used in signalling that a feature should be toggled.
572 555 *
573 556 * @param {string} scope The feature scope (e.g. core/edit-post).
@@ -574,15 +557,17 @@
574 557 * @param {string} featureName The feature name.
575 558 */
576 559
577 560 function toggleFeature(scope, featureName) {
578 - return function (_ref) {
561 + return function (_ref5) {
579 562 let {
580 - select,
581 - dispatch
582 - } = _ref;
583 - const currentValue = select.isFeatureActive(scope, featureName);
584 - dispatch.setFeatureValue(scope, featureName, !currentValue);
563 + registry
564 + } = _ref5;
565 + external_wp_deprecated_default()(`dispatch( 'core/interface' ).toggleFeature`, {
566 + since: '6.0',
567 + alternative: `dispatch( 'core/preferences' ).toggle`
568 + });
569 + registry.dispatch(external_wp_preferences_namespaceObject.store).toggle(scope, featureName);
585 570 };
586 571 }
587 572 /**
588 573 * Returns an action object used in signalling that a feature should be set to
@@ -595,13 +580,17 @@
595 580 * @return {Object} Action object.
596 581 */
597 582
598 583 function setFeatureValue(scope, featureName, value) {
599 - return {
600 - type: 'SET_FEATURE_VALUE',
601 - scope,
602 - featureName,
603 - value: !!value
584 + return function (_ref6) {
585 + let {
586 + registry
587 + } = _ref6;
588 + external_wp_deprecated_default()(`dispatch( 'core/interface' ).setFeatureValue`, {
589 + since: '6.0',
590 + alternative: `dispatch( 'core/preferences' ).set`
591 + });
592 + registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, featureName, !!value);
604 593 };
605 594 }
606 595 /**
607 596 * Returns an action object used in signalling that defaults should be set for features.
@@ -612,33 +601,27 @@
612 601 * @return {Object} Action object.
613 602 */
614 603
615 604 function setFeatureDefaults(scope, defaults) {
616 - return {
617 - type: 'SET_FEATURE_DEFAULTS',
618 - scope,
619 - defaults
605 + return function (_ref7) {
606 + let {
607 + registry
608 + } = _ref7;
609 + external_wp_deprecated_default()(`dispatch( 'core/interface' ).setFeatureDefaults`, {
610 + since: '6.0',
611 + alternative: `dispatch( 'core/preferences' ).setDefaults`
612 + });
613 + registry.dispatch(external_wp_preferences_namespaceObject.store).setDefaults(scope, defaults);
620 614 };
621 615 }
622 -//# sourceMappingURL=actions.js.map
616 +
623 617 ;// CONCATENATED MODULE: ./packages/interface/build-module/store/selectors.js
624 618 /**
625 - * External dependencies
619 + * WordPress dependencies
626 620 */
627 621
628 -/**
629 - * Returns the item that is enabled in a given scope.
630 - *
631 - * @param {Object} state Global application state.
632 - * @param {string} itemType Type of item.
633 - * @param {string} scope Item scope.
634 - *
635 - * @return {?string|null} The item that is enabled in the passed scope and type.
636 - */
637 622
638 -function getSingleEnableItem(state, itemType, scope) {
639 - return (0,external_lodash_namespaceObject.get)(state.enableItems.singleEnableItems, [itemType, scope]);
640 -}
623 +
641 624 /**
642 625 * Returns the complementary area that is active in a given scope.
643 626 *
644 627 * @param {Object} state Global application state.
@@ -643,29 +626,29 @@
643 626 *
644 627 * @param {Object} state Global application state.
645 628 * @param {string} scope Item scope.
646 629 *
647 - * @return {string} The complementary area that is active in the given scope.
630 + * @return {string | null | undefined} The complementary area that is active in the given scope.
648 631 */
649 632
633 +const getActiveComplementaryArea = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope) => {
634 + var _state$complementaryA;
650 635
651 -function getActiveComplementaryArea(state, scope) {
652 - return getSingleEnableItem(state, 'complementaryArea', scope);
653 -}
654 -/**
655 - * Returns a boolean indicating if an item is enabled or not in a given scope.
656 - *
657 - * @param {Object} state Global application state.
658 - * @param {string} itemType Type of item.
659 - * @param {string} scope Scope.
660 - * @param {string} item Item to check.
661 - *
662 - * @return {boolean|undefined} True if the item is enabled, false otherwise if the item is explicitly disabled, and undefined if there is no information for that item.
663 - */
636 + const isComplementaryAreaVisible = select(external_wp_preferences_namespaceObject.store).get(scope, 'isComplementaryAreaVisible'); // Return `undefined` to indicate that the user has never toggled
637 + // visibility, this is the vanilla default. Other code relies on this
638 + // nuance in the return value.
664 639
665 -function isMultipleEnabledItemEnabled(state, itemType, scope, item) {
666 - return (0,external_lodash_namespaceObject.get)(state.enableItems.multipleEnableItems, [itemType, scope, item]);
667 -}
640 + if (isComplementaryAreaVisible === undefined) {
641 + return undefined;
642 + } // Return `null` to indicate the user hid the complementary area.
643 +
644 +
645 + if (!isComplementaryAreaVisible) {
646 + return null;
647 + }
648 +
649 + return state === null || state === void 0 ? void 0 : (_state$complementaryA = state.complementaryAreas) === null || _state$complementaryA === void 0 ? void 0 : _state$complementaryA[scope];
650 +});
668 651 /**
669 652 * Returns a boolean indicating if an item is pinned or not.
670 653 *
671 654 * @param {Object} state Global application state.
@@ -674,12 +657,14 @@
674 657 *
675 658 * @return {boolean} True if the item is pinned and false otherwise.
676 659 */
677 660
661 +const isItemPinned = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope, item) => {
662 + var _pinnedItems$item;
678 663
679 -function isItemPinned(state, scope, item) {
680 - return isMultipleEnabledItemEnabled(state, 'pinnedItems', scope, item) !== false;
681 -}
664 + const pinnedItems = select(external_wp_preferences_namespaceObject.store).get(scope, 'pinnedItems');
665 + return (_pinnedItems$item = pinnedItems === null || pinnedItems === void 0 ? void 0 : pinnedItems[item]) !== null && _pinnedItems$item !== void 0 ? _pinnedItems$item : true;
666 +});
682 667 /**
683 668 * Returns a boolean indicating whether a feature is active for a particular
684 669 * scope.
685 670 *
@@ -689,16 +674,60 @@
689 674 *
690 675 * @return {boolean} Is the feature enabled?
691 676 */
692 677
693 -function isFeatureActive(state, scope, featureName) {
694 - var _state$preferences$fe, _state$preferenceDefa;
678 +const isFeatureActive = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope, featureName) => {
679 + external_wp_deprecated_default()(`select( 'core/interface' ).isFeatureActive( scope, featureName )`, {
680 + since: '6.0',
681 + alternative: `select( 'core/preferences' ).get( scope, featureName )`
682 + });
683 + return !!select(external_wp_preferences_namespaceObject.store).get(scope, featureName);
684 +});
695 685
696 - const featureValue = (_state$preferences$fe = state.preferences.features[scope]) === null || _state$preferences$fe === void 0 ? void 0 : _state$preferences$fe[featureName];
697 - const defaultedFeatureValue = featureValue !== undefined ? featureValue : (_state$preferenceDefa = state.preferenceDefaults.features[scope]) === null || _state$preferenceDefa === void 0 ? void 0 : _state$preferenceDefa[featureName];
698 - return !!defaultedFeatureValue;
686 +;// CONCATENATED MODULE: ./packages/interface/build-module/store/reducer.js
687 +/**
688 + * WordPress dependencies
689 + */
690 +
691 +function complementaryAreas() {
692 + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
693 + let action = arguments.length > 1 ? arguments[1] : undefined;
694 +
695 + switch (action.type) {
696 + case 'SET_DEFAULT_COMPLEMENTARY_AREA':
697 + {
698 + const {
699 + scope,
700 + area
701 + } = action; // If there's already an area, don't overwrite it.
702 +
703 + if (state[scope]) {
704 + return state;
705 + }
706 +
707 + return { ...state,
708 + [scope]: area
709 + };
710 + }
711 +
712 + case 'ENABLE_COMPLEMENTARY_AREA':
713 + {
714 + const {
715 + scope,
716 + area
717 + } = action;
718 + return { ...state,
719 + [scope]: area
720 + };
721 + }
722 + }
723 +
724 + return state;
699 725 }
700 -//# sourceMappingURL=selectors.js.map
726 +/* harmony default export */ const store_reducer = ((0,external_wp_data_namespaceObject.combineReducers)({
727 + complementaryAreas
728 +}));
729 +
701 730 ;// CONCATENATED MODULE: ./packages/interface/build-module/store/constants.js
702 731 /**
703 732 * The identifier for the data store.
704 733 *
@@ -704,9 +733,9 @@
704 733 *
705 734 * @type {string}
706 735 */
707 736 const STORE_NAME = 'core/interface';
708 -//# sourceMappingURL=constants.js.map
737 +
709 738 ;// CONCATENATED MODULE: ./packages/interface/build-module/store/index.js
710 739 /**
711 740 * WordPress dependencies
712 741 */
@@ -727,52 +756,39 @@
727 756 * @type {Object}
728 757 */
729 758
730 759 const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, {
731 - reducer: reducer,
760 + reducer: store_reducer,
732 761 actions: actions_namespaceObject,
733 - selectors: selectors_namespaceObject,
734 - persist: ['enableItems', 'preferences'],
735 - __experimentalUseThunks: true
762 + selectors: selectors_namespaceObject
736 763 }); // Once we build a more generic persistence plugin that works across types of stores
737 764 // we'd be able to replace this with a register call.
738 765
739 -(0,external_wp_data_namespaceObject.registerStore)(STORE_NAME, {
740 - reducer: reducer,
741 - actions: actions_namespaceObject,
742 - selectors: selectors_namespaceObject,
743 - persist: ['enableItems', 'preferences'],
744 - __experimentalUseThunks: true
745 -});
746 -//# sourceMappingURL=index.js.map
766 +(0,external_wp_data_namespaceObject.register)(store);
767 +
747 768 ;// CONCATENATED MODULE: external ["wp","plugins"]
748 -var external_wp_plugins_namespaceObject = window["wp"]["plugins"];
769 +const external_wp_plugins_namespaceObject = window["wp"]["plugins"];
749 770 ;// CONCATENATED MODULE: ./packages/interface/build-module/components/complementary-area-context/index.js
750 771 /**
751 772 * WordPress dependencies
752 773 */
753 774
754 -/* harmony default export */ var complementary_area_context = ((0,external_wp_plugins_namespaceObject.withPluginContext)((context, ownProps) => {
775 +/* harmony default export */ const complementary_area_context = ((0,external_wp_plugins_namespaceObject.withPluginContext)((context, ownProps) => {
755 776 return {
756 777 icon: ownProps.icon || context.icon,
757 778 identifier: ownProps.identifier || `${context.name}/${ownProps.name}`
758 779 };
759 780 }));
760 -//# sourceMappingURL=index.js.map
781 +
761 782 ;// CONCATENATED MODULE: ./packages/interface/build-module/components/complementary-area-toggle/index.js
762 783
763 784
764 785
765 786 /**
766 - * External dependencies
767 - */
768 -
769 -/**
770 787 * WordPress dependencies
771 788 */
772 789
773 790
774 -
775 791 /**
776 792 * Internal dependencies
777 793 */
778 794
@@ -785,8 +801,9 @@
785 801 scope,
786 802 identifier,
787 803 icon,
788 804 selectedIcon,
805 + name,
789 806 ...props
790 807 } = _ref;
791 808 const ComponentToUse = as;
792 809 const isSelected = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getActiveComplementaryArea(scope) === identifier, [identifier]);
@@ -802,13 +819,13 @@
802 819 } else {
803 820 enableComplementaryArea(scope, identifier);
804 821 }
805 822 }
806 - }, (0,external_lodash_namespaceObject.omit)(props, ['name'])));
823 + }, props));
807 824 }
808 825
809 -/* harmony default export */ var complementary_area_toggle = (complementary_area_context(ComplementaryAreaToggle));
810 -//# sourceMappingURL=index.js.map
826 +/* harmony default export */ const complementary_area_toggle = (complementary_area_context(ComplementaryAreaToggle));
827 +
811 828 ;// CONCATENATED MODULE: ./packages/interface/build-module/components/complementary-area-header/index.js
812 829
813 830
814 831
@@ -846,24 +863,21 @@
846 863 tabIndex: -1
847 864 }, children, toggleButton));
848 865 };
849 866
850 -/* harmony default export */ var complementary_area_header = (ComplementaryAreaHeader);
851 -//# sourceMappingURL=index.js.map
867 +/* harmony default export */ const complementary_area_header = (ComplementaryAreaHeader);
868 +
852 869 ;// CONCATENATED MODULE: ./packages/interface/build-module/components/action-item/index.js
853 870
854 871
855 872
856 873 /**
857 - * External dependencies
858 - */
859 -
860 -/**
861 874 * WordPress dependencies
862 875 */
863 876
864 877
865 878
879 +const noop = () => {};
866 880
867 881 function ActionItemSlot(_ref) {
868 882 let {
869 883 name,
@@ -876,9 +890,9 @@
876 890 name: name,
877 891 bubblesVirtually: bubblesVirtually,
878 892 fillProps: fillProps
879 893 }, fills => {
880 - if ((0,external_lodash_namespaceObject.isEmpty)(external_wp_element_namespaceObject.Children.toArray(fills))) {
894 + if (!external_wp_element_namespaceObject.Children.toArray(fills).length) {
881 895 return null;
882 896 } // Special handling exists for backward compatibility.
883 897 // It ensures that menu items created by plugin authors aren't
884 898 // duplicated with automatically injected menu items coming
@@ -924,10 +938,10 @@
924 938 onClick: fpOnClick
925 939 } = _ref4;
926 940 return (0,external_wp_element_namespaceObject.createElement)(Component, _extends({
927 941 onClick: onClick || fpOnClick ? function () {
928 - (onClick || external_lodash_namespaceObject.noop)(...arguments);
929 - (fpOnClick || external_lodash_namespaceObject.noop)(...arguments);
942 + (onClick || noop)(...arguments);
943 + (fpOnClick || noop)(...arguments);
930 944 } : undefined
931 945 }, props));
932 946 });
933 947 }
@@ -932,24 +946,19 @@
932 946 });
933 947 }
934 948
935 949 ActionItem.Slot = ActionItemSlot;
936 -/* harmony default export */ var action_item = (ActionItem);
937 -//# sourceMappingURL=index.js.map
950 +/* harmony default export */ const action_item = (ActionItem);
951 +
938 952 ;// CONCATENATED MODULE: ./packages/interface/build-module/components/complementary-area-more-menu-item/index.js
939 953
940 954
941 955
942 956 /**
943 - * External dependencies
944 - */
945 -
946 -/**
947 957 * WordPress dependencies
948 958 */
949 959
950 960
951 -
952 961 /**
953 962 * Internal dependencies
954 963 */
955 964
@@ -955,20 +964,27 @@
955 964
956 965
957 966
958 967
959 -const PluginsMenuItem = props => // Menu item is marked with unstable prop for backward compatibility.
960 -// They are removed so they don't leak to DOM elements.
961 -// @see https://github.com/WordPress/gutenberg/issues/14457
962 -(0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, (0,external_lodash_namespaceObject.omit)(props, ['__unstableExplicitMenuItem', '__unstableTarget']));
968 +const PluginsMenuItem = _ref => {
969 + let {
970 + // Menu item is marked with unstable prop for backward compatibility.
971 + // They are removed so they don't leak to DOM elements.
972 + // @see https://github.com/WordPress/gutenberg/issues/14457
973 + __unstableExplicitMenuItem,
974 + __unstableTarget,
975 + ...restProps
976 + } = _ref;
977 + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, restProps);
978 +};
963 979
964 -function ComplementaryAreaMoreMenuItem(_ref) {
980 +function ComplementaryAreaMoreMenuItem(_ref2) {
965 981 let {
966 982 scope,
967 983 target,
968 984 __unstableExplicitMenuItem,
969 985 ...props
970 - } = _ref;
986 + } = _ref2;
971 987 return (0,external_wp_element_namespaceObject.createElement)(complementary_area_toggle, _extends({
972 988 as: toggleProps => {
973 989 return (0,external_wp_element_namespaceObject.createElement)(action_item, _extends({
974 990 __unstableExplicitMenuItem: __unstableExplicitMenuItem,
@@ -982,9 +998,9 @@
982 998 name: target,
983 999 scope: scope
984 1000 }, props));
985 1001 }
986 -//# sourceMappingURL=index.js.map
1002 +
987 1003 ;// CONCATENATED MODULE: ./packages/interface/build-module/components/pinned-items/index.js
988 1004
989 1005
990 1006
@@ -991,9 +1007,8 @@
991 1007 /**
992 1008 * External dependencies
993 1009 */
994 1010
995 -
996 1011 /**
997 1012 * WordPress dependencies
998 1013 */
999 1014
@@ -1016,16 +1031,16 @@
1016 1031 ...props
1017 1032 } = _ref2;
1018 1033 return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Slot, _extends({
1019 1034 name: `PinnedItems/${scope}`
1020 - }, props), fills => !(0,external_lodash_namespaceObject.isEmpty)(fills) && (0,external_wp_element_namespaceObject.createElement)("div", {
1035 + }, props), fills => (fills === null || fills === void 0 ? void 0 : fills.length) > 0 && (0,external_wp_element_namespaceObject.createElement)("div", {
1021 1036 className: classnames_default()(className, 'interface-pinned-items')
1022 1037 }, fills));
1023 1038 }
1024 1039
1025 1040 PinnedItems.Slot = PinnedItemsSlot;
1026 -/* harmony default export */ var pinned_items = (PinnedItems);
1027 -//# sourceMappingURL=index.js.map
1041 +/* harmony default export */ const pinned_items = (PinnedItems);
1042 +
1028 1043 ;// CONCATENATED MODULE: ./packages/interface/build-module/components/complementary-area/index.js
1029 1044
1030 1045
1031 1046
@@ -1205,12 +1220,12 @@
1205 1220 }
1206 1221
1207 1222 const ComplementaryAreaWrapped = complementary_area_context(ComplementaryArea);
1208 1223 ComplementaryAreaWrapped.Slot = ComplementaryAreaSlot;
1209 -/* harmony default export */ var complementary_area = (ComplementaryAreaWrapped);
1210 -//# sourceMappingURL=index.js.map
1224 +/* harmony default export */ const complementary_area = (ComplementaryAreaWrapped);
1225 +
1211 1226 ;// CONCATENATED MODULE: external ["wp","compose"]
1212 -var external_wp_compose_namespaceObject = window["wp"]["compose"];
1227 +const external_wp_compose_namespaceObject = window["wp"]["compose"];
1213 1228 ;// CONCATENATED MODULE: ./packages/interface/build-module/components/interface-skeleton/index.js
1214 1229
1215 1230
1216 1231
@@ -1221,17 +1236,13 @@
1221 1236 /**
1222 1237 * WordPress dependencies
1223 1238 */
1224 1239
1225 -/**
1226 - * WordPress dependencies
1227 - */
1228 1240
1229 1241
1230 1242
1231 1243
1232 1244
1233 -
1234 1245 function useHTMLClass(className) {
1235 1246 (0,external_wp_element_namespaceObject.useEffect)(() => {
1236 1247 const element = document && document.querySelector(`html:not(.${className})`);
1237 1248
@@ -1247,10 +1258,12 @@
1247 1258 }
1248 1259
1249 1260 function InterfaceSkeleton(_ref, ref) {
1250 1261 let {
1262 + isDistractionFree,
1251 1263 footer,
1252 1264 header,
1265 + editorNotices,
1253 1266 sidebar,
1254 1267 secondarySidebar,
1255 1268 notices,
1256 1269 content,
@@ -1286,8 +1299,23 @@
1286 1299 };
1287 1300 const mergedLabels = { ...defaultLabels,
1288 1301 ...labels
1289 1302 };
1303 + const headerVariants = {
1304 + hidden: isDistractionFree ? {
1305 + opacity: 0
1306 + } : {
1307 + opacity: 1
1308 + },
1309 + hover: {
1310 + opacity: 1,
1311 + transition: {
1312 + type: 'tween',
1313 + delay: 0.2,
1314 + delayChildren: 0.2
1315 + }
1316 + }
1317 + };
1290 1318 return (0,external_wp_element_namespaceObject.createElement)("div", _extends({}, navigateRegionsProps, {
1291 1319 ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, navigateRegionsProps.ref]),
1292 1320 className: classnames_default()(className, 'interface-interface-skeleton', navigateRegionsProps.className, !!footer && 'has-footer')
1293 1321 }), !!drawer && (0,external_wp_element_namespaceObject.createElement)("div", {
@@ -1296,14 +1324,28 @@
1296 1324 "aria-label": mergedLabels.drawer,
1297 1325 tabIndex: "-1"
1298 1326 }, drawer), (0,external_wp_element_namespaceObject.createElement)("div", {
1299 1327 className: "interface-interface-skeleton__editor"
1300 - }, !!header && (0,external_wp_element_namespaceObject.createElement)("div", {
1328 + }, !!header && isDistractionFree && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableMotion.div, {
1329 + initial: isDistractionFree ? 'hidden' : 'hover',
1330 + whileHover: "hover",
1331 + variants: headerVariants,
1332 + transition: {
1333 + type: 'tween',
1334 + delay: 0.8
1335 + },
1301 1336 className: "interface-interface-skeleton__header",
1302 1337 role: "region",
1303 1338 "aria-label": mergedLabels.header,
1304 1339 tabIndex: "-1"
1305 - }, header), (0,external_wp_element_namespaceObject.createElement)("div", {
1340 + }, header), !!header && !isDistractionFree && (0,external_wp_element_namespaceObject.createElement)("div", {
1341 + className: "interface-interface-skeleton__header",
1342 + role: "region",
1343 + "aria-label": mergedLabels.header,
1344 + tabIndex: "-1"
1345 + }, header), isDistractionFree && (0,external_wp_element_namespaceObject.createElement)("div", {
1346 + className: "interface-interface-skeleton__header"
1347 + }, editorNotices), (0,external_wp_element_namespaceObject.createElement)("div", {
1306 1348 className: "interface-interface-skeleton__body"
1307 1349 }, !!secondarySidebar && (0,external_wp_element_namespaceObject.createElement)("div", {
1308 1350 className: "interface-interface-skeleton__secondary-sidebar",
1309 1351 role: "region",
@@ -1333,10 +1375,10 @@
1333 1375 tabIndex: "-1"
1334 1376 }, footer));
1335 1377 }
1336 1378
1337 -/* harmony default export */ var interface_skeleton = ((0,external_wp_element_namespaceObject.forwardRef)(InterfaceSkeleton));
1338 -//# sourceMappingURL=index.js.map
1379 +/* harmony default export */ const interface_skeleton = ((0,external_wp_element_namespaceObject.forwardRef)(InterfaceSkeleton));
1380 +
1339 1381 ;// CONCATENATED MODULE: ./packages/icons/build-module/library/more-vertical.js
1340 1382
1341 1383
1342 1384 /**
@@ -1348,10 +1390,10 @@
1348 1390 viewBox: "0 0 24 24"
1349 1391 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
1350 1392 d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"
1351 1393 }));
1352 -/* harmony default export */ var more_vertical = (moreVertical);
1353 -//# sourceMappingURL=more-vertical.js.map
1394 +/* harmony default export */ const more_vertical = (moreVertical);
1395 +
1354 1396 ;// CONCATENATED MODULE: ./packages/interface/build-module/components/more-menu-dropdown/index.js
1355 1397
1356 1398
1357 1399 /**
@@ -1390,182 +1432,29 @@
1390 1432 ...toggleProps
1391 1433 }
1392 1434 }, onClose => children(onClose));
1393 1435 }
1394 -//# sourceMappingURL=index.js.map
1395 -;// CONCATENATED MODULE: external ["wp","a11y"]
1396 -var external_wp_a11y_namespaceObject = window["wp"]["a11y"];
1397 -;// CONCATENATED MODULE: ./packages/interface/build-module/components/more-menu-feature-toggle/index.js
1398 1436
1437 +;// CONCATENATED MODULE: ./packages/interface/build-module/components/index.js
1399 1438
1400 -/**
1401 - * WordPress dependencies
1402 - */
1403 1439
1404 1440
1405 1441
1406 1442
1407 1443
1408 -/**
1409 - * Internal dependencies
1410 - */
1411 1444
1412 1445
1413 -function MoreMenuFeatureToggle(_ref) {
1414 - let {
1415 - scope,
1416 - label,
1417 - info,
1418 - messageActivated,
1419 - messageDeactivated,
1420 - shortcut,
1421 - feature
1422 - } = _ref;
1423 - const isActive = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).isFeatureActive(scope, feature), [feature]);
1424 - const {
1425 - toggleFeature
1426 - } = (0,external_wp_data_namespaceObject.useDispatch)(store);
1427 1446
1428 - const speakMessage = () => {
1429 - if (isActive) {
1430 - (0,external_wp_a11y_namespaceObject.speak)(messageDeactivated || (0,external_wp_i18n_namespaceObject.__)('Feature deactivated'));
1431 - } else {
1432 - (0,external_wp_a11y_namespaceObject.speak)(messageActivated || (0,external_wp_i18n_namespaceObject.__)('Feature activated'));
1433 - }
1434 - };
1435 1447
1436 - return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
1437 - icon: isActive && library_check,
1438 - isSelected: isActive,
1439 - onClick: () => {
1440 - toggleFeature(scope, feature);
1441 - speakMessage();
1442 - },
1443 - role: "menuitemcheckbox",
1444 - info: info,
1445 - shortcut: shortcut
1446 - }, label);
1447 -}
1448 -//# sourceMappingURL=index.js.map
1449 -;// CONCATENATED MODULE: ./packages/interface/build-module/components/index.js
1450 1448
1451 1449
1452 1450
1453 -
1454 -
1455 -
1456 -
1457 -
1458 -//# sourceMappingURL=index.js.map
1459 1451 ;// CONCATENATED MODULE: ./packages/interface/build-module/index.js
1460 1452
1461 1453
1462 -//# sourceMappingURL=index.js.map
1463 -;// CONCATENATED MODULE: external ["wp","apiFetch"]
1464 -var external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
1465 -var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject);
1466 -;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/store/reducer.js
1467 -/**
1468 - * WordPress dependencies
1469 - */
1470 1454
1471 -/**
1472 - * Controls the open state of the widget areas.
1473 - *
1474 - * @param {Object} state Redux state.
1475 - * @param {Object} action Redux action.
1476 - *
1477 - * @return {Array} Updated state.
1478 - */
1479 -
1480 -function widgetAreasOpenState() {
1481 - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1482 - let action = arguments.length > 1 ? arguments[1] : undefined;
1483 - const {
1484 - type
1485 - } = action;
1486 -
1487 - switch (type) {
1488 - case 'SET_WIDGET_AREAS_OPEN_STATE':
1489 - {
1490 - return action.widgetAreasOpenState;
1491 - }
1492 -
1493 - case 'SET_IS_WIDGET_AREA_OPEN':
1494 - {
1495 - const {
1496 - clientId,
1497 - isOpen
1498 - } = action;
1499 - return { ...state,
1500 - [clientId]: isOpen
1501 - };
1502 - }
1503 -
1504 - default:
1505 - {
1506 - return state;
1507 - }
1508 - }
1509 -}
1510 -/**
1511 - * Reducer to set the block inserter panel open or closed.
1512 - *
1513 - * Note: this reducer interacts with the list view panel reducer
1514 - * to make sure that only one of the two panels is open at the same time.
1515 - *
1516 - * @param {Object} state Current state.
1517 - * @param {Object} action Dispatched action.
1518 - */
1519 -
1520 -function blockInserterPanel() {
1521 - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
1522 - let action = arguments.length > 1 ? arguments[1] : undefined;
1523 -
1524 - switch (action.type) {
1525 - case 'SET_IS_LIST_VIEW_OPENED':
1526 - return action.isOpen ? false : state;
1527 -
1528 - case 'SET_IS_INSERTER_OPENED':
1529 - return action.value;
1530 - }
1531 -
1532 - return state;
1533 -}
1534 -/**
1535 - * Reducer to set the list view panel open or closed.
1536 - *
1537 - * Note: this reducer interacts with the inserter panel reducer
1538 - * to make sure that only one of the two panels is open at the same time.
1539 - *
1540 - * @param {Object} state Current state.
1541 - * @param {Object} action Dispatched action.
1542 - */
1543 -
1544 -function listViewPanel() {
1545 - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
1546 - let action = arguments.length > 1 ? arguments[1] : undefined;
1547 -
1548 - switch (action.type) {
1549 - case 'SET_IS_INSERTER_OPENED':
1550 - return action.value ? false : state;
1551 -
1552 - case 'SET_IS_LIST_VIEW_OPENED':
1553 - return action.isOpen;
1554 - }
1555 -
1556 - return state;
1557 -}
1558 -/* harmony default export */ var store_reducer = ((0,external_wp_data_namespaceObject.combineReducers)({
1559 - blockInserterPanel,
1560 - listViewPanel,
1561 - widgetAreasOpenState
1562 -}));
1563 -//# sourceMappingURL=reducer.js.map
1564 -;// CONCATENATED MODULE: external ["wp","notices"]
1565 -var external_wp_notices_namespaceObject = window["wp"]["notices"];
1566 1455 ;// CONCATENATED MODULE: external ["wp","blockEditor"]
1567 -var external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"];
1456 +const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"];
1568 1457 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/store/transformers.js
1569 1458 /**
1570 1459 * WordPress dependencies
1571 1460 */
@@ -1579,9 +1468,11 @@
1579 1468 */
1580 1469
1581 1470 function transformWidgetToBlock(widget) {
1582 1471 if (widget.id_base === 'block') {
1583 - const parsedBlocks = (0,external_wp_blocks_namespaceObject.parse)(widget.instance.raw.content);
1472 + const parsedBlocks = (0,external_wp_blocks_namespaceObject.parse)(widget.instance.raw.content, {
1473 + __unstableSkipAutop: true
1474 + });
1584 1475
1585 1476 if (!parsedBlocks.length) {
1586 1477 return (0,external_wp_widgets_namespaceObject.addWidgetIdToBlock)((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {}, []), widget.id);
1587 1478 }
@@ -1640,9 +1531,9 @@
1640 1531 delete widget.rendered;
1641 1532 delete widget.rendered_form;
1642 1533 return widget;
1643 1534 }
1644 -//# sourceMappingURL=transformers.js.map
1535 +
1645 1536 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/store/utils.js
1646 1537 /**
1647 1538 * "Kind" of the navigation post.
1648 1539 *
@@ -1719,15 +1610,15 @@
1719 1610 meta: {
1720 1611 widgetAreaId: id
1721 1612 }
1722 1613 });
1723 -//# sourceMappingURL=utils.js.map
1614 +
1724 1615 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/store/constants.js
1725 1616 /**
1726 1617 * Module Constants
1727 1618 */
1728 1619 const constants_STORE_NAME = 'core/edit-widgets';
1729 -//# sourceMappingURL=constants.js.map
1620 +
1730 1621 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/store/actions.js
1731 1622 /**
1732 1623 * WordPress dependencies
1733 1624 */
@@ -1815,9 +1706,9 @@
1815 1706 for (const widgetArea of widgetAreas) {
1816 1707 await dispatch.saveWidgetArea(widgetArea.id);
1817 1708 }
1818 1709 } finally {
1819 - // saveEditedEntityRecord resets the resolution status, let's fix it manually
1710 + // saveEditedEntityRecord resets the resolution status, let's fix it manually.
1820 1711 await registry.dispatch(external_wp_coreData_namespaceObject.store).finishResolution('getEntityRecord', KIND, WIDGET_AREA_ENTITY_TYPE, buildWidgetAreasQuery());
1821 1712 }
1822 1713 };
1823 1714 /**
@@ -1983,15 +1874,11 @@
1983 1874 const trySaveWidgetArea = widgetAreaId => _ref9 => {
1984 1875 let {
1985 1876 registry
1986 1877 } = _ref9;
1987 - const saveErrorBefore = registry.select(external_wp_coreData_namespaceObject.store).getLastEntitySaveError(KIND, WIDGET_AREA_ENTITY_TYPE, widgetAreaId);
1988 - registry.dispatch(external_wp_coreData_namespaceObject.store).saveEditedEntityRecord(KIND, WIDGET_AREA_ENTITY_TYPE, widgetAreaId);
1989 - const saveErrorAfter = registry.select(external_wp_coreData_namespaceObject.store).getLastEntitySaveError(KIND, WIDGET_AREA_ENTITY_TYPE, widgetAreaId);
1990 -
1991 - if (saveErrorAfter && saveErrorBefore !== saveErrorAfter) {
1992 - throw new Error(saveErrorAfter);
1993 - }
1878 + registry.dispatch(external_wp_coreData_namespaceObject.store).saveEditedEntityRecord(KIND, WIDGET_AREA_ENTITY_TYPE, widgetAreaId, {
1879 + throwOnError: true
1880 + });
1994 1881 };
1995 1882 /**
1996 1883 * Sets the clientId stored for a particular widgetId.
1997 1884 *
@@ -2106,9 +1993,9 @@
2106 1993 attributes
2107 1994 } = _ref12;
2108 1995 return attributes.id === widgetAreaId;
2109 1996 });
2110 - const destinationRootClientId = destinationWidgetAreaBlock.clientId; // Get the index for moving to the end of the the destination widget area.
1997 + const destinationRootClientId = destinationWidgetAreaBlock.clientId; // Get the index for moving to the end of the destination widget area.
2111 1998
2112 1999 const destinationInnerBlocksClientIds = registry.select(external_wp_blockEditor_namespaceObject.store).getBlockOrder(destinationRootClientId);
2113 2000 const destinationIndex = destinationInnerBlocksClientIds.length; // Reveal the widget area, if it's not open.
2114 2001
@@ -2120,9 +2007,9 @@
2120 2007
2121 2008
2122 2009 registry.dispatch(external_wp_blockEditor_namespaceObject.store).moveBlocksToPosition([clientId], sourceRootClientId, destinationRootClientId, destinationIndex);
2123 2010 };
2124 -//# sourceMappingURL=actions.js.map
2011 +
2125 2012 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/store/resolvers.js
2126 2013 /**
2127 2014 * WordPress dependencies
2128 2015 */
@@ -2213,15 +2100,11 @@
2213 2100 dispatch(persistStubPost(buildWidgetAreaPostId(sidebarId), groupedBySidebar[sidebarId]));
2214 2101 }
2215 2102 }
2216 2103 };
2217 -//# sourceMappingURL=resolvers.js.map
2104 +
2218 2105 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/store/selectors.js
2219 2106 /**
2220 - * External dependencies
2221 - */
2222 -
2223 -/**
2224 2107 * WordPress dependencies
2225 2108 */
2226 2109
2227 2110
@@ -2226,9 +2109,8 @@
2226 2109
2227 2110
2228 2111
2229 2112
2230 -
2231 2113 /**
2232 2114 * Internal dependencies
2233 2115 */
2234 2116
@@ -2241,9 +2123,13 @@
2241 2123 */
2242 2124
2243 2125 const selectors_getWidgets = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => {
2244 2126 const widgets = select(external_wp_coreData_namespaceObject.store).getEntityRecords('root', 'widget', buildWidgetsQuery());
2245 - return (0,external_lodash_namespaceObject.keyBy)(widgets, 'id');
2127 + return (// Key widgets by their ID.
2128 + (widgets === null || widgets === void 0 ? void 0 : widgets.reduce((allWidgets, widget) => ({ ...allWidgets,
2129 + [widget.id]: widget
2130 + }), {})) || {}
2131 + );
2246 2132 });
2247 2133 /**
2248 2134 * Returns API widget data for a particular widget ID.
2249 2135 *
@@ -2472,9 +2358,9 @@
2472 2358
2473 2359 function isListViewOpened(state) {
2474 2360 return state.listViewPanel;
2475 2361 }
2476 -//# sourceMappingURL=selectors.js.map
2362 +
2477 2363 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/store/index.js
2478 2364 /**
2479 2365 * WordPress dependencies
2480 2366 */
@@ -2491,19 +2377,18 @@
2491 2377
2492 2378 /**
2493 2379 * Block editor data store configuration.
2494 2380 *
2495 - * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore
2381 + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#register
2496 2382 *
2497 2383 * @type {Object}
2498 2384 */
2499 2385
2500 2386 const storeConfig = {
2501 - reducer: store_reducer,
2387 + reducer: reducer,
2502 2388 selectors: store_selectors_namespaceObject,
2503 2389 resolvers: resolvers_namespaceObject,
2504 - actions: store_actions_namespaceObject,
2505 - __experimentalUseThunks: true
2390 + actions: store_actions_namespaceObject
2506 2391 };
2507 2392 /**
2508 2393 * Store definition for the edit widgets namespace.
2509 2394 *
@@ -2511,12 +2396,10 @@
2511 2396 *
2512 2397 * @type {Object}
2513 2398 */
2514 2399
2515 -const store_store = (0,external_wp_data_namespaceObject.createReduxStore)(constants_STORE_NAME, storeConfig); // Once we build a more generic persistence plugin that works across types of stores
2516 -// we'd be able to replace this with a register call.
2517 -
2518 -(0,external_wp_data_namespaceObject.registerStore)(constants_STORE_NAME, storeConfig); // This package uses a few in-memory post types as wrappers for convenience.
2400 +const store_store = (0,external_wp_data_namespaceObject.createReduxStore)(constants_STORE_NAME, storeConfig);
2401 +(0,external_wp_data_namespaceObject.register)(store_store); // This package uses a few in-memory post types as wrappers for convenience.
2519 2402 // This middleware prevents any network requests related to these types as they are
2520 2403 // bound to fail anyway.
2521 2404
2522 2405 external_wp_apiFetch_default().use(function (options, next) {
@@ -2527,11 +2410,11 @@
2527 2410 }
2528 2411
2529 2412 return next(options);
2530 2413 });
2531 -//# sourceMappingURL=index.js.map
2414 +
2532 2415 ;// CONCATENATED MODULE: external ["wp","hooks"]
2533 -var external_wp_hooks_namespaceObject = window["wp"]["hooks"];
2416 +const external_wp_hooks_namespaceObject = window["wp"]["hooks"];
2534 2417 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/filters/move-to-widget-area.js
2535 2418
2536 2419
2537 2420 /**
@@ -2585,11 +2468,11 @@
2585 2468 }
2586 2469 })));
2587 2470 }, 'withMoveToWidgetAreaToolbarItem');
2588 2471 (0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/edit-widgets/block-edit', withMoveToWidgetAreaToolbarItem);
2589 -//# sourceMappingURL=move-to-widget-area.js.map
2472 +
2590 2473 ;// CONCATENATED MODULE: external ["wp","mediaUtils"]
2591 -var external_wp_mediaUtils_namespaceObject = window["wp"]["mediaUtils"];
2474 +const external_wp_mediaUtils_namespaceObject = window["wp"]["mediaUtils"];
2592 2475 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/filters/replace-media-upload.js
2593 2476 /**
2594 2477 * WordPress dependencies
2595 2478 */
@@ -2598,9 +2481,9 @@
2598 2481
2599 2482 const replaceMediaUpload = () => external_wp_mediaUtils_namespaceObject.MediaUpload;
2600 2483
2601 2484 (0,external_wp_hooks_namespaceObject.addFilter)('editor.MediaUpload', 'core/edit-widgets/replace-media-upload', replaceMediaUpload);
2602 -//# sourceMappingURL=replace-media-upload.js.map
2485 +
2603 2486 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/filters/index.js
2604 2487 /**
2605 2488 * Internal dependencies
2606 2489 */
@@ -2605,9 +2488,9 @@
2605 2488 * Internal dependencies
2606 2489 */
2607 2490
2608 2491
2609 -//# sourceMappingURL=index.js.map
2492 +
2610 2493 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/blocks/widget-area/edit/use-is-dragging-within.js
2611 2494 /**
2612 2495 * WordPress dependencies
2613 2496 */
@@ -2661,10 +2544,10 @@
2661 2544 }, []);
2662 2545 return isDraggingWithin;
2663 2546 };
2664 2547
2665 -/* harmony default export */ var use_is_dragging_within = (useIsDraggingWithin);
2666 -//# sourceMappingURL=use-is-dragging-within.js.map
2548 +/* harmony default export */ const use_is_dragging_within = (useIsDraggingWithin);
2549 +
2667 2550 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/blocks/widget-area/edit/inner-blocks.js
2668 2551
2669 2552
2670 2553 /**
@@ -2707,9 +2590,9 @@
2707 2590 'wp-block-widget-area__highlight-drop-zone': shouldHighlightDropZone
2708 2591 })
2709 2592 }, (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps));
2710 2593 }
2711 -//# sourceMappingURL=inner-blocks.js.map
2594 +
2712 2595 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/blocks/widget-area/edit/index.js
2713 2596
2714 2597
2715 2598 /**
@@ -2821,9 +2704,9 @@
2821 2704 };
2822 2705 }, []);
2823 2706 return isDragging;
2824 2707 };
2825 -//# sourceMappingURL=index.js.map
2708 +
2826 2709 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/blocks/widget-area/index.js
2827 2710 /**
2828 2711 * WordPress dependencies
2829 2712 */
@@ -2848,9 +2731,10 @@
2848 2731 inserter: false,
2849 2732 customClassName: false,
2850 2733 reusable: false,
2851 2734 __experimentalToolbar: false,
2852 - __experimentalParentSelector: false
2735 + __experimentalParentSelector: false,
2736 + __experimentalDisableBlockOverlay: true
2853 2737 },
2854 2738 editorStyle: "wp-block-widget-area-editor",
2855 2739 style: "wp-block-widget-area"
2856 2740 };
@@ -2869,9 +2753,9 @@
2869 2753 return label;
2870 2754 },
2871 2755 edit: WidgetAreaEdit
2872 2756 };
2873 -//# sourceMappingURL=index.js.map
2757 +
2874 2758 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/components/error-boundary/index.js
2875 2759
2876 2760
2877 2761 /**
@@ -2882,8 +2766,9 @@
2882 2766
2883 2767
2884 2768
2885 2769
2770 +
2886 2771 function CopyButton(_ref) {
2887 2772 let {
2888 2773 text,
2889 2774 children
@@ -2907,8 +2792,9 @@
2907 2792 componentDidCatch(error) {
2908 2793 this.setState({
2909 2794 error
2910 2795 });
2796 + (0,external_wp_hooks_namespaceObject.doAction)('editor.ErrorBoundary.errorLogged', error);
2911 2797 }
2912 2798
2913 2799 reboot() {
2914 2800 this.props.onError();
@@ -2936,13 +2822,13 @@
2936 2822 }, (0,external_wp_i18n_namespaceObject.__)('The editor has encountered an unexpected error.'));
2937 2823 }
2938 2824
2939 2825 }
2940 -//# sourceMappingURL=index.js.map
2826 +
2941 2827 ;// CONCATENATED MODULE: external ["wp","reusableBlocks"]
2942 -var external_wp_reusableBlocks_namespaceObject = window["wp"]["reusableBlocks"];
2828 +const external_wp_reusableBlocks_namespaceObject = window["wp"]["reusableBlocks"];
2943 2829 ;// CONCATENATED MODULE: external ["wp","keyboardShortcuts"]
2944 -var external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShortcuts"];
2830 +const external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShortcuts"];
2945 2831 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/components/keyboard-shortcuts/index.js
2946 2832 /**
2947 2833 * WordPress dependencies
2948 2834 */
@@ -2980,9 +2866,9 @@
2980 2866 return null;
2981 2867 }
2982 2868
2983 2869 function KeyboardShortcutsRegister() {
2984 - // Registering the shortcuts
2870 + // Registering the shortcuts.
2985 2871 const {
2986 2872 registerShortcut
2987 2873 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_keyboardShortcuts_namespaceObject.store);
2988 2874 (0,external_wp_element_namespaceObject.useEffect)(() => {
@@ -3052,10 +2938,10 @@
3052 2938 return null;
3053 2939 }
3054 2940
3055 2941 KeyboardShortcuts.Register = KeyboardShortcutsRegister;
3056 -/* harmony default export */ var keyboard_shortcuts = (KeyboardShortcuts);
3057 -//# sourceMappingURL=index.js.map
2942 +/* harmony default export */ const keyboard_shortcuts = (KeyboardShortcuts);
2943 +
3058 2944 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/hooks/use-last-selected-widget-area.js
3059 2945 /**
3060 2946 * WordPress dependencies
3061 2947 */
@@ -3106,23 +2992,19 @@
3106 2992 const widgetAreasPost = getEntityRecord(KIND, POST_TYPE, buildWidgetAreasPostId());
3107 2993 return widgetAreasPost === null || widgetAreasPost === void 0 ? void 0 : (_widgetAreasPost$bloc = widgetAreasPost.blocks[0]) === null || _widgetAreasPost$bloc === void 0 ? void 0 : _widgetAreasPost$bloc.clientId;
3108 2994 }, []);
3109 2995
3110 -/* harmony default export */ var use_last_selected_widget_area = (useLastSelectedWidgetArea);
3111 -//# sourceMappingURL=use-last-selected-widget-area.js.map
2996 +/* harmony default export */ const use_last_selected_widget_area = (useLastSelectedWidgetArea);
2997 +
3112 2998 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/constants.js
3113 2999 const ALLOW_REUSABLE_BLOCKS = false;
3114 3000 const ENABLE_EXPERIMENTAL_FSE_BLOCKS = false;
3115 -//# sourceMappingURL=constants.js.map
3001 +
3116 3002 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/components/widget-areas-block-editor-provider/index.js
3117 3003
3118 3004
3119 3005
3120 3006 /**
3121 - * External dependencies
3122 - */
3123 -
3124 -/**
3125 3007 * WordPress dependencies
3126 3008 */
3127 3009
3128 3010
@@ -3141,9 +3023,8 @@
3141 3023
3142 3024
3143 3025
3144 3026
3145 -
3146 3027 function WidgetAreasBlockEditorProvider(_ref) {
3147 3028 let {
3148 3029 blockEditorSettings,
3149 3030 children,
@@ -3148,20 +3029,19 @@
3148 3029 blockEditorSettings,
3149 3030 children,
3150 3031 ...props
3151 3032 } = _ref;
3033 + const mediaPermissions = (0,external_wp_coreData_namespaceObject.useResourcePermissions)('media');
3152 3034 const {
3153 - hasUploadPermissions,
3154 3035 reusableBlocks,
3155 3036 isFixedToolbarActive,
3156 3037 keepCaretInsideBlock
3157 3038 } = (0,external_wp_data_namespaceObject.useSelect)(select => ({
3158 - hasUploadPermissions: (0,external_lodash_namespaceObject.defaultTo)(select(external_wp_coreData_namespaceObject.store).canUser('create', 'media'), true),
3159 3039 widgetAreas: select(store_store).getWidgetAreas(),
3160 3040 widgets: select(store_store).getWidgets(),
3161 3041 reusableBlocks: ALLOW_REUSABLE_BLOCKS ? select(external_wp_coreData_namespaceObject.store).getEntityRecords('postType', 'wp_block') : [],
3162 - isFixedToolbarActive: select(store).isFeatureActive('core/edit-widgets', 'fixedToolbar'),
3163 - keepCaretInsideBlock: select(store).isFeatureActive('core/edit-widgets', 'keepCaretInsideBlock')
3042 + isFixedToolbarActive: !!select(external_wp_preferences_namespaceObject.store).get('core/edit-widgets', 'fixedToolbar'),
3043 + keepCaretInsideBlock: !!select(external_wp_preferences_namespaceObject.store).get('core/edit-widgets', 'keepCaretInsideBlock')
3164 3044 }), []);
3165 3045 const {
3166 3046 setIsInserterOpened
3167 3047 } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
@@ -3167,9 +3047,9 @@
3167 3047 } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
3168 3048 const settings = (0,external_wp_element_namespaceObject.useMemo)(() => {
3169 3049 let mediaUploadBlockEditor;
3170 3050
3171 - if (hasUploadPermissions) {
3051 + if (mediaPermissions.canCreate) {
3172 3052 mediaUploadBlockEditor = _ref2 => {
3173 3053 let {
3174 3054 onError,
3175 3055 ...argumentsObject
@@ -3194,9 +3074,9 @@
3194 3074 mediaUpload: mediaUploadBlockEditor,
3195 3075 templateLock: 'all',
3196 3076 __experimentalSetIsInserterOpened: setIsInserterOpened
3197 3077 };
3198 - }, [blockEditorSettings, isFixedToolbarActive, keepCaretInsideBlock, hasUploadPermissions, reusableBlocks, setIsInserterOpened]);
3078 + }, [blockEditorSettings, isFixedToolbarActive, keepCaretInsideBlock, mediaPermissions.canCreate, reusableBlocks, setIsInserterOpened]);
3199 3079 const widgetAreaId = use_last_selected_widget_area();
3200 3080 const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)(KIND, POST_TYPE, {
3201 3081 id: buildWidgetAreasPostId()
3202 3082 });
@@ -3209,9 +3089,9 @@
3209 3089 }, props), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.CopyHandler, null, children), (0,external_wp_element_namespaceObject.createElement)(external_wp_reusableBlocks_namespaceObject.ReusableBlocksMenuItems, {
3210 3090 rootClientId: widgetAreaId
3211 3091 }))));
3212 3092 }
3213 -//# sourceMappingURL=index.js.map
3093 +
3214 3094 ;// CONCATENATED MODULE: ./packages/icons/build-module/library/cog.js
3215 3095
3216 3096
3217 3097 /**
@@ -3225,10 +3105,10 @@
3225 3105 fillRule: "evenodd",
3226 3106 d: "M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",
3227 3107 clipRule: "evenodd"
3228 3108 }));
3229 -/* harmony default export */ var library_cog = (cog);
3230 -//# sourceMappingURL=cog.js.map
3109 +/* harmony default export */ const library_cog = (cog);
3110 +
3231 3111 ;// CONCATENATED MODULE: ./packages/icons/build-module/library/block-default.js
3232 3112
3233 3113
3234 3114 /**
@@ -3240,14 +3120,14 @@
3240 3120 viewBox: "0 0 24 24"
3241 3121 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
3242 3122 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"
3243 3123 }));
3244 -/* harmony default export */ var block_default = (blockDefault);
3245 -//# sourceMappingURL=block-default.js.map
3124 +/* harmony default export */ const block_default = (blockDefault);
3125 +
3246 3126 ;// CONCATENATED MODULE: external ["wp","url"]
3247 -var external_wp_url_namespaceObject = window["wp"]["url"];
3127 +const external_wp_url_namespaceObject = window["wp"]["url"];
3248 3128 ;// CONCATENATED MODULE: external ["wp","dom"]
3249 -var external_wp_dom_namespaceObject = window["wp"]["dom"];
3129 +const external_wp_dom_namespaceObject = window["wp"]["dom"];
3250 3130 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/components/sidebar/widget-areas.js
3251 3131
3252 3132
3253 3133 /**
@@ -3303,9 +3183,9 @@
3303 3183 }),
3304 3184 variant: "tertiary"
3305 3185 }, (0,external_wp_i18n_namespaceObject.__)('Manage with live preview')))));
3306 3186 }
3307 -//# sourceMappingURL=widget-areas.js.map
3187 +
3308 3188 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/components/sidebar/index.js
3309 3189
3310 3190
3311 3191 /**
@@ -3443,9 +3323,9 @@
3443 3323 (0,external_wp_element_namespaceObject.createElement)("span", {
3444 3324 className: "block-editor-block-inspector__no-blocks"
3445 3325 }, (0,external_wp_i18n_namespaceObject.__)('No block selected.'))));
3446 3326 }
3447 -//# sourceMappingURL=index.js.map
3327 +
3448 3328 ;// CONCATENATED MODULE: ./packages/icons/build-module/library/plus.js
3449 3329
3450 3330
3451 3331 /**
@@ -3457,10 +3337,10 @@
3457 3337 viewBox: "0 0 24 24"
3458 3338 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
3459 3339 d: "M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"
3460 3340 }));
3461 -/* harmony default export */ var library_plus = (plus);
3462 -//# sourceMappingURL=plus.js.map
3341 +/* harmony default export */ const library_plus = (plus);
3342 +
3463 3343 ;// CONCATENATED MODULE: ./packages/icons/build-module/library/list-view.js
3464 3344
3465 3345
3466 3346 /**
@@ -3472,10 +3352,10 @@
3472 3352 xmlns: "http://www.w3.org/2000/svg"
3473 3353 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
3474 3354 d: "M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"
3475 3355 }));
3476 -/* harmony default export */ var list_view = (listView);
3477 -//# sourceMappingURL=list-view.js.map
3356 +/* harmony default export */ const list_view = (listView);
3357 +
3478 3358 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/components/save-button/index.js
3479 3359
3480 3360
3481 3361 /**
@@ -3517,10 +3397,10 @@
3517 3397 disabled: !hasEditedWidgetAreaIds
3518 3398 }, isSaving ? (0,external_wp_i18n_namespaceObject.__)('Saving…') : (0,external_wp_i18n_namespaceObject.__)('Update'));
3519 3399 }
3520 3400
3521 -/* harmony default export */ var save_button = (SaveButton);
3522 -//# sourceMappingURL=index.js.map
3401 +/* harmony default export */ const save_button = (SaveButton);
3402 +
3523 3403 ;// CONCATENATED MODULE: ./packages/icons/build-module/library/undo.js
3524 3404
3525 3405
3526 3406 /**
@@ -3532,10 +3412,10 @@
3532 3412 viewBox: "0 0 24 24"
3533 3413 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
3534 3414 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"
3535 3415 }));
3536 -/* harmony default export */ var library_undo = (undo);
3537 -//# sourceMappingURL=undo.js.map
3416 +/* harmony default export */ const library_undo = (undo);
3417 +
3538 3418 ;// CONCATENATED MODULE: ./packages/icons/build-module/library/redo.js
3539 3419
3540 3420
3541 3421 /**
@@ -3547,12 +3427,12 @@
3547 3427 viewBox: "0 0 24 24"
3548 3428 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
3549 3429 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"
3550 3430 }));
3551 -/* harmony default export */ var library_redo = (redo);
3552 -//# sourceMappingURL=redo.js.map
3431 +/* harmony default export */ const library_redo = (redo);
3432 +
3553 3433 ;// CONCATENATED MODULE: external ["wp","keycodes"]
3554 -var external_wp_keycodes_namespaceObject = window["wp"]["keycodes"];
3434 +const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"];
3555 3435 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/components/header/undo-redo/undo.js
3556 3436
3557 3437
3558 3438 /**
@@ -3579,9 +3459,9 @@
3579 3459 "aria-disabled": !hasUndo,
3580 3460 onClick: hasUndo ? undo : undefined
3581 3461 });
3582 3462 }
3583 -//# sourceMappingURL=undo.js.map
3463 +
3584 3464 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/components/header/undo-redo/redo.js
3585 3465
3586 3466
3587 3467 /**
@@ -3593,8 +3473,9 @@
3593 3473
3594 3474
3595 3475
3596 3476 function RedoButton() {
3477 + const shortcut = (0,external_wp_keycodes_namespaceObject.isAppleOS)() ? external_wp_keycodes_namespaceObject.displayShortcut.primaryShift('z') : external_wp_keycodes_namespaceObject.displayShortcut.primary('y');
3597 3478 const hasRedo = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).hasRedo(), []);
3598 3479 const {
3599 3480 redo
3600 3481 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
@@ -3600,9 +3481,9 @@
3600 3481 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
3601 3482 return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
3602 3483 icon: !(0,external_wp_i18n_namespaceObject.isRTL)() ? library_redo : library_undo,
3603 3484 label: (0,external_wp_i18n_namespaceObject.__)('Redo'),
3604 - shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primaryShift('z') // If there are no undo levels we don't want to actually disable this
3485 + shortcut: shortcut // If there are no undo levels we don't want to actually disable this
3605 3486 // button, because it will remove focus for keyboard users.
3606 3487 // See: https://github.com/WordPress/gutenberg/issues/3486
3607 3488 ,
3608 3489 "aria-disabled": !hasRedo,
@@ -3608,9 +3489,9 @@
3608 3489 "aria-disabled": !hasRedo,
3609 3490 onClick: hasRedo ? redo : undefined
3610 3491 });
3611 3492 }
3612 -//# sourceMappingURL=redo.js.map
3493 +
3613 3494 ;// CONCATENATED MODULE: ./packages/icons/build-module/library/external.js
3614 3495
3615 3496
3616 3497 /**
@@ -3622,10 +3503,10 @@
3622 3503 viewBox: "0 0 24 24"
3623 3504 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
3624 3505 d: "M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"
3625 3506 }));
3626 -/* harmony default export */ var library_external = (external);
3627 -//# sourceMappingURL=external.js.map
3507 +/* harmony default export */ const library_external = (external);
3508 +
3628 3509 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/components/keyboard-shortcut-help-modal/config.js
3629 3510 /**
3630 3511 * WordPress dependencies
3631 3512 */
@@ -3655,28 +3536,40 @@
3655 3536 },
3656 3537 description: (0,external_wp_i18n_namespaceObject.__)('Remove a link.')
3657 3538 }, {
3658 3539 keyCombination: {
3540 + character: '[['
3541 + },
3542 + description: (0,external_wp_i18n_namespaceObject.__)('Insert a link to a post or page')
3543 +}, {
3544 + keyCombination: {
3659 3545 modifier: 'primary',
3660 3546 character: 'u'
3661 3547 },
3662 3548 description: (0,external_wp_i18n_namespaceObject.__)('Underline the selected text.')
3549 +}, {
3550 + keyCombination: {
3551 + modifier: 'access',
3552 + character: 'd'
3553 + },
3554 + description: (0,external_wp_i18n_namespaceObject.__)('Strikethrough the selected text.')
3555 +}, {
3556 + keyCombination: {
3557 + modifier: 'access',
3558 + character: 'x'
3559 + },
3560 + description: (0,external_wp_i18n_namespaceObject.__)('Make the selected text inline code.')
3663 3561 }];
3664 -//# sourceMappingURL=config.js.map
3562 +
3665 3563 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/components/keyboard-shortcut-help-modal/shortcut.js
3666 3564
3667 3565
3668 3566 /**
3669 - * External dependencies
3670 - */
3671 -
3672 -/**
3673 3567 * WordPress dependencies
3674 3568 */
3675 3569
3676 3570
3677 3571
3678 -
3679 3572 function KeyCombination(_ref) {
3680 3573 let {
3681 3574 keyCombination,
3682 3575 forceAriaLabel
@@ -3682,12 +3575,13 @@
3682 3575 forceAriaLabel
3683 3576 } = _ref;
3684 3577 const shortcut = keyCombination.modifier ? external_wp_keycodes_namespaceObject.displayShortcutList[keyCombination.modifier](keyCombination.character) : keyCombination.character;
3685 3578 const ariaLabel = keyCombination.modifier ? external_wp_keycodes_namespaceObject.shortcutAriaLabel[keyCombination.modifier](keyCombination.character) : keyCombination.character;
3579 + const shortcuts = Array.isArray(shortcut) ? shortcut : [shortcut];
3686 3580 return (0,external_wp_element_namespaceObject.createElement)("kbd", {
3687 3581 className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-key-combination",
3688 3582 "aria-label": forceAriaLabel || ariaLabel
3689 - }, (0,external_lodash_namespaceObject.castArray)(shortcut).map((character, index) => {
3583 + }, shortcuts.map((character, index) => {
3690 3584 if (character === '+') {
3691 3585 return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, {
3692 3586 key: index
3693 3587 }, character);
@@ -3720,10 +3614,10 @@
3720 3614 key: index
3721 3615 }))));
3722 3616 }
3723 3617
3724 -/* harmony default export */ var keyboard_shortcut_help_modal_shortcut = (Shortcut);
3725 -//# sourceMappingURL=shortcut.js.map
3618 +/* harmony default export */ const keyboard_shortcut_help_modal_shortcut = (Shortcut);
3619 +
3726 3620 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js
3727 3621
3728 3622
3729 3623 /**
@@ -3768,10 +3662,10 @@
3768 3662 aliases: aliases
3769 3663 });
3770 3664 }
3771 3665
3772 -/* harmony default export */ var dynamic_shortcut = (DynamicShortcut);
3773 -//# sourceMappingURL=dynamic-shortcut.js.map
3666 +/* harmony default export */ const dynamic_shortcut = (DynamicShortcut);
3667 +
3774 3668 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/components/keyboard-shortcut-help-modal/index.js
3775 3669
3776 3670
3777 3671 /**
@@ -3777,9 +3671,8 @@
3777 3671 /**
3778 3672 * External dependencies
3779 3673 */
3780 3674
3781 -
3782 3675 /**
3783 3676 * WordPress dependencies
3784 3677 */
3785 3678
@@ -3811,9 +3704,9 @@
3811 3704 role: "list"
3812 3705 }, shortcuts.map((shortcut, index) => (0,external_wp_element_namespaceObject.createElement)("li", {
3813 3706 className: "edit-widgets-keyboard-shortcut-help-modal__shortcut",
3814 3707 key: index
3815 - }, (0,external_lodash_namespaceObject.isString)(shortcut) ? (0,external_wp_element_namespaceObject.createElement)(dynamic_shortcut, {
3708 + }, typeof shortcut === 'string' ? (0,external_wp_element_namespaceObject.createElement)(dynamic_shortcut, {
3816 3709 name: shortcut
3817 3710 }) : (0,external_wp_element_namespaceObject.createElement)(keyboard_shortcut_help_modal_shortcut, shortcut))))
3818 3711 /* eslint-enable jsx-a11y/no-redundant-roles */
3819 3712
@@ -3893,21 +3786,16 @@
3893 3786 title: (0,external_wp_i18n_namespaceObject.__)('Text formatting'),
3894 3787 shortcuts: textFormattingShortcuts
3895 3788 }));
3896 3789 }
3897 -//# sourceMappingURL=index.js.map
3790 +
3898 3791 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/components/more-menu/tools-more-menu-group.js
3899 3792
3900 3793
3901 3794 /**
3902 - * External dependencies
3903 - */
3904 -
3905 -/**
3906 3795 * WordPress dependencies
3907 3796 */
3908 3797
3909 -
3910 3798 const {
3911 3799 Fill: ToolsMoreMenuGroup,
3912 3800 Slot
3913 3801 } = (0,external_wp_components_namespaceObject.createSlotFill)('EditWidgetsToolsMoreMenuGroup');
@@ -3917,13 +3805,13 @@
3917 3805 fillProps
3918 3806 } = _ref;
3919 3807 return (0,external_wp_element_namespaceObject.createElement)(Slot, {
3920 3808 fillProps: fillProps
3921 - }, fills => !(0,external_lodash_namespaceObject.isEmpty)(fills) && fills);
3809 + }, fills => fills.length > 0 && fills);
3922 3810 };
3923 3811
3924 -/* harmony default export */ var tools_more_menu_group = (ToolsMoreMenuGroup);
3925 -//# sourceMappingURL=tools-more-menu-group.js.map
3812 +/* harmony default export */ const tools_more_menu_group = (ToolsMoreMenuGroup);
3813 +
3926 3814 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/components/more-menu/index.js
3927 3815
3928 3816
3929 3817 /**
@@ -3936,8 +3824,9 @@
3936 3824
3937 3825
3938 3826
3939 3827
3828 +
3940 3829 /**
3941 3830 * Internal dependencies
3942 3831 */
3943 3832
@@ -3951,11 +3840,11 @@
3951 3840 (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/edit-widgets/keyboard-shortcuts', toggleKeyboardShortcutsModal);
3952 3841 const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium');
3953 3842 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, {
3954 3843 label: (0,external_wp_i18n_namespaceObject._x)('View', 'noun')
3955 - }, (0,external_wp_element_namespaceObject.createElement)(MoreMenuFeatureToggle, {
3844 + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, {
3956 3845 scope: "core/edit-widgets",
3957 - feature: "fixedToolbar",
3846 + name: "fixedToolbar",
3958 3847 label: (0,external_wp_i18n_namespaceObject.__)('Top toolbar'),
3959 3848 info: (0,external_wp_i18n_namespaceObject.__)('Access all block and document tools in a single place'),
3960 3849 messageActivated: (0,external_wp_i18n_namespaceObject.__)('Top toolbar activated'),
3961 3850 messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Top toolbar deactivated')
@@ -3965,11 +3854,11 @@
3965 3854 onClick: () => {
3966 3855 setIsKeyboardShortcutsModalVisible(true);
3967 3856 },
3968 3857 shortcut: external_wp_keycodes_namespaceObject.displayShortcut.access('h')
3969 - }, (0,external_wp_i18n_namespaceObject.__)('Keyboard shortcuts')), (0,external_wp_element_namespaceObject.createElement)(MoreMenuFeatureToggle, {
3858 + }, (0,external_wp_i18n_namespaceObject.__)('Keyboard shortcuts')), (0,external_wp_element_namespaceObject.createElement)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, {
3970 3859 scope: "core/edit-widgets",
3971 - feature: "welcomeGuide",
3860 + name: "welcomeGuide",
3972 3861 label: (0,external_wp_i18n_namespaceObject.__)('Welcome Guide')
3973 3862 }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
3974 3863 role: "menuitem",
3975 3864 icon: library_external,
@@ -3985,23 +3874,23 @@
3985 3874 onClose
3986 3875 }
3987 3876 })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
3988 3877 label: (0,external_wp_i18n_namespaceObject.__)('Preferences')
3989 - }, (0,external_wp_element_namespaceObject.createElement)(MoreMenuFeatureToggle, {
3878 + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, {
3990 3879 scope: "core/edit-widgets",
3991 - feature: "keepCaretInsideBlock",
3880 + name: "keepCaretInsideBlock",
3992 3881 label: (0,external_wp_i18n_namespaceObject.__)('Contain text cursor inside block'),
3993 3882 info: (0,external_wp_i18n_namespaceObject.__)('Aids screen readers by stopping text caret from leaving blocks.'),
3994 3883 messageActivated: (0,external_wp_i18n_namespaceObject.__)('Contain text cursor inside block activated'),
3995 3884 messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Contain text cursor inside block deactivated')
3996 - }), (0,external_wp_element_namespaceObject.createElement)(MoreMenuFeatureToggle, {
3885 + }), (0,external_wp_element_namespaceObject.createElement)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, {
3997 3886 scope: "core/edit-widgets",
3998 - feature: "themeStyles",
3887 + name: "themeStyles",
3999 3888 info: (0,external_wp_i18n_namespaceObject.__)('Make the editor look like your theme.'),
4000 3889 label: (0,external_wp_i18n_namespaceObject.__)('Use theme styles')
4001 - }), isLargeViewport && (0,external_wp_element_namespaceObject.createElement)(MoreMenuFeatureToggle, {
3890 + }), isLargeViewport && (0,external_wp_element_namespaceObject.createElement)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, {
4002 3891 scope: "core/edit-widgets",
4003 - feature: "showBlockBreadcrumbs",
3892 + name: "showBlockBreadcrumbs",
4004 3893 label: (0,external_wp_i18n_namespaceObject.__)('Display block breadcrumbs'),
4005 3894 info: (0,external_wp_i18n_namespaceObject.__)('Shows block breadcrumbs at the bottom of the editor.'),
4006 3895 messageActivated: (0,external_wp_i18n_namespaceObject.__)('Display block breadcrumbs activated'),
4007 3896 messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Display block breadcrumbs deactivated')
@@ -4009,9 +3898,9 @@
4009 3898 isModalActive: isKeyboardShortcutsModalActive,
4010 3899 toggleModal: toggleKeyboardShortcutsModal
4011 3900 }));
4012 3901 }
4013 -//# sourceMappingURL=index.js.map
3902 +
4014 3903 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/components/header/index.js
4015 3904
4016 3905
4017 3906 /**
@@ -4064,9 +3953,9 @@
4064 3953 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
4065 3954
4066 3955 const handleClick = () => {
4067 3956 if (isInserterOpen) {
4068 - // Focusing the inserter button closes the inserter popover
3957 + // Focusing the inserter button closes the inserter popover.
4069 3958 setIsInserterOpened(false);
4070 3959 } else {
4071 3960 if (!isLastSelectedWidgetAreaOpen) {
4072 3961 // Select the last selected block if hasn't already.
@@ -4127,18 +4016,14 @@
4127 4016 scope: "core/edit-widgets"
4128 4017 }), (0,external_wp_element_namespaceObject.createElement)(MoreMenu, null))));
4129 4018 }
4130 4019
4131 -/* harmony default export */ var header = (Header);
4132 -//# sourceMappingURL=index.js.map
4020 +/* harmony default export */ const header = (Header);
4021 +
4133 4022 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/components/notices/index.js
4134 4023
4135 4024
4136 4025 /**
4137 - * External dependencies
4138 - */
4139 -
4140 -/**
4141 4026 * WordPress dependencies
4142 4027 */
4143 4028
4144 4029
@@ -4143,9 +4028,8 @@
4143 4028
4144 4029
4145 4030
4146 4031
4147 -
4148 4032 function Notices() {
4149 4033 const {
4150 4034 removeNotice
4151 4035 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
@@ -4155,18 +4039,27 @@
4155 4039 return {
4156 4040 notices: select(external_wp_notices_namespaceObject.store).getNotices()
4157 4041 };
4158 4042 }, []);
4159 - const dismissibleNotices = (0,external_lodash_namespaceObject.filter)(notices, {
4160 - isDismissible: true,
4161 - type: 'default'
4043 + const dismissibleNotices = notices.filter(_ref => {
4044 + let {
4045 + isDismissible,
4046 + type
4047 + } = _ref;
4048 + return isDismissible && type === 'default';
4162 4049 });
4163 - const nonDismissibleNotices = (0,external_lodash_namespaceObject.filter)(notices, {
4164 - isDismissible: false,
4165 - type: 'default'
4050 + const nonDismissibleNotices = notices.filter(_ref2 => {
4051 + let {
4052 + isDismissible,
4053 + type
4054 + } = _ref2;
4055 + return !isDismissible && type === 'default';
4166 4056 });
4167 - const snackbarNotices = (0,external_lodash_namespaceObject.filter)(notices, {
4168 - type: 'snackbar'
4057 + const snackbarNotices = notices.filter(_ref3 => {
4058 + let {
4059 + type
4060 + } = _ref3;
4061 + return type === 'snackbar';
4169 4062 });
4170 4063 return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.NoticeList, {
4171 4064 notices: nonDismissibleNotices,
4172 4065 className: "edit-widgets-notices__pinned"
@@ -4180,10 +4073,10 @@
4180 4073 onRemove: removeNotice
4181 4074 }));
4182 4075 }
4183 4076
4184 -/* harmony default export */ var notices = (Notices);
4185 -//# sourceMappingURL=index.js.map
4077 +/* harmony default export */ const notices = (Notices);
4078 +
4186 4079 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/components/widget-areas-block-editor-content/index.js
4187 4080
4188 4081
4189 4082 /**
@@ -4202,9 +4095,9 @@
4202 4095 function WidgetAreasBlockEditorContent(_ref) {
4203 4096 let {
4204 4097 blockEditorSettings
4205 4098 } = _ref;
4206 - const hasThemeStyles = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).isFeatureActive('core/edit-widgets', 'themeStyles'), []);
4099 + const hasThemeStyles = (0,external_wp_data_namespaceObject.useSelect)(select => !!select(external_wp_preferences_namespaceObject.store).get('core/edit-widgets', 'themeStyles'), []);
4207 4100 const styles = (0,external_wp_element_namespaceObject.useMemo)(() => {
4208 4101 return hasThemeStyles ? blockEditorSettings.styles : [];
4209 4102 }, [blockEditorSettings, hasThemeStyles]);
4210 4103 return (0,external_wp_element_namespaceObject.createElement)("div", {
@@ -4214,9 +4107,9 @@
4214 4107 }), (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.ObserveTyping, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockList, {
4215 4108 className: "edit-widgets-main-block-list"
4216 4109 }))))));
4217 4110 }
4218 -//# sourceMappingURL=index.js.map
4111 +
4219 4112 ;// CONCATENATED MODULE: ./packages/icons/build-module/library/close.js
4220 4113
4221 4114
4222 4115 /**
@@ -4228,10 +4121,10 @@
4228 4121 viewBox: "0 0 24 24"
4229 4122 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
4230 4123 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"
4231 4124 }));
4232 -/* harmony default export */ var library_close = (close_close);
4233 -//# sourceMappingURL=close.js.map
4125 +/* harmony default export */ const library_close = (close_close);
4126 +
4234 4127 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/hooks/use-widget-library-insertion-point.js
4235 4128 /**
4236 4129 * WordPress dependencies
4237 4130 */
@@ -4290,10 +4183,10 @@
4290 4183 };
4291 4184 }, [firstRootId]);
4292 4185 };
4293 4186
4294 -/* harmony default export */ var use_widget_library_insertion_point = (useWidgetLibraryInsertionPoint);
4295 -//# sourceMappingURL=use-widget-library-insertion-point.js.map
4187 +/* harmony default export */ const use_widget_library_insertion_point = (useWidgetLibraryInsertionPoint);
4188 +
4296 4189 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/components/secondary-sidebar/inserter-sidebar.js
4297 4190
4298 4191
4299 4192
@@ -4353,9 +4246,9 @@
4353 4246 __experimentalInsertionIndex: insertionIndex,
4354 4247 ref: libraryRef
4355 4248 })));
4356 4249 }
4357 -//# sourceMappingURL=inserter-sidebar.js.map
4250 +
4358 4251 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/components/secondary-sidebar/list-view-sidebar.js
4359 4252
4360 4253
4361 4254 /**
@@ -4376,18 +4269,8 @@
4376 4269 function ListViewSidebar() {
4377 4270 const {
4378 4271 setIsListViewOpened
4379 4272 } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
4380 - const {
4381 - clearSelectedBlock,
4382 - selectBlock
4383 - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
4384 -
4385 - async function selectEditorBlock(clientId) {
4386 - await clearSelectedBlock();
4387 - selectBlock(clientId, -1);
4388 - }
4389 -
4390 4273 const focusOnMountRef = (0,external_wp_compose_namespaceObject.useFocusOnMount)('firstElement');
4391 4274 const headerFocusReturnRef = (0,external_wp_compose_namespaceObject.useFocusReturn)();
4392 4275 const contentFocusReturnRef = (0,external_wp_compose_namespaceObject.useFocusReturn)();
4393 4276
@@ -4416,18 +4299,12 @@
4416 4299 onClick: () => setIsListViewOpened(false)
4417 4300 })), (0,external_wp_element_namespaceObject.createElement)("div", {
4418 4301 className: "edit-widgets-editor__list-view-panel-content",
4419 4302 ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([contentFocusReturnRef, focusOnMountRef])
4420 - }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalListView, {
4421 - onSelect: selectEditorBlock,
4422 - showNestedBlocks: true,
4423 - __experimentalHideContainerBlockActions: true,
4424 - __experimentalFeatures: true,
4425 - __experimentalPersistentListViewFeatures: true
4426 - })))
4303 + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalListView, null)))
4427 4304 );
4428 4305 }
4429 -//# sourceMappingURL=list-view-sidebar.js.map
4306 +
4430 4307 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/components/secondary-sidebar/index.js
4431 4308
4432 4309
4433 4310 /**
@@ -4469,9 +4346,9 @@
4469 4346 }
4470 4347
4471 4348 return null;
4472 4349 }
4473 -//# sourceMappingURL=index.js.map
4350 +
4474 4351 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/components/layout/interface.js
4475 4352
4476 4353
4477 4354 /**
@@ -4483,8 +4360,9 @@
4483 4360
4484 4361
4485 4362
4486 4363
4364 +
4487 4365 /**
4488 4366 * Internal dependencies
4489 4367 */
4490 4368
@@ -4527,9 +4405,9 @@
4527 4405 } = (0,external_wp_data_namespaceObject.useSelect)(select => ({
4528 4406 hasSidebarEnabled: !!select(store).getActiveComplementaryArea(store_store.name),
4529 4407 isInserterOpened: !!select(store_store).isInserterOpened(),
4530 4408 isListViewOpened: !!select(store_store).isListViewOpened(),
4531 - hasBlockBreadCrumbsEnabled: select(store).isFeatureActive('core/edit-widgets', 'showBlockBreadcrumbs'),
4409 + hasBlockBreadCrumbsEnabled: !!select(external_wp_preferences_namespaceObject.store).get('core/edit-widgets', 'showBlockBreadcrumbs'),
4532 4410 previousShortcut: select(external_wp_keyboardShortcuts_namespaceObject.store).getAllShortcutKeyCombinations('core/edit-widgets/previous-region'),
4533 4411 nextShortcut: select(external_wp_keyboardShortcuts_namespaceObject.store).getAllShortcutKeyCombinations('core/edit-widgets/next-region')
4534 4412 }), []); // Inserter and Sidebars are mutually exclusive
4535 4413
@@ -4543,11 +4421,14 @@
4543 4421 if ((isInserterOpened || isListViewOpened) && !isHugeViewport) {
4544 4422 closeGeneralSidebar();
4545 4423 }
4546 4424 }, [isInserterOpened, isListViewOpened, isHugeViewport]);
4425 + const secondarySidebarLabel = isListViewOpened ? (0,external_wp_i18n_namespaceObject.__)('List View') : (0,external_wp_i18n_namespaceObject.__)('Block Library');
4547 4426 const hasSecondarySidebar = isListViewOpened || isInserterOpened;
4548 4427 return (0,external_wp_element_namespaceObject.createElement)(interface_skeleton, {
4549 - labels: interfaceLabels,
4428 + labels: { ...interfaceLabels,
4429 + secondarySidebar: secondarySidebarLabel
4430 + },
4550 4431 header: (0,external_wp_element_namespaceObject.createElement)(header, null),
4551 4432 secondarySidebar: hasSecondarySidebar && (0,external_wp_element_namespaceObject.createElement)(SecondarySidebar, null),
4552 4433 sidebar: hasSidebarEnabled && (0,external_wp_element_namespaceObject.createElement)(complementary_area.Slot, {
4553 4434 scope: "core/edit-widgets"
@@ -4553,10 +4434,8 @@
4553 4434 scope: "core/edit-widgets"
4554 4435 }),
4555 4436 content: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(WidgetAreasBlockEditorContent, {
4556 4437 blockEditorSettings: blockEditorSettings
4557 - }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockStyles.Slot, {
4558 - scope: "core/block-inspector"
4559 4438 })),
4560 4439 footer: hasBlockBreadCrumbsEnabled && !isMobileViewport && (0,external_wp_element_namespaceObject.createElement)("div", {
4561 4440 className: "edit-widgets-layout__footer"
4562 4441 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockBreadcrumb, {
@@ -4568,10 +4447,10 @@
4568 4447 }
4569 4448 });
4570 4449 }
4571 4450
4572 -/* harmony default export */ var layout_interface = (Interface);
4573 -//# sourceMappingURL=interface.js.map
4451 +/* harmony default export */ const layout_interface = (Interface);
4452 +
4574 4453 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/components/layout/unsaved-changes-warning.js
4575 4454 /**
4576 4455 * WordPress dependencies
4577 4456 */
@@ -4621,9 +4500,9 @@
4621 4500 };
4622 4501 }, [isDirty]);
4623 4502 return null;
4624 4503 }
4625 -//# sourceMappingURL=unsaved-changes-warning.js.map
4504 +
4626 4505 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/components/welcome-guide/index.js
4627 4506
4628 4507
4629 4508 /**
@@ -4641,12 +4520,12 @@
4641 4520
4642 4521 function WelcomeGuide() {
4643 4522 var _widgetAreas$filter$l;
4644 4523
4645 - const isActive = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).isFeatureActive('core/edit-widgets', 'welcomeGuide'), []);
4524 + const isActive = (0,external_wp_data_namespaceObject.useSelect)(select => !!select(external_wp_preferences_namespaceObject.store).get('core/edit-widgets', 'welcomeGuide'), []);
4646 4525 const {
4647 - toggleFeature
4648 - } = (0,external_wp_data_namespaceObject.useDispatch)(store);
4526 + toggle
4527 + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store);
4649 4528 const widgetAreas = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getWidgetAreas({
4650 4529 per_page: -1
4651 4530 }), []);
4652 4531
@@ -4659,9 +4538,9 @@
4659 4538 return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Guide, {
4660 4539 className: "edit-widgets-welcome-guide",
4661 4540 contentLabel: (0,external_wp_i18n_namespaceObject.__)('Welcome to block Widgets'),
4662 4541 finishButtonText: (0,external_wp_i18n_namespaceObject.__)('Get started'),
4663 - onFinish: () => toggleFeature('core/edit-widgets', 'welcomeGuide'),
4542 + onFinish: () => toggle('core/edit-widgets', 'welcomeGuide'),
4664 4543 pages: [{
4665 4544 image: (0,external_wp_element_namespaceObject.createElement)(WelcomeGuideImage, {
4666 4545 nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.svg",
4667 4546 animatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.gif"
@@ -4736,9 +4615,9 @@
4736 4615 height: "240",
4737 4616 alt: ""
4738 4617 }));
4739 4618 }
4740 -//# sourceMappingURL=index.js.map
4619 +
4741 4620 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/components/layout/index.js
4742 4621
4743 4622
4744 4623 /**
@@ -4785,10 +4664,10 @@
4785 4664 onError: onPluginAreaError
4786 4665 }), (0,external_wp_element_namespaceObject.createElement)(UnsavedChangesWarning, null), (0,external_wp_element_namespaceObject.createElement)(WelcomeGuide, null)));
4787 4666 }
4788 4667
4789 -/* harmony default export */ var layout = (Layout);
4790 -//# sourceMappingURL=index.js.map
4668 +/* harmony default export */ const layout = (Layout);
4669 +
4791 4670 ;// CONCATENATED MODULE: ./packages/edit-widgets/build-module/index.js
4792 4671
4793 4672
4794 4673 /**
@@ -4842,9 +4721,9 @@
4842 4721 const coreBlocks = (0,external_wp_blockLibrary_namespaceObject.__experimentalGetCoreBlocks)().filter(block => {
4843 4722 return !(disabledBlocks.includes(block.name) || block.name.startsWith('core/post') || block.name.startsWith('core/query') || block.name.startsWith('core/site') || block.name.startsWith('core/navigation'));
4844 4723 });
4845 4724
4846 - (0,external_wp_data_namespaceObject.dispatch)(store).setFeatureDefaults('core/edit-widgets', {
4725 + (0,external_wp_data_namespaceObject.dispatch)(external_wp_preferences_namespaceObject.store).setDefaults('core/edit-widgets', {
4847 4726 fixedToolbar: false,
4848 4727 welcomeGuide: true,
4849 4728 showBlockBreadcrumbs: true,
4850 4729 themeStyles: true
@@ -4902,9 +4781,10 @@
4902 4781 }
4903 4782
4904 4783 (0,external_wp_blocks_namespaceObject.registerBlockType)(name, settings);
4905 4784 };
4906 -//# sourceMappingURL=index.js.map
4907 -}();
4785 +
4786 +})();
4787 +
4908 4788 (window.wp = window.wp || {}).editWidgets = __webpack_exports__;
4909 4789 /******/ })()
4910 4790 ;