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/customize-widgets/index.js +619 -753 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,632 +141,73 @@
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; }
145 + "initialize": () => (/* binding */ initialize)
146 146 });
147 147
148 -// NAMESPACE OBJECT: ./packages/interface/build-module/store/actions.js
148 +// NAMESPACE OBJECT: ./packages/customize-widgets/build-module/store/selectors.js
149 +var selectors_namespaceObject = {};
150 +__webpack_require__.r(selectors_namespaceObject);
151 +__webpack_require__.d(selectors_namespaceObject, {
152 + "__experimentalGetInsertionPoint": () => (__experimentalGetInsertionPoint),
153 + "isInserterOpened": () => (isInserterOpened)
154 +});
155 +
156 +// NAMESPACE OBJECT: ./packages/customize-widgets/build-module/store/actions.js
149 157 var actions_namespaceObject = {};
150 158 __webpack_require__.r(actions_namespaceObject);
151 159 __webpack_require__.d(actions_namespaceObject, {
152 - "disableComplementaryArea": function() { return disableComplementaryArea; },
153 - "enableComplementaryArea": function() { return enableComplementaryArea; },
154 - "pinItem": function() { return pinItem; },
155 - "setFeatureDefaults": function() { return setFeatureDefaults; },
156 - "setFeatureValue": function() { return setFeatureValue; },
157 - "toggleFeature": function() { return toggleFeature; },
158 - "unpinItem": function() { return unpinItem; }
160 + "setIsInserterOpened": () => (setIsInserterOpened)
159 161 });
160 162
161 -// NAMESPACE OBJECT: ./packages/interface/build-module/store/selectors.js
162 -var selectors_namespaceObject = {};
163 -__webpack_require__.r(selectors_namespaceObject);
164 -__webpack_require__.d(selectors_namespaceObject, {
165 - "getActiveComplementaryArea": function() { return getActiveComplementaryArea; },
166 - "isFeatureActive": function() { return isFeatureActive; },
167 - "isItemPinned": function() { return isItemPinned; }
163 +// NAMESPACE OBJECT: ./packages/interface/build-module/store/actions.js
164 +var store_actions_namespaceObject = {};
165 +__webpack_require__.r(store_actions_namespaceObject);
166 +__webpack_require__.d(store_actions_namespaceObject, {
167 + "disableComplementaryArea": () => (disableComplementaryArea),
168 + "enableComplementaryArea": () => (enableComplementaryArea),
169 + "pinItem": () => (pinItem),
170 + "setDefaultComplementaryArea": () => (setDefaultComplementaryArea),
171 + "setFeatureDefaults": () => (setFeatureDefaults),
172 + "setFeatureValue": () => (setFeatureValue),
173 + "toggleFeature": () => (toggleFeature),
174 + "unpinItem": () => (unpinItem)
168 175 });
169 176
170 -// NAMESPACE OBJECT: ./packages/customize-widgets/build-module/store/selectors.js
177 +// NAMESPACE OBJECT: ./packages/interface/build-module/store/selectors.js
171 178 var store_selectors_namespaceObject = {};
172 179 __webpack_require__.r(store_selectors_namespaceObject);
173 180 __webpack_require__.d(store_selectors_namespaceObject, {
174 - "__experimentalGetInsertionPoint": function() { return __experimentalGetInsertionPoint; },
175 - "isInserterOpened": function() { return isInserterOpened; }
181 + "getActiveComplementaryArea": () => (getActiveComplementaryArea),
182 + "isFeatureActive": () => (isFeatureActive),
183 + "isItemPinned": () => (isItemPinned)
176 184 });
177 185
178 -// NAMESPACE OBJECT: ./packages/customize-widgets/build-module/store/actions.js
179 -var store_actions_namespaceObject = {};
180 -__webpack_require__.r(store_actions_namespaceObject);
181 -__webpack_require__.d(store_actions_namespaceObject, {
182 - "setIsInserterOpened": function() { return setIsInserterOpened; }
183 -});
184 -
185 186 ;// CONCATENATED MODULE: external ["wp","element"]
186 -var external_wp_element_namespaceObject = window["wp"]["element"];
187 +const external_wp_element_namespaceObject = window["wp"]["element"];
187 188 ;// CONCATENATED MODULE: external ["wp","blockLibrary"]
188 -var external_wp_blockLibrary_namespaceObject = window["wp"]["blockLibrary"];
189 +const external_wp_blockLibrary_namespaceObject = window["wp"]["blockLibrary"];
189 190 ;// CONCATENATED MODULE: external ["wp","widgets"]
190 -var external_wp_widgets_namespaceObject = window["wp"]["widgets"];
191 +const external_wp_widgets_namespaceObject = window["wp"]["widgets"];
191 192 ;// CONCATENATED MODULE: external ["wp","blocks"]
192 -var external_wp_blocks_namespaceObject = window["wp"]["blocks"];
193 +const external_wp_blocks_namespaceObject = window["wp"]["blocks"];
193 194 ;// CONCATENATED MODULE: external ["wp","data"]
194 -var external_wp_data_namespaceObject = window["wp"]["data"];
195 -// EXTERNAL MODULE: ./node_modules/classnames/index.js
196 -var classnames = __webpack_require__(4184);
197 -var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
195 +const external_wp_data_namespaceObject = window["wp"]["data"];
196 +;// CONCATENATED MODULE: external ["wp","preferences"]
197 +const external_wp_preferences_namespaceObject = window["wp"]["preferences"];
198 198 ;// CONCATENATED MODULE: external ["wp","components"]
199 -var external_wp_components_namespaceObject = window["wp"]["components"];
199 +const external_wp_components_namespaceObject = window["wp"]["components"];
200 +;// CONCATENATED MODULE: external ["wp","keyboardShortcuts"]
201 +const external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShortcuts"];
200 202 ;// CONCATENATED MODULE: external ["wp","i18n"]
201 -var external_wp_i18n_namespaceObject = window["wp"]["i18n"];
202 -;// CONCATENATED MODULE: external ["wp","primitives"]
203 -var external_wp_primitives_namespaceObject = window["wp"]["primitives"];
204 -;// CONCATENATED MODULE: ./packages/icons/build-module/library/more-vertical.js
205 -
206 -
207 -/**
208 - * WordPress dependencies
209 - */
210 -
211 -const moreVertical = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
212 - xmlns: "http://www.w3.org/2000/svg",
213 - viewBox: "0 0 24 24"
214 -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
215 - d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"
216 -}));
217 -/* harmony default export */ var more_vertical = (moreVertical);
218 -//# sourceMappingURL=more-vertical.js.map
219 -;// CONCATENATED MODULE: ./packages/interface/build-module/components/more-menu-dropdown/index.js
220 -
221 -
222 -/**
223 - * External dependencies
224 - */
225 -
226 -/**
227 - * WordPress dependencies
228 - */
229 -
230 -
231 -
232 -
233 -function MoreMenuDropdown(_ref) {
234 - let {
235 - as: DropdownComponent = external_wp_components_namespaceObject.DropdownMenu,
236 - className,
237 -
238 - /* translators: button label text should, if possible, be under 16 characters. */
239 - label = (0,external_wp_i18n_namespaceObject.__)('Options'),
240 - popoverProps,
241 - toggleProps,
242 - children
243 - } = _ref;
244 - return (0,external_wp_element_namespaceObject.createElement)(DropdownComponent, {
245 - className: classnames_default()('interface-more-menu-dropdown', className),
246 - icon: more_vertical,
247 - label: label,
248 - popoverProps: {
249 - position: 'bottom left',
250 - ...popoverProps,
251 - className: classnames_default()('interface-more-menu-dropdown__content', popoverProps === null || popoverProps === void 0 ? void 0 : popoverProps.className)
252 - },
253 - toggleProps: {
254 - tooltipPosition: 'bottom',
255 - ...toggleProps
256 - }
257 - }, onClose => children(onClose));
258 -}
259 -//# sourceMappingURL=index.js.map
260 -;// CONCATENATED MODULE: ./packages/icons/build-module/library/check.js
261 -
262 -
263 -/**
264 - * WordPress dependencies
265 - */
266 -
267 -const check = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
268 - xmlns: "http://www.w3.org/2000/svg",
269 - viewBox: "0 0 24 24"
270 -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
271 - d: "M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"
272 -}));
273 -/* harmony default export */ var library_check = (check);
274 -//# sourceMappingURL=check.js.map
275 -;// CONCATENATED MODULE: external ["wp","a11y"]
276 -var external_wp_a11y_namespaceObject = window["wp"]["a11y"];
277 -;// CONCATENATED MODULE: external "lodash"
278 -var external_lodash_namespaceObject = window["lodash"];
279 -;// CONCATENATED MODULE: ./packages/interface/build-module/store/reducer.js
280 -/**
281 - * External dependencies
282 - */
283 -
284 -/**
285 - * WordPress dependencies
286 - */
287 -
288 -
289 -/**
290 - * Reducer to keep tract of the active area per scope.
291 - *
292 - * @param {boolean} state Previous state.
293 - * @param {Object} action Action object.
294 - * @param {string} action.type Action type.
295 - * @param {string} action.itemType Type of item.
296 - * @param {string} action.scope Item scope.
297 - * @param {string} action.item Item name.
298 - *
299 - * @return {Object} Updated state.
300 - */
301 -
302 -function singleEnableItems() {
303 - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
304 - let {
305 - type,
306 - itemType,
307 - scope,
308 - item
309 - } = arguments.length > 1 ? arguments[1] : undefined;
310 -
311 - if (type !== 'SET_SINGLE_ENABLE_ITEM' || !itemType || !scope) {
312 - return state;
313 - }
314 -
315 - return { ...state,
316 - [itemType]: { ...state[itemType],
317 - [scope]: item || null
318 - }
319 - };
320 -}
321 -/**
322 - * Reducer keeping track of the "pinned" items per scope.
323 - *
324 - * @param {boolean} state Previous state.
325 - * @param {Object} action Action object.
326 - * @param {string} action.type Action type.
327 - * @param {string} action.itemType Type of item.
328 - * @param {string} action.scope Item scope.
329 - * @param {string} action.item Item name.
330 - * @param {boolean} action.isEnable Whether the item is pinned.
331 - *
332 - * @return {Object} Updated state.
333 - */
334 -
335 -function multipleEnableItems() {
336 - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
337 - let {
338 - type,
339 - itemType,
340 - scope,
341 - item,
342 - isEnable
343 - } = arguments.length > 1 ? arguments[1] : undefined;
344 -
345 - if (type !== 'SET_MULTIPLE_ENABLE_ITEM' || !itemType || !scope || !item || (0,external_lodash_namespaceObject.get)(state, [itemType, scope, item]) === isEnable) {
346 - return state;
347 - }
348 -
349 - const currentTypeState = state[itemType] || {};
350 - const currentScopeState = currentTypeState[scope] || {};
351 - return { ...state,
352 - [itemType]: { ...currentTypeState,
353 - [scope]: { ...currentScopeState,
354 - [item]: isEnable || false
355 - }
356 - }
357 - };
358 -}
359 -/**
360 - * Reducer returning the defaults for user preferences.
361 - *
362 - * This is kept intentionally separate from the preferences
363 - * themselves so that defaults are not persisted.
364 - *
365 - * @param {Object} state Current state.
366 - * @param {Object} action Dispatched action.
367 - *
368 - * @return {Object} Updated state.
369 - */
370 -
371 -const preferenceDefaults = (0,external_wp_data_namespaceObject.combineReducers)({
372 - features() {
373 - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
374 - let action = arguments.length > 1 ? arguments[1] : undefined;
375 -
376 - if (action.type === 'SET_FEATURE_DEFAULTS') {
377 - const {
378 - scope,
379 - defaults
380 - } = action;
381 - return { ...state,
382 - [scope]: { ...state[scope],
383 - ...defaults
384 - }
385 - };
386 - }
387 -
388 - return state;
389 - }
390 -
391 -});
392 -/**
393 - * Reducer returning the user preferences.
394 - *
395 - * @param {Object} state Current state.
396 - * @param {Object} action Dispatched action.
397 - *
398 - * @return {Object} Updated state.
399 - */
400 -
401 -const preferences = (0,external_wp_data_namespaceObject.combineReducers)({
402 - features() {
403 - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
404 - let action = arguments.length > 1 ? arguments[1] : undefined;
405 -
406 - if (action.type === 'SET_FEATURE_VALUE') {
407 - const {
408 - scope,
409 - featureName,
410 - value
411 - } = action;
412 - return { ...state,
413 - [scope]: { ...state[scope],
414 - [featureName]: value
415 - }
416 - };
417 - }
418 -
419 - return state;
420 - }
421 -
422 -});
423 -const enableItems = (0,external_wp_data_namespaceObject.combineReducers)({
424 - singleEnableItems,
425 - multipleEnableItems
426 -});
427 -/* harmony default export */ var reducer = ((0,external_wp_data_namespaceObject.combineReducers)({
428 - enableItems,
429 - preferenceDefaults,
430 - preferences
431 -}));
432 -//# sourceMappingURL=reducer.js.map
433 -;// CONCATENATED MODULE: ./packages/interface/build-module/store/actions.js
434 -/**
435 - * Returns an action object used in signalling that an active area should be changed.
436 - *
437 - * @param {string} itemType Type of item.
438 - * @param {string} scope Item scope.
439 - * @param {string} item Item identifier.
440 - *
441 - * @return {Object} Action object.
442 - */
443 -function setSingleEnableItem(itemType, scope, item) {
444 - return {
445 - type: 'SET_SINGLE_ENABLE_ITEM',
446 - itemType,
447 - scope,
448 - item
449 - };
450 -}
451 -/**
452 - * Returns an action object used in signalling that a complementary item should be enabled.
453 - *
454 - * @param {string} scope Complementary area scope.
455 - * @param {string} area Area identifier.
456 - *
457 - * @return {Object} Action object.
458 - */
459 -
460 -
461 -function enableComplementaryArea(scope, area) {
462 - return setSingleEnableItem('complementaryArea', scope, area);
463 -}
464 -/**
465 - * Returns an action object used in signalling that the complementary area of a given scope should be disabled.
466 - *
467 - * @param {string} scope Complementary area scope.
468 - *
469 - * @return {Object} Action object.
470 - */
471 -
472 -function disableComplementaryArea(scope) {
473 - return setSingleEnableItem('complementaryArea', scope, undefined);
474 -}
475 -/**
476 - * Returns an action object to make an area enabled/disabled.
477 - *
478 - * @param {string} itemType Type of item.
479 - * @param {string} scope Item scope.
480 - * @param {string} item Item identifier.
481 - * @param {boolean} isEnable Boolean indicating if an area should be pinned or not.
482 - *
483 - * @return {Object} Action object.
484 - */
485 -
486 -function setMultipleEnableItem(itemType, scope, item, isEnable) {
487 - return {
488 - type: 'SET_MULTIPLE_ENABLE_ITEM',
489 - itemType,
490 - scope,
491 - item,
492 - isEnable
493 - };
494 -}
495 -/**
496 - * Returns an action object used in signalling that an item should be pinned.
497 - *
498 - * @param {string} scope Item scope.
499 - * @param {string} itemId Item identifier.
500 - *
501 - * @return {Object} Action object.
502 - */
503 -
504 -
505 -function pinItem(scope, itemId) {
506 - return setMultipleEnableItem('pinnedItems', scope, itemId, true);
507 -}
508 -/**
509 - * Returns an action object used in signalling that an item should be unpinned.
510 - *
511 - * @param {string} scope Item scope.
512 - * @param {string} itemId Item identifier.
513 - *
514 - * @return {Object} Action object.
515 - */
516 -
517 -function unpinItem(scope, itemId) {
518 - return setMultipleEnableItem('pinnedItems', scope, itemId, false);
519 -}
520 -/**
521 - * Returns an action object used in signalling that a feature should be toggled.
522 - *
523 - * @param {string} scope The feature scope (e.g. core/edit-post).
524 - * @param {string} featureName The feature name.
525 - */
526 -
527 -function toggleFeature(scope, featureName) {
528 - return function (_ref) {
529 - let {
530 - select,
531 - dispatch
532 - } = _ref;
533 - const currentValue = select.isFeatureActive(scope, featureName);
534 - dispatch.setFeatureValue(scope, featureName, !currentValue);
535 - };
536 -}
537 -/**
538 - * Returns an action object used in signalling that a feature should be set to
539 - * a true or false value
540 - *
541 - * @param {string} scope The feature scope (e.g. core/edit-post).
542 - * @param {string} featureName The feature name.
543 - * @param {boolean} value The value to set.
544 - *
545 - * @return {Object} Action object.
546 - */
547 -
548 -function setFeatureValue(scope, featureName, value) {
549 - return {
550 - type: 'SET_FEATURE_VALUE',
551 - scope,
552 - featureName,
553 - value: !!value
554 - };
555 -}
556 -/**
557 - * Returns an action object used in signalling that defaults should be set for features.
558 - *
559 - * @param {string} scope The feature scope (e.g. core/edit-post).
560 - * @param {Object<string, boolean>} defaults A key/value map of feature names to values.
561 - *
562 - * @return {Object} Action object.
563 - */
564 -
565 -function setFeatureDefaults(scope, defaults) {
566 - return {
567 - type: 'SET_FEATURE_DEFAULTS',
568 - scope,
569 - defaults
570 - };
571 -}
572 -//# sourceMappingURL=actions.js.map
573 -;// CONCATENATED MODULE: ./packages/interface/build-module/store/selectors.js
574 -/**
575 - * External dependencies
576 - */
577 -
578 -/**
579 - * Returns the item that is enabled in a given scope.
580 - *
581 - * @param {Object} state Global application state.
582 - * @param {string} itemType Type of item.
583 - * @param {string} scope Item scope.
584 - *
585 - * @return {?string|null} The item that is enabled in the passed scope and type.
586 - */
587 -
588 -function getSingleEnableItem(state, itemType, scope) {
589 - return (0,external_lodash_namespaceObject.get)(state.enableItems.singleEnableItems, [itemType, scope]);
590 -}
591 -/**
592 - * Returns the complementary area that is active in a given scope.
593 - *
594 - * @param {Object} state Global application state.
595 - * @param {string} scope Item scope.
596 - *
597 - * @return {string} The complementary area that is active in the given scope.
598 - */
599 -
600 -
601 -function getActiveComplementaryArea(state, scope) {
602 - return getSingleEnableItem(state, 'complementaryArea', scope);
603 -}
604 -/**
605 - * Returns a boolean indicating if an item is enabled or not in a given scope.
606 - *
607 - * @param {Object} state Global application state.
608 - * @param {string} itemType Type of item.
609 - * @param {string} scope Scope.
610 - * @param {string} item Item to check.
611 - *
612 - * @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.
613 - */
614 -
615 -function isMultipleEnabledItemEnabled(state, itemType, scope, item) {
616 - return (0,external_lodash_namespaceObject.get)(state.enableItems.multipleEnableItems, [itemType, scope, item]);
617 -}
618 -/**
619 - * Returns a boolean indicating if an item is pinned or not.
620 - *
621 - * @param {Object} state Global application state.
622 - * @param {string} scope Scope.
623 - * @param {string} item Item to check.
624 - *
625 - * @return {boolean} True if the item is pinned and false otherwise.
626 - */
627 -
628 -
629 -function isItemPinned(state, scope, item) {
630 - return isMultipleEnabledItemEnabled(state, 'pinnedItems', scope, item) !== false;
631 -}
632 -/**
633 - * Returns a boolean indicating whether a feature is active for a particular
634 - * scope.
635 - *
636 - * @param {Object} state The store state.
637 - * @param {string} scope The scope of the feature (e.g. core/edit-post).
638 - * @param {string} featureName The name of the feature.
639 - *
640 - * @return {boolean} Is the feature enabled?
641 - */
642 -
643 -function isFeatureActive(state, scope, featureName) {
644 - var _state$preferences$fe, _state$preferenceDefa;
645 -
646 - const featureValue = (_state$preferences$fe = state.preferences.features[scope]) === null || _state$preferences$fe === void 0 ? void 0 : _state$preferences$fe[featureName];
647 - const defaultedFeatureValue = featureValue !== undefined ? featureValue : (_state$preferenceDefa = state.preferenceDefaults.features[scope]) === null || _state$preferenceDefa === void 0 ? void 0 : _state$preferenceDefa[featureName];
648 - return !!defaultedFeatureValue;
649 -}
650 -//# sourceMappingURL=selectors.js.map
651 -;// CONCATENATED MODULE: ./packages/interface/build-module/store/constants.js
652 -/**
653 - * The identifier for the data store.
654 - *
655 - * @type {string}
656 - */
657 -const STORE_NAME = 'core/interface';
658 -//# sourceMappingURL=constants.js.map
659 -;// CONCATENATED MODULE: ./packages/interface/build-module/store/index.js
660 -/**
661 - * WordPress dependencies
662 - */
663 -
664 -/**
665 - * Internal dependencies
666 - */
667 -
668 -
669 -
670 -
671 -
672 -/**
673 - * Store definition for the interface namespace.
674 - *
675 - * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
676 - *
677 - * @type {Object}
678 - */
679 -
680 -const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, {
681 - reducer: reducer,
682 - actions: actions_namespaceObject,
683 - selectors: selectors_namespaceObject,
684 - persist: ['enableItems', 'preferences'],
685 - __experimentalUseThunks: true
686 -}); // Once we build a more generic persistence plugin that works across types of stores
687 -// we'd be able to replace this with a register call.
688 -
689 -(0,external_wp_data_namespaceObject.registerStore)(STORE_NAME, {
690 - reducer: reducer,
691 - actions: actions_namespaceObject,
692 - selectors: selectors_namespaceObject,
693 - persist: ['enableItems', 'preferences'],
694 - __experimentalUseThunks: true
695 -});
696 -//# sourceMappingURL=index.js.map
697 -;// CONCATENATED MODULE: ./packages/interface/build-module/components/more-menu-feature-toggle/index.js
698 -
699 -
700 -/**
701 - * WordPress dependencies
702 - */
703 -
704 -
705 -
706 -
707 -
708 -/**
709 - * Internal dependencies
710 - */
711 -
712 -
713 -function MoreMenuFeatureToggle(_ref) {
714 - let {
715 - scope,
716 - label,
717 - info,
718 - messageActivated,
719 - messageDeactivated,
720 - shortcut,
721 - feature
722 - } = _ref;
723 - const isActive = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).isFeatureActive(scope, feature), [feature]);
724 - const {
725 - toggleFeature
726 - } = (0,external_wp_data_namespaceObject.useDispatch)(store);
727 -
728 - const speakMessage = () => {
729 - if (isActive) {
730 - (0,external_wp_a11y_namespaceObject.speak)(messageDeactivated || (0,external_wp_i18n_namespaceObject.__)('Feature deactivated'));
731 - } else {
732 - (0,external_wp_a11y_namespaceObject.speak)(messageActivated || (0,external_wp_i18n_namespaceObject.__)('Feature activated'));
733 - }
734 - };
735 -
736 - return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
737 - icon: isActive && library_check,
738 - isSelected: isActive,
739 - onClick: () => {
740 - toggleFeature(scope, feature);
741 - speakMessage();
742 - },
743 - role: "menuitemcheckbox",
744 - info: info,
745 - shortcut: shortcut
746 - }, label);
747 -}
748 -//# sourceMappingURL=index.js.map
749 -;// CONCATENATED MODULE: ./packages/interface/build-module/components/index.js
750 -
751 -
752 -
753 -
754 -
755 -
756 -
757 -
758 -//# sourceMappingURL=index.js.map
759 -;// CONCATENATED MODULE: ./packages/interface/build-module/index.js
760 -
761 -
762 -//# sourceMappingURL=index.js.map
763 -;// CONCATENATED MODULE: external ["wp","keyboardShortcuts"]
764 -var external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShortcuts"];
203 +const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
765 204 ;// CONCATENATED MODULE: external ["wp","blockEditor"]
766 -var external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"];
205 +const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"];
767 206 ;// CONCATENATED MODULE: external ["wp","compose"]
768 -var external_wp_compose_namespaceObject = window["wp"]["compose"];
207 +const external_wp_compose_namespaceObject = window["wp"]["compose"];
208 +;// CONCATENATED MODULE: external ["wp","hooks"]
209 +const external_wp_hooks_namespaceObject = window["wp"]["hooks"];
769 210 ;// CONCATENATED MODULE: ./packages/customize-widgets/build-module/components/error-boundary/index.js
770 211
771 212
772 213 /**
@@ -777,8 +218,9 @@
777 218
778 219
779 220
780 221
222 +
781 223 function CopyButton(_ref) {
782 224 let {
783 225 text,
784 226 children
@@ -801,8 +243,9 @@
801 243 componentDidCatch(error) {
802 244 this.setState({
803 245 error
804 246 });
247 + (0,external_wp_hooks_namespaceObject.doAction)('editor.ErrorBoundary.errorLogged', error);
805 248 }
806 249
807 250 render() {
808 251 const {
@@ -822,13 +265,13 @@
822 265 }, (0,external_wp_i18n_namespaceObject.__)('The editor has encountered an unexpected error.'));
823 266 }
824 267
825 268 }
826 -//# sourceMappingURL=index.js.map
269 +
827 270 ;// CONCATENATED MODULE: external ["wp","coreData"]
828 -var external_wp_coreData_namespaceObject = window["wp"]["coreData"];
271 +const external_wp_coreData_namespaceObject = window["wp"]["coreData"];
829 272 ;// CONCATENATED MODULE: external ["wp","mediaUtils"]
830 -var external_wp_mediaUtils_namespaceObject = window["wp"]["mediaUtils"];
273 +const external_wp_mediaUtils_namespaceObject = window["wp"]["mediaUtils"];
831 274 ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
832 275 function _extends() {
833 276 _extends = Object.assign || function (target) {
834 277 for (var i = 1; i < arguments.length; i++) {
@@ -878,12 +321,17 @@
878 321 }
879 322 }, props), (0,external_wp_i18n_namespaceObject.__)('Show more settings'));
880 323 }
881 324
882 -/* harmony default export */ var block_inspector_button = (BlockInspectorButton);
883 -//# sourceMappingURL=index.js.map
325 +/* harmony default export */ const block_inspector_button = (BlockInspectorButton);
326 +
327 +// EXTERNAL MODULE: ./node_modules/classnames/index.js
328 +var classnames = __webpack_require__(4403);
329 +var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
884 330 ;// CONCATENATED MODULE: external ["wp","keycodes"]
885 -var external_wp_keycodes_namespaceObject = window["wp"]["keycodes"];
331 +const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"];
332 +;// CONCATENATED MODULE: external ["wp","primitives"]
333 +const external_wp_primitives_namespaceObject = window["wp"]["primitives"];
886 334 ;// CONCATENATED MODULE: ./packages/icons/build-module/library/undo.js
887 335
888 336
889 337 /**
@@ -895,10 +343,10 @@
895 343 viewBox: "0 0 24 24"
896 344 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
897 345 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"
898 346 }));
899 -/* harmony default export */ var library_undo = (undo);
900 -//# sourceMappingURL=undo.js.map
347 +/* harmony default export */ const library_undo = (undo);
348 +
901 349 ;// CONCATENATED MODULE: ./packages/icons/build-module/library/redo.js
902 350
903 351
904 352 /**
@@ -910,10 +358,10 @@
910 358 viewBox: "0 0 24 24"
911 359 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
912 360 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"
913 361 }));
914 -/* harmony default export */ var library_redo = (redo);
915 -//# sourceMappingURL=redo.js.map
362 +/* harmony default export */ const library_redo = (redo);
363 +
916 364 ;// CONCATENATED MODULE: ./packages/icons/build-module/library/plus.js
917 365
918 366
919 367 /**
@@ -925,10 +373,10 @@
925 373 viewBox: "0 0 24 24"
926 374 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
927 375 d: "M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"
928 376 }));
929 -/* harmony default export */ var library_plus = (plus);
930 -//# sourceMappingURL=plus.js.map
377 +/* harmony default export */ const library_plus = (plus);
378 +
931 379 ;// CONCATENATED MODULE: ./packages/icons/build-module/library/close-small.js
932 380
933 381
934 382 /**
@@ -940,10 +388,10 @@
940 388 viewBox: "0 0 24 24"
941 389 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
942 390 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"
943 391 }));
944 -/* harmony default export */ var close_small = (closeSmall);
945 -//# sourceMappingURL=close-small.js.map
392 +/* harmony default export */ const close_small = (closeSmall);
393 +
946 394 ;// CONCATENATED MODULE: ./packages/customize-widgets/build-module/store/reducer.js
947 395 /**
948 396 * WordPress dependencies
949 397 */
@@ -966,12 +414,12 @@
966 414
967 415 return state;
968 416 }
969 417
970 -/* harmony default export */ var store_reducer = ((0,external_wp_data_namespaceObject.combineReducers)({
418 +/* harmony default export */ const reducer = ((0,external_wp_data_namespaceObject.combineReducers)({
971 419 blockInserterPanel
972 420 }));
973 -//# sourceMappingURL=reducer.js.map
421 +
974 422 ;// CONCATENATED MODULE: ./packages/customize-widgets/build-module/store/selectors.js
975 423 /**
976 424 * Returns true if the inserter is opened.
977 425 *
@@ -999,9 +447,9 @@
999 447 rootClientId,
1000 448 insertionIndex
1001 449 };
1002 450 }
1003 -//# sourceMappingURL=selectors.js.map
451 +
1004 452 ;// CONCATENATED MODULE: ./packages/customize-widgets/build-module/store/actions.js
1005 453 /**
1006 454 * Returns an action object used to open/close the inserter.
1007 455 *
@@ -1019,15 +467,15 @@
1019 467 type: 'SET_IS_INSERTER_OPENED',
1020 468 value
1021 469 };
1022 470 }
1023 -//# sourceMappingURL=actions.js.map
471 +
1024 472 ;// CONCATENATED MODULE: ./packages/customize-widgets/build-module/store/constants.js
1025 473 /**
1026 474 * Module Constants
1027 475 */
1028 -const constants_STORE_NAME = 'core/customize-widgets';
1029 -//# sourceMappingURL=constants.js.map
476 +const STORE_NAME = 'core/customize-widgets';
477 +
1030 478 ;// CONCATENATED MODULE: ./packages/customize-widgets/build-module/store/index.js
1031 479 /**
1032 480 * WordPress dependencies
1033 481 */
@@ -1042,17 +490,17 @@
1042 490
1043 491 /**
1044 492 * Block editor data store configuration.
1045 493 *
1046 - * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore
494 + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registering-a-store
1047 495 *
1048 496 * @type {Object}
1049 497 */
1050 498
1051 499 const storeConfig = {
1052 - reducer: store_reducer,
1053 - selectors: store_selectors_namespaceObject,
1054 - actions: store_actions_namespaceObject
500 + reducer: reducer,
501 + selectors: selectors_namespaceObject,
502 + actions: actions_namespaceObject
1055 503 };
1056 504 /**
1057 505 * Store definition for the edit widgets namespace.
1058 506 *
@@ -1060,13 +508,11 @@
1060 508 *
1061 509 * @type {Object}
1062 510 */
1063 511
1064 -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
1065 -// we'd be able to replace this with a register call.
512 +const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, storeConfig);
513 +(0,external_wp_data_namespaceObject.register)(store);
1066 514
1067 -(0,external_wp_data_namespaceObject.registerStore)(constants_STORE_NAME, storeConfig);
1068 -//# sourceMappingURL=index.js.map
1069 515 ;// CONCATENATED MODULE: ./packages/customize-widgets/build-module/components/inserter/index.js
1070 516
1071 517
1072 518 /**
@@ -1088,9 +534,9 @@
1088 534 let {
1089 535 setIsOpened
1090 536 } = _ref;
1091 537 const inserterTitleId = (0,external_wp_compose_namespaceObject.useInstanceId)(Inserter, 'customize-widget-layout__inserter-panel-title');
1092 - const insertionPoint = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).__experimentalGetInsertionPoint(), []);
538 + const insertionPoint = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).__experimentalGetInsertionPoint(), []);
1093 539 return (0,external_wp_element_namespaceObject.createElement)("div", {
1094 540 className: "customize-widgets-layout__inserter-panel",
1095 541 "aria-labelledby": inserterTitleId
1096 542 }, (0,external_wp_element_namespaceObject.createElement)("div", {
@@ -1112,10 +558,10 @@
1112 558 onSelect: () => setIsOpened(false)
1113 559 })));
1114 560 }
1115 561
1116 -/* harmony default export */ var components_inserter = (Inserter);
1117 -//# sourceMappingURL=index.js.map
562 +/* harmony default export */ const components_inserter = (Inserter);
563 +
1118 564 ;// CONCATENATED MODULE: ./packages/icons/build-module/library/external.js
1119 565
1120 566
1121 567 /**
@@ -1127,10 +573,419 @@
1127 573 viewBox: "0 0 24 24"
1128 574 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
1129 575 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"
1130 576 }));
1131 -/* harmony default export */ var library_external = (external);
1132 -//# sourceMappingURL=external.js.map
577 +/* harmony default export */ const library_external = (external);
578 +
579 +;// CONCATENATED MODULE: ./packages/icons/build-module/library/more-vertical.js
580 +
581 +
582 +/**
583 + * WordPress dependencies
584 + */
585 +
586 +const moreVertical = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
587 + xmlns: "http://www.w3.org/2000/svg",
588 + viewBox: "0 0 24 24"
589 +}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
590 + d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"
591 +}));
592 +/* harmony default export */ const more_vertical = (moreVertical);
593 +
594 +;// CONCATENATED MODULE: ./packages/interface/build-module/components/more-menu-dropdown/index.js
595 +
596 +
597 +/**
598 + * External dependencies
599 + */
600 +
601 +/**
602 + * WordPress dependencies
603 + */
604 +
605 +
606 +
607 +
608 +function MoreMenuDropdown(_ref) {
609 + let {
610 + as: DropdownComponent = external_wp_components_namespaceObject.DropdownMenu,
611 + className,
612 +
613 + /* translators: button label text should, if possible, be under 16 characters. */
614 + label = (0,external_wp_i18n_namespaceObject.__)('Options'),
615 + popoverProps,
616 + toggleProps,
617 + children
618 + } = _ref;
619 + return (0,external_wp_element_namespaceObject.createElement)(DropdownComponent, {
620 + className: classnames_default()('interface-more-menu-dropdown', className),
621 + icon: more_vertical,
622 + label: label,
623 + popoverProps: {
624 + position: 'bottom left',
625 + ...popoverProps,
626 + className: classnames_default()('interface-more-menu-dropdown__content', popoverProps === null || popoverProps === void 0 ? void 0 : popoverProps.className)
627 + },
628 + toggleProps: {
629 + tooltipPosition: 'bottom',
630 + ...toggleProps
631 + }
632 + }, onClose => children(onClose));
633 +}
634 +
635 +;// CONCATENATED MODULE: ./packages/interface/build-module/components/index.js
636 +
637 +
638 +
639 +
640 +
641 +
642 +
643 +
644 +
645 +
646 +
647 +
648 +
649 +;// CONCATENATED MODULE: external ["wp","deprecated"]
650 +const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
651 +var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
652 +;// CONCATENATED MODULE: ./packages/interface/build-module/store/actions.js
653 +/**
654 + * WordPress dependencies
655 + */
656 +
657 +
658 +/**
659 + * Set a default complementary area.
660 + *
661 + * @param {string} scope Complementary area scope.
662 + * @param {string} area Area identifier.
663 + *
664 + * @return {Object} Action object.
665 + */
666 +
667 +const setDefaultComplementaryArea = (scope, area) => ({
668 + type: 'SET_DEFAULT_COMPLEMENTARY_AREA',
669 + scope,
670 + area
671 +});
672 +/**
673 + * Enable the complementary area.
674 + *
675 + * @param {string} scope Complementary area scope.
676 + * @param {string} area Area identifier.
677 + */
678 +
679 +const enableComplementaryArea = (scope, area) => _ref => {
680 + let {
681 + registry,
682 + dispatch
683 + } = _ref;
684 +
685 + // Return early if there's no area.
686 + if (!area) {
687 + return;
688 + }
689 +
690 + const isComplementaryAreaVisible = registry.select(external_wp_preferences_namespaceObject.store).get(scope, 'isComplementaryAreaVisible');
691 +
692 + if (!isComplementaryAreaVisible) {
693 + registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'isComplementaryAreaVisible', true);
694 + }
695 +
696 + dispatch({
697 + type: 'ENABLE_COMPLEMENTARY_AREA',
698 + scope,
699 + area
700 + });
701 +};
702 +/**
703 + * Disable the complementary area.
704 + *
705 + * @param {string} scope Complementary area scope.
706 + */
707 +
708 +const disableComplementaryArea = scope => _ref2 => {
709 + let {
710 + registry
711 + } = _ref2;
712 + const isComplementaryAreaVisible = registry.select(external_wp_preferences_namespaceObject.store).get(scope, 'isComplementaryAreaVisible');
713 +
714 + if (isComplementaryAreaVisible) {
715 + registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'isComplementaryAreaVisible', false);
716 + }
717 +};
718 +/**
719 + * Pins an item.
720 + *
721 + * @param {string} scope Item scope.
722 + * @param {string} item Item identifier.
723 + *
724 + * @return {Object} Action object.
725 + */
726 +
727 +const pinItem = (scope, item) => _ref3 => {
728 + let {
729 + registry
730 + } = _ref3;
731 +
732 + // Return early if there's no item.
733 + if (!item) {
734 + return;
735 + }
736 +
737 + const pinnedItems = registry.select(external_wp_preferences_namespaceObject.store).get(scope, 'pinnedItems'); // The item is already pinned, there's nothing to do.
738 +
739 + if ((pinnedItems === null || pinnedItems === void 0 ? void 0 : pinnedItems[item]) === true) {
740 + return;
741 + }
742 +
743 + registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'pinnedItems', { ...pinnedItems,
744 + [item]: true
745 + });
746 +};
747 +/**
748 + * Unpins an item.
749 + *
750 + * @param {string} scope Item scope.
751 + * @param {string} item Item identifier.
752 + */
753 +
754 +const unpinItem = (scope, item) => _ref4 => {
755 + let {
756 + registry
757 + } = _ref4;
758 +
759 + // Return early if there's no item.
760 + if (!item) {
761 + return;
762 + }
763 +
764 + const pinnedItems = registry.select(external_wp_preferences_namespaceObject.store).get(scope, 'pinnedItems');
765 + registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'pinnedItems', { ...pinnedItems,
766 + [item]: false
767 + });
768 +};
769 +/**
770 + * Returns an action object used in signalling that a feature should be toggled.
771 + *
772 + * @param {string} scope The feature scope (e.g. core/edit-post).
773 + * @param {string} featureName The feature name.
774 + */
775 +
776 +function toggleFeature(scope, featureName) {
777 + return function (_ref5) {
778 + let {
779 + registry
780 + } = _ref5;
781 + external_wp_deprecated_default()(`dispatch( 'core/interface' ).toggleFeature`, {
782 + since: '6.0',
783 + alternative: `dispatch( 'core/preferences' ).toggle`
784 + });
785 + registry.dispatch(external_wp_preferences_namespaceObject.store).toggle(scope, featureName);
786 + };
787 +}
788 +/**
789 + * Returns an action object used in signalling that a feature should be set to
790 + * a true or false value
791 + *
792 + * @param {string} scope The feature scope (e.g. core/edit-post).
793 + * @param {string} featureName The feature name.
794 + * @param {boolean} value The value to set.
795 + *
796 + * @return {Object} Action object.
797 + */
798 +
799 +function setFeatureValue(scope, featureName, value) {
800 + return function (_ref6) {
801 + let {
802 + registry
803 + } = _ref6;
804 + external_wp_deprecated_default()(`dispatch( 'core/interface' ).setFeatureValue`, {
805 + since: '6.0',
806 + alternative: `dispatch( 'core/preferences' ).set`
807 + });
808 + registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, featureName, !!value);
809 + };
810 +}
811 +/**
812 + * Returns an action object used in signalling that defaults should be set for features.
813 + *
814 + * @param {string} scope The feature scope (e.g. core/edit-post).
815 + * @param {Object<string, boolean>} defaults A key/value map of feature names to values.
816 + *
817 + * @return {Object} Action object.
818 + */
819 +
820 +function setFeatureDefaults(scope, defaults) {
821 + return function (_ref7) {
822 + let {
823 + registry
824 + } = _ref7;
825 + external_wp_deprecated_default()(`dispatch( 'core/interface' ).setFeatureDefaults`, {
826 + since: '6.0',
827 + alternative: `dispatch( 'core/preferences' ).setDefaults`
828 + });
829 + registry.dispatch(external_wp_preferences_namespaceObject.store).setDefaults(scope, defaults);
830 + };
831 +}
832 +
833 +;// CONCATENATED MODULE: ./packages/interface/build-module/store/selectors.js
834 +/**
835 + * WordPress dependencies
836 + */
837 +
838 +
839 +
840 +/**
841 + * Returns the complementary area that is active in a given scope.
842 + *
843 + * @param {Object} state Global application state.
844 + * @param {string} scope Item scope.
845 + *
846 + * @return {string | null | undefined} The complementary area that is active in the given scope.
847 + */
848 +
849 +const getActiveComplementaryArea = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope) => {
850 + var _state$complementaryA;
851 +
852 + const isComplementaryAreaVisible = select(external_wp_preferences_namespaceObject.store).get(scope, 'isComplementaryAreaVisible'); // Return `undefined` to indicate that the user has never toggled
853 + // visibility, this is the vanilla default. Other code relies on this
854 + // nuance in the return value.
855 +
856 + if (isComplementaryAreaVisible === undefined) {
857 + return undefined;
858 + } // Return `null` to indicate the user hid the complementary area.
859 +
860 +
861 + if (!isComplementaryAreaVisible) {
862 + return null;
863 + }
864 +
865 + return state === null || state === void 0 ? void 0 : (_state$complementaryA = state.complementaryAreas) === null || _state$complementaryA === void 0 ? void 0 : _state$complementaryA[scope];
866 +});
867 +/**
868 + * Returns a boolean indicating if an item is pinned or not.
869 + *
870 + * @param {Object} state Global application state.
871 + * @param {string} scope Scope.
872 + * @param {string} item Item to check.
873 + *
874 + * @return {boolean} True if the item is pinned and false otherwise.
875 + */
876 +
877 +const isItemPinned = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope, item) => {
878 + var _pinnedItems$item;
879 +
880 + const pinnedItems = select(external_wp_preferences_namespaceObject.store).get(scope, 'pinnedItems');
881 + return (_pinnedItems$item = pinnedItems === null || pinnedItems === void 0 ? void 0 : pinnedItems[item]) !== null && _pinnedItems$item !== void 0 ? _pinnedItems$item : true;
882 +});
883 +/**
884 + * Returns a boolean indicating whether a feature is active for a particular
885 + * scope.
886 + *
887 + * @param {Object} state The store state.
888 + * @param {string} scope The scope of the feature (e.g. core/edit-post).
889 + * @param {string} featureName The name of the feature.
890 + *
891 + * @return {boolean} Is the feature enabled?
892 + */
893 +
894 +const isFeatureActive = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope, featureName) => {
895 + external_wp_deprecated_default()(`select( 'core/interface' ).isFeatureActive( scope, featureName )`, {
896 + since: '6.0',
897 + alternative: `select( 'core/preferences' ).get( scope, featureName )`
898 + });
899 + return !!select(external_wp_preferences_namespaceObject.store).get(scope, featureName);
900 +});
901 +
902 +;// CONCATENATED MODULE: ./packages/interface/build-module/store/reducer.js
903 +/**
904 + * WordPress dependencies
905 + */
906 +
907 +function complementaryAreas() {
908 + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
909 + let action = arguments.length > 1 ? arguments[1] : undefined;
910 +
911 + switch (action.type) {
912 + case 'SET_DEFAULT_COMPLEMENTARY_AREA':
913 + {
914 + const {
915 + scope,
916 + area
917 + } = action; // If there's already an area, don't overwrite it.
918 +
919 + if (state[scope]) {
920 + return state;
921 + }
922 +
923 + return { ...state,
924 + [scope]: area
925 + };
926 + }
927 +
928 + case 'ENABLE_COMPLEMENTARY_AREA':
929 + {
930 + const {
931 + scope,
932 + area
933 + } = action;
934 + return { ...state,
935 + [scope]: area
936 + };
937 + }
938 + }
939 +
940 + return state;
941 +}
942 +/* harmony default export */ const store_reducer = ((0,external_wp_data_namespaceObject.combineReducers)({
943 + complementaryAreas
944 +}));
945 +
946 +;// CONCATENATED MODULE: ./packages/interface/build-module/store/constants.js
947 +/**
948 + * The identifier for the data store.
949 + *
950 + * @type {string}
951 + */
952 +const constants_STORE_NAME = 'core/interface';
953 +
954 +;// CONCATENATED MODULE: ./packages/interface/build-module/store/index.js
955 +/**
956 + * WordPress dependencies
957 + */
958 +
959 +/**
960 + * Internal dependencies
961 + */
962 +
963 +
964 +
965 +
966 +
967 +/**
968 + * Store definition for the interface namespace.
969 + *
970 + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
971 + *
972 + * @type {Object}
973 + */
974 +
975 +const store_store = (0,external_wp_data_namespaceObject.createReduxStore)(constants_STORE_NAME, {
976 + reducer: store_reducer,
977 + actions: store_actions_namespaceObject,
978 + selectors: store_selectors_namespaceObject
979 +}); // Once we build a more generic persistence plugin that works across types of stores
980 +// we'd be able to replace this with a register call.
981 +
982 +(0,external_wp_data_namespaceObject.register)(store_store);
983 +
984 +;// CONCATENATED MODULE: ./packages/interface/build-module/index.js
985 +
986 +
987 +
1133 988 ;// CONCATENATED MODULE: ./packages/customize-widgets/build-module/components/keyboard-shortcut-help-modal/config.js
1134 989 /**
1135 990 * WordPress dependencies
1136 991 */
@@ -1160,28 +1015,40 @@
1160 1015 },
1161 1016 description: (0,external_wp_i18n_namespaceObject.__)('Remove a link.')
1162 1017 }, {
1163 1018 keyCombination: {
1019 + character: '[['
1020 + },
1021 + description: (0,external_wp_i18n_namespaceObject.__)('Insert a link to a post or page')
1022 +}, {
1023 + keyCombination: {
1164 1024 modifier: 'primary',
1165 1025 character: 'u'
1166 1026 },
1167 1027 description: (0,external_wp_i18n_namespaceObject.__)('Underline the selected text.')
1028 +}, {
1029 + keyCombination: {
1030 + modifier: 'access',
1031 + character: 'd'
1032 + },
1033 + description: (0,external_wp_i18n_namespaceObject.__)('Strikethrough the selected text.')
1034 +}, {
1035 + keyCombination: {
1036 + modifier: 'access',
1037 + character: 'x'
1038 + },
1039 + description: (0,external_wp_i18n_namespaceObject.__)('Make the selected text inline code.')
1168 1040 }];
1169 -//# sourceMappingURL=config.js.map
1041 +
1170 1042 ;// CONCATENATED MODULE: ./packages/customize-widgets/build-module/components/keyboard-shortcut-help-modal/shortcut.js
1171 1043
1172 1044
1173 1045 /**
1174 - * External dependencies
1175 - */
1176 -
1177 -/**
1178 1046 * WordPress dependencies
1179 1047 */
1180 1048
1181 1049
1182 1050
1183 -
1184 1051 function KeyCombination(_ref) {
1185 1052 let {
1186 1053 keyCombination,
1187 1054 forceAriaLabel
@@ -1190,9 +1057,9 @@
1190 1057 const ariaLabel = keyCombination.modifier ? external_wp_keycodes_namespaceObject.shortcutAriaLabel[keyCombination.modifier](keyCombination.character) : keyCombination.character;
1191 1058 return (0,external_wp_element_namespaceObject.createElement)("kbd", {
1192 1059 className: "customize-widgets-keyboard-shortcut-help-modal__shortcut-key-combination",
1193 1060 "aria-label": forceAriaLabel || ariaLabel
1194 - }, (0,external_lodash_namespaceObject.castArray)(shortcut).map((character, index) => {
1061 + }, (Array.isArray(shortcut) ? shortcut : [shortcut]).map((character, index) => {
1195 1062 if (character === '+') {
1196 1063 return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, {
1197 1064 key: index
1198 1065 }, character);
@@ -1225,10 +1092,10 @@
1225 1092 key: index
1226 1093 }))));
1227 1094 }
1228 1095
1229 -/* harmony default export */ var keyboard_shortcut_help_modal_shortcut = (Shortcut);
1230 -//# sourceMappingURL=shortcut.js.map
1096 +/* harmony default export */ const keyboard_shortcut_help_modal_shortcut = (Shortcut);
1097 +
1231 1098 ;// CONCATENATED MODULE: ./packages/customize-widgets/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js
1232 1099
1233 1100
1234 1101 /**
@@ -1273,10 +1140,10 @@
1273 1140 aliases: aliases
1274 1141 });
1275 1142 }
1276 1143
1277 -/* harmony default export */ var dynamic_shortcut = (DynamicShortcut);
1278 -//# sourceMappingURL=dynamic-shortcut.js.map
1144 +/* harmony default export */ const dynamic_shortcut = (DynamicShortcut);
1145 +
1279 1146 ;// CONCATENATED MODULE: ./packages/customize-widgets/build-module/components/keyboard-shortcut-help-modal/index.js
1280 1147
1281 1148
1282 1149 /**
@@ -1282,9 +1149,8 @@
1282 1149 /**
1283 1150 * External dependencies
1284 1151 */
1285 1152
1286 -
1287 1153 /**
1288 1154 * WordPress dependencies
1289 1155 */
1290 1156
@@ -1316,9 +1182,9 @@
1316 1182 role: "list"
1317 1183 }, shortcuts.map((shortcut, index) => (0,external_wp_element_namespaceObject.createElement)("li", {
1318 1184 className: "customize-widgets-keyboard-shortcut-help-modal__shortcut",
1319 1185 key: index
1320 - }, (0,external_lodash_namespaceObject.isString)(shortcut) ? (0,external_wp_element_namespaceObject.createElement)(dynamic_shortcut, {
1186 + }, typeof shortcut === 'string' ? (0,external_wp_element_namespaceObject.createElement)(dynamic_shortcut, {
1321 1187 name: shortcut
1322 1188 }) : (0,external_wp_element_namespaceObject.createElement)(keyboard_shortcut_help_modal_shortcut, shortcut))))
1323 1189 /* eslint-enable jsx-a11y/no-redundant-roles */
1324 1190
@@ -1408,9 +1274,9 @@
1408 1274 title: (0,external_wp_i18n_namespaceObject.__)('Text formatting'),
1409 1275 shortcuts: textFormattingShortcuts
1410 1276 }));
1411 1277 }
1412 -//# sourceMappingURL=index.js.map
1278 +
1413 1279 ;// CONCATENATED MODULE: ./packages/customize-widgets/build-module/components/more-menu/index.js
1414 1280
1415 1281
1416 1282 /**
@@ -1422,16 +1288,14 @@
1422 1288
1423 1289
1424 1290
1425 1291
1292 +
1426 1293 /**
1427 1294 * Internal dependencies
1428 1295 */
1429 1296
1430 1297
1431 -const POPOVER_PROPS = {
1432 - className: 'customize-widgets-more-menu__content'
1433 -};
1434 1298 function MoreMenu() {
1435 1299 const [isKeyboardShortcutsModalActive, setIsKeyboardShortcutsModalVisible] = (0,external_wp_element_namespaceObject.useState)(false);
1436 1300
1437 1301 const toggleKeyboardShortcutsModal = () => setIsKeyboardShortcutsModalVisible(!isKeyboardShortcutsModalActive);
@@ -1437,16 +1301,14 @@
1437 1301 const toggleKeyboardShortcutsModal = () => setIsKeyboardShortcutsModalVisible(!isKeyboardShortcutsModalActive);
1438 1302
1439 1303 (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/customize-widgets/keyboard-shortcuts', toggleKeyboardShortcutsModal);
1440 1304 return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(MoreMenuDropdown, {
1441 - as: external_wp_components_namespaceObject.ToolbarDropdownMenu,
1442 - className: "customize-widgets-more-menu",
1443 - popoverProps: POPOVER_PROPS
1305 + as: external_wp_components_namespaceObject.ToolbarDropdownMenu
1444 1306 }, () => (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
1445 1307 label: (0,external_wp_i18n_namespaceObject._x)('View', 'noun')
1446 - }, (0,external_wp_element_namespaceObject.createElement)(MoreMenuFeatureToggle, {
1308 + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, {
1447 1309 scope: "core/customize-widgets",
1448 - feature: "fixedToolbar",
1310 + name: "fixedToolbar",
1449 1311 label: (0,external_wp_i18n_namespaceObject.__)('Top toolbar'),
1450 1312 info: (0,external_wp_i18n_namespaceObject.__)('Access all block and document tools in a single place'),
1451 1313 messageActivated: (0,external_wp_i18n_namespaceObject.__)('Top toolbar activated'),
1452 1314 messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Top toolbar deactivated')
@@ -1456,11 +1318,11 @@
1456 1318 onClick: () => {
1457 1319 setIsKeyboardShortcutsModalVisible(true);
1458 1320 },
1459 1321 shortcut: external_wp_keycodes_namespaceObject.displayShortcut.access('h')
1460 - }, (0,external_wp_i18n_namespaceObject.__)('Keyboard shortcuts')), (0,external_wp_element_namespaceObject.createElement)(MoreMenuFeatureToggle, {
1322 + }, (0,external_wp_i18n_namespaceObject.__)('Keyboard shortcuts')), (0,external_wp_element_namespaceObject.createElement)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, {
1461 1323 scope: "core/customize-widgets",
1462 - feature: "welcomeGuide",
1324 + name: "welcomeGuide",
1463 1325 label: (0,external_wp_i18n_namespaceObject.__)('Welcome Guide')
1464 1326 }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
1465 1327 role: "menuitem",
1466 1328 icon: library_external,
@@ -1472,11 +1334,11 @@
1472 1334 },
1473 1335 /* translators: accessibility text */
1474 1336 (0,external_wp_i18n_namespaceObject.__)('(opens in a new tab)')))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
1475 1337 label: (0,external_wp_i18n_namespaceObject.__)('Preferences')
1476 - }, (0,external_wp_element_namespaceObject.createElement)(MoreMenuFeatureToggle, {
1338 + }, (0,external_wp_element_namespaceObject.createElement)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, {
1477 1339 scope: "core/customize-widgets",
1478 - feature: "keepCaretInsideBlock",
1340 + name: "keepCaretInsideBlock",
1479 1341 label: (0,external_wp_i18n_namespaceObject.__)('Contain text cursor inside block'),
1480 1342 info: (0,external_wp_i18n_namespaceObject.__)('Aids screen readers by stopping text caret from leaving blocks.'),
1481 1343 messageActivated: (0,external_wp_i18n_namespaceObject.__)('Contain text cursor inside block activated'),
1482 1344 messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Contain text cursor inside block deactivated')
@@ -1484,9 +1346,9 @@
1484 1346 isModalActive: isKeyboardShortcutsModalActive,
1485 1347 toggleModal: toggleKeyboardShortcutsModal
1486 1348 }));
1487 1349 }
1488 -//# sourceMappingURL=index.js.map
1350 +
1489 1351 ;// CONCATENATED MODULE: ./packages/customize-widgets/build-module/components/header/index.js
1490 1352
1491 1353
1492 1354 /**
@@ -1518,8 +1380,9 @@
1518 1380 setIsInserterOpened,
1519 1381 isFixedToolbarActive
1520 1382 } = _ref;
1521 1383 const [[hasUndo, hasRedo], setUndoRedo] = (0,external_wp_element_namespaceObject.useState)([sidebar.hasUndo(), sidebar.hasRedo()]);
1384 + const shortcut = (0,external_wp_keycodes_namespaceObject.isAppleOS)() ? external_wp_keycodes_namespaceObject.displayShortcut.primaryShift('z') : external_wp_keycodes_namespaceObject.displayShortcut.primary('y');
1522 1385 (0,external_wp_element_namespaceObject.useEffect)(() => {
1523 1386 return sidebar.subscribeHistory(() => {
1524 1387 setUndoRedo([sidebar.hasUndo(), sidebar.hasRedo()]);
1525 1388 });
@@ -1547,9 +1410,9 @@
1547 1410 icon: !(0,external_wp_i18n_namespaceObject.isRTL)() ? library_redo : library_undo
1548 1411 /* translators: button label text should, if possible, be under 16 characters. */
1549 1412 ,
1550 1413 label: (0,external_wp_i18n_namespaceObject.__)('Redo'),
1551 - shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primaryShift('z') // If there are no undo levels we don't want to actually disable this
1414 + shortcut: shortcut // If there are no undo levels we don't want to actually disable this
1552 1415 // button, because it will remove focus for keyboard users.
1553 1416 // See: https://github.com/WordPress/gutenberg/issues/3486
1554 1417 ,
1555 1418 "aria-disabled": !hasRedo,
@@ -1568,10 +1431,10 @@
1568 1431 setIsOpened: setIsInserterOpened
1569 1432 }), inserter.contentContainer[0]));
1570 1433 }
1571 1434
1572 -/* harmony default export */ var header = (Header);
1573 -//# sourceMappingURL=index.js.map
1435 +/* harmony default export */ const header = (Header);
1436 +
1574 1437 ;// CONCATENATED MODULE: ./packages/customize-widgets/build-module/components/inserter/use-inserter.js
1575 1438 /**
1576 1439 * WordPress dependencies
1577 1440 */
@@ -1582,12 +1445,12 @@
1582 1445 */
1583 1446
1584 1447
1585 1448 function useInserter(inserter) {
1586 - const isInserterOpened = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).isInserterOpened(), []);
1449 + const isInserterOpened = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).isInserterOpened(), []);
1587 1450 const {
1588 1451 setIsInserterOpened
1589 - } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
1452 + } = (0,external_wp_data_namespaceObject.useDispatch)(store);
1590 1453 (0,external_wp_element_namespaceObject.useEffect)(() => {
1591 1454 if (isInserterOpened) {
1592 1455 inserter.open();
1593 1456 } else {
@@ -1597,17 +1460,19 @@
1597 1460 return [isInserterOpened, (0,external_wp_element_namespaceObject.useCallback)(updater => {
1598 1461 let isOpen = updater;
1599 1462
1600 1463 if (typeof updater === 'function') {
1601 - isOpen = updater((0,external_wp_data_namespaceObject.select)(store_store).isInserterOpened());
1464 + isOpen = updater((0,external_wp_data_namespaceObject.select)(store).isInserterOpened());
1602 1465 }
1603 1466
1604 1467 setIsInserterOpened(isOpen);
1605 1468 }, [setIsInserterOpened])];
1606 1469 }
1607 -//# sourceMappingURL=use-inserter.js.map
1470 +
1471 +;// CONCATENATED MODULE: external "lodash"
1472 +const external_lodash_namespaceObject = window["lodash"];
1608 1473 ;// CONCATENATED MODULE: external ["wp","isShallowEqual"]
1609 -var external_wp_isShallowEqual_namespaceObject = window["wp"]["isShallowEqual"];
1474 +const external_wp_isShallowEqual_namespaceObject = window["wp"]["isShallowEqual"];
1610 1475 var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_namespaceObject);
1611 1476 ;// CONCATENATED MODULE: ./packages/customize-widgets/build-module/utils.js
1612 1477 // @ts-check
1613 1478
@@ -1616,13 +1481,8 @@
1616 1481 */
1617 1482
1618 1483
1619 1484 /**
1620 - * External dependencies
1621 - */
1622 -
1623 -
1624 -/**
1625 1485 * Convert settingId to widgetId.
1626 1486 *
1627 1487 * @param {string} settingId The setting id.
1628 1488 * @return {string} The widget id.
@@ -1690,9 +1550,14 @@
1690 1550 }
1691 1551 };
1692 1552 }
1693 1553
1694 - return { ...(0,external_lodash_namespaceObject.omit)(existingWidget, ['form', 'rendered']),
1554 + const {
1555 + form,
1556 + rendered,
1557 + ...restExistingWidget
1558 + } = existingWidget || {};
1559 + return { ...restExistingWidget,
1695 1560 ...widget
1696 1561 };
1697 1562 }
1698 1563 /**
@@ -1721,9 +1586,11 @@
1721 1586 ...rest
1722 1587 } = instance;
1723 1588
1724 1589 if (idBase === 'block') {
1725 - const parsedBlocks = (0,external_wp_blocks_namespaceObject.parse)(raw.content);
1590 + const parsedBlocks = (0,external_wp_blocks_namespaceObject.parse)(raw.content, {
1591 + __unstableSkipAutop: true
1592 + });
1726 1593 block = parsedBlocks.length ? parsedBlocks[0] : (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {});
1727 1594 } else if (number) {
1728 1595 // Widget that extends WP_Widget.
1729 1596 block = (0,external_wp_blocks_namespaceObject.createBlock)('core/legacy-widget', {
@@ -1743,9 +1610,9 @@
1743 1610 }
1744 1611
1745 1612 return (0,external_wp_widgets_namespaceObject.addWidgetIdToBlock)(block, id);
1746 1613 }
1747 -//# sourceMappingURL=utils.js.map
1614 +
1748 1615 ;// CONCATENATED MODULE: ./packages/customize-widgets/build-module/components/sidebar-block-editor/use-sidebar-block-editor.js
1749 1616 /**
1750 1617 * External dependencies
1751 1618 */
@@ -1841,9 +1708,9 @@
1841 1708 });
1842 1709 }, [sidebar]);
1843 1710 return [blocks, onChangeBlocks, onChangeBlocks];
1844 1711 }
1845 -//# sourceMappingURL=use-sidebar-block-editor.js.map
1712 +
1846 1713 ;// CONCATENATED MODULE: ./packages/customize-widgets/build-module/components/focus-control/index.js
1847 1714
1848 1715
1849 1716 /**
@@ -1907,9 +1774,9 @@
1907 1774 value: context
1908 1775 }, children);
1909 1776 }
1910 1777 const useFocusControl = () => (0,external_wp_element_namespaceObject.useContext)(FocusControlContext);
1911 -//# sourceMappingURL=index.js.map
1778 +
1912 1779 ;// CONCATENATED MODULE: ./packages/customize-widgets/build-module/components/focus-control/use-blocks-focus-control.js
1913 1780 /**
1914 1781 * WordPress dependencies
1915 1782 */
@@ -1945,9 +1812,9 @@
1945 1812 }
1946 1813 }
1947 1814 }, [focusedWidgetIdRef, selectBlock]);
1948 1815 }
1949 -//# sourceMappingURL=use-blocks-focus-control.js.map
1816 +
1950 1817 ;// CONCATENATED MODULE: ./packages/customize-widgets/build-module/components/sidebar-block-editor/sidebar-editor-provider.js
1951 1818
1952 1819
1953 1820 /**
@@ -1975,9 +1842,9 @@
1975 1842 settings: settings,
1976 1843 useSubRegistry: false
1977 1844 }, children);
1978 1845 }
1979 -//# sourceMappingURL=sidebar-editor-provider.js.map
1846 +
1980 1847 ;// CONCATENATED MODULE: ./packages/customize-widgets/build-module/components/welcome-guide/index.js
1981 1848
1982 1849
1983 1850 /**
@@ -1991,10 +1858,10 @@
1991 1858 let {
1992 1859 sidebar
1993 1860 } = _ref;
1994 1861 const {
1995 - toggleFeature
1996 - } = (0,external_wp_data_namespaceObject.useDispatch)(store);
1862 + toggle
1863 + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store);
1997 1864 const isEntirelyBlockWidgets = sidebar.getWidgets().every(widget => widget.id.startsWith('block-'));
1998 1865 return (0,external_wp_element_namespaceObject.createElement)("div", {
1999 1866 className: "customize-widgets-welcome-guide"
2000 1867 }, (0,external_wp_element_namespaceObject.createElement)("div", {
@@ -2014,9 +1881,9 @@
2014 1881 className: "customize-widgets-welcome-guide__text"
2015 1882 }, isEntirelyBlockWidgets ? (0,external_wp_i18n_namespaceObject.__)('Your theme provides different “block” areas for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.') : (0,external_wp_i18n_namespaceObject.__)('You can now add any block to your site’s widget areas. Don’t worry, all of your favorite widgets still work flawlessly.')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
2016 1883 className: "customize-widgets-welcome-guide__button",
2017 1884 variant: "primary",
2018 - onClick: () => toggleFeature('core/customize-widgets', 'welcomeGuide')
1885 + onClick: () => toggle('core/customize-widgets', 'welcomeGuide')
2019 1886 }, (0,external_wp_i18n_namespaceObject.__)('Got it')), (0,external_wp_element_namespaceObject.createElement)("hr", {
2020 1887 className: "customize-widgets-welcome-guide__separator"
2021 1888 }), !isEntirelyBlockWidgets && (0,external_wp_element_namespaceObject.createElement)("p", {
2022 1889 className: "customize-widgets-welcome-guide__more-info"
@@ -2027,9 +1894,9 @@
2027 1894 }, (0,external_wp_i18n_namespaceObject.__)('New to the block editor?'), (0,external_wp_element_namespaceObject.createElement)("br", null), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, {
2028 1895 href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/support/article/wordpress-editor/')
2029 1896 }, (0,external_wp_i18n_namespaceObject.__)("Here's a detailed guide."))));
2030 1897 }
2031 -//# sourceMappingURL=index.js.map
1898 +
2032 1899 ;// CONCATENATED MODULE: ./packages/customize-widgets/build-module/components/keyboard-shortcuts/index.js
2033 1900 /**
2034 1901 * WordPress dependencies
2035 1902 */
@@ -2101,10 +1968,10 @@
2101 1968 return null;
2102 1969 }
2103 1970
2104 1971 KeyboardShortcuts.Register = KeyboardShortcutsRegister;
2105 -/* harmony default export */ var keyboard_shortcuts = (KeyboardShortcuts);
2106 -//# sourceMappingURL=index.js.map
1972 +/* harmony default export */ const keyboard_shortcuts = (KeyboardShortcuts);
1973 +
2107 1974 ;// CONCATENATED MODULE: ./packages/customize-widgets/build-module/components/block-appender/index.js
2108 1975
2109 1976
2110 1977
@@ -2133,17 +2000,13 @@
2133 2000 return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.ButtonBlockAppender, _extends({}, props, {
2134 2001 ref: ref
2135 2002 }));
2136 2003 }
2137 -//# sourceMappingURL=index.js.map
2004 +
2138 2005 ;// CONCATENATED MODULE: ./packages/customize-widgets/build-module/components/sidebar-block-editor/index.js
2139 2006
2140 2007
2141 2008 /**
2142 - * External dependencies
2143 - */
2144 -
2145 -/**
2146 2009 * WordPress dependencies
2147 2010 */
2148 2011
2149 2012
@@ -2150,9 +2013,8 @@
2150 2013
2151 2014
2152 2015
2153 2016
2154 -
2155 2017 /**
2156 2018 * Internal dependencies
2157 2019 */
2158 2020
@@ -2176,16 +2038,18 @@
2176 2038 isFixedToolbarActive,
2177 2039 keepCaretInsideBlock,
2178 2040 isWelcomeGuideActive
2179 2041 } = (0,external_wp_data_namespaceObject.useSelect)(select => {
2042 + var _select$canUser;
2043 +
2180 2044 const {
2181 - isFeatureActive
2182 - } = select(store);
2045 + get
2046 + } = select(external_wp_preferences_namespaceObject.store);
2183 2047 return {
2184 - hasUploadPermissions: (0,external_lodash_namespaceObject.defaultTo)(select(external_wp_coreData_namespaceObject.store).canUser('create', 'media'), true),
2185 - isFixedToolbarActive: isFeatureActive('core/customize-widgets', 'fixedToolbar'),
2186 - keepCaretInsideBlock: isFeatureActive('core/customize-widgets', 'keepCaretInsideBlock'),
2187 - isWelcomeGuideActive: isFeatureActive('core/customize-widgets', 'welcomeGuide')
2048 + hasUploadPermissions: (_select$canUser = select(external_wp_coreData_namespaceObject.store).canUser('create', 'media')) !== null && _select$canUser !== void 0 ? _select$canUser : true,
2049 + isFixedToolbarActive: !!get('core/customize-widgets', 'fixedToolbar'),
2050 + keepCaretInsideBlock: !!get('core/customize-widgets', 'keepCaretInsideBlock'),
2051 + isWelcomeGuideActive: !!get('core/customize-widgets', 'welcomeGuide')
2188 2052 };
2189 2053 }, []);
2190 2054 const settings = (0,external_wp_element_namespaceObject.useMemo)(() => {
2191 2055 let mediaUploadBlockEditor;
@@ -2256,9 +2120,9 @@
2256 2120 closeMenu: onClose
2257 2121 });
2258 2122 }));
2259 2123 }
2260 -//# sourceMappingURL=index.js.map
2124 +
2261 2125 ;// CONCATENATED MODULE: ./packages/customize-widgets/build-module/components/sidebar-controls/index.js
2262 2126
2263 2127
2264 2128 /**
@@ -2291,9 +2155,9 @@
2291 2155 activeSidebarControl
2292 2156 } = (0,external_wp_element_namespaceObject.useContext)(SidebarControlsContext);
2293 2157 return activeSidebarControl;
2294 2158 }
2295 -//# sourceMappingURL=index.js.map
2159 +
2296 2160 ;// CONCATENATED MODULE: ./packages/customize-widgets/build-module/components/customize-widgets/use-clear-selected-block.js
2297 2161 /**
2298 2162 * WordPress dependencies
2299 2163 */
@@ -2360,9 +2224,9 @@
2360 2224 };
2361 2225 }
2362 2226 }, [popoverRef, sidebarControl, hasSelectedBlock, hasMultiSelection, clearSelectedBlock]);
2363 2227 }
2364 -//# sourceMappingURL=use-clear-selected-block.js.map
2228 +
2365 2229 ;// CONCATENATED MODULE: ./packages/customize-widgets/build-module/components/customize-widgets/index.js
2366 2230
2367 2231
2368 2232 /**
@@ -2420,9 +2284,9 @@
2420 2284 api: api,
2421 2285 sidebarControls: sidebarControls
2422 2286 }, activeSidebar, popover))));
2423 2287 }
2424 -//# sourceMappingURL=index.js.map
2288 +
2425 2289 ;// CONCATENATED MODULE: ./packages/customize-widgets/build-module/controls/inspector-section.js
2426 2290 function getInspectorSection() {
2427 2291 const {
2428 2292 wp: {
@@ -2524,9 +2388,9 @@
2524 2388 }
2525 2389
2526 2390 };
2527 2391 }
2528 -//# sourceMappingURL=inspector-section.js.map
2392 +
2529 2393 ;// CONCATENATED MODULE: ./packages/customize-widgets/build-module/controls/sidebar-section.js
2530 2394 /**
2531 2395 * WordPress dependencies
2532 2396 */
@@ -2544,8 +2408,13 @@
2544 2408 wp: {
2545 2409 customize
2546 2410 }
2547 2411 } = window;
2412 + const reduceMotionMediaQuery = window.matchMedia('(prefers-reduced-motion: reduce)');
2413 + let isReducedMotion = reduceMotionMediaQuery.matches;
2414 + reduceMotionMediaQuery.addEventListener('change', event => {
2415 + isReducedMotion = event.matches;
2416 + });
2548 2417 return class SidebarSection extends customize.Section {
2549 2418 ready() {
2550 2419 const InspectorSection = getInspectorSection();
2551 2420 this.inspector = new InspectorSection(getInspectorSectionId(this.id), {
@@ -2582,21 +2451,24 @@
2582 2451 if (expanded) {
2583 2452 this.contentContainer.addClass(['busy', 'open']);
2584 2453 this.contentContainer.removeClass('is-sub-section-open');
2585 2454 this.contentContainer.closest('.wp-full-overlay').addClass('section-open');
2586 - this.contentContainer.one('transitionend', () => {
2587 - this.contentContainer.removeClass('busy');
2588 - args.completeCallback();
2589 - });
2590 2455 } else {
2591 2456 this.contentContainer.addClass(['busy', 'is-sub-section-open']);
2592 2457 this.contentContainer.closest('.wp-full-overlay').addClass('section-open');
2593 2458 this.contentContainer.removeClass('open');
2594 - this.contentContainer.one('transitionend', () => {
2595 - this.contentContainer.removeClass('busy');
2596 - args.completeCallback();
2597 - });
2598 2459 }
2460 +
2461 + const handleTransitionEnd = () => {
2462 + this.contentContainer.removeClass('busy');
2463 + args.completeCallback();
2464 + };
2465 +
2466 + if (isReducedMotion) {
2467 + handleTransitionEnd();
2468 + } else {
2469 + this.contentContainer.one('transitionend', handleTransitionEnd);
2470 + }
2599 2471 } else {
2600 2472 super.onChangeExpanded(expanded, args);
2601 2473 }
2602 2474 }
@@ -2602,9 +2474,9 @@
2602 2474 }
2603 2475
2604 2476 };
2605 2477 }
2606 -//# sourceMappingURL=sidebar-section.js.map
2478 +
2607 2479 ;// CONCATENATED MODULE: ./packages/customize-widgets/build-module/components/sidebar-block-editor/sidebar-adapter.js
2608 2480 /**
2609 2481 * Internal dependencies
2610 2482 */
@@ -2930,11 +2802,11 @@
2930 2802 this.api.previewer.save();
2931 2803 }
2932 2804
2933 2805 }
2934 -//# sourceMappingURL=sidebar-adapter.js.map
2806 +
2935 2807 ;// CONCATENATED MODULE: external ["wp","dom"]
2936 -var external_wp_dom_namespaceObject = window["wp"]["dom"];
2808 +const external_wp_dom_namespaceObject = window["wp"]["dom"];
2937 2809 ;// CONCATENATED MODULE: ./packages/customize-widgets/build-module/controls/inserter-outer-section.js
2938 2810 /**
2939 2811 * WordPress dependencies
2940 2812 */
@@ -2986,9 +2858,9 @@
2986 2858 ownerWindow.addEventListener('keydown', event => {
2987 2859 if (this.expanded() && (event.keyCode === external_wp_keycodes_namespaceObject.ESCAPE || event.code === 'Escape') && !event.defaultPrevented) {
2988 2860 event.preventDefault();
2989 2861 event.stopPropagation();
2990 - (0,external_wp_data_namespaceObject.dispatch)(store_store).setIsInserterOpened(false);
2862 + (0,external_wp_data_namespaceObject.dispatch)(store).setIsInserterOpened(false);
2991 2863 }
2992 2864 }, // Use capture mode to make this run before other event listeners.
2993 2865 true);
2994 2866 this.contentContainer.addClass('widgets-inserter'); // Set a flag if the state is being changed from open() or close().
@@ -2997,9 +2869,9 @@
2997 2869 this.isFromInternalAction = false;
2998 2870 this.expanded.bind(() => {
2999 2871 if (!this.isFromInternalAction) {
3000 2872 // Propagate the event to React to sync the state.
3001 - (0,external_wp_data_namespaceObject.dispatch)(store_store).setIsInserterOpened(this.expanded());
2873 + (0,external_wp_data_namespaceObject.dispatch)(store).setIsInserterOpened(this.expanded());
3002 2874 }
3003 2875
3004 2876 this.isFromInternalAction = false;
3005 2877 });
@@ -3051,9 +2923,9 @@
3051 2923 }
3052 2924
3053 2925 };
3054 2926 }
3055 -//# sourceMappingURL=inserter-outer-section.js.map
2927 +
3056 2928 ;// CONCATENATED MODULE: ./packages/customize-widgets/build-module/controls/sidebar-control.js
3057 2929 /**
3058 2930 * WordPress dependencies
3059 2931 */
@@ -3099,9 +2971,9 @@
3099 2971 onChangeSectionExpanded(expanded, args) {
3100 2972 if (!args.unchanged) {
3101 2973 // Close the inserter when the section collapses.
3102 2974 if (!expanded) {
3103 - (0,external_wp_data_namespaceObject.dispatch)(store_store).setIsInserterOpened(false);
2975 + (0,external_wp_data_namespaceObject.dispatch)(store).setIsInserterOpened(false);
3104 2976 }
3105 2977
3106 2978 this.subscribers.forEach(subscriber => subscriber(expanded, args));
3107 2979 }
@@ -3108,19 +2980,13 @@
3108 2980 }
3109 2981
3110 2982 };
3111 2983 }
3112 -//# sourceMappingURL=sidebar-control.js.map
3113 -;// CONCATENATED MODULE: external ["wp","hooks"]
3114 -var external_wp_hooks_namespaceObject = window["wp"]["hooks"];
2984 +
3115 2985 ;// CONCATENATED MODULE: ./packages/customize-widgets/build-module/filters/move-to-sidebar.js
3116 2986
3117 2987
3118 2988 /**
3119 - * External dependencies
3120 - */
3121 -
3122 -/**
3123 2989 * WordPress dependencies
3124 2990 */
3125 2991
3126 2992
@@ -3126,9 +2992,8 @@
3126 2992
3127 2993
3128 2994
3129 2995
3130 -
3131 2996 /**
3132 2997 * Internal dependencies
3133 2998 */
3134 2999
@@ -3161,9 +3026,9 @@
3161 3026 * If there's a widgetId, move it to the other sidebar.
3162 3027 */
3163 3028 const oldSetting = activeSidebarControl.setting;
3164 3029 const newSetting = newSidebarControl.setting;
3165 - oldSetting((0,external_lodash_namespaceObject.without)(oldSetting(), widgetId));
3030 + oldSetting(oldSetting().filter(id => id !== widgetId));
3166 3031 newSetting([...newSetting(), widgetId]);
3167 3032 } else {
3168 3033 /**
3169 3034 * If there isn't a widgetId, it's most likely a inner block.
@@ -3191,9 +3056,9 @@
3191 3056 onSelect: moveToSidebar
3192 3057 })));
3193 3058 }, 'withMoveToSidebarToolbarItem');
3194 3059 (0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/customize-widgets/block-edit', withMoveToSidebarToolbarItem);
3195 -//# sourceMappingURL=move-to-sidebar.js.map
3060 +
3196 3061 ;// CONCATENATED MODULE: ./packages/customize-widgets/build-module/filters/replace-media-upload.js
3197 3062 /**
3198 3063 * WordPress dependencies
3199 3064 */
@@ -3202,9 +3067,9 @@
3202 3067
3203 3068 const replaceMediaUpload = () => external_wp_mediaUtils_namespaceObject.MediaUpload;
3204 3069
3205 3070 (0,external_wp_hooks_namespaceObject.addFilter)('editor.MediaUpload', 'core/edit-widgets/replace-media-upload', replaceMediaUpload);
3206 -//# sourceMappingURL=replace-media-upload.js.map
3071 +
3207 3072 ;// CONCATENATED MODULE: ./packages/customize-widgets/build-module/filters/wide-widget-display.js
3208 3073
3209 3074
3210 3075
@@ -3227,9 +3092,9 @@
3227 3092 isWide: isWide
3228 3093 }));
3229 3094 }, 'withWideWidgetDisplay');
3230 3095 (0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/customize-widgets/wide-widget-display', withWideWidgetDisplay);
3231 -//# sourceMappingURL=wide-widget-display.js.map
3096 +
3232 3097 ;// CONCATENATED MODULE: ./packages/customize-widgets/build-module/filters/index.js
3233 3098 /**
3234 3099 * Internal dependencies
3235 3100 */
@@ -3235,9 +3100,9 @@
3235 3100 */
3236 3101
3237 3102
3238 3103
3239 -//# sourceMappingURL=index.js.map
3104 +
3240 3105 ;// CONCATENATED MODULE: ./packages/customize-widgets/build-module/index.js
3241 3106
3242 3107
3243 3108 /**
@@ -3269,9 +3134,9 @@
3269 3134 * @param {Object} blockEditorSettings Block editor settings.
3270 3135 */
3271 3136
3272 3137 function initialize(editorName, blockEditorSettings) {
3273 - (0,external_wp_data_namespaceObject.dispatch)(store).setFeatureDefaults('core/customize-widgets', {
3138 + (0,external_wp_data_namespaceObject.dispatch)(external_wp_preferences_namespaceObject.store).setDefaults('core/customize-widgets', {
3274 3139 fixedToolbar: false,
3275 3140 welcomeGuide: true
3276 3141 });
3277 3142
@@ -3315,9 +3180,10 @@
3315 3180 blockEditorSettings: blockEditorSettings
3316 3181 }), container);
3317 3182 });
3318 3183 }
3319 -//# sourceMappingURL=index.js.map
3320 -}();
3184 +
3185 +})();
3186 +
3321 3187 (window.wp = window.wp || {}).customizeWidgets = __webpack_exports__;
3322 3188 /******/ })()
3323 3189 ;