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-navigation/index.js +507 -657 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 - "__unstableCreateMenuPreloadingMiddleware": function() { return /* reexport */ createMenuPreloadingMiddleware; },
146 - "initialize": function() { return /* binding */ initialize; }
145 + "__unstableCreateMenuPreloadingMiddleware": () => (/* reexport */ createMenuPreloadingMiddleware),
146 + "initialize": () => (/* binding */ initialize)
147 147 });
148 148
149 149 // NAMESPACE OBJECT: ./packages/edit-navigation/build-module/store/resolvers.js
150 150 var resolvers_namespaceObject = {};
@@ -149,9 +149,9 @@
149 149 // NAMESPACE OBJECT: ./packages/edit-navigation/build-module/store/resolvers.js
150 150 var resolvers_namespaceObject = {};
151 151 __webpack_require__.r(resolvers_namespaceObject);
152 152 __webpack_require__.d(resolvers_namespaceObject, {
153 - "getNavigationPostForMenu": function() { return getNavigationPostForMenu; }
153 + "getNavigationPostForMenu": () => (getNavigationPostForMenu)
154 154 });
155 155
156 156 // NAMESPACE OBJECT: ./packages/edit-navigation/build-module/store/selectors.js
157 157 var selectors_namespaceObject = {};
@@ -156,12 +156,11 @@
156 156 // NAMESPACE OBJECT: ./packages/edit-navigation/build-module/store/selectors.js
157 157 var selectors_namespaceObject = {};
158 158 __webpack_require__.r(selectors_namespaceObject);
159 159 __webpack_require__.d(selectors_namespaceObject, {
160 - "getNavigationPostForMenu": function() { return selectors_getNavigationPostForMenu; },
161 - "getSelectedMenuId": function() { return getSelectedMenuId; },
162 - "hasResolvedNavigationPost": function() { return hasResolvedNavigationPost; },
163 - "isInserterOpened": function() { return isInserterOpened; }
160 + "getNavigationPostForMenu": () => (selectors_getNavigationPostForMenu),
161 + "hasResolvedNavigationPost": () => (hasResolvedNavigationPost),
162 + "isInserterOpened": () => (isInserterOpened)
164 163 });
165 164
166 165 // NAMESPACE OBJECT: ./packages/edit-navigation/build-module/store/actions.js
167 166 var actions_namespaceObject = {};
@@ -166,11 +165,10 @@
166 165 // NAMESPACE OBJECT: ./packages/edit-navigation/build-module/store/actions.js
167 166 var actions_namespaceObject = {};
168 167 __webpack_require__.r(actions_namespaceObject);
169 168 __webpack_require__.d(actions_namespaceObject, {
170 - "saveNavigationPost": function() { return saveNavigationPost; },
171 - "setIsInserterOpened": function() { return setIsInserterOpened; },
172 - "setSelectedMenuId": function() { return setSelectedMenuId; }
169 + "saveNavigationPost": () => (saveNavigationPost),
170 + "setIsInserterOpened": () => (setIsInserterOpened)
173 171 });
174 172
175 173 // NAMESPACE OBJECT: ./packages/interface/build-module/store/actions.js
176 174 var store_actions_namespaceObject = {};
@@ -175,15 +173,16 @@
175 173 // NAMESPACE OBJECT: ./packages/interface/build-module/store/actions.js
176 174 var store_actions_namespaceObject = {};
177 175 __webpack_require__.r(store_actions_namespaceObject);
178 176 __webpack_require__.d(store_actions_namespaceObject, {
179 - "disableComplementaryArea": function() { return disableComplementaryArea; },
180 - "enableComplementaryArea": function() { return enableComplementaryArea; },
181 - "pinItem": function() { return pinItem; },
182 - "setFeatureDefaults": function() { return setFeatureDefaults; },
183 - "setFeatureValue": function() { return setFeatureValue; },
184 - "toggleFeature": function() { return toggleFeature; },
185 - "unpinItem": function() { return unpinItem; }
177 + "disableComplementaryArea": () => (disableComplementaryArea),
178 + "enableComplementaryArea": () => (enableComplementaryArea),
179 + "pinItem": () => (pinItem),
180 + "setDefaultComplementaryArea": () => (setDefaultComplementaryArea),
181 + "setFeatureDefaults": () => (setFeatureDefaults),
182 + "setFeatureValue": () => (setFeatureValue),
183 + "toggleFeature": () => (toggleFeature),
184 + "unpinItem": () => (unpinItem)
186 185 });
187 186
188 187 // NAMESPACE OBJECT: ./packages/interface/build-module/store/selectors.js
189 188 var store_selectors_namespaceObject = {};
@@ -188,25 +187,25 @@
188 187 // NAMESPACE OBJECT: ./packages/interface/build-module/store/selectors.js
189 188 var store_selectors_namespaceObject = {};
190 189 __webpack_require__.r(store_selectors_namespaceObject);
191 190 __webpack_require__.d(store_selectors_namespaceObject, {
192 - "getActiveComplementaryArea": function() { return getActiveComplementaryArea; },
193 - "isFeatureActive": function() { return isFeatureActive; },
194 - "isItemPinned": function() { return isItemPinned; }
191 + "getActiveComplementaryArea": () => (getActiveComplementaryArea),
192 + "isFeatureActive": () => (isFeatureActive),
193 + "isItemPinned": () => (isItemPinned)
195 194 });
196 195
197 196 ;// CONCATENATED MODULE: external ["wp","element"]
198 -var external_wp_element_namespaceObject = window["wp"]["element"];
197 +const external_wp_element_namespaceObject = window["wp"]["element"];
199 198 ;// CONCATENATED MODULE: external ["wp","blocks"]
200 -var external_wp_blocks_namespaceObject = window["wp"]["blocks"];
199 +const external_wp_blocks_namespaceObject = window["wp"]["blocks"];
201 200 ;// CONCATENATED MODULE: external ["wp","blockLibrary"]
202 -var external_wp_blockLibrary_namespaceObject = window["wp"]["blockLibrary"];
201 +const external_wp_blockLibrary_namespaceObject = window["wp"]["blockLibrary"];
203 202 ;// CONCATENATED MODULE: external ["wp","data"]
204 -var external_wp_data_namespaceObject = window["wp"]["data"];
203 +const external_wp_data_namespaceObject = window["wp"]["data"];
205 204 ;// CONCATENATED MODULE: external ["wp","coreData"]
206 -var external_wp_coreData_namespaceObject = window["wp"]["coreData"];
205 +const external_wp_coreData_namespaceObject = window["wp"]["coreData"];
207 206 ;// CONCATENATED MODULE: external ["wp","i18n"]
208 -var external_wp_i18n_namespaceObject = window["wp"]["i18n"];
207 +const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
209 208 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/constants/index.js
210 209 /**
211 210 * "Kind" of the menu post.
212 211 *
@@ -262,9 +261,9 @@
262 261 * @type {string}
263 262 */
264 263
265 264 const NEW_TAB_TARGET_ATTRIBUTE = '_blank';
266 -//# sourceMappingURL=index.js.map
265 +
267 266 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/store/reducer.js
268 267 /**
269 268 * WordPress dependencies
270 269 */
@@ -269,27 +268,8 @@
269 268 * WordPress dependencies
270 269 */
271 270
272 271 /**
273 - * Reducer keeping track of selected menu ID.
274 - *
275 - * @param {number} state Current state.
276 - * @param {Object} action Dispatched action.
277 - * @return {Object} Updated state.
278 - */
279 -
280 -function selectedMenuId() {
281 - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
282 - let action = arguments.length > 1 ? arguments[1] : undefined;
283 -
284 - switch (action.type) {
285 - case 'SET_SELECTED_MENU_ID':
286 - return action.menuId;
287 - }
288 -
289 - return state;
290 -}
291 -/**
292 272 * Reducer tracking whether the inserter is open.
293 273 *
294 274 * @param {boolean|Object} state Current state.
295 275 * @param {Object} action Dispatched action.
@@ -308,13 +288,12 @@
308 288
309 289 return state;
310 290 }
311 291
312 -/* harmony default export */ var reducer = ((0,external_wp_data_namespaceObject.combineReducers)({
313 - selectedMenuId,
292 +/* harmony default export */ const reducer = ((0,external_wp_data_namespaceObject.combineReducers)({
314 293 blockInserterPanel
315 294 }));
316 -//# sourceMappingURL=reducer.js.map
295 +
317 296 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/store/utils.js
318 297 /**
319 298 * A WP nav_menu_item object.
320 299 * For more documentation on the individual fields present on a menu item please see:
@@ -393,11 +372,11 @@
393 372 * @return {boolean} True if a given block should be persisted as a menu item, false otherwise.
394 373 */
395 374
396 375 const isBlockSupportedInNav = block => ['core/navigation-link', 'core/navigation-submenu'].includes(block.name);
397 -//# sourceMappingURL=utils.js.map
376 +
398 377 ;// CONCATENATED MODULE: external "lodash"
399 -var external_lodash_namespaceObject = window["lodash"];
378 +const external_lodash_namespaceObject = window["lodash"];
400 379 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/store/transform.js
401 380 /**
402 381 * External dependencies
403 382 */
@@ -434,9 +413,15 @@
434 413 * @property {string} target The target attribute of the link element for this menu item.
435 414 */
436 415
437 416 function blockToMenuItem(block, menuItem, parentId, blockPosition, menuId) {
438 - menuItem = (0,external_lodash_namespaceObject.omit)(menuItem, 'menus', 'meta', '_links');
417 + const {
418 + menus,
419 + meta,
420 + _links,
421 + ...restMenuItem
422 + } = menuItem;
423 + menuItem = restMenuItem;
439 424 menuItem.content = (0,external_lodash_namespaceObject.get)(menuItem.content, 'raw', menuItem.content);
440 425 let attributes;
441 426
442 427 if (isBlockSupportedInNav(block)) {
@@ -556,9 +541,9 @@
556 541 */
557 542
558 543 function mapMenuItemsToBlocks(menuItems) {
559 544 // The menuItem should be in menu_order sort order.
560 - const sortedItems = (0,external_lodash_namespaceObject.sortBy)(menuItems, 'menu_order');
545 + const sortedItems = [...menuItems].sort((a, b) => a.menu_order - b.menu_order);
561 546 const blocks = sortedItems.map(menuItem => {
562 547 var _menuItem$children;
563 548
564 549 if (menuItem.type === 'block') {
@@ -581,12 +566,9 @@
581 566 const itemBlockName = nestedBlocks !== null && nestedBlocks !== void 0 && nestedBlocks.length ? 'core/navigation-submenu' : 'core/navigation-link'; // Create block with nested "innerBlocks".
582 567
583 568 return (0,external_wp_blocks_namespaceObject.createBlock)(itemBlockName, attributes, nestedBlocks);
584 569 });
585 - return (0,external_lodash_namespaceObject.zip)(blocks, sortedItems).map(_ref2 => {
586 - let [block, menuItem] = _ref2;
587 - return addRecordIdToBlock(block, menuItem.id);
588 - });
570 + return blocks.map((block, blockIndex) => addRecordIdToBlock(block, sortedItems[blockIndex].id));
589 571 } // A few parameters are using snake case, let's embrace that for convenience:
590 572
591 573 /* eslint-disable camelcase */
592 574
@@ -597,9 +579,9 @@
597 579 * @return {Object} the block attributes converted from the WPNavMenuItem item.
598 580 */
599 581
600 582
601 -function menuItemToBlockAttributes(_ref3) {
583 +function menuItemToBlockAttributes(_ref2) {
602 584 var _object;
603 585
604 586 let {
605 587 title: menuItemTitleField,
@@ -611,9 +593,9 @@
611 593 description,
612 594 url,
613 595 type: menuItemTypeField,
614 596 target
615 - } = _ref3;
597 + } = _ref2;
616 598
617 599 // For historical reasons, the `core/navigation-link` variation type is `tag`
618 600 // whereas WP Core expects `post_tag` as the `object` type.
619 601 // To avoid writing a block migration we perform a conversion here.
@@ -690,9 +672,9 @@
690 672 }
691 673
692 674 return dataTree;
693 675 }
694 -//# sourceMappingURL=transform.js.map
676 +
695 677 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/store/resolvers.js
696 678 /**
697 679 * WordPress dependencies
698 680 */
@@ -725,21 +707,21 @@
725 707 if (!menuId) {
726 708 return;
727 709 }
728 710
729 - const stubPost = createStubPost(menuId); // Persist an empty post to warm up the state
711 + const stubPost = createStubPost(menuId); // Persist an empty post to warm up the state.
730 712
731 713 dispatch(persistPost(stubPost)); // Dispatch startResolution to skip the execution of the real getEntityRecord resolver - it would
732 714 // issue an http request and fail.
733 715
734 716 const args = [NAVIGATION_POST_KIND, NAVIGATION_POST_POST_TYPE, stubPost.id];
735 - registry.dispatch(external_wp_coreData_namespaceObject.store).startResolution('getEntityRecord', args); // Now let's create a proper one hydrated using actual menu items
717 + registry.dispatch(external_wp_coreData_namespaceObject.store).startResolution('getEntityRecord', args); // Now let's create a proper one hydrated using actual menu items.
736 718
737 719 const menuItems = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getMenuItems(menuItemsQuery(menuId));
738 - const navigationBlock = createNavigationBlock(menuItems); // Persist the actual post containing the navigation block
720 + const navigationBlock = createNavigationBlock(menuItems); // Persist the actual post containing the navigation block.
739 721
740 722 const builtPost = createStubPost(menuId, navigationBlock);
741 - dispatch(persistPost(builtPost)); // Dispatch finishResolution to conclude startResolution dispatched earlier
723 + dispatch(persistPost(builtPost)); // Dispatch finishResolution to conclude startResolution dispatched earlier.
742 724
743 725 registry.dispatch(external_wp_coreData_namespaceObject.store).finishResolution('getEntityRecord', args);
744 726 };
745 727
@@ -779,9 +761,9 @@
779 761 return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation', {
780 762 orientation: 'vertical'
781 763 }, innerBlocks);
782 764 }
783 -//# sourceMappingURL=resolvers.js.map
765 +
784 766 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/store/selectors.js
785 767 /**
786 768 * WordPress dependencies
787 769 */
@@ -793,20 +775,8 @@
793 775
794 776
795 777
796 778 /**
797 - * Returns the selected menu ID.
798 - *
799 - * @param {Object} state Global application state.
800 - * @return {number} The selected menu ID.
801 - */
802 -
803 -function getSelectedMenuId(state) {
804 - var _state$selectedMenuId;
805 -
806 - return (_state$selectedMenuId = state.selectedMenuId) !== null && _state$selectedMenuId !== void 0 ? _state$selectedMenuId : null;
807 -}
808 -/**
809 779 * Returns a "stub" navigation post reflecting the contents of menu with id=menuId. The
810 780 * post is meant as a convenient to only exists in runtime and should never be saved. It
811 781 * enables a convenient way of editing the navigation by using a regular post editor.
812 782 *
@@ -846,29 +816,24 @@
846 816 function isInserterOpened() {
847 817 let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
848 818 return !!(state !== null && state !== void 0 && state.blockInserterPanel);
849 819 }
850 -//# sourceMappingURL=selectors.js.map
820 +
851 821 ;// CONCATENATED MODULE: external ["wp","notices"]
852 -var external_wp_notices_namespaceObject = window["wp"]["notices"];
822 +const external_wp_notices_namespaceObject = window["wp"]["notices"];
853 823 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/store/constants.js
854 824 /**
855 825 * Module Constants
856 826 */
857 827 const STORE_NAME = 'core/edit-navigation';
858 -//# sourceMappingURL=constants.js.map
828 +
859 829 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/store/actions.js
860 830 /**
861 - * External dependencies
862 - */
863 -
864 -/**
865 831 * WordPress dependencies
866 832 */
867 833
868 834
869 835
870 -
871 836 /**
872 837 * Internal dependencies
873 838 */
874 839
@@ -876,21 +841,8 @@
876 841
877 842
878 843
879 844 /**
880 - * Returns an action object used to select menu.
881 - *
882 - * @param {number} menuId The menu ID.
883 - * @return {Object} Action object.
884 - */
885 -
886 -function setSelectedMenuId(menuId) {
887 - return {
888 - type: 'SET_SELECTED_MENU_ID',
889 - menuId
890 - };
891 -}
892 -/**
893 845 * Converts all the blocks into menu items and submits a batch request to save everything at once.
894 846 *
895 847 * @param {Object} post A navigation post to process
896 848 * @return {Function} An action creator
@@ -905,18 +857,14 @@
905 857 exclusive: true
906 858 });
907 859
908 860 try {
909 - const menuId = post.meta.menuId; // Save menu
861 + const menuId = post.meta.menuId; // Save menu.
910 862
911 - await registry.dispatch(external_wp_coreData_namespaceObject.store).saveEditedEntityRecord('root', 'menu', menuId);
912 - const error = registry.select(external_wp_coreData_namespaceObject.store).getLastEntitySaveError('root', 'menu', menuId);
863 + await registry.dispatch(external_wp_coreData_namespaceObject.store).saveEditedEntityRecord('root', 'menu', menuId, {
864 + throwOnError: true
865 + }); // Save menu items.
913 866
914 - if (error) {
915 - throw new Error(error.message);
916 - } // Save menu items
917 -
918 -
919 867 const updatedBlocks = await dispatch(batchSaveMenuItems(post.blocks[0], menuId)); // Clear "stub" navigation post edits to avoid a false "dirty" state.
920 868
921 869 registry.dispatch(external_wp_coreData_namespaceObject.store).receiveEntityRecords(NAVIGATION_POST_KIND, NAVIGATION_POST_POST_TYPE, post, undefined);
922 870 const updatedPost = { ...post,
@@ -928,9 +876,9 @@
928 876 });
929 877 } catch (saveError) {
930 878 const errorMessage = saveError ? (0,external_wp_i18n_namespaceObject.sprintf)(
931 879 /* translators: %s: The text of an error message (potentially untranslated). */
932 - (0,external_wp_i18n_namespaceObject.__)("Unable to save: '%s'"), saveError.message) : (0,external_wp_i18n_namespaceObject.__)('Unable to save: An error ocurred.');
880 + (0,external_wp_i18n_namespaceObject.__)("Unable to save: '%s'"), saveError.message) : (0,external_wp_i18n_namespaceObject.__)('Unable to save: An error occurred.');
933 881 registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice(errorMessage, {
934 882 type: 'snackbar'
935 883 });
936 884 } finally {
@@ -950,9 +898,9 @@
950 898 let {
951 899 dispatch,
952 900 registry
953 901 } = _ref2;
954 - // Make sure all the existing menu items are available before proceeding
902 + // Make sure all the existing menu items are available before proceeding.
955 903 const oldMenuItems = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getMenuItems({
956 904 menus: menuId,
957 905 per_page: -1
958 906 }); // Insert placeholders for new menu items to have an ID to work with.
@@ -962,16 +910,16 @@
962 910 const navBlockWithRecordIds = await dispatch(batchInsertPlaceholderMenuItems(navigationBlock)); // Update menu items. This is separate from deleting, because there
963 911 // are no consistency guarantees and we don't want to delete something
964 912 // that was a parent node before another node takes it place.
965 913
966 - const navBlockAfterUpdates = await dispatch(batchUpdateMenuItems(navBlockWithRecordIds, menuId)); // Delete menu items
914 + const navBlockAfterUpdates = await dispatch(batchUpdateMenuItems(navBlockWithRecordIds, menuId)); // Delete menu items.
967 915
968 - const deletedIds = (0,external_lodash_namespaceObject.difference)(oldMenuItems.map(_ref3 => {
916 + const deletedIds = oldMenuItems.map(_ref3 => {
969 917 let {
970 918 id
971 919 } = _ref3;
972 920 return id;
973 - }), blocksTreeToList(navBlockAfterUpdates).map(getRecordIdFromBlock));
921 + }).filter(id => !blocksTreeToList(navBlockAfterUpdates).map(getRecordIdFromBlock).includes(id));
974 922 await dispatch(batchDeleteMenuItems(deletedIds));
975 923 return navBlockAfterUpdates;
976 924 };
977 925 /**
@@ -997,11 +945,11 @@
997 945 url: '#placeholder',
998 946 menu_order: 1
999 947 });
1000 948 });
1001 - const results = await registry.dispatch(external_wp_coreData_namespaceObject.store).__experimentalBatch(tasks); // Return an updated navigation block with all the IDs in
949 + const results = await registry.dispatch(external_wp_coreData_namespaceObject.store).__experimentalBatch(tasks); // Return an updated navigation block with all the IDs in.
1002 950
1003 - const blockToResult = new Map((0,external_lodash_namespaceObject.zip)(blocksWithoutRecordId, results));
951 + const blockToResult = new Map(blocksWithoutRecordId.map((block, index) => [block, results[index]]));
1004 952 return mapBlocksTree(navigationBlock, block => {
1005 953 if (!blockToResult.has(block)) {
1006 954 return block;
1007 955 }
@@ -1040,15 +988,15 @@
1040 988 window.console.warn((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Name of block (i.e. core/legacy-widget)
1041 989 (0,external_wp_i18n_namespaceObject.__)('The following blocks haven\'t been saved because they are not supported: "%s".'), unsupportedMenuItems.join('", "')));
1042 990 }
1043 991
1044 - const updatedMenuItems = allMenuItems // Filter out unsupported blocks
992 + const updatedMenuItems = allMenuItems // Filter out unsupported blocks.
1045 993 .filter(_ref9 => {
1046 994 let {
1047 995 block
1048 996 } = _ref9;
1049 997 return isBlockSupportedInNav(block);
1050 - }) // Transform the blocks into menu items
998 + }) // Transform the blocks into menu items.
1051 999 .map(_ref10 => {
1052 1000 let {
1053 1001 block,
1054 1002 parentBlock,
@@ -1054,9 +1002,9 @@
1054 1002 parentBlock,
1055 1003 childIndex
1056 1004 } = _ref10;
1057 1005 return blockToMenuItem(block, registry.select(external_wp_coreData_namespaceObject.store).getMenuItem(getRecordIdFromBlock(block)), getRecordIdFromBlock(parentBlock), childIndex, menuId);
1058 - }) // Filter out menu items without any edits
1006 + }) // Filter out menu items without any edits.
1059 1007 .filter(menuItem => {
1060 1008 // Update an existing entity record.
1061 1009 registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord('root', 'menuItem', menuItem.id, menuItem, {
1062 1010 undoIgnore: true
@@ -1061,9 +1009,9 @@
1061 1009 registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord('root', 'menuItem', menuItem.id, menuItem, {
1062 1010 undoIgnore: true
1063 1011 });
1064 1012 return registry.select(external_wp_coreData_namespaceObject.store).hasEditsForEntityRecord('root', 'menuItem', menuItem.id);
1065 - }); // Map the edited menu items to batch tasks
1013 + }); // Map the edited menu items to batch tasks.
1066 1014
1067 1015 const tasks = updatedMenuItems.map(menuItem => _ref11 => {
1068 1016 let {
1069 1017 saveEditedEntityRecord
@@ -1183,9 +1131,9 @@
1183 1131 type: 'SET_IS_INSERTER_OPENED',
1184 1132 value
1185 1133 };
1186 1134 }
1187 -//# sourceMappingURL=actions.js.map
1135 +
1188 1136 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/store/index.js
1189 1137 /**
1190 1138 * WordPress dependencies
1191 1139 */
@@ -1199,36 +1147,23 @@
1199 1147
1200 1148
1201 1149
1202 1150 /**
1203 - * Block editor data store configuration.
1151 + * Store definition for the edit navigation namespace.
1204 1152 *
1205 - * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore
1153 + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
1206 1154 *
1207 1155 * @type {Object}
1208 1156 */
1209 1157
1210 -const storeConfig = {
1158 +const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, {
1211 1159 reducer: reducer,
1212 1160 selectors: selectors_namespaceObject,
1213 1161 resolvers: resolvers_namespaceObject,
1214 - actions: actions_namespaceObject,
1215 - persist: ['selectedMenuId'],
1216 - __experimentalUseThunks: true
1217 -};
1218 -/**
1219 - * Store definition for the edit navigation namespace.
1220 - *
1221 - * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
1222 - *
1223 - * @type {Object}
1224 - */
1162 + actions: actions_namespaceObject
1163 +});
1164 +(0,external_wp_data_namespaceObject.register)(store);
1225 1165
1226 -const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, storeConfig); // Once we build a more generic persistence plugin that works across types of stores
1227 -// we'd be able to replace this with a register call.
1228 -
1229 -(0,external_wp_data_namespaceObject.registerStore)(STORE_NAME, storeConfig);
1230 -//# sourceMappingURL=index.js.map
1231 1166 ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
1232 1167 function _extends() {
1233 1168 _extends = Object.assign || function (target) {
1234 1169 for (var i = 1; i < arguments.length; i++) {
@@ -1246,13 +1181,13 @@
1246 1181
1247 1182 return _extends.apply(this, arguments);
1248 1183 }
1249 1184 ;// CONCATENATED MODULE: external ["wp","hooks"]
1250 -var external_wp_hooks_namespaceObject = window["wp"]["hooks"];
1185 +const external_wp_hooks_namespaceObject = window["wp"]["hooks"];
1251 1186 ;// CONCATENATED MODULE: external ["wp","compose"]
1252 -var external_wp_compose_namespaceObject = window["wp"]["compose"];
1187 +const external_wp_compose_namespaceObject = window["wp"]["compose"];
1253 1188 ;// CONCATENATED MODULE: external ["wp","blockEditor"]
1254 -var external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"];
1189 +const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"];
1255 1190 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/filters/add-navigation-editor-custom-appender.js
1256 1191
1257 1192
1258 1193
@@ -1318,14 +1253,14 @@
1318 1253 return (0,external_wp_element_namespaceObject.createElement)(EnhancedNavigationBlock, _extends({
1319 1254 blockEdit: BlockEdit
1320 1255 }, props));
1321 1256 }, 'withNavigationEditorCustomAppender');
1322 -/* harmony default export */ var add_navigation_editor_custom_appender = (() => (0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/edit-navigation/with-navigation-editor-custom-appender', addNavigationEditorCustomAppender));
1323 -//# sourceMappingURL=add-navigation-editor-custom-appender.js.map
1257 +/* harmony default export */ const add_navigation_editor_custom_appender = (() => (0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/edit-navigation/with-navigation-editor-custom-appender', addNavigationEditorCustomAppender));
1258 +
1324 1259 ;// CONCATENATED MODULE: external ["wp","components"]
1325 -var external_wp_components_namespaceObject = window["wp"]["components"];
1260 +const external_wp_components_namespaceObject = window["wp"]["components"];
1326 1261 ;// CONCATENATED MODULE: external ["wp","primitives"]
1327 -var external_wp_primitives_namespaceObject = window["wp"]["primitives"];
1262 +const external_wp_primitives_namespaceObject = window["wp"]["primitives"];
1328 1263 ;// CONCATENATED MODULE: ./packages/icons/build-module/library/chevron-down.js
1329 1264
1330 1265
1331 1266 /**
@@ -1337,10 +1272,10 @@
1337 1272 xmlns: "http://www.w3.org/2000/svg"
1338 1273 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
1339 1274 d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"
1340 1275 }));
1341 -/* harmony default export */ var chevron_down = (chevronDown);
1342 -//# sourceMappingURL=chevron-down.js.map
1276 +/* harmony default export */ const chevron_down = (chevronDown);
1277 +
1343 1278 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/hooks/use-menu-entity.js
1344 1279 /**
1345 1280 * WordPress dependencies
1346 1281 */
@@ -1371,9 +1306,9 @@
1371 1306 editMenuEntityRecord: editEntityRecord,
1372 1307 hasLoadedEditedMenu
1373 1308 };
1374 1309 }
1375 -//# sourceMappingURL=use-menu-entity.js.map
1310 +
1376 1311 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/hooks/use-menu-entity-prop.js
1377 1312 /**
1378 1313 * WordPress dependencies
1379 1314 */
@@ -1397,9 +1332,9 @@
1397 1332
1398 1333 function useMenuEntityProp(prop, menuId) {
1399 1334 return (0,external_wp_coreData_namespaceObject.useEntityProp)(MENU_KIND, MENU_POST_TYPE, prop, menuId);
1400 1335 }
1401 -//# sourceMappingURL=use-menu-entity-prop.js.map
1336 +
1402 1337 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/hooks/use-navigation-editor.js
1403 1338 /**
1404 1339 * WordPress dependencies
1405 1340 */
@@ -1507,11 +1442,11 @@
1507 1442 deleteMenu,
1508 1443 isMenuSelected: !!selectedMenuId
1509 1444 };
1510 1445 }
1511 -//# sourceMappingURL=use-navigation-editor.js.map
1446 +
1512 1447 ;// CONCATENATED MODULE: external ["wp","dom"]
1513 -var external_wp_dom_namespaceObject = window["wp"]["dom"];
1448 +const external_wp_dom_namespaceObject = window["wp"]["dom"];
1514 1449 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/hooks/use-menu-notifications.js
1515 1450 /**
1516 1451 * WordPress dependencies
1517 1452 */
@@ -1539,17 +1474,16 @@
1539 1474 });
1540 1475 }
1541 1476 }, [lastDeleteError]);
1542 1477 }
1543 -//# sourceMappingURL=use-menu-notifications.js.map
1478 +
1479 +;// CONCATENATED MODULE: external ["wp","preferences"]
1480 +const external_wp_preferences_namespaceObject = window["wp"]["preferences"];
1544 1481 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/hooks/use-selected-menu-id.js
1545 1482 /**
1546 1483 * WordPress dependencies
1547 1484 */
1548 1485
1549 -/**
1550 - * Internal dependencies
1551 - */
1552 1486
1553 1487
1554 1488 /**
1555 1489 * Returns selected menu ID and the setter.
@@ -1559,17 +1493,20 @@
1559 1493 * the setter.
1560 1494 */
1561 1495
1562 1496 function useSelectedMenuId() {
1563 - const selectedMenuId = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getSelectedMenuId(), []);
1497 + var _useSelect;
1498 +
1499 + const selectedMenuId = (_useSelect = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_preferences_namespaceObject.store).get('core/edit-navigation', 'selectedMenuId'), [])) !== null && _useSelect !== void 0 ? _useSelect : null;
1564 1500 const {
1565 - setSelectedMenuId
1566 - } = (0,external_wp_data_namespaceObject.useDispatch)(store);
1501 + set
1502 + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store);
1503 + const setSelectedMenuId = (0,external_wp_element_namespaceObject.useCallback)(menuId => set('core/edit-navigation', 'selectedMenuId', menuId), [set]);
1567 1504 return [selectedMenuId, setSelectedMenuId];
1568 1505 }
1569 -//# sourceMappingURL=use-selected-menu-id.js.map
1506 +
1570 1507 ;// CONCATENATED MODULE: external ["wp","apiFetch"]
1571 -var external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
1508 +const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
1572 1509 var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject);
1573 1510 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/hooks/use-menu-locations.js
1574 1511 /**
1575 1512 * WordPress dependencies
@@ -1648,9 +1585,9 @@
1648 1585 assignMenuToLocation,
1649 1586 toggleMenuLocationAssignment
1650 1587 };
1651 1588 }
1652 -//# sourceMappingURL=use-menu-locations.js.map
1589 +
1653 1590 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/hooks/use-navigation-editor-root-block.js
1654 1591 /**
1655 1592 * WordPress dependencies
1656 1593 */
@@ -1672,10 +1609,10 @@
1672 1609 };
1673 1610 }, []);
1674 1611 };
1675 1612
1676 -/* harmony default export */ var use_navigation_editor_root_block = (useNavigationEditorRootBlock);
1677 -//# sourceMappingURL=use-navigation-editor-root-block.js.map
1613 +/* harmony default export */ const use_navigation_editor_root_block = (useNavigationEditorRootBlock);
1614 +
1678 1615 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/hooks/index.js
1679 1616 /**
1680 1617 * WordPress dependencies
1681 1618 */
@@ -1689,9 +1626,9 @@
1689 1626
1690 1627
1691 1628
1692 1629
1693 -//# sourceMappingURL=index.js.map
1630 +
1694 1631 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/components/block-placeholder/use-navigation-entities.js
1695 1632 /**
1696 1633 * WordPress dependencies
1697 1634 */
@@ -1719,39 +1656,35 @@
1719 1656 * @return { NavigationEntitiesData } the entity data.
1720 1657 */
1721 1658
1722 1659 function useNavigationEntities(menuId) {
1723 - return { ...usePageEntities(),
1724 - ...useMenuEntities(),
1725 - ...useMenuItemEntities(menuId)
1726 - };
1727 -}
1728 -
1729 -function useMenuEntities() {
1730 1660 const {
1731 - menus,
1732 - isResolvingMenus,
1733 - hasResolvedMenus
1734 - } = (0,external_wp_data_namespaceObject.useSelect)(select => {
1735 - const {
1736 - getMenus,
1737 - isResolving,
1738 - hasFinishedResolution
1739 - } = select(external_wp_coreData_namespaceObject.store);
1740 - const menusParameters = [{
1741 - per_page: -1
1742 - }];
1743 - return {
1744 - menus: getMenus(...menusParameters),
1745 - isResolvingMenus: isResolving('getMenus', menusParameters),
1746 - hasResolvedMenus: hasFinishedResolution('getMenus', menusParameters)
1747 - };
1748 - }, []);
1661 + records: menus,
1662 + isResolving: isResolvingMenus,
1663 + hasResolved: hasResolvedMenus
1664 + } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('root', 'menu', [{
1665 + per_page: -1
1666 + }]);
1667 + const {
1668 + records: pages,
1669 + isResolving: isResolvingPages,
1670 + hasResolved: hasResolvedPages
1671 + } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('postType', 'page', {
1672 + parent: 0,
1673 + order: 'asc',
1674 + orderby: 'id',
1675 + per_page: -1
1676 + });
1749 1677 return {
1678 + pages,
1679 + isResolvingPages,
1680 + hasResolvedPages,
1681 + hasPages: !!(hasResolvedPages && pages !== null && pages !== void 0 && pages.length),
1750 1682 menus,
1751 1683 isResolvingMenus,
1752 1684 hasResolvedMenus,
1753 - hasMenus: !!(hasResolvedMenus && menus !== null && menus !== void 0 && menus.length)
1685 + hasMenus: !!(hasResolvedMenus && menus !== null && menus !== void 0 && menus.length),
1686 + ...useMenuItemEntities(menuId)
1754 1687 };
1755 1688 }
1756 1689
1757 1690 function useMenuItemEntities(menuId) {
@@ -1756,22 +1689,25 @@
1756 1689
1757 1690 function useMenuItemEntities(menuId) {
1758 1691 const {
1759 1692 menuItems,
1760 - hasResolvedMenuItems
1693 + hasResolvedMenuItems = false
1761 1694 } = (0,external_wp_data_namespaceObject.useSelect)(select => {
1695 + if (!menuId) {
1696 + return {};
1697 + }
1698 +
1762 1699 const {
1763 1700 getMenuItems,
1764 1701 hasFinishedResolution
1765 1702 } = select(external_wp_coreData_namespaceObject.store);
1766 - const hasSelectedMenu = menuId !== undefined;
1767 - const menuItemsParameters = hasSelectedMenu ? [{
1703 + const query = {
1768 1704 menus: menuId,
1769 1705 per_page: -1
1770 - }] : undefined;
1706 + };
1771 1707 return {
1772 - menuItems: hasSelectedMenu ? getMenuItems(...menuItemsParameters) : undefined,
1773 - hasResolvedMenuItems: hasSelectedMenu ? hasFinishedResolution('getMenuItems', menuItemsParameters) : false
1708 + menuItems: getMenuItems(query),
1709 + hasResolvedMenuItems: hasFinishedResolution('getMenuItems', [query])
1774 1710 };
1775 1711 }, [menuId]);
1776 1712 return {
1777 1713 menuItems,
@@ -1778,39 +1714,8 @@
1778 1714 hasResolvedMenuItems
1779 1715 };
1780 1716 }
1781 1717
1782 -function usePageEntities() {
1783 - const {
1784 - pages,
1785 - isResolvingPages,
1786 - hasResolvedPages
1787 - } = (0,external_wp_data_namespaceObject.useSelect)(select => {
1788 - const {
1789 - getEntityRecords,
1790 - isResolving,
1791 - hasFinishedResolution
1792 - } = select(external_wp_coreData_namespaceObject.store);
1793 - const pagesParameters = ['postType', 'page', {
1794 - parent: 0,
1795 - order: 'asc',
1796 - orderby: 'id',
1797 - per_page: -1
1798 - }];
1799 - return {
1800 - pages: getEntityRecords(...pagesParameters) || null,
1801 - isResolvingPages: isResolving('getEntityRecords', pagesParameters),
1802 - hasResolvedPages: hasFinishedResolution('getEntityRecords', pagesParameters)
1803 - };
1804 - }, []);
1805 - return {
1806 - pages,
1807 - isResolvingPages,
1808 - hasResolvedPages,
1809 - hasPages: !!(hasResolvedPages && pages !== null && pages !== void 0 && pages.length)
1810 - };
1811 -}
1812 -//# sourceMappingURL=use-navigation-entities.js.map
1813 1718 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/components/block-placeholder/index.js
1814 1719
1815 1720
1816 1721 /**
@@ -1961,10 +1866,10 @@
1961 1866 }));
1962 1867 }) : undefined)));
1963 1868 }
1964 1869
1965 -/* harmony default export */ var block_placeholder = ((0,external_wp_element_namespaceObject.forwardRef)(BlockPlaceholder));
1966 -//# sourceMappingURL=index.js.map
1870 +/* harmony default export */ const block_placeholder = ((0,external_wp_element_namespaceObject.forwardRef)(BlockPlaceholder));
1871 +
1967 1872 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/filters/add-navigation-editor-placeholder.js
1968 1873
1969 1874
1970 1875
@@ -1986,12 +1891,12 @@
1986 1891 return (0,external_wp_element_namespaceObject.createElement)(BlockEdit, _extends({}, props, {
1987 1892 customPlaceholder: block_placeholder
1988 1893 }));
1989 1894 }, 'withNavigationEditorPlaceholder');
1990 -/* harmony default export */ var add_navigation_editor_placeholder = (() => (0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/edit-navigation/with-navigation-editor-placeholder', addNavigationEditorPlaceholder));
1991 -//# sourceMappingURL=add-navigation-editor-placeholder.js.map
1895 +/* harmony default export */ const add_navigation_editor_placeholder = (() => (0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/edit-navigation/with-navigation-editor-placeholder', addNavigationEditorPlaceholder));
1896 +
1992 1897 // EXTERNAL MODULE: ./node_modules/classnames/index.js
1993 -var classnames = __webpack_require__(4184);
1898 +var classnames = __webpack_require__(4403);
1994 1899 var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
1995 1900 ;// CONCATENATED MODULE: ./packages/icons/build-module/library/check.js
1996 1901
1997 1902
@@ -2004,10 +1909,10 @@
2004 1909 viewBox: "0 0 24 24"
2005 1910 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
2006 1911 d: "M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"
2007 1912 }));
2008 -/* harmony default export */ var library_check = (check);
2009 -//# sourceMappingURL=check.js.map
1913 +/* harmony default export */ const library_check = (check);
1914 +
2010 1915 ;// CONCATENATED MODULE: ./packages/icons/build-module/library/star-filled.js
2011 1916
2012 1917
2013 1918 /**
@@ -2019,10 +1924,10 @@
2019 1924 viewBox: "0 0 24 24"
2020 1925 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
2021 1926 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"
2022 1927 }));
2023 -/* harmony default export */ var star_filled = (starFilled);
2024 -//# sourceMappingURL=star-filled.js.map
1928 +/* harmony default export */ const star_filled = (starFilled);
1929 +
2025 1930 ;// CONCATENATED MODULE: ./packages/icons/build-module/library/star-empty.js
2026 1931
2027 1932
2028 1933 /**
@@ -2036,12 +1941,12 @@
2036 1941 fillRule: "evenodd",
2037 1942 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",
2038 1943 clipRule: "evenodd"
2039 1944 }));
2040 -/* harmony default export */ var star_empty = (starEmpty);
2041 -//# sourceMappingURL=star-empty.js.map
1945 +/* harmony default export */ const star_empty = (starEmpty);
1946 +
2042 1947 ;// CONCATENATED MODULE: external ["wp","viewport"]
2043 -var external_wp_viewport_namespaceObject = window["wp"]["viewport"];
1948 +const external_wp_viewport_namespaceObject = window["wp"]["viewport"];
2044 1949 ;// CONCATENATED MODULE: ./packages/icons/build-module/library/close-small.js
2045 1950
2046 1951
2047 1952 /**
@@ -2053,15 +1958,14 @@
2053 1958 viewBox: "0 0 24 24"
2054 1959 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
2055 1960 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"
2056 1961 }));
2057 -/* harmony default export */ var close_small = (closeSmall);
2058 -//# sourceMappingURL=close-small.js.map
2059 -;// CONCATENATED MODULE: ./packages/interface/build-module/store/reducer.js
2060 -/**
2061 - * External dependencies
2062 - */
1962 +/* harmony default export */ const close_small = (closeSmall);
2063 1963
1964 +;// CONCATENATED MODULE: external ["wp","deprecated"]
1965 +const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
1966 +var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
1967 +;// CONCATENATED MODULE: ./packages/interface/build-module/store/actions.js
2064 1968 /**
2065 1969 * WordPress dependencies
2066 1970 */
2067 1971
@@ -2066,238 +1970,118 @@
2066 1970 */
2067 1971
2068 1972
2069 1973 /**
2070 - * Reducer to keep tract of the active area per scope.
1974 + * Set a default complementary area.
2071 1975 *
2072 - * @param {boolean} state Previous state.
2073 - * @param {Object} action Action object.
2074 - * @param {string} action.type Action type.
2075 - * @param {string} action.itemType Type of item.
2076 - * @param {string} action.scope Item scope.
2077 - * @param {string} action.item Item name.
1976 + * @param {string} scope Complementary area scope.
1977 + * @param {string} area Area identifier.
2078 1978 *
2079 - * @return {Object} Updated state.
1979 + * @return {Object} Action object.
2080 1980 */
2081 1981
2082 -function singleEnableItems() {
2083 - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2084 - let {
2085 - type,
2086 - itemType,
2087 - scope,
2088 - item
2089 - } = arguments.length > 1 ? arguments[1] : undefined;
2090 -
2091 - if (type !== 'SET_SINGLE_ENABLE_ITEM' || !itemType || !scope) {
2092 - return state;
2093 - }
2094 -
2095 - return { ...state,
2096 - [itemType]: { ...state[itemType],
2097 - [scope]: item || null
2098 - }
2099 - };
2100 -}
1982 +const setDefaultComplementaryArea = (scope, area) => ({
1983 + type: 'SET_DEFAULT_COMPLEMENTARY_AREA',
1984 + scope,
1985 + area
1986 +});
2101 1987 /**
2102 - * Reducer keeping track of the "pinned" items per scope.
1988 + * Enable the complementary area.
2103 1989 *
2104 - * @param {boolean} state Previous state.
2105 - * @param {Object} action Action object.
2106 - * @param {string} action.type Action type.
2107 - * @param {string} action.itemType Type of item.
2108 - * @param {string} action.scope Item scope.
2109 - * @param {string} action.item Item name.
2110 - * @param {boolean} action.isEnable Whether the item is pinned.
2111 - *
2112 - * @return {Object} Updated state.
1990 + * @param {string} scope Complementary area scope.
1991 + * @param {string} area Area identifier.
2113 1992 */
2114 1993
2115 -function multipleEnableItems() {
2116 - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1994 +const enableComplementaryArea = (scope, area) => _ref => {
2117 1995 let {
2118 - type,
2119 - itemType,
2120 - scope,
2121 - item,
2122 - isEnable
2123 - } = arguments.length > 1 ? arguments[1] : undefined;
1996 + registry,
1997 + dispatch
1998 + } = _ref;
2124 1999
2125 - if (type !== 'SET_MULTIPLE_ENABLE_ITEM' || !itemType || !scope || !item || (0,external_lodash_namespaceObject.get)(state, [itemType, scope, item]) === isEnable) {
2126 - return state;
2000 + // Return early if there's no area.
2001 + if (!area) {
2002 + return;
2127 2003 }
2128 2004
2129 - const currentTypeState = state[itemType] || {};
2130 - const currentScopeState = currentTypeState[scope] || {};
2131 - return { ...state,
2132 - [itemType]: { ...currentTypeState,
2133 - [scope]: { ...currentScopeState,
2134 - [item]: isEnable || false
2135 - }
2136 - }
2137 - };
2138 -}
2139 -/**
2140 - * Reducer returning the defaults for user preferences.
2141 - *
2142 - * This is kept intentionally separate from the preferences
2143 - * themselves so that defaults are not persisted.
2144 - *
2145 - * @param {Object} state Current state.
2146 - * @param {Object} action Dispatched action.
2147 - *
2148 - * @return {Object} Updated state.
2149 - */
2005 + const isComplementaryAreaVisible = registry.select(external_wp_preferences_namespaceObject.store).get(scope, 'isComplementaryAreaVisible');
2150 2006
2151 -const preferenceDefaults = (0,external_wp_data_namespaceObject.combineReducers)({
2152 - features() {
2153 - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2154 - let action = arguments.length > 1 ? arguments[1] : undefined;
2155 -
2156 - if (action.type === 'SET_FEATURE_DEFAULTS') {
2157 - const {
2158 - scope,
2159 - defaults
2160 - } = action;
2161 - return { ...state,
2162 - [scope]: { ...state[scope],
2163 - ...defaults
2164 - }
2165 - };
2166 - }
2167 -
2168 - return state;
2007 + if (!isComplementaryAreaVisible) {
2008 + registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'isComplementaryAreaVisible', true);
2169 2009 }
2170 2010
2171 -});
2011 + dispatch({
2012 + type: 'ENABLE_COMPLEMENTARY_AREA',
2013 + scope,
2014 + area
2015 + });
2016 +};
2172 2017 /**
2173 - * Reducer returning the user preferences.
2018 + * Disable the complementary area.
2174 2019 *
2175 - * @param {Object} state Current state.
2176 - * @param {Object} action Dispatched action.
2177 - *
2178 - * @return {Object} Updated state.
2020 + * @param {string} scope Complementary area scope.
2179 2021 */
2180 2022
2181 -const preferences = (0,external_wp_data_namespaceObject.combineReducers)({
2182 - features() {
2183 - let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2184 - let action = arguments.length > 1 ? arguments[1] : undefined;
2023 +const disableComplementaryArea = scope => _ref2 => {
2024 + let {
2025 + registry
2026 + } = _ref2;
2027 + const isComplementaryAreaVisible = registry.select(external_wp_preferences_namespaceObject.store).get(scope, 'isComplementaryAreaVisible');
2185 2028
2186 - if (action.type === 'SET_FEATURE_VALUE') {
2187 - const {
2188 - scope,
2189 - featureName,
2190 - value
2191 - } = action;
2192 - return { ...state,
2193 - [scope]: { ...state[scope],
2194 - [featureName]: value
2195 - }
2196 - };
2197 - }
2198 -
2199 - return state;
2029 + if (isComplementaryAreaVisible) {
2030 + registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'isComplementaryAreaVisible', false);
2200 2031 }
2201 -
2202 -});
2203 -const enableItems = (0,external_wp_data_namespaceObject.combineReducers)({
2204 - singleEnableItems,
2205 - multipleEnableItems
2206 -});
2207 -/* harmony default export */ var store_reducer = ((0,external_wp_data_namespaceObject.combineReducers)({
2208 - enableItems,
2209 - preferenceDefaults,
2210 - preferences
2211 -}));
2212 -//# sourceMappingURL=reducer.js.map
2213 -;// CONCATENATED MODULE: ./packages/interface/build-module/store/actions.js
2032 +};
2214 2033 /**
2215 - * Returns an action object used in signalling that an active area should be changed.
2034 + * Pins an item.
2216 2035 *
2217 - * @param {string} itemType Type of item.
2218 - * @param {string} scope Item scope.
2219 - * @param {string} item Item identifier.
2036 + * @param {string} scope Item scope.
2037 + * @param {string} item Item identifier.
2220 2038 *
2221 2039 * @return {Object} Action object.
2222 2040 */
2223 -function setSingleEnableItem(itemType, scope, item) {
2224 - return {
2225 - type: 'SET_SINGLE_ENABLE_ITEM',
2226 - itemType,
2227 - scope,
2228 - item
2229 - };
2230 -}
2231 -/**
2232 - * Returns an action object used in signalling that a complementary item should be enabled.
2233 - *
2234 - * @param {string} scope Complementary area scope.
2235 - * @param {string} area Area identifier.
2236 - *
2237 - * @return {Object} Action object.
2238 - */
2239 2041
2042 +const pinItem = (scope, item) => _ref3 => {
2043 + let {
2044 + registry
2045 + } = _ref3;
2240 2046
2241 -function enableComplementaryArea(scope, area) {
2242 - return setSingleEnableItem('complementaryArea', scope, area);
2243 -}
2244 -/**
2245 - * Returns an action object used in signalling that the complementary area of a given scope should be disabled.
2246 - *
2247 - * @param {string} scope Complementary area scope.
2248 - *
2249 - * @return {Object} Action object.
2250 - */
2047 + // Return early if there's no item.
2048 + if (!item) {
2049 + return;
2050 + }
2251 2051
2252 -function disableComplementaryArea(scope) {
2253 - return setSingleEnableItem('complementaryArea', scope, undefined);
2254 -}
2255 -/**
2256 - * Returns an action object to make an area enabled/disabled.
2257 - *
2258 - * @param {string} itemType Type of item.
2259 - * @param {string} scope Item scope.
2260 - * @param {string} item Item identifier.
2261 - * @param {boolean} isEnable Boolean indicating if an area should be pinned or not.
2262 - *
2263 - * @return {Object} Action object.
2264 - */
2052 + const pinnedItems = registry.select(external_wp_preferences_namespaceObject.store).get(scope, 'pinnedItems'); // The item is already pinned, there's nothing to do.
2265 2053
2266 -function setMultipleEnableItem(itemType, scope, item, isEnable) {
2267 - return {
2268 - type: 'SET_MULTIPLE_ENABLE_ITEM',
2269 - itemType,
2270 - scope,
2271 - item,
2272 - isEnable
2273 - };
2274 -}
2054 + if ((pinnedItems === null || pinnedItems === void 0 ? void 0 : pinnedItems[item]) === true) {
2055 + return;
2056 + }
2057 +
2058 + registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'pinnedItems', { ...pinnedItems,
2059 + [item]: true
2060 + });
2061 +};
2275 2062 /**
2276 - * Returns an action object used in signalling that an item should be pinned.
2063 + * Unpins an item.
2277 2064 *
2278 - * @param {string} scope Item scope.
2279 - * @param {string} itemId Item identifier.
2280 - *
2281 - * @return {Object} Action object.
2065 + * @param {string} scope Item scope.
2066 + * @param {string} item Item identifier.
2282 2067 */
2283 2068
2069 +const unpinItem = (scope, item) => _ref4 => {
2070 + let {
2071 + registry
2072 + } = _ref4;
2284 2073
2285 -function pinItem(scope, itemId) {
2286 - return setMultipleEnableItem('pinnedItems', scope, itemId, true);
2287 -}
2288 -/**
2289 - * Returns an action object used in signalling that an item should be unpinned.
2290 - *
2291 - * @param {string} scope Item scope.
2292 - * @param {string} itemId Item identifier.
2293 - *
2294 - * @return {Object} Action object.
2295 - */
2074 + // Return early if there's no item.
2075 + if (!item) {
2076 + return;
2077 + }
2296 2078
2297 -function unpinItem(scope, itemId) {
2298 - return setMultipleEnableItem('pinnedItems', scope, itemId, false);
2299 -}
2079 + const pinnedItems = registry.select(external_wp_preferences_namespaceObject.store).get(scope, 'pinnedItems');
2080 + registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'pinnedItems', { ...pinnedItems,
2081 + [item]: false
2082 + });
2083 +};
2300 2084 /**
2301 2085 * Returns an action object used in signalling that a feature should be toggled.
2302 2086 *
2303 2087 * @param {string} scope The feature scope (e.g. core/edit-post).
@@ -2304,15 +2088,17 @@
2304 2088 * @param {string} featureName The feature name.
2305 2089 */
2306 2090
2307 2091 function toggleFeature(scope, featureName) {
2308 - return function (_ref) {
2092 + return function (_ref5) {
2309 2093 let {
2310 - select,
2311 - dispatch
2312 - } = _ref;
2313 - const currentValue = select.isFeatureActive(scope, featureName);
2314 - dispatch.setFeatureValue(scope, featureName, !currentValue);
2094 + registry
2095 + } = _ref5;
2096 + external_wp_deprecated_default()(`dispatch( 'core/interface' ).toggleFeature`, {
2097 + since: '6.0',
2098 + alternative: `dispatch( 'core/preferences' ).toggle`
2099 + });
2100 + registry.dispatch(external_wp_preferences_namespaceObject.store).toggle(scope, featureName);
2315 2101 };
2316 2102 }
2317 2103 /**
2318 2104 * Returns an action object used in signalling that a feature should be set to
@@ -2325,13 +2111,17 @@
2325 2111 * @return {Object} Action object.
2326 2112 */
2327 2113
2328 2114 function setFeatureValue(scope, featureName, value) {
2329 - return {
2330 - type: 'SET_FEATURE_VALUE',
2331 - scope,
2332 - featureName,
2333 - value: !!value
2115 + return function (_ref6) {
2116 + let {
2117 + registry
2118 + } = _ref6;
2119 + external_wp_deprecated_default()(`dispatch( 'core/interface' ).setFeatureValue`, {
2120 + since: '6.0',
2121 + alternative: `dispatch( 'core/preferences' ).set`
2122 + });
2123 + registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, featureName, !!value);
2334 2124 };
2335 2125 }
2336 2126 /**
2337 2127 * Returns an action object used in signalling that defaults should be set for features.
@@ -2342,33 +2132,27 @@
2342 2132 * @return {Object} Action object.
2343 2133 */
2344 2134
2345 2135 function setFeatureDefaults(scope, defaults) {
2346 - return {
2347 - type: 'SET_FEATURE_DEFAULTS',
2348 - scope,
2349 - defaults
2136 + return function (_ref7) {
2137 + let {
2138 + registry
2139 + } = _ref7;
2140 + external_wp_deprecated_default()(`dispatch( 'core/interface' ).setFeatureDefaults`, {
2141 + since: '6.0',
2142 + alternative: `dispatch( 'core/preferences' ).setDefaults`
2143 + });
2144 + registry.dispatch(external_wp_preferences_namespaceObject.store).setDefaults(scope, defaults);
2350 2145 };
2351 2146 }
2352 -//# sourceMappingURL=actions.js.map
2147 +
2353 2148 ;// CONCATENATED MODULE: ./packages/interface/build-module/store/selectors.js
2354 2149 /**
2355 - * External dependencies
2150 + * WordPress dependencies
2356 2151 */
2357 2152
2358 -/**
2359 - * Returns the item that is enabled in a given scope.
2360 - *
2361 - * @param {Object} state Global application state.
2362 - * @param {string} itemType Type of item.
2363 - * @param {string} scope Item scope.
2364 - *
2365 - * @return {?string|null} The item that is enabled in the passed scope and type.
2366 - */
2367 2153
2368 -function getSingleEnableItem(state, itemType, scope) {
2369 - return (0,external_lodash_namespaceObject.get)(state.enableItems.singleEnableItems, [itemType, scope]);
2370 -}
2154 +
2371 2155 /**
2372 2156 * Returns the complementary area that is active in a given scope.
2373 2157 *
2374 2158 * @param {Object} state Global application state.
@@ -2373,29 +2157,29 @@
2373 2157 *
2374 2158 * @param {Object} state Global application state.
2375 2159 * @param {string} scope Item scope.
2376 2160 *
2377 - * @return {string} The complementary area that is active in the given scope.
2161 + * @return {string | null | undefined} The complementary area that is active in the given scope.
2378 2162 */
2379 2163
2164 +const getActiveComplementaryArea = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope) => {
2165 + var _state$complementaryA;
2380 2166
2381 -function getActiveComplementaryArea(state, scope) {
2382 - return getSingleEnableItem(state, 'complementaryArea', scope);
2383 -}
2384 -/**
2385 - * Returns a boolean indicating if an item is enabled or not in a given scope.
2386 - *
2387 - * @param {Object} state Global application state.
2388 - * @param {string} itemType Type of item.
2389 - * @param {string} scope Scope.
2390 - * @param {string} item Item to check.
2391 - *
2392 - * @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.
2393 - */
2167 + const isComplementaryAreaVisible = select(external_wp_preferences_namespaceObject.store).get(scope, 'isComplementaryAreaVisible'); // Return `undefined` to indicate that the user has never toggled
2168 + // visibility, this is the vanilla default. Other code relies on this
2169 + // nuance in the return value.
2394 2170
2395 -function isMultipleEnabledItemEnabled(state, itemType, scope, item) {
2396 - return (0,external_lodash_namespaceObject.get)(state.enableItems.multipleEnableItems, [itemType, scope, item]);
2397 -}
2171 + if (isComplementaryAreaVisible === undefined) {
2172 + return undefined;
2173 + } // Return `null` to indicate the user hid the complementary area.
2174 +
2175 +
2176 + if (!isComplementaryAreaVisible) {
2177 + return null;
2178 + }
2179 +
2180 + return state === null || state === void 0 ? void 0 : (_state$complementaryA = state.complementaryAreas) === null || _state$complementaryA === void 0 ? void 0 : _state$complementaryA[scope];
2181 +});
2398 2182 /**
2399 2183 * Returns a boolean indicating if an item is pinned or not.
2400 2184 *
2401 2185 * @param {Object} state Global application state.
@@ -2404,12 +2188,14 @@
2404 2188 *
2405 2189 * @return {boolean} True if the item is pinned and false otherwise.
2406 2190 */
2407 2191
2192 +const isItemPinned = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope, item) => {
2193 + var _pinnedItems$item;
2408 2194
2409 -function isItemPinned(state, scope, item) {
2410 - return isMultipleEnabledItemEnabled(state, 'pinnedItems', scope, item) !== false;
2411 -}
2195 + const pinnedItems = select(external_wp_preferences_namespaceObject.store).get(scope, 'pinnedItems');
2196 + return (_pinnedItems$item = pinnedItems === null || pinnedItems === void 0 ? void 0 : pinnedItems[item]) !== null && _pinnedItems$item !== void 0 ? _pinnedItems$item : true;
2197 +});
2412 2198 /**
2413 2199 * Returns a boolean indicating whether a feature is active for a particular
2414 2200 * scope.
2415 2201 *
@@ -2419,16 +2205,60 @@
2419 2205 *
2420 2206 * @return {boolean} Is the feature enabled?
2421 2207 */
2422 2208
2423 -function isFeatureActive(state, scope, featureName) {
2424 - var _state$preferences$fe, _state$preferenceDefa;
2209 +const isFeatureActive = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope, featureName) => {
2210 + external_wp_deprecated_default()(`select( 'core/interface' ).isFeatureActive( scope, featureName )`, {
2211 + since: '6.0',
2212 + alternative: `select( 'core/preferences' ).get( scope, featureName )`
2213 + });
2214 + return !!select(external_wp_preferences_namespaceObject.store).get(scope, featureName);
2215 +});
2425 2216
2426 - const featureValue = (_state$preferences$fe = state.preferences.features[scope]) === null || _state$preferences$fe === void 0 ? void 0 : _state$preferences$fe[featureName];
2427 - const defaultedFeatureValue = featureValue !== undefined ? featureValue : (_state$preferenceDefa = state.preferenceDefaults.features[scope]) === null || _state$preferenceDefa === void 0 ? void 0 : _state$preferenceDefa[featureName];
2428 - return !!defaultedFeatureValue;
2217 +;// CONCATENATED MODULE: ./packages/interface/build-module/store/reducer.js
2218 +/**
2219 + * WordPress dependencies
2220 + */
2221 +
2222 +function complementaryAreas() {
2223 + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2224 + let action = arguments.length > 1 ? arguments[1] : undefined;
2225 +
2226 + switch (action.type) {
2227 + case 'SET_DEFAULT_COMPLEMENTARY_AREA':
2228 + {
2229 + const {
2230 + scope,
2231 + area
2232 + } = action; // If there's already an area, don't overwrite it.
2233 +
2234 + if (state[scope]) {
2235 + return state;
2236 + }
2237 +
2238 + return { ...state,
2239 + [scope]: area
2240 + };
2241 + }
2242 +
2243 + case 'ENABLE_COMPLEMENTARY_AREA':
2244 + {
2245 + const {
2246 + scope,
2247 + area
2248 + } = action;
2249 + return { ...state,
2250 + [scope]: area
2251 + };
2252 + }
2253 + }
2254 +
2255 + return state;
2429 2256 }
2430 -//# sourceMappingURL=selectors.js.map
2257 +/* harmony default export */ const store_reducer = ((0,external_wp_data_namespaceObject.combineReducers)({
2258 + complementaryAreas
2259 +}));
2260 +
2431 2261 ;// CONCATENATED MODULE: ./packages/interface/build-module/store/constants.js
2432 2262 /**
2433 2263 * The identifier for the data store.
2434 2264 *
@@ -2434,9 +2264,9 @@
2434 2264 *
2435 2265 * @type {string}
2436 2266 */
2437 2267 const constants_STORE_NAME = 'core/interface';
2438 -//# sourceMappingURL=constants.js.map
2268 +
2439 2269 ;// CONCATENATED MODULE: ./packages/interface/build-module/store/index.js
2440 2270 /**
2441 2271 * WordPress dependencies
2442 2272 */
@@ -2459,50 +2289,37 @@
2459 2289
2460 2290 const store_store = (0,external_wp_data_namespaceObject.createReduxStore)(constants_STORE_NAME, {
2461 2291 reducer: store_reducer,
2462 2292 actions: store_actions_namespaceObject,
2463 - selectors: store_selectors_namespaceObject,
2464 - persist: ['enableItems', 'preferences'],
2465 - __experimentalUseThunks: true
2293 + selectors: store_selectors_namespaceObject
2466 2294 }); // Once we build a more generic persistence plugin that works across types of stores
2467 2295 // we'd be able to replace this with a register call.
2468 2296
2469 -(0,external_wp_data_namespaceObject.registerStore)(constants_STORE_NAME, {
2470 - reducer: store_reducer,
2471 - actions: store_actions_namespaceObject,
2472 - selectors: store_selectors_namespaceObject,
2473 - persist: ['enableItems', 'preferences'],
2474 - __experimentalUseThunks: true
2475 -});
2476 -//# sourceMappingURL=index.js.map
2297 +(0,external_wp_data_namespaceObject.register)(store_store);
2298 +
2477 2299 ;// CONCATENATED MODULE: external ["wp","plugins"]
2478 -var external_wp_plugins_namespaceObject = window["wp"]["plugins"];
2300 +const external_wp_plugins_namespaceObject = window["wp"]["plugins"];
2479 2301 ;// CONCATENATED MODULE: ./packages/interface/build-module/components/complementary-area-context/index.js
2480 2302 /**
2481 2303 * WordPress dependencies
2482 2304 */
2483 2305
2484 -/* harmony default export */ var complementary_area_context = ((0,external_wp_plugins_namespaceObject.withPluginContext)((context, ownProps) => {
2306 +/* harmony default export */ const complementary_area_context = ((0,external_wp_plugins_namespaceObject.withPluginContext)((context, ownProps) => {
2485 2307 return {
2486 2308 icon: ownProps.icon || context.icon,
2487 2309 identifier: ownProps.identifier || `${context.name}/${ownProps.name}`
2488 2310 };
2489 2311 }));
2490 -//# sourceMappingURL=index.js.map
2312 +
2491 2313 ;// CONCATENATED MODULE: ./packages/interface/build-module/components/complementary-area-toggle/index.js
2492 2314
2493 2315
2494 2316
2495 2317 /**
2496 - * External dependencies
2497 - */
2498 -
2499 -/**
2500 2318 * WordPress dependencies
2501 2319 */
2502 2320
2503 2321
2504 -
2505 2322 /**
2506 2323 * Internal dependencies
2507 2324 */
2508 2325
@@ -2515,8 +2332,9 @@
2515 2332 scope,
2516 2333 identifier,
2517 2334 icon,
2518 2335 selectedIcon,
2336 + name,
2519 2337 ...props
2520 2338 } = _ref;
2521 2339 const ComponentToUse = as;
2522 2340 const isSelected = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getActiveComplementaryArea(scope) === identifier, [identifier]);
@@ -2532,13 +2350,13 @@
2532 2350 } else {
2533 2351 enableComplementaryArea(scope, identifier);
2534 2352 }
2535 2353 }
2536 - }, (0,external_lodash_namespaceObject.omit)(props, ['name'])));
2354 + }, props));
2537 2355 }
2538 2356
2539 -/* harmony default export */ var complementary_area_toggle = (complementary_area_context(ComplementaryAreaToggle));
2540 -//# sourceMappingURL=index.js.map
2357 +/* harmony default export */ const complementary_area_toggle = (complementary_area_context(ComplementaryAreaToggle));
2358 +
2541 2359 ;// CONCATENATED MODULE: ./packages/interface/build-module/components/complementary-area-header/index.js
2542 2360
2543 2361
2544 2362
@@ -2576,24 +2394,21 @@
2576 2394 tabIndex: -1
2577 2395 }, children, toggleButton));
2578 2396 };
2579 2397
2580 -/* harmony default export */ var complementary_area_header = (ComplementaryAreaHeader);
2581 -//# sourceMappingURL=index.js.map
2398 +/* harmony default export */ const complementary_area_header = (ComplementaryAreaHeader);
2399 +
2582 2400 ;// CONCATENATED MODULE: ./packages/interface/build-module/components/action-item/index.js
2583 2401
2584 2402
2585 2403
2586 2404 /**
2587 - * External dependencies
2588 - */
2589 -
2590 -/**
2591 2405 * WordPress dependencies
2592 2406 */
2593 2407
2594 2408
2595 2409
2410 +const noop = () => {};
2596 2411
2597 2412 function ActionItemSlot(_ref) {
2598 2413 let {
2599 2414 name,
@@ -2606,9 +2421,9 @@
2606 2421 name: name,
2607 2422 bubblesVirtually: bubblesVirtually,
2608 2423 fillProps: fillProps
2609 2424 }, fills => {
2610 - if ((0,external_lodash_namespaceObject.isEmpty)(external_wp_element_namespaceObject.Children.toArray(fills))) {
2425 + if (!external_wp_element_namespaceObject.Children.toArray(fills).length) {
2611 2426 return null;
2612 2427 } // Special handling exists for backward compatibility.
2613 2428 // It ensures that menu items created by plugin authors aren't
2614 2429 // duplicated with automatically injected menu items coming
@@ -2654,10 +2469,10 @@
2654 2469 onClick: fpOnClick
2655 2470 } = _ref4;
2656 2471 return (0,external_wp_element_namespaceObject.createElement)(Component, _extends({
2657 2472 onClick: onClick || fpOnClick ? function () {
2658 - (onClick || external_lodash_namespaceObject.noop)(...arguments);
2659 - (fpOnClick || external_lodash_namespaceObject.noop)(...arguments);
2473 + (onClick || noop)(...arguments);
2474 + (fpOnClick || noop)(...arguments);
2660 2475 } : undefined
2661 2476 }, props));
2662 2477 });
2663 2478 }
@@ -2662,24 +2477,19 @@
2662 2477 });
2663 2478 }
2664 2479
2665 2480 ActionItem.Slot = ActionItemSlot;
2666 -/* harmony default export */ var action_item = (ActionItem);
2667 -//# sourceMappingURL=index.js.map
2481 +/* harmony default export */ const action_item = (ActionItem);
2482 +
2668 2483 ;// CONCATENATED MODULE: ./packages/interface/build-module/components/complementary-area-more-menu-item/index.js
2669 2484
2670 2485
2671 2486
2672 2487 /**
2673 - * External dependencies
2674 - */
2675 -
2676 -/**
2677 2488 * WordPress dependencies
2678 2489 */
2679 2490
2680 2491
2681 -
2682 2492 /**
2683 2493 * Internal dependencies
2684 2494 */
2685 2495
@@ -2685,20 +2495,27 @@
2685 2495
2686 2496
2687 2497
2688 2498
2689 -const PluginsMenuItem = props => // Menu item is marked with unstable prop for backward compatibility.
2690 -// They are removed so they don't leak to DOM elements.
2691 -// @see https://github.com/WordPress/gutenberg/issues/14457
2692 -(0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, (0,external_lodash_namespaceObject.omit)(props, ['__unstableExplicitMenuItem', '__unstableTarget']));
2499 +const PluginsMenuItem = _ref => {
2500 + let {
2501 + // Menu item is marked with unstable prop for backward compatibility.
2502 + // They are removed so they don't leak to DOM elements.
2503 + // @see https://github.com/WordPress/gutenberg/issues/14457
2504 + __unstableExplicitMenuItem,
2505 + __unstableTarget,
2506 + ...restProps
2507 + } = _ref;
2508 + return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, restProps);
2509 +};
2693 2510
2694 -function ComplementaryAreaMoreMenuItem(_ref) {
2511 +function ComplementaryAreaMoreMenuItem(_ref2) {
2695 2512 let {
2696 2513 scope,
2697 2514 target,
2698 2515 __unstableExplicitMenuItem,
2699 2516 ...props
2700 - } = _ref;
2517 + } = _ref2;
2701 2518 return (0,external_wp_element_namespaceObject.createElement)(complementary_area_toggle, _extends({
2702 2519 as: toggleProps => {
2703 2520 return (0,external_wp_element_namespaceObject.createElement)(action_item, _extends({
2704 2521 __unstableExplicitMenuItem: __unstableExplicitMenuItem,
@@ -2712,9 +2529,9 @@
2712 2529 name: target,
2713 2530 scope: scope
2714 2531 }, props));
2715 2532 }
2716 -//# sourceMappingURL=index.js.map
2533 +
2717 2534 ;// CONCATENATED MODULE: ./packages/interface/build-module/components/pinned-items/index.js
2718 2535
2719 2536
2720 2537
@@ -2721,9 +2538,8 @@
2721 2538 /**
2722 2539 * External dependencies
2723 2540 */
2724 2541
2725 -
2726 2542 /**
2727 2543 * WordPress dependencies
2728 2544 */
2729 2545
@@ -2746,16 +2562,16 @@
2746 2562 ...props
2747 2563 } = _ref2;
2748 2564 return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Slot, _extends({
2749 2565 name: `PinnedItems/${scope}`
2750 - }, props), fills => !(0,external_lodash_namespaceObject.isEmpty)(fills) && (0,external_wp_element_namespaceObject.createElement)("div", {
2566 + }, props), fills => (fills === null || fills === void 0 ? void 0 : fills.length) > 0 && (0,external_wp_element_namespaceObject.createElement)("div", {
2751 2567 className: classnames_default()(className, 'interface-pinned-items')
2752 2568 }, fills));
2753 2569 }
2754 2570
2755 2571 PinnedItems.Slot = PinnedItemsSlot;
2756 -/* harmony default export */ var pinned_items = (PinnedItems);
2757 -//# sourceMappingURL=index.js.map
2572 +/* harmony default export */ const pinned_items = (PinnedItems);
2573 +
2758 2574 ;// CONCATENATED MODULE: ./packages/interface/build-module/components/complementary-area/index.js
2759 2575
2760 2576
2761 2577
@@ -2935,10 +2751,10 @@
2935 2751 }
2936 2752
2937 2753 const ComplementaryAreaWrapped = complementary_area_context(ComplementaryArea);
2938 2754 ComplementaryAreaWrapped.Slot = ComplementaryAreaSlot;
2939 -/* harmony default export */ var complementary_area = (ComplementaryAreaWrapped);
2940 -//# sourceMappingURL=index.js.map
2755 +/* harmony default export */ const complementary_area = (ComplementaryAreaWrapped);
2756 +
2941 2757 ;// CONCATENATED MODULE: ./packages/interface/build-module/components/interface-skeleton/index.js
2942 2758
2943 2759
2944 2760
@@ -2949,17 +2765,13 @@
2949 2765 /**
2950 2766 * WordPress dependencies
2951 2767 */
2952 2768
2953 -/**
2954 - * WordPress dependencies
2955 - */
2956 2769
2957 2770
2958 2771
2959 2772
2960 2773
2961 -
2962 2774 function useHTMLClass(className) {
2963 2775 (0,external_wp_element_namespaceObject.useEffect)(() => {
2964 2776 const element = document && document.querySelector(`html:not(.${className})`);
2965 2777
@@ -2975,10 +2787,12 @@
2975 2787 }
2976 2788
2977 2789 function InterfaceSkeleton(_ref, ref) {
2978 2790 let {
2791 + isDistractionFree,
2979 2792 footer,
2980 2793 header,
2794 + editorNotices,
2981 2795 sidebar,
2982 2796 secondarySidebar,
2983 2797 notices,
2984 2798 content,
@@ -3014,8 +2828,23 @@
3014 2828 };
3015 2829 const mergedLabels = { ...defaultLabels,
3016 2830 ...labels
3017 2831 };
2832 + const headerVariants = {
2833 + hidden: isDistractionFree ? {
2834 + opacity: 0
2835 + } : {
2836 + opacity: 1
2837 + },
2838 + hover: {
2839 + opacity: 1,
2840 + transition: {
2841 + type: 'tween',
2842 + delay: 0.2,
2843 + delayChildren: 0.2
2844 + }
2845 + }
2846 + };
3018 2847 return (0,external_wp_element_namespaceObject.createElement)("div", _extends({}, navigateRegionsProps, {
3019 2848 ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, navigateRegionsProps.ref]),
3020 2849 className: classnames_default()(className, 'interface-interface-skeleton', navigateRegionsProps.className, !!footer && 'has-footer')
3021 2850 }), !!drawer && (0,external_wp_element_namespaceObject.createElement)("div", {
@@ -3024,14 +2853,28 @@
3024 2853 "aria-label": mergedLabels.drawer,
3025 2854 tabIndex: "-1"
3026 2855 }, drawer), (0,external_wp_element_namespaceObject.createElement)("div", {
3027 2856 className: "interface-interface-skeleton__editor"
3028 - }, !!header && (0,external_wp_element_namespaceObject.createElement)("div", {
2857 + }, !!header && isDistractionFree && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableMotion.div, {
2858 + initial: isDistractionFree ? 'hidden' : 'hover',
2859 + whileHover: "hover",
2860 + variants: headerVariants,
2861 + transition: {
2862 + type: 'tween',
2863 + delay: 0.8
2864 + },
3029 2865 className: "interface-interface-skeleton__header",
3030 2866 role: "region",
3031 2867 "aria-label": mergedLabels.header,
3032 2868 tabIndex: "-1"
3033 - }, header), (0,external_wp_element_namespaceObject.createElement)("div", {
2869 + }, header), !!header && !isDistractionFree && (0,external_wp_element_namespaceObject.createElement)("div", {
2870 + className: "interface-interface-skeleton__header",
2871 + role: "region",
2872 + "aria-label": mergedLabels.header,
2873 + tabIndex: "-1"
2874 + }, header), isDistractionFree && (0,external_wp_element_namespaceObject.createElement)("div", {
2875 + className: "interface-interface-skeleton__header"
2876 + }, editorNotices), (0,external_wp_element_namespaceObject.createElement)("div", {
3034 2877 className: "interface-interface-skeleton__body"
3035 2878 }, !!secondarySidebar && (0,external_wp_element_namespaceObject.createElement)("div", {
3036 2879 className: "interface-interface-skeleton__secondary-sidebar",
3037 2880 role: "region",
@@ -3061,10 +2904,10 @@
3061 2904 tabIndex: "-1"
3062 2905 }, footer));
3063 2906 }
3064 2907
3065 -/* harmony default export */ var interface_skeleton = ((0,external_wp_element_namespaceObject.forwardRef)(InterfaceSkeleton));
3066 -//# sourceMappingURL=index.js.map
2908 +/* harmony default export */ const interface_skeleton = ((0,external_wp_element_namespaceObject.forwardRef)(InterfaceSkeleton));
2909 +
3067 2910 ;// CONCATENATED MODULE: ./packages/icons/build-module/library/more-vertical.js
3068 2911
3069 2912
3070 2913 /**
@@ -3076,10 +2919,10 @@
3076 2919 viewBox: "0 0 24 24"
3077 2920 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
3078 2921 d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"
3079 2922 }));
3080 -/* harmony default export */ var more_vertical = (moreVertical);
3081 -//# sourceMappingURL=more-vertical.js.map
2923 +/* harmony default export */ const more_vertical = (moreVertical);
2924 +
3082 2925 ;// CONCATENATED MODULE: ./packages/interface/build-module/components/more-menu-dropdown/index.js
3083 2926
3084 2927
3085 2928 /**
@@ -3118,9 +2961,9 @@
3118 2961 ...toggleProps
3119 2962 }
3120 2963 }, onClose => children(onClose));
3121 2964 }
3122 -//# sourceMappingURL=index.js.map
2965 +
3123 2966 ;// CONCATENATED MODULE: ./packages/interface/build-module/components/index.js
3124 2967
3125 2968
3126 2969
@@ -3128,15 +2971,19 @@
3128 2971
3129 2972
3130 2973
3131 2974
3132 -//# sourceMappingURL=index.js.map
2975 +
2976 +
2977 +
2978 +
2979 +
3133 2980 ;// CONCATENATED MODULE: ./packages/interface/build-module/index.js
3134 2981
3135 2982
3136 -//# sourceMappingURL=index.js.map
2983 +
3137 2984 ;// CONCATENATED MODULE: external ["wp","htmlEntities"]
3138 -var external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"];
2985 +const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"];
3139 2986 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/components/name-display/index.js
3140 2987
3141 2988
3142 2989 /**
@@ -3175,9 +3022,9 @@
3175 3022 ellipsizeMode: "tail",
3176 3023 truncate: true
3177 3024 }, menuName))));
3178 3025 }
3179 -//# sourceMappingURL=index.js.map
3026 +
3180 3027 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/filters/add-menu-name-editor.js
3181 3028
3182 3029
3183 3030 /**
@@ -3183,14 +3030,14 @@
3183 3030 /**
3184 3031 * WordPress dependencies
3185 3032 */
3186 3033
3034 +
3187 3035 /**
3188 3036 * Internal dependencies
3189 3037 */
3190 3038
3191 3039
3192 -
3193 3040 const addMenuNameEditor = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockEdit => props => {
3194 3041 if (props.name !== 'core/navigation') {
3195 3042 return (0,external_wp_element_namespaceObject.createElement)(BlockEdit, props);
3196 3043 }
@@ -3196,10 +3043,10 @@
3196 3043 }
3197 3044
3198 3045 return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(NameDisplay, null), (0,external_wp_element_namespaceObject.createElement)(BlockEdit, props));
3199 3046 }, 'withMenuName');
3200 -/* harmony default export */ var add_menu_name_editor = (() => (0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/edit-navigation/with-menu-name', addMenuNameEditor));
3201 -//# sourceMappingURL=add-menu-name-editor.js.map
3047 +/* harmony default export */ const add_menu_name_editor = (() => (0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/edit-navigation/with-menu-name', addMenuNameEditor));
3048 +
3202 3049 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/filters/disable-inserting-non-navigation-blocks.js
3203 3050 /**
3204 3051 * WordPress dependencies
3205 3052 */
@@ -3217,10 +3064,10 @@
3217 3064
3218 3065 return settings;
3219 3066 }
3220 3067
3221 -/* harmony default export */ var disable_inserting_non_navigation_blocks = (() => (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/edit-navigation/disable-inserting-non-navigation-blocks', disableInsertingNonNavigationBlocks));
3222 -//# sourceMappingURL=disable-inserting-non-navigation-blocks.js.map
3068 +/* harmony default export */ const disable_inserting_non_navigation_blocks = (() => (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/edit-navigation/disable-inserting-non-navigation-blocks', disableInsertingNonNavigationBlocks));
3069 +
3223 3070 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/filters/remove-edit-unsupported-features.js
3224 3071
3225 3072
3226 3073
@@ -3239,10 +3086,10 @@
3239 3086 hasItemJustificationControls: false,
3240 3087 hasColorSettings: false
3241 3088 }));
3242 3089 }, 'removeNavigationBlockEditUnsupportedFeatures');
3243 -/* harmony default export */ var remove_edit_unsupported_features = (() => (0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/edit-navigation/remove-navigation-block-edit-unsupported-features', removeNavigationBlockEditUnsupportedFeatures));
3244 -//# sourceMappingURL=remove-edit-unsupported-features.js.map
3090 +/* harmony default export */ const remove_edit_unsupported_features = (() => (0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/edit-navigation/remove-navigation-block-edit-unsupported-features', removeNavigationBlockEditUnsupportedFeatures));
3091 +
3245 3092 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/filters/remove-settings-unsupported-features.js
3246 3093 /**
3247 3094 * WordPress dependencies
3248 3095 */
@@ -3263,10 +3110,10 @@
3263 3110 variations: undefined
3264 3111 };
3265 3112 }
3266 3113
3267 -/* harmony default export */ var remove_settings_unsupported_features = (() => (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/edit-navigation/remove-navigation-block-settings-unsupported-features', removeNavigationBlockSettingsUnsupportedFeatures));
3268 -//# sourceMappingURL=remove-settings-unsupported-features.js.map
3114 +/* harmony default export */ const remove_settings_unsupported_features = (() => (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/edit-navigation/remove-navigation-block-settings-unsupported-features', removeNavigationBlockSettingsUnsupportedFeatures));
3115 +
3269 3116 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/filters/index.js
3270 3117 /**
3271 3118 * Internal dependencies
3272 3119 */
@@ -3287,11 +3134,11 @@
3287 3134
3288 3135 remove_edit_unsupported_features();
3289 3136 remove_settings_unsupported_features();
3290 3137 };
3291 -//# sourceMappingURL=index.js.map
3138 +
3292 3139 ;// CONCATENATED MODULE: external ["wp","keyboardShortcuts"]
3293 -var external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShortcuts"];
3140 +const external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShortcuts"];
3294 3141 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/components/add-menu/index.js
3295 3142
3296 3143
3297 3144 /**
@@ -3391,24 +3238,20 @@
3391 3238 type: "submit",
3392 3239 variant: "primary",
3393 3240 disabled: !menuName.length,
3394 3241 isBusy: isCreatingMenu
3395 - /* Button is disabled but still focusable */
3242 + /* Button is disabled but still focusable. */
3396 3243 ,
3397 3244 "aria-disabled": !menuName.length || isCreatingMenu
3398 3245 }, (0,external_wp_i18n_namespaceObject.__)('Create menu')));
3399 3246 }
3400 3247
3401 -/* harmony default export */ var add_menu = ((0,external_wp_components_namespaceObject.withNotices)(AddMenu));
3402 -//# sourceMappingURL=index.js.map
3248 +/* harmony default export */ const add_menu = ((0,external_wp_components_namespaceObject.withNotices)(AddMenu));
3249 +
3403 3250 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/components/menu-switcher/index.js
3404 3251
3405 3252
3406 3253 /**
3407 - * External dependencies
3408 - */
3409 -
3410 -/**
3411 3254 * WordPress dependencies
3412 3255 */
3413 3256
3414 3257
@@ -3413,19 +3256,21 @@
3413 3256
3414 3257
3415 3258
3416 3259
3417 -
3418 3260 /**
3419 3261 * Internal dependencies
3420 3262 */
3421 3263
3422 3264
3265 +
3266 +const menu_switcher_noop = () => {};
3267 +
3423 3268 function MenuSwitcher(_ref) {
3424 3269 let {
3425 3270 menus,
3426 3271 selectedMenuId,
3427 - onSelectMenu = external_lodash_namespaceObject.noop
3272 + onSelectMenu = menu_switcher_noop
3428 3273 } = _ref;
3429 3274 const [isModalVisible, setIsModalVisible] = (0,external_wp_element_namespaceObject.useState)(false);
3430 3275
3431 3276 const openModal = () => setIsModalVisible(true);
@@ -3464,9 +3309,9 @@
3464 3309 },
3465 3310 helpText: (0,external_wp_i18n_namespaceObject.__)('A short descriptive name for your menu.')
3466 3311 }))));
3467 3312 }
3468 -//# sourceMappingURL=index.js.map
3313 +
3469 3314 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/components/layout/unselected-menu-state.js
3470 3315
3471 3316
3472 3317 /**
@@ -3498,9 +3343,9 @@
3498 3343 helpText: (0,external_wp_i18n_namespaceObject.__)('A short descriptive name for your menu.'),
3499 3344 focusInputOnMount: true
3500 3345 }))));
3501 3346 }
3502 -//# sourceMappingURL=unselected-menu-state.js.map
3347 +
3503 3348 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/components/error-boundary/index.js
3504 3349
3505 3350
3506 3351 /**
@@ -3552,10 +3397,10 @@
3552 3397 }
3553 3398
3554 3399 }
3555 3400
3556 -/* harmony default export */ var error_boundary = (ErrorBoundary);
3557 -//# sourceMappingURL=index.js.map
3401 +/* harmony default export */ const error_boundary = (ErrorBoundary);
3402 +
3558 3403 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/components/layout/shortcuts.js
3559 3404 /**
3560 3405 * WordPress dependencies
3561 3406 */
@@ -3624,10 +3469,10 @@
3624 3469 return null;
3625 3470 }
3626 3471
3627 3472 NavigationEditorShortcuts.Register = RegisterNavigationEditorShortcuts;
3628 -/* harmony default export */ var shortcuts = (NavigationEditorShortcuts);
3629 -//# sourceMappingURL=shortcuts.js.map
3473 +/* harmony default export */ const shortcuts = (NavigationEditorShortcuts);
3474 +
3630 3475 ;// CONCATENATED MODULE: ./packages/icons/build-module/library/cog.js
3631 3476
3632 3477
3633 3478 /**
@@ -3641,10 +3486,10 @@
3641 3486 fillRule: "evenodd",
3642 3487 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",
3643 3488 clipRule: "evenodd"
3644 3489 }));
3645 -/* harmony default export */ var library_cog = (cog);
3646 -//# sourceMappingURL=cog.js.map
3490 +/* harmony default export */ const library_cog = (cog);
3491 +
3647 3492 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/components/sidebar/sidebar-header.js
3648 3493
3649 3494
3650 3495 /**
@@ -3694,9 +3539,9 @@
3694 3539 "data-label": (0,external_wp_i18n_namespaceObject.__)('Block')
3695 3540 }, // translators: Text label for the Block Settings Sidebar tab.
3696 3541 (0,external_wp_i18n_namespaceObject.__)('Block'))));
3697 3542 }
3698 -//# sourceMappingURL=sidebar-header.js.map
3543 +
3699 3544 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/components/name-editor/index.js
3700 3545
3701 3546
3702 3547 /**
@@ -3728,9 +3573,9 @@
3728 3573 value: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(name || ''),
3729 3574 onChange: setName
3730 3575 });
3731 3576 }
3732 -//# sourceMappingURL=index.js.map
3577 +
3733 3578 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/components/sidebar/auto-add-pages.js
3734 3579
3735 3580
3736 3581 /**
@@ -3754,9 +3599,9 @@
3754 3599 checked: autoAddPages !== null && autoAddPages !== void 0 ? autoAddPages : false,
3755 3600 onChange: setAutoAddPages
3756 3601 });
3757 3602 }
3758 -//# sourceMappingURL=auto-add-pages.js.map
3603 +
3759 3604 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/components/sidebar/menu-settings.js
3760 3605
3761 3606
3762 3607 /**
@@ -3779,9 +3624,9 @@
3779 3624 }, (0,external_wp_element_namespaceObject.createElement)(NameEditor, null), (0,external_wp_element_namespaceObject.createElement)(AutoAddPages, {
3780 3625 menuId: menuId
3781 3626 }));
3782 3627 }
3783 -//# sourceMappingURL=menu-settings.js.map
3628 +
3784 3629 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/components/sidebar/manage-locations.js
3785 3630
3786 3631
3787 3632 /**
@@ -3970,9 +3815,9 @@
3970 3815 variant: "primary",
3971 3816 onClick: handleUpdateMenuLocations
3972 3817 }, (0,external_wp_i18n_namespaceObject.__)('Update'))));
3973 3818 }
3974 -//# sourceMappingURL=manage-locations.js.map
3819 +
3975 3820 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/components/sidebar/delete-menu.js
3976 3821
3977 3822
3978 3823 /**
@@ -4006,9 +3851,9 @@
4006 3851 onConfirm: handleConfirm,
4007 3852 onCancel: () => setShowConfirmDialog(false)
4008 3853 }, (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to delete this navigation? This action cannot be undone.'))));
4009 3854 }
4010 -//# sourceMappingURL=delete-menu.js.map
3855 +
4011 3856 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/components/sidebar/index.js
4012 3857
4013 3858
4014 3859 /**
@@ -4099,9 +3944,9 @@
4099 3944 onDeleteMenu: onDeleteMenu,
4100 3945 isMenuBeingDeleted: isMenuBeingDeleted
4101 3946 })), sidebarName === SIDEBAR_BLOCK && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockInspector, null));
4102 3947 }
4103 -//# sourceMappingURL=index.js.map
3948 +
4104 3949 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/components/header/menu-actions.js
4105 3950
4106 3951
4107 3952 /**
@@ -4123,14 +3968,21 @@
4123 3968 menus,
4124 3969 isLoading
4125 3970 } = _ref;
4126 3971 const [selectedMenuId, setSelectedMenuId] = useSelectedMenuId();
4127 - const [menuName] = useMenuEntityProp('name', selectedMenuId); // The title ref is passed to the popover as the anchorRef so that the
4128 - // dropdown is centered over the whole title area rather than just one
4129 - // part of it.
3972 + const [menuName] = useMenuEntityProp('name', selectedMenuId); // Use internal state instead of a ref to make sure that the component
3973 + // re-renders when the popover's anchor updates.
4130 3974
4131 - const titleRef = (0,external_wp_element_namespaceObject.useRef)();
3975 + const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null); // Memoize popoverProps to avoid returning a new object every time.
4132 3976
3977 + const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({
3978 + className: 'edit-navigation-menu-actions__switcher-dropdown',
3979 + position: 'bottom center',
3980 + // Use the title ref as the popover's anchor so that the dropdown is
3981 + // centered over the whole title area rather than just on part of it.
3982 + anchor: popoverAnchor
3983 + }), [popoverAnchor]);
3984 +
4133 3985 if (isLoading) {
4134 3986 return (0,external_wp_element_namespaceObject.createElement)("div", {
4135 3987 className: "edit-navigation-menu-actions"
4136 3988 }, (0,external_wp_i18n_namespaceObject.__)('Loading…'));
@@ -4138,9 +3990,9 @@
4138 3990
4139 3991 return (0,external_wp_element_namespaceObject.createElement)("div", {
4140 3992 className: "edit-navigation-menu-actions"
4141 3993 }, (0,external_wp_element_namespaceObject.createElement)("div", {
4142 - ref: titleRef,
3994 + ref: setPopoverAnchor,
4143 3995 className: "edit-navigation-menu-actions__subtitle-wrapper"
4144 3996 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalText, {
4145 3997 size: "body",
4146 3998 className: "edit-navigation-menu-actions__subtitle",
@@ -4155,13 +4007,9 @@
4155 4007 className: 'edit-navigation-menu-actions__switcher-toggle',
4156 4008 showTooltip: false,
4157 4009 __experimentalIsFocusable: true
4158 4010 },
4159 - popoverProps: {
4160 - className: 'edit-navigation-menu-actions__switcher-dropdown',
4161 - position: 'bottom center',
4162 - anchorRef: titleRef.current
4163 - }
4011 + popoverProps: popoverProps
4164 4012 }, _ref2 => {
4165 4013 let {
4166 4014 onClose
4167 4015 } = _ref2;
@@ -4174,9 +4022,9 @@
4174 4022 }
4175 4023 });
4176 4024 })));
4177 4025 }
4178 -//# sourceMappingURL=menu-actions.js.map
4026 +
4179 4027 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/components/header/new-button.js
4180 4028
4181 4029
4182 4030 /**
@@ -4208,9 +4056,9 @@
4208 4056 setSelectedMenuId(menuId);
4209 4057 }
4210 4058 })));
4211 4059 }
4212 -//# sourceMappingURL=new-button.js.map
4060 +
4213 4061 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/components/header/save-button.js
4214 4062
4215 4063
4216 4064 /**
@@ -4254,9 +4102,9 @@
4254 4102 },
4255 4103 disabled: disabled
4256 4104 }, (0,external_wp_i18n_namespaceObject.__)('Save'));
4257 4105 }
4258 -//# sourceMappingURL=save-button.js.map
4106 +
4259 4107 ;// CONCATENATED MODULE: ./packages/icons/build-module/library/undo.js
4260 4108
4261 4109
4262 4110 /**
@@ -4268,10 +4116,10 @@
4268 4116 viewBox: "0 0 24 24"
4269 4117 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
4270 4118 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"
4271 4119 }));
4272 -/* harmony default export */ var library_undo = (undo);
4273 -//# sourceMappingURL=undo.js.map
4120 +/* harmony default export */ const library_undo = (undo);
4121 +
4274 4122 ;// CONCATENATED MODULE: ./packages/icons/build-module/library/redo.js
4275 4123
4276 4124
4277 4125 /**
@@ -4283,12 +4131,12 @@
4283 4131 viewBox: "0 0 24 24"
4284 4132 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
4285 4133 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"
4286 4134 }));
4287 -/* harmony default export */ var library_redo = (redo);
4288 -//# sourceMappingURL=redo.js.map
4135 +/* harmony default export */ const library_redo = (redo);
4136 +
4289 4137 ;// CONCATENATED MODULE: external ["wp","keycodes"]
4290 -var external_wp_keycodes_namespaceObject = window["wp"]["keycodes"];
4138 +const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"];
4291 4139 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/components/header/undo-button.js
4292 4140
4293 4141
4294 4142 /**
@@ -4315,9 +4163,9 @@
4315 4163 "aria-disabled": !hasUndo,
4316 4164 onClick: hasUndo ? undo : undefined
4317 4165 });
4318 4166 }
4319 -//# sourceMappingURL=undo-button.js.map
4167 +
4320 4168 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/components/header/redo-button.js
4321 4169
4322 4170
4323 4171 /**
@@ -4329,8 +4177,9 @@
4329 4177
4330 4178
4331 4179
4332 4180 function RedoButton() {
4181 + const shortcut = (0,external_wp_keycodes_namespaceObject.isAppleOS)() ? external_wp_keycodes_namespaceObject.displayShortcut.primaryShift('z') : external_wp_keycodes_namespaceObject.displayShortcut.primary('y');
4333 4182 const hasRedo = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).hasRedo(), []);
4334 4183 const {
4335 4184 redo
4336 4185 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
@@ -4336,9 +4185,9 @@
4336 4185 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
4337 4186 return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
4338 4187 icon: !(0,external_wp_i18n_namespaceObject.isRTL)() ? library_redo : library_undo,
4339 4188 label: (0,external_wp_i18n_namespaceObject.__)('Redo'),
4340 - shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primaryShift('z') // If there are no undo levels we don't want to actually disable this
4189 + shortcut: shortcut // If there are no undo levels we don't want to actually disable this
4341 4190 // button, because it will remove focus for keyboard users.
4342 4191 // See: https://github.com/WordPress/gutenberg/issues/3486
4343 4192 ,
4344 4193 "aria-disabled": !hasRedo,
@@ -4344,9 +4193,9 @@
4344 4193 "aria-disabled": !hasRedo,
4345 4194 onClick: hasRedo ? redo : undefined
4346 4195 });
4347 4196 }
4348 -//# sourceMappingURL=redo-button.js.map
4197 +
4349 4198 ;// CONCATENATED MODULE: ./packages/icons/build-module/library/plus.js
4350 4199
4351 4200
4352 4201 /**
@@ -4358,10 +4207,10 @@
4358 4207 viewBox: "0 0 24 24"
4359 4208 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
4360 4209 d: "M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"
4361 4210 }));
4362 -/* harmony default export */ var library_plus = (plus);
4363 -//# sourceMappingURL=plus.js.map
4211 +/* harmony default export */ const library_plus = (plus);
4212 +
4364 4213 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/components/header/inserter-toggle.js
4365 4214
4366 4215
4367 4216 /**
@@ -4412,10 +4261,10 @@
4412 4261 disabled: !hasInserterItems
4413 4262 });
4414 4263 }
4415 4264
4416 -/* harmony default export */ var inserter_toggle = (InserterToggle);
4417 -//# sourceMappingURL=inserter-toggle.js.map
4265 +/* harmony default export */ const inserter_toggle = (InserterToggle);
4266 +
4418 4267 ;// CONCATENATED MODULE: ./packages/icons/build-module/library/external.js
4419 4268
4420 4269
4421 4270 /**
@@ -4427,10 +4276,10 @@
4427 4276 viewBox: "0 0 24 24"
4428 4277 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
4429 4278 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"
4430 4279 }));
4431 -/* harmony default export */ var library_external = (external);
4432 -//# sourceMappingURL=external.js.map
4280 +/* harmony default export */ const library_external = (external);
4281 +
4433 4282 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/components/header/tools-more-menu-group.js
4434 4283
4435 4284
4436 4285 /**
@@ -4450,10 +4299,10 @@
4450 4299 fillProps: fillProps
4451 4300 }, fills => fills);
4452 4301 };
4453 4302
4454 -/* harmony default export */ var tools_more_menu_group = (ToolsMoreMenuGroup);
4455 -//# sourceMappingURL=tools-more-menu-group.js.map
4303 +/* harmony default export */ const tools_more_menu_group = (ToolsMoreMenuGroup);
4304 +
4456 4305 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/components/header/more-menu.js
4457 4306
4458 4307
4459 4308 /**
@@ -4486,9 +4335,9 @@
4486 4335 onClose
4487 4336 }
4488 4337 })));
4489 4338 }
4490 -//# sourceMappingURL=more-menu.js.map
4339 +
4491 4340 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/components/header/index.js
4492 4341
4493 4342
4494 4343 /**
@@ -4547,9 +4396,9 @@
4547 4396 }), (0,external_wp_element_namespaceObject.createElement)(pinned_items.Slot, {
4548 4397 scope: "core/edit-navigation"
4549 4398 }), (0,external_wp_element_namespaceObject.createElement)(MoreMenu, null)));
4550 4399 }
4551 -//# sourceMappingURL=index.js.map
4400 +
4552 4401 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/components/notices/index.js
4553 4402
4554 4403
4555 4404 /**
@@ -4591,9 +4440,9 @@
4591 4440 className: "edit-navigation-notices__snackbar-list",
4592 4441 onRemove: removeNotice
4593 4442 }));
4594 4443 }
4595 -//# sourceMappingURL=index.js.map
4444 +
4596 4445 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/components/editor/index.js
4597 4446
4598 4447
4599 4448 /**
@@ -4610,9 +4459,9 @@
4610 4459 }, isPending ? (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null) : (0,external_wp_element_namespaceObject.createElement)("div", {
4611 4460 className: "editor-styles-wrapper"
4612 4461 }, (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, null)))));
4613 4462 }
4614 -//# sourceMappingURL=index.js.map
4463 +
4615 4464 ;// CONCATENATED MODULE: ./packages/icons/build-module/library/close.js
4616 4465
4617 4466
4618 4467 /**
@@ -4624,10 +4473,10 @@
4624 4473 viewBox: "0 0 24 24"
4625 4474 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
4626 4475 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"
4627 4476 }));
4628 -/* harmony default export */ var library_close = (close_close);
4629 -//# sourceMappingURL=close.js.map
4477 +/* harmony default export */ const library_close = (close_close);
4478 +
4630 4479 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/components/inserter-sidebar/index.js
4631 4480
4632 4481
4633 4482
@@ -4700,10 +4549,10 @@
4700 4549 showInserterHelpPanel: SHOW_PREVIEWS
4701 4550 })));
4702 4551 }
4703 4552
4704 -/* harmony default export */ var inserter_sidebar = (InserterSidebar);
4705 -//# sourceMappingURL=index.js.map
4553 +/* harmony default export */ const inserter_sidebar = (InserterSidebar);
4554 +
4706 4555 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/components/layout/unsaved-changes-warning.js
4707 4556 /**
4708 4557 * WordPress dependencies
4709 4558 */
@@ -4751,9 +4600,9 @@
4751 4600 };
4752 4601 }, [isDirty]);
4753 4602 return null;
4754 4603 }
4755 -//# sourceMappingURL=unsaved-changes-warning.js.map
4604 +
4756 4605 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/components/layout/index.js
4757 4606
4758 4607
4759 4608 /**
@@ -4881,11 +4730,11 @@
4881 4730 onDeleteMenu: deleteMenu,
4882 4731 isMenuBeingDeleted: isMenuBeingDeleted
4883 4732 })), (0,external_wp_element_namespaceObject.createElement)(UnsavedChangesWarning, null)), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover.Slot, null), (0,external_wp_element_namespaceObject.createElement)(external_wp_plugins_namespaceObject.PluginArea, null))));
4884 4733 }
4885 -//# sourceMappingURL=index.js.map
4734 +
4886 4735 ;// CONCATENATED MODULE: external ["wp","url"]
4887 -var external_wp_url_namespaceObject = window["wp"]["url"];
4736 +const external_wp_url_namespaceObject = window["wp"]["url"];
4888 4737 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/utils/index.js
4889 4738 /**
4890 4739 * WordPress dependencies
4891 4740 */
@@ -4959,9 +4808,9 @@
4959 4808 return id === menuId;
4960 4809 });
4961 4810
4962 4811 if (menu.length > 0) {
4963 - menuDataLoaded = true; // We don't have headers because we "emulate" this request
4812 + menuDataLoaded = true; // We don't have headers because we "emulate" this request.
4964 4813
4965 4814 return sendSuccessResponse({
4966 4815 body: menu[0],
4967 4816 headers: {}
@@ -4985,9 +4834,9 @@
4985 4834 statusText: 'OK',
4986 4835 headers: responseData.headers
4987 4836 }));
4988 4837 }
4989 -//# sourceMappingURL=index.js.map
4838 +
4990 4839 ;// CONCATENATED MODULE: ./packages/edit-navigation/build-module/index.js
4991 4840
4992 4841
4993 4842 /**
@@ -5080,9 +4929,10 @@
5080 4929 settings: settings
5081 4930 }), document.getElementById(id));
5082 4931 }
5083 4932
5084 -//# sourceMappingURL=index.js.map
5085 -}();
4933 +
4934 +})();
4935 +
5086 4936 (window.wp = window.wp || {}).editNavigation = __webpack_exports__;
5087 4937 /******/ })()
5088 4938 ;