91 /******/ return module.exports; |
107 /******/ return module.exports; |
92 /******/ } |
108 /******/ } |
93 /******/ |
109 /******/ |
94 /************************************************************************/ |
110 /************************************************************************/ |
95 /******/ /* webpack/runtime/compat get default export */ |
111 /******/ /* webpack/runtime/compat get default export */ |
96 /******/ !function() { |
112 /******/ (() => { |
97 /******/ // getDefaultExport function for compatibility with non-harmony modules |
113 /******/ // getDefaultExport function for compatibility with non-harmony modules |
98 /******/ __webpack_require__.n = function(module) { |
114 /******/ __webpack_require__.n = (module) => { |
99 /******/ var getter = module && module.__esModule ? |
115 /******/ var getter = module && module.__esModule ? |
100 /******/ function() { return module['default']; } : |
116 /******/ () => (module['default']) : |
101 /******/ function() { return module; }; |
117 /******/ () => (module); |
102 /******/ __webpack_require__.d(getter, { a: getter }); |
118 /******/ __webpack_require__.d(getter, { a: getter }); |
103 /******/ return getter; |
119 /******/ return getter; |
104 /******/ }; |
120 /******/ }; |
105 /******/ }(); |
121 /******/ })(); |
106 /******/ |
122 /******/ |
107 /******/ /* webpack/runtime/define property getters */ |
123 /******/ /* webpack/runtime/define property getters */ |
108 /******/ !function() { |
124 /******/ (() => { |
109 /******/ // define getter functions for harmony exports |
125 /******/ // define getter functions for harmony exports |
110 /******/ __webpack_require__.d = function(exports, definition) { |
126 /******/ __webpack_require__.d = (exports, definition) => { |
111 /******/ for(var key in definition) { |
127 /******/ for(var key in definition) { |
112 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { |
128 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { |
113 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); |
129 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); |
114 /******/ } |
130 /******/ } |
115 /******/ } |
131 /******/ } |
116 /******/ }; |
132 /******/ }; |
117 /******/ }(); |
133 /******/ })(); |
118 /******/ |
134 /******/ |
119 /******/ /* webpack/runtime/hasOwnProperty shorthand */ |
135 /******/ /* webpack/runtime/hasOwnProperty shorthand */ |
120 /******/ !function() { |
136 /******/ (() => { |
121 /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } |
137 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) |
122 /******/ }(); |
138 /******/ })(); |
123 /******/ |
139 /******/ |
124 /******/ /* webpack/runtime/make namespace object */ |
140 /******/ /* webpack/runtime/make namespace object */ |
125 /******/ !function() { |
141 /******/ (() => { |
126 /******/ // define __esModule on exports |
142 /******/ // define __esModule on exports |
127 /******/ __webpack_require__.r = function(exports) { |
143 /******/ __webpack_require__.r = (exports) => { |
128 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
144 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
129 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
145 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
130 /******/ } |
146 /******/ } |
131 /******/ Object.defineProperty(exports, '__esModule', { value: true }); |
147 /******/ Object.defineProperty(exports, '__esModule', { value: true }); |
132 /******/ }; |
148 /******/ }; |
133 /******/ }(); |
149 /******/ })(); |
134 /******/ |
150 /******/ |
135 /************************************************************************/ |
151 /************************************************************************/ |
136 var __webpack_exports__ = {}; |
152 var __webpack_exports__ = {}; |
137 // This entry need to be wrapped in an IIFE because it need to be in strict mode. |
153 // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. |
138 !function() { |
154 (() => { |
139 "use strict"; |
|
140 // ESM COMPAT FLAG |
155 // ESM COMPAT FLAG |
141 __webpack_require__.r(__webpack_exports__); |
156 __webpack_require__.r(__webpack_exports__); |
142 |
157 |
143 // EXPORTS |
158 // EXPORTS |
144 __webpack_require__.d(__webpack_exports__, { |
159 __webpack_require__.d(__webpack_exports__, { |
145 "initialize": function() { return /* binding */ initialize; } |
160 initialize: () => (/* binding */ initialize), |
|
161 store: () => (/* reexport */ store) |
146 }); |
162 }); |
147 |
163 |
148 // NAMESPACE OBJECT: ./node_modules/@wordpress/customize-widgets/build-module/store/selectors.js |
164 // NAMESPACE OBJECT: ./node_modules/@wordpress/customize-widgets/build-module/store/selectors.js |
149 var selectors_namespaceObject = {}; |
165 var selectors_namespaceObject = {}; |
150 __webpack_require__.r(selectors_namespaceObject); |
166 __webpack_require__.r(selectors_namespaceObject); |
151 __webpack_require__.d(selectors_namespaceObject, { |
167 __webpack_require__.d(selectors_namespaceObject, { |
152 "__experimentalGetInsertionPoint": function() { return __experimentalGetInsertionPoint; }, |
168 __experimentalGetInsertionPoint: () => (__experimentalGetInsertionPoint), |
153 "isInserterOpened": function() { return isInserterOpened; } |
169 isInserterOpened: () => (isInserterOpened) |
154 }); |
170 }); |
155 |
171 |
156 // NAMESPACE OBJECT: ./node_modules/@wordpress/customize-widgets/build-module/store/actions.js |
172 // NAMESPACE OBJECT: ./node_modules/@wordpress/customize-widgets/build-module/store/actions.js |
157 var actions_namespaceObject = {}; |
173 var actions_namespaceObject = {}; |
158 __webpack_require__.r(actions_namespaceObject); |
174 __webpack_require__.r(actions_namespaceObject); |
159 __webpack_require__.d(actions_namespaceObject, { |
175 __webpack_require__.d(actions_namespaceObject, { |
160 "setIsInserterOpened": function() { return setIsInserterOpened; } |
176 setIsInserterOpened: () => (setIsInserterOpened) |
161 }); |
177 }); |
162 |
178 |
163 // NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/store/actions.js |
|
164 var store_actions_namespaceObject = {}; |
|
165 __webpack_require__.r(store_actions_namespaceObject); |
|
166 __webpack_require__.d(store_actions_namespaceObject, { |
|
167 "disableComplementaryArea": function() { return disableComplementaryArea; }, |
|
168 "enableComplementaryArea": function() { return enableComplementaryArea; }, |
|
169 "pinItem": function() { return pinItem; }, |
|
170 "setFeatureDefaults": function() { return setFeatureDefaults; }, |
|
171 "setFeatureValue": function() { return setFeatureValue; }, |
|
172 "toggleFeature": function() { return toggleFeature; }, |
|
173 "unpinItem": function() { return unpinItem; } |
|
174 }); |
|
175 |
|
176 // NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/store/selectors.js |
|
177 var store_selectors_namespaceObject = {}; |
|
178 __webpack_require__.r(store_selectors_namespaceObject); |
|
179 __webpack_require__.d(store_selectors_namespaceObject, { |
|
180 "getActiveComplementaryArea": function() { return getActiveComplementaryArea; }, |
|
181 "isFeatureActive": function() { return isFeatureActive; }, |
|
182 "isItemPinned": function() { return isItemPinned; } |
|
183 }); |
|
184 |
|
185 ;// CONCATENATED MODULE: external ["wp","element"] |
179 ;// CONCATENATED MODULE: external ["wp","element"] |
186 var external_wp_element_namespaceObject = window["wp"]["element"]; |
180 const external_wp_element_namespaceObject = window["wp"]["element"]; |
187 ;// CONCATENATED MODULE: external ["wp","blockLibrary"] |
181 ;// CONCATENATED MODULE: external ["wp","blockLibrary"] |
188 var external_wp_blockLibrary_namespaceObject = window["wp"]["blockLibrary"]; |
182 const external_wp_blockLibrary_namespaceObject = window["wp"]["blockLibrary"]; |
189 ;// CONCATENATED MODULE: external ["wp","widgets"] |
183 ;// CONCATENATED MODULE: external ["wp","widgets"] |
190 var external_wp_widgets_namespaceObject = window["wp"]["widgets"]; |
184 const external_wp_widgets_namespaceObject = window["wp"]["widgets"]; |
191 ;// CONCATENATED MODULE: external ["wp","blocks"] |
185 ;// CONCATENATED MODULE: external ["wp","blocks"] |
192 var external_wp_blocks_namespaceObject = window["wp"]["blocks"]; |
186 const external_wp_blocks_namespaceObject = window["wp"]["blocks"]; |
193 ;// CONCATENATED MODULE: external ["wp","data"] |
187 ;// CONCATENATED MODULE: external ["wp","data"] |
194 var external_wp_data_namespaceObject = window["wp"]["data"]; |
188 const external_wp_data_namespaceObject = window["wp"]["data"]; |
195 ;// CONCATENATED MODULE: external ["wp","preferences"] |
189 ;// CONCATENATED MODULE: external ["wp","preferences"] |
196 var external_wp_preferences_namespaceObject = window["wp"]["preferences"]; |
190 const external_wp_preferences_namespaceObject = window["wp"]["preferences"]; |
197 ;// CONCATENATED MODULE: external ["wp","components"] |
191 ;// CONCATENATED MODULE: external ["wp","components"] |
198 var external_wp_components_namespaceObject = window["wp"]["components"]; |
192 const external_wp_components_namespaceObject = window["wp"]["components"]; |
199 ;// CONCATENATED MODULE: external ["wp","keyboardShortcuts"] |
|
200 var external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShortcuts"]; |
|
201 ;// CONCATENATED MODULE: external ["wp","i18n"] |
193 ;// CONCATENATED MODULE: external ["wp","i18n"] |
202 var external_wp_i18n_namespaceObject = window["wp"]["i18n"]; |
194 const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; |
203 ;// CONCATENATED MODULE: external ["wp","blockEditor"] |
195 ;// CONCATENATED MODULE: external ["wp","blockEditor"] |
204 var external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"]; |
196 const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"]; |
205 ;// CONCATENATED MODULE: external ["wp","compose"] |
197 ;// CONCATENATED MODULE: external ["wp","compose"] |
206 var external_wp_compose_namespaceObject = window["wp"]["compose"]; |
198 const external_wp_compose_namespaceObject = window["wp"]["compose"]; |
|
199 ;// CONCATENATED MODULE: external ["wp","hooks"] |
|
200 const external_wp_hooks_namespaceObject = window["wp"]["hooks"]; |
|
201 ;// CONCATENATED MODULE: external "ReactJSXRuntime" |
|
202 const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; |
207 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/components/error-boundary/index.js |
203 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/components/error-boundary/index.js |
208 |
204 /** |
209 |
205 * WordPress dependencies |
210 /** |
206 */ |
211 * WordPress dependencies |
207 |
212 */ |
208 |
213 |
209 |
214 |
210 |
215 |
211 |
216 |
212 |
217 |
213 |
218 |
214 function CopyButton({ |
219 function CopyButton(_ref) { |
215 text, |
220 let { |
216 children |
221 text, |
217 }) { |
222 children |
|
223 } = _ref; |
|
224 const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(text); |
218 const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(text); |
225 return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { |
219 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { |
226 variant: "secondary", |
220 variant: "secondary", |
227 ref: ref |
221 ref: ref, |
228 }, children); |
222 children: children |
229 } |
223 }); |
230 |
224 } |
231 class ErrorBoundary extends external_wp_element_namespaceObject.Component { |
225 class ErrorBoundary extends external_wp_element_namespaceObject.Component { |
232 constructor() { |
226 constructor() { |
233 super(...arguments); |
227 super(...arguments); |
234 this.state = { |
228 this.state = { |
235 error: null |
229 error: null |
236 }; |
230 }; |
237 } |
231 } |
238 |
|
239 componentDidCatch(error) { |
232 componentDidCatch(error) { |
240 this.setState({ |
233 this.setState({ |
241 error |
234 error |
242 }); |
235 }); |
243 } |
236 (0,external_wp_hooks_namespaceObject.doAction)('editor.ErrorBoundary.errorLogged', error); |
244 |
237 } |
245 render() { |
238 render() { |
246 const { |
239 const { |
247 error |
240 error |
248 } = this.state; |
241 } = this.state; |
249 |
|
250 if (!error) { |
242 if (!error) { |
251 return this.props.children; |
243 return this.props.children; |
252 } |
244 } |
253 |
245 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { |
254 return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, { |
|
255 className: "customize-widgets-error-boundary", |
246 className: "customize-widgets-error-boundary", |
256 actions: [(0,external_wp_element_namespaceObject.createElement)(CopyButton, { |
247 actions: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CopyButton, { |
257 key: "copy-error", |
248 text: error.stack, |
258 text: error.stack |
249 children: (0,external_wp_i18n_namespaceObject.__)('Copy Error') |
259 }, (0,external_wp_i18n_namespaceObject.__)('Copy Error'))] |
250 }, "copy-error")], |
260 }, (0,external_wp_i18n_namespaceObject.__)('The editor has encountered an unexpected error.')); |
251 children: (0,external_wp_i18n_namespaceObject.__)('The editor has encountered an unexpected error.') |
261 } |
252 }); |
262 |
253 } |
263 } |
254 } |
264 |
255 |
265 ;// CONCATENATED MODULE: external "lodash" |
|
266 var external_lodash_namespaceObject = window["lodash"]; |
|
267 ;// CONCATENATED MODULE: external ["wp","coreData"] |
256 ;// CONCATENATED MODULE: external ["wp","coreData"] |
268 var external_wp_coreData_namespaceObject = window["wp"]["coreData"]; |
257 const external_wp_coreData_namespaceObject = window["wp"]["coreData"]; |
269 ;// CONCATENATED MODULE: external ["wp","mediaUtils"] |
258 ;// CONCATENATED MODULE: external ["wp","mediaUtils"] |
270 var external_wp_mediaUtils_namespaceObject = window["wp"]["mediaUtils"]; |
259 const external_wp_mediaUtils_namespaceObject = window["wp"]["mediaUtils"]; |
271 ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js |
|
272 function _extends() { |
|
273 _extends = Object.assign ? Object.assign.bind() : function (target) { |
|
274 for (var i = 1; i < arguments.length; i++) { |
|
275 var source = arguments[i]; |
|
276 |
|
277 for (var key in source) { |
|
278 if (Object.prototype.hasOwnProperty.call(source, key)) { |
|
279 target[key] = source[key]; |
|
280 } |
|
281 } |
|
282 } |
|
283 |
|
284 return target; |
|
285 }; |
|
286 return _extends.apply(this, arguments); |
|
287 } |
|
288 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/components/block-inspector-button/index.js |
260 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/components/block-inspector-button/index.js |
289 |
261 /** |
290 |
262 * WordPress dependencies |
291 |
263 */ |
292 /** |
264 |
293 * WordPress dependencies |
265 |
294 */ |
266 |
295 |
267 |
296 |
268 |
297 |
269 |
298 |
270 function BlockInspectorButton({ |
299 |
271 inspector, |
300 |
272 closeMenu, |
301 function BlockInspectorButton(_ref) { |
273 ...props |
302 let { |
274 }) { |
303 inspector, |
|
304 closeMenu, |
|
305 ...props |
|
306 } = _ref; |
|
307 const selectedBlockClientId = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSelectedBlockClientId(), []); |
275 const selectedBlockClientId = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSelectedBlockClientId(), []); |
308 const selectedBlock = (0,external_wp_element_namespaceObject.useMemo)(() => document.getElementById(`block-${selectedBlockClientId}`), [selectedBlockClientId]); |
276 const selectedBlock = (0,external_wp_element_namespaceObject.useMemo)(() => document.getElementById(`block-${selectedBlockClientId}`), [selectedBlockClientId]); |
309 return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, _extends({ |
277 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { |
310 onClick: () => { |
278 onClick: () => { |
311 // Open the inspector. |
279 // Open the inspector. |
312 inspector.open({ |
280 inspector.open({ |
313 returnFocusWhenClose: selectedBlock |
281 returnFocusWhenClose: selectedBlock |
314 }); // Then close the dropdown menu. |
282 }); |
315 |
283 // Then close the dropdown menu. |
316 closeMenu(); |
284 closeMenu(); |
317 } |
285 }, |
318 }, props), (0,external_wp_i18n_namespaceObject.__)('Show more settings')); |
286 ...props, |
319 } |
287 children: (0,external_wp_i18n_namespaceObject.__)('Show more settings') |
320 |
288 }); |
321 /* harmony default export */ var block_inspector_button = (BlockInspectorButton); |
289 } |
322 |
290 /* harmony default export */ const block_inspector_button = (BlockInspectorButton); |
323 // EXTERNAL MODULE: ./node_modules/classnames/index.js |
291 |
324 var classnames = __webpack_require__(4403); |
292 ;// CONCATENATED MODULE: ./node_modules/clsx/dist/clsx.mjs |
325 var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); |
293 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); |
326 ;// CONCATENATED MODULE: external ["wp","keycodes"] |
294 ;// CONCATENATED MODULE: external ["wp","keycodes"] |
327 var external_wp_keycodes_namespaceObject = window["wp"]["keycodes"]; |
295 const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"]; |
328 ;// CONCATENATED MODULE: external ["wp","primitives"] |
296 ;// CONCATENATED MODULE: external ["wp","primitives"] |
329 var external_wp_primitives_namespaceObject = window["wp"]["primitives"]; |
297 const external_wp_primitives_namespaceObject = window["wp"]["primitives"]; |
330 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/undo.js |
298 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/undo.js |
331 |
299 /** |
332 |
300 * WordPress dependencies |
333 /** |
301 */ |
334 * WordPress dependencies |
302 |
335 */ |
303 |
336 |
304 const undo = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { |
337 const undo = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { |
|
338 xmlns: "http://www.w3.org/2000/svg", |
305 xmlns: "http://www.w3.org/2000/svg", |
339 viewBox: "0 0 24 24" |
306 viewBox: "0 0 24 24", |
340 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { |
307 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { |
341 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" |
308 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" |
342 })); |
309 }) |
343 /* harmony default export */ var library_undo = (undo); |
310 }); |
|
311 /* harmony default export */ const library_undo = (undo); |
344 |
312 |
345 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/redo.js |
313 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/redo.js |
346 |
314 /** |
347 |
315 * WordPress dependencies |
348 /** |
316 */ |
349 * WordPress dependencies |
317 |
350 */ |
318 |
351 |
319 const redo = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { |
352 const redo = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { |
|
353 xmlns: "http://www.w3.org/2000/svg", |
320 xmlns: "http://www.w3.org/2000/svg", |
354 viewBox: "0 0 24 24" |
321 viewBox: "0 0 24 24", |
355 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { |
322 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { |
356 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" |
323 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" |
357 })); |
324 }) |
358 /* harmony default export */ var library_redo = (redo); |
325 }); |
|
326 /* harmony default export */ const library_redo = (redo); |
359 |
327 |
360 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/plus.js |
328 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/plus.js |
361 |
329 /** |
362 |
330 * WordPress dependencies |
363 /** |
331 */ |
364 * WordPress dependencies |
332 |
365 */ |
333 |
366 |
334 const plus = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { |
367 const plus = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { |
|
368 xmlns: "http://www.w3.org/2000/svg", |
335 xmlns: "http://www.w3.org/2000/svg", |
369 viewBox: "0 0 24 24" |
336 viewBox: "0 0 24 24", |
370 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { |
337 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { |
371 d: "M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z" |
338 d: "M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z" |
372 })); |
339 }) |
373 /* harmony default export */ var library_plus = (plus); |
340 }); |
|
341 /* harmony default export */ const library_plus = (plus); |
374 |
342 |
375 ;// 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 |
376 |
344 /** |
377 |
345 * WordPress dependencies |
378 /** |
346 */ |
379 * WordPress dependencies |
347 |
380 */ |
348 |
381 |
349 const closeSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { |
382 const closeSmall = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { |
|
383 xmlns: "http://www.w3.org/2000/svg", |
350 xmlns: "http://www.w3.org/2000/svg", |
384 viewBox: "0 0 24 24" |
351 viewBox: "0 0 24 24", |
385 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { |
352 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { |
386 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" |
387 })); |
354 }) |
388 /* harmony default export */ var close_small = (closeSmall); |
355 }); |
|
356 /* harmony default export */ const close_small = (closeSmall); |
389 |
357 |
390 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/store/reducer.js |
358 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/store/reducer.js |
391 /** |
359 /** |
392 * WordPress dependencies |
360 * WordPress dependencies |
393 */ |
361 */ |
|
362 |
394 |
363 |
395 /** |
364 /** |
396 * Reducer tracking whether the inserter is open. |
365 * Reducer tracking whether the inserter is open. |
397 * |
366 * |
398 * @param {boolean|Object} state |
367 * @param {boolean|Object} state |
399 * @param {Object} action |
368 * @param {Object} action |
400 */ |
369 */ |
401 |
370 function blockInserterPanel(state = false, action) { |
402 function blockInserterPanel() { |
|
403 let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; |
|
404 let action = arguments.length > 1 ? arguments[1] : undefined; |
|
405 |
|
406 switch (action.type) { |
371 switch (action.type) { |
407 case 'SET_IS_INSERTER_OPENED': |
372 case 'SET_IS_INSERTER_OPENED': |
408 return action.value; |
373 return action.value; |
409 } |
374 } |
410 |
|
411 return state; |
375 return state; |
412 } |
376 } |
413 |
377 /* harmony default export */ const reducer = ((0,external_wp_data_namespaceObject.combineReducers)({ |
414 /* harmony default export */ var reducer = ((0,external_wp_data_namespaceObject.combineReducers)({ |
|
415 blockInserterPanel |
378 blockInserterPanel |
416 })); |
379 })); |
417 |
380 |
418 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/store/selectors.js |
381 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/store/selectors.js |
|
382 const EMPTY_INSERTION_POINT = { |
|
383 rootClientId: undefined, |
|
384 insertionIndex: undefined |
|
385 }; |
|
386 |
419 /** |
387 /** |
420 * Returns true if the inserter is opened. |
388 * Returns true if the inserter is opened. |
421 * |
389 * |
422 * @param {Object} state Global application state. |
390 * @param {Object} state Global application state. |
423 * |
391 * |
|
392 * @example |
|
393 * ```js |
|
394 * import { store as customizeWidgetsStore } from '@wordpress/customize-widgets'; |
|
395 * import { __ } from '@wordpress/i18n'; |
|
396 * import { useSelect } from '@wordpress/data'; |
|
397 * |
|
398 * const ExampleComponent = () => { |
|
399 * const { isInserterOpened } = useSelect( |
|
400 * ( select ) => select( customizeWidgetsStore ), |
|
401 * [] |
|
402 * ); |
|
403 * |
|
404 * return isInserterOpened() |
|
405 * ? __( 'Inserter is open' ) |
|
406 * : __( 'Inserter is closed.' ); |
|
407 * }; |
|
408 * ``` |
|
409 * |
424 * @return {boolean} Whether the inserter is opened. |
410 * @return {boolean} Whether the inserter is opened. |
425 */ |
411 */ |
426 function isInserterOpened(state) { |
412 function isInserterOpened(state) { |
427 return !!state.blockInserterPanel; |
413 return !!state.blockInserterPanel; |
428 } |
414 } |
|
415 |
429 /** |
416 /** |
430 * Get the insertion point for the inserter. |
417 * Get the insertion point for the inserter. |
431 * |
418 * |
432 * @param {Object} state Global application state. |
419 * @param {Object} state Global application state. |
433 * |
420 * |
434 * @return {Object} The root client ID and index to insert at. |
421 * @return {Object} The root client ID and index to insert at. |
435 */ |
422 */ |
436 |
|
437 function __experimentalGetInsertionPoint(state) { |
423 function __experimentalGetInsertionPoint(state) { |
438 const { |
424 if (typeof state.blockInserterPanel === 'boolean') { |
439 rootClientId, |
425 return EMPTY_INSERTION_POINT; |
440 insertionIndex |
426 } |
441 } = state.blockInserterPanel; |
427 return state.blockInserterPanel; |
442 return { |
|
443 rootClientId, |
|
444 insertionIndex |
|
445 }; |
|
446 } |
428 } |
447 |
429 |
448 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/store/actions.js |
430 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/store/actions.js |
449 /** |
431 /** |
450 * Returns an action object used to open/close the inserter. |
432 * Returns an action object used to open/close the inserter. |
524 * Internal dependencies |
530 * Internal dependencies |
525 */ |
531 */ |
526 |
532 |
527 |
533 |
528 |
534 |
529 function Inserter(_ref) { |
535 function Inserter({ |
530 let { |
536 setIsOpened |
531 setIsOpened |
537 }) { |
532 } = _ref; |
|
533 const inserterTitleId = (0,external_wp_compose_namespaceObject.useInstanceId)(Inserter, 'customize-widget-layout__inserter-panel-title'); |
538 const inserterTitleId = (0,external_wp_compose_namespaceObject.useInstanceId)(Inserter, 'customize-widget-layout__inserter-panel-title'); |
534 const insertionPoint = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).__experimentalGetInsertionPoint(), []); |
539 const insertionPoint = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).__experimentalGetInsertionPoint(), []); |
535 return (0,external_wp_element_namespaceObject.createElement)("div", { |
540 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { |
536 className: "customize-widgets-layout__inserter-panel", |
541 className: "customize-widgets-layout__inserter-panel", |
537 "aria-labelledby": inserterTitleId |
542 "aria-labelledby": inserterTitleId, |
538 }, (0,external_wp_element_namespaceObject.createElement)("div", { |
543 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { |
539 className: "customize-widgets-layout__inserter-panel-header" |
544 className: "customize-widgets-layout__inserter-panel-header", |
540 }, (0,external_wp_element_namespaceObject.createElement)("h2", { |
545 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { |
541 id: inserterTitleId, |
546 id: inserterTitleId, |
542 className: "customize-widgets-layout__inserter-panel-header-title" |
547 className: "customize-widgets-layout__inserter-panel-header-title", |
543 }, (0,external_wp_i18n_namespaceObject.__)('Add a block')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { |
548 children: (0,external_wp_i18n_namespaceObject.__)('Add a block') |
544 className: "customize-widgets-layout__inserter-panel-header-close-button", |
549 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { |
545 icon: close_small, |
550 className: "customize-widgets-layout__inserter-panel-header-close-button", |
546 onClick: () => setIsOpened(false), |
551 icon: close_small, |
547 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Close inserter') |
552 onClick: () => setIsOpened(false), |
548 })), (0,external_wp_element_namespaceObject.createElement)("div", { |
553 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Close inserter') |
549 className: "customize-widgets-layout__inserter-panel-content" |
554 })] |
550 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalLibrary, { |
555 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { |
551 rootClientId: insertionPoint.rootClientId, |
556 className: "customize-widgets-layout__inserter-panel-content", |
552 __experimentalInsertionIndex: insertionPoint.insertionIndex, |
557 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalLibrary, { |
553 showInserterHelpPanel: true, |
558 rootClientId: insertionPoint.rootClientId, |
554 onSelect: () => setIsOpened(false) |
559 __experimentalInsertionIndex: insertionPoint.insertionIndex, |
555 }))); |
560 showInserterHelpPanel: true, |
556 } |
561 onSelect: () => setIsOpened(false) |
557 |
562 }) |
558 /* harmony default export */ var components_inserter = (Inserter); |
563 })] |
|
564 }); |
|
565 } |
|
566 /* harmony default export */ const components_inserter = (Inserter); |
|
567 |
|
568 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/more-vertical.js |
|
569 /** |
|
570 * WordPress dependencies |
|
571 */ |
|
572 |
|
573 |
|
574 const moreVertical = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { |
|
575 xmlns: "http://www.w3.org/2000/svg", |
|
576 viewBox: "0 0 24 24", |
|
577 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { |
|
578 d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" |
|
579 }) |
|
580 }); |
|
581 /* harmony default export */ const more_vertical = (moreVertical); |
559 |
582 |
560 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/external.js |
583 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/external.js |
561 |
584 /** |
562 |
585 * WordPress dependencies |
563 /** |
586 */ |
564 * WordPress dependencies |
587 |
565 */ |
588 |
566 |
589 const external = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { |
567 const external = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { |
|
568 xmlns: "http://www.w3.org/2000/svg", |
590 xmlns: "http://www.w3.org/2000/svg", |
569 viewBox: "0 0 24 24" |
591 viewBox: "0 0 24 24", |
570 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { |
592 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { |
571 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" |
593 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" |
572 })); |
594 }) |
573 /* harmony default export */ var library_external = (external); |
|
574 |
|
575 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/more-vertical.js |
|
576 |
|
577 |
|
578 /** |
|
579 * WordPress dependencies |
|
580 */ |
|
581 |
|
582 const moreVertical = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { |
|
583 xmlns: "http://www.w3.org/2000/svg", |
|
584 viewBox: "0 0 24 24" |
|
585 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { |
|
586 d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" |
|
587 })); |
|
588 /* harmony default export */ var more_vertical = (moreVertical); |
|
589 |
|
590 ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/more-menu-dropdown/index.js |
|
591 |
|
592 |
|
593 /** |
|
594 * External dependencies |
|
595 */ |
|
596 |
|
597 /** |
|
598 * WordPress dependencies |
|
599 */ |
|
600 |
|
601 |
|
602 |
|
603 |
|
604 function MoreMenuDropdown(_ref) { |
|
605 let { |
|
606 as: DropdownComponent = external_wp_components_namespaceObject.DropdownMenu, |
|
607 className, |
|
608 |
|
609 /* translators: button label text should, if possible, be under 16 characters. */ |
|
610 label = (0,external_wp_i18n_namespaceObject.__)('Options'), |
|
611 popoverProps, |
|
612 toggleProps, |
|
613 children |
|
614 } = _ref; |
|
615 return (0,external_wp_element_namespaceObject.createElement)(DropdownComponent, { |
|
616 className: classnames_default()('interface-more-menu-dropdown', className), |
|
617 icon: more_vertical, |
|
618 label: label, |
|
619 popoverProps: { |
|
620 position: 'bottom left', |
|
621 ...popoverProps, |
|
622 className: classnames_default()('interface-more-menu-dropdown__content', popoverProps === null || popoverProps === void 0 ? void 0 : popoverProps.className) |
|
623 }, |
|
624 toggleProps: { |
|
625 tooltipPosition: 'bottom', |
|
626 ...toggleProps |
|
627 } |
|
628 }, onClose => children(onClose)); |
|
629 } |
|
630 |
|
631 ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/index.js |
|
632 |
|
633 |
|
634 |
|
635 |
|
636 |
|
637 |
|
638 |
|
639 |
|
640 |
|
641 |
|
642 |
|
643 |
|
644 |
|
645 ;// CONCATENATED MODULE: external ["wp","deprecated"] |
|
646 var external_wp_deprecated_namespaceObject = window["wp"]["deprecated"]; |
|
647 var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject); |
|
648 ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/actions.js |
|
649 /** |
|
650 * WordPress dependencies |
|
651 */ |
|
652 |
|
653 |
|
654 /** |
|
655 * Enable the complementary area. |
|
656 * |
|
657 * @param {string} scope Complementary area scope. |
|
658 * @param {string} area Area identifier. |
|
659 */ |
|
660 |
|
661 const enableComplementaryArea = (scope, area) => _ref => { |
|
662 let { |
|
663 registry |
|
664 } = _ref; |
|
665 |
|
666 // Return early if there's no area. |
|
667 if (!area) { |
|
668 return; |
|
669 } |
|
670 |
|
671 registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'complementaryArea', area); |
|
672 }; |
|
673 /** |
|
674 * Disable the complementary area. |
|
675 * |
|
676 * @param {string} scope Complementary area scope. |
|
677 */ |
|
678 |
|
679 const disableComplementaryArea = scope => _ref2 => { |
|
680 let { |
|
681 registry |
|
682 } = _ref2; |
|
683 registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'complementaryArea', null); |
|
684 }; |
|
685 /** |
|
686 * Pins an item. |
|
687 * |
|
688 * @param {string} scope Item scope. |
|
689 * @param {string} item Item identifier. |
|
690 * |
|
691 * @return {Object} Action object. |
|
692 */ |
|
693 |
|
694 const pinItem = (scope, item) => _ref3 => { |
|
695 let { |
|
696 registry |
|
697 } = _ref3; |
|
698 |
|
699 // Return early if there's no item. |
|
700 if (!item) { |
|
701 return; |
|
702 } |
|
703 |
|
704 const pinnedItems = registry.select(external_wp_preferences_namespaceObject.store).get(scope, 'pinnedItems'); // The item is already pinned, there's nothing to do. |
|
705 |
|
706 if ((pinnedItems === null || pinnedItems === void 0 ? void 0 : pinnedItems[item]) === true) { |
|
707 return; |
|
708 } |
|
709 |
|
710 registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'pinnedItems', { ...pinnedItems, |
|
711 [item]: true |
|
712 }); |
|
713 }; |
|
714 /** |
|
715 * Unpins an item. |
|
716 * |
|
717 * @param {string} scope Item scope. |
|
718 * @param {string} item Item identifier. |
|
719 */ |
|
720 |
|
721 const unpinItem = (scope, item) => _ref4 => { |
|
722 let { |
|
723 registry |
|
724 } = _ref4; |
|
725 |
|
726 // Return early if there's no item. |
|
727 if (!item) { |
|
728 return; |
|
729 } |
|
730 |
|
731 const pinnedItems = registry.select(external_wp_preferences_namespaceObject.store).get(scope, 'pinnedItems'); |
|
732 registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'pinnedItems', { ...pinnedItems, |
|
733 [item]: false |
|
734 }); |
|
735 }; |
|
736 /** |
|
737 * Returns an action object used in signalling that a feature should be toggled. |
|
738 * |
|
739 * @param {string} scope The feature scope (e.g. core/edit-post). |
|
740 * @param {string} featureName The feature name. |
|
741 */ |
|
742 |
|
743 function toggleFeature(scope, featureName) { |
|
744 return function (_ref5) { |
|
745 let { |
|
746 registry |
|
747 } = _ref5; |
|
748 external_wp_deprecated_default()(`dispatch( 'core/interface' ).toggleFeature`, { |
|
749 since: '6.0', |
|
750 alternative: `dispatch( 'core/preferences' ).toggle` |
|
751 }); |
|
752 registry.dispatch(external_wp_preferences_namespaceObject.store).toggle(scope, featureName); |
|
753 }; |
|
754 } |
|
755 /** |
|
756 * Returns an action object used in signalling that a feature should be set to |
|
757 * a true or false value |
|
758 * |
|
759 * @param {string} scope The feature scope (e.g. core/edit-post). |
|
760 * @param {string} featureName The feature name. |
|
761 * @param {boolean} value The value to set. |
|
762 * |
|
763 * @return {Object} Action object. |
|
764 */ |
|
765 |
|
766 function setFeatureValue(scope, featureName, value) { |
|
767 return function (_ref6) { |
|
768 let { |
|
769 registry |
|
770 } = _ref6; |
|
771 external_wp_deprecated_default()(`dispatch( 'core/interface' ).setFeatureValue`, { |
|
772 since: '6.0', |
|
773 alternative: `dispatch( 'core/preferences' ).set` |
|
774 }); |
|
775 registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, featureName, !!value); |
|
776 }; |
|
777 } |
|
778 /** |
|
779 * Returns an action object used in signalling that defaults should be set for features. |
|
780 * |
|
781 * @param {string} scope The feature scope (e.g. core/edit-post). |
|
782 * @param {Object<string, boolean>} defaults A key/value map of feature names to values. |
|
783 * |
|
784 * @return {Object} Action object. |
|
785 */ |
|
786 |
|
787 function setFeatureDefaults(scope, defaults) { |
|
788 return function (_ref7) { |
|
789 let { |
|
790 registry |
|
791 } = _ref7; |
|
792 external_wp_deprecated_default()(`dispatch( 'core/interface' ).setFeatureDefaults`, { |
|
793 since: '6.0', |
|
794 alternative: `dispatch( 'core/preferences' ).setDefaults` |
|
795 }); |
|
796 registry.dispatch(external_wp_preferences_namespaceObject.store).setDefaults(scope, defaults); |
|
797 }; |
|
798 } |
|
799 |
|
800 ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/selectors.js |
|
801 /** |
|
802 * WordPress dependencies |
|
803 */ |
|
804 |
|
805 |
|
806 |
|
807 /** |
|
808 * Returns the complementary area that is active in a given scope. |
|
809 * |
|
810 * @param {Object} state Global application state. |
|
811 * @param {string} scope Item scope. |
|
812 * |
|
813 * @return {string} The complementary area that is active in the given scope. |
|
814 */ |
|
815 |
|
816 const getActiveComplementaryArea = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope) => { |
|
817 return select(external_wp_preferences_namespaceObject.store).get(scope, 'complementaryArea'); |
|
818 }); |
595 }); |
819 /** |
596 /* harmony default export */ const library_external = (external); |
820 * Returns a boolean indicating if an item is pinned or not. |
597 |
821 * |
598 ;// CONCATENATED MODULE: external ["wp","keyboardShortcuts"] |
822 * @param {Object} state Global application state. |
599 const external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShortcuts"]; |
823 * @param {string} scope Scope. |
|
824 * @param {string} item Item to check. |
|
825 * |
|
826 * @return {boolean} True if the item is pinned and false otherwise. |
|
827 */ |
|
828 |
|
829 const isItemPinned = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope, item) => { |
|
830 var _pinnedItems$item; |
|
831 |
|
832 const pinnedItems = select(external_wp_preferences_namespaceObject.store).get(scope, 'pinnedItems'); |
|
833 return (_pinnedItems$item = pinnedItems === null || pinnedItems === void 0 ? void 0 : pinnedItems[item]) !== null && _pinnedItems$item !== void 0 ? _pinnedItems$item : true; |
|
834 }); |
|
835 /** |
|
836 * Returns a boolean indicating whether a feature is active for a particular |
|
837 * scope. |
|
838 * |
|
839 * @param {Object} state The store state. |
|
840 * @param {string} scope The scope of the feature (e.g. core/edit-post). |
|
841 * @param {string} featureName The name of the feature. |
|
842 * |
|
843 * @return {boolean} Is the feature enabled? |
|
844 */ |
|
845 |
|
846 const isFeatureActive = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope, featureName) => { |
|
847 external_wp_deprecated_default()(`select( 'core/interface' ).isFeatureActive( scope, featureName )`, { |
|
848 since: '6.0', |
|
849 alternative: `select( 'core/preferences' ).get( scope, featureName )` |
|
850 }); |
|
851 return !!select(external_wp_preferences_namespaceObject.store).get(scope, featureName); |
|
852 }); |
|
853 |
|
854 ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/constants.js |
|
855 /** |
|
856 * The identifier for the data store. |
|
857 * |
|
858 * @type {string} |
|
859 */ |
|
860 const constants_STORE_NAME = 'core/interface'; |
|
861 |
|
862 ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/index.js |
|
863 /** |
|
864 * WordPress dependencies |
|
865 */ |
|
866 |
|
867 /** |
|
868 * Internal dependencies |
|
869 */ |
|
870 |
|
871 |
|
872 |
|
873 |
|
874 /** |
|
875 * Store definition for the interface namespace. |
|
876 * |
|
877 * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore |
|
878 * |
|
879 * @type {Object} |
|
880 */ |
|
881 |
|
882 const store_store = (0,external_wp_data_namespaceObject.createReduxStore)(constants_STORE_NAME, { |
|
883 reducer: () => {}, |
|
884 actions: store_actions_namespaceObject, |
|
885 selectors: store_selectors_namespaceObject |
|
886 }); // Once we build a more generic persistence plugin that works across types of stores |
|
887 // we'd be able to replace this with a register call. |
|
888 |
|
889 (0,external_wp_data_namespaceObject.register)(store_store); |
|
890 |
|
891 ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/index.js |
|
892 |
|
893 |
|
894 |
|
895 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/components/keyboard-shortcut-help-modal/config.js |
600 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/components/keyboard-shortcut-help-modal/config.js |
896 /** |
601 /** |
897 * WordPress dependencies |
602 * WordPress dependencies |
898 */ |
603 */ |
899 |
604 |
921 character: 'k' |
626 character: 'k' |
922 }, |
627 }, |
923 description: (0,external_wp_i18n_namespaceObject.__)('Remove a link.') |
628 description: (0,external_wp_i18n_namespaceObject.__)('Remove a link.') |
924 }, { |
629 }, { |
925 keyCombination: { |
630 keyCombination: { |
|
631 character: '[[' |
|
632 }, |
|
633 description: (0,external_wp_i18n_namespaceObject.__)('Insert a link to a post or page.') |
|
634 }, { |
|
635 keyCombination: { |
926 modifier: 'primary', |
636 modifier: 'primary', |
927 character: 'u' |
637 character: 'u' |
928 }, |
638 }, |
929 description: (0,external_wp_i18n_namespaceObject.__)('Underline the selected text.') |
639 description: (0,external_wp_i18n_namespaceObject.__)('Underline the selected text.') |
|
640 }, { |
|
641 keyCombination: { |
|
642 modifier: 'access', |
|
643 character: 'd' |
|
644 }, |
|
645 description: (0,external_wp_i18n_namespaceObject.__)('Strikethrough the selected text.') |
|
646 }, { |
|
647 keyCombination: { |
|
648 modifier: 'access', |
|
649 character: 'x' |
|
650 }, |
|
651 description: (0,external_wp_i18n_namespaceObject.__)('Make the selected text inline code.') |
|
652 }, { |
|
653 keyCombination: { |
|
654 modifier: 'access', |
|
655 character: '0' |
|
656 }, |
|
657 aliases: [{ |
|
658 modifier: 'access', |
|
659 character: '7' |
|
660 }], |
|
661 description: (0,external_wp_i18n_namespaceObject.__)('Convert the current heading to a paragraph.') |
|
662 }, { |
|
663 keyCombination: { |
|
664 modifier: 'access', |
|
665 character: '1-6' |
|
666 }, |
|
667 description: (0,external_wp_i18n_namespaceObject.__)('Convert the current paragraph or heading to a heading of level 1 to 6.') |
|
668 }, { |
|
669 keyCombination: { |
|
670 modifier: 'primaryShift', |
|
671 character: 'SPACE' |
|
672 }, |
|
673 description: (0,external_wp_i18n_namespaceObject.__)('Add non breaking space.') |
930 }]; |
674 }]; |
931 |
675 |
932 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/components/keyboard-shortcut-help-modal/shortcut.js |
676 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/components/keyboard-shortcut-help-modal/shortcut.js |
933 |
677 /** |
934 |
678 * WordPress dependencies |
935 /** |
679 */ |
936 * External dependencies |
680 |
937 */ |
681 |
938 |
682 |
939 /** |
683 |
940 * WordPress dependencies |
684 |
941 */ |
685 function KeyCombination({ |
942 |
686 keyCombination, |
943 |
687 forceAriaLabel |
944 |
688 }) { |
945 |
|
946 function KeyCombination(_ref) { |
|
947 let { |
|
948 keyCombination, |
|
949 forceAriaLabel |
|
950 } = _ref; |
|
951 const shortcut = keyCombination.modifier ? external_wp_keycodes_namespaceObject.displayShortcutList[keyCombination.modifier](keyCombination.character) : keyCombination.character; |
689 const shortcut = keyCombination.modifier ? external_wp_keycodes_namespaceObject.displayShortcutList[keyCombination.modifier](keyCombination.character) : keyCombination.character; |
952 const ariaLabel = keyCombination.modifier ? external_wp_keycodes_namespaceObject.shortcutAriaLabel[keyCombination.modifier](keyCombination.character) : keyCombination.character; |
690 const ariaLabel = keyCombination.modifier ? external_wp_keycodes_namespaceObject.shortcutAriaLabel[keyCombination.modifier](keyCombination.character) : keyCombination.character; |
953 return (0,external_wp_element_namespaceObject.createElement)("kbd", { |
691 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("kbd", { |
954 className: "customize-widgets-keyboard-shortcut-help-modal__shortcut-key-combination", |
692 className: "customize-widgets-keyboard-shortcut-help-modal__shortcut-key-combination", |
955 "aria-label": forceAriaLabel || ariaLabel |
693 "aria-label": forceAriaLabel || ariaLabel, |
956 }, (0,external_lodash_namespaceObject.castArray)(shortcut).map((character, index) => { |
694 children: (Array.isArray(shortcut) ? shortcut : [shortcut]).map((character, index) => { |
957 if (character === '+') { |
695 if (character === '+') { |
958 return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, { |
696 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.Fragment, { |
959 key: index |
697 children: character |
960 }, character); |
698 }, index); |
961 } |
699 } |
962 |
700 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("kbd", { |
963 return (0,external_wp_element_namespaceObject.createElement)("kbd", { |
701 className: "customize-widgets-keyboard-shortcut-help-modal__shortcut-key", |
964 key: index, |
702 children: character |
965 className: "customize-widgets-keyboard-shortcut-help-modal__shortcut-key" |
703 }, index); |
966 }, character); |
704 }) |
967 })); |
705 }); |
968 } |
706 } |
969 |
707 function Shortcut({ |
970 function Shortcut(_ref2) { |
708 description, |
971 let { |
709 keyCombination, |
972 description, |
710 aliases = [], |
973 keyCombination, |
711 ariaLabel |
974 aliases = [], |
712 }) { |
975 ariaLabel |
713 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
976 } = _ref2; |
714 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { |
977 return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", { |
715 className: "customize-widgets-keyboard-shortcut-help-modal__shortcut-description", |
978 className: "customize-widgets-keyboard-shortcut-help-modal__shortcut-description" |
716 children: description |
979 }, description), (0,external_wp_element_namespaceObject.createElement)("div", { |
717 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { |
980 className: "customize-widgets-keyboard-shortcut-help-modal__shortcut-term" |
718 className: "customize-widgets-keyboard-shortcut-help-modal__shortcut-term", |
981 }, (0,external_wp_element_namespaceObject.createElement)(KeyCombination, { |
719 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(KeyCombination, { |
982 keyCombination: keyCombination, |
720 keyCombination: keyCombination, |
983 forceAriaLabel: ariaLabel |
721 forceAriaLabel: ariaLabel |
984 }), aliases.map((alias, index) => (0,external_wp_element_namespaceObject.createElement)(KeyCombination, { |
722 }), aliases.map((alias, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(KeyCombination, { |
985 keyCombination: alias, |
723 keyCombination: alias, |
986 forceAriaLabel: ariaLabel, |
724 forceAriaLabel: ariaLabel |
987 key: index |
725 }, index))] |
988 })))); |
726 })] |
989 } |
727 }); |
990 |
728 } |
991 /* harmony default export */ var keyboard_shortcut_help_modal_shortcut = (Shortcut); |
729 /* harmony default export */ const keyboard_shortcut_help_modal_shortcut = (Shortcut); |
992 |
730 |
993 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js |
731 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js |
994 |
732 /** |
995 |
733 * WordPress dependencies |
996 /** |
734 */ |
997 * WordPress dependencies |
735 |
998 */ |
|
999 |
736 |
1000 |
737 |
1001 /** |
738 /** |
1002 * Internal dependencies |
739 * Internal dependencies |
1003 */ |
740 */ |
1004 |
741 |
1005 |
742 |
1006 |
743 function DynamicShortcut({ |
1007 function DynamicShortcut(_ref) { |
744 name |
1008 let { |
745 }) { |
1009 name |
|
1010 } = _ref; |
|
1011 const { |
746 const { |
1012 keyCombination, |
747 keyCombination, |
1013 description, |
748 description, |
1014 aliases |
749 aliases |
1015 } = (0,external_wp_data_namespaceObject.useSelect)(select => { |
750 } = (0,external_wp_data_namespaceObject.useSelect)(select => { |
1187 |
904 |
1188 |
905 |
1189 /** |
906 /** |
1190 * Internal dependencies |
907 * Internal dependencies |
1191 */ |
908 */ |
|
909 |
|
910 |
1192 |
911 |
1193 |
912 |
1194 function MoreMenu() { |
913 function MoreMenu() { |
1195 const [isKeyboardShortcutsModalActive, setIsKeyboardShortcutsModalVisible] = (0,external_wp_element_namespaceObject.useState)(false); |
914 const [isKeyboardShortcutsModalActive, setIsKeyboardShortcutsModalVisible] = (0,external_wp_element_namespaceObject.useState)(false); |
1196 |
|
1197 const toggleKeyboardShortcutsModal = () => setIsKeyboardShortcutsModalVisible(!isKeyboardShortcutsModalActive); |
915 const toggleKeyboardShortcutsModal = () => setIsKeyboardShortcutsModalVisible(!isKeyboardShortcutsModalActive); |
1198 |
|
1199 (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/customize-widgets/keyboard-shortcuts', toggleKeyboardShortcutsModal); |
916 (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/customize-widgets/keyboard-shortcuts', toggleKeyboardShortcutsModal); |
1200 return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(MoreMenuDropdown, { |
917 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
1201 as: external_wp_components_namespaceObject.ToolbarDropdownMenu |
918 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarDropdownMenu, { |
1202 }, () => (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, { |
919 icon: more_vertical, |
1203 label: (0,external_wp_i18n_namespaceObject._x)('View', 'noun') |
920 label: (0,external_wp_i18n_namespaceObject.__)('Options'), |
1204 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, { |
921 popoverProps: { |
1205 scope: "core/customize-widgets", |
922 placement: 'bottom-end', |
1206 name: "fixedToolbar", |
923 className: 'more-menu-dropdown__content' |
1207 label: (0,external_wp_i18n_namespaceObject.__)('Top toolbar'), |
924 }, |
1208 info: (0,external_wp_i18n_namespaceObject.__)('Access all block and document tools in a single place'), |
925 toggleProps: { |
1209 messageActivated: (0,external_wp_i18n_namespaceObject.__)('Top toolbar activated'), |
926 tooltipPosition: 'bottom', |
1210 messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Top toolbar deactivated') |
927 size: 'compact' |
1211 })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, { |
928 }, |
1212 label: (0,external_wp_i18n_namespaceObject.__)('Tools') |
929 children: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
1213 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { |
930 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { |
1214 onClick: () => { |
931 label: (0,external_wp_i18n_namespaceObject._x)('View', 'noun'), |
1215 setIsKeyboardShortcutsModalVisible(true); |
932 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, { |
1216 }, |
933 scope: "core/customize-widgets", |
1217 shortcut: external_wp_keycodes_namespaceObject.displayShortcut.access('h') |
934 name: "fixedToolbar", |
1218 }, (0,external_wp_i18n_namespaceObject.__)('Keyboard shortcuts')), (0,external_wp_element_namespaceObject.createElement)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, { |
935 label: (0,external_wp_i18n_namespaceObject.__)('Top toolbar'), |
1219 scope: "core/customize-widgets", |
936 info: (0,external_wp_i18n_namespaceObject.__)('Access all block and document tools in a single place'), |
1220 name: "welcomeGuide", |
937 messageActivated: (0,external_wp_i18n_namespaceObject.__)('Top toolbar activated'), |
1221 label: (0,external_wp_i18n_namespaceObject.__)('Welcome Guide') |
938 messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Top toolbar deactivated') |
1222 }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { |
939 }) |
1223 role: "menuitem", |
940 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { |
1224 icon: library_external, |
941 label: (0,external_wp_i18n_namespaceObject.__)('Tools'), |
1225 href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/support/article/block-based-widgets-editor/'), |
942 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { |
1226 target: "_blank", |
943 onClick: () => { |
1227 rel: "noopener noreferrer" |
944 setIsKeyboardShortcutsModalVisible(true); |
1228 }, (0,external_wp_i18n_namespaceObject.__)('Help'), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, { |
945 }, |
1229 as: "span" |
946 shortcut: external_wp_keycodes_namespaceObject.displayShortcut.access('h'), |
1230 }, |
947 children: (0,external_wp_i18n_namespaceObject.__)('Keyboard shortcuts') |
1231 /* translators: accessibility text */ |
948 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, { |
1232 (0,external_wp_i18n_namespaceObject.__)('(opens in a new tab)')))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, { |
949 scope: "core/customize-widgets", |
1233 label: (0,external_wp_i18n_namespaceObject.__)('Preferences') |
950 name: "welcomeGuide", |
1234 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, { |
951 label: (0,external_wp_i18n_namespaceObject.__)('Welcome Guide') |
1235 scope: "core/customize-widgets", |
952 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuItem, { |
1236 name: "keepCaretInsideBlock", |
953 role: "menuitem", |
1237 label: (0,external_wp_i18n_namespaceObject.__)('Contain text cursor inside block'), |
954 icon: library_external, |
1238 info: (0,external_wp_i18n_namespaceObject.__)('Aids screen readers by stopping text caret from leaving blocks.'), |
955 href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/documentation/article/block-based-widgets-editor/'), |
1239 messageActivated: (0,external_wp_i18n_namespaceObject.__)('Contain text cursor inside block activated'), |
956 target: "_blank", |
1240 messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Contain text cursor inside block deactivated') |
957 rel: "noopener noreferrer", |
1241 })))), (0,external_wp_element_namespaceObject.createElement)(KeyboardShortcutHelpModal, { |
958 children: [(0,external_wp_i18n_namespaceObject.__)('Help'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { |
1242 isModalActive: isKeyboardShortcutsModalActive, |
959 as: "span", |
1243 toggleModal: toggleKeyboardShortcutsModal |
960 children: /* translators: accessibility text */ |
1244 })); |
961 (0,external_wp_i18n_namespaceObject.__)('(opens in a new tab)') |
|
962 })] |
|
963 })] |
|
964 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { |
|
965 label: (0,external_wp_i18n_namespaceObject.__)('Preferences'), |
|
966 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, { |
|
967 scope: "core/customize-widgets", |
|
968 name: "keepCaretInsideBlock", |
|
969 label: (0,external_wp_i18n_namespaceObject.__)('Contain text cursor inside block'), |
|
970 info: (0,external_wp_i18n_namespaceObject.__)('Aids screen readers by stopping text caret from leaving blocks.'), |
|
971 messageActivated: (0,external_wp_i18n_namespaceObject.__)('Contain text cursor inside block activated'), |
|
972 messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Contain text cursor inside block deactivated') |
|
973 }) |
|
974 })] |
|
975 }) |
|
976 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(KeyboardShortcutHelpModal, { |
|
977 isModalActive: isKeyboardShortcutsModalActive, |
|
978 toggleModal: toggleKeyboardShortcutsModal |
|
979 })] |
|
980 }); |
1245 } |
981 } |
1246 |
982 |
1247 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/components/header/index.js |
983 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/components/header/index.js |
1248 |
|
1249 |
|
1250 /** |
984 /** |
1251 * External dependencies |
985 * External dependencies |
1252 */ |
986 */ |
1253 |
987 |
|
988 |
1254 /** |
989 /** |
1255 * WordPress dependencies |
990 * WordPress dependencies |
1256 */ |
991 */ |
1257 |
992 |
1258 |
993 |
1266 */ |
1001 */ |
1267 |
1002 |
1268 |
1003 |
1269 |
1004 |
1270 |
1005 |
1271 function Header(_ref) { |
1006 |
1272 let { |
1007 function Header({ |
1273 sidebar, |
1008 sidebar, |
1274 inserter, |
1009 inserter, |
1275 isInserterOpened, |
1010 isInserterOpened, |
1276 setIsInserterOpened, |
1011 setIsInserterOpened, |
1277 isFixedToolbarActive |
1012 isFixedToolbarActive |
1278 } = _ref; |
1013 }) { |
1279 const [[hasUndo, hasRedo], setUndoRedo] = (0,external_wp_element_namespaceObject.useState)([sidebar.hasUndo(), sidebar.hasRedo()]); |
1014 const [[hasUndo, hasRedo], setUndoRedo] = (0,external_wp_element_namespaceObject.useState)([sidebar.hasUndo(), sidebar.hasRedo()]); |
|
1015 const shortcut = (0,external_wp_keycodes_namespaceObject.isAppleOS)() ? external_wp_keycodes_namespaceObject.displayShortcut.primaryShift('z') : external_wp_keycodes_namespaceObject.displayShortcut.primary('y'); |
1280 (0,external_wp_element_namespaceObject.useEffect)(() => { |
1016 (0,external_wp_element_namespaceObject.useEffect)(() => { |
1281 return sidebar.subscribeHistory(() => { |
1017 return sidebar.subscribeHistory(() => { |
1282 setUndoRedo([sidebar.hasUndo(), sidebar.hasRedo()]); |
1018 setUndoRedo([sidebar.hasUndo(), sidebar.hasRedo()]); |
1283 }); |
1019 }); |
1284 }, [sidebar]); |
1020 }, [sidebar]); |
1285 return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", { |
1021 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
1286 className: classnames_default()('customize-widgets-header', { |
1022 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { |
1287 'is-fixed-toolbar-active': isFixedToolbarActive |
1023 className: dist_clsx('customize-widgets-header', { |
1288 }) |
1024 'is-fixed-toolbar-active': isFixedToolbarActive |
1289 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.NavigableToolbar, { |
1025 }), |
1290 className: "customize-widgets-header-toolbar", |
1026 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.NavigableToolbar, { |
1291 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Document tools') |
1027 className: "customize-widgets-header-toolbar", |
1292 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { |
1028 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Document tools'), |
1293 icon: !(0,external_wp_i18n_namespaceObject.isRTL)() ? library_undo : library_redo |
1029 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { |
1294 /* translators: button label text should, if possible, be under 16 characters. */ |
1030 icon: !(0,external_wp_i18n_namespaceObject.isRTL)() ? library_undo : library_redo |
1295 , |
1031 /* translators: button label text should, if possible, be under 16 characters. */, |
1296 label: (0,external_wp_i18n_namespaceObject.__)('Undo'), |
1032 label: (0,external_wp_i18n_namespaceObject.__)('Undo'), |
1297 shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary('z') // If there are no undo levels we don't want to actually disable this |
1033 shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary('z') |
1298 // button, because it will remove focus for keyboard users. |
1034 // If there are no undo levels we don't want to actually disable this |
1299 // See: https://github.com/WordPress/gutenberg/issues/3486 |
1035 // button, because it will remove focus for keyboard users. |
1300 , |
1036 // See: https://github.com/WordPress/gutenberg/issues/3486 |
1301 "aria-disabled": !hasUndo, |
1037 , |
1302 onClick: sidebar.undo, |
1038 "aria-disabled": !hasUndo, |
1303 className: "customize-widgets-editor-history-button undo-button" |
1039 onClick: sidebar.undo, |
1304 }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { |
1040 className: "customize-widgets-editor-history-button undo-button" |
1305 icon: !(0,external_wp_i18n_namespaceObject.isRTL)() ? library_redo : library_undo |
1041 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { |
1306 /* translators: button label text should, if possible, be under 16 characters. */ |
1042 icon: !(0,external_wp_i18n_namespaceObject.isRTL)() ? library_redo : library_undo |
1307 , |
1043 /* translators: button label text should, if possible, be under 16 characters. */, |
1308 label: (0,external_wp_i18n_namespaceObject.__)('Redo'), |
1044 label: (0,external_wp_i18n_namespaceObject.__)('Redo'), |
1309 shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primaryShift('z') // If there are no undo levels we don't want to actually disable this |
1045 shortcut: shortcut |
1310 // button, because it will remove focus for keyboard users. |
1046 // If there are no undo levels we don't want to actually disable this |
1311 // See: https://github.com/WordPress/gutenberg/issues/3486 |
1047 // button, because it will remove focus for keyboard users. |
1312 , |
1048 // See: https://github.com/WordPress/gutenberg/issues/3486 |
1313 "aria-disabled": !hasRedo, |
1049 , |
1314 onClick: sidebar.redo, |
1050 "aria-disabled": !hasRedo, |
1315 className: "customize-widgets-editor-history-button redo-button" |
1051 onClick: sidebar.redo, |
1316 }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, { |
1052 className: "customize-widgets-editor-history-button redo-button" |
1317 className: "customize-widgets-header-toolbar__inserter-toggle", |
1053 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { |
1318 isPressed: isInserterOpened, |
1054 className: "customize-widgets-header-toolbar__inserter-toggle", |
1319 variant: "primary", |
1055 isPressed: isInserterOpened, |
1320 icon: library_plus, |
1056 variant: "primary", |
1321 label: (0,external_wp_i18n_namespaceObject._x)('Add block', 'Generic label for block inserter button'), |
1057 icon: library_plus, |
1322 onClick: () => { |
1058 label: (0,external_wp_i18n_namespaceObject._x)('Add block', 'Generic label for block inserter button'), |
1323 setIsInserterOpened(isOpen => !isOpen); |
1059 onClick: () => { |
1324 } |
1060 setIsInserterOpened(isOpen => !isOpen); |
1325 }), (0,external_wp_element_namespaceObject.createElement)(MoreMenu, null))), (0,external_wp_element_namespaceObject.createPortal)((0,external_wp_element_namespaceObject.createElement)(components_inserter, { |
1061 } |
1326 setIsOpened: setIsInserterOpened |
1062 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MoreMenu, {})] |
1327 }), inserter.contentContainer[0])); |
1063 }) |
1328 } |
1064 }), (0,external_wp_element_namespaceObject.createPortal)( /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(components_inserter, { |
1329 |
1065 setIsOpened: setIsInserterOpened |
1330 /* harmony default export */ var header = (Header); |
1066 }), inserter.contentContainer[0])] |
|
1067 }); |
|
1068 } |
|
1069 /* harmony default export */ const header = (Header); |
1331 |
1070 |
1332 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/components/inserter/use-inserter.js |
1071 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/components/inserter/use-inserter.js |
1333 /** |
1072 /** |
1334 * WordPress dependencies |
1073 * WordPress dependencies |
1335 */ |
1074 */ |
1336 |
1075 |
1337 |
1076 |
|
1077 |
1338 /** |
1078 /** |
1339 * Internal dependencies |
1079 * Internal dependencies |
1340 */ |
1080 */ |
1341 |
|
1342 |
1081 |
1343 function useInserter(inserter) { |
1082 function useInserter(inserter) { |
1344 const isInserterOpened = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).isInserterOpened(), []); |
1083 const isInserterOpened = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).isInserterOpened(), []); |
1345 const { |
1084 const { |
1346 setIsInserterOpened |
1085 setIsInserterOpened |
1497 // Widget that does not extend WP_Widget. |
1235 // Widget that does not extend WP_Widget. |
1498 block = (0,external_wp_blocks_namespaceObject.createBlock)('core/legacy-widget', { |
1236 block = (0,external_wp_blocks_namespaceObject.createBlock)('core/legacy-widget', { |
1499 id |
1237 id |
1500 }); |
1238 }); |
1501 } |
1239 } |
1502 |
|
1503 return (0,external_wp_widgets_namespaceObject.addWidgetIdToBlock)(block, id); |
1240 return (0,external_wp_widgets_namespaceObject.addWidgetIdToBlock)(block, id); |
1504 } |
1241 } |
1505 |
1242 |
1506 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/components/sidebar-block-editor/use-sidebar-block-editor.js |
1243 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/components/sidebar-block-editor/use-sidebar-block-editor.js |
1507 /** |
1244 /** |
1508 * External dependencies |
1245 * External dependencies |
1509 */ |
1246 */ |
1510 |
1247 |
|
1248 |
1511 /** |
1249 /** |
1512 * WordPress dependencies |
1250 * WordPress dependencies |
1513 */ |
1251 */ |
1514 |
1252 |
1515 |
1253 |
1516 |
1254 |
1517 |
1255 |
1518 /** |
1256 /** |
1519 * Internal dependencies |
1257 * Internal dependencies |
1520 */ |
1258 */ |
1521 |
|
1522 |
|
1523 |
1259 |
1524 function widgetsToBlocks(widgets) { |
1260 function widgetsToBlocks(widgets) { |
1525 return widgets.map(widget => widgetToBlock(widget)); |
1261 return widgets.map(widget => widgetToBlock(widget)); |
1526 } |
1262 } |
1527 |
|
1528 function useSidebarBlockEditor(sidebar) { |
1263 function useSidebarBlockEditor(sidebar) { |
1529 const [blocks, setBlocks] = (0,external_wp_element_namespaceObject.useState)(() => widgetsToBlocks(sidebar.getWidgets())); |
1264 const [blocks, setBlocks] = (0,external_wp_element_namespaceObject.useState)(() => widgetsToBlocks(sidebar.getWidgets())); |
1530 (0,external_wp_element_namespaceObject.useEffect)(() => { |
1265 (0,external_wp_element_namespaceObject.useEffect)(() => { |
1531 return sidebar.subscribe((prevWidgets, nextWidgets) => { |
1266 return sidebar.subscribe((prevWidgets, nextWidgets) => { |
1532 setBlocks(prevBlocks => { |
1267 setBlocks(prevBlocks => { |
1533 const prevWidgetsMap = new Map(prevWidgets.map(widget => [widget.id, widget])); |
1268 const prevWidgetsMap = new Map(prevWidgets.map(widget => [widget.id, widget])); |
1534 const prevBlocksMap = new Map(prevBlocks.map(block => [(0,external_wp_widgets_namespaceObject.getWidgetIdFromBlock)(block), block])); |
1269 const prevBlocksMap = new Map(prevBlocks.map(block => [(0,external_wp_widgets_namespaceObject.getWidgetIdFromBlock)(block), block])); |
1535 const nextBlocks = nextWidgets.map(nextWidget => { |
1270 const nextBlocks = nextWidgets.map(nextWidget => { |
1536 const prevWidget = prevWidgetsMap.get(nextWidget.id); // Bail out updates. |
1271 const prevWidget = prevWidgetsMap.get(nextWidget.id); |
1537 |
1272 |
|
1273 // Bail out updates. |
1538 if (prevWidget && prevWidget === nextWidget) { |
1274 if (prevWidget && prevWidget === nextWidget) { |
1539 return prevBlocksMap.get(nextWidget.id); |
1275 return prevBlocksMap.get(nextWidget.id); |
1540 } |
1276 } |
1541 |
|
1542 return widgetToBlock(nextWidget); |
1277 return widgetToBlock(nextWidget); |
1543 }); // Bail out updates. |
1278 }); |
1544 |
1279 |
|
1280 // Bail out updates. |
1545 if (external_wp_isShallowEqual_default()(prevBlocks, nextBlocks)) { |
1281 if (external_wp_isShallowEqual_default()(prevBlocks, nextBlocks)) { |
1546 return prevBlocks; |
1282 return prevBlocks; |
1547 } |
1283 } |
1548 |
|
1549 return nextBlocks; |
1284 return nextBlocks; |
1550 }); |
1285 }); |
1551 }); |
1286 }); |
1552 }, [sidebar]); |
1287 }, [sidebar]); |
1553 const onChangeBlocks = (0,external_wp_element_namespaceObject.useCallback)(nextBlocks => { |
1288 const onChangeBlocks = (0,external_wp_element_namespaceObject.useCallback)(nextBlocks => { |
1554 setBlocks(prevBlocks => { |
1289 setBlocks(prevBlocks => { |
1555 if (external_wp_isShallowEqual_default()(prevBlocks, nextBlocks)) { |
1290 if (external_wp_isShallowEqual_default()(prevBlocks, nextBlocks)) { |
1556 return prevBlocks; |
1291 return prevBlocks; |
1557 } |
1292 } |
1558 |
|
1559 const prevBlocksMap = new Map(prevBlocks.map(block => [(0,external_wp_widgets_namespaceObject.getWidgetIdFromBlock)(block), block])); |
1293 const prevBlocksMap = new Map(prevBlocks.map(block => [(0,external_wp_widgets_namespaceObject.getWidgetIdFromBlock)(block), block])); |
1560 const nextWidgets = nextBlocks.map(nextBlock => { |
1294 const nextWidgets = nextBlocks.map(nextBlock => { |
1561 const widgetId = (0,external_wp_widgets_namespaceObject.getWidgetIdFromBlock)(nextBlock); // Update existing widgets. |
1295 const widgetId = (0,external_wp_widgets_namespaceObject.getWidgetIdFromBlock)(nextBlock); |
1562 |
1296 |
|
1297 // Update existing widgets. |
1563 if (widgetId && prevBlocksMap.has(widgetId)) { |
1298 if (widgetId && prevBlocksMap.has(widgetId)) { |
1564 const prevBlock = prevBlocksMap.get(widgetId); |
1299 const prevBlock = prevBlocksMap.get(widgetId); |
1565 const prevWidget = sidebar.getWidget(widgetId); // Bail out updates by returning the previous widgets. |
1300 const prevWidget = sidebar.getWidget(widgetId); |
|
1301 |
|
1302 // Bail out updates by returning the previous widgets. |
1566 // Deep equality is necessary until the block editor's internals changes. |
1303 // Deep equality is necessary until the block editor's internals changes. |
1567 |
1304 if (es6_default()(nextBlock, prevBlock) && prevWidget) { |
1568 if ((0,external_lodash_namespaceObject.isEqual)(nextBlock, prevBlock) && prevWidget) { |
|
1569 return prevWidget; |
1305 return prevWidget; |
1570 } |
1306 } |
1571 |
|
1572 return blockToWidget(nextBlock, prevWidget); |
1307 return blockToWidget(nextBlock, prevWidget); |
1573 } // Add a new widget. |
1308 } |
1574 |
1309 |
1575 |
1310 // Add a new widget. |
1576 return blockToWidget(nextBlock); |
1311 return blockToWidget(nextBlock); |
1577 }); // Bail out updates if the updated widgets are the same. |
1312 }); |
1578 |
1313 |
|
1314 // Bail out updates if the updated widgets are the same. |
1579 if (external_wp_isShallowEqual_default()(sidebar.getWidgets(), nextWidgets)) { |
1315 if (external_wp_isShallowEqual_default()(sidebar.getWidgets(), nextWidgets)) { |
1580 return prevBlocks; |
1316 return prevBlocks; |
1581 } |
1317 } |
1582 |
|
1583 const addedWidgetIds = sidebar.setWidgets(nextWidgets); |
1318 const addedWidgetIds = sidebar.setWidgets(nextWidgets); |
1584 return nextBlocks.reduce((updatedNextBlocks, nextBlock, index) => { |
1319 return nextBlocks.reduce((updatedNextBlocks, nextBlock, index) => { |
1585 const addedWidgetId = addedWidgetIds[index]; |
1320 const addedWidgetId = addedWidgetIds[index]; |
1586 |
|
1587 if (addedWidgetId !== null) { |
1321 if (addedWidgetId !== null) { |
1588 // Only create a new instance if necessary to prevent |
1322 // Only create a new instance if necessary to prevent |
1589 // the whole editor from re-rendering on every edit. |
1323 // the whole editor from re-rendering on every edit. |
1590 if (updatedNextBlocks === nextBlocks) { |
1324 if (updatedNextBlocks === nextBlocks) { |
1591 updatedNextBlocks = nextBlocks.slice(); |
1325 updatedNextBlocks = nextBlocks.slice(); |
1592 } |
1326 } |
1593 |
|
1594 updatedNextBlocks[index] = (0,external_wp_widgets_namespaceObject.addWidgetIdToBlock)(nextBlock, addedWidgetId); |
1327 updatedNextBlocks[index] = (0,external_wp_widgets_namespaceObject.addWidgetIdToBlock)(nextBlock, addedWidgetId); |
1595 } |
1328 } |
1596 |
|
1597 return updatedNextBlocks; |
1329 return updatedNextBlocks; |
1598 }, nextBlocks); |
1330 }, nextBlocks); |
1599 }); |
1331 }); |
1600 }, [sidebar]); |
1332 }, [sidebar]); |
1601 return [blocks, onChangeBlocks, onChangeBlocks]; |
1333 return [blocks, onChangeBlocks, onChangeBlocks]; |
1602 } |
1334 } |
1603 |
1335 |
1604 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/components/focus-control/index.js |
1336 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/components/focus-control/index.js |
1605 |
1337 /** |
1606 |
1338 * WordPress dependencies |
1607 /** |
1339 */ |
1608 * WordPress dependencies |
1340 |
1609 */ |
|
1610 |
1341 |
1611 /** |
1342 /** |
1612 * Internal dependencies |
1343 * Internal dependencies |
1613 */ |
1344 */ |
1614 |
1345 |
1615 |
1346 |
1616 const FocusControlContext = (0,external_wp_element_namespaceObject.createContext)(); |
1347 const FocusControlContext = (0,external_wp_element_namespaceObject.createContext)(); |
1617 function FocusControl(_ref) { |
1348 function FocusControl({ |
1618 let { |
1349 api, |
1619 api, |
1350 sidebarControls, |
1620 sidebarControls, |
1351 children |
1621 children |
1352 }) { |
1622 } = _ref; |
|
1623 const [focusedWidgetIdRef, setFocusedWidgetIdRef] = (0,external_wp_element_namespaceObject.useState)({ |
1353 const [focusedWidgetIdRef, setFocusedWidgetIdRef] = (0,external_wp_element_namespaceObject.useState)({ |
1624 current: null |
1354 current: null |
1625 }); |
1355 }); |
1626 const focusWidget = (0,external_wp_element_namespaceObject.useCallback)(widgetId => { |
1356 const focusWidget = (0,external_wp_element_namespaceObject.useCallback)(widgetId => { |
1627 for (const sidebarControl of sidebarControls) { |
1357 for (const sidebarControl of sidebarControls) { |
1628 const widgets = sidebarControl.setting.get(); |
1358 const widgets = sidebarControl.setting.get(); |
1629 |
|
1630 if (widgets.includes(widgetId)) { |
1359 if (widgets.includes(widgetId)) { |
1631 sidebarControl.sectionInstance.expand({ |
1360 sidebarControl.sectionInstance.expand({ |
1632 // Schedule it after the complete callback so that |
1361 // Schedule it after the complete callback so that |
1633 // it won't be overridden by the "Back" button focus. |
1362 // it won't be overridden by the "Back" button focus. |
1634 completeCallback() { |
1363 completeCallback() { |
1690 blocksRef.current = blocks; |
1421 blocksRef.current = blocks; |
1691 }, [blocks]); |
1422 }, [blocks]); |
1692 (0,external_wp_element_namespaceObject.useEffect)(() => { |
1423 (0,external_wp_element_namespaceObject.useEffect)(() => { |
1693 if (focusedWidgetIdRef.current) { |
1424 if (focusedWidgetIdRef.current) { |
1694 const focusedBlock = blocksRef.current.find(block => (0,external_wp_widgets_namespaceObject.getWidgetIdFromBlock)(block) === focusedWidgetIdRef.current); |
1425 const focusedBlock = blocksRef.current.find(block => (0,external_wp_widgets_namespaceObject.getWidgetIdFromBlock)(block) === focusedWidgetIdRef.current); |
1695 |
|
1696 if (focusedBlock) { |
1426 if (focusedBlock) { |
1697 selectBlock(focusedBlock.clientId); // If the block is already being selected, the DOM node won't |
1427 selectBlock(focusedBlock.clientId); |
|
1428 // If the block is already being selected, the DOM node won't |
1698 // get focused again automatically. |
1429 // get focused again automatically. |
1699 // We select the DOM and focus it manually here. |
1430 // We select the DOM and focus it manually here. |
1700 |
|
1701 const blockNode = document.querySelector(`[data-block="${focusedBlock.clientId}"]`); |
1431 const blockNode = document.querySelector(`[data-block="${focusedBlock.clientId}"]`); |
1702 blockNode === null || blockNode === void 0 ? void 0 : blockNode.focus(); |
1432 blockNode?.focus(); |
1703 } |
1433 } |
1704 } |
1434 } |
1705 }, [focusedWidgetIdRef, selectBlock]); |
1435 }, [focusedWidgetIdRef, selectBlock]); |
1706 } |
1436 } |
1707 |
1437 |
|
1438 ;// CONCATENATED MODULE: external ["wp","privateApis"] |
|
1439 const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"]; |
|
1440 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/lock-unlock.js |
|
1441 /** |
|
1442 * WordPress dependencies |
|
1443 */ |
|
1444 |
|
1445 const { |
|
1446 lock, |
|
1447 unlock |
|
1448 } = (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/customize-widgets'); |
|
1449 |
1708 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/components/sidebar-block-editor/sidebar-editor-provider.js |
1450 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/components/sidebar-block-editor/sidebar-editor-provider.js |
1709 |
1451 /** |
1710 |
1452 * WordPress dependencies |
1711 /** |
1453 */ |
1712 * WordPress dependencies |
1454 |
1713 */ |
|
1714 |
1455 |
1715 /** |
1456 /** |
1716 * Internal dependencies |
1457 * Internal dependencies |
1717 */ |
1458 */ |
1718 |
1459 |
1719 |
1460 |
1720 |
1461 |
1721 function SidebarEditorProvider(_ref) { |
1462 |
1722 let { |
1463 const { |
1723 sidebar, |
1464 ExperimentalBlockEditorProvider |
1724 settings, |
1465 } = unlock(external_wp_blockEditor_namespaceObject.privateApis); |
1725 children |
1466 function SidebarEditorProvider({ |
1726 } = _ref; |
1467 sidebar, |
|
1468 settings, |
|
1469 children |
|
1470 }) { |
1727 const [blocks, onInput, onChange] = useSidebarBlockEditor(sidebar); |
1471 const [blocks, onInput, onChange] = useSidebarBlockEditor(sidebar); |
1728 useBlocksFocusControl(blocks); |
1472 useBlocksFocusControl(blocks); |
1729 return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockEditorProvider, { |
1473 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ExperimentalBlockEditorProvider, { |
1730 value: blocks, |
1474 value: blocks, |
1731 onInput: onInput, |
1475 onInput: onInput, |
1732 onChange: onChange, |
1476 onChange: onChange, |
1733 settings: settings, |
1477 settings: settings, |
1734 useSubRegistry: false |
1478 useSubRegistry: false, |
1735 }, children); |
1479 children: children |
|
1480 }); |
1736 } |
1481 } |
1737 |
1482 |
1738 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/components/welcome-guide/index.js |
1483 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/components/welcome-guide/index.js |
1739 |
1484 /** |
1740 |
1485 * WordPress dependencies |
1741 /** |
1486 */ |
1742 * WordPress dependencies |
1487 |
1743 */ |
1488 |
1744 |
1489 |
1745 |
1490 |
1746 |
1491 |
1747 |
1492 |
1748 function WelcomeGuide(_ref) { |
1493 function WelcomeGuide({ |
1749 let { |
1494 sidebar |
1750 sidebar |
1495 }) { |
1751 } = _ref; |
|
1752 const { |
1496 const { |
1753 toggle |
1497 toggle |
1754 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store); |
1498 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store); |
1755 const isEntirelyBlockWidgets = sidebar.getWidgets().every(widget => widget.id.startsWith('block-')); |
1499 const isEntirelyBlockWidgets = sidebar.getWidgets().every(widget => widget.id.startsWith('block-')); |
1756 return (0,external_wp_element_namespaceObject.createElement)("div", { |
1500 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { |
1757 className: "customize-widgets-welcome-guide" |
1501 className: "customize-widgets-welcome-guide", |
1758 }, (0,external_wp_element_namespaceObject.createElement)("div", { |
1502 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { |
1759 className: "customize-widgets-welcome-guide__image__wrapper" |
1503 className: "customize-widgets-welcome-guide__image__wrapper", |
1760 }, (0,external_wp_element_namespaceObject.createElement)("picture", null, (0,external_wp_element_namespaceObject.createElement)("source", { |
1504 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("picture", { |
1761 srcSet: "https://s.w.org/images/block-editor/welcome-editor.svg", |
1505 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("source", { |
1762 media: "(prefers-reduced-motion: reduce)" |
1506 srcSet: "https://s.w.org/images/block-editor/welcome-editor.svg", |
1763 }), (0,external_wp_element_namespaceObject.createElement)("img", { |
1507 media: "(prefers-reduced-motion: reduce)" |
1764 className: "customize-widgets-welcome-guide__image", |
1508 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { |
1765 src: "https://s.w.org/images/block-editor/welcome-editor.gif", |
1509 className: "customize-widgets-welcome-guide__image", |
1766 width: "312", |
1510 src: "https://s.w.org/images/block-editor/welcome-editor.gif", |
1767 height: "240", |
1511 width: "312", |
1768 alt: "" |
1512 height: "240", |
1769 }))), (0,external_wp_element_namespaceObject.createElement)("h1", { |
1513 alt: "" |
1770 className: "customize-widgets-welcome-guide__heading" |
1514 })] |
1771 }, (0,external_wp_i18n_namespaceObject.__)('Welcome to block Widgets')), (0,external_wp_element_namespaceObject.createElement)("p", { |
1515 }) |
1772 className: "customize-widgets-welcome-guide__text" |
1516 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { |
1773 }, isEntirelyBlockWidgets ? (0,external_wp_i18n_namespaceObject.__)('Your theme provides different “block” areas for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.') : (0,external_wp_i18n_namespaceObject.__)('You can now add any block to your site’s widget areas. Don’t worry, all of your favorite widgets still work flawlessly.')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { |
1517 className: "customize-widgets-welcome-guide__heading", |
1774 className: "customize-widgets-welcome-guide__button", |
1518 children: (0,external_wp_i18n_namespaceObject.__)('Welcome to block Widgets') |
1775 variant: "primary", |
1519 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { |
1776 onClick: () => toggle('core/customize-widgets', 'welcomeGuide') |
1520 className: "customize-widgets-welcome-guide__text", |
1777 }, (0,external_wp_i18n_namespaceObject.__)('Got it')), (0,external_wp_element_namespaceObject.createElement)("hr", { |
1521 children: isEntirelyBlockWidgets ? (0,external_wp_i18n_namespaceObject.__)('Your theme provides different “block” areas for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.') : (0,external_wp_i18n_namespaceObject.__)('You can now add any block to your site’s widget areas. Don’t worry, all of your favorite widgets still work flawlessly.') |
1778 className: "customize-widgets-welcome-guide__separator" |
1522 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { |
1779 }), !isEntirelyBlockWidgets && (0,external_wp_element_namespaceObject.createElement)("p", { |
1523 className: "customize-widgets-welcome-guide__button", |
1780 className: "customize-widgets-welcome-guide__more-info" |
1524 variant: "primary", |
1781 }, (0,external_wp_i18n_namespaceObject.__)('Want to stick with the old widgets?'), (0,external_wp_element_namespaceObject.createElement)("br", null), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, { |
1525 onClick: () => toggle('core/customize-widgets', 'welcomeGuide'), |
1782 href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/plugins/classic-widgets/') |
1526 children: (0,external_wp_i18n_namespaceObject.__)('Got it') |
1783 }, (0,external_wp_i18n_namespaceObject.__)('Get the Classic Widgets plugin.'))), (0,external_wp_element_namespaceObject.createElement)("p", { |
1527 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("hr", { |
1784 className: "customize-widgets-welcome-guide__more-info" |
1528 className: "customize-widgets-welcome-guide__separator" |
1785 }, (0,external_wp_i18n_namespaceObject.__)('New to the block editor?'), (0,external_wp_element_namespaceObject.createElement)("br", null), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, { |
1529 }), !isEntirelyBlockWidgets && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("p", { |
1786 href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/support/article/wordpress-editor/') |
1530 className: "customize-widgets-welcome-guide__more-info", |
1787 }, (0,external_wp_i18n_namespaceObject.__)("Here's a detailed guide.")))); |
1531 children: [(0,external_wp_i18n_namespaceObject.__)('Want to stick with the old widgets?'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("br", {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { |
|
1532 href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/plugins/classic-widgets/'), |
|
1533 children: (0,external_wp_i18n_namespaceObject.__)('Get the Classic Widgets plugin.') |
|
1534 })] |
|
1535 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("p", { |
|
1536 className: "customize-widgets-welcome-guide__more-info", |
|
1537 children: [(0,external_wp_i18n_namespaceObject.__)('New to the block editor?'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("br", {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { |
|
1538 href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/documentation/article/wordpress-block-editor/'), |
|
1539 children: (0,external_wp_i18n_namespaceObject.__)("Here's a detailed guide.") |
|
1540 })] |
|
1541 })] |
|
1542 }); |
1788 } |
1543 } |
1789 |
1544 |
1790 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/components/keyboard-shortcuts/index.js |
1545 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/components/keyboard-shortcuts/index.js |
1791 /** |
1546 /** |
1792 * WordPress dependencies |
1547 * WordPress dependencies |
1919 |
1674 |
1920 |
1675 |
1921 |
1676 |
1922 |
1677 |
1923 |
1678 |
1924 function SidebarBlockEditor(_ref) { |
1679 |
1925 let { |
1680 |
1926 blockEditorSettings, |
1681 |
1927 sidebar, |
1682 const { |
1928 inserter, |
1683 ExperimentalBlockCanvas: BlockCanvas |
1929 inspector |
1684 } = unlock(external_wp_blockEditor_namespaceObject.privateApis); |
1930 } = _ref; |
1685 const { |
|
1686 BlockKeyboardShortcuts |
|
1687 } = unlock(external_wp_blockLibrary_namespaceObject.privateApis); |
|
1688 function SidebarBlockEditor({ |
|
1689 blockEditorSettings, |
|
1690 sidebar, |
|
1691 inserter, |
|
1692 inspector |
|
1693 }) { |
1931 const [isInserterOpened, setIsInserterOpened] = useInserter(inserter); |
1694 const [isInserterOpened, setIsInserterOpened] = useInserter(inserter); |
|
1695 const isMediumViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('small'); |
1932 const { |
1696 const { |
1933 hasUploadPermissions, |
1697 hasUploadPermissions, |
1934 isFixedToolbarActive, |
1698 isFixedToolbarActive, |
1935 keepCaretInsideBlock, |
1699 keepCaretInsideBlock, |
1936 isWelcomeGuideActive |
1700 isWelcomeGuideActive |
1937 } = (0,external_wp_data_namespaceObject.useSelect)(select => { |
1701 } = (0,external_wp_data_namespaceObject.useSelect)(select => { |
|
1702 var _select$canUser; |
1938 const { |
1703 const { |
1939 get |
1704 get |
1940 } = select(external_wp_preferences_namespaceObject.store); |
1705 } = select(external_wp_preferences_namespaceObject.store); |
1941 return { |
1706 return { |
1942 hasUploadPermissions: (0,external_lodash_namespaceObject.defaultTo)(select(external_wp_coreData_namespaceObject.store).canUser('create', 'media'), true), |
1707 hasUploadPermissions: (_select$canUser = select(external_wp_coreData_namespaceObject.store).canUser('create', 'media')) !== null && _select$canUser !== void 0 ? _select$canUser : true, |
1943 isFixedToolbarActive: !!get('core/customize-widgets', 'fixedToolbar'), |
1708 isFixedToolbarActive: !!get('core/customize-widgets', 'fixedToolbar'), |
1944 keepCaretInsideBlock: !!get('core/customize-widgets', 'keepCaretInsideBlock'), |
1709 keepCaretInsideBlock: !!get('core/customize-widgets', 'keepCaretInsideBlock'), |
1945 isWelcomeGuideActive: !!get('core/customize-widgets', 'welcomeGuide') |
1710 isWelcomeGuideActive: !!get('core/customize-widgets', 'welcomeGuide') |
1946 }; |
1711 }; |
1947 }, []); |
1712 }, []); |
1948 const settings = (0,external_wp_element_namespaceObject.useMemo)(() => { |
1713 const settings = (0,external_wp_element_namespaceObject.useMemo)(() => { |
1949 let mediaUploadBlockEditor; |
1714 let mediaUploadBlockEditor; |
1950 |
|
1951 if (hasUploadPermissions) { |
1715 if (hasUploadPermissions) { |
1952 mediaUploadBlockEditor = _ref2 => { |
1716 mediaUploadBlockEditor = ({ |
1953 let { |
1717 onError, |
1954 onError, |
1718 ...argumentsObject |
1955 ...argumentsObject |
1719 }) => { |
1956 } = _ref2; |
|
1957 (0,external_wp_mediaUtils_namespaceObject.uploadMedia)({ |
1720 (0,external_wp_mediaUtils_namespaceObject.uploadMedia)({ |
1958 wpAllowedMimeTypes: blockEditorSettings.allowedMimeTypes, |
1721 wpAllowedMimeTypes: blockEditorSettings.allowedMimeTypes, |
1959 onError: _ref3 => { |
1722 onError: ({ |
1960 let { |
1723 message |
1961 message |
1724 }) => onError(message), |
1962 } = _ref3; |
|
1963 return onError(message); |
|
1964 }, |
|
1965 ...argumentsObject |
1725 ...argumentsObject |
1966 }); |
1726 }); |
1967 }; |
1727 }; |
1968 } |
1728 } |
1969 |
1729 return { |
1970 return { ...blockEditorSettings, |
1730 ...blockEditorSettings, |
1971 __experimentalSetIsInserterOpened: setIsInserterOpened, |
1731 __experimentalSetIsInserterOpened: setIsInserterOpened, |
1972 mediaUpload: mediaUploadBlockEditor, |
1732 mediaUpload: mediaUploadBlockEditor, |
1973 hasFixedToolbar: isFixedToolbarActive, |
1733 hasFixedToolbar: isFixedToolbarActive || !isMediumViewport, |
1974 keepCaretInsideBlock, |
1734 keepCaretInsideBlock, |
1975 __unstableHasCustomAppender: true |
1735 __unstableHasCustomAppender: true |
1976 }; |
1736 }; |
1977 }, [hasUploadPermissions, blockEditorSettings, isFixedToolbarActive, keepCaretInsideBlock, setIsInserterOpened]); |
1737 }, [hasUploadPermissions, blockEditorSettings, isFixedToolbarActive, isMediumViewport, keepCaretInsideBlock, setIsInserterOpened]); |
1978 |
|
1979 if (isWelcomeGuideActive) { |
1738 if (isWelcomeGuideActive) { |
1980 return (0,external_wp_element_namespaceObject.createElement)(WelcomeGuide, { |
1739 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuide, { |
1981 sidebar: sidebar |
1740 sidebar: sidebar |
1982 }); |
1741 }); |
1983 } |
1742 } |
1984 |
1743 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
1985 return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, 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)(SidebarEditorProvider, { |
1744 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboard_shortcuts.Register, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockKeyboardShortcuts, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(SidebarEditorProvider, { |
1986 sidebar: sidebar, |
1745 sidebar: sidebar, |
1987 settings: settings |
1746 settings: settings, |
1988 }, (0,external_wp_element_namespaceObject.createElement)(keyboard_shortcuts, { |
1747 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboard_shortcuts, { |
1989 undo: sidebar.undo, |
1748 undo: sidebar.undo, |
1990 redo: sidebar.redo, |
1749 redo: sidebar.redo, |
1991 save: sidebar.save |
1750 save: sidebar.save |
1992 }), (0,external_wp_element_namespaceObject.createElement)(header, { |
1751 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(header, { |
1993 sidebar: sidebar, |
1752 sidebar: sidebar, |
1994 inserter: inserter, |
1753 inserter: inserter, |
1995 isInserterOpened: isInserterOpened, |
1754 isInserterOpened: isInserterOpened, |
1996 setIsInserterOpened: setIsInserterOpened, |
1755 setIsInserterOpened: setIsInserterOpened, |
1997 isFixedToolbarActive: isFixedToolbarActive |
1756 isFixedToolbarActive: isFixedToolbarActive || !isMediumViewport |
1998 }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.CopyHandler, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockTools, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__unstableEditorStyles, { |
1757 }), (isFixedToolbarActive || !isMediumViewport) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockToolbar, { |
1999 styles: settings.defaultEditorStyles |
1758 hideDragHandle: true |
2000 }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockSelectionClearer, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.WritingFlow, { |
1759 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockCanvas, { |
2001 className: "editor-styles-wrapper" |
1760 shouldIframe: false, |
2002 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.ObserveTyping, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockList, { |
1761 styles: settings.defaultEditorStyles, |
2003 renderAppender: BlockAppender |
1762 height: "100%", |
2004 })))))), (0,external_wp_element_namespaceObject.createPortal)( // This is a temporary hack to prevent button component inside <BlockInspector> |
1763 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockList, { |
2005 // from submitting form when type="button" is not specified. |
1764 renderAppender: BlockAppender |
2006 (0,external_wp_element_namespaceObject.createElement)("form", { |
1765 }) |
2007 onSubmit: event => event.preventDefault() |
1766 }), (0,external_wp_element_namespaceObject.createPortal)( |
2008 }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockInspector, null)), inspector.contentContainer[0])), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__unstableBlockSettingsMenuFirstItem, null, _ref4 => { |
1767 /*#__PURE__*/ |
2009 let { |
1768 // This is a temporary hack to prevent button component inside <BlockInspector> |
2010 onClose |
1769 // from submitting form when type="button" is not specified. |
2011 } = _ref4; |
1770 (0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { |
2012 return (0,external_wp_element_namespaceObject.createElement)(block_inspector_button, { |
1771 onSubmit: event => event.preventDefault(), |
2013 inspector: inspector, |
1772 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockInspector, {}) |
2014 closeMenu: onClose |
1773 }), inspector.contentContainer[0])] |
2015 }); |
1774 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__unstableBlockSettingsMenuFirstItem, { |
2016 })); |
1775 children: ({ |
|
1776 onClose |
|
1777 }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_inspector_button, { |
|
1778 inspector: inspector, |
|
1779 closeMenu: onClose |
|
1780 }) |
|
1781 })] |
|
1782 }); |
2017 } |
1783 } |
2018 |
1784 |
2019 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/components/sidebar-controls/index.js |
1785 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/components/sidebar-controls/index.js |
2020 |
1786 /** |
2021 |
1787 * WordPress dependencies |
2022 /** |
1788 */ |
2023 * WordPress dependencies |
1789 |
2024 */ |
|
2025 |
1790 |
2026 const SidebarControlsContext = (0,external_wp_element_namespaceObject.createContext)(); |
1791 const SidebarControlsContext = (0,external_wp_element_namespaceObject.createContext)(); |
2027 function SidebarControls(_ref) { |
1792 function SidebarControls({ |
2028 let { |
1793 sidebarControls, |
2029 sidebarControls, |
1794 activeSidebarControl, |
2030 activeSidebarControl, |
1795 children |
2031 children |
1796 }) { |
2032 } = _ref; |
|
2033 const context = (0,external_wp_element_namespaceObject.useMemo)(() => ({ |
1797 const context = (0,external_wp_element_namespaceObject.useMemo)(() => ({ |
2034 sidebarControls, |
1798 sidebarControls, |
2035 activeSidebarControl |
1799 activeSidebarControl |
2036 }), [sidebarControls, activeSidebarControl]); |
1800 }), [sidebarControls, activeSidebarControl]); |
2037 return (0,external_wp_element_namespaceObject.createElement)(SidebarControlsContext.Provider, { |
1801 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarControlsContext.Provider, { |
2038 value: context |
1802 value: context, |
2039 }, children); |
1803 children: children |
|
1804 }); |
2040 } |
1805 } |
2041 function useSidebarControls() { |
1806 function useSidebarControls() { |
2042 const { |
1807 const { |
2043 sidebarControls |
1808 sidebarControls |
2044 } = (0,external_wp_element_namespaceObject.useContext)(SidebarControlsContext); |
1809 } = (0,external_wp_element_namespaceObject.useContext)(SidebarControlsContext); |
2376 */ |
2122 */ |
2377 |
2123 |
2378 const { |
2124 const { |
2379 wp |
2125 wp |
2380 } = window; |
2126 } = window; |
2381 |
|
2382 function parseWidgetId(widgetId) { |
2127 function parseWidgetId(widgetId) { |
2383 const matches = widgetId.match(/^(.+)-(\d+)$/); |
2128 const matches = widgetId.match(/^(.+)-(\d+)$/); |
2384 |
|
2385 if (matches) { |
2129 if (matches) { |
2386 return { |
2130 return { |
2387 idBase: matches[1], |
2131 idBase: matches[1], |
2388 number: parseInt(matches[2], 10) |
2132 number: parseInt(matches[2], 10) |
2389 }; |
2133 }; |
2390 } // Likely an old single widget. |
2134 } |
2391 |
2135 |
2392 |
2136 // Likely an old single widget. |
2393 return { |
2137 return { |
2394 idBase: widgetId |
2138 idBase: widgetId |
2395 }; |
2139 }; |
2396 } |
2140 } |
2397 |
|
2398 function widgetIdToSettingId(widgetId) { |
2141 function widgetIdToSettingId(widgetId) { |
2399 const { |
2142 const { |
2400 idBase, |
2143 idBase, |
2401 number |
2144 number |
2402 } = parseWidgetId(widgetId); |
2145 } = parseWidgetId(widgetId); |
2403 |
|
2404 if (number) { |
2146 if (number) { |
2405 return `widget_${idBase}[${number}]`; |
2147 return `widget_${idBase}[${number}]`; |
2406 } |
2148 } |
2407 |
|
2408 return `widget_${idBase}`; |
2149 return `widget_${idBase}`; |
2409 } |
2150 } |
|
2151 |
2410 /** |
2152 /** |
2411 * This is a custom debounce function to call different callbacks depending on |
2153 * This is a custom debounce function to call different callbacks depending on |
2412 * whether it's the _leading_ call or not. |
2154 * whether it's the _leading_ call or not. |
2413 * |
2155 * |
2414 * @param {Function} leading The callback that gets called first. |
2156 * @param {Function} leading The callback that gets called first. |
2415 * @param {Function} callback The callback that gets called after the first time. |
2157 * @param {Function} callback The callback that gets called after the first time. |
2416 * @param {number} timeout The debounced time in milliseconds. |
2158 * @param {number} timeout The debounced time in milliseconds. |
2417 * @return {Function} The debounced function. |
2159 * @return {Function} The debounced function. |
2418 */ |
2160 */ |
2419 |
|
2420 |
|
2421 function debounce(leading, callback, timeout) { |
2161 function debounce(leading, callback, timeout) { |
2422 let isLeading = false; |
2162 let isLeading = false; |
2423 let timerID; |
2163 let timerID; |
2424 |
2164 function debounced(...args) { |
2425 function debounced() { |
|
2426 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { |
|
2427 args[_key] = arguments[_key]; |
|
2428 } |
|
2429 |
|
2430 const result = (isLeading ? callback : leading).apply(this, args); |
2165 const result = (isLeading ? callback : leading).apply(this, args); |
2431 isLeading = true; |
2166 isLeading = true; |
2432 clearTimeout(timerID); |
2167 clearTimeout(timerID); |
2433 timerID = setTimeout(() => { |
2168 timerID = setTimeout(() => { |
2434 isLeading = false; |
2169 isLeading = false; |
2435 }, timeout); |
2170 }, timeout); |
2436 return result; |
2171 return result; |
2437 } |
2172 } |
2438 |
|
2439 debounced.cancel = () => { |
2173 debounced.cancel = () => { |
2440 isLeading = false; |
2174 isLeading = false; |
2441 clearTimeout(timerID); |
2175 clearTimeout(timerID); |
2442 }; |
2176 }; |
2443 |
|
2444 return debounced; |
2177 return debounced; |
2445 } |
2178 } |
2446 |
|
2447 class SidebarAdapter { |
2179 class SidebarAdapter { |
2448 constructor(setting, api) { |
2180 constructor(setting, api) { |
2449 this.setting = setting; |
2181 this.setting = setting; |
2450 this.api = api; |
2182 this.api = api; |
2451 this.locked = false; |
2183 this.locked = false; |
2452 this.widgetsCache = new WeakMap(); |
2184 this.widgetsCache = new WeakMap(); |
2453 this.subscribers = new Set(); |
2185 this.subscribers = new Set(); |
2454 this.history = [this._getWidgetIds().map(widgetId => this.getWidget(widgetId))]; |
2186 this.history = [this._getWidgetIds().map(widgetId => this.getWidget(widgetId))]; |
2455 this.historyIndex = 0; |
2187 this.historyIndex = 0; |
2456 this.historySubscribers = new Set(); // Debounce the input for 1 second. |
2188 this.historySubscribers = new Set(); |
2457 |
2189 // Debounce the input for 1 second. |
2458 this._debounceSetHistory = debounce(this._pushHistory, this._replaceHistory, 1000); |
2190 this._debounceSetHistory = debounce(this._pushHistory, this._replaceHistory, 1000); |
2459 this.setting.bind(this._handleSettingChange.bind(this)); |
2191 this.setting.bind(this._handleSettingChange.bind(this)); |
2460 this.api.bind('change', this._handleAllSettingsChange.bind(this)); |
2192 this.api.bind('change', this._handleAllSettingsChange.bind(this)); |
2461 this.undo = this.undo.bind(this); |
2193 this.undo = this.undo.bind(this); |
2462 this.redo = this.redo.bind(this); |
2194 this.redo = this.redo.bind(this); |
2463 this.save = this.save.bind(this); |
2195 this.save = this.save.bind(this); |
2464 } |
2196 } |
2465 |
|
2466 subscribe(callback) { |
2197 subscribe(callback) { |
2467 this.subscribers.add(callback); |
2198 this.subscribers.add(callback); |
2468 return () => { |
2199 return () => { |
2469 this.subscribers.delete(callback); |
2200 this.subscribers.delete(callback); |
2470 }; |
2201 }; |
2471 } |
2202 } |
2472 |
|
2473 getWidgets() { |
2203 getWidgets() { |
2474 return this.history[this.historyIndex]; |
2204 return this.history[this.historyIndex]; |
2475 } |
2205 } |
2476 |
2206 _emit(...args) { |
2477 _emit() { |
|
2478 for (const callback of this.subscribers) { |
2207 for (const callback of this.subscribers) { |
2479 callback(...arguments); |
2208 callback(...args); |
2480 } |
2209 } |
2481 } |
2210 } |
2482 |
|
2483 _getWidgetIds() { |
2211 _getWidgetIds() { |
2484 return this.setting.get(); |
2212 return this.setting.get(); |
2485 } |
2213 } |
2486 |
|
2487 _pushHistory() { |
2214 _pushHistory() { |
2488 this.history = [...this.history.slice(0, this.historyIndex + 1), this._getWidgetIds().map(widgetId => this.getWidget(widgetId))]; |
2215 this.history = [...this.history.slice(0, this.historyIndex + 1), this._getWidgetIds().map(widgetId => this.getWidget(widgetId))]; |
2489 this.historyIndex += 1; |
2216 this.historyIndex += 1; |
2490 this.historySubscribers.forEach(listener => listener()); |
2217 this.historySubscribers.forEach(listener => listener()); |
2491 } |
2218 } |
2492 |
|
2493 _replaceHistory() { |
2219 _replaceHistory() { |
2494 this.history[this.historyIndex] = this._getWidgetIds().map(widgetId => this.getWidget(widgetId)); |
2220 this.history[this.historyIndex] = this._getWidgetIds().map(widgetId => this.getWidget(widgetId)); |
2495 } |
2221 } |
2496 |
|
2497 _handleSettingChange() { |
2222 _handleSettingChange() { |
2498 if (this.locked) { |
2223 if (this.locked) { |
2499 return; |
2224 return; |
2500 } |
2225 } |
2501 |
|
2502 const prevWidgets = this.getWidgets(); |
2226 const prevWidgets = this.getWidgets(); |
2503 |
|
2504 this._pushHistory(); |
2227 this._pushHistory(); |
2505 |
|
2506 this._emit(prevWidgets, this.getWidgets()); |
2228 this._emit(prevWidgets, this.getWidgets()); |
2507 } |
2229 } |
2508 |
|
2509 _handleAllSettingsChange(setting) { |
2230 _handleAllSettingsChange(setting) { |
2510 if (this.locked) { |
2231 if (this.locked) { |
2511 return; |
2232 return; |
2512 } |
2233 } |
2513 |
|
2514 if (!setting.id.startsWith('widget_')) { |
2234 if (!setting.id.startsWith('widget_')) { |
2515 return; |
2235 return; |
2516 } |
2236 } |
2517 |
|
2518 const widgetId = settingIdToWidgetId(setting.id); |
2237 const widgetId = settingIdToWidgetId(setting.id); |
2519 |
|
2520 if (!this.setting.get().includes(widgetId)) { |
2238 if (!this.setting.get().includes(widgetId)) { |
2521 return; |
2239 return; |
2522 } |
2240 } |
2523 |
|
2524 const prevWidgets = this.getWidgets(); |
2241 const prevWidgets = this.getWidgets(); |
2525 |
|
2526 this._pushHistory(); |
2242 this._pushHistory(); |
2527 |
|
2528 this._emit(prevWidgets, this.getWidgets()); |
2243 this._emit(prevWidgets, this.getWidgets()); |
2529 } |
2244 } |
2530 |
|
2531 _createWidget(widget) { |
2245 _createWidget(widget) { |
2532 const widgetModel = wp.customize.Widgets.availableWidgets.findWhere({ |
2246 const widgetModel = wp.customize.Widgets.availableWidgets.findWhere({ |
2533 id_base: widget.idBase |
2247 id_base: widget.idBase |
2534 }); |
2248 }); |
2535 let number = widget.number; |
2249 let number = widget.number; |
2536 |
|
2537 if (widgetModel.get('is_multi') && !number) { |
2250 if (widgetModel.get('is_multi') && !number) { |
2538 widgetModel.set('multi_number', widgetModel.get('multi_number') + 1); |
2251 widgetModel.set('multi_number', widgetModel.get('multi_number') + 1); |
2539 number = widgetModel.get('multi_number'); |
2252 number = widgetModel.get('multi_number'); |
2540 } |
2253 } |
2541 |
|
2542 const settingId = number ? `widget_${widget.idBase}[${number}]` : `widget_${widget.idBase}`; |
2254 const settingId = number ? `widget_${widget.idBase}[${number}]` : `widget_${widget.idBase}`; |
2543 const settingArgs = { |
2255 const settingArgs = { |
2544 transport: wp.customize.Widgets.data.selectiveRefreshableWidgets[widgetModel.get('id_base')] ? 'postMessage' : 'refresh', |
2256 transport: wp.customize.Widgets.data.selectiveRefreshableWidgets[widgetModel.get('id_base')] ? 'postMessage' : 'refresh', |
2545 previewer: this.setting.previewer |
2257 previewer: this.setting.previewer |
2546 }; |
2258 }; |
2547 const setting = this.api.create(settingId, settingId, '', settingArgs); |
2259 const setting = this.api.create(settingId, settingId, '', settingArgs); |
2548 setting.set(widget.instance); |
2260 setting.set(widget.instance); |
2549 const widgetId = settingIdToWidgetId(settingId); |
2261 const widgetId = settingIdToWidgetId(settingId); |
2550 return widgetId; |
2262 return widgetId; |
2551 } |
2263 } |
2552 |
|
2553 _removeWidget(widget) { |
2264 _removeWidget(widget) { |
2554 const settingId = widgetIdToSettingId(widget.id); |
2265 const settingId = widgetIdToSettingId(widget.id); |
2555 const setting = this.api(settingId); |
2266 const setting = this.api(settingId); |
2556 |
|
2557 if (setting) { |
2267 if (setting) { |
2558 const instance = setting.get(); |
2268 const instance = setting.get(); |
2559 this.widgetsCache.delete(instance); |
2269 this.widgetsCache.delete(instance); |
2560 } |
2270 } |
2561 |
|
2562 this.api.remove(settingId); |
2271 this.api.remove(settingId); |
2563 } |
2272 } |
2564 |
|
2565 _updateWidget(widget) { |
2273 _updateWidget(widget) { |
2566 const prevWidget = this.getWidget(widget.id); // Bail out update if nothing changed. |
2274 const prevWidget = this.getWidget(widget.id); |
2567 |
2275 |
|
2276 // Bail out update if nothing changed. |
2568 if (prevWidget === widget) { |
2277 if (prevWidget === widget) { |
2569 return widget.id; |
2278 return widget.id; |
2570 } // Update existing setting if only the widget's instance changed. |
2279 } |
2571 |
2280 |
2572 |
2281 // Update existing setting if only the widget's instance changed. |
2573 if (prevWidget.idBase && widget.idBase && prevWidget.idBase === widget.idBase) { |
2282 if (prevWidget.idBase && widget.idBase && prevWidget.idBase === widget.idBase) { |
2574 const settingId = widgetIdToSettingId(widget.id); |
2283 const settingId = widgetIdToSettingId(widget.id); |
2575 this.api(settingId).set(widget.instance); |
2284 this.api(settingId).set(widget.instance); |
2576 return widget.id; |
2285 return widget.id; |
2577 } // Otherwise delete and re-create. |
2286 } |
2578 |
2287 |
2579 |
2288 // Otherwise delete and re-create. |
2580 this._removeWidget(widget); |
2289 this._removeWidget(widget); |
2581 |
|
2582 return this._createWidget(widget); |
2290 return this._createWidget(widget); |
2583 } |
2291 } |
2584 |
|
2585 getWidget(widgetId) { |
2292 getWidget(widgetId) { |
2586 if (!widgetId) { |
2293 if (!widgetId) { |
2587 return null; |
2294 return null; |
2588 } |
2295 } |
2589 |
|
2590 const { |
2296 const { |
2591 idBase, |
2297 idBase, |
2592 number |
2298 number |
2593 } = parseWidgetId(widgetId); |
2299 } = parseWidgetId(widgetId); |
2594 const settingId = widgetIdToSettingId(widgetId); |
2300 const settingId = widgetIdToSettingId(widgetId); |
2595 const setting = this.api(settingId); |
2301 const setting = this.api(settingId); |
2596 |
|
2597 if (!setting) { |
2302 if (!setting) { |
2598 return null; |
2303 return null; |
2599 } |
2304 } |
2600 |
|
2601 const instance = setting.get(); |
2305 const instance = setting.get(); |
2602 |
|
2603 if (this.widgetsCache.has(instance)) { |
2306 if (this.widgetsCache.has(instance)) { |
2604 return this.widgetsCache.get(instance); |
2307 return this.widgetsCache.get(instance); |
2605 } |
2308 } |
2606 |
|
2607 const widget = { |
2309 const widget = { |
2608 id: widgetId, |
2310 id: widgetId, |
2609 idBase, |
2311 idBase, |
2610 number, |
2312 number, |
2611 instance |
2313 instance |
2612 }; |
2314 }; |
2613 this.widgetsCache.set(instance, widget); |
2315 this.widgetsCache.set(instance, widget); |
2614 return widget; |
2316 return widget; |
2615 } |
2317 } |
2616 |
|
2617 _updateWidgets(nextWidgets) { |
2318 _updateWidgets(nextWidgets) { |
2618 this.locked = true; |
2319 this.locked = true; |
2619 const addedWidgetIds = []; |
2320 const addedWidgetIds = []; |
2620 const nextWidgetIds = nextWidgets.map(nextWidget => { |
2321 const nextWidgetIds = nextWidgets.map(nextWidget => { |
2621 if (nextWidget.id && this.getWidget(nextWidget.id)) { |
2322 if (nextWidget.id && this.getWidget(nextWidget.id)) { |
2622 addedWidgetIds.push(null); |
2323 addedWidgetIds.push(null); |
2623 return this._updateWidget(nextWidget); |
2324 return this._updateWidget(nextWidget); |
2624 } |
2325 } |
2625 |
|
2626 const widgetId = this._createWidget(nextWidget); |
2326 const widgetId = this._createWidget(nextWidget); |
2627 |
|
2628 addedWidgetIds.push(widgetId); |
2327 addedWidgetIds.push(widgetId); |
2629 return widgetId; |
2328 return widgetId; |
2630 }); |
2329 }); |
2631 const deletedWidgets = this.getWidgets().filter(widget => !nextWidgetIds.includes(widget.id)); |
2330 const deletedWidgets = this.getWidgets().filter(widget => !nextWidgetIds.includes(widget.id)); |
2632 deletedWidgets.forEach(widget => this._removeWidget(widget)); |
2331 deletedWidgets.forEach(widget => this._removeWidget(widget)); |
2633 this.setting.set(nextWidgetIds); |
2332 this.setting.set(nextWidgetIds); |
2634 this.locked = false; |
2333 this.locked = false; |
2635 return addedWidgetIds; |
2334 return addedWidgetIds; |
2636 } |
2335 } |
2637 |
|
2638 setWidgets(nextWidgets) { |
2336 setWidgets(nextWidgets) { |
2639 const addedWidgetIds = this._updateWidgets(nextWidgets); |
2337 const addedWidgetIds = this._updateWidgets(nextWidgets); |
2640 |
|
2641 this._debounceSetHistory(); |
2338 this._debounceSetHistory(); |
2642 |
|
2643 return addedWidgetIds; |
2339 return addedWidgetIds; |
2644 } |
2340 } |
|
2341 |
2645 /** |
2342 /** |
2646 * Undo/Redo related features |
2343 * Undo/Redo related features |
2647 */ |
2344 */ |
2648 |
|
2649 |
|
2650 hasUndo() { |
2345 hasUndo() { |
2651 return this.historyIndex > 0; |
2346 return this.historyIndex > 0; |
2652 } |
2347 } |
2653 |
|
2654 hasRedo() { |
2348 hasRedo() { |
2655 return this.historyIndex < this.history.length - 1; |
2349 return this.historyIndex < this.history.length - 1; |
2656 } |
2350 } |
2657 |
|
2658 _seek(historyIndex) { |
2351 _seek(historyIndex) { |
2659 const currentWidgets = this.getWidgets(); |
2352 const currentWidgets = this.getWidgets(); |
2660 this.historyIndex = historyIndex; |
2353 this.historyIndex = historyIndex; |
2661 const widgets = this.history[this.historyIndex]; |
2354 const widgets = this.history[this.historyIndex]; |
2662 |
|
2663 this._updateWidgets(widgets); |
2355 this._updateWidgets(widgets); |
2664 |
|
2665 this._emit(currentWidgets, this.getWidgets()); |
2356 this._emit(currentWidgets, this.getWidgets()); |
2666 |
|
2667 this.historySubscribers.forEach(listener => listener()); |
2357 this.historySubscribers.forEach(listener => listener()); |
2668 |
|
2669 this._debounceSetHistory.cancel(); |
2358 this._debounceSetHistory.cancel(); |
2670 } |
2359 } |
2671 |
|
2672 undo() { |
2360 undo() { |
2673 if (!this.hasUndo()) { |
2361 if (!this.hasUndo()) { |
2674 return; |
2362 return; |
2675 } |
2363 } |
2676 |
|
2677 this._seek(this.historyIndex - 1); |
2364 this._seek(this.historyIndex - 1); |
2678 } |
2365 } |
2679 |
|
2680 redo() { |
2366 redo() { |
2681 if (!this.hasRedo()) { |
2367 if (!this.hasRedo()) { |
2682 return; |
2368 return; |
2683 } |
2369 } |
2684 |
|
2685 this._seek(this.historyIndex + 1); |
2370 this._seek(this.historyIndex + 1); |
2686 } |
2371 } |
2687 |
|
2688 subscribeHistory(listener) { |
2372 subscribeHistory(listener) { |
2689 this.historySubscribers.add(listener); |
2373 this.historySubscribers.add(listener); |
2690 return () => { |
2374 return () => { |
2691 this.historySubscribers.delete(listener); |
2375 this.historySubscribers.delete(listener); |
2692 }; |
2376 }; |
2693 } |
2377 } |
2694 |
|
2695 save() { |
2378 save() { |
2696 this.api.previewer.save(); |
2379 this.api.previewer.save(); |
2697 } |
2380 } |
2698 |
|
2699 } |
2381 } |
2700 |
2382 |
2701 ;// CONCATENATED MODULE: external ["wp","dom"] |
2383 ;// CONCATENATED MODULE: external ["wp","dom"] |
2702 var external_wp_dom_namespaceObject = window["wp"]["dom"]; |
2384 const external_wp_dom_namespaceObject = window["wp"]["dom"]; |
2703 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/controls/inserter-outer-section.js |
2385 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/controls/inserter-outer-section.js |
2704 /** |
2386 /** |
2705 * WordPress dependencies |
2387 * WordPress dependencies |
2706 */ |
2388 */ |
2707 |
2389 |
2708 |
2390 |
2709 |
2391 |
|
2392 |
2710 /** |
2393 /** |
2711 * Internal dependencies |
2394 * Internal dependencies |
2712 */ |
2395 */ |
2713 |
|
2714 |
2396 |
2715 function getInserterOuterSection() { |
2397 function getInserterOuterSection() { |
2716 const { |
2398 const { |
2717 wp: { |
2399 wp: { |
2718 customize |
2400 customize |
2719 } |
2401 } |
2720 } = window; |
2402 } = window; |
2721 const OuterSection = customize.OuterSection; // Override the OuterSection class to handle multiple outer sections. |
2403 const OuterSection = customize.OuterSection; |
|
2404 // Override the OuterSection class to handle multiple outer sections. |
2722 // It closes all the other outer sections whenever one is opened. |
2405 // It closes all the other outer sections whenever one is opened. |
2723 // The result is that at most one outer section can be opened at the same time. |
2406 // The result is that at most one outer section can be opened at the same time. |
2724 |
|
2725 customize.OuterSection = class extends OuterSection { |
2407 customize.OuterSection = class extends OuterSection { |
2726 onChangeExpanded(expanded, args) { |
2408 onChangeExpanded(expanded, args) { |
2727 if (expanded) { |
2409 if (expanded) { |
2728 customize.section.each(section => { |
2410 customize.section.each(section => { |
2729 if (section.params.type === 'outer' && section.id !== this.id) { |
2411 if (section.params.type === 'outer' && section.id !== this.id) { |
2916 const block = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getBlock(clientId), [clientId]); |
2580 const block = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getBlock(clientId), [clientId]); |
2917 const { |
2581 const { |
2918 removeBlock |
2582 removeBlock |
2919 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); |
2583 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); |
2920 const [, focusWidget] = useFocusControl(); |
2584 const [, focusWidget] = useFocusControl(); |
2921 |
|
2922 function moveToSidebar(sidebarControlId) { |
2585 function moveToSidebar(sidebarControlId) { |
2923 const newSidebarControl = sidebarControls.find(sidebarControl => sidebarControl.id === sidebarControlId); |
2586 const newSidebarControl = sidebarControls.find(sidebarControl => sidebarControl.id === sidebarControlId); |
2924 |
|
2925 if (widgetId) { |
2587 if (widgetId) { |
2926 /** |
2588 /** |
2927 * If there's a widgetId, move it to the other sidebar. |
2589 * If there's a widgetId, move it to the other sidebar. |
2928 */ |
2590 */ |
2929 const oldSetting = activeSidebarControl.setting; |
2591 const oldSetting = activeSidebarControl.setting; |
2930 const newSetting = newSidebarControl.setting; |
2592 const newSetting = newSidebarControl.setting; |
2931 oldSetting((0,external_lodash_namespaceObject.without)(oldSetting(), widgetId)); |
2593 oldSetting(oldSetting().filter(id => id !== widgetId)); |
2932 newSetting([...newSetting(), widgetId]); |
2594 newSetting([...newSetting(), widgetId]); |
2933 } else { |
2595 } else { |
2934 /** |
2596 /** |
2935 * If there isn't a widgetId, it's most likely a inner block. |
2597 * If there isn't a widgetId, it's most likely a inner block. |
2936 * First, remove the block in the original sidebar, |
2598 * First, remove the block in the original sidebar, |
2937 * then, create a new widget in the new sidebar and get back its widgetId. |
2599 * then, create a new widget in the new sidebar and get back its widgetId. |
2938 */ |
2600 */ |
2939 const sidebarAdapter = newSidebarControl.sidebarAdapter; |
2601 const sidebarAdapter = newSidebarControl.sidebarAdapter; |
2940 removeBlock(clientId); |
2602 removeBlock(clientId); |
2941 const addedWidgetIds = sidebarAdapter.setWidgets([...sidebarAdapter.getWidgets(), blockToWidget(block)]); // The last non-null id is the added widget's id. |
2603 const addedWidgetIds = sidebarAdapter.setWidgets([...sidebarAdapter.getWidgets(), blockToWidget(block)]); |
2942 |
2604 // The last non-null id is the added widget's id. |
2943 widgetId = addedWidgetIds.reverse().find(id => !!id); |
2605 widgetId = addedWidgetIds.reverse().find(id => !!id); |
2944 } // Move focus to the moved widget and expand the sidebar. |
2606 } |
2945 |
2607 |
2946 |
2608 // Move focus to the moved widget and expand the sidebar. |
2947 focusWidget(widgetId); |
2609 focusWidget(widgetId); |
2948 } |
2610 } |
2949 |
2611 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
2950 return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(BlockEdit, props), hasMultipleSidebars && canInsertBlockInSidebar && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_widgets_namespaceObject.MoveToWidgetArea, { |
2612 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockEdit, { |
2951 widgetAreas: sidebarControls.map(sidebarControl => ({ |
2613 ...props |
2952 id: sidebarControl.id, |
2614 }), hasMultipleSidebars && canInsertBlockInSidebar && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { |
2953 name: sidebarControl.params.label, |
2615 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_widgets_namespaceObject.MoveToWidgetArea, { |
2954 description: sidebarControl.params.description |
2616 widgetAreas: sidebarControls.map(sidebarControl => ({ |
2955 })), |
2617 id: sidebarControl.id, |
2956 currentWidgetAreaId: activeSidebarControl === null || activeSidebarControl === void 0 ? void 0 : activeSidebarControl.id, |
2618 name: sidebarControl.params.label, |
2957 onSelect: moveToSidebar |
2619 description: sidebarControl.params.description |
2958 }))); |
2620 })), |
|
2621 currentWidgetAreaId: activeSidebarControl?.id, |
|
2622 onSelect: moveToSidebar |
|
2623 }) |
|
2624 })] |
|
2625 }); |
2959 }, 'withMoveToSidebarToolbarItem'); |
2626 }, 'withMoveToSidebarToolbarItem'); |
2960 (0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/customize-widgets/block-edit', withMoveToSidebarToolbarItem); |
2627 (0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/customize-widgets/block-edit', withMoveToSidebarToolbarItem); |
2961 |
2628 |
2962 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/filters/replace-media-upload.js |
2629 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/filters/replace-media-upload.js |
2963 /** |
2630 /** |
2964 * WordPress dependencies |
2631 * WordPress dependencies |
2965 */ |
2632 */ |
2966 |
2633 |
2967 |
2634 |
2968 |
|
2969 const replaceMediaUpload = () => external_wp_mediaUtils_namespaceObject.MediaUpload; |
2635 const replaceMediaUpload = () => external_wp_mediaUtils_namespaceObject.MediaUpload; |
2970 |
|
2971 (0,external_wp_hooks_namespaceObject.addFilter)('editor.MediaUpload', 'core/edit-widgets/replace-media-upload', replaceMediaUpload); |
2636 (0,external_wp_hooks_namespaceObject.addFilter)('editor.MediaUpload', 'core/edit-widgets/replace-media-upload', replaceMediaUpload); |
2972 |
2637 |
2973 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/filters/wide-widget-display.js |
2638 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/filters/wide-widget-display.js |
2974 |
2639 /** |
2975 |
2640 * WordPress dependencies |
2976 |
2641 */ |
2977 /** |
2642 |
2978 * WordPress dependencies |
|
2979 */ |
|
2980 |
2643 |
2981 |
2644 |
2982 const { |
2645 const { |
2983 wp: wide_widget_display_wp |
2646 wp: wide_widget_display_wp |
2984 } = window; |
2647 } = window; |
2985 const withWideWidgetDisplay = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockEdit => props => { |
2648 const withWideWidgetDisplay = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockEdit => props => { |
2986 var _wp$customize$Widgets, _wp$customize$Widgets2; |
2649 var _wp$customize$Widgets; |
2987 |
|
2988 const { |
2650 const { |
2989 idBase |
2651 idBase |
2990 } = props.attributes; |
2652 } = props.attributes; |
2991 const isWide = (_wp$customize$Widgets = (_wp$customize$Widgets2 = wide_widget_display_wp.customize.Widgets.data.availableWidgets.find(widget => widget.id_base === idBase)) === null || _wp$customize$Widgets2 === void 0 ? void 0 : _wp$customize$Widgets2.is_wide) !== null && _wp$customize$Widgets !== void 0 ? _wp$customize$Widgets : false; |
2653 const isWide = (_wp$customize$Widgets = wide_widget_display_wp.customize.Widgets.data.availableWidgets.find(widget => widget.id_base === idBase)?.is_wide) !== null && _wp$customize$Widgets !== void 0 ? _wp$customize$Widgets : false; |
2992 return (0,external_wp_element_namespaceObject.createElement)(BlockEdit, _extends({}, props, { |
2654 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockEdit, { |
|
2655 ...props, |
2993 isWide: isWide |
2656 isWide: isWide |
2994 })); |
2657 }); |
2995 }, 'withWideWidgetDisplay'); |
2658 }, 'withWideWidgetDisplay'); |
2996 (0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/customize-widgets/wide-widget-display', withWideWidgetDisplay); |
2659 (0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/customize-widgets/wide-widget-display', withWideWidgetDisplay); |
2997 |
2660 |
2998 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/filters/index.js |
2661 ;// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/filters/index.js |
2999 /** |
2662 /** |