1 /******/ (function() { // webpackBootstrap |
1 /******/ (() => { // webpackBootstrap |
2 /******/ var __webpack_modules__ = ({ |
2 /******/ "use strict"; |
3 |
3 /******/ // The require scope |
4 /***/ 4403: |
4 /******/ var __webpack_require__ = {}; |
5 /***/ (function(module, exports) { |
|
6 |
|
7 var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! |
|
8 Copyright (c) 2018 Jed Watson. |
|
9 Licensed under the MIT License (MIT), see |
|
10 http://jedwatson.github.io/classnames |
|
11 */ |
|
12 /* global define */ |
|
13 |
|
14 (function () { |
|
15 'use strict'; |
|
16 |
|
17 var hasOwn = {}.hasOwnProperty; |
|
18 |
|
19 function classNames() { |
|
20 var classes = []; |
|
21 |
|
22 for (var i = 0; i < arguments.length; i++) { |
|
23 var arg = arguments[i]; |
|
24 if (!arg) continue; |
|
25 |
|
26 var argType = typeof arg; |
|
27 |
|
28 if (argType === 'string' || argType === 'number') { |
|
29 classes.push(arg); |
|
30 } else if (Array.isArray(arg)) { |
|
31 if (arg.length) { |
|
32 var inner = classNames.apply(null, arg); |
|
33 if (inner) { |
|
34 classes.push(inner); |
|
35 } |
|
36 } |
|
37 } else if (argType === 'object') { |
|
38 if (arg.toString === Object.prototype.toString) { |
|
39 for (var key in arg) { |
|
40 if (hasOwn.call(arg, key) && arg[key]) { |
|
41 classes.push(key); |
|
42 } |
|
43 } |
|
44 } else { |
|
45 classes.push(arg.toString()); |
|
46 } |
|
47 } |
|
48 } |
|
49 |
|
50 return classes.join(' '); |
|
51 } |
|
52 |
|
53 if ( true && module.exports) { |
|
54 classNames.default = classNames; |
|
55 module.exports = classNames; |
|
56 } else if (true) { |
|
57 // register as 'classnames', consistent with npm package name |
|
58 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { |
|
59 return classNames; |
|
60 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), |
|
61 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); |
|
62 } else {} |
|
63 }()); |
|
64 |
|
65 |
|
66 /***/ }) |
|
67 |
|
68 /******/ }); |
|
69 /************************************************************************/ |
|
70 /******/ // The module cache |
|
71 /******/ var __webpack_module_cache__ = {}; |
|
72 /******/ |
|
73 /******/ // The require function |
|
74 /******/ function __webpack_require__(moduleId) { |
|
75 /******/ // Check if module is in cache |
|
76 /******/ var cachedModule = __webpack_module_cache__[moduleId]; |
|
77 /******/ if (cachedModule !== undefined) { |
|
78 /******/ return cachedModule.exports; |
|
79 /******/ } |
|
80 /******/ // Create a new module (and put it into the cache) |
|
81 /******/ var module = __webpack_module_cache__[moduleId] = { |
|
82 /******/ // no module.id needed |
|
83 /******/ // no module.loaded needed |
|
84 /******/ exports: {} |
|
85 /******/ }; |
|
86 /******/ |
|
87 /******/ // Execute the module function |
|
88 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); |
|
89 /******/ |
|
90 /******/ // Return the exports of the module |
|
91 /******/ return module.exports; |
|
92 /******/ } |
|
93 /******/ |
5 /******/ |
94 /************************************************************************/ |
6 /************************************************************************/ |
95 /******/ /* webpack/runtime/compat get default export */ |
7 /******/ /* webpack/runtime/compat get default export */ |
96 /******/ !function() { |
8 /******/ (() => { |
97 /******/ // getDefaultExport function for compatibility with non-harmony modules |
9 /******/ // getDefaultExport function for compatibility with non-harmony modules |
98 /******/ __webpack_require__.n = function(module) { |
10 /******/ __webpack_require__.n = (module) => { |
99 /******/ var getter = module && module.__esModule ? |
11 /******/ var getter = module && module.__esModule ? |
100 /******/ function() { return module['default']; } : |
12 /******/ () => (module['default']) : |
101 /******/ function() { return module; }; |
13 /******/ () => (module); |
102 /******/ __webpack_require__.d(getter, { a: getter }); |
14 /******/ __webpack_require__.d(getter, { a: getter }); |
103 /******/ return getter; |
15 /******/ return getter; |
104 /******/ }; |
16 /******/ }; |
105 /******/ }(); |
17 /******/ })(); |
106 /******/ |
18 /******/ |
107 /******/ /* webpack/runtime/define property getters */ |
19 /******/ /* webpack/runtime/define property getters */ |
108 /******/ !function() { |
20 /******/ (() => { |
109 /******/ // define getter functions for harmony exports |
21 /******/ // define getter functions for harmony exports |
110 /******/ __webpack_require__.d = function(exports, definition) { |
22 /******/ __webpack_require__.d = (exports, definition) => { |
111 /******/ for(var key in definition) { |
23 /******/ for(var key in definition) { |
112 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { |
24 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { |
113 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); |
25 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); |
114 /******/ } |
26 /******/ } |
115 /******/ } |
27 /******/ } |
116 /******/ }; |
28 /******/ }; |
117 /******/ }(); |
29 /******/ })(); |
118 /******/ |
30 /******/ |
119 /******/ /* webpack/runtime/hasOwnProperty shorthand */ |
31 /******/ /* webpack/runtime/hasOwnProperty shorthand */ |
120 /******/ !function() { |
32 /******/ (() => { |
121 /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } |
33 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) |
122 /******/ }(); |
34 /******/ })(); |
123 /******/ |
35 /******/ |
124 /******/ /* webpack/runtime/make namespace object */ |
36 /******/ /* webpack/runtime/make namespace object */ |
125 /******/ !function() { |
37 /******/ (() => { |
126 /******/ // define __esModule on exports |
38 /******/ // define __esModule on exports |
127 /******/ __webpack_require__.r = function(exports) { |
39 /******/ __webpack_require__.r = (exports) => { |
128 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
40 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
129 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
41 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
130 /******/ } |
42 /******/ } |
131 /******/ Object.defineProperty(exports, '__esModule', { value: true }); |
43 /******/ Object.defineProperty(exports, '__esModule', { value: true }); |
132 /******/ }; |
44 /******/ }; |
133 /******/ }(); |
45 /******/ })(); |
134 /******/ |
46 /******/ |
135 /************************************************************************/ |
47 /************************************************************************/ |
136 var __webpack_exports__ = {}; |
48 var __webpack_exports__ = {}; |
137 // This entry need to be wrapped in an IIFE because it need to be in strict mode. |
|
138 !function() { |
|
139 "use strict"; |
|
140 // ESM COMPAT FLAG |
49 // ESM COMPAT FLAG |
141 __webpack_require__.r(__webpack_exports__); |
50 __webpack_require__.r(__webpack_exports__); |
142 |
51 |
143 // EXPORTS |
52 // EXPORTS |
144 __webpack_require__.d(__webpack_exports__, { |
53 __webpack_require__.d(__webpack_exports__, { |
145 "initialize": function() { return /* binding */ initialize; }, |
54 initialize: () => (/* binding */ initialize), |
146 "reinitializeEditor": function() { return /* binding */ reinitializeEditor; } |
55 initializeEditor: () => (/* binding */ initializeEditor), |
|
56 reinitializeEditor: () => (/* binding */ reinitializeEditor), |
|
57 store: () => (/* reexport */ store_store) |
147 }); |
58 }); |
148 |
59 |
149 // NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/store/actions.js |
60 // NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/store/actions.js |
150 var actions_namespaceObject = {}; |
61 var actions_namespaceObject = {}; |
151 __webpack_require__.r(actions_namespaceObject); |
62 __webpack_require__.r(actions_namespaceObject); |
152 __webpack_require__.d(actions_namespaceObject, { |
63 __webpack_require__.d(actions_namespaceObject, { |
153 "disableComplementaryArea": function() { return disableComplementaryArea; }, |
64 closeModal: () => (closeModal), |
154 "enableComplementaryArea": function() { return enableComplementaryArea; }, |
65 disableComplementaryArea: () => (disableComplementaryArea), |
155 "pinItem": function() { return pinItem; }, |
66 enableComplementaryArea: () => (enableComplementaryArea), |
156 "setFeatureDefaults": function() { return setFeatureDefaults; }, |
67 openModal: () => (openModal), |
157 "setFeatureValue": function() { return setFeatureValue; }, |
68 pinItem: () => (pinItem), |
158 "toggleFeature": function() { return toggleFeature; }, |
69 setDefaultComplementaryArea: () => (setDefaultComplementaryArea), |
159 "unpinItem": function() { return unpinItem; } |
70 setFeatureDefaults: () => (setFeatureDefaults), |
|
71 setFeatureValue: () => (setFeatureValue), |
|
72 toggleFeature: () => (toggleFeature), |
|
73 unpinItem: () => (unpinItem) |
160 }); |
74 }); |
161 |
75 |
162 // NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/store/selectors.js |
76 // NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/store/selectors.js |
163 var selectors_namespaceObject = {}; |
77 var selectors_namespaceObject = {}; |
164 __webpack_require__.r(selectors_namespaceObject); |
78 __webpack_require__.r(selectors_namespaceObject); |
165 __webpack_require__.d(selectors_namespaceObject, { |
79 __webpack_require__.d(selectors_namespaceObject, { |
166 "getActiveComplementaryArea": function() { return getActiveComplementaryArea; }, |
80 getActiveComplementaryArea: () => (getActiveComplementaryArea), |
167 "isFeatureActive": function() { return isFeatureActive; }, |
81 isComplementaryAreaLoading: () => (isComplementaryAreaLoading), |
168 "isItemPinned": function() { return isItemPinned; } |
82 isFeatureActive: () => (isFeatureActive), |
|
83 isItemPinned: () => (isItemPinned), |
|
84 isModalActive: () => (isModalActive) |
169 }); |
85 }); |
170 |
86 |
171 // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/store/actions.js |
87 // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/store/actions.js |
172 var store_actions_namespaceObject = {}; |
88 var store_actions_namespaceObject = {}; |
173 __webpack_require__.r(store_actions_namespaceObject); |
89 __webpack_require__.r(store_actions_namespaceObject); |
174 __webpack_require__.d(store_actions_namespaceObject, { |
90 __webpack_require__.d(store_actions_namespaceObject, { |
175 "closeGeneralSidebar": function() { return closeGeneralSidebar; }, |
91 closeGeneralSidebar: () => (closeGeneralSidebar), |
176 "moveBlockToWidgetArea": function() { return moveBlockToWidgetArea; }, |
92 moveBlockToWidgetArea: () => (moveBlockToWidgetArea), |
177 "persistStubPost": function() { return persistStubPost; }, |
93 persistStubPost: () => (persistStubPost), |
178 "saveEditedWidgetAreas": function() { return saveEditedWidgetAreas; }, |
94 saveEditedWidgetAreas: () => (saveEditedWidgetAreas), |
179 "saveWidgetArea": function() { return saveWidgetArea; }, |
95 saveWidgetArea: () => (saveWidgetArea), |
180 "saveWidgetAreas": function() { return saveWidgetAreas; }, |
96 saveWidgetAreas: () => (saveWidgetAreas), |
181 "setIsInserterOpened": function() { return setIsInserterOpened; }, |
97 setIsInserterOpened: () => (setIsInserterOpened), |
182 "setIsListViewOpened": function() { return setIsListViewOpened; }, |
98 setIsListViewOpened: () => (setIsListViewOpened), |
183 "setIsWidgetAreaOpen": function() { return setIsWidgetAreaOpen; }, |
99 setIsWidgetAreaOpen: () => (setIsWidgetAreaOpen), |
184 "setWidgetAreasOpenState": function() { return setWidgetAreasOpenState; }, |
100 setWidgetAreasOpenState: () => (setWidgetAreasOpenState), |
185 "setWidgetIdForClientId": function() { return setWidgetIdForClientId; } |
101 setWidgetIdForClientId: () => (setWidgetIdForClientId) |
186 }); |
102 }); |
187 |
103 |
188 // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/store/resolvers.js |
104 // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/store/resolvers.js |
189 var resolvers_namespaceObject = {}; |
105 var resolvers_namespaceObject = {}; |
190 __webpack_require__.r(resolvers_namespaceObject); |
106 __webpack_require__.r(resolvers_namespaceObject); |
191 __webpack_require__.d(resolvers_namespaceObject, { |
107 __webpack_require__.d(resolvers_namespaceObject, { |
192 "getWidgetAreas": function() { return getWidgetAreas; }, |
108 getWidgetAreas: () => (getWidgetAreas), |
193 "getWidgets": function() { return getWidgets; } |
109 getWidgets: () => (getWidgets) |
194 }); |
110 }); |
195 |
111 |
196 // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/store/selectors.js |
112 // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/store/selectors.js |
197 var store_selectors_namespaceObject = {}; |
113 var store_selectors_namespaceObject = {}; |
198 __webpack_require__.r(store_selectors_namespaceObject); |
114 __webpack_require__.r(store_selectors_namespaceObject); |
199 __webpack_require__.d(store_selectors_namespaceObject, { |
115 __webpack_require__.d(store_selectors_namespaceObject, { |
200 "__experimentalGetInsertionPoint": function() { return __experimentalGetInsertionPoint; }, |
116 __experimentalGetInsertionPoint: () => (__experimentalGetInsertionPoint), |
201 "canInsertBlockInWidgetArea": function() { return canInsertBlockInWidgetArea; }, |
117 canInsertBlockInWidgetArea: () => (canInsertBlockInWidgetArea), |
202 "getEditedWidgetAreas": function() { return getEditedWidgetAreas; }, |
118 getEditedWidgetAreas: () => (getEditedWidgetAreas), |
203 "getIsWidgetAreaOpen": function() { return getIsWidgetAreaOpen; }, |
119 getIsWidgetAreaOpen: () => (getIsWidgetAreaOpen), |
204 "getParentWidgetAreaBlock": function() { return getParentWidgetAreaBlock; }, |
120 getParentWidgetAreaBlock: () => (getParentWidgetAreaBlock), |
205 "getReferenceWidgetBlocks": function() { return getReferenceWidgetBlocks; }, |
121 getReferenceWidgetBlocks: () => (getReferenceWidgetBlocks), |
206 "getWidget": function() { return getWidget; }, |
122 getWidget: () => (getWidget), |
207 "getWidgetAreaForWidgetId": function() { return getWidgetAreaForWidgetId; }, |
123 getWidgetAreaForWidgetId: () => (getWidgetAreaForWidgetId), |
208 "getWidgetAreas": function() { return selectors_getWidgetAreas; }, |
124 getWidgetAreas: () => (selectors_getWidgetAreas), |
209 "getWidgets": function() { return selectors_getWidgets; }, |
125 getWidgets: () => (selectors_getWidgets), |
210 "isInserterOpened": function() { return isInserterOpened; }, |
126 isInserterOpened: () => (isInserterOpened), |
211 "isListViewOpened": function() { return isListViewOpened; }, |
127 isListViewOpened: () => (isListViewOpened), |
212 "isSavingWidgetAreas": function() { return isSavingWidgetAreas; } |
128 isSavingWidgetAreas: () => (isSavingWidgetAreas) |
|
129 }); |
|
130 |
|
131 // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/store/private-selectors.js |
|
132 var private_selectors_namespaceObject = {}; |
|
133 __webpack_require__.r(private_selectors_namespaceObject); |
|
134 __webpack_require__.d(private_selectors_namespaceObject, { |
|
135 getInserterSidebarToggleRef: () => (getInserterSidebarToggleRef), |
|
136 getListViewToggleRef: () => (getListViewToggleRef) |
213 }); |
137 }); |
214 |
138 |
215 // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/blocks/widget-area/index.js |
139 // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/blocks/widget-area/index.js |
216 var widget_area_namespaceObject = {}; |
140 var widget_area_namespaceObject = {}; |
217 __webpack_require__.r(widget_area_namespaceObject); |
141 __webpack_require__.r(widget_area_namespaceObject); |
218 __webpack_require__.d(widget_area_namespaceObject, { |
142 __webpack_require__.d(widget_area_namespaceObject, { |
219 "metadata": function() { return metadata; }, |
143 metadata: () => (metadata), |
220 "name": function() { return widget_area_name; }, |
144 name: () => (widget_area_name), |
221 "settings": function() { return settings; } |
145 settings: () => (settings) |
222 }); |
146 }); |
223 |
147 |
|
148 ;// CONCATENATED MODULE: external ["wp","blocks"] |
|
149 const external_wp_blocks_namespaceObject = window["wp"]["blocks"]; |
|
150 ;// CONCATENATED MODULE: external ["wp","data"] |
|
151 const external_wp_data_namespaceObject = window["wp"]["data"]; |
|
152 ;// CONCATENATED MODULE: external ["wp","deprecated"] |
|
153 const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"]; |
|
154 var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject); |
224 ;// CONCATENATED MODULE: external ["wp","element"] |
155 ;// CONCATENATED MODULE: external ["wp","element"] |
225 var external_wp_element_namespaceObject = window["wp"]["element"]; |
156 const external_wp_element_namespaceObject = window["wp"]["element"]; |
226 ;// CONCATENATED MODULE: external ["wp","blocks"] |
|
227 var external_wp_blocks_namespaceObject = window["wp"]["blocks"]; |
|
228 ;// CONCATENATED MODULE: external ["wp","data"] |
|
229 var external_wp_data_namespaceObject = window["wp"]["data"]; |
|
230 ;// CONCATENATED MODULE: external ["wp","blockLibrary"] |
157 ;// CONCATENATED MODULE: external ["wp","blockLibrary"] |
231 var external_wp_blockLibrary_namespaceObject = window["wp"]["blockLibrary"]; |
158 const external_wp_blockLibrary_namespaceObject = window["wp"]["blockLibrary"]; |
232 ;// CONCATENATED MODULE: external ["wp","coreData"] |
159 ;// CONCATENATED MODULE: external ["wp","coreData"] |
233 var external_wp_coreData_namespaceObject = window["wp"]["coreData"]; |
160 const external_wp_coreData_namespaceObject = window["wp"]["coreData"]; |
234 ;// CONCATENATED MODULE: external ["wp","widgets"] |
161 ;// CONCATENATED MODULE: external ["wp","widgets"] |
235 var external_wp_widgets_namespaceObject = window["wp"]["widgets"]; |
162 const external_wp_widgets_namespaceObject = window["wp"]["widgets"]; |
236 ;// CONCATENATED MODULE: external ["wp","preferences"] |
163 ;// CONCATENATED MODULE: external ["wp","preferences"] |
237 var external_wp_preferences_namespaceObject = window["wp"]["preferences"]; |
164 const external_wp_preferences_namespaceObject = window["wp"]["preferences"]; |
238 ;// CONCATENATED MODULE: external ["wp","apiFetch"] |
165 ;// CONCATENATED MODULE: external ["wp","apiFetch"] |
239 var external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"]; |
166 const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"]; |
240 var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject); |
167 var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject); |
241 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/store/reducer.js |
168 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/store/reducer.js |
242 /** |
169 /** |
243 * WordPress dependencies |
170 * WordPress dependencies |
244 */ |
171 */ |
245 |
172 |
|
173 |
246 /** |
174 /** |
247 * Controls the open state of the widget areas. |
175 * Controls the open state of the widget areas. |
248 * |
176 * |
249 * @param {Object} state Redux state. |
177 * @param {Object} state Redux state. |
250 * @param {Object} action Redux action. |
178 * @param {Object} action Redux action. |
251 * |
179 * |
252 * @return {Array} Updated state. |
180 * @return {Array} Updated state. |
253 */ |
181 */ |
254 |
182 function widgetAreasOpenState(state = {}, action) { |
255 function widgetAreasOpenState() { |
|
256 let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
|
257 let action = arguments.length > 1 ? arguments[1] : undefined; |
|
258 const { |
183 const { |
259 type |
184 type |
260 } = action; |
185 } = action; |
261 |
|
262 switch (type) { |
186 switch (type) { |
263 case 'SET_WIDGET_AREAS_OPEN_STATE': |
187 case 'SET_WIDGET_AREAS_OPEN_STATE': |
264 { |
188 { |
265 return action.widgetAreasOpenState; |
189 return action.widgetAreasOpenState; |
266 } |
190 } |
267 |
|
268 case 'SET_IS_WIDGET_AREA_OPEN': |
191 case 'SET_IS_WIDGET_AREA_OPEN': |
269 { |
192 { |
270 const { |
193 const { |
271 clientId, |
194 clientId, |
272 isOpen |
195 isOpen |
273 } = action; |
196 } = action; |
274 return { ...state, |
197 return { |
|
198 ...state, |
275 [clientId]: isOpen |
199 [clientId]: isOpen |
276 }; |
200 }; |
277 } |
201 } |
278 |
|
279 default: |
202 default: |
280 { |
203 { |
281 return state; |
204 return state; |
282 } |
205 } |
283 } |
206 } |
284 } |
207 } |
|
208 |
285 /** |
209 /** |
286 * Reducer to set the block inserter panel open or closed. |
210 * Reducer to set the block inserter panel open or closed. |
287 * |
211 * |
288 * Note: this reducer interacts with the list view panel reducer |
212 * Note: this reducer interacts with the list view panel reducer |
289 * to make sure that only one of the two panels is open at the same time. |
213 * to make sure that only one of the two panels is open at the same time. |
290 * |
214 * |
291 * @param {Object} state Current state. |
215 * @param {Object} state Current state. |
292 * @param {Object} action Dispatched action. |
216 * @param {Object} action Dispatched action. |
293 */ |
217 */ |
294 |
218 function blockInserterPanel(state = false, action) { |
295 function blockInserterPanel() { |
|
296 let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; |
|
297 let action = arguments.length > 1 ? arguments[1] : undefined; |
|
298 |
|
299 switch (action.type) { |
219 switch (action.type) { |
300 case 'SET_IS_LIST_VIEW_OPENED': |
220 case 'SET_IS_LIST_VIEW_OPENED': |
301 return action.isOpen ? false : state; |
221 return action.isOpen ? false : state; |
302 |
|
303 case 'SET_IS_INSERTER_OPENED': |
222 case 'SET_IS_INSERTER_OPENED': |
304 return action.value; |
223 return action.value; |
305 } |
224 } |
306 |
|
307 return state; |
225 return state; |
308 } |
226 } |
|
227 |
309 /** |
228 /** |
310 * Reducer to set the list view panel open or closed. |
229 * Reducer to set the list view panel open or closed. |
311 * |
230 * |
312 * Note: this reducer interacts with the inserter panel reducer |
231 * Note: this reducer interacts with the inserter panel reducer |
313 * to make sure that only one of the two panels is open at the same time. |
232 * to make sure that only one of the two panels is open at the same time. |
314 * |
233 * |
315 * @param {Object} state Current state. |
234 * @param {Object} state Current state. |
316 * @param {Object} action Dispatched action. |
235 * @param {Object} action Dispatched action. |
317 */ |
236 */ |
318 |
237 function listViewPanel(state = false, action) { |
319 function listViewPanel() { |
|
320 let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; |
|
321 let action = arguments.length > 1 ? arguments[1] : undefined; |
|
322 |
|
323 switch (action.type) { |
238 switch (action.type) { |
324 case 'SET_IS_INSERTER_OPENED': |
239 case 'SET_IS_INSERTER_OPENED': |
325 return action.value ? false : state; |
240 return action.value ? false : state; |
326 |
|
327 case 'SET_IS_LIST_VIEW_OPENED': |
241 case 'SET_IS_LIST_VIEW_OPENED': |
328 return action.isOpen; |
242 return action.isOpen; |
329 } |
243 } |
330 |
|
331 return state; |
244 return state; |
332 } |
245 } |
333 /* harmony default export */ var reducer = ((0,external_wp_data_namespaceObject.combineReducers)({ |
246 |
|
247 /** |
|
248 * This reducer does nothing aside initializing a ref to the list view toggle. |
|
249 * We will have a unique ref per "editor" instance. |
|
250 * |
|
251 * @param {Object} state |
|
252 * @return {Object} Reference to the list view toggle button. |
|
253 */ |
|
254 function listViewToggleRef(state = { |
|
255 current: null |
|
256 }) { |
|
257 return state; |
|
258 } |
|
259 |
|
260 /** |
|
261 * This reducer does nothing aside initializing a ref to the inserter sidebar toggle. |
|
262 * We will have a unique ref per "editor" instance. |
|
263 * |
|
264 * @param {Object} state |
|
265 * @return {Object} Reference to the inserter sidebar toggle button. |
|
266 */ |
|
267 function inserterSidebarToggleRef(state = { |
|
268 current: null |
|
269 }) { |
|
270 return state; |
|
271 } |
|
272 /* harmony default export */ const reducer = ((0,external_wp_data_namespaceObject.combineReducers)({ |
334 blockInserterPanel, |
273 blockInserterPanel, |
|
274 inserterSidebarToggleRef, |
335 listViewPanel, |
275 listViewPanel, |
|
276 listViewToggleRef, |
336 widgetAreasOpenState |
277 widgetAreasOpenState |
337 })); |
278 })); |
338 |
279 |
339 ;// CONCATENATED MODULE: external ["wp","i18n"] |
280 ;// CONCATENATED MODULE: external ["wp","i18n"] |
340 var external_wp_i18n_namespaceObject = window["wp"]["i18n"]; |
281 const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; |
341 ;// CONCATENATED MODULE: external ["wp","notices"] |
282 ;// CONCATENATED MODULE: external ["wp","notices"] |
342 var external_wp_notices_namespaceObject = window["wp"]["notices"]; |
283 const external_wp_notices_namespaceObject = window["wp"]["notices"]; |
343 ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js |
284 ;// CONCATENATED MODULE: ./node_modules/clsx/dist/clsx.mjs |
344 function _extends() { |
285 function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f)}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}/* harmony default export */ const dist_clsx = (clsx); |
345 _extends = Object.assign ? Object.assign.bind() : function (target) { |
|
346 for (var i = 1; i < arguments.length; i++) { |
|
347 var source = arguments[i]; |
|
348 |
|
349 for (var key in source) { |
|
350 if (Object.prototype.hasOwnProperty.call(source, key)) { |
|
351 target[key] = source[key]; |
|
352 } |
|
353 } |
|
354 } |
|
355 |
|
356 return target; |
|
357 }; |
|
358 return _extends.apply(this, arguments); |
|
359 } |
|
360 // EXTERNAL MODULE: ./node_modules/classnames/index.js |
|
361 var classnames = __webpack_require__(4403); |
|
362 var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); |
|
363 ;// CONCATENATED MODULE: external ["wp","components"] |
286 ;// CONCATENATED MODULE: external ["wp","components"] |
364 var external_wp_components_namespaceObject = window["wp"]["components"]; |
287 const external_wp_components_namespaceObject = window["wp"]["components"]; |
365 ;// CONCATENATED MODULE: external ["wp","primitives"] |
288 ;// CONCATENATED MODULE: external ["wp","primitives"] |
366 var external_wp_primitives_namespaceObject = window["wp"]["primitives"]; |
289 const external_wp_primitives_namespaceObject = window["wp"]["primitives"]; |
|
290 ;// CONCATENATED MODULE: external "ReactJSXRuntime" |
|
291 const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; |
367 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/check.js |
292 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/check.js |
368 |
293 /** |
369 |
294 * WordPress dependencies |
370 /** |
295 */ |
371 * WordPress dependencies |
296 |
372 */ |
297 |
373 |
298 const check = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { |
374 const check = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { |
|
375 xmlns: "http://www.w3.org/2000/svg", |
299 xmlns: "http://www.w3.org/2000/svg", |
376 viewBox: "0 0 24 24" |
300 viewBox: "0 0 24 24", |
377 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { |
301 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { |
378 d: "M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z" |
302 d: "M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z" |
379 })); |
303 }) |
380 /* harmony default export */ var library_check = (check); |
304 }); |
|
305 /* harmony default export */ const library_check = (check); |
381 |
306 |
382 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/star-filled.js |
307 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/star-filled.js |
383 |
308 /** |
384 |
309 * WordPress dependencies |
385 /** |
310 */ |
386 * WordPress dependencies |
311 |
387 */ |
312 |
388 |
313 const starFilled = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { |
389 const starFilled = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { |
|
390 xmlns: "http://www.w3.org/2000/svg", |
314 xmlns: "http://www.w3.org/2000/svg", |
391 viewBox: "0 0 24 24" |
315 viewBox: "0 0 24 24", |
392 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { |
316 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { |
393 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" |
317 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" |
394 })); |
318 }) |
395 /* harmony default export */ var star_filled = (starFilled); |
319 }); |
|
320 /* harmony default export */ const star_filled = (starFilled); |
396 |
321 |
397 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/star-empty.js |
322 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/star-empty.js |
398 |
323 /** |
399 |
324 * WordPress dependencies |
400 /** |
325 */ |
401 * WordPress dependencies |
326 |
402 */ |
327 |
403 |
328 const starEmpty = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { |
404 const starEmpty = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { |
|
405 xmlns: "http://www.w3.org/2000/svg", |
329 xmlns: "http://www.w3.org/2000/svg", |
406 viewBox: "0 0 24 24" |
330 viewBox: "0 0 24 24", |
407 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { |
331 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { |
408 fillRule: "evenodd", |
332 fillRule: "evenodd", |
409 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", |
333 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", |
410 clipRule: "evenodd" |
334 clipRule: "evenodd" |
411 })); |
335 }) |
412 /* harmony default export */ var star_empty = (starEmpty); |
336 }); |
|
337 /* harmony default export */ const star_empty = (starEmpty); |
413 |
338 |
414 ;// CONCATENATED MODULE: external ["wp","viewport"] |
339 ;// CONCATENATED MODULE: external ["wp","viewport"] |
415 var external_wp_viewport_namespaceObject = window["wp"]["viewport"]; |
340 const external_wp_viewport_namespaceObject = window["wp"]["viewport"]; |
|
341 ;// CONCATENATED MODULE: external ["wp","compose"] |
|
342 const external_wp_compose_namespaceObject = window["wp"]["compose"]; |
416 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close-small.js |
343 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close-small.js |
417 |
344 /** |
418 |
345 * WordPress dependencies |
419 /** |
346 */ |
420 * WordPress dependencies |
347 |
421 */ |
348 |
422 |
349 const closeSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { |
423 const closeSmall = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { |
|
424 xmlns: "http://www.w3.org/2000/svg", |
350 xmlns: "http://www.w3.org/2000/svg", |
425 viewBox: "0 0 24 24" |
351 viewBox: "0 0 24 24", |
426 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { |
352 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { |
427 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" |
353 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" |
428 })); |
354 }) |
429 /* harmony default export */ var close_small = (closeSmall); |
355 }); |
430 |
356 /* harmony default export */ const close_small = (closeSmall); |
431 ;// CONCATENATED MODULE: external "lodash" |
357 |
432 var external_lodash_namespaceObject = window["lodash"]; |
358 ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/deprecated.js |
433 ;// CONCATENATED MODULE: external ["wp","deprecated"] |
359 /** |
434 var external_wp_deprecated_namespaceObject = window["wp"]["deprecated"]; |
360 * WordPress dependencies |
435 var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject); |
361 */ |
|
362 |
|
363 function normalizeComplementaryAreaScope(scope) { |
|
364 if (['core/edit-post', 'core/edit-site'].includes(scope)) { |
|
365 external_wp_deprecated_default()(`${scope} interface scope`, { |
|
366 alternative: 'core interface scope', |
|
367 hint: 'core/edit-post and core/edit-site are merging.', |
|
368 version: '6.6' |
|
369 }); |
|
370 return 'core'; |
|
371 } |
|
372 return scope; |
|
373 } |
|
374 function normalizeComplementaryAreaName(scope, name) { |
|
375 if (scope === 'core' && name === 'edit-site/template') { |
|
376 external_wp_deprecated_default()(`edit-site/template sidebar`, { |
|
377 alternative: 'edit-post/document', |
|
378 version: '6.6' |
|
379 }); |
|
380 return 'edit-post/document'; |
|
381 } |
|
382 if (scope === 'core' && name === 'edit-site/block-inspector') { |
|
383 external_wp_deprecated_default()(`edit-site/block-inspector sidebar`, { |
|
384 alternative: 'edit-post/block', |
|
385 version: '6.6' |
|
386 }); |
|
387 return 'edit-post/block'; |
|
388 } |
|
389 return name; |
|
390 } |
|
391 |
436 ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/actions.js |
392 ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/actions.js |
437 /** |
393 /** |
438 * WordPress dependencies |
394 * WordPress dependencies |
439 */ |
395 */ |
440 |
396 |
441 |
397 |
442 /** |
398 |
443 * Enable the complementary area. |
399 /** |
|
400 * Internal dependencies |
|
401 */ |
|
402 |
|
403 |
|
404 /** |
|
405 * Set a default complementary area. |
444 * |
406 * |
445 * @param {string} scope Complementary area scope. |
407 * @param {string} scope Complementary area scope. |
446 * @param {string} area Area identifier. |
408 * @param {string} area Area identifier. |
447 */ |
409 * |
448 |
410 * @return {Object} Action object. |
449 const enableComplementaryArea = (scope, area) => _ref => { |
411 */ |
450 let { |
412 const setDefaultComplementaryArea = (scope, area) => { |
451 registry |
413 scope = normalizeComplementaryAreaScope(scope); |
452 } = _ref; |
414 area = normalizeComplementaryAreaName(scope, area); |
453 |
415 return { |
|
416 type: 'SET_DEFAULT_COMPLEMENTARY_AREA', |
|
417 scope, |
|
418 area |
|
419 }; |
|
420 }; |
|
421 |
|
422 /** |
|
423 * Enable the complementary area. |
|
424 * |
|
425 * @param {string} scope Complementary area scope. |
|
426 * @param {string} area Area identifier. |
|
427 */ |
|
428 const enableComplementaryArea = (scope, area) => ({ |
|
429 registry, |
|
430 dispatch |
|
431 }) => { |
454 // Return early if there's no area. |
432 // Return early if there's no area. |
455 if (!area) { |
433 if (!area) { |
456 return; |
434 return; |
457 } |
435 } |
458 |
436 scope = normalizeComplementaryAreaScope(scope); |
459 registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'complementaryArea', area); |
437 area = normalizeComplementaryAreaName(scope, area); |
|
438 const isComplementaryAreaVisible = registry.select(external_wp_preferences_namespaceObject.store).get(scope, 'isComplementaryAreaVisible'); |
|
439 if (!isComplementaryAreaVisible) { |
|
440 registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'isComplementaryAreaVisible', true); |
|
441 } |
|
442 dispatch({ |
|
443 type: 'ENABLE_COMPLEMENTARY_AREA', |
|
444 scope, |
|
445 area |
|
446 }); |
460 }; |
447 }; |
|
448 |
461 /** |
449 /** |
462 * Disable the complementary area. |
450 * Disable the complementary area. |
463 * |
451 * |
464 * @param {string} scope Complementary area scope. |
452 * @param {string} scope Complementary area scope. |
465 */ |
453 */ |
466 |
454 const disableComplementaryArea = scope => ({ |
467 const disableComplementaryArea = scope => _ref2 => { |
455 registry |
468 let { |
456 }) => { |
469 registry |
457 scope = normalizeComplementaryAreaScope(scope); |
470 } = _ref2; |
458 const isComplementaryAreaVisible = registry.select(external_wp_preferences_namespaceObject.store).get(scope, 'isComplementaryAreaVisible'); |
471 registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'complementaryArea', null); |
459 if (isComplementaryAreaVisible) { |
|
460 registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'isComplementaryAreaVisible', false); |
|
461 } |
472 }; |
462 }; |
|
463 |
473 /** |
464 /** |
474 * Pins an item. |
465 * Pins an item. |
475 * |
466 * |
476 * @param {string} scope Item scope. |
467 * @param {string} scope Item scope. |
477 * @param {string} item Item identifier. |
468 * @param {string} item Item identifier. |
478 * |
469 * |
479 * @return {Object} Action object. |
470 * @return {Object} Action object. |
480 */ |
471 */ |
481 |
472 const pinItem = (scope, item) => ({ |
482 const pinItem = (scope, item) => _ref3 => { |
473 registry |
483 let { |
474 }) => { |
484 registry |
|
485 } = _ref3; |
|
486 |
|
487 // Return early if there's no item. |
475 // Return early if there's no item. |
488 if (!item) { |
476 if (!item) { |
489 return; |
477 return; |
490 } |
478 } |
491 |
479 scope = normalizeComplementaryAreaScope(scope); |
492 const pinnedItems = registry.select(external_wp_preferences_namespaceObject.store).get(scope, 'pinnedItems'); // The item is already pinned, there's nothing to do. |
480 item = normalizeComplementaryAreaName(scope, item); |
493 |
481 const pinnedItems = registry.select(external_wp_preferences_namespaceObject.store).get(scope, 'pinnedItems'); |
494 if ((pinnedItems === null || pinnedItems === void 0 ? void 0 : pinnedItems[item]) === true) { |
482 |
|
483 // The item is already pinned, there's nothing to do. |
|
484 if (pinnedItems?.[item] === true) { |
495 return; |
485 return; |
496 } |
486 } |
497 |
487 registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'pinnedItems', { |
498 registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'pinnedItems', { ...pinnedItems, |
488 ...pinnedItems, |
499 [item]: true |
489 [item]: true |
500 }); |
490 }); |
501 }; |
491 }; |
|
492 |
502 /** |
493 /** |
503 * Unpins an item. |
494 * Unpins an item. |
504 * |
495 * |
505 * @param {string} scope Item scope. |
496 * @param {string} scope Item scope. |
506 * @param {string} item Item identifier. |
497 * @param {string} item Item identifier. |
507 */ |
498 */ |
508 |
499 const unpinItem = (scope, item) => ({ |
509 const unpinItem = (scope, item) => _ref4 => { |
500 registry |
510 let { |
501 }) => { |
511 registry |
|
512 } = _ref4; |
|
513 |
|
514 // Return early if there's no item. |
502 // Return early if there's no item. |
515 if (!item) { |
503 if (!item) { |
516 return; |
504 return; |
517 } |
505 } |
518 |
506 scope = normalizeComplementaryAreaScope(scope); |
|
507 item = normalizeComplementaryAreaName(scope, item); |
519 const pinnedItems = registry.select(external_wp_preferences_namespaceObject.store).get(scope, 'pinnedItems'); |
508 const pinnedItems = registry.select(external_wp_preferences_namespaceObject.store).get(scope, 'pinnedItems'); |
520 registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'pinnedItems', { ...pinnedItems, |
509 registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'pinnedItems', { |
|
510 ...pinnedItems, |
521 [item]: false |
511 [item]: false |
522 }); |
512 }); |
523 }; |
513 }; |
|
514 |
524 /** |
515 /** |
525 * Returns an action object used in signalling that a feature should be toggled. |
516 * Returns an action object used in signalling that a feature should be toggled. |
526 * |
517 * |
527 * @param {string} scope The feature scope (e.g. core/edit-post). |
518 * @param {string} scope The feature scope (e.g. core/edit-post). |
528 * @param {string} featureName The feature name. |
519 * @param {string} featureName The feature name. |
529 */ |
520 */ |
530 |
|
531 function toggleFeature(scope, featureName) { |
521 function toggleFeature(scope, featureName) { |
532 return function (_ref5) { |
522 return function ({ |
533 let { |
523 registry |
534 registry |
524 }) { |
535 } = _ref5; |
|
536 external_wp_deprecated_default()(`dispatch( 'core/interface' ).toggleFeature`, { |
525 external_wp_deprecated_default()(`dispatch( 'core/interface' ).toggleFeature`, { |
537 since: '6.0', |
526 since: '6.0', |
538 alternative: `dispatch( 'core/preferences' ).toggle` |
527 alternative: `dispatch( 'core/preferences' ).toggle` |
539 }); |
528 }); |
540 registry.dispatch(external_wp_preferences_namespaceObject.store).toggle(scope, featureName); |
529 registry.dispatch(external_wp_preferences_namespaceObject.store).toggle(scope, featureName); |
541 }; |
530 }; |
542 } |
531 } |
|
532 |
543 /** |
533 /** |
544 * Returns an action object used in signalling that a feature should be set to |
534 * Returns an action object used in signalling that a feature should be set to |
545 * a true or false value |
535 * a true or false value |
546 * |
536 * |
547 * @param {string} scope The feature scope (e.g. core/edit-post). |
537 * @param {string} scope The feature scope (e.g. core/edit-post). |
548 * @param {string} featureName The feature name. |
538 * @param {string} featureName The feature name. |
549 * @param {boolean} value The value to set. |
539 * @param {boolean} value The value to set. |
550 * |
540 * |
551 * @return {Object} Action object. |
541 * @return {Object} Action object. |
552 */ |
542 */ |
553 |
|
554 function setFeatureValue(scope, featureName, value) { |
543 function setFeatureValue(scope, featureName, value) { |
555 return function (_ref6) { |
544 return function ({ |
556 let { |
545 registry |
557 registry |
546 }) { |
558 } = _ref6; |
|
559 external_wp_deprecated_default()(`dispatch( 'core/interface' ).setFeatureValue`, { |
547 external_wp_deprecated_default()(`dispatch( 'core/interface' ).setFeatureValue`, { |
560 since: '6.0', |
548 since: '6.0', |
561 alternative: `dispatch( 'core/preferences' ).set` |
549 alternative: `dispatch( 'core/preferences' ).set` |
562 }); |
550 }); |
563 registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, featureName, !!value); |
551 registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, featureName, !!value); |
564 }; |
552 }; |
565 } |
553 } |
|
554 |
566 /** |
555 /** |
567 * Returns an action object used in signalling that defaults should be set for features. |
556 * Returns an action object used in signalling that defaults should be set for features. |
568 * |
557 * |
569 * @param {string} scope The feature scope (e.g. core/edit-post). |
558 * @param {string} scope The feature scope (e.g. core/edit-post). |
570 * @param {Object<string, boolean>} defaults A key/value map of feature names to values. |
559 * @param {Object<string, boolean>} defaults A key/value map of feature names to values. |
571 * |
560 * |
572 * @return {Object} Action object. |
561 * @return {Object} Action object. |
573 */ |
562 */ |
574 |
|
575 function setFeatureDefaults(scope, defaults) { |
563 function setFeatureDefaults(scope, defaults) { |
576 return function (_ref7) { |
564 return function ({ |
577 let { |
565 registry |
578 registry |
566 }) { |
579 } = _ref7; |
|
580 external_wp_deprecated_default()(`dispatch( 'core/interface' ).setFeatureDefaults`, { |
567 external_wp_deprecated_default()(`dispatch( 'core/interface' ).setFeatureDefaults`, { |
581 since: '6.0', |
568 since: '6.0', |
582 alternative: `dispatch( 'core/preferences' ).setDefaults` |
569 alternative: `dispatch( 'core/preferences' ).setDefaults` |
583 }); |
570 }); |
584 registry.dispatch(external_wp_preferences_namespaceObject.store).setDefaults(scope, defaults); |
571 registry.dispatch(external_wp_preferences_namespaceObject.store).setDefaults(scope, defaults); |
585 }; |
572 }; |
586 } |
573 } |
587 |
574 |
|
575 /** |
|
576 * Returns an action object used in signalling that the user opened a modal. |
|
577 * |
|
578 * @param {string} name A string that uniquely identifies the modal. |
|
579 * |
|
580 * @return {Object} Action object. |
|
581 */ |
|
582 function openModal(name) { |
|
583 return { |
|
584 type: 'OPEN_MODAL', |
|
585 name |
|
586 }; |
|
587 } |
|
588 |
|
589 /** |
|
590 * Returns an action object signalling that the user closed a modal. |
|
591 * |
|
592 * @return {Object} Action object. |
|
593 */ |
|
594 function closeModal() { |
|
595 return { |
|
596 type: 'CLOSE_MODAL' |
|
597 }; |
|
598 } |
|
599 |
588 ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/selectors.js |
600 ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/selectors.js |
589 /** |
601 /** |
590 * WordPress dependencies |
602 * WordPress dependencies |
591 */ |
603 */ |
592 |
604 |
|
605 |
|
606 |
|
607 |
|
608 /** |
|
609 * Internal dependencies |
|
610 */ |
593 |
611 |
594 |
612 |
595 /** |
613 /** |
596 * Returns the complementary area that is active in a given scope. |
614 * Returns the complementary area that is active in a given scope. |
597 * |
615 * |
598 * @param {Object} state Global application state. |
616 * @param {Object} state Global application state. |
599 * @param {string} scope Item scope. |
617 * @param {string} scope Item scope. |
600 * |
618 * |
601 * @return {string} The complementary area that is active in the given scope. |
619 * @return {string | null | undefined} The complementary area that is active in the given scope. |
602 */ |
620 */ |
603 |
|
604 const getActiveComplementaryArea = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope) => { |
621 const getActiveComplementaryArea = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope) => { |
605 return select(external_wp_preferences_namespaceObject.store).get(scope, 'complementaryArea'); |
622 scope = normalizeComplementaryAreaScope(scope); |
|
623 const isComplementaryAreaVisible = select(external_wp_preferences_namespaceObject.store).get(scope, 'isComplementaryAreaVisible'); |
|
624 |
|
625 // Return `undefined` to indicate that the user has never toggled |
|
626 // visibility, this is the vanilla default. Other code relies on this |
|
627 // nuance in the return value. |
|
628 if (isComplementaryAreaVisible === undefined) { |
|
629 return undefined; |
|
630 } |
|
631 |
|
632 // Return `null` to indicate the user hid the complementary area. |
|
633 if (isComplementaryAreaVisible === false) { |
|
634 return null; |
|
635 } |
|
636 return state?.complementaryAreas?.[scope]; |
606 }); |
637 }); |
|
638 const isComplementaryAreaLoading = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope) => { |
|
639 scope = normalizeComplementaryAreaScope(scope); |
|
640 const isVisible = select(external_wp_preferences_namespaceObject.store).get(scope, 'isComplementaryAreaVisible'); |
|
641 const identifier = state?.complementaryAreas?.[scope]; |
|
642 return isVisible && identifier === undefined; |
|
643 }); |
|
644 |
607 /** |
645 /** |
608 * Returns a boolean indicating if an item is pinned or not. |
646 * Returns a boolean indicating if an item is pinned or not. |
609 * |
647 * |
610 * @param {Object} state Global application state. |
648 * @param {Object} state Global application state. |
611 * @param {string} scope Scope. |
649 * @param {string} scope Scope. |
612 * @param {string} item Item to check. |
650 * @param {string} item Item to check. |
613 * |
651 * |
614 * @return {boolean} True if the item is pinned and false otherwise. |
652 * @return {boolean} True if the item is pinned and false otherwise. |
615 */ |
653 */ |
616 |
|
617 const isItemPinned = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope, item) => { |
654 const isItemPinned = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope, item) => { |
618 var _pinnedItems$item; |
655 var _pinnedItems$item; |
619 |
656 scope = normalizeComplementaryAreaScope(scope); |
|
657 item = normalizeComplementaryAreaName(scope, item); |
620 const pinnedItems = select(external_wp_preferences_namespaceObject.store).get(scope, 'pinnedItems'); |
658 const pinnedItems = select(external_wp_preferences_namespaceObject.store).get(scope, 'pinnedItems'); |
621 return (_pinnedItems$item = pinnedItems === null || pinnedItems === void 0 ? void 0 : pinnedItems[item]) !== null && _pinnedItems$item !== void 0 ? _pinnedItems$item : true; |
659 return (_pinnedItems$item = pinnedItems?.[item]) !== null && _pinnedItems$item !== void 0 ? _pinnedItems$item : true; |
622 }); |
660 }); |
|
661 |
623 /** |
662 /** |
624 * Returns a boolean indicating whether a feature is active for a particular |
663 * Returns a boolean indicating whether a feature is active for a particular |
625 * scope. |
664 * scope. |
626 * |
665 * |
627 * @param {Object} state The store state. |
666 * @param {Object} state The store state. |
628 * @param {string} scope The scope of the feature (e.g. core/edit-post). |
667 * @param {string} scope The scope of the feature (e.g. core/edit-post). |
629 * @param {string} featureName The name of the feature. |
668 * @param {string} featureName The name of the feature. |
630 * |
669 * |
631 * @return {boolean} Is the feature enabled? |
670 * @return {boolean} Is the feature enabled? |
632 */ |
671 */ |
633 |
|
634 const isFeatureActive = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope, featureName) => { |
672 const isFeatureActive = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope, featureName) => { |
635 external_wp_deprecated_default()(`select( 'core/interface' ).isFeatureActive( scope, featureName )`, { |
673 external_wp_deprecated_default()(`select( 'core/interface' ).isFeatureActive( scope, featureName )`, { |
636 since: '6.0', |
674 since: '6.0', |
637 alternative: `select( 'core/preferences' ).get( scope, featureName )` |
675 alternative: `select( 'core/preferences' ).get( scope, featureName )` |
638 }); |
676 }); |
639 return !!select(external_wp_preferences_namespaceObject.store).get(scope, featureName); |
677 return !!select(external_wp_preferences_namespaceObject.store).get(scope, featureName); |
640 }); |
678 }); |
641 |
679 |
|
680 /** |
|
681 * Returns true if a modal is active, or false otherwise. |
|
682 * |
|
683 * @param {Object} state Global application state. |
|
684 * @param {string} modalName A string that uniquely identifies the modal. |
|
685 * |
|
686 * @return {boolean} Whether the modal is active. |
|
687 */ |
|
688 function isModalActive(state, modalName) { |
|
689 return state.activeModal === modalName; |
|
690 } |
|
691 |
|
692 ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/reducer.js |
|
693 /** |
|
694 * WordPress dependencies |
|
695 */ |
|
696 |
|
697 function complementaryAreas(state = {}, action) { |
|
698 switch (action.type) { |
|
699 case 'SET_DEFAULT_COMPLEMENTARY_AREA': |
|
700 { |
|
701 const { |
|
702 scope, |
|
703 area |
|
704 } = action; |
|
705 |
|
706 // If there's already an area, don't overwrite it. |
|
707 if (state[scope]) { |
|
708 return state; |
|
709 } |
|
710 return { |
|
711 ...state, |
|
712 [scope]: area |
|
713 }; |
|
714 } |
|
715 case 'ENABLE_COMPLEMENTARY_AREA': |
|
716 { |
|
717 const { |
|
718 scope, |
|
719 area |
|
720 } = action; |
|
721 return { |
|
722 ...state, |
|
723 [scope]: area |
|
724 }; |
|
725 } |
|
726 } |
|
727 return state; |
|
728 } |
|
729 |
|
730 /** |
|
731 * Reducer for storing the name of the open modal, or null if no modal is open. |
|
732 * |
|
733 * @param {Object} state Previous state. |
|
734 * @param {Object} action Action object containing the `name` of the modal |
|
735 * |
|
736 * @return {Object} Updated state |
|
737 */ |
|
738 function activeModal(state = null, action) { |
|
739 switch (action.type) { |
|
740 case 'OPEN_MODAL': |
|
741 return action.name; |
|
742 case 'CLOSE_MODAL': |
|
743 return null; |
|
744 } |
|
745 return state; |
|
746 } |
|
747 /* harmony default export */ const store_reducer = ((0,external_wp_data_namespaceObject.combineReducers)({ |
|
748 complementaryAreas, |
|
749 activeModal |
|
750 })); |
|
751 |
642 ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/constants.js |
752 ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/constants.js |
643 /** |
753 /** |
644 * The identifier for the data store. |
754 * The identifier for the data store. |
645 * |
755 * |
646 * @type {string} |
756 * @type {string} |
885 * Internal dependencies |
977 * Internal dependencies |
886 */ |
978 */ |
887 |
979 |
888 |
980 |
889 |
981 |
890 |
982 const PluginsMenuItem = ({ |
891 const PluginsMenuItem = props => // Menu item is marked with unstable prop for backward compatibility. |
983 // Menu item is marked with unstable prop for backward compatibility. |
892 // They are removed so they don't leak to DOM elements. |
984 // They are removed so they don't leak to DOM elements. |
893 // @see https://github.com/WordPress/gutenberg/issues/14457 |
985 // @see https://github.com/WordPress/gutenberg/issues/14457 |
894 (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, (0,external_lodash_namespaceObject.omit)(props, ['__unstableExplicitMenuItem', '__unstableTarget'])); |
986 __unstableExplicitMenuItem, |
895 |
987 __unstableTarget, |
896 function ComplementaryAreaMoreMenuItem(_ref) { |
988 ...restProps |
897 let { |
989 }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { |
898 scope, |
990 ...restProps |
899 target, |
991 }); |
900 __unstableExplicitMenuItem, |
992 function ComplementaryAreaMoreMenuItem({ |
901 ...props |
993 scope, |
902 } = _ref; |
994 target, |
903 return (0,external_wp_element_namespaceObject.createElement)(complementary_area_toggle, _extends({ |
995 __unstableExplicitMenuItem, |
|
996 ...props |
|
997 }) { |
|
998 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(complementary_area_toggle, { |
904 as: toggleProps => { |
999 as: toggleProps => { |
905 return (0,external_wp_element_namespaceObject.createElement)(action_item, _extends({ |
1000 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(action_item, { |
906 __unstableExplicitMenuItem: __unstableExplicitMenuItem, |
1001 __unstableExplicitMenuItem: __unstableExplicitMenuItem, |
907 __unstableTarget: `${scope}/${target}`, |
1002 __unstableTarget: `${scope}/${target}`, |
908 as: PluginsMenuItem, |
1003 as: PluginsMenuItem, |
909 name: `${scope}/plugin-more-menu` |
1004 name: `${scope}/plugin-more-menu`, |
910 }, toggleProps)); |
1005 ...toggleProps |
|
1006 }); |
911 }, |
1007 }, |
912 role: "menuitemcheckbox", |
1008 role: "menuitemcheckbox", |
913 selectedIcon: library_check, |
1009 selectedIcon: library_check, |
914 name: target, |
1010 name: target, |
915 scope: scope |
1011 scope: scope, |
916 }, props)); |
1012 ...props |
|
1013 }); |
917 } |
1014 } |
918 |
1015 |
919 ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/pinned-items/index.js |
1016 ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/pinned-items/index.js |
920 |
|
921 |
|
922 |
|
923 /** |
1017 /** |
924 * External dependencies |
1018 * External dependencies |
925 */ |
1019 */ |
926 |
1020 |
927 |
1021 |
928 /** |
1022 /** |
929 * WordPress dependencies |
1023 * WordPress dependencies |
930 */ |
1024 */ |
931 |
1025 |
932 |
1026 |
933 |
1027 function PinnedItems({ |
934 function PinnedItems(_ref) { |
1028 scope, |
935 let { |
1029 ...props |
936 scope, |
1030 }) { |
|
1031 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Fill, { |
|
1032 name: `PinnedItems/${scope}`, |
937 ...props |
1033 ...props |
938 } = _ref; |
1034 }); |
939 return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Fill, _extends({ |
1035 } |
940 name: `PinnedItems/${scope}` |
1036 function PinnedItemsSlot({ |
941 }, props)); |
1037 scope, |
942 } |
1038 className, |
943 |
1039 ...props |
944 function PinnedItemsSlot(_ref2) { |
1040 }) { |
945 let { |
1041 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Slot, { |
946 scope, |
1042 name: `PinnedItems/${scope}`, |
947 className, |
1043 ...props, |
|
1044 children: fills => fills?.length > 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { |
|
1045 className: dist_clsx(className, 'interface-pinned-items'), |
|
1046 children: fills |
|
1047 }) |
|
1048 }); |
|
1049 } |
|
1050 PinnedItems.Slot = PinnedItemsSlot; |
|
1051 /* harmony default export */ const pinned_items = (PinnedItems); |
|
1052 |
|
1053 ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area/index.js |
|
1054 /** |
|
1055 * External dependencies |
|
1056 */ |
|
1057 |
|
1058 |
|
1059 /** |
|
1060 * WordPress dependencies |
|
1061 */ |
|
1062 |
|
1063 |
|
1064 |
|
1065 |
|
1066 |
|
1067 |
|
1068 |
|
1069 |
|
1070 |
|
1071 /** |
|
1072 * Internal dependencies |
|
1073 */ |
|
1074 |
|
1075 |
|
1076 |
|
1077 |
|
1078 |
|
1079 |
|
1080 |
|
1081 |
|
1082 |
|
1083 const ANIMATION_DURATION = 0.3; |
|
1084 function ComplementaryAreaSlot({ |
|
1085 scope, |
|
1086 ...props |
|
1087 }) { |
|
1088 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Slot, { |
|
1089 name: `ComplementaryArea/${scope}`, |
948 ...props |
1090 ...props |
949 } = _ref2; |
1091 }); |
950 return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Slot, _extends({ |
1092 } |
951 name: `PinnedItems/${scope}` |
1093 const SIDEBAR_WIDTH = 280; |
952 }, props), fills => !(0,external_lodash_namespaceObject.isEmpty)(fills) && (0,external_wp_element_namespaceObject.createElement)("div", { |
1094 const variants = { |
953 className: classnames_default()(className, 'interface-pinned-items') |
1095 open: { |
954 }, fills)); |
1096 width: SIDEBAR_WIDTH |
955 } |
1097 }, |
956 |
1098 closed: { |
957 PinnedItems.Slot = PinnedItemsSlot; |
1099 width: 0 |
958 /* harmony default export */ var pinned_items = (PinnedItems); |
1100 }, |
959 |
1101 mobileOpen: { |
960 ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area/index.js |
1102 width: '100vw' |
961 |
1103 } |
962 |
1104 }; |
963 |
1105 function ComplementaryAreaFill({ |
964 /** |
1106 activeArea, |
965 * External dependencies |
1107 isActive, |
966 */ |
1108 scope, |
967 |
1109 children, |
968 /** |
1110 className, |
969 * WordPress dependencies |
1111 id |
970 */ |
1112 }) { |
971 |
1113 const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); |
972 |
1114 const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); |
973 |
1115 // This is used to delay the exit animation to the next tick. |
974 |
1116 // The reason this is done is to allow us to apply the right transition properties |
975 |
1117 // When we switch from an open sidebar to another open sidebar. |
976 |
1118 // we don't want to animate in this case. |
977 |
1119 const previousActiveArea = (0,external_wp_compose_namespaceObject.usePrevious)(activeArea); |
978 /** |
1120 const previousIsActive = (0,external_wp_compose_namespaceObject.usePrevious)(isActive); |
979 * Internal dependencies |
1121 const [, setState] = (0,external_wp_element_namespaceObject.useState)({}); |
980 */ |
1122 (0,external_wp_element_namespaceObject.useEffect)(() => { |
981 |
1123 setState({}); |
982 |
1124 }, [isActive]); |
983 |
1125 const transition = { |
984 |
1126 type: 'tween', |
985 |
1127 duration: disableMotion || isMobileViewport || !!previousActiveArea && !!activeArea && activeArea !== previousActiveArea ? 0 : ANIMATION_DURATION, |
986 |
1128 ease: [0.6, 0, 0.4, 1] |
987 |
1129 }; |
988 |
1130 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Fill, { |
989 function ComplementaryAreaSlot(_ref) { |
1131 name: `ComplementaryArea/${scope}`, |
990 let { |
1132 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableAnimatePresence, { |
991 scope, |
1133 initial: false, |
992 ...props |
1134 children: (previousIsActive || isActive) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.div, { |
993 } = _ref; |
1135 variants: variants, |
994 return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Slot, _extends({ |
1136 initial: "closed", |
995 name: `ComplementaryArea/${scope}` |
1137 animate: isMobileViewport ? 'mobileOpen' : 'open', |
996 }, props)); |
1138 exit: "closed", |
997 } |
1139 transition: transition, |
998 |
1140 className: "interface-complementary-area__fill", |
999 function ComplementaryAreaFill(_ref2) { |
1141 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { |
1000 let { |
1142 id: id, |
1001 scope, |
1143 className: className, |
1002 children, |
1144 style: { |
1003 className |
1145 width: isMobileViewport ? '100vw' : SIDEBAR_WIDTH |
1004 } = _ref2; |
1146 }, |
1005 return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Fill, { |
1147 children: children |
1006 name: `ComplementaryArea/${scope}` |
1148 }) |
1007 }, (0,external_wp_element_namespaceObject.createElement)("div", { |
1149 }) |
1008 className: className |
1150 }) |
1009 }, children)); |
1151 }); |
1010 } |
1152 } |
1011 |
|
1012 function useAdjustComplementaryListener(scope, identifier, activeArea, isActive, isSmall) { |
1153 function useAdjustComplementaryListener(scope, identifier, activeArea, isActive, isSmall) { |
1013 const previousIsSmall = (0,external_wp_element_namespaceObject.useRef)(false); |
1154 const previousIsSmall = (0,external_wp_element_namespaceObject.useRef)(false); |
1014 const shouldOpenWhenNotSmall = (0,external_wp_element_namespaceObject.useRef)(false); |
1155 const shouldOpenWhenNotSmall = (0,external_wp_element_namespaceObject.useRef)(false); |
1015 const { |
1156 const { |
1016 enableComplementaryArea, |
1157 enableComplementaryArea, |
1017 disableComplementaryArea |
1158 disableComplementaryArea |
1018 } = (0,external_wp_data_namespaceObject.useDispatch)(store); |
1159 } = (0,external_wp_data_namespaceObject.useDispatch)(store); |
1019 (0,external_wp_element_namespaceObject.useEffect)(() => { |
1160 (0,external_wp_element_namespaceObject.useEffect)(() => { |
1020 // If the complementary area is active and the editor is switching from a big to a small window size. |
1161 // If the complementary area is active and the editor is switching from |
|
1162 // a big to a small window size. |
1021 if (isActive && isSmall && !previousIsSmall.current) { |
1163 if (isActive && isSmall && !previousIsSmall.current) { |
1022 // Disable the complementary area. |
1164 disableComplementaryArea(scope); |
1023 disableComplementaryArea(scope); // Flag the complementary area to be reopened when the window size goes from small to big. |
1165 // Flag the complementary area to be reopened when the window size |
1024 |
1166 // goes from small to big. |
1025 shouldOpenWhenNotSmall.current = true; |
1167 shouldOpenWhenNotSmall.current = true; |
1026 } else if ( // If there is a flag indicating the complementary area should be enabled when we go from small to big window size |
1168 } else if ( |
1027 // and we are going from a small to big window size. |
1169 // If there is a flag indicating the complementary area should be |
|
1170 // enabled when we go from small to big window size and we are going |
|
1171 // from a small to big window size. |
1028 shouldOpenWhenNotSmall.current && !isSmall && previousIsSmall.current) { |
1172 shouldOpenWhenNotSmall.current && !isSmall && previousIsSmall.current) { |
1029 // Remove the flag indicating the complementary area should be enabled. |
1173 // Remove the flag indicating the complementary area should be |
1030 shouldOpenWhenNotSmall.current = false; // Enable the complementary area. |
1174 // enabled. |
1031 |
1175 shouldOpenWhenNotSmall.current = false; |
1032 enableComplementaryArea(scope, identifier); |
1176 enableComplementaryArea(scope, identifier); |
1033 } else if ( // If the flag is indicating the current complementary should be reopened but another complementary area becomes active, |
1177 } else if ( |
1034 // remove the flag. |
1178 // If the flag is indicating the current complementary should be |
|
1179 // reopened but another complementary area becomes active, remove |
|
1180 // the flag. |
1035 shouldOpenWhenNotSmall.current && activeArea && activeArea !== identifier) { |
1181 shouldOpenWhenNotSmall.current && activeArea && activeArea !== identifier) { |
1036 shouldOpenWhenNotSmall.current = false; |
1182 shouldOpenWhenNotSmall.current = false; |
1037 } |
1183 } |
1038 |
|
1039 if (isSmall !== previousIsSmall.current) { |
1184 if (isSmall !== previousIsSmall.current) { |
1040 previousIsSmall.current = isSmall; |
1185 previousIsSmall.current = isSmall; |
1041 } |
1186 } |
1042 }, [isActive, isSmall, scope, identifier, activeArea]); |
1187 }, [isActive, isSmall, scope, identifier, activeArea, disableComplementaryArea, enableComplementaryArea]); |
1043 } |
1188 } |
1044 |
1189 function ComplementaryArea({ |
1045 function ComplementaryArea(_ref3) { |
1190 children, |
1046 let { |
1191 className, |
1047 children, |
1192 closeLabel = (0,external_wp_i18n_namespaceObject.__)('Close plugin'), |
1048 className, |
1193 identifier, |
1049 closeLabel = (0,external_wp_i18n_namespaceObject.__)('Close plugin'), |
1194 header, |
1050 identifier, |
1195 headerClassName, |
1051 header, |
1196 icon, |
1052 headerClassName, |
1197 isPinnable = true, |
1053 icon, |
1198 panelClassName, |
1054 isPinnable = true, |
1199 scope, |
1055 panelClassName, |
1200 name, |
1056 scope, |
1201 smallScreenTitle, |
1057 name, |
1202 title, |
1058 smallScreenTitle, |
1203 toggleShortcut, |
1059 title, |
1204 isActiveByDefault |
1060 toggleShortcut, |
1205 }) { |
1061 isActiveByDefault, |
1206 // This state is used to delay the rendering of the Fill |
1062 showIconLabels = false |
1207 // until the initial effect runs. |
1063 } = _ref3; |
1208 // This prevents the animation from running on mount if |
|
1209 // the complementary area is active by default. |
|
1210 const [isReady, setIsReady] = (0,external_wp_element_namespaceObject.useState)(false); |
1064 const { |
1211 const { |
|
1212 isLoading, |
1065 isActive, |
1213 isActive, |
1066 isPinned, |
1214 isPinned, |
1067 activeArea, |
1215 activeArea, |
1068 isSmall, |
1216 isSmall, |
1069 isLarge |
1217 isLarge, |
|
1218 showIconLabels |
1070 } = (0,external_wp_data_namespaceObject.useSelect)(select => { |
1219 } = (0,external_wp_data_namespaceObject.useSelect)(select => { |
1071 const { |
1220 const { |
1072 getActiveComplementaryArea, |
1221 getActiveComplementaryArea, |
|
1222 isComplementaryAreaLoading, |
1073 isItemPinned |
1223 isItemPinned |
1074 } = select(store); |
1224 } = select(store); |
1075 |
1225 const { |
|
1226 get |
|
1227 } = select(external_wp_preferences_namespaceObject.store); |
1076 const _activeArea = getActiveComplementaryArea(scope); |
1228 const _activeArea = getActiveComplementaryArea(scope); |
1077 |
|
1078 return { |
1229 return { |
|
1230 isLoading: isComplementaryAreaLoading(scope), |
1079 isActive: _activeArea === identifier, |
1231 isActive: _activeArea === identifier, |
1080 isPinned: isItemPinned(scope, identifier), |
1232 isPinned: isItemPinned(scope, identifier), |
1081 activeArea: _activeArea, |
1233 activeArea: _activeArea, |
1082 isSmall: select(external_wp_viewport_namespaceObject.store).isViewportMatch('< medium'), |
1234 isSmall: select(external_wp_viewport_namespaceObject.store).isViewportMatch('< medium'), |
1083 isLarge: select(external_wp_viewport_namespaceObject.store).isViewportMatch('large') |
1235 isLarge: select(external_wp_viewport_namespaceObject.store).isViewportMatch('large'), |
|
1236 showIconLabels: get('core', 'showIconLabels') |
1084 }; |
1237 }; |
1085 }, [identifier, scope]); |
1238 }, [identifier, scope]); |
1086 useAdjustComplementaryListener(scope, identifier, activeArea, isActive, isSmall); |
1239 useAdjustComplementaryListener(scope, identifier, activeArea, isActive, isSmall); |
1087 const { |
1240 const { |
1088 enableComplementaryArea, |
1241 enableComplementaryArea, |
1089 disableComplementaryArea, |
1242 disableComplementaryArea, |
1090 pinItem, |
1243 pinItem, |
1091 unpinItem |
1244 unpinItem |
1092 } = (0,external_wp_data_namespaceObject.useDispatch)(store); |
1245 } = (0,external_wp_data_namespaceObject.useDispatch)(store); |
1093 (0,external_wp_element_namespaceObject.useEffect)(() => { |
1246 (0,external_wp_element_namespaceObject.useEffect)(() => { |
|
1247 // Set initial visibility: For large screens, enable if it's active by |
|
1248 // default. For small screens, always initially disable. |
1094 if (isActiveByDefault && activeArea === undefined && !isSmall) { |
1249 if (isActiveByDefault && activeArea === undefined && !isSmall) { |
1095 enableComplementaryArea(scope, identifier); |
1250 enableComplementaryArea(scope, identifier); |
|
1251 } else if (activeArea === undefined && isSmall) { |
|
1252 disableComplementaryArea(scope, identifier); |
1096 } |
1253 } |
1097 }, [activeArea, isActiveByDefault, scope, identifier, isSmall]); |
1254 setIsReady(true); |
1098 return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, isPinnable && (0,external_wp_element_namespaceObject.createElement)(pinned_items, { |
1255 }, [activeArea, isActiveByDefault, scope, identifier, isSmall, enableComplementaryArea, disableComplementaryArea]); |
1099 scope: scope |
1256 if (!isReady) { |
1100 }, isPinned && (0,external_wp_element_namespaceObject.createElement)(complementary_area_toggle, { |
1257 return; |
1101 scope: scope, |
1258 } |
1102 identifier: identifier, |
1259 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
1103 isPressed: isActive && (!showIconLabels || isLarge), |
1260 children: [isPinnable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(pinned_items, { |
1104 "aria-expanded": isActive, |
1261 scope: scope, |
1105 label: title, |
1262 children: isPinned && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(complementary_area_toggle, { |
1106 icon: showIconLabels ? library_check : icon, |
1263 scope: scope, |
1107 showTooltip: !showIconLabels, |
1264 identifier: identifier, |
1108 variant: showIconLabels ? 'tertiary' : undefined |
1265 isPressed: isActive && (!showIconLabels || isLarge), |
1109 })), name && isPinnable && (0,external_wp_element_namespaceObject.createElement)(ComplementaryAreaMoreMenuItem, { |
1266 "aria-expanded": isActive, |
1110 target: name, |
1267 "aria-disabled": isLoading, |
1111 scope: scope, |
1268 label: title, |
1112 icon: icon |
1269 icon: showIconLabels ? library_check : icon, |
1113 }, title), isActive && (0,external_wp_element_namespaceObject.createElement)(ComplementaryAreaFill, { |
1270 showTooltip: !showIconLabels, |
1114 className: classnames_default()('interface-complementary-area', className), |
1271 variant: showIconLabels ? 'tertiary' : undefined, |
1115 scope: scope |
1272 size: "compact" |
1116 }, (0,external_wp_element_namespaceObject.createElement)(complementary_area_header, { |
1273 }) |
1117 className: headerClassName, |
1274 }), name && isPinnable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ComplementaryAreaMoreMenuItem, { |
1118 closeLabel: closeLabel, |
1275 target: name, |
1119 onClose: () => disableComplementaryArea(scope), |
1276 scope: scope, |
1120 smallScreenTitle: smallScreenTitle, |
1277 icon: icon, |
1121 toggleButtonProps: { |
1278 children: title |
1122 label: closeLabel, |
1279 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(ComplementaryAreaFill, { |
1123 shortcut: toggleShortcut, |
1280 activeArea: activeArea, |
1124 scope, |
1281 isActive: isActive, |
1125 identifier |
1282 className: dist_clsx('interface-complementary-area', className), |
1126 } |
1283 scope: scope, |
1127 }, header || (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("strong", null, title), isPinnable && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { |
1284 id: identifier.replace('/', ':'), |
1128 className: "interface-complementary-area__pin-unpin-item", |
1285 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(complementary_area_header, { |
1129 icon: isPinned ? star_filled : star_empty, |
1286 className: headerClassName, |
1130 label: isPinned ? (0,external_wp_i18n_namespaceObject.__)('Unpin from toolbar') : (0,external_wp_i18n_namespaceObject.__)('Pin to toolbar'), |
1287 closeLabel: closeLabel, |
1131 onClick: () => (isPinned ? unpinItem : pinItem)(scope, identifier), |
1288 onClose: () => disableComplementaryArea(scope), |
1132 isPressed: isPinned, |
1289 smallScreenTitle: smallScreenTitle, |
1133 "aria-expanded": isPinned |
1290 toggleButtonProps: { |
1134 }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Panel, { |
1291 label: closeLabel, |
1135 className: panelClassName |
1292 size: 'small', |
1136 }, children))); |
1293 shortcut: toggleShortcut, |
1137 } |
1294 scope, |
1138 |
1295 identifier |
|
1296 }, |
|
1297 children: header || /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
|
1298 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { |
|
1299 className: "interface-complementary-area-header__title", |
|
1300 children: title |
|
1301 }), isPinnable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { |
|
1302 className: "interface-complementary-area__pin-unpin-item", |
|
1303 icon: isPinned ? star_filled : star_empty, |
|
1304 label: isPinned ? (0,external_wp_i18n_namespaceObject.__)('Unpin from toolbar') : (0,external_wp_i18n_namespaceObject.__)('Pin to toolbar'), |
|
1305 onClick: () => (isPinned ? unpinItem : pinItem)(scope, identifier), |
|
1306 isPressed: isPinned, |
|
1307 "aria-expanded": isPinned, |
|
1308 size: "compact" |
|
1309 })] |
|
1310 }) |
|
1311 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Panel, { |
|
1312 className: panelClassName, |
|
1313 children: children |
|
1314 })] |
|
1315 })] |
|
1316 }); |
|
1317 } |
1139 const ComplementaryAreaWrapped = complementary_area_context(ComplementaryArea); |
1318 const ComplementaryAreaWrapped = complementary_area_context(ComplementaryArea); |
1140 ComplementaryAreaWrapped.Slot = ComplementaryAreaSlot; |
1319 ComplementaryAreaWrapped.Slot = ComplementaryAreaSlot; |
1141 /* harmony default export */ var complementary_area = (ComplementaryAreaWrapped); |
1320 /* harmony default export */ const complementary_area = (ComplementaryAreaWrapped); |
1142 |
1321 |
1143 ;// CONCATENATED MODULE: external ["wp","compose"] |
1322 ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/navigable-region/index.js |
1144 var external_wp_compose_namespaceObject = window["wp"]["compose"]; |
1323 /** |
|
1324 * External dependencies |
|
1325 */ |
|
1326 |
|
1327 |
|
1328 function NavigableRegion({ |
|
1329 children, |
|
1330 className, |
|
1331 ariaLabel, |
|
1332 as: Tag = 'div', |
|
1333 ...props |
|
1334 }) { |
|
1335 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { |
|
1336 className: dist_clsx('interface-navigable-region', className), |
|
1337 "aria-label": ariaLabel, |
|
1338 role: "region", |
|
1339 tabIndex: "-1", |
|
1340 ...props, |
|
1341 children: children |
|
1342 }); |
|
1343 } |
|
1344 |
1145 ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/interface-skeleton/index.js |
1345 ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/interface-skeleton/index.js |
1146 |
|
1147 |
|
1148 |
|
1149 /** |
1346 /** |
1150 * External dependencies |
1347 * External dependencies |
1151 */ |
1348 */ |
1152 |
1349 |
1153 /** |
1350 |
1154 * WordPress dependencies |
1351 /** |
1155 */ |
1352 * WordPress dependencies |
1156 |
1353 */ |
1157 /** |
1354 |
1158 * WordPress dependencies |
1355 |
1159 */ |
1356 |
1160 |
1357 |
1161 |
1358 |
1162 |
1359 /** |
1163 |
1360 * Internal dependencies |
1164 |
1361 */ |
1165 |
1362 |
|
1363 |
|
1364 |
|
1365 const interface_skeleton_ANIMATION_DURATION = 0.25; |
|
1366 const commonTransition = { |
|
1367 type: 'tween', |
|
1368 duration: interface_skeleton_ANIMATION_DURATION, |
|
1369 ease: [0.6, 0, 0.4, 1] |
|
1370 }; |
1166 function useHTMLClass(className) { |
1371 function useHTMLClass(className) { |
1167 (0,external_wp_element_namespaceObject.useEffect)(() => { |
1372 (0,external_wp_element_namespaceObject.useEffect)(() => { |
1168 const element = document && document.querySelector(`html:not(.${className})`); |
1373 const element = document && document.querySelector(`html:not(.${className})`); |
1169 |
|
1170 if (!element) { |
1374 if (!element) { |
1171 return; |
1375 return; |
1172 } |
1376 } |
1173 |
|
1174 element.classList.toggle(className); |
1377 element.classList.toggle(className); |
1175 return () => { |
1378 return () => { |
1176 element.classList.toggle(className); |
1379 element.classList.toggle(className); |
1177 }; |
1380 }; |
1178 }, [className]); |
1381 }, [className]); |
1179 } |
1382 } |
1180 |
1383 const headerVariants = { |
1181 function InterfaceSkeleton(_ref, ref) { |
1384 hidden: { |
1182 let { |
1385 opacity: 1, |
1183 footer, |
1386 marginTop: -60 |
1184 header, |
1387 }, |
1185 sidebar, |
1388 visible: { |
1186 secondarySidebar, |
1389 opacity: 1, |
1187 notices, |
1390 marginTop: 0 |
1188 content, |
1391 }, |
1189 drawer, |
1392 distractionFreeHover: { |
1190 actions, |
1393 opacity: 1, |
1191 labels, |
1394 marginTop: 0, |
1192 className, |
1395 transition: { |
1193 shortcuts |
1396 ...commonTransition, |
1194 } = _ref; |
1397 delay: 0.2, |
|
1398 delayChildren: 0.2 |
|
1399 } |
|
1400 }, |
|
1401 distractionFreeHidden: { |
|
1402 opacity: 0, |
|
1403 marginTop: -60 |
|
1404 }, |
|
1405 distractionFreeDisabled: { |
|
1406 opacity: 0, |
|
1407 marginTop: 0, |
|
1408 transition: { |
|
1409 ...commonTransition, |
|
1410 delay: 0.8, |
|
1411 delayChildren: 0.8 |
|
1412 } |
|
1413 } |
|
1414 }; |
|
1415 function InterfaceSkeleton({ |
|
1416 isDistractionFree, |
|
1417 footer, |
|
1418 header, |
|
1419 editorNotices, |
|
1420 sidebar, |
|
1421 secondarySidebar, |
|
1422 content, |
|
1423 actions, |
|
1424 labels, |
|
1425 className, |
|
1426 enableRegionNavigation = true, |
|
1427 // Todo: does this need to be a prop. |
|
1428 // Can we use a dependency to keyboard-shortcuts directly? |
|
1429 shortcuts |
|
1430 }, ref) { |
|
1431 const [secondarySidebarResizeListener, secondarySidebarSize] = (0,external_wp_compose_namespaceObject.useResizeObserver)(); |
|
1432 const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); |
|
1433 const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); |
|
1434 const defaultTransition = { |
|
1435 type: 'tween', |
|
1436 duration: disableMotion ? 0 : interface_skeleton_ANIMATION_DURATION, |
|
1437 ease: [0.6, 0, 0.4, 1] |
|
1438 }; |
1195 const navigateRegionsProps = (0,external_wp_components_namespaceObject.__unstableUseNavigateRegions)(shortcuts); |
1439 const navigateRegionsProps = (0,external_wp_components_namespaceObject.__unstableUseNavigateRegions)(shortcuts); |
1196 useHTMLClass('interface-interface-skeleton__html-container'); |
1440 useHTMLClass('interface-interface-skeleton__html-container'); |
1197 const defaultLabels = { |
1441 const defaultLabels = { |
1198 /* translators: accessibility text for the nav bar landmark region. */ |
|
1199 drawer: (0,external_wp_i18n_namespaceObject.__)('Drawer'), |
|
1200 |
|
1201 /* translators: accessibility text for the top bar landmark region. */ |
1442 /* translators: accessibility text for the top bar landmark region. */ |
1202 header: (0,external_wp_i18n_namespaceObject.__)('Header'), |
1443 header: (0,external_wp_i18n_namespaceObject._x)('Header', 'header landmark area'), |
1203 |
|
1204 /* translators: accessibility text for the content landmark region. */ |
1444 /* translators: accessibility text for the content landmark region. */ |
1205 body: (0,external_wp_i18n_namespaceObject.__)('Content'), |
1445 body: (0,external_wp_i18n_namespaceObject.__)('Content'), |
1206 |
|
1207 /* translators: accessibility text for the secondary sidebar landmark region. */ |
1446 /* translators: accessibility text for the secondary sidebar landmark region. */ |
1208 secondarySidebar: (0,external_wp_i18n_namespaceObject.__)('Block Library'), |
1447 secondarySidebar: (0,external_wp_i18n_namespaceObject.__)('Block Library'), |
1209 |
|
1210 /* translators: accessibility text for the settings landmark region. */ |
1448 /* translators: accessibility text for the settings landmark region. */ |
1211 sidebar: (0,external_wp_i18n_namespaceObject.__)('Settings'), |
1449 sidebar: (0,external_wp_i18n_namespaceObject.__)('Settings'), |
1212 |
|
1213 /* translators: accessibility text for the publish landmark region. */ |
1450 /* translators: accessibility text for the publish landmark region. */ |
1214 actions: (0,external_wp_i18n_namespaceObject.__)('Publish'), |
1451 actions: (0,external_wp_i18n_namespaceObject.__)('Publish'), |
1215 |
|
1216 /* translators: accessibility text for the footer landmark region. */ |
1452 /* translators: accessibility text for the footer landmark region. */ |
1217 footer: (0,external_wp_i18n_namespaceObject.__)('Footer') |
1453 footer: (0,external_wp_i18n_namespaceObject.__)('Footer') |
1218 }; |
1454 }; |
1219 const mergedLabels = { ...defaultLabels, |
1455 const mergedLabels = { |
|
1456 ...defaultLabels, |
1220 ...labels |
1457 ...labels |
1221 }; |
1458 }; |
1222 return (0,external_wp_element_namespaceObject.createElement)("div", _extends({}, navigateRegionsProps, { |
1459 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { |
1223 ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, navigateRegionsProps.ref]), |
1460 ...(enableRegionNavigation ? navigateRegionsProps : {}), |
1224 className: classnames_default()(className, 'interface-interface-skeleton', navigateRegionsProps.className, !!footer && 'has-footer') |
1461 ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, enableRegionNavigation ? navigateRegionsProps.ref : undefined]), |
1225 }), !!drawer && (0,external_wp_element_namespaceObject.createElement)("div", { |
1462 className: dist_clsx(className, 'interface-interface-skeleton', navigateRegionsProps.className, !!footer && 'has-footer'), |
1226 className: "interface-interface-skeleton__drawer", |
1463 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { |
1227 role: "region", |
1464 className: "interface-interface-skeleton__editor", |
1228 "aria-label": mergedLabels.drawer, |
1465 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableAnimatePresence, { |
1229 tabIndex: "-1" |
1466 initial: false, |
1230 }, drawer), (0,external_wp_element_namespaceObject.createElement)("div", { |
1467 children: !!header && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigableRegion, { |
1231 className: "interface-interface-skeleton__editor" |
1468 as: external_wp_components_namespaceObject.__unstableMotion.div, |
1232 }, !!header && (0,external_wp_element_namespaceObject.createElement)("div", { |
1469 className: "interface-interface-skeleton__header", |
1233 className: "interface-interface-skeleton__header", |
1470 "aria-label": mergedLabels.header, |
1234 role: "region", |
1471 initial: isDistractionFree ? 'distractionFreeHidden' : 'hidden', |
1235 "aria-label": mergedLabels.header, |
1472 whileHover: isDistractionFree ? 'distractionFreeHover' : 'visible', |
1236 tabIndex: "-1" |
1473 animate: isDistractionFree ? 'distractionFreeDisabled' : 'visible', |
1237 }, header), (0,external_wp_element_namespaceObject.createElement)("div", { |
1474 exit: isDistractionFree ? 'distractionFreeHidden' : 'hidden', |
1238 className: "interface-interface-skeleton__body" |
1475 variants: headerVariants, |
1239 }, !!secondarySidebar && (0,external_wp_element_namespaceObject.createElement)("div", { |
1476 transition: defaultTransition, |
1240 className: "interface-interface-skeleton__secondary-sidebar", |
1477 children: header |
1241 role: "region", |
1478 }) |
1242 "aria-label": mergedLabels.secondarySidebar, |
1479 }), isDistractionFree && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { |
1243 tabIndex: "-1" |
1480 className: "interface-interface-skeleton__header", |
1244 }, secondarySidebar), !!notices && (0,external_wp_element_namespaceObject.createElement)("div", { |
1481 children: editorNotices |
1245 className: "interface-interface-skeleton__notices" |
1482 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { |
1246 }, notices), (0,external_wp_element_namespaceObject.createElement)("div", { |
1483 className: "interface-interface-skeleton__body", |
1247 className: "interface-interface-skeleton__content", |
1484 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableAnimatePresence, { |
1248 role: "region", |
1485 initial: false, |
1249 "aria-label": mergedLabels.body, |
1486 children: !!secondarySidebar && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigableRegion, { |
1250 tabIndex: "-1" |
1487 className: "interface-interface-skeleton__secondary-sidebar", |
1251 }, content), !!sidebar && (0,external_wp_element_namespaceObject.createElement)("div", { |
1488 ariaLabel: mergedLabels.secondarySidebar, |
1252 className: "interface-interface-skeleton__sidebar", |
1489 as: external_wp_components_namespaceObject.__unstableMotion.div, |
1253 role: "region", |
1490 initial: "closed", |
1254 "aria-label": mergedLabels.sidebar, |
1491 animate: isMobileViewport ? 'mobileOpen' : 'open', |
1255 tabIndex: "-1" |
1492 exit: "closed", |
1256 }, sidebar), !!actions && (0,external_wp_element_namespaceObject.createElement)("div", { |
1493 variants: { |
1257 className: "interface-interface-skeleton__actions", |
1494 open: { |
1258 role: "region", |
1495 width: secondarySidebarSize.width |
1259 "aria-label": mergedLabels.actions, |
1496 }, |
1260 tabIndex: "-1" |
1497 closed: { |
1261 }, actions))), !!footer && (0,external_wp_element_namespaceObject.createElement)("div", { |
1498 width: 0 |
1262 className: "interface-interface-skeleton__footer", |
1499 }, |
1263 role: "region", |
1500 mobileOpen: { |
1264 "aria-label": mergedLabels.footer, |
1501 width: '100vw' |
1265 tabIndex: "-1" |
1502 } |
1266 }, footer)); |
1503 }, |
1267 } |
1504 transition: defaultTransition, |
1268 |
1505 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { |
1269 /* harmony default export */ var interface_skeleton = ((0,external_wp_element_namespaceObject.forwardRef)(InterfaceSkeleton)); |
1506 style: { |
1270 |
1507 position: 'absolute', |
1271 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/more-vertical.js |
1508 width: isMobileViewport ? '100vw' : 'fit-content', |
1272 |
1509 height: '100%', |
1273 |
1510 right: 0 |
1274 /** |
1511 }, |
1275 * WordPress dependencies |
1512 children: [secondarySidebarResizeListener, secondarySidebar] |
1276 */ |
1513 }) |
1277 |
1514 }) |
1278 const moreVertical = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { |
1515 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigableRegion, { |
1279 xmlns: "http://www.w3.org/2000/svg", |
1516 className: "interface-interface-skeleton__content", |
1280 viewBox: "0 0 24 24" |
1517 ariaLabel: mergedLabels.body, |
1281 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { |
1518 children: content |
1282 d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" |
1519 }), !!sidebar && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigableRegion, { |
1283 })); |
1520 className: "interface-interface-skeleton__sidebar", |
1284 /* harmony default export */ var more_vertical = (moreVertical); |
1521 ariaLabel: mergedLabels.sidebar, |
1285 |
1522 children: sidebar |
1286 ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/more-menu-dropdown/index.js |
1523 }), !!actions && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigableRegion, { |
1287 |
1524 className: "interface-interface-skeleton__actions", |
1288 |
1525 ariaLabel: mergedLabels.actions, |
1289 /** |
1526 children: actions |
1290 * External dependencies |
1527 })] |
1291 */ |
1528 })] |
1292 |
1529 }), !!footer && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigableRegion, { |
1293 /** |
1530 className: "interface-interface-skeleton__footer", |
1294 * WordPress dependencies |
1531 ariaLabel: mergedLabels.footer, |
1295 */ |
1532 children: footer |
1296 |
1533 })] |
1297 |
1534 }); |
1298 |
1535 } |
1299 |
1536 /* harmony default export */ const interface_skeleton = ((0,external_wp_element_namespaceObject.forwardRef)(InterfaceSkeleton)); |
1300 function MoreMenuDropdown(_ref) { |
|
1301 let { |
|
1302 as: DropdownComponent = external_wp_components_namespaceObject.DropdownMenu, |
|
1303 className, |
|
1304 |
|
1305 /* translators: button label text should, if possible, be under 16 characters. */ |
|
1306 label = (0,external_wp_i18n_namespaceObject.__)('Options'), |
|
1307 popoverProps, |
|
1308 toggleProps, |
|
1309 children |
|
1310 } = _ref; |
|
1311 return (0,external_wp_element_namespaceObject.createElement)(DropdownComponent, { |
|
1312 className: classnames_default()('interface-more-menu-dropdown', className), |
|
1313 icon: more_vertical, |
|
1314 label: label, |
|
1315 popoverProps: { |
|
1316 position: 'bottom left', |
|
1317 ...popoverProps, |
|
1318 className: classnames_default()('interface-more-menu-dropdown__content', popoverProps === null || popoverProps === void 0 ? void 0 : popoverProps.className) |
|
1319 }, |
|
1320 toggleProps: { |
|
1321 tooltipPosition: 'bottom', |
|
1322 ...toggleProps |
|
1323 } |
|
1324 }, onClose => children(onClose)); |
|
1325 } |
|
1326 |
1537 |
1327 ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/index.js |
1538 ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/index.js |
1328 |
1539 |
1329 |
1540 |
1330 |
1541 |
1331 |
1542 |
1332 |
1543 |
1333 |
1544 |
1334 |
1545 |
1335 |
1546 |
1336 |
|
1337 |
|
1338 |
|
1339 |
|
1340 |
|
1341 ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/index.js |
1547 ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/index.js |
1342 |
1548 |
1343 |
1549 |
1344 |
1550 |
1345 ;// CONCATENATED MODULE: external ["wp","blockEditor"] |
1551 ;// CONCATENATED MODULE: external ["wp","blockEditor"] |
1346 var external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"]; |
1552 const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"]; |
1347 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/store/transformers.js |
1553 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/store/transformers.js |
1348 /** |
1554 /** |
1349 * WordPress dependencies |
1555 * WordPress dependencies |
1350 */ |
1556 */ |
|
1557 |
1351 |
1558 |
1352 |
1559 |
1353 /** |
1560 /** |
1354 * Converts a widget entity record into a block. |
1561 * Converts a widget entity record into a block. |
1355 * |
1562 * |
1356 * @param {Object} widget The widget entity record. |
1563 * @param {Object} widget The widget entity record. |
1357 * @return {Object} a block (converted from the entity record). |
1564 * @return {Object} a block (converted from the entity record). |
1358 */ |
1565 */ |
1359 |
|
1360 function transformWidgetToBlock(widget) { |
1566 function transformWidgetToBlock(widget) { |
1361 if (widget.id_base === 'block') { |
1567 if (widget.id_base === 'block') { |
1362 const parsedBlocks = (0,external_wp_blocks_namespaceObject.parse)(widget.instance.raw.content); |
1568 const parsedBlocks = (0,external_wp_blocks_namespaceObject.parse)(widget.instance.raw.content, { |
1363 |
1569 __unstableSkipAutop: true |
|
1570 }); |
1364 if (!parsedBlocks.length) { |
1571 if (!parsedBlocks.length) { |
1365 return (0,external_wp_widgets_namespaceObject.addWidgetIdToBlock)((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {}, []), widget.id); |
1572 return (0,external_wp_widgets_namespaceObject.addWidgetIdToBlock)((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {}, []), widget.id); |
1366 } |
1573 } |
1367 |
|
1368 return (0,external_wp_widgets_namespaceObject.addWidgetIdToBlock)(parsedBlocks[0], widget.id); |
1574 return (0,external_wp_widgets_namespaceObject.addWidgetIdToBlock)(parsedBlocks[0], widget.id); |
1369 } |
1575 } |
1370 |
|
1371 let attributes; |
1576 let attributes; |
1372 |
|
1373 if (widget._embedded.about[0].is_multi) { |
1577 if (widget._embedded.about[0].is_multi) { |
1374 attributes = { |
1578 attributes = { |
1375 idBase: widget.id_base, |
1579 idBase: widget.id_base, |
1376 instance: widget.instance |
1580 instance: widget.instance |
1377 }; |
1581 }; |
1378 } else { |
1582 } else { |
1379 attributes = { |
1583 attributes = { |
1380 id: widget.id |
1584 id: widget.id |
1381 }; |
1585 }; |
1382 } |
1586 } |
1383 |
|
1384 return (0,external_wp_widgets_namespaceObject.addWidgetIdToBlock)((0,external_wp_blocks_namespaceObject.createBlock)('core/legacy-widget', attributes, []), widget.id); |
1587 return (0,external_wp_widgets_namespaceObject.addWidgetIdToBlock)((0,external_wp_blocks_namespaceObject.createBlock)('core/legacy-widget', attributes, []), widget.id); |
1385 } |
1588 } |
|
1589 |
1386 /** |
1590 /** |
1387 * Converts a block to a widget entity record. |
1591 * Converts a block to a widget entity record. |
1388 * |
1592 * |
1389 * @param {Object} block The block. |
1593 * @param {Object} block The block. |
1390 * @param {Object?} relatedWidget A related widget entity record from the API (optional). |
1594 * @param {Object?} relatedWidget A related widget entity record from the API (optional). |
1391 * @return {Object} the widget object (converted from block). |
1595 * @return {Object} the widget object (converted from block). |
1392 */ |
1596 */ |
1393 |
1597 function transformBlockToWidget(block, relatedWidget = {}) { |
1394 function transformBlockToWidget(block) { |
|
1395 let relatedWidget = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; |
|
1396 let widget; |
1598 let widget; |
1397 const isValidLegacyWidgetBlock = block.name === 'core/legacy-widget' && (block.attributes.id || block.attributes.instance); |
1599 const isValidLegacyWidgetBlock = block.name === 'core/legacy-widget' && (block.attributes.id || block.attributes.instance); |
1398 |
|
1399 if (isValidLegacyWidgetBlock) { |
1600 if (isValidLegacyWidgetBlock) { |
1400 var _block$attributes$id, _block$attributes$idB, _block$attributes$ins; |
1601 var _block$attributes$id, _block$attributes$idB, _block$attributes$ins; |
1401 |
1602 widget = { |
1402 widget = { ...relatedWidget, |
1603 ...relatedWidget, |
1403 id: (_block$attributes$id = block.attributes.id) !== null && _block$attributes$id !== void 0 ? _block$attributes$id : relatedWidget.id, |
1604 id: (_block$attributes$id = block.attributes.id) !== null && _block$attributes$id !== void 0 ? _block$attributes$id : relatedWidget.id, |
1404 id_base: (_block$attributes$idB = block.attributes.idBase) !== null && _block$attributes$idB !== void 0 ? _block$attributes$idB : relatedWidget.id_base, |
1605 id_base: (_block$attributes$idB = block.attributes.idBase) !== null && _block$attributes$idB !== void 0 ? _block$attributes$idB : relatedWidget.id_base, |
1405 instance: (_block$attributes$ins = block.attributes.instance) !== null && _block$attributes$ins !== void 0 ? _block$attributes$ins : relatedWidget.instance |
1606 instance: (_block$attributes$ins = block.attributes.instance) !== null && _block$attributes$ins !== void 0 ? _block$attributes$ins : relatedWidget.instance |
1406 }; |
1607 }; |
1407 } else { |
1608 } else { |
1408 widget = { ...relatedWidget, |
1609 widget = { |
|
1610 ...relatedWidget, |
1409 id_base: 'block', |
1611 id_base: 'block', |
1410 instance: { |
1612 instance: { |
1411 raw: { |
1613 raw: { |
1412 content: (0,external_wp_blocks_namespaceObject.serialize)(block) |
1614 content: (0,external_wp_blocks_namespaceObject.serialize)(block) |
1413 } |
1615 } |
1414 } |
1616 } |
1415 }; |
1617 }; |
1416 } // Delete read-only properties. |
1618 } |
1417 |
1619 |
1418 |
1620 // Delete read-only properties. |
1419 delete widget.rendered; |
1621 delete widget.rendered; |
1420 delete widget.rendered_form; |
1622 delete widget.rendered_form; |
1421 return widget; |
1623 return widget; |
1422 } |
1624 } |
1423 |
1625 |
1529 * |
1732 * |
1530 * @param {string} id Post ID. |
1733 * @param {string} id Post ID. |
1531 * @param {Array} blocks Blocks the post should consist of. |
1734 * @param {Array} blocks Blocks the post should consist of. |
1532 * @return {Object} The post object. |
1735 * @return {Object} The post object. |
1533 */ |
1736 */ |
1534 |
1737 const persistStubPost = (id, blocks) => ({ |
1535 const persistStubPost = (id, blocks) => _ref => { |
1738 registry |
1536 let { |
1739 }) => { |
1537 registry |
|
1538 } = _ref; |
|
1539 const stubPost = createStubPost(id, blocks); |
1740 const stubPost = createStubPost(id, blocks); |
1540 registry.dispatch(external_wp_coreData_namespaceObject.store).receiveEntityRecords(KIND, POST_TYPE, stubPost, { |
1741 registry.dispatch(external_wp_coreData_namespaceObject.store).receiveEntityRecords(KIND, POST_TYPE, stubPost, { |
1541 id: stubPost.id |
1742 id: stubPost.id |
1542 }, false); |
1743 }, false); |
1543 return stubPost; |
1744 return stubPost; |
1544 }; |
1745 }; |
|
1746 |
1545 /** |
1747 /** |
1546 * Converts all the blocks from edited widget areas into widgets, |
1748 * Converts all the blocks from edited widget areas into widgets, |
1547 * and submits a batch request to save everything at once. |
1749 * and submits a batch request to save everything at once. |
1548 * |
1750 * |
1549 * Creates a snackbar notice on either success or error. |
1751 * Creates a snackbar notice on either success or error. |
1550 * |
1752 * |
1551 * @return {Function} An action creator. |
1753 * @return {Function} An action creator. |
1552 */ |
1754 */ |
1553 |
1755 const saveEditedWidgetAreas = () => async ({ |
1554 const saveEditedWidgetAreas = () => async _ref2 => { |
1756 select, |
1555 let { |
1757 dispatch, |
1556 select, |
1758 registry |
1557 dispatch, |
1759 }) => { |
1558 registry |
|
1559 } = _ref2; |
|
1560 const editedWidgetAreas = select.getEditedWidgetAreas(); |
1760 const editedWidgetAreas = select.getEditedWidgetAreas(); |
1561 |
1761 if (!editedWidgetAreas?.length) { |
1562 if (!(editedWidgetAreas !== null && editedWidgetAreas !== void 0 && editedWidgetAreas.length)) { |
|
1563 return; |
1762 return; |
1564 } |
1763 } |
1565 |
|
1566 try { |
1764 try { |
1567 await dispatch.saveWidgetAreas(editedWidgetAreas); |
1765 await dispatch.saveWidgetAreas(editedWidgetAreas); |
1568 registry.dispatch(external_wp_notices_namespaceObject.store).createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Widgets saved.'), { |
1766 registry.dispatch(external_wp_notices_namespaceObject.store).createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Widgets saved.'), { |
1569 type: 'snackbar' |
1767 type: 'snackbar' |
1570 }); |
1768 }); |
1571 } catch (e) { |
1769 } catch (e) { |
1572 registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice( |
1770 registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice( /* translators: %s: The error message. */ |
1573 /* translators: %s: The error message. */ |
|
1574 (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('There was an error. %s'), e.message), { |
1771 (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('There was an error. %s'), e.message), { |
1575 type: 'snackbar' |
1772 type: 'snackbar' |
1576 }); |
1773 }); |
1577 } |
1774 } |
1578 }; |
1775 }; |
|
1776 |
1579 /** |
1777 /** |
1580 * Converts all the blocks from specified widget areas into widgets, |
1778 * Converts all the blocks from specified widget areas into widgets, |
1581 * and submits a batch request to save everything at once. |
1779 * and submits a batch request to save everything at once. |
1582 * |
1780 * |
1583 * @param {Object[]} widgetAreas Widget areas to save. |
1781 * @param {Object[]} widgetAreas Widget areas to save. |
1584 * @return {Function} An action creator. |
1782 * @return {Function} An action creator. |
1585 */ |
1783 */ |
1586 |
1784 const saveWidgetAreas = widgetAreas => async ({ |
1587 const saveWidgetAreas = widgetAreas => async _ref3 => { |
1785 dispatch, |
1588 let { |
1786 registry |
1589 dispatch, |
1787 }) => { |
1590 registry |
|
1591 } = _ref3; |
|
1592 |
|
1593 try { |
1788 try { |
1594 for (const widgetArea of widgetAreas) { |
1789 for (const widgetArea of widgetAreas) { |
1595 await dispatch.saveWidgetArea(widgetArea.id); |
1790 await dispatch.saveWidgetArea(widgetArea.id); |
1596 } |
1791 } |
1597 } finally { |
1792 } finally { |
1598 // saveEditedEntityRecord resets the resolution status, let's fix it manually. |
1793 // saveEditedEntityRecord resets the resolution status, let's fix it manually. |
1599 await registry.dispatch(external_wp_coreData_namespaceObject.store).finishResolution('getEntityRecord', KIND, WIDGET_AREA_ENTITY_TYPE, buildWidgetAreasQuery()); |
1794 await registry.dispatch(external_wp_coreData_namespaceObject.store).finishResolution('getEntityRecord', KIND, WIDGET_AREA_ENTITY_TYPE, buildWidgetAreasQuery()); |
1600 } |
1795 } |
1601 }; |
1796 }; |
|
1797 |
1602 /** |
1798 /** |
1603 * Converts all the blocks from a widget area specified by ID into widgets, |
1799 * Converts all the blocks from a widget area specified by ID into widgets, |
1604 * and submits a batch request to save everything at once. |
1800 * and submits a batch request to save everything at once. |
1605 * |
1801 * |
1606 * @param {string} widgetAreaId ID of the widget area to process. |
1802 * @param {string} widgetAreaId ID of the widget area to process. |
1607 * @return {Function} An action creator. |
1803 * @return {Function} An action creator. |
1608 */ |
1804 */ |
1609 |
1805 const saveWidgetArea = widgetAreaId => async ({ |
1610 const saveWidgetArea = widgetAreaId => async _ref4 => { |
1806 dispatch, |
1611 let { |
1807 select, |
1612 dispatch, |
1808 registry |
1613 select, |
1809 }) => { |
1614 registry |
|
1615 } = _ref4; |
|
1616 const widgets = select.getWidgets(); |
1810 const widgets = select.getWidgets(); |
1617 const post = registry.select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord(KIND, POST_TYPE, buildWidgetAreaPostId(widgetAreaId)); // Get all widgets from this area |
1811 const post = registry.select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord(KIND, POST_TYPE, buildWidgetAreaPostId(widgetAreaId)); |
1618 |
1812 |
1619 const areaWidgets = Object.values(widgets).filter(_ref5 => { |
1813 // Get all widgets from this area |
1620 let { |
1814 const areaWidgets = Object.values(widgets).filter(({ |
1621 sidebar |
1815 sidebar |
1622 } = _ref5; |
1816 }) => sidebar === widgetAreaId); |
1623 return sidebar === widgetAreaId; |
1817 |
1624 }); // Remove all duplicate reference widget instances for legacy widgets. |
1818 // Remove all duplicate reference widget instances for legacy widgets. |
1625 // Why? We filter out the widgets with duplicate IDs to prevent adding more than one instance of a widget |
1819 // Why? We filter out the widgets with duplicate IDs to prevent adding more than one instance of a widget |
1626 // implemented using a function. WordPress doesn't support having more than one instance of these, if you try to |
1820 // implemented using a function. WordPress doesn't support having more than one instance of these, if you try to |
1627 // save multiple instances of these in different sidebars you will run into undefined behaviors. |
1821 // save multiple instances of these in different sidebars you will run into undefined behaviors. |
1628 |
|
1629 const usedReferenceWidgets = []; |
1822 const usedReferenceWidgets = []; |
1630 const widgetsBlocks = post.blocks.filter(block => { |
1823 const widgetsBlocks = post.blocks.filter(block => { |
1631 const { |
1824 const { |
1632 id |
1825 id |
1633 } = block.attributes; |
1826 } = block.attributes; |
1634 |
|
1635 if (block.name === 'core/legacy-widget' && id) { |
1827 if (block.name === 'core/legacy-widget' && id) { |
1636 if (usedReferenceWidgets.includes(id)) { |
1828 if (usedReferenceWidgets.includes(id)) { |
1637 return false; |
1829 return false; |
1638 } |
1830 } |
1639 |
|
1640 usedReferenceWidgets.push(id); |
1831 usedReferenceWidgets.push(id); |
1641 } |
1832 } |
1642 |
|
1643 return true; |
1833 return true; |
1644 }); // Determine which widgets have been deleted. We can tell if a widget is |
1834 }); |
|
1835 |
|
1836 // Determine which widgets have been deleted. We can tell if a widget is |
1645 // deleted and not just moved to a different area by looking to see if |
1837 // deleted and not just moved to a different area by looking to see if |
1646 // getWidgetAreaForWidgetId() finds something. |
1838 // getWidgetAreaForWidgetId() finds something. |
1647 |
|
1648 const deletedWidgets = []; |
1839 const deletedWidgets = []; |
1649 |
|
1650 for (const widget of areaWidgets) { |
1840 for (const widget of areaWidgets) { |
1651 const widgetsNewArea = select.getWidgetAreaForWidgetId(widget.id); |
1841 const widgetsNewArea = select.getWidgetAreaForWidgetId(widget.id); |
1652 |
|
1653 if (!widgetsNewArea) { |
1842 if (!widgetsNewArea) { |
1654 deletedWidgets.push(widget); |
1843 deletedWidgets.push(widget); |
1655 } |
1844 } |
1656 } |
1845 } |
1657 |
|
1658 const batchMeta = []; |
1846 const batchMeta = []; |
1659 const batchTasks = []; |
1847 const batchTasks = []; |
1660 const sidebarWidgetsIds = []; |
1848 const sidebarWidgetsIds = []; |
1661 |
|
1662 for (let i = 0; i < widgetsBlocks.length; i++) { |
1849 for (let i = 0; i < widgetsBlocks.length; i++) { |
1663 const block = widgetsBlocks[i]; |
1850 const block = widgetsBlocks[i]; |
1664 const widgetId = (0,external_wp_widgets_namespaceObject.getWidgetIdFromBlock)(block); |
1851 const widgetId = (0,external_wp_widgets_namespaceObject.getWidgetIdFromBlock)(block); |
1665 const oldWidget = widgets[widgetId]; |
1852 const oldWidget = widgets[widgetId]; |
1666 const widget = transformBlockToWidget(block, oldWidget); // We'll replace the null widgetId after save, but we track it here |
1853 const widget = transformBlockToWidget(block, oldWidget); |
|
1854 |
|
1855 // We'll replace the null widgetId after save, but we track it here |
1667 // since order is important. |
1856 // since order is important. |
1668 |
1857 sidebarWidgetsIds.push(widgetId); |
1669 sidebarWidgetsIds.push(widgetId); // Check oldWidget as widgetId might refer to an ID which has been |
1858 |
|
1859 // Check oldWidget as widgetId might refer to an ID which has been |
1670 // deleted, e.g. if a deleted block is restored via undo after saving. |
1860 // deleted, e.g. if a deleted block is restored via undo after saving. |
1671 |
|
1672 if (oldWidget) { |
1861 if (oldWidget) { |
1673 // Update an existing widget. |
1862 // Update an existing widget. |
1674 registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord('root', 'widget', widgetId, { ...widget, |
1863 registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord('root', 'widget', widgetId, { |
|
1864 ...widget, |
1675 sidebar: widgetAreaId |
1865 sidebar: widgetAreaId |
1676 }, { |
1866 }, { |
1677 undoIgnore: true |
1867 undoIgnore: true |
1678 }); |
1868 }); |
1679 const hasEdits = registry.select(external_wp_coreData_namespaceObject.store).hasEditsForEntityRecord('root', 'widget', widgetId); |
1869 const hasEdits = registry.select(external_wp_coreData_namespaceObject.store).hasEditsForEntityRecord('root', 'widget', widgetId); |
1680 |
|
1681 if (!hasEdits) { |
1870 if (!hasEdits) { |
1682 continue; |
1871 continue; |
1683 } |
1872 } |
1684 |
1873 batchTasks.push(({ |
1685 batchTasks.push(_ref6 => { |
1874 saveEditedEntityRecord |
1686 let { |
1875 }) => saveEditedEntityRecord('root', 'widget', widgetId)); |
1687 saveEditedEntityRecord |
|
1688 } = _ref6; |
|
1689 return saveEditedEntityRecord('root', 'widget', widgetId); |
|
1690 }); |
|
1691 } else { |
1876 } else { |
1692 // Create a new widget. |
1877 // Create a new widget. |
1693 batchTasks.push(_ref7 => { |
1878 batchTasks.push(({ |
1694 let { |
1879 saveEntityRecord |
1695 saveEntityRecord |
1880 }) => saveEntityRecord('root', 'widget', { |
1696 } = _ref7; |
1881 ...widget, |
1697 return saveEntityRecord('root', 'widget', { ...widget, |
1882 sidebar: widgetAreaId |
1698 sidebar: widgetAreaId |
1883 })); |
1699 }); |
|
1700 }); |
|
1701 } |
1884 } |
1702 |
|
1703 batchMeta.push({ |
1885 batchMeta.push({ |
1704 block, |
1886 block, |
1705 position: i, |
1887 position: i, |
1706 clientId: block.clientId |
1888 clientId: block.clientId |
1707 }); |
1889 }); |
1708 } |
1890 } |
1709 |
|
1710 for (const widget of deletedWidgets) { |
1891 for (const widget of deletedWidgets) { |
1711 batchTasks.push(_ref8 => { |
1892 batchTasks.push(({ |
1712 let { |
1893 deleteEntityRecord |
1713 deleteEntityRecord |
1894 }) => deleteEntityRecord('root', 'widget', widget.id, { |
1714 } = _ref8; |
1895 force: true |
1715 return deleteEntityRecord('root', 'widget', widget.id, { |
1896 })); |
1716 force: true |
1897 } |
1717 }); |
|
1718 }); |
|
1719 } |
|
1720 |
|
1721 const records = await registry.dispatch(external_wp_coreData_namespaceObject.store).__experimentalBatch(batchTasks); |
1898 const records = await registry.dispatch(external_wp_coreData_namespaceObject.store).__experimentalBatch(batchTasks); |
1722 const preservedRecords = records.filter(record => !record.hasOwnProperty('deleted')); |
1899 const preservedRecords = records.filter(record => !record.hasOwnProperty('deleted')); |
1723 const failedWidgetNames = []; |
1900 const failedWidgetNames = []; |
1724 |
|
1725 for (let i = 0; i < preservedRecords.length; i++) { |
1901 for (let i = 0; i < preservedRecords.length; i++) { |
1726 const widget = preservedRecords[i]; |
1902 const widget = preservedRecords[i]; |
1727 const { |
1903 const { |
1728 block, |
1904 block, |
1729 position |
1905 position |
1730 } = batchMeta[i]; // Set __internalWidgetId on the block. This will be persisted to the |
1906 } = batchMeta[i]; |
|
1907 |
|
1908 // Set __internalWidgetId on the block. This will be persisted to the |
1731 // store when we dispatch receiveEntityRecords( post ) below. |
1909 // store when we dispatch receiveEntityRecords( post ) below. |
1732 |
|
1733 post.blocks[position].attributes.__internalWidgetId = widget.id; |
1910 post.blocks[position].attributes.__internalWidgetId = widget.id; |
1734 const error = registry.select(external_wp_coreData_namespaceObject.store).getLastEntitySaveError('root', 'widget', widget.id); |
1911 const error = registry.select(external_wp_coreData_namespaceObject.store).getLastEntitySaveError('root', 'widget', widget.id); |
1735 |
|
1736 if (error) { |
1912 if (error) { |
1737 var _block$attributes; |
1913 failedWidgetNames.push(block.attributes?.name || block?.name); |
1738 |
|
1739 failedWidgetNames.push(((_block$attributes = block.attributes) === null || _block$attributes === void 0 ? void 0 : _block$attributes.name) || (block === null || block === void 0 ? void 0 : block.name)); |
|
1740 } |
1914 } |
1741 |
|
1742 if (!sidebarWidgetsIds[position]) { |
1915 if (!sidebarWidgetsIds[position]) { |
1743 sidebarWidgetsIds[position] = widget.id; |
1916 sidebarWidgetsIds[position] = widget.id; |
1744 } |
1917 } |
1745 } |
1918 } |
1746 |
|
1747 if (failedWidgetNames.length) { |
1919 if (failedWidgetNames.length) { |
1748 throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( |
1920 throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: List of widget names */ |
1749 /* translators: %s: List of widget names */ |
|
1750 (0,external_wp_i18n_namespaceObject.__)('Could not save the following widgets: %s.'), failedWidgetNames.join(', '))); |
1921 (0,external_wp_i18n_namespaceObject.__)('Could not save the following widgets: %s.'), failedWidgetNames.join(', '))); |
1751 } |
1922 } |
1752 |
|
1753 registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord(KIND, WIDGET_AREA_ENTITY_TYPE, widgetAreaId, { |
1923 registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord(KIND, WIDGET_AREA_ENTITY_TYPE, widgetAreaId, { |
1754 widgets: sidebarWidgetsIds |
1924 widgets: sidebarWidgetsIds |
1755 }, { |
1925 }, { |
1756 undoIgnore: true |
1926 undoIgnore: true |
1757 }); |
1927 }); |
1758 dispatch(trySaveWidgetArea(widgetAreaId)); |
1928 dispatch(trySaveWidgetArea(widgetAreaId)); |
1759 registry.dispatch(external_wp_coreData_namespaceObject.store).receiveEntityRecords(KIND, POST_TYPE, post, undefined); |
1929 registry.dispatch(external_wp_coreData_namespaceObject.store).receiveEntityRecords(KIND, POST_TYPE, post, undefined); |
1760 }; |
1930 }; |
1761 |
1931 const trySaveWidgetArea = widgetAreaId => ({ |
1762 const trySaveWidgetArea = widgetAreaId => _ref9 => { |
1932 registry |
1763 let { |
1933 }) => { |
1764 registry |
|
1765 } = _ref9; |
|
1766 registry.dispatch(external_wp_coreData_namespaceObject.store).saveEditedEntityRecord(KIND, WIDGET_AREA_ENTITY_TYPE, widgetAreaId, { |
1934 registry.dispatch(external_wp_coreData_namespaceObject.store).saveEditedEntityRecord(KIND, WIDGET_AREA_ENTITY_TYPE, widgetAreaId, { |
1767 throwOnError: true |
1935 throwOnError: true |
1768 }); |
1936 }); |
1769 }; |
1937 }; |
|
1938 |
1770 /** |
1939 /** |
1771 * Sets the clientId stored for a particular widgetId. |
1940 * Sets the clientId stored for a particular widgetId. |
1772 * |
1941 * |
1773 * @param {number} clientId Client id. |
1942 * @param {number} clientId Client id. |
1774 * @param {number} widgetId Widget id. |
1943 * @param {number} widgetId Widget id. |
1775 * |
1944 * |
1776 * @return {Object} Action. |
1945 * @return {Object} Action. |
1777 */ |
1946 */ |
1778 |
|
1779 |
|
1780 function setWidgetIdForClientId(clientId, widgetId) { |
1947 function setWidgetIdForClientId(clientId, widgetId) { |
1781 return { |
1948 return { |
1782 type: 'SET_WIDGET_ID_FOR_CLIENT_ID', |
1949 type: 'SET_WIDGET_ID_FOR_CLIENT_ID', |
1783 clientId, |
1950 clientId, |
1784 widgetId |
1951 widgetId |
1785 }; |
1952 }; |
1786 } |
1953 } |
|
1954 |
1787 /** |
1955 /** |
1788 * Sets the open state of all the widget areas. |
1956 * Sets the open state of all the widget areas. |
1789 * |
1957 * |
1790 * @param {Object} widgetAreasOpenState The open states of all the widget areas. |
1958 * @param {Object} widgetAreasOpenState The open states of all the widget areas. |
1791 * |
1959 * |
1792 * @return {Object} Action. |
1960 * @return {Object} Action. |
1793 */ |
1961 */ |
1794 |
|
1795 function setWidgetAreasOpenState(widgetAreasOpenState) { |
1962 function setWidgetAreasOpenState(widgetAreasOpenState) { |
1796 return { |
1963 return { |
1797 type: 'SET_WIDGET_AREAS_OPEN_STATE', |
1964 type: 'SET_WIDGET_AREAS_OPEN_STATE', |
1798 widgetAreasOpenState |
1965 widgetAreasOpenState |
1799 }; |
1966 }; |
1800 } |
1967 } |
|
1968 |
1801 /** |
1969 /** |
1802 * Sets the open state of the widget area. |
1970 * Sets the open state of the widget area. |
1803 * |
1971 * |
1804 * @param {string} clientId The clientId of the widget area. |
1972 * @param {string} clientId The clientId of the widget area. |
1805 * @param {boolean} isOpen Whether the widget area should be opened. |
1973 * @param {boolean} isOpen Whether the widget area should be opened. |
1806 * |
1974 * |
1807 * @return {Object} Action. |
1975 * @return {Object} Action. |
1808 */ |
1976 */ |
1809 |
|
1810 function setIsWidgetAreaOpen(clientId, isOpen) { |
1977 function setIsWidgetAreaOpen(clientId, isOpen) { |
1811 return { |
1978 return { |
1812 type: 'SET_IS_WIDGET_AREA_OPEN', |
1979 type: 'SET_IS_WIDGET_AREA_OPEN', |
1813 clientId, |
1980 clientId, |
1814 isOpen |
1981 isOpen |
1815 }; |
1982 }; |
1816 } |
1983 } |
|
1984 |
1817 /** |
1985 /** |
1818 * Returns an action object used to open/close the inserter. |
1986 * Returns an action object used to open/close the inserter. |
1819 * |
1987 * |
1820 * @param {boolean|Object} value Whether the inserter should be |
1988 * @param {boolean|Object} value Whether the inserter should be |
1821 * opened (true) or closed (false). |
1989 * opened (true) or closed (false). |
2006 /** |
2157 /** |
2007 * Internal dependencies |
2158 * Internal dependencies |
2008 */ |
2159 */ |
2009 |
2160 |
2010 |
2161 |
|
2162 const EMPTY_INSERTION_POINT = { |
|
2163 rootClientId: undefined, |
|
2164 insertionIndex: undefined |
|
2165 }; |
2011 |
2166 |
2012 /** |
2167 /** |
2013 * Returns all API widgets. |
2168 * Returns all API widgets. |
2014 * |
2169 * |
2015 * @return {Object[]} API List of widgets. |
2170 * @return {Object[]} API List of widgets. |
2016 */ |
2171 */ |
2017 |
|
2018 const selectors_getWidgets = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { |
2172 const selectors_getWidgets = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { |
2019 const widgets = select(external_wp_coreData_namespaceObject.store).getEntityRecords('root', 'widget', buildWidgetsQuery()); |
2173 const widgets = select(external_wp_coreData_namespaceObject.store).getEntityRecords('root', 'widget', buildWidgetsQuery()); |
2020 return (0,external_lodash_namespaceObject.keyBy)(widgets, 'id'); |
2174 return ( |
|
2175 // Key widgets by their ID. |
|
2176 widgets?.reduce((allWidgets, widget) => ({ |
|
2177 ...allWidgets, |
|
2178 [widget.id]: widget |
|
2179 }), {}) || {} |
|
2180 ); |
2021 }); |
2181 }); |
|
2182 |
2022 /** |
2183 /** |
2023 * Returns API widget data for a particular widget ID. |
2184 * Returns API widget data for a particular widget ID. |
2024 * |
2185 * |
2025 * @param {number} id Widget ID. |
2186 * @param {number} id Widget ID. |
2026 * |
2187 * |
2027 * @return {Object} API widget data for a particular widget ID. |
2188 * @return {Object} API widget data for a particular widget ID. |
2028 */ |
2189 */ |
2029 |
|
2030 const getWidget = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, id) => { |
2190 const getWidget = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, id) => { |
2031 const widgets = select(constants_STORE_NAME).getWidgets(); |
2191 const widgets = select(constants_STORE_NAME).getWidgets(); |
2032 return widgets[id]; |
2192 return widgets[id]; |
2033 }); |
2193 }); |
|
2194 |
2034 /** |
2195 /** |
2035 * Returns all API widget areas. |
2196 * Returns all API widget areas. |
2036 * |
2197 * |
2037 * @return {Object[]} API List of widget areas. |
2198 * @return {Object[]} API List of widget areas. |
2038 */ |
2199 */ |
2039 |
|
2040 const selectors_getWidgetAreas = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { |
2200 const selectors_getWidgetAreas = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { |
2041 const query = buildWidgetAreasQuery(); |
2201 const query = buildWidgetAreasQuery(); |
2042 return select(external_wp_coreData_namespaceObject.store).getEntityRecords(KIND, WIDGET_AREA_ENTITY_TYPE, query); |
2202 return select(external_wp_coreData_namespaceObject.store).getEntityRecords(KIND, WIDGET_AREA_ENTITY_TYPE, query); |
2043 }); |
2203 }); |
|
2204 |
2044 /** |
2205 /** |
2045 * Returns widgetArea containing a block identify by given widgetId |
2206 * Returns widgetArea containing a block identify by given widgetId |
2046 * |
2207 * |
2047 * @param {string} widgetId The ID of the widget. |
2208 * @param {string} widgetId The ID of the widget. |
2048 * @return {Object} Containing widget area. |
2209 * @return {Object} Containing widget area. |
2049 */ |
2210 */ |
2050 |
|
2051 const getWidgetAreaForWidgetId = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, widgetId) => { |
2211 const getWidgetAreaForWidgetId = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, widgetId) => { |
2052 const widgetAreas = select(constants_STORE_NAME).getWidgetAreas(); |
2212 const widgetAreas = select(constants_STORE_NAME).getWidgetAreas(); |
2053 return widgetAreas.find(widgetArea => { |
2213 return widgetAreas.find(widgetArea => { |
2054 const post = select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord(KIND, POST_TYPE, buildWidgetAreaPostId(widgetArea.id)); |
2214 const post = select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord(KIND, POST_TYPE, buildWidgetAreaPostId(widgetArea.id)); |
2055 const blockWidgetIds = post.blocks.map(block => (0,external_wp_widgets_namespaceObject.getWidgetIdFromBlock)(block)); |
2215 const blockWidgetIds = post.blocks.map(block => (0,external_wp_widgets_namespaceObject.getWidgetIdFromBlock)(block)); |
2056 return blockWidgetIds.includes(widgetId); |
2216 return blockWidgetIds.includes(widgetId); |
2057 }); |
2217 }); |
2058 }); |
2218 }); |
|
2219 |
2059 /** |
2220 /** |
2060 * Given a child client id, returns the parent widget area block. |
2221 * Given a child client id, returns the parent widget area block. |
2061 * |
2222 * |
2062 * @param {string} clientId The client id of a block in a widget area. |
2223 * @param {string} clientId The client id of a block in a widget area. |
2063 * |
2224 * |
2064 * @return {WPBlock} The widget area block. |
2225 * @return {WPBlock} The widget area block. |
2065 */ |
2226 */ |
2066 |
|
2067 const getParentWidgetAreaBlock = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, clientId) => { |
2227 const getParentWidgetAreaBlock = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, clientId) => { |
2068 const { |
2228 const { |
2069 getBlock, |
2229 getBlock, |
2070 getBlockName, |
2230 getBlockName, |
2071 getBlockParents |
2231 getBlockParents |
2072 } = select(external_wp_blockEditor_namespaceObject.store); |
2232 } = select(external_wp_blockEditor_namespaceObject.store); |
2073 const blockParents = getBlockParents(clientId); |
2233 const blockParents = getBlockParents(clientId); |
2074 const widgetAreaClientId = blockParents.find(parentClientId => getBlockName(parentClientId) === 'core/widget-area'); |
2234 const widgetAreaClientId = blockParents.find(parentClientId => getBlockName(parentClientId) === 'core/widget-area'); |
2075 return getBlock(widgetAreaClientId); |
2235 return getBlock(widgetAreaClientId); |
2076 }); |
2236 }); |
|
2237 |
2077 /** |
2238 /** |
2078 * Returns all edited widget area entity records. |
2239 * Returns all edited widget area entity records. |
2079 * |
2240 * |
2080 * @return {Object[]} List of edited widget area entity records. |
2241 * @return {Object[]} List of edited widget area entity records. |
2081 */ |
2242 */ |
2082 |
|
2083 const getEditedWidgetAreas = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, ids) => { |
2243 const getEditedWidgetAreas = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, ids) => { |
2084 let widgetAreas = select(constants_STORE_NAME).getWidgetAreas(); |
2244 let widgetAreas = select(constants_STORE_NAME).getWidgetAreas(); |
2085 |
|
2086 if (!widgetAreas) { |
2245 if (!widgetAreas) { |
2087 return []; |
2246 return []; |
2088 } |
2247 } |
2089 |
|
2090 if (ids) { |
2248 if (ids) { |
2091 widgetAreas = widgetAreas.filter(_ref => { |
2249 widgetAreas = widgetAreas.filter(({ |
2092 let { |
|
2093 id |
|
2094 } = _ref; |
|
2095 return ids.includes(id); |
|
2096 }); |
|
2097 } |
|
2098 |
|
2099 return widgetAreas.filter(_ref2 => { |
|
2100 let { |
|
2101 id |
2250 id |
2102 } = _ref2; |
2251 }) => ids.includes(id)); |
2103 return select(external_wp_coreData_namespaceObject.store).hasEditsForEntityRecord(KIND, POST_TYPE, buildWidgetAreaPostId(id)); |
2252 } |
2104 }).map(_ref3 => { |
2253 return widgetAreas.filter(({ |
2105 let { |
2254 id |
2106 id |
2255 }) => select(external_wp_coreData_namespaceObject.store).hasEditsForEntityRecord(KIND, POST_TYPE, buildWidgetAreaPostId(id))).map(({ |
2107 } = _ref3; |
2256 id |
2108 return select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord(KIND, WIDGET_AREA_ENTITY_TYPE, id); |
2257 }) => select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord(KIND, WIDGET_AREA_ENTITY_TYPE, id)); |
2109 }); |
|
2110 }); |
2258 }); |
|
2259 |
2111 /** |
2260 /** |
2112 * Returns all blocks representing reference widgets. |
2261 * Returns all blocks representing reference widgets. |
2113 * |
2262 * |
2114 * @param {string} referenceWidgetName Optional. If given, only reference widgets with this name will be returned. |
2263 * @param {string} referenceWidgetName Optional. If given, only reference widgets with this name will be returned. |
2115 * @return {Array} List of all blocks representing reference widgets |
2264 * @return {Array} List of all blocks representing reference widgets |
2116 */ |
2265 */ |
2117 |
2266 const getReferenceWidgetBlocks = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, referenceWidgetName = null) => { |
2118 const getReferenceWidgetBlocks = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => function (state) { |
|
2119 let referenceWidgetName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; |
|
2120 const results = []; |
2267 const results = []; |
2121 const widgetAreas = select(constants_STORE_NAME).getWidgetAreas(); |
2268 const widgetAreas = select(constants_STORE_NAME).getWidgetAreas(); |
2122 |
|
2123 for (const _widgetArea of widgetAreas) { |
2269 for (const _widgetArea of widgetAreas) { |
2124 const post = select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord(KIND, POST_TYPE, buildWidgetAreaPostId(_widgetArea.id)); |
2270 const post = select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord(KIND, POST_TYPE, buildWidgetAreaPostId(_widgetArea.id)); |
2125 |
|
2126 for (const block of post.blocks) { |
2271 for (const block of post.blocks) { |
2127 var _block$attributes; |
2272 if (block.name === 'core/legacy-widget' && (!referenceWidgetName || block.attributes?.referenceWidgetName === referenceWidgetName)) { |
2128 |
|
2129 if (block.name === 'core/legacy-widget' && (!referenceWidgetName || ((_block$attributes = block.attributes) === null || _block$attributes === void 0 ? void 0 : _block$attributes.referenceWidgetName) === referenceWidgetName)) { |
|
2130 results.push(block); |
2273 results.push(block); |
2131 } |
2274 } |
2132 } |
2275 } |
2133 } |
2276 } |
2134 |
|
2135 return results; |
2277 return results; |
2136 }); |
2278 }); |
|
2279 |
2137 /** |
2280 /** |
2138 * Returns true if any widget area is currently being saved. |
2281 * Returns true if any widget area is currently being saved. |
2139 * |
2282 * |
2140 * @return {boolean} True if any widget area is currently being saved. False otherwise. |
2283 * @return {boolean} True if any widget area is currently being saved. False otherwise. |
2141 */ |
2284 */ |
2142 |
|
2143 const isSavingWidgetAreas = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { |
2285 const isSavingWidgetAreas = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { |
2144 var _select$getWidgetArea; |
2286 const widgetAreasIds = select(constants_STORE_NAME).getWidgetAreas()?.map(({ |
2145 |
2287 id |
2146 const widgetAreasIds = (_select$getWidgetArea = select(constants_STORE_NAME).getWidgetAreas()) === null || _select$getWidgetArea === void 0 ? void 0 : _select$getWidgetArea.map(_ref4 => { |
2288 }) => id); |
2147 let { |
|
2148 id |
|
2149 } = _ref4; |
|
2150 return id; |
|
2151 }); |
|
2152 |
|
2153 if (!widgetAreasIds) { |
2289 if (!widgetAreasIds) { |
2154 return false; |
2290 return false; |
2155 } |
2291 } |
2156 |
|
2157 for (const id of widgetAreasIds) { |
2292 for (const id of widgetAreasIds) { |
2158 const isSaving = select(external_wp_coreData_namespaceObject.store).isSavingEntityRecord(KIND, WIDGET_AREA_ENTITY_TYPE, id); |
2293 const isSaving = select(external_wp_coreData_namespaceObject.store).isSavingEntityRecord(KIND, WIDGET_AREA_ENTITY_TYPE, id); |
2159 |
|
2160 if (isSaving) { |
2294 if (isSaving) { |
2161 return true; |
2295 return true; |
2162 } |
2296 } |
2163 } |
2297 } |
2164 |
|
2165 const widgetIds = [...Object.keys(select(constants_STORE_NAME).getWidgets()), undefined // account for new widgets without an ID |
2298 const widgetIds = [...Object.keys(select(constants_STORE_NAME).getWidgets()), undefined // account for new widgets without an ID |
2166 ]; |
2299 ]; |
2167 |
|
2168 for (const id of widgetIds) { |
2300 for (const id of widgetIds) { |
2169 const isSaving = select(external_wp_coreData_namespaceObject.store).isSavingEntityRecord('root', 'widget', id); |
2301 const isSaving = select(external_wp_coreData_namespaceObject.store).isSavingEntityRecord('root', 'widget', id); |
2170 |
|
2171 if (isSaving) { |
2302 if (isSaving) { |
2172 return true; |
2303 return true; |
2173 } |
2304 } |
2174 } |
2305 } |
2175 |
|
2176 return false; |
2306 return false; |
2177 }); |
2307 }); |
|
2308 |
2178 /** |
2309 /** |
2179 * Gets whether the widget area is opened. |
2310 * Gets whether the widget area is opened. |
2180 * |
2311 * |
2181 * @param {Array} state The open state of the widget areas. |
2312 * @param {Array} state The open state of the widget areas. |
2182 * @param {string} clientId The clientId of the widget area. |
2313 * @param {string} clientId The clientId of the widget area. |
2183 * |
2314 * |
2184 * @return {boolean} True if the widget area is open. |
2315 * @return {boolean} True if the widget area is open. |
2185 */ |
2316 */ |
2186 |
|
2187 const getIsWidgetAreaOpen = (state, clientId) => { |
2317 const getIsWidgetAreaOpen = (state, clientId) => { |
2188 const { |
2318 const { |
2189 widgetAreasOpenState |
2319 widgetAreasOpenState |
2190 } = state; |
2320 } = state; |
2191 return !!widgetAreasOpenState[clientId]; |
2321 return !!widgetAreasOpenState[clientId]; |
2192 }; |
2322 }; |
|
2323 |
2193 /** |
2324 /** |
2194 * Returns true if the inserter is opened. |
2325 * Returns true if the inserter is opened. |
2195 * |
2326 * |
2196 * @param {Object} state Global application state. |
2327 * @param {Object} state Global application state. |
2197 * |
2328 * |
2198 * @return {boolean} Whether the inserter is opened. |
2329 * @return {boolean} Whether the inserter is opened. |
2199 */ |
2330 */ |
2200 |
|
2201 function isInserterOpened(state) { |
2331 function isInserterOpened(state) { |
2202 return !!state.blockInserterPanel; |
2332 return !!state.blockInserterPanel; |
2203 } |
2333 } |
|
2334 |
2204 /** |
2335 /** |
2205 * Get the insertion point for the inserter. |
2336 * Get the insertion point for the inserter. |
2206 * |
2337 * |
2207 * @param {Object} state Global application state. |
2338 * @param {Object} state Global application state. |
2208 * |
2339 * |
2209 * @return {Object} The root client ID and index to insert at. |
2340 * @return {Object} The root client ID and index to insert at. |
2210 */ |
2341 */ |
2211 |
|
2212 function __experimentalGetInsertionPoint(state) { |
2342 function __experimentalGetInsertionPoint(state) { |
2213 const { |
2343 if (typeof state.blockInserterPanel === 'boolean') { |
2214 rootClientId, |
2344 return EMPTY_INSERTION_POINT; |
2215 insertionIndex |
2345 } |
2216 } = state.blockInserterPanel; |
2346 return state.blockInserterPanel; |
2217 return { |
2347 } |
2218 rootClientId, |
2348 |
2219 insertionIndex |
|
2220 }; |
|
2221 } |
|
2222 /** |
2349 /** |
2223 * Returns true if a block can be inserted into a widget area. |
2350 * Returns true if a block can be inserted into a widget area. |
2224 * |
2351 * |
2225 * @param {Array} state The open state of the widget areas. |
2352 * @param {Array} state The open state of the widget areas. |
2226 * @param {string} blockName The name of the block being inserted. |
2353 * @param {string} blockName The name of the block being inserted. |
2227 * |
2354 * |
2228 * @return {boolean} True if the block can be inserted in a widget area. |
2355 * @return {boolean} True if the block can be inserted in a widget area. |
2229 */ |
2356 */ |
2230 |
|
2231 const canInsertBlockInWidgetArea = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, blockName) => { |
2357 const canInsertBlockInWidgetArea = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, blockName) => { |
2232 // Widget areas are always top-level blocks, which getBlocks will return. |
2358 // Widget areas are always top-level blocks, which getBlocks will return. |
2233 const widgetAreas = select(external_wp_blockEditor_namespaceObject.store).getBlocks(); // Makes an assumption that a block that can be inserted into one |
2359 const widgetAreas = select(external_wp_blockEditor_namespaceObject.store).getBlocks(); |
|
2360 |
|
2361 // Makes an assumption that a block that can be inserted into one |
2234 // widget area can be inserted into any widget area. Uses the first |
2362 // widget area can be inserted into any widget area. Uses the first |
2235 // widget area for testing whether the block can be inserted. |
2363 // widget area for testing whether the block can be inserted. |
2236 |
|
2237 const [firstWidgetArea] = widgetAreas; |
2364 const [firstWidgetArea] = widgetAreas; |
2238 return select(external_wp_blockEditor_namespaceObject.store).canInsertBlockType(blockName, firstWidgetArea.clientId); |
2365 return select(external_wp_blockEditor_namespaceObject.store).canInsertBlockType(blockName, firstWidgetArea.clientId); |
2239 }); |
2366 }); |
|
2367 |
2240 /** |
2368 /** |
2241 * Returns true if the list view is opened. |
2369 * Returns true if the list view is opened. |
2242 * |
2370 * |
2243 * @param {Object} state Global application state. |
2371 * @param {Object} state Global application state. |
2244 * |
2372 * |
2245 * @return {boolean} Whether the list view is opened. |
2373 * @return {boolean} Whether the list view is opened. |
2246 */ |
2374 */ |
2247 |
|
2248 function isListViewOpened(state) { |
2375 function isListViewOpened(state) { |
2249 return state.listViewPanel; |
2376 return state.listViewPanel; |
2250 } |
2377 } |
2251 |
2378 |
|
2379 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/store/private-selectors.js |
|
2380 function getListViewToggleRef(state) { |
|
2381 return state.listViewToggleRef; |
|
2382 } |
|
2383 function getInserterSidebarToggleRef(state) { |
|
2384 return state.inserterSidebarToggleRef; |
|
2385 } |
|
2386 |
|
2387 ;// CONCATENATED MODULE: external ["wp","privateApis"] |
|
2388 const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"]; |
|
2389 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/lock-unlock.js |
|
2390 /** |
|
2391 * WordPress dependencies |
|
2392 */ |
|
2393 |
|
2394 const { |
|
2395 lock, |
|
2396 unlock |
|
2397 } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/edit-widgets'); |
|
2398 |
2252 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/store/index.js |
2399 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/store/index.js |
2253 /** |
2400 /** |
2254 * WordPress dependencies |
2401 * WordPress dependencies |
2255 */ |
2402 */ |
2256 |
2403 |
2257 |
2404 |
|
2405 |
2258 /** |
2406 /** |
2259 * Internal dependencies |
2407 * Internal dependencies |
2260 */ |
2408 */ |
2261 |
2409 |
2262 |
2410 |
2263 |
2411 |
2264 |
2412 |
2265 |
2413 |
2266 |
2414 |
|
2415 |
|
2416 |
2267 /** |
2417 /** |
2268 * Block editor data store configuration. |
2418 * Block editor data store configuration. |
2269 * |
2419 * |
2270 * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#register |
2420 * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#register |
2271 * |
2421 * |
2272 * @type {Object} |
2422 * @type {Object} |
2273 */ |
2423 */ |
2274 |
|
2275 const storeConfig = { |
2424 const storeConfig = { |
2276 reducer: reducer, |
2425 reducer: reducer, |
2277 selectors: store_selectors_namespaceObject, |
2426 selectors: store_selectors_namespaceObject, |
2278 resolvers: resolvers_namespaceObject, |
2427 resolvers: resolvers_namespaceObject, |
2279 actions: store_actions_namespaceObject |
2428 actions: store_actions_namespaceObject |
2280 }; |
2429 }; |
|
2430 |
2281 /** |
2431 /** |
2282 * Store definition for the edit widgets namespace. |
2432 * Store definition for the edit widgets namespace. |
2283 * |
2433 * |
2284 * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore |
2434 * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore |
2285 * |
2435 * |
2286 * @type {Object} |
2436 * @type {Object} |
2287 */ |
2437 */ |
2288 |
|
2289 const store_store = (0,external_wp_data_namespaceObject.createReduxStore)(constants_STORE_NAME, storeConfig); |
2438 const store_store = (0,external_wp_data_namespaceObject.createReduxStore)(constants_STORE_NAME, storeConfig); |
2290 (0,external_wp_data_namespaceObject.register)(store_store); // This package uses a few in-memory post types as wrappers for convenience. |
2439 (0,external_wp_data_namespaceObject.register)(store_store); |
|
2440 |
|
2441 // This package uses a few in-memory post types as wrappers for convenience. |
2291 // This middleware prevents any network requests related to these types as they are |
2442 // This middleware prevents any network requests related to these types as they are |
2292 // bound to fail anyway. |
2443 // bound to fail anyway. |
2293 |
|
2294 external_wp_apiFetch_default().use(function (options, next) { |
2444 external_wp_apiFetch_default().use(function (options, next) { |
2295 var _options$path; |
2445 if (options.path?.indexOf('/wp/v2/types/widget-area') === 0) { |
2296 |
|
2297 if (((_options$path = options.path) === null || _options$path === void 0 ? void 0 : _options$path.indexOf('/wp/v2/types/widget-area')) === 0) { |
|
2298 return Promise.resolve({}); |
2446 return Promise.resolve({}); |
2299 } |
2447 } |
2300 |
|
2301 return next(options); |
2448 return next(options); |
2302 }); |
2449 }); |
|
2450 unlock(store_store).registerPrivateSelectors(private_selectors_namespaceObject); |
2303 |
2451 |
2304 ;// CONCATENATED MODULE: external ["wp","hooks"] |
2452 ;// CONCATENATED MODULE: external ["wp","hooks"] |
2305 var external_wp_hooks_namespaceObject = window["wp"]["hooks"]; |
2453 const external_wp_hooks_namespaceObject = window["wp"]["hooks"]; |
2306 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/filters/move-to-widget-area.js |
2454 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/filters/move-to-widget-area.js |
2307 |
2455 /** |
2308 |
2456 * WordPress dependencies |
2309 /** |
2457 */ |
2310 * WordPress dependencies |
2458 |
2311 */ |
2459 |
2312 |
2460 |
2313 |
2461 |
2314 |
2462 |
2315 |
2463 |
2316 |
2464 |
2317 /** |
2465 /** |
2318 * Internal dependencies |
2466 * Internal dependencies |
2319 */ |
2467 */ |
|
2468 |
|
2469 |
2320 |
2470 |
2321 |
2471 |
2322 const withMoveToWidgetAreaToolbarItem = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockEdit => props => { |
2472 const withMoveToWidgetAreaToolbarItem = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockEdit => props => { |
2323 const { |
2473 const { |
2324 clientId, |
2474 clientId, |
2913 |
3055 |
2914 |
3056 |
2915 |
3057 |
2916 |
3058 |
2917 |
3059 |
2918 function WidgetAreasBlockEditorProvider(_ref) { |
3060 |
2919 let { |
3061 const { |
2920 blockEditorSettings, |
3062 ExperimentalBlockEditorProvider |
2921 children, |
3063 } = unlock(external_wp_blockEditor_namespaceObject.privateApis); |
2922 ...props |
3064 const { |
2923 } = _ref; |
3065 PatternsMenuItems |
|
3066 } = unlock(external_wp_patterns_namespaceObject.privateApis); |
|
3067 const { |
|
3068 BlockKeyboardShortcuts |
|
3069 } = unlock(external_wp_blockLibrary_namespaceObject.privateApis); |
|
3070 function WidgetAreasBlockEditorProvider({ |
|
3071 blockEditorSettings, |
|
3072 children, |
|
3073 ...props |
|
3074 }) { |
|
3075 const mediaPermissions = (0,external_wp_coreData_namespaceObject.useResourcePermissions)('media'); |
|
3076 const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium'); |
2924 const { |
3077 const { |
2925 hasUploadPermissions, |
|
2926 reusableBlocks, |
3078 reusableBlocks, |
2927 isFixedToolbarActive, |
3079 isFixedToolbarActive, |
2928 keepCaretInsideBlock |
3080 keepCaretInsideBlock, |
2929 } = (0,external_wp_data_namespaceObject.useSelect)(select => ({ |
3081 pageOnFront, |
2930 hasUploadPermissions: (0,external_lodash_namespaceObject.defaultTo)(select(external_wp_coreData_namespaceObject.store).canUser('create', 'media'), true), |
3082 pageForPosts |
2931 widgetAreas: select(store_store).getWidgetAreas(), |
3083 } = (0,external_wp_data_namespaceObject.useSelect)(select => { |
2932 widgets: select(store_store).getWidgets(), |
3084 const { |
2933 reusableBlocks: ALLOW_REUSABLE_BLOCKS ? select(external_wp_coreData_namespaceObject.store).getEntityRecords('postType', 'wp_block') : [], |
3085 canUser, |
2934 isFixedToolbarActive: !!select(external_wp_preferences_namespaceObject.store).get('core/edit-widgets', 'fixedToolbar'), |
3086 getEntityRecord, |
2935 keepCaretInsideBlock: !!select(external_wp_preferences_namespaceObject.store).get('core/edit-widgets', 'keepCaretInsideBlock') |
3087 getEntityRecords |
2936 }), []); |
3088 } = select(external_wp_coreData_namespaceObject.store); |
|
3089 const siteSettings = canUser('read', 'settings') ? getEntityRecord('root', 'site') : undefined; |
|
3090 return { |
|
3091 widgetAreas: select(store_store).getWidgetAreas(), |
|
3092 widgets: select(store_store).getWidgets(), |
|
3093 reusableBlocks: ALLOW_REUSABLE_BLOCKS ? getEntityRecords('postType', 'wp_block') : [], |
|
3094 isFixedToolbarActive: !!select(external_wp_preferences_namespaceObject.store).get('core/edit-widgets', 'fixedToolbar'), |
|
3095 keepCaretInsideBlock: !!select(external_wp_preferences_namespaceObject.store).get('core/edit-widgets', 'keepCaretInsideBlock'), |
|
3096 pageOnFront: siteSettings?.page_on_front, |
|
3097 pageForPosts: siteSettings?.page_for_posts |
|
3098 }; |
|
3099 }, []); |
2937 const { |
3100 const { |
2938 setIsInserterOpened |
3101 setIsInserterOpened |
2939 } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); |
3102 } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); |
2940 const settings = (0,external_wp_element_namespaceObject.useMemo)(() => { |
3103 const settings = (0,external_wp_element_namespaceObject.useMemo)(() => { |
2941 let mediaUploadBlockEditor; |
3104 let mediaUploadBlockEditor; |
2942 |
3105 if (mediaPermissions.canCreate) { |
2943 if (hasUploadPermissions) { |
3106 mediaUploadBlockEditor = ({ |
2944 mediaUploadBlockEditor = _ref2 => { |
3107 onError, |
2945 let { |
3108 ...argumentsObject |
2946 onError, |
3109 }) => { |
2947 ...argumentsObject |
|
2948 } = _ref2; |
|
2949 (0,external_wp_mediaUtils_namespaceObject.uploadMedia)({ |
3110 (0,external_wp_mediaUtils_namespaceObject.uploadMedia)({ |
2950 wpAllowedMimeTypes: blockEditorSettings.allowedMimeTypes, |
3111 wpAllowedMimeTypes: blockEditorSettings.allowedMimeTypes, |
2951 onError: _ref3 => { |
3112 onError: ({ |
2952 let { |
3113 message |
2953 message |
3114 }) => onError(message), |
2954 } = _ref3; |
|
2955 return onError(message); |
|
2956 }, |
|
2957 ...argumentsObject |
3115 ...argumentsObject |
2958 }); |
3116 }); |
2959 }; |
3117 }; |
2960 } |
3118 } |
2961 |
3119 return { |
2962 return { ...blockEditorSettings, |
3120 ...blockEditorSettings, |
2963 __experimentalReusableBlocks: reusableBlocks, |
3121 __experimentalReusableBlocks: reusableBlocks, |
2964 hasFixedToolbar: isFixedToolbarActive, |
3122 hasFixedToolbar: isFixedToolbarActive || !isLargeViewport, |
2965 keepCaretInsideBlock, |
3123 keepCaretInsideBlock, |
2966 mediaUpload: mediaUploadBlockEditor, |
3124 mediaUpload: mediaUploadBlockEditor, |
2967 templateLock: 'all', |
3125 templateLock: 'all', |
2968 __experimentalSetIsInserterOpened: setIsInserterOpened |
3126 __experimentalSetIsInserterOpened: setIsInserterOpened, |
|
3127 pageOnFront, |
|
3128 pageForPosts |
2969 }; |
3129 }; |
2970 }, [blockEditorSettings, isFixedToolbarActive, keepCaretInsideBlock, hasUploadPermissions, reusableBlocks, setIsInserterOpened]); |
3130 }, [blockEditorSettings, isFixedToolbarActive, isLargeViewport, keepCaretInsideBlock, mediaPermissions.canCreate, reusableBlocks, setIsInserterOpened, pageOnFront, pageForPosts]); |
2971 const widgetAreaId = use_last_selected_widget_area(); |
3131 const widgetAreaId = use_last_selected_widget_area(); |
2972 const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)(KIND, POST_TYPE, { |
3132 const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)(KIND, POST_TYPE, { |
2973 id: buildWidgetAreasPostId() |
3133 id: buildWidgetAreasPostId() |
2974 }); |
3134 }); |
2975 return (0,external_wp_element_namespaceObject.createElement)(external_wp_keyboardShortcuts_namespaceObject.ShortcutProvider, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockEditorKeyboardShortcuts.Register, null), (0,external_wp_element_namespaceObject.createElement)(keyboard_shortcuts.Register, null), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SlotFillProvider, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockEditorProvider, _extends({ |
3135 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.SlotFillProvider, { |
2976 value: blocks, |
3136 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboard_shortcuts.Register, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockKeyboardShortcuts, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(ExperimentalBlockEditorProvider, { |
2977 onInput: onInput, |
3137 value: blocks, |
2978 onChange: onChange, |
3138 onInput: onInput, |
2979 settings: settings, |
3139 onChange: onChange, |
2980 useSubRegistry: false |
3140 settings: settings, |
2981 }, props), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.CopyHandler, null, children), (0,external_wp_element_namespaceObject.createElement)(external_wp_reusableBlocks_namespaceObject.ReusableBlocksMenuItems, { |
3141 useSubRegistry: false, |
2982 rootClientId: widgetAreaId |
3142 ...props, |
2983 })))); |
3143 children: [children, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternsMenuItems, { |
2984 } |
3144 rootClientId: widgetAreaId |
2985 |
3145 })] |
2986 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/cog.js |
3146 })] |
2987 |
3147 }); |
2988 |
3148 } |
2989 /** |
3149 |
2990 * WordPress dependencies |
3150 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/drawer-left.js |
2991 */ |
3151 /** |
2992 |
3152 * WordPress dependencies |
2993 const cog = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { |
3153 */ |
|
3154 |
|
3155 |
|
3156 const drawerLeft = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { |
|
3157 width: "24", |
|
3158 height: "24", |
2994 xmlns: "http://www.w3.org/2000/svg", |
3159 xmlns: "http://www.w3.org/2000/svg", |
2995 viewBox: "0 0 24 24" |
3160 viewBox: "0 0 24 24", |
2996 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { |
3161 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { |
2997 fillRule: "evenodd", |
3162 fillRule: "evenodd", |
2998 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", |
3163 clipRule: "evenodd", |
2999 clipRule: "evenodd" |
3164 d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM8.5 18.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h2.5v13zm10-.5c0 .3-.2.5-.5.5h-8v-13h8c.3 0 .5.2.5.5v12z" |
3000 })); |
3165 }) |
3001 /* harmony default export */ var library_cog = (cog); |
3166 }); |
|
3167 /* harmony default export */ const drawer_left = (drawerLeft); |
|
3168 |
|
3169 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/drawer-right.js |
|
3170 /** |
|
3171 * WordPress dependencies |
|
3172 */ |
|
3173 |
|
3174 |
|
3175 const drawerRight = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { |
|
3176 width: "24", |
|
3177 height: "24", |
|
3178 xmlns: "http://www.w3.org/2000/svg", |
|
3179 viewBox: "0 0 24 24", |
|
3180 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { |
|
3181 fillRule: "evenodd", |
|
3182 clipRule: "evenodd", |
|
3183 d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z" |
|
3184 }) |
|
3185 }); |
|
3186 /* harmony default export */ const drawer_right = (drawerRight); |
3002 |
3187 |
3003 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/block-default.js |
3188 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/block-default.js |
3004 |
3189 /** |
3005 |
3190 * WordPress dependencies |
3006 /** |
3191 */ |
3007 * WordPress dependencies |
3192 |
3008 */ |
3193 |
3009 |
3194 const blockDefault = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { |
3010 const blockDefault = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { |
|
3011 xmlns: "http://www.w3.org/2000/svg", |
3195 xmlns: "http://www.w3.org/2000/svg", |
3012 viewBox: "0 0 24 24" |
3196 viewBox: "0 0 24 24", |
3013 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { |
3197 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { |
3014 d: "M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z" |
3198 d: "M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z" |
3015 })); |
3199 }) |
3016 /* harmony default export */ var block_default = (blockDefault); |
3200 }); |
|
3201 /* harmony default export */ const block_default = (blockDefault); |
3017 |
3202 |
3018 ;// CONCATENATED MODULE: external ["wp","url"] |
3203 ;// CONCATENATED MODULE: external ["wp","url"] |
3019 var external_wp_url_namespaceObject = window["wp"]["url"]; |
3204 const external_wp_url_namespaceObject = window["wp"]["url"]; |
3020 ;// CONCATENATED MODULE: external ["wp","dom"] |
3205 ;// CONCATENATED MODULE: external ["wp","dom"] |
3021 var external_wp_dom_namespaceObject = window["wp"]["dom"]; |
3206 const external_wp_dom_namespaceObject = window["wp"]["dom"]; |
3022 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/sidebar/widget-areas.js |
3207 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/sidebar/widget-areas.js |
3023 |
3208 /** |
3024 |
3209 * WordPress dependencies |
3025 /** |
3210 */ |
3026 * WordPress dependencies |
3211 |
3027 */ |
|
3028 |
3212 |
3029 |
3213 |
3030 |
3214 |
3031 |
3215 |
3032 |
3216 |
3149 getActiveComplementaryArea |
3388 getActiveComplementaryArea |
3150 } = select(store); |
3389 } = select(store); |
3151 const selectedBlock = getSelectedBlock(); |
3390 const selectedBlock = getSelectedBlock(); |
3152 const activeArea = getActiveComplementaryArea(store_store.name); |
3391 const activeArea = getActiveComplementaryArea(store_store.name); |
3153 let currentSelection = activeArea; |
3392 let currentSelection = activeArea; |
3154 |
|
3155 if (!currentSelection) { |
3393 if (!currentSelection) { |
3156 if (selectedBlock) { |
3394 if (selectedBlock) { |
3157 currentSelection = BLOCK_INSPECTOR_IDENTIFIER; |
3395 currentSelection = BLOCK_INSPECTOR_IDENTIFIER; |
3158 } else { |
3396 } else { |
3159 currentSelection = WIDGET_AREAS_IDENTIFIER; |
3397 currentSelection = WIDGET_AREAS_IDENTIFIER; |
3160 } |
3398 } |
3161 } |
3399 } |
3162 |
|
3163 let widgetAreaBlock; |
3400 let widgetAreaBlock; |
3164 |
|
3165 if (selectedBlock) { |
3401 if (selectedBlock) { |
3166 if (selectedBlock.name === 'core/widget-area') { |
3402 if (selectedBlock.name === 'core/widget-area') { |
3167 widgetAreaBlock = selectedBlock; |
3403 widgetAreaBlock = selectedBlock; |
3168 } else { |
3404 } else { |
3169 widgetAreaBlock = getBlock(getBlockParentsByBlockName(selectedBlock.clientId, 'core/widget-area')[0]); |
3405 widgetAreaBlock = getBlock(getBlockParentsByBlockName(selectedBlock.clientId, 'core/widget-area')[0]); |
3170 } |
3406 } |
3171 } |
3407 } |
3172 |
|
3173 return { |
3408 return { |
3174 currentArea: currentSelection, |
3409 currentArea: currentSelection, |
3175 hasSelectedNonAreaBlock: !!(selectedBlock && selectedBlock.name !== 'core/widget-area'), |
3410 hasSelectedNonAreaBlock: !!(selectedBlock && selectedBlock.name !== 'core/widget-area'), |
3176 isGeneralSidebarOpen: !!activeArea, |
3411 isGeneralSidebarOpen: !!activeArea, |
3177 selectedWidgetAreaBlock: widgetAreaBlock |
3412 selectedWidgetAreaBlock: widgetAreaBlock |
3178 }; |
3413 }; |
3179 }, []); // currentArea, and isGeneralSidebarOpen are intentionally left out from the dependencies, |
3414 }, []); |
3180 // because we want to run the effect when a block is selected/unselected and not when the sidebar state changes. |
3415 const { |
3181 |
3416 enableComplementaryArea |
3182 (0,external_wp_element_namespaceObject.useEffect)(() => { |
3417 } = (0,external_wp_data_namespaceObject.useDispatch)(store); |
3183 if (hasSelectedNonAreaBlock && currentArea === WIDGET_AREAS_IDENTIFIER && isGeneralSidebarOpen) { |
3418 |
3184 enableComplementaryArea('core/edit-widgets', BLOCK_INSPECTOR_IDENTIFIER); |
3419 // `newSelectedTabId` could technically be falsey if no tab is selected (i.e. |
|
3420 // the initial render) or when we don't want a tab displayed (i.e. the |
|
3421 // sidebar is closed). These cases should both be covered by the `!!` check |
|
3422 // below, so we shouldn't need any additional falsey handling. |
|
3423 const onTabSelect = (0,external_wp_element_namespaceObject.useCallback)(newSelectedTabId => { |
|
3424 if (!!newSelectedTabId) { |
|
3425 enableComplementaryArea(store_store.name, newSelectedTabId); |
3185 } |
3426 } |
3186 |
3427 }, [enableComplementaryArea]); |
3187 if (!hasSelectedNonAreaBlock && currentArea === BLOCK_INSPECTOR_IDENTIFIER && isGeneralSidebarOpen) { |
3428 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs |
3188 enableComplementaryArea('core/edit-widgets', WIDGET_AREAS_IDENTIFIER); |
3429 // Due to how this component is controlled (via a value from the |
3189 } |
3430 // `interfaceStore`), when the sidebar closes the currently selected |
3190 }, [hasSelectedNonAreaBlock, enableComplementaryArea]); |
3431 // tab can't be found. This causes the component to continuously reset |
3191 return (0,external_wp_element_namespaceObject.createElement)(complementary_area, { |
3432 // the selection to `null` in an infinite loop. Proactively setting |
3192 className: "edit-widgets-sidebar", |
3433 // the selected tab to `null` avoids that. |
3193 header: (0,external_wp_element_namespaceObject.createElement)("ul", null, (0,external_wp_element_namespaceObject.createElement)("li", null, (0,external_wp_element_namespaceObject.createElement)(ComplementaryAreaTab, { |
3434 , { |
3194 identifier: WIDGET_AREAS_IDENTIFIER, |
3435 selectedTabId: isGeneralSidebarOpen ? currentArea : null, |
3195 label: selectedWidgetAreaBlock ? selectedWidgetAreaBlock.attributes.name : (0,external_wp_i18n_namespaceObject.__)('Widget Areas'), |
3436 onSelect: onTabSelect, |
3196 isActive: currentArea === WIDGET_AREAS_IDENTIFIER |
3437 selectOnMove: false, |
3197 })), (0,external_wp_element_namespaceObject.createElement)("li", null, (0,external_wp_element_namespaceObject.createElement)(ComplementaryAreaTab, { |
3438 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarContent, { |
3198 identifier: BLOCK_INSPECTOR_IDENTIFIER, |
3439 hasSelectedNonAreaBlock: hasSelectedNonAreaBlock, |
3199 label: (0,external_wp_i18n_namespaceObject.__)('Block'), |
3440 currentArea: currentArea, |
3200 isActive: currentArea === BLOCK_INSPECTOR_IDENTIFIER |
3441 isGeneralSidebarOpen: isGeneralSidebarOpen, |
3201 }))), |
3442 selectedWidgetAreaBlock: selectedWidgetAreaBlock |
3202 headerClassName: "edit-widgets-sidebar__panel-tabs" |
3443 }) |
3203 /* translators: button label text should, if possible, be under 16 characters. */ |
3444 }); |
|
3445 } |
|
3446 |
|
3447 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/plus.js |
|
3448 /** |
|
3449 * WordPress dependencies |
|
3450 */ |
|
3451 |
|
3452 |
|
3453 const plus = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { |
|
3454 xmlns: "http://www.w3.org/2000/svg", |
|
3455 viewBox: "0 0 24 24", |
|
3456 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { |
|
3457 d: "M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z" |
|
3458 }) |
|
3459 }); |
|
3460 /* harmony default export */ const library_plus = (plus); |
|
3461 |
|
3462 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/list-view.js |
|
3463 /** |
|
3464 * WordPress dependencies |
|
3465 */ |
|
3466 |
|
3467 |
|
3468 const listView = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { |
|
3469 viewBox: "0 0 24 24", |
|
3470 xmlns: "http://www.w3.org/2000/svg", |
|
3471 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { |
|
3472 d: "M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z" |
|
3473 }) |
|
3474 }); |
|
3475 /* harmony default export */ const list_view = (listView); |
|
3476 |
|
3477 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/undo.js |
|
3478 /** |
|
3479 * WordPress dependencies |
|
3480 */ |
|
3481 |
|
3482 |
|
3483 const undo = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { |
|
3484 xmlns: "http://www.w3.org/2000/svg", |
|
3485 viewBox: "0 0 24 24", |
|
3486 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { |
|
3487 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" |
|
3488 }) |
|
3489 }); |
|
3490 /* harmony default export */ const library_undo = (undo); |
|
3491 |
|
3492 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/redo.js |
|
3493 /** |
|
3494 * WordPress dependencies |
|
3495 */ |
|
3496 |
|
3497 |
|
3498 const redo = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { |
|
3499 xmlns: "http://www.w3.org/2000/svg", |
|
3500 viewBox: "0 0 24 24", |
|
3501 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { |
|
3502 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" |
|
3503 }) |
|
3504 }); |
|
3505 /* harmony default export */ const library_redo = (redo); |
|
3506 |
|
3507 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/header/undo-redo/undo.js |
|
3508 /** |
|
3509 * WordPress dependencies |
|
3510 */ |
|
3511 |
|
3512 |
|
3513 |
|
3514 |
|
3515 |
|
3516 |
|
3517 |
|
3518 |
|
3519 function UndoButton(props, ref) { |
|
3520 const hasUndo = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).hasUndo(), []); |
|
3521 const { |
|
3522 undo |
|
3523 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); |
|
3524 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { |
|
3525 ...props, |
|
3526 ref: ref, |
|
3527 icon: !(0,external_wp_i18n_namespaceObject.isRTL)() ? library_undo : library_redo, |
|
3528 label: (0,external_wp_i18n_namespaceObject.__)('Undo'), |
|
3529 shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary('z') |
|
3530 // If there are no undo levels we don't want to actually disable this |
|
3531 // button, because it will remove focus for keyboard users. |
|
3532 // See: https://github.com/WordPress/gutenberg/issues/3486 |
3204 , |
3533 , |
3205 title: (0,external_wp_i18n_namespaceObject.__)('Settings'), |
3534 "aria-disabled": !hasUndo, |
3206 closeLabel: (0,external_wp_i18n_namespaceObject.__)('Close settings'), |
3535 onClick: hasUndo ? undo : undefined, |
3207 scope: "core/edit-widgets", |
3536 size: "compact" |
3208 identifier: currentArea, |
3537 }); |
3209 icon: library_cog, |
3538 } |
3210 isActiveByDefault: SIDEBAR_ACTIVE_BY_DEFAULT |
3539 /* harmony default export */ const undo_redo_undo = ((0,external_wp_element_namespaceObject.forwardRef)(UndoButton)); |
3211 }, currentArea === WIDGET_AREAS_IDENTIFIER && (0,external_wp_element_namespaceObject.createElement)(WidgetAreas, { |
3540 |
3212 selectedWidgetAreaId: selectedWidgetAreaBlock === null || selectedWidgetAreaBlock === void 0 ? void 0 : selectedWidgetAreaBlock.attributes.id |
3541 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/header/undo-redo/redo.js |
3213 }), currentArea === BLOCK_INSPECTOR_IDENTIFIER && (hasSelectedNonAreaBlock ? (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockInspector, null) : // Pretend that Widget Areas are part of the UI by not |
3542 /** |
3214 // showing the Block Inspector when one is selected. |
3543 * WordPress dependencies |
3215 (0,external_wp_element_namespaceObject.createElement)("span", { |
3544 */ |
3216 className: "block-editor-block-inspector__no-blocks" |
3545 |
3217 }, (0,external_wp_i18n_namespaceObject.__)('No block selected.')))); |
3546 |
3218 } |
3547 |
3219 |
3548 |
3220 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/plus.js |
3549 |
3221 |
3550 |
3222 |
3551 |
3223 /** |
3552 |
3224 * WordPress dependencies |
3553 function RedoButton(props, ref) { |
3225 */ |
3554 const shortcut = (0,external_wp_keycodes_namespaceObject.isAppleOS)() ? external_wp_keycodes_namespaceObject.displayShortcut.primaryShift('z') : external_wp_keycodes_namespaceObject.displayShortcut.primary('y'); |
3226 |
3555 const hasRedo = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).hasRedo(), []); |
3227 const plus = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { |
3556 const { |
3228 xmlns: "http://www.w3.org/2000/svg", |
3557 redo |
3229 viewBox: "0 0 24 24" |
3558 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); |
3230 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { |
3559 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { |
3231 d: "M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z" |
3560 ...props, |
3232 })); |
3561 ref: ref, |
3233 /* harmony default export */ var library_plus = (plus); |
3562 icon: !(0,external_wp_i18n_namespaceObject.isRTL)() ? library_redo : library_undo, |
3234 |
3563 label: (0,external_wp_i18n_namespaceObject.__)('Redo'), |
3235 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/list-view.js |
3564 shortcut: shortcut |
3236 |
3565 // If there are no undo levels we don't want to actually disable this |
3237 |
3566 // button, because it will remove focus for keyboard users. |
3238 /** |
3567 // See: https://github.com/WordPress/gutenberg/issues/3486 |
3239 * WordPress dependencies |
3568 , |
3240 */ |
3569 "aria-disabled": !hasRedo, |
3241 |
3570 onClick: hasRedo ? redo : undefined, |
3242 const listView = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { |
3571 size: "compact" |
3243 viewBox: "0 0 24 24", |
3572 }); |
3244 xmlns: "http://www.w3.org/2000/svg" |
3573 } |
3245 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { |
3574 /* harmony default export */ const undo_redo_redo = ((0,external_wp_element_namespaceObject.forwardRef)(RedoButton)); |
3246 d: "M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z" |
3575 |
3247 })); |
3576 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/header/document-tools/index.js |
3248 /* harmony default export */ var list_view = (listView); |
3577 /** |
|
3578 * WordPress dependencies |
|
3579 */ |
|
3580 |
|
3581 |
|
3582 |
|
3583 |
|
3584 |
|
3585 |
|
3586 |
|
3587 |
|
3588 /** |
|
3589 * Internal dependencies |
|
3590 */ |
|
3591 |
|
3592 |
|
3593 |
|
3594 |
|
3595 |
|
3596 |
|
3597 |
|
3598 function DocumentTools() { |
|
3599 const isMediumViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium'); |
|
3600 const { |
|
3601 isInserterOpen, |
|
3602 isListViewOpen, |
|
3603 inserterSidebarToggleRef, |
|
3604 listViewToggleRef |
|
3605 } = (0,external_wp_data_namespaceObject.useSelect)(select => { |
|
3606 const { |
|
3607 isInserterOpened, |
|
3608 getInserterSidebarToggleRef, |
|
3609 isListViewOpened, |
|
3610 getListViewToggleRef |
|
3611 } = unlock(select(store_store)); |
|
3612 return { |
|
3613 isInserterOpen: isInserterOpened(), |
|
3614 isListViewOpen: isListViewOpened(), |
|
3615 inserterSidebarToggleRef: getInserterSidebarToggleRef(), |
|
3616 listViewToggleRef: getListViewToggleRef() |
|
3617 }; |
|
3618 }, []); |
|
3619 const { |
|
3620 setIsInserterOpened, |
|
3621 setIsListViewOpened |
|
3622 } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); |
|
3623 const toggleListView = (0,external_wp_element_namespaceObject.useCallback)(() => setIsListViewOpened(!isListViewOpen), [setIsListViewOpened, isListViewOpen]); |
|
3624 const toggleInserterSidebar = (0,external_wp_element_namespaceObject.useCallback)(() => setIsInserterOpened(!isInserterOpen), [setIsInserterOpened, isInserterOpen]); |
|
3625 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.NavigableToolbar, { |
|
3626 className: "edit-widgets-header-toolbar", |
|
3627 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Document tools'), |
|
3628 variant: "unstyled", |
|
3629 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, { |
|
3630 ref: inserterSidebarToggleRef, |
|
3631 as: external_wp_components_namespaceObject.Button, |
|
3632 className: "edit-widgets-header-toolbar__inserter-toggle", |
|
3633 variant: "primary", |
|
3634 isPressed: isInserterOpen, |
|
3635 onMouseDown: event => { |
|
3636 event.preventDefault(); |
|
3637 }, |
|
3638 onClick: toggleInserterSidebar, |
|
3639 icon: library_plus |
|
3640 /* translators: button label text should, if possible, be under 16 |
|
3641 characters. */, |
|
3642 label: (0,external_wp_i18n_namespaceObject._x)('Toggle block inserter', 'Generic label for block inserter button'), |
|
3643 size: "compact" |
|
3644 }), isMediumViewport && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
|
3645 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, { |
|
3646 as: undo_redo_undo |
|
3647 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, { |
|
3648 as: undo_redo_redo |
|
3649 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, { |
|
3650 as: external_wp_components_namespaceObject.Button, |
|
3651 className: "edit-widgets-header-toolbar__list-view-toggle", |
|
3652 icon: list_view, |
|
3653 isPressed: isListViewOpen |
|
3654 /* translators: button label text should, if possible, be under 16 characters. */, |
|
3655 label: (0,external_wp_i18n_namespaceObject.__)('List View'), |
|
3656 onClick: toggleListView, |
|
3657 ref: listViewToggleRef, |
|
3658 size: "compact" |
|
3659 })] |
|
3660 })] |
|
3661 }); |
|
3662 } |
|
3663 /* harmony default export */ const document_tools = (DocumentTools); |
3249 |
3664 |
3250 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/save-button/index.js |
3665 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/save-button/index.js |
3251 |
3666 /** |
3252 |
3667 * WordPress dependencies |
3253 /** |
3668 */ |
3254 * WordPress dependencies |
3669 |
3255 */ |
|
3256 |
3670 |
3257 |
3671 |
3258 |
3672 |
3259 /** |
3673 /** |
3260 * Internal dependencies |
3674 * Internal dependencies |
3261 */ |
3675 */ |
3262 |
|
3263 |
3676 |
3264 |
3677 |
3265 function SaveButton() { |
3678 function SaveButton() { |
3266 const { |
3679 const { |
3267 hasEditedWidgetAreaIds, |
3680 hasEditedWidgetAreaIds, |
3268 isSaving |
3681 isSaving |
3269 } = (0,external_wp_data_namespaceObject.useSelect)(select => { |
3682 } = (0,external_wp_data_namespaceObject.useSelect)(select => { |
3270 var _getEditedWidgetAreas; |
|
3271 |
|
3272 const { |
3683 const { |
3273 getEditedWidgetAreas, |
3684 getEditedWidgetAreas, |
3274 isSavingWidgetAreas |
3685 isSavingWidgetAreas |
3275 } = select(store_store); |
3686 } = select(store_store); |
3276 return { |
3687 return { |
3277 hasEditedWidgetAreaIds: ((_getEditedWidgetAreas = getEditedWidgetAreas()) === null || _getEditedWidgetAreas === void 0 ? void 0 : _getEditedWidgetAreas.length) > 0, |
3688 hasEditedWidgetAreaIds: getEditedWidgetAreas()?.length > 0, |
3278 isSaving: isSavingWidgetAreas() |
3689 isSaving: isSavingWidgetAreas() |
3279 }; |
3690 }; |
3280 }, []); |
3691 }, []); |
3281 const { |
3692 const { |
3282 saveEditedWidgetAreas |
3693 saveEditedWidgetAreas |
3283 } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); |
3694 } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); |
3284 return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { |
3695 const isDisabled = isSaving || !hasEditedWidgetAreaIds; |
|
3696 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { |
3285 variant: "primary", |
3697 variant: "primary", |
3286 isBusy: isSaving, |
3698 isBusy: isSaving, |
3287 "aria-disabled": isSaving, |
3699 "aria-disabled": isDisabled, |
3288 onClick: isSaving ? undefined : saveEditedWidgetAreas, |
3700 onClick: isDisabled ? undefined : saveEditedWidgetAreas, |
3289 disabled: !hasEditedWidgetAreaIds |
3701 size: "compact", |
3290 }, isSaving ? (0,external_wp_i18n_namespaceObject.__)('Saving…') : (0,external_wp_i18n_namespaceObject.__)('Update')); |
3702 children: isSaving ? (0,external_wp_i18n_namespaceObject.__)('Saving…') : (0,external_wp_i18n_namespaceObject.__)('Update') |
3291 } |
3703 }); |
3292 |
3704 } |
3293 /* harmony default export */ var save_button = (SaveButton); |
3705 /* harmony default export */ const save_button = (SaveButton); |
3294 |
3706 |
3295 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/undo.js |
3707 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/more-vertical.js |
3296 |
3708 /** |
3297 |
3709 * WordPress dependencies |
3298 /** |
3710 */ |
3299 * WordPress dependencies |
3711 |
3300 */ |
3712 |
3301 |
3713 const moreVertical = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { |
3302 const undo = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { |
|
3303 xmlns: "http://www.w3.org/2000/svg", |
3714 xmlns: "http://www.w3.org/2000/svg", |
3304 viewBox: "0 0 24 24" |
3715 viewBox: "0 0 24 24", |
3305 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { |
3716 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { |
3306 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" |
3717 d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" |
3307 })); |
3718 }) |
3308 /* harmony default export */ var library_undo = (undo); |
3719 }); |
3309 |
3720 /* harmony default export */ const more_vertical = (moreVertical); |
3310 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/redo.js |
3721 |
3311 |
3722 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/external.js |
3312 |
3723 /** |
3313 /** |
3724 * WordPress dependencies |
3314 * WordPress dependencies |
3725 */ |
3315 */ |
3726 |
3316 |
3727 |
3317 const redo = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { |
3728 const external = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { |
3318 xmlns: "http://www.w3.org/2000/svg", |
3729 xmlns: "http://www.w3.org/2000/svg", |
3319 viewBox: "0 0 24 24" |
3730 viewBox: "0 0 24 24", |
3320 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { |
3731 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { |
3321 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" |
3732 d: "M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z" |
3322 })); |
3733 }) |
3323 /* harmony default export */ var library_redo = (redo); |
3734 }); |
3324 |
3735 /* harmony default export */ const library_external = (external); |
3325 ;// CONCATENATED MODULE: external ["wp","keycodes"] |
|
3326 var external_wp_keycodes_namespaceObject = window["wp"]["keycodes"]; |
|
3327 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/header/undo-redo/undo.js |
|
3328 |
|
3329 |
|
3330 /** |
|
3331 * WordPress dependencies |
|
3332 */ |
|
3333 |
|
3334 |
|
3335 |
|
3336 |
|
3337 |
|
3338 |
|
3339 function UndoButton() { |
|
3340 const hasUndo = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).hasUndo(), []); |
|
3341 const { |
|
3342 undo |
|
3343 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); |
|
3344 return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { |
|
3345 icon: !(0,external_wp_i18n_namespaceObject.isRTL)() ? library_undo : library_redo, |
|
3346 label: (0,external_wp_i18n_namespaceObject.__)('Undo'), |
|
3347 shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary('z') // If there are no undo levels we don't want to actually disable this |
|
3348 // button, because it will remove focus for keyboard users. |
|
3349 // See: https://github.com/WordPress/gutenberg/issues/3486 |
|
3350 , |
|
3351 "aria-disabled": !hasUndo, |
|
3352 onClick: hasUndo ? undo : undefined |
|
3353 }); |
|
3354 } |
|
3355 |
|
3356 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/header/undo-redo/redo.js |
|
3357 |
|
3358 |
|
3359 /** |
|
3360 * WordPress dependencies |
|
3361 */ |
|
3362 |
|
3363 |
|
3364 |
|
3365 |
|
3366 |
|
3367 |
|
3368 function RedoButton() { |
|
3369 const hasRedo = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).hasRedo(), []); |
|
3370 const { |
|
3371 redo |
|
3372 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); |
|
3373 return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { |
|
3374 icon: !(0,external_wp_i18n_namespaceObject.isRTL)() ? library_redo : library_undo, |
|
3375 label: (0,external_wp_i18n_namespaceObject.__)('Redo'), |
|
3376 shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primaryShift('z') // If there are no undo levels we don't want to actually disable this |
|
3377 // button, because it will remove focus for keyboard users. |
|
3378 // See: https://github.com/WordPress/gutenberg/issues/3486 |
|
3379 , |
|
3380 "aria-disabled": !hasRedo, |
|
3381 onClick: hasRedo ? redo : undefined |
|
3382 }); |
|
3383 } |
|
3384 |
|
3385 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/external.js |
|
3386 |
|
3387 |
|
3388 /** |
|
3389 * WordPress dependencies |
|
3390 */ |
|
3391 |
|
3392 const external = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { |
|
3393 xmlns: "http://www.w3.org/2000/svg", |
|
3394 viewBox: "0 0 24 24" |
|
3395 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { |
|
3396 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" |
|
3397 })); |
|
3398 /* harmony default export */ var library_external = (external); |
|
3399 |
3736 |
3400 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/keyboard-shortcut-help-modal/config.js |
3737 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/keyboard-shortcut-help-modal/config.js |
3401 /** |
3738 /** |
3402 * WordPress dependencies |
3739 * WordPress dependencies |
3403 */ |
3740 */ |
3565 |
3928 |
3566 |
3929 |
3567 |
3930 |
3568 |
3931 |
3569 |
3932 |
3570 const ShortcutList = _ref => { |
3933 const ShortcutList = ({ |
3571 let { |
3934 shortcuts |
3572 shortcuts |
3935 }) => |
3573 } = _ref; |
3936 /*#__PURE__*/ |
3574 return ( |
3937 /* |
3575 /* |
3938 * Disable reason: The `list` ARIA role is redundant but |
3576 * Disable reason: The `list` ARIA role is redundant but |
3939 * Safari+VoiceOver won't announce the list otherwise. |
3577 * Safari+VoiceOver won't announce the list otherwise. |
3940 */ |
3578 */ |
3941 /* eslint-disable jsx-a11y/no-redundant-roles */ |
3579 |
3942 (0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { |
3580 /* eslint-disable jsx-a11y/no-redundant-roles */ |
3943 className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-list", |
3581 (0,external_wp_element_namespaceObject.createElement)("ul", { |
3944 role: "list", |
3582 className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-list", |
3945 children: shortcuts.map((shortcut, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { |
3583 role: "list" |
3946 className: "edit-widgets-keyboard-shortcut-help-modal__shortcut", |
3584 }, shortcuts.map((shortcut, index) => (0,external_wp_element_namespaceObject.createElement)("li", { |
3947 children: typeof shortcut === 'string' ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dynamic_shortcut, { |
3585 className: "edit-widgets-keyboard-shortcut-help-modal__shortcut", |
|
3586 key: index |
|
3587 }, (0,external_lodash_namespaceObject.isString)(shortcut) ? (0,external_wp_element_namespaceObject.createElement)(dynamic_shortcut, { |
|
3588 name: shortcut |
3948 name: shortcut |
3589 }) : (0,external_wp_element_namespaceObject.createElement)(keyboard_shortcut_help_modal_shortcut, shortcut)))) |
3949 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboard_shortcut_help_modal_shortcut, { |
3590 /* eslint-enable jsx-a11y/no-redundant-roles */ |
3950 ...shortcut |
3591 |
3951 }) |
3592 ); |
3952 }, index)) |
3593 }; |
3953 }) |
3594 |
3954 /* eslint-enable jsx-a11y/no-redundant-roles */; |
3595 const ShortcutSection = _ref2 => { |
3955 const ShortcutSection = ({ |
3596 let { |
3956 title, |
3597 title, |
3957 shortcuts, |
3598 shortcuts, |
3958 className |
3599 className |
3959 }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("section", { |
3600 } = _ref2; |
3960 className: dist_clsx('edit-widgets-keyboard-shortcut-help-modal__section', className), |
3601 return (0,external_wp_element_namespaceObject.createElement)("section", { |
3961 children: [!!title && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { |
3602 className: classnames_default()('edit-widgets-keyboard-shortcut-help-modal__section', className) |
3962 className: "edit-widgets-keyboard-shortcut-help-modal__section-title", |
3603 }, !!title && (0,external_wp_element_namespaceObject.createElement)("h2", { |
3963 children: title |
3604 className: "edit-widgets-keyboard-shortcut-help-modal__section-title" |
3964 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutList, { |
3605 }, title), (0,external_wp_element_namespaceObject.createElement)(ShortcutList, { |
|
3606 shortcuts: shortcuts |
3965 shortcuts: shortcuts |
3607 })); |
3966 })] |
3608 }; |
3967 }); |
3609 |
3968 const ShortcutCategorySection = ({ |
3610 const ShortcutCategorySection = _ref3 => { |
3969 title, |
3611 let { |
3970 categoryName, |
3612 title, |
3971 additionalShortcuts = [] |
3613 categoryName, |
3972 }) => { |
3614 additionalShortcuts = [] |
|
3615 } = _ref3; |
|
3616 const categoryShortcuts = (0,external_wp_data_namespaceObject.useSelect)(select => { |
3973 const categoryShortcuts = (0,external_wp_data_namespaceObject.useSelect)(select => { |
3617 return select(external_wp_keyboardShortcuts_namespaceObject.store).getCategoryShortcuts(categoryName); |
3974 return select(external_wp_keyboardShortcuts_namespaceObject.store).getCategoryShortcuts(categoryName); |
3618 }, [categoryName]); |
3975 }, [categoryName]); |
3619 return (0,external_wp_element_namespaceObject.createElement)(ShortcutSection, { |
3976 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutSection, { |
3620 title: title, |
3977 title: title, |
3621 shortcuts: categoryShortcuts.concat(additionalShortcuts) |
3978 shortcuts: categoryShortcuts.concat(additionalShortcuts) |
3622 }); |
3979 }); |
3623 }; |
3980 }; |
3624 |
3981 function KeyboardShortcutHelpModal({ |
3625 function KeyboardShortcutHelpModal(_ref4) { |
3982 isModalActive, |
3626 let { |
3983 toggleModal |
3627 isModalActive, |
3984 }) { |
3628 toggleModal |
|
3629 } = _ref4; |
|
3630 (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/edit-widgets/keyboard-shortcuts', toggleModal, { |
3985 (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/edit-widgets/keyboard-shortcuts', toggleModal, { |
3631 bindGlobal: true |
3986 bindGlobal: true |
3632 }); |
3987 }); |
3633 |
|
3634 if (!isModalActive) { |
3988 if (!isModalActive) { |
3635 return null; |
3989 return null; |
3636 } |
3990 } |
3637 |
3991 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Modal, { |
3638 return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, { |
|
3639 className: "edit-widgets-keyboard-shortcut-help-modal", |
3992 className: "edit-widgets-keyboard-shortcut-help-modal", |
3640 title: (0,external_wp_i18n_namespaceObject.__)('Keyboard shortcuts'), |
3993 title: (0,external_wp_i18n_namespaceObject.__)('Keyboard shortcuts'), |
3641 closeLabel: (0,external_wp_i18n_namespaceObject.__)('Close'), |
3994 onRequestClose: toggleModal, |
3642 onRequestClose: toggleModal |
3995 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutSection, { |
3643 }, (0,external_wp_element_namespaceObject.createElement)(ShortcutSection, { |
3996 className: "edit-widgets-keyboard-shortcut-help-modal__main-shortcuts", |
3644 className: "edit-widgets-keyboard-shortcut-help-modal__main-shortcuts", |
3997 shortcuts: ['core/edit-widgets/keyboard-shortcuts'] |
3645 shortcuts: ['core/edit-widgets/keyboard-shortcuts'] |
3998 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutCategorySection, { |
3646 }), (0,external_wp_element_namespaceObject.createElement)(ShortcutCategorySection, { |
3999 title: (0,external_wp_i18n_namespaceObject.__)('Global shortcuts'), |
3647 title: (0,external_wp_i18n_namespaceObject.__)('Global shortcuts'), |
4000 categoryName: "global" |
3648 categoryName: "global" |
4001 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutCategorySection, { |
3649 }), (0,external_wp_element_namespaceObject.createElement)(ShortcutCategorySection, { |
4002 title: (0,external_wp_i18n_namespaceObject.__)('Selection shortcuts'), |
3650 title: (0,external_wp_i18n_namespaceObject.__)('Selection shortcuts'), |
4003 categoryName: "selection" |
3651 categoryName: "selection" |
4004 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutCategorySection, { |
3652 }), (0,external_wp_element_namespaceObject.createElement)(ShortcutCategorySection, { |
4005 title: (0,external_wp_i18n_namespaceObject.__)('Block shortcuts'), |
3653 title: (0,external_wp_i18n_namespaceObject.__)('Block shortcuts'), |
4006 categoryName: "block", |
3654 categoryName: "block", |
4007 additionalShortcuts: [{ |
3655 additionalShortcuts: [{ |
4008 keyCombination: { |
3656 keyCombination: { |
4009 character: '/' |
3657 character: '/' |
4010 }, |
3658 }, |
4011 description: (0,external_wp_i18n_namespaceObject.__)('Change the block type after adding a new paragraph.'), |
3659 description: (0,external_wp_i18n_namespaceObject.__)('Change the block type after adding a new paragraph.'), |
4012 /* translators: The forward-slash character. e.g. '/'. */ |
3660 |
4013 ariaLabel: (0,external_wp_i18n_namespaceObject.__)('Forward-slash') |
3661 /* translators: The forward-slash character. e.g. '/'. */ |
4014 }] |
3662 ariaLabel: (0,external_wp_i18n_namespaceObject.__)('Forward-slash') |
4015 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutSection, { |
3663 }] |
4016 title: (0,external_wp_i18n_namespaceObject.__)('Text formatting'), |
3664 }), (0,external_wp_element_namespaceObject.createElement)(ShortcutSection, { |
4017 shortcuts: textFormattingShortcuts |
3665 title: (0,external_wp_i18n_namespaceObject.__)('Text formatting'), |
4018 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutCategorySection, { |
3666 shortcuts: textFormattingShortcuts |
4019 title: (0,external_wp_i18n_namespaceObject.__)('List View shortcuts'), |
3667 })); |
4020 categoryName: "list-view" |
|
4021 })] |
|
4022 }); |
3668 } |
4023 } |
3669 |
4024 |
3670 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/more-menu/tools-more-menu-group.js |
4025 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/more-menu/tools-more-menu-group.js |
3671 |
|
3672 |
|
3673 /** |
|
3674 * External dependencies |
|
3675 */ |
|
3676 |
|
3677 /** |
4026 /** |
3678 * WordPress dependencies |
4027 * WordPress dependencies |
3679 */ |
4028 */ |
3680 |
4029 |
3681 |
4030 |
3682 const { |
4031 const { |
3683 Fill: ToolsMoreMenuGroup, |
4032 Fill: ToolsMoreMenuGroup, |
3684 Slot |
4033 Slot |
3685 } = (0,external_wp_components_namespaceObject.createSlotFill)('EditWidgetsToolsMoreMenuGroup'); |
4034 } = (0,external_wp_components_namespaceObject.createSlotFill)('EditWidgetsToolsMoreMenuGroup'); |
3686 |
4035 ToolsMoreMenuGroup.Slot = ({ |
3687 ToolsMoreMenuGroup.Slot = _ref => { |
4036 fillProps |
3688 let { |
4037 }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Slot, { |
3689 fillProps |
4038 fillProps: fillProps, |
3690 } = _ref; |
4039 children: fills => fills.length > 0 && fills |
3691 return (0,external_wp_element_namespaceObject.createElement)(Slot, { |
4040 }); |
3692 fillProps: fillProps |
4041 /* harmony default export */ const tools_more_menu_group = (ToolsMoreMenuGroup); |
3693 }, fills => !(0,external_lodash_namespaceObject.isEmpty)(fills) && fills); |
|
3694 }; |
|
3695 |
|
3696 /* harmony default export */ var tools_more_menu_group = (ToolsMoreMenuGroup); |
|
3697 |
4042 |
3698 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/more-menu/index.js |
4043 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/more-menu/index.js |
3699 |
|
3700 |
|
3701 /** |
4044 /** |
3702 * WordPress dependencies |
4045 * WordPress dependencies |
3703 */ |
4046 */ |
3704 |
4047 |
3705 |
4048 |
3711 |
4054 |
3712 |
4055 |
3713 /** |
4056 /** |
3714 * Internal dependencies |
4057 * Internal dependencies |
3715 */ |
4058 */ |
|
4059 |
|
4060 |
3716 |
4061 |
3717 |
4062 |
3718 |
4063 |
3719 function MoreMenu() { |
4064 function MoreMenu() { |
3720 const [isKeyboardShortcutsModalActive, setIsKeyboardShortcutsModalVisible] = (0,external_wp_element_namespaceObject.useState)(false); |
4065 const [isKeyboardShortcutsModalActive, setIsKeyboardShortcutsModalVisible] = (0,external_wp_element_namespaceObject.useState)(false); |
3721 |
|
3722 const toggleKeyboardShortcutsModal = () => setIsKeyboardShortcutsModalVisible(!isKeyboardShortcutsModalActive); |
4066 const toggleKeyboardShortcutsModal = () => setIsKeyboardShortcutsModalVisible(!isKeyboardShortcutsModalActive); |
3723 |
|
3724 (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/edit-widgets/keyboard-shortcuts', toggleKeyboardShortcutsModal); |
4067 (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/edit-widgets/keyboard-shortcuts', toggleKeyboardShortcutsModal); |
3725 const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium'); |
4068 const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium'); |
3726 return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(MoreMenuDropdown, null, onClose => (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, isLargeViewport && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, { |
4069 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
3727 label: (0,external_wp_i18n_namespaceObject._x)('View', 'noun') |
4070 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, { |
3728 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, { |
4071 icon: more_vertical, |
3729 scope: "core/edit-widgets", |
4072 label: (0,external_wp_i18n_namespaceObject.__)('Options'), |
3730 name: "fixedToolbar", |
4073 popoverProps: { |
3731 label: (0,external_wp_i18n_namespaceObject.__)('Top toolbar'), |
4074 placement: 'bottom-end', |
3732 info: (0,external_wp_i18n_namespaceObject.__)('Access all block and document tools in a single place'), |
4075 className: 'more-menu-dropdown__content' |
3733 messageActivated: (0,external_wp_i18n_namespaceObject.__)('Top toolbar activated'), |
4076 }, |
3734 messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Top toolbar deactivated') |
4077 toggleProps: { |
3735 })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, { |
4078 tooltipPosition: 'bottom', |
3736 label: (0,external_wp_i18n_namespaceObject.__)('Tools') |
4079 size: 'compact' |
3737 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { |
4080 }, |
3738 onClick: () => { |
4081 children: onClose => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
3739 setIsKeyboardShortcutsModalVisible(true); |
4082 children: [isLargeViewport && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { |
3740 }, |
4083 label: (0,external_wp_i18n_namespaceObject._x)('View', 'noun'), |
3741 shortcut: external_wp_keycodes_namespaceObject.displayShortcut.access('h') |
4084 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, { |
3742 }, (0,external_wp_i18n_namespaceObject.__)('Keyboard shortcuts')), (0,external_wp_element_namespaceObject.createElement)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, { |
4085 scope: "core/edit-widgets", |
3743 scope: "core/edit-widgets", |
4086 name: "fixedToolbar", |
3744 name: "welcomeGuide", |
4087 label: (0,external_wp_i18n_namespaceObject.__)('Top toolbar'), |
3745 label: (0,external_wp_i18n_namespaceObject.__)('Welcome Guide') |
4088 info: (0,external_wp_i18n_namespaceObject.__)('Access all block and document tools in a single place'), |
3746 }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { |
4089 messageActivated: (0,external_wp_i18n_namespaceObject.__)('Top toolbar activated'), |
3747 role: "menuitem", |
4090 messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Top toolbar deactivated') |
3748 icon: library_external, |
4091 }) |
3749 href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/support/article/block-based-widgets-editor/'), |
4092 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { |
3750 target: "_blank", |
4093 label: (0,external_wp_i18n_namespaceObject.__)('Tools'), |
3751 rel: "noopener noreferrer" |
4094 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { |
3752 }, (0,external_wp_i18n_namespaceObject.__)('Help'), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, { |
4095 onClick: () => { |
3753 as: "span" |
4096 setIsKeyboardShortcutsModalVisible(true); |
3754 }, |
4097 }, |
3755 /* translators: accessibility text */ |
4098 shortcut: external_wp_keycodes_namespaceObject.displayShortcut.access('h'), |
3756 (0,external_wp_i18n_namespaceObject.__)('(opens in a new tab)'))), (0,external_wp_element_namespaceObject.createElement)(tools_more_menu_group.Slot, { |
4099 children: (0,external_wp_i18n_namespaceObject.__)('Keyboard shortcuts') |
3757 fillProps: { |
4100 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, { |
3758 onClose |
4101 scope: "core/edit-widgets", |
3759 } |
4102 name: "welcomeGuide", |
3760 })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, { |
4103 label: (0,external_wp_i18n_namespaceObject.__)('Welcome Guide') |
3761 label: (0,external_wp_i18n_namespaceObject.__)('Preferences') |
4104 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuItem, { |
3762 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, { |
4105 role: "menuitem", |
3763 scope: "core/edit-widgets", |
4106 icon: library_external, |
3764 name: "keepCaretInsideBlock", |
4107 href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/documentation/article/block-based-widgets-editor/'), |
3765 label: (0,external_wp_i18n_namespaceObject.__)('Contain text cursor inside block'), |
4108 target: "_blank", |
3766 info: (0,external_wp_i18n_namespaceObject.__)('Aids screen readers by stopping text caret from leaving blocks.'), |
4109 rel: "noopener noreferrer", |
3767 messageActivated: (0,external_wp_i18n_namespaceObject.__)('Contain text cursor inside block activated'), |
4110 children: [(0,external_wp_i18n_namespaceObject.__)('Help'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { |
3768 messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Contain text cursor inside block deactivated') |
4111 as: "span", |
3769 }), (0,external_wp_element_namespaceObject.createElement)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, { |
4112 children: /* translators: accessibility text */ |
3770 scope: "core/edit-widgets", |
4113 (0,external_wp_i18n_namespaceObject.__)('(opens in a new tab)') |
3771 name: "themeStyles", |
4114 })] |
3772 info: (0,external_wp_i18n_namespaceObject.__)('Make the editor look like your theme.'), |
4115 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(tools_more_menu_group.Slot, { |
3773 label: (0,external_wp_i18n_namespaceObject.__)('Use theme styles') |
4116 fillProps: { |
3774 }), isLargeViewport && (0,external_wp_element_namespaceObject.createElement)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, { |
4117 onClose |
3775 scope: "core/edit-widgets", |
4118 } |
3776 name: "showBlockBreadcrumbs", |
4119 })] |
3777 label: (0,external_wp_i18n_namespaceObject.__)('Display block breadcrumbs'), |
4120 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { |
3778 info: (0,external_wp_i18n_namespaceObject.__)('Shows block breadcrumbs at the bottom of the editor.'), |
4121 label: (0,external_wp_i18n_namespaceObject.__)('Preferences'), |
3779 messageActivated: (0,external_wp_i18n_namespaceObject.__)('Display block breadcrumbs activated'), |
4122 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, { |
3780 messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Display block breadcrumbs deactivated') |
4123 scope: "core/edit-widgets", |
3781 })))), (0,external_wp_element_namespaceObject.createElement)(KeyboardShortcutHelpModal, { |
4124 name: "keepCaretInsideBlock", |
3782 isModalActive: isKeyboardShortcutsModalActive, |
4125 label: (0,external_wp_i18n_namespaceObject.__)('Contain text cursor inside block'), |
3783 toggleModal: toggleKeyboardShortcutsModal |
4126 info: (0,external_wp_i18n_namespaceObject.__)('Aids screen readers by stopping text caret from leaving blocks.'), |
3784 })); |
4127 messageActivated: (0,external_wp_i18n_namespaceObject.__)('Contain text cursor inside block activated'), |
|
4128 messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Contain text cursor inside block deactivated') |
|
4129 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, { |
|
4130 scope: "core/edit-widgets", |
|
4131 name: "themeStyles", |
|
4132 info: (0,external_wp_i18n_namespaceObject.__)('Make the editor look like your theme.'), |
|
4133 label: (0,external_wp_i18n_namespaceObject.__)('Use theme styles') |
|
4134 }), isLargeViewport && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, { |
|
4135 scope: "core/edit-widgets", |
|
4136 name: "showBlockBreadcrumbs", |
|
4137 label: (0,external_wp_i18n_namespaceObject.__)('Display block breadcrumbs'), |
|
4138 info: (0,external_wp_i18n_namespaceObject.__)('Shows block breadcrumbs at the bottom of the editor.'), |
|
4139 messageActivated: (0,external_wp_i18n_namespaceObject.__)('Display block breadcrumbs activated'), |
|
4140 messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Display block breadcrumbs deactivated') |
|
4141 })] |
|
4142 })] |
|
4143 }) |
|
4144 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(KeyboardShortcutHelpModal, { |
|
4145 isModalActive: isKeyboardShortcutsModalActive, |
|
4146 toggleModal: toggleKeyboardShortcutsModal |
|
4147 })] |
|
4148 }); |
3785 } |
4149 } |
3786 |
4150 |
3787 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/header/index.js |
4151 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/header/index.js |
3788 |
4152 /** |
3789 |
4153 * WordPress dependencies |
3790 /** |
4154 */ |
3791 * WordPress dependencies |
4155 |
3792 */ |
|
3793 |
4156 |
3794 |
4157 |
3795 |
4158 |
3796 |
4159 |
3797 |
4160 |
3927 } = (0,external_wp_data_namespaceObject.useSelect)(select => { |
4234 } = (0,external_wp_data_namespaceObject.useSelect)(select => { |
3928 return { |
4235 return { |
3929 notices: select(external_wp_notices_namespaceObject.store).getNotices() |
4236 notices: select(external_wp_notices_namespaceObject.store).getNotices() |
3930 }; |
4237 }; |
3931 }, []); |
4238 }, []); |
3932 const dismissibleNotices = (0,external_lodash_namespaceObject.filter)(notices, { |
4239 const dismissibleNotices = notices.filter(({ |
3933 isDismissible: true, |
4240 isDismissible, |
3934 type: 'default' |
4241 type |
3935 }); |
4242 }) => isDismissible && type === 'default'); |
3936 const nonDismissibleNotices = (0,external_lodash_namespaceObject.filter)(notices, { |
4243 const nonDismissibleNotices = notices.filter(({ |
3937 isDismissible: false, |
4244 isDismissible, |
3938 type: 'default' |
4245 type |
3939 }); |
4246 }) => !isDismissible && type === 'default'); |
3940 const snackbarNotices = (0,external_lodash_namespaceObject.filter)(notices, { |
4247 const snackbarNotices = notices.filter(({ |
3941 type: 'snackbar' |
4248 type |
3942 }); |
4249 }) => type === 'snackbar').slice(MAX_VISIBLE_NOTICES); |
3943 return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.NoticeList, { |
4250 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
3944 notices: nonDismissibleNotices, |
4251 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.NoticeList, { |
3945 className: "edit-widgets-notices__pinned" |
4252 notices: nonDismissibleNotices, |
3946 }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.NoticeList, { |
4253 className: "edit-widgets-notices__pinned" |
3947 notices: dismissibleNotices, |
4254 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.NoticeList, { |
3948 className: "edit-widgets-notices__dismissible", |
4255 notices: dismissibleNotices, |
3949 onRemove: removeNotice |
4256 className: "edit-widgets-notices__dismissible", |
3950 }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SnackbarList, { |
4257 onRemove: removeNotice |
3951 notices: snackbarNotices, |
4258 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SnackbarList, { |
3952 className: "edit-widgets-notices__snackbar", |
4259 notices: snackbarNotices, |
3953 onRemove: removeNotice |
4260 className: "edit-widgets-notices__snackbar", |
3954 })); |
4261 onRemove: removeNotice |
3955 } |
4262 })] |
3956 |
4263 }); |
3957 /* harmony default export */ var notices = (Notices); |
4264 } |
|
4265 /* harmony default export */ const notices = (Notices); |
3958 |
4266 |
3959 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/widget-areas-block-editor-content/index.js |
4267 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/widget-areas-block-editor-content/index.js |
3960 |
4268 /** |
3961 |
4269 * WordPress dependencies |
3962 /** |
4270 */ |
3963 * WordPress dependencies |
4271 |
3964 */ |
4272 |
3965 |
4273 |
3966 |
4274 |
3967 |
4275 |
3968 |
4276 |
3969 /** |
4277 /** |
3970 * Internal dependencies |
4278 * Internal dependencies |
3971 */ |
4279 */ |
3972 |
4280 |
3973 |
4281 |
3974 |
4282 |
3975 function WidgetAreasBlockEditorContent(_ref) { |
4283 |
3976 let { |
4284 function WidgetAreasBlockEditorContent({ |
3977 blockEditorSettings |
4285 blockEditorSettings |
3978 } = _ref; |
4286 }) { |
3979 const hasThemeStyles = (0,external_wp_data_namespaceObject.useSelect)(select => !!select(external_wp_preferences_namespaceObject.store).get('core/edit-widgets', 'themeStyles'), []); |
4287 const hasThemeStyles = (0,external_wp_data_namespaceObject.useSelect)(select => !!select(external_wp_preferences_namespaceObject.store).get('core/edit-widgets', 'themeStyles'), []); |
|
4288 const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium'); |
3980 const styles = (0,external_wp_element_namespaceObject.useMemo)(() => { |
4289 const styles = (0,external_wp_element_namespaceObject.useMemo)(() => { |
3981 return hasThemeStyles ? blockEditorSettings.styles : []; |
4290 return hasThemeStyles ? blockEditorSettings.styles : []; |
3982 }, [blockEditorSettings, hasThemeStyles]); |
4291 }, [blockEditorSettings, hasThemeStyles]); |
3983 return (0,external_wp_element_namespaceObject.createElement)("div", { |
4292 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { |
3984 className: "edit-widgets-block-editor" |
4293 className: "edit-widgets-block-editor", |
3985 }, (0,external_wp_element_namespaceObject.createElement)(notices, null), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockTools, null, (0,external_wp_element_namespaceObject.createElement)(keyboard_shortcuts, null), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__unstableEditorStyles, { |
4294 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(notices, {}), !isLargeViewport && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockToolbar, { |
3986 styles: styles |
4295 hideDragHandle: true |
3987 }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockSelectionClearer, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.WritingFlow, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.ObserveTyping, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockList, { |
4296 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockTools, { |
3988 className: "edit-widgets-main-block-list" |
4297 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboard_shortcuts, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__unstableEditorStyles, { |
3989 })))))); |
4298 styles: styles, |
|
4299 scope: ".editor-styles-wrapper" |
|
4300 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockSelectionClearer, { |
|
4301 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.WritingFlow, { |
|
4302 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockList, { |
|
4303 className: "edit-widgets-main-block-list" |
|
4304 }) |
|
4305 }) |
|
4306 })] |
|
4307 })] |
|
4308 }); |
3990 } |
4309 } |
3991 |
4310 |
3992 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close.js |
4311 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close.js |
3993 |
4312 /** |
3994 |
4313 * WordPress dependencies |
3995 /** |
4314 */ |
3996 * WordPress dependencies |
4315 |
3997 */ |
4316 |
3998 |
4317 const close_close = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { |
3999 const close_close = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { |
|
4000 xmlns: "http://www.w3.org/2000/svg", |
4318 xmlns: "http://www.w3.org/2000/svg", |
4001 viewBox: "0 0 24 24" |
4319 viewBox: "0 0 24 24", |
4002 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { |
4320 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { |
4003 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" |
4321 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" |
4004 })); |
4322 }) |
4005 /* harmony default export */ var library_close = (close_close); |
4323 }); |
|
4324 /* harmony default export */ const library_close = (close_close); |
4006 |
4325 |
4007 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/hooks/use-widget-library-insertion-point.js |
4326 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/hooks/use-widget-library-insertion-point.js |
4008 /** |
4327 /** |
4009 * WordPress dependencies |
4328 * WordPress dependencies |
4010 */ |
4329 */ |
4011 |
4330 |
4012 |
4331 |
4013 |
4332 |
|
4333 |
4014 /** |
4334 /** |
4015 * Internal dependencies |
4335 * Internal dependencies |
4016 */ |
4336 */ |
4017 |
|
4018 |
|
4019 |
4337 |
4020 |
4338 |
4021 const useWidgetLibraryInsertionPoint = () => { |
4339 const useWidgetLibraryInsertionPoint = () => { |
4022 const firstRootId = (0,external_wp_data_namespaceObject.useSelect)(select => { |
4340 const firstRootId = (0,external_wp_data_namespaceObject.useSelect)(select => { |
4023 var _widgetAreasPost$bloc; |
|
4024 |
|
4025 // Default to the first widget area |
4341 // Default to the first widget area |
4026 const { |
4342 const { |
4027 getEntityRecord |
4343 getEntityRecord |
4028 } = select(external_wp_coreData_namespaceObject.store); |
4344 } = select(external_wp_coreData_namespaceObject.store); |
4029 const widgetAreasPost = getEntityRecord(KIND, POST_TYPE, buildWidgetAreasPostId()); |
4345 const widgetAreasPost = getEntityRecord(KIND, POST_TYPE, buildWidgetAreasPostId()); |
4030 return widgetAreasPost === null || widgetAreasPost === void 0 ? void 0 : (_widgetAreasPost$bloc = widgetAreasPost.blocks[0]) === null || _widgetAreasPost$bloc === void 0 ? void 0 : _widgetAreasPost$bloc.clientId; |
4346 return widgetAreasPost?.blocks[0]?.clientId; |
4031 }, []); |
4347 }, []); |
4032 return (0,external_wp_data_namespaceObject.useSelect)(select => { |
4348 return (0,external_wp_data_namespaceObject.useSelect)(select => { |
4033 const { |
4349 const { |
4034 getBlockRootClientId, |
4350 getBlockRootClientId, |
4035 getBlockSelectionEnd, |
4351 getBlockSelectionEnd, |
4036 getBlockOrder, |
4352 getBlockOrder, |
4037 getBlockIndex |
4353 getBlockIndex |
4038 } = select(external_wp_blockEditor_namespaceObject.store); |
4354 } = select(external_wp_blockEditor_namespaceObject.store); |
4039 |
4355 const insertionPoint = select(store_store).__experimentalGetInsertionPoint(); |
4040 const insertionPoint = select(store_store).__experimentalGetInsertionPoint(); // "Browse all" in the quick inserter will set the rootClientId to the current block. |
4356 |
|
4357 // "Browse all" in the quick inserter will set the rootClientId to the current block. |
4041 // Otherwise, it will just be undefined, and we'll have to handle it differently below. |
4358 // Otherwise, it will just be undefined, and we'll have to handle it differently below. |
4042 |
|
4043 |
|
4044 if (insertionPoint.rootClientId) { |
4359 if (insertionPoint.rootClientId) { |
4045 return insertionPoint; |
4360 return insertionPoint; |
4046 } |
4361 } |
4047 |
|
4048 const clientId = getBlockSelectionEnd() || firstRootId; |
4362 const clientId = getBlockSelectionEnd() || firstRootId; |
4049 const rootClientId = getBlockRootClientId(clientId); // If the selected block is at the root level, it's a widget area and |
4363 const rootClientId = getBlockRootClientId(clientId); |
|
4364 |
|
4365 // If the selected block is at the root level, it's a widget area and |
4050 // blocks can't be inserted here. Return this block as the root and the |
4366 // blocks can't be inserted here. Return this block as the root and the |
4051 // last child clientId indicating insertion at the end. |
4367 // last child clientId indicating insertion at the end. |
4052 |
|
4053 if (clientId && rootClientId === '') { |
4368 if (clientId && rootClientId === '') { |
4054 return { |
4369 return { |
4055 rootClientId: clientId, |
4370 rootClientId: clientId, |
4056 insertionIndex: getBlockOrder(clientId).length |
4371 insertionIndex: getBlockOrder(clientId).length |
4057 }; |
4372 }; |
4058 } |
4373 } |
4059 |
|
4060 return { |
4374 return { |
4061 rootClientId, |
4375 rootClientId, |
4062 insertionIndex: getBlockIndex(clientId) + 1 |
4376 insertionIndex: getBlockIndex(clientId) + 1 |
4063 }; |
4377 }; |
4064 }, [firstRootId]); |
4378 }, [firstRootId]); |
4065 }; |
4379 }; |
4066 |
4380 /* harmony default export */ const use_widget_library_insertion_point = (useWidgetLibraryInsertionPoint); |
4067 /* harmony default export */ var use_widget_library_insertion_point = (useWidgetLibraryInsertionPoint); |
|
4068 |
4381 |
4069 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/secondary-sidebar/inserter-sidebar.js |
4382 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/secondary-sidebar/inserter-sidebar.js |
4070 |
4383 /** |
4071 |
4384 * WordPress dependencies |
4072 |
4385 */ |
4073 /** |
4386 |
4074 * WordPress dependencies |
|
4075 */ |
|
4076 |
4387 |
4077 |
4388 |
4078 |
4389 |
4079 |
4390 |
4080 |
4391 |
4081 |
4392 |
4082 |
4393 |
4083 /** |
4394 /** |
4084 * Internal dependencies |
4395 * Internal dependencies |
4085 */ |
4396 */ |
|
4397 |
4086 |
4398 |
4087 |
4399 |
4088 |
4400 |
4089 function InserterSidebar() { |
4401 function InserterSidebar() { |
4090 const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); |
4402 const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); |
4353 * Warns the user if there are unsaved changes before leaving the editor. |
4667 * Warns the user if there are unsaved changes before leaving the editor. |
4354 * |
4668 * |
4355 * This is a duplicate of the component implemented in the editor package. |
4669 * This is a duplicate of the component implemented in the editor package. |
4356 * Duplicated here as edit-widgets doesn't depend on editor. |
4670 * Duplicated here as edit-widgets doesn't depend on editor. |
4357 * |
4671 * |
4358 * @return {WPComponent} The component. |
4672 * @return {Component} The component. |
4359 */ |
4673 */ |
4360 |
|
4361 function UnsavedChangesWarning() { |
4674 function UnsavedChangesWarning() { |
4362 const isDirty = (0,external_wp_data_namespaceObject.useSelect)(select => { |
4675 const isDirty = (0,external_wp_data_namespaceObject.useSelect)(select => { |
4363 const { |
4676 const { |
4364 getEditedWidgetAreas |
4677 getEditedWidgetAreas |
4365 } = select(store_store); |
4678 } = select(store_store); |
4366 const editedWidgetAreas = getEditedWidgetAreas(); |
4679 const editedWidgetAreas = getEditedWidgetAreas(); |
4367 return (editedWidgetAreas === null || editedWidgetAreas === void 0 ? void 0 : editedWidgetAreas.length) > 0; |
4680 return editedWidgetAreas?.length > 0; |
4368 }, []); |
4681 }, []); |
4369 (0,external_wp_element_namespaceObject.useEffect)(() => { |
4682 (0,external_wp_element_namespaceObject.useEffect)(() => { |
4370 /** |
4683 /** |
4371 * Warns the user if there are unsaved changes before leaving the editor. |
4684 * Warns the user if there are unsaved changes before leaving the editor. |
4372 * |
4685 * |
4373 * @param {Event} event `beforeunload` event. |
4686 * @param {Event} event `beforeunload` event. |
4374 * |
4687 * |
4375 * @return {?string} Warning prompt message, if unsaved changes exist. |
4688 * @return {string | undefined} Warning prompt message, if unsaved changes exist. |
4376 */ |
4689 */ |
4377 const warnIfUnsavedChanges = event => { |
4690 const warnIfUnsavedChanges = event => { |
4378 if (isDirty) { |
4691 if (isDirty) { |
4379 event.returnValue = (0,external_wp_i18n_namespaceObject.__)('You have unsaved changes. If you proceed, they will be lost.'); |
4692 event.returnValue = (0,external_wp_i18n_namespaceObject.__)('You have unsaved changes. If you proceed, they will be lost.'); |
4380 return event.returnValue; |
4693 return event.returnValue; |
4381 } |
4694 } |
4382 }; |
4695 }; |
4383 |
|
4384 window.addEventListener('beforeunload', warnIfUnsavedChanges); |
4696 window.addEventListener('beforeunload', warnIfUnsavedChanges); |
4385 return () => { |
4697 return () => { |
4386 window.removeEventListener('beforeunload', warnIfUnsavedChanges); |
4698 window.removeEventListener('beforeunload', warnIfUnsavedChanges); |
4387 }; |
4699 }; |
4388 }, [isDirty]); |
4700 }, [isDirty]); |
4389 return null; |
4701 return null; |
4390 } |
4702 } |
4391 |
4703 |
4392 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/welcome-guide/index.js |
4704 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/welcome-guide/index.js |
4393 |
4705 /** |
4394 |
4706 * WordPress dependencies |
4395 /** |
4707 */ |
4396 * WordPress dependencies |
4708 |
4397 */ |
|
4398 |
4709 |
4399 |
4710 |
4400 |
4711 |
4401 |
4712 |
4402 |
4713 |
4403 /** |
4714 /** |
4404 * Internal dependencies |
4715 * Internal dependencies |
4405 */ |
4716 */ |
|
4717 |
|
4718 |
4406 |
4719 |
4407 |
4720 |
4408 function WelcomeGuide() { |
4721 function WelcomeGuide() { |
4409 var _widgetAreas$filter$l; |
4722 var _widgetAreas$filter$l; |
4410 |
|
4411 const isActive = (0,external_wp_data_namespaceObject.useSelect)(select => !!select(external_wp_preferences_namespaceObject.store).get('core/edit-widgets', 'welcomeGuide'), []); |
4723 const isActive = (0,external_wp_data_namespaceObject.useSelect)(select => !!select(external_wp_preferences_namespaceObject.store).get('core/edit-widgets', 'welcomeGuide'), []); |
4412 const { |
4724 const { |
4413 toggle |
4725 toggle |
4414 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store); |
4726 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store); |
4415 const widgetAreas = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getWidgetAreas({ |
4727 const widgetAreas = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getWidgetAreas({ |
4416 per_page: -1 |
4728 per_page: -1 |
4417 }), []); |
4729 }), []); |
4418 |
|
4419 if (!isActive) { |
4730 if (!isActive) { |
4420 return null; |
4731 return null; |
4421 } |
4732 } |
4422 |
4733 const isEntirelyBlockWidgets = widgetAreas?.every(widgetArea => widgetArea.id === 'wp_inactive_widgets' || widgetArea.widgets.every(widgetId => widgetId.startsWith('block-'))); |
4423 const isEntirelyBlockWidgets = widgetAreas === null || widgetAreas === void 0 ? void 0 : widgetAreas.every(widgetArea => widgetArea.id === 'wp_inactive_widgets' || widgetArea.widgets.every(widgetId => widgetId.startsWith('block-'))); |
4734 const numWidgetAreas = (_widgetAreas$filter$l = widgetAreas?.filter(widgetArea => widgetArea.id !== 'wp_inactive_widgets').length) !== null && _widgetAreas$filter$l !== void 0 ? _widgetAreas$filter$l : 0; |
4424 const numWidgetAreas = (_widgetAreas$filter$l = widgetAreas === null || widgetAreas === void 0 ? void 0 : widgetAreas.filter(widgetArea => widgetArea.id !== 'wp_inactive_widgets').length) !== null && _widgetAreas$filter$l !== void 0 ? _widgetAreas$filter$l : 0; |
4735 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Guide, { |
4425 return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Guide, { |
|
4426 className: "edit-widgets-welcome-guide", |
4736 className: "edit-widgets-welcome-guide", |
4427 contentLabel: (0,external_wp_i18n_namespaceObject.__)('Welcome to block Widgets'), |
4737 contentLabel: (0,external_wp_i18n_namespaceObject.__)('Welcome to block Widgets'), |
4428 finishButtonText: (0,external_wp_i18n_namespaceObject.__)('Get started'), |
4738 finishButtonText: (0,external_wp_i18n_namespaceObject.__)('Get started'), |
4429 onFinish: () => toggle('core/edit-widgets', 'welcomeGuide'), |
4739 onFinish: () => toggle('core/edit-widgets', 'welcomeGuide'), |
4430 pages: [{ |
4740 pages: [{ |
4431 image: (0,external_wp_element_namespaceObject.createElement)(WelcomeGuideImage, { |
4741 image: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideImage, { |
4432 nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.svg", |
4742 nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.svg", |
4433 animatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.gif" |
4743 animatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.gif" |
4434 }), |
4744 }), |
4435 content: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("h1", { |
4745 content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
4436 className: "edit-widgets-welcome-guide__heading" |
4746 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { |
4437 }, (0,external_wp_i18n_namespaceObject.__)('Welcome to block Widgets')), isEntirelyBlockWidgets ? (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("p", { |
4747 className: "edit-widgets-welcome-guide__heading", |
4438 className: "edit-widgets-welcome-guide__text" |
4748 children: (0,external_wp_i18n_namespaceObject.__)('Welcome to block Widgets') |
4439 }, (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: %s: Number of block areas in the current theme. |
4749 }), isEntirelyBlockWidgets ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
4440 (0,external_wp_i18n_namespaceObject._n)('Your theme provides %s “block” area for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.', 'Your theme provides %s different “block” areas for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.', numWidgetAreas), numWidgetAreas))) : (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("p", { |
4750 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { |
4441 className: "edit-widgets-welcome-guide__text" |
4751 className: "edit-widgets-welcome-guide__text", |
4442 }, (0,external_wp_i18n_namespaceObject.__)('You can now add any block to your site’s widget areas. Don’t worry, all of your favorite widgets still work flawlessly.')), (0,external_wp_element_namespaceObject.createElement)("p", { |
4752 children: (0,external_wp_i18n_namespaceObject.sprintf)( |
4443 className: "edit-widgets-welcome-guide__text" |
4753 // Translators: %s: Number of block areas in the current theme. |
4444 }, (0,external_wp_element_namespaceObject.createElement)("strong", null, (0,external_wp_i18n_namespaceObject.__)('Want to stick with the old widgets?')), ' ', (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, { |
4754 (0,external_wp_i18n_namespaceObject._n)('Your theme provides %s “block” area for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.', 'Your theme provides %s different “block” areas for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.', numWidgetAreas), numWidgetAreas) |
4445 href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/plugins/classic-widgets/') |
4755 }) |
4446 }, (0,external_wp_i18n_namespaceObject.__)('Get the Classic Widgets plugin.'))))) |
4756 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
|
4757 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { |
|
4758 className: "edit-widgets-welcome-guide__text", |
|
4759 children: (0,external_wp_i18n_namespaceObject.__)('You can now add any block to your site’s widget areas. Don’t worry, all of your favorite widgets still work flawlessly.') |
|
4760 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("p", { |
|
4761 className: "edit-widgets-welcome-guide__text", |
|
4762 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("strong", { |
|
4763 children: (0,external_wp_i18n_namespaceObject.__)('Want to stick with the old widgets?') |
|
4764 }), ' ', /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { |
|
4765 href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/plugins/classic-widgets/'), |
|
4766 children: (0,external_wp_i18n_namespaceObject.__)('Get the Classic Widgets plugin.') |
|
4767 })] |
|
4768 })] |
|
4769 })] |
|
4770 }) |
4447 }, { |
4771 }, { |
4448 image: (0,external_wp_element_namespaceObject.createElement)(WelcomeGuideImage, { |
4772 image: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideImage, { |
4449 nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-editor.svg", |
4773 nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-editor.svg", |
4450 animatedSrc: "https://s.w.org/images/block-editor/welcome-editor.gif" |
4774 animatedSrc: "https://s.w.org/images/block-editor/welcome-editor.gif" |
4451 }), |
4775 }), |
4452 content: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("h1", { |
4776 content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
4453 className: "edit-widgets-welcome-guide__heading" |
4777 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { |
4454 }, (0,external_wp_i18n_namespaceObject.__)('Make each block your own')), (0,external_wp_element_namespaceObject.createElement)("p", { |
4778 className: "edit-widgets-welcome-guide__heading", |
4455 className: "edit-widgets-welcome-guide__text" |
4779 children: (0,external_wp_i18n_namespaceObject.__)('Make each block your own') |
4456 }, (0,external_wp_i18n_namespaceObject.__)('Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.'))) |
4780 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { |
|
4781 className: "edit-widgets-welcome-guide__text", |
|
4782 children: (0,external_wp_i18n_namespaceObject.__)('Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.') |
|
4783 })] |
|
4784 }) |
4457 }, { |
4785 }, { |
4458 image: (0,external_wp_element_namespaceObject.createElement)(WelcomeGuideImage, { |
4786 image: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideImage, { |
4459 nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-library.svg", |
4787 nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-library.svg", |
4460 animatedSrc: "https://s.w.org/images/block-editor/welcome-library.gif" |
4788 animatedSrc: "https://s.w.org/images/block-editor/welcome-library.gif" |
4461 }), |
4789 }), |
4462 content: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("h1", { |
4790 content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
4463 className: "edit-widgets-welcome-guide__heading" |
4791 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { |
4464 }, (0,external_wp_i18n_namespaceObject.__)('Get to know the block library')), (0,external_wp_element_namespaceObject.createElement)("p", { |
4792 className: "edit-widgets-welcome-guide__heading", |
4465 className: "edit-widgets-welcome-guide__text" |
4793 children: (0,external_wp_i18n_namespaceObject.__)('Get to know the block library') |
4466 }, (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('All of the blocks available to you live in the block library. You’ll find it wherever you see the <InserterIconImage /> icon.'), { |
4794 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { |
4467 InserterIconImage: (0,external_wp_element_namespaceObject.createElement)("img", { |
4795 className: "edit-widgets-welcome-guide__text", |
4468 className: "edit-widgets-welcome-guide__inserter-icon", |
4796 children: (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('All of the blocks available to you live in the block library. You’ll find it wherever you see the <InserterIconImage /> icon.'), { |
4469 alt: (0,external_wp_i18n_namespaceObject.__)('inserter'), |
4797 InserterIconImage: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { |
4470 src: "data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A" |
4798 className: "edit-widgets-welcome-guide__inserter-icon", |
4471 }) |
4799 alt: (0,external_wp_i18n_namespaceObject.__)('inserter'), |
4472 }))) |
4800 src: "data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A" |
|
4801 }) |
|
4802 }) |
|
4803 })] |
|
4804 }) |
4473 }, { |
4805 }, { |
4474 image: (0,external_wp_element_namespaceObject.createElement)(WelcomeGuideImage, { |
4806 image: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideImage, { |
4475 nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.svg", |
4807 nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.svg", |
4476 animatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.gif" |
4808 animatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.gif" |
4477 }), |
4809 }), |
4478 content: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("h1", { |
4810 content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
4479 className: "edit-widgets-welcome-guide__heading" |
4811 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { |
4480 }, (0,external_wp_i18n_namespaceObject.__)('Learn how to use the block editor')), (0,external_wp_element_namespaceObject.createElement)("p", { |
4812 className: "edit-widgets-welcome-guide__heading", |
4481 className: "edit-widgets-welcome-guide__text" |
4813 children: (0,external_wp_i18n_namespaceObject.__)('Learn how to use the block editor') |
4482 }, (0,external_wp_i18n_namespaceObject.__)('New to the block editor? Want to learn more about using it? '), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, { |
4814 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("p", { |
4483 href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/support/article/wordpress-editor/') |
4815 className: "edit-widgets-welcome-guide__text", |
4484 }, (0,external_wp_i18n_namespaceObject.__)("Here's a detailed guide.")))) |
4816 children: [(0,external_wp_i18n_namespaceObject.__)('New to the block editor? Want to learn more about using it? '), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { |
|
4817 href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/documentation/article/wordpress-block-editor/'), |
|
4818 children: (0,external_wp_i18n_namespaceObject.__)("Here's a detailed guide.") |
|
4819 })] |
|
4820 })] |
|
4821 }) |
4485 }] |
4822 }] |
4486 }); |
4823 }); |
4487 } |
4824 } |
4488 |
4825 function WelcomeGuideImage({ |
4489 function WelcomeGuideImage(_ref) { |
4826 nonAnimatedSrc, |
4490 let { |
4827 animatedSrc |
4491 nonAnimatedSrc, |
4828 }) { |
4492 animatedSrc |
4829 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("picture", { |
4493 } = _ref; |
4830 className: "edit-widgets-welcome-guide__image", |
4494 return (0,external_wp_element_namespaceObject.createElement)("picture", { |
4831 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("source", { |
4495 className: "edit-widgets-welcome-guide__image" |
4832 srcSet: nonAnimatedSrc, |
4496 }, (0,external_wp_element_namespaceObject.createElement)("source", { |
4833 media: "(prefers-reduced-motion: reduce)" |
4497 srcSet: nonAnimatedSrc, |
4834 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { |
4498 media: "(prefers-reduced-motion: reduce)" |
4835 src: animatedSrc, |
4499 }), (0,external_wp_element_namespaceObject.createElement)("img", { |
4836 width: "312", |
4500 src: animatedSrc, |
4837 height: "240", |
4501 width: "312", |
4838 alt: "" |
4502 height: "240", |
4839 })] |
4503 alt: "" |
4840 }); |
4504 })); |
|
4505 } |
4841 } |
4506 |
4842 |
4507 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/layout/index.js |
4843 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/layout/index.js |
4508 |
|
4509 |
|
4510 /** |
4844 /** |
4511 * WordPress dependencies |
4845 * WordPress dependencies |
4512 */ |
4846 */ |
4513 |
4847 |
4514 |
4848 |