[ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Summary view] [Print] [Text view]
1 /******/ (() => { // webpackBootstrap 2 /******/ "use strict"; 3 /******/ // The require scope 4 /******/ var __webpack_require__ = {}; 5 /******/ 6 /************************************************************************/ 7 /******/ /* webpack/runtime/compat get default export */ 8 /******/ (() => { 9 /******/ // getDefaultExport function for compatibility with non-harmony modules 10 /******/ __webpack_require__.n = (module) => { 11 /******/ var getter = module && module.__esModule ? 12 /******/ () => (module['default']) : 13 /******/ () => (module); 14 /******/ __webpack_require__.d(getter, { a: getter }); 15 /******/ return getter; 16 /******/ }; 17 /******/ })(); 18 /******/ 19 /******/ /* webpack/runtime/define property getters */ 20 /******/ (() => { 21 /******/ // define getter functions for harmony exports 22 /******/ __webpack_require__.d = (exports, definition) => { 23 /******/ for(var key in definition) { 24 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 25 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 26 /******/ } 27 /******/ } 28 /******/ }; 29 /******/ })(); 30 /******/ 31 /******/ /* webpack/runtime/hasOwnProperty shorthand */ 32 /******/ (() => { 33 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 34 /******/ })(); 35 /******/ 36 /******/ /* webpack/runtime/make namespace object */ 37 /******/ (() => { 38 /******/ // define __esModule on exports 39 /******/ __webpack_require__.r = (exports) => { 40 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 41 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 42 /******/ } 43 /******/ Object.defineProperty(exports, '__esModule', { value: true }); 44 /******/ }; 45 /******/ })(); 46 /******/ 47 /************************************************************************/ 48 var __webpack_exports__ = {}; 49 // ESM COMPAT FLAG 50 __webpack_require__.r(__webpack_exports__); 51 52 // EXPORTS 53 __webpack_require__.d(__webpack_exports__, { 54 initialize: () => (/* binding */ initialize), 55 initializeEditor: () => (/* binding */ initializeEditor), 56 reinitializeEditor: () => (/* binding */ reinitializeEditor), 57 store: () => (/* reexport */ store_store) 58 }); 59 60 // NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/store/actions.js 61 var actions_namespaceObject = {}; 62 __webpack_require__.r(actions_namespaceObject); 63 __webpack_require__.d(actions_namespaceObject, { 64 closeModal: () => (closeModal), 65 disableComplementaryArea: () => (disableComplementaryArea), 66 enableComplementaryArea: () => (enableComplementaryArea), 67 openModal: () => (openModal), 68 pinItem: () => (pinItem), 69 setDefaultComplementaryArea: () => (setDefaultComplementaryArea), 70 setFeatureDefaults: () => (setFeatureDefaults), 71 setFeatureValue: () => (setFeatureValue), 72 toggleFeature: () => (toggleFeature), 73 unpinItem: () => (unpinItem) 74 }); 75 76 // NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/store/selectors.js 77 var selectors_namespaceObject = {}; 78 __webpack_require__.r(selectors_namespaceObject); 79 __webpack_require__.d(selectors_namespaceObject, { 80 getActiveComplementaryArea: () => (getActiveComplementaryArea), 81 isComplementaryAreaLoading: () => (isComplementaryAreaLoading), 82 isFeatureActive: () => (isFeatureActive), 83 isItemPinned: () => (isItemPinned), 84 isModalActive: () => (isModalActive) 85 }); 86 87 // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/store/actions.js 88 var store_actions_namespaceObject = {}; 89 __webpack_require__.r(store_actions_namespaceObject); 90 __webpack_require__.d(store_actions_namespaceObject, { 91 closeGeneralSidebar: () => (closeGeneralSidebar), 92 lockWidgetSaving: () => (lockWidgetSaving), 93 moveBlockToWidgetArea: () => (moveBlockToWidgetArea), 94 persistStubPost: () => (persistStubPost), 95 saveEditedWidgetAreas: () => (saveEditedWidgetAreas), 96 saveWidgetArea: () => (saveWidgetArea), 97 saveWidgetAreas: () => (saveWidgetAreas), 98 setIsInserterOpened: () => (setIsInserterOpened), 99 setIsListViewOpened: () => (setIsListViewOpened), 100 setIsWidgetAreaOpen: () => (setIsWidgetAreaOpen), 101 setWidgetAreasOpenState: () => (setWidgetAreasOpenState), 102 setWidgetIdForClientId: () => (setWidgetIdForClientId), 103 unlockWidgetSaving: () => (unlockWidgetSaving) 104 }); 105 106 // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/store/resolvers.js 107 var resolvers_namespaceObject = {}; 108 __webpack_require__.r(resolvers_namespaceObject); 109 __webpack_require__.d(resolvers_namespaceObject, { 110 getWidgetAreas: () => (getWidgetAreas), 111 getWidgets: () => (getWidgets) 112 }); 113 114 // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/store/selectors.js 115 var store_selectors_namespaceObject = {}; 116 __webpack_require__.r(store_selectors_namespaceObject); 117 __webpack_require__.d(store_selectors_namespaceObject, { 118 __experimentalGetInsertionPoint: () => (__experimentalGetInsertionPoint), 119 canInsertBlockInWidgetArea: () => (canInsertBlockInWidgetArea), 120 getEditedWidgetAreas: () => (getEditedWidgetAreas), 121 getIsWidgetAreaOpen: () => (getIsWidgetAreaOpen), 122 getParentWidgetAreaBlock: () => (getParentWidgetAreaBlock), 123 getReferenceWidgetBlocks: () => (getReferenceWidgetBlocks), 124 getWidget: () => (getWidget), 125 getWidgetAreaForWidgetId: () => (getWidgetAreaForWidgetId), 126 getWidgetAreas: () => (selectors_getWidgetAreas), 127 getWidgets: () => (selectors_getWidgets), 128 isInserterOpened: () => (isInserterOpened), 129 isListViewOpened: () => (isListViewOpened), 130 isSavingWidgetAreas: () => (isSavingWidgetAreas), 131 isWidgetSavingLocked: () => (isWidgetSavingLocked) 132 }); 133 134 // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/store/private-selectors.js 135 var private_selectors_namespaceObject = {}; 136 __webpack_require__.r(private_selectors_namespaceObject); 137 __webpack_require__.d(private_selectors_namespaceObject, { 138 getInserterSidebarToggleRef: () => (getInserterSidebarToggleRef), 139 getListViewToggleRef: () => (getListViewToggleRef) 140 }); 141 142 // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/blocks/widget-area/index.js 143 var widget_area_namespaceObject = {}; 144 __webpack_require__.r(widget_area_namespaceObject); 145 __webpack_require__.d(widget_area_namespaceObject, { 146 metadata: () => (block_namespaceObject), 147 name: () => (widget_area_name), 148 settings: () => (settings) 149 }); 150 151 ;// external "ReactJSXRuntime" 152 const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; 153 ;// external ["wp","blocks"] 154 const external_wp_blocks_namespaceObject = window["wp"]["blocks"]; 155 ;// external ["wp","data"] 156 const external_wp_data_namespaceObject = window["wp"]["data"]; 157 ;// external ["wp","deprecated"] 158 const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"]; 159 var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject); 160 ;// external ["wp","element"] 161 const external_wp_element_namespaceObject = window["wp"]["element"]; 162 ;// external ["wp","blockLibrary"] 163 const external_wp_blockLibrary_namespaceObject = window["wp"]["blockLibrary"]; 164 ;// external ["wp","coreData"] 165 const external_wp_coreData_namespaceObject = window["wp"]["coreData"]; 166 ;// external ["wp","widgets"] 167 const external_wp_widgets_namespaceObject = window["wp"]["widgets"]; 168 ;// external ["wp","preferences"] 169 const external_wp_preferences_namespaceObject = window["wp"]["preferences"]; 170 ;// external ["wp","apiFetch"] 171 const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"]; 172 var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject); 173 ;// ./node_modules/@wordpress/edit-widgets/build-module/store/reducer.js 174 175 function widgetAreasOpenState(state = {}, action) { 176 const { type } = action; 177 switch (type) { 178 case "SET_WIDGET_AREAS_OPEN_STATE": { 179 return action.widgetAreasOpenState; 180 } 181 case "SET_IS_WIDGET_AREA_OPEN": { 182 const { clientId, isOpen } = action; 183 return { 184 ...state, 185 [clientId]: isOpen 186 }; 187 } 188 default: { 189 return state; 190 } 191 } 192 } 193 function blockInserterPanel(state = false, action) { 194 switch (action.type) { 195 case "SET_IS_LIST_VIEW_OPENED": 196 return action.isOpen ? false : state; 197 case "SET_IS_INSERTER_OPENED": 198 return action.value; 199 } 200 return state; 201 } 202 function listViewPanel(state = false, action) { 203 switch (action.type) { 204 case "SET_IS_INSERTER_OPENED": 205 return action.value ? false : state; 206 case "SET_IS_LIST_VIEW_OPENED": 207 return action.isOpen; 208 } 209 return state; 210 } 211 function listViewToggleRef(state = { current: null }) { 212 return state; 213 } 214 function inserterSidebarToggleRef(state = { current: null }) { 215 return state; 216 } 217 function widgetSavingLock(state = {}, action) { 218 switch (action.type) { 219 case "LOCK_WIDGET_SAVING": 220 return { ...state, [action.lockName]: true }; 221 case "UNLOCK_WIDGET_SAVING": { 222 const { [action.lockName]: removedLockName, ...restState } = state; 223 return restState; 224 } 225 } 226 return state; 227 } 228 var reducer_default = (0,external_wp_data_namespaceObject.combineReducers)({ 229 blockInserterPanel, 230 inserterSidebarToggleRef, 231 listViewPanel, 232 listViewToggleRef, 233 widgetAreasOpenState, 234 widgetSavingLock 235 }); 236 237 238 ;// external ["wp","i18n"] 239 const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; 240 ;// external ["wp","notices"] 241 const external_wp_notices_namespaceObject = window["wp"]["notices"]; 242 ;// ./node_modules/clsx/dist/clsx.mjs 243 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); 244 ;// external ["wp","components"] 245 const external_wp_components_namespaceObject = window["wp"]["components"]; 246 ;// external ["wp","primitives"] 247 const external_wp_primitives_namespaceObject = window["wp"]["primitives"]; 248 ;// ./node_modules/@wordpress/icons/build-module/library/check.js 249 250 251 var check_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z" }) }); 252 253 254 ;// ./node_modules/@wordpress/icons/build-module/library/star-filled.js 255 256 257 var star_filled_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z" }) }); 258 259 260 ;// ./node_modules/@wordpress/icons/build-module/library/star-empty.js 261 262 263 var star_empty_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 264 external_wp_primitives_namespaceObject.Path, 265 { 266 fillRule: "evenodd", 267 d: "M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z", 268 clipRule: "evenodd" 269 } 270 ) }); 271 272 273 ;// external ["wp","viewport"] 274 const external_wp_viewport_namespaceObject = window["wp"]["viewport"]; 275 ;// external ["wp","compose"] 276 const external_wp_compose_namespaceObject = window["wp"]["compose"]; 277 ;// external ["wp","plugins"] 278 const external_wp_plugins_namespaceObject = window["wp"]["plugins"]; 279 ;// ./node_modules/@wordpress/icons/build-module/library/close-small.js 280 281 282 var close_small_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 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" }) }); 283 284 285 ;// ./node_modules/@wordpress/interface/build-module/store/deprecated.js 286 287 function normalizeComplementaryAreaScope(scope) { 288 if (["core/edit-post", "core/edit-site"].includes(scope)) { 289 external_wp_deprecated_default()(`$scope} interface scope`, { 290 alternative: "core interface scope", 291 hint: "core/edit-post and core/edit-site are merging.", 292 version: "6.6" 293 }); 294 return "core"; 295 } 296 return scope; 297 } 298 function normalizeComplementaryAreaName(scope, name) { 299 if (scope === "core" && name === "edit-site/template") { 300 external_wp_deprecated_default()(`edit-site/template sidebar`, { 301 alternative: "edit-post/document", 302 version: "6.6" 303 }); 304 return "edit-post/document"; 305 } 306 if (scope === "core" && name === "edit-site/block-inspector") { 307 external_wp_deprecated_default()(`edit-site/block-inspector sidebar`, { 308 alternative: "edit-post/block", 309 version: "6.6" 310 }); 311 return "edit-post/block"; 312 } 313 return name; 314 } 315 316 317 ;// ./node_modules/@wordpress/interface/build-module/store/actions.js 318 319 320 321 const setDefaultComplementaryArea = (scope, area) => { 322 scope = normalizeComplementaryAreaScope(scope); 323 area = normalizeComplementaryAreaName(scope, area); 324 return { 325 type: "SET_DEFAULT_COMPLEMENTARY_AREA", 326 scope, 327 area 328 }; 329 }; 330 const enableComplementaryArea = (scope, area) => ({ registry, dispatch }) => { 331 if (!area) { 332 return; 333 } 334 scope = normalizeComplementaryAreaScope(scope); 335 area = normalizeComplementaryAreaName(scope, area); 336 const isComplementaryAreaVisible = registry.select(external_wp_preferences_namespaceObject.store).get(scope, "isComplementaryAreaVisible"); 337 if (!isComplementaryAreaVisible) { 338 registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, "isComplementaryAreaVisible", true); 339 } 340 dispatch({ 341 type: "ENABLE_COMPLEMENTARY_AREA", 342 scope, 343 area 344 }); 345 }; 346 const disableComplementaryArea = (scope) => ({ registry }) => { 347 scope = normalizeComplementaryAreaScope(scope); 348 const isComplementaryAreaVisible = registry.select(external_wp_preferences_namespaceObject.store).get(scope, "isComplementaryAreaVisible"); 349 if (isComplementaryAreaVisible) { 350 registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, "isComplementaryAreaVisible", false); 351 } 352 }; 353 const pinItem = (scope, item) => ({ registry }) => { 354 if (!item) { 355 return; 356 } 357 scope = normalizeComplementaryAreaScope(scope); 358 item = normalizeComplementaryAreaName(scope, item); 359 const pinnedItems = registry.select(external_wp_preferences_namespaceObject.store).get(scope, "pinnedItems"); 360 if (pinnedItems?.[item] === true) { 361 return; 362 } 363 registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, "pinnedItems", { 364 ...pinnedItems, 365 [item]: true 366 }); 367 }; 368 const unpinItem = (scope, item) => ({ registry }) => { 369 if (!item) { 370 return; 371 } 372 scope = normalizeComplementaryAreaScope(scope); 373 item = normalizeComplementaryAreaName(scope, item); 374 const pinnedItems = registry.select(external_wp_preferences_namespaceObject.store).get(scope, "pinnedItems"); 375 registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, "pinnedItems", { 376 ...pinnedItems, 377 [item]: false 378 }); 379 }; 380 function toggleFeature(scope, featureName) { 381 return function({ registry }) { 382 external_wp_deprecated_default()(`dispatch( 'core/interface' ).toggleFeature`, { 383 since: "6.0", 384 alternative: `dispatch( 'core/preferences' ).toggle` 385 }); 386 registry.dispatch(external_wp_preferences_namespaceObject.store).toggle(scope, featureName); 387 }; 388 } 389 function setFeatureValue(scope, featureName, value) { 390 return function({ registry }) { 391 external_wp_deprecated_default()(`dispatch( 'core/interface' ).setFeatureValue`, { 392 since: "6.0", 393 alternative: `dispatch( 'core/preferences' ).set` 394 }); 395 registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, featureName, !!value); 396 }; 397 } 398 function setFeatureDefaults(scope, defaults) { 399 return function({ registry }) { 400 external_wp_deprecated_default()(`dispatch( 'core/interface' ).setFeatureDefaults`, { 401 since: "6.0", 402 alternative: `dispatch( 'core/preferences' ).setDefaults` 403 }); 404 registry.dispatch(external_wp_preferences_namespaceObject.store).setDefaults(scope, defaults); 405 }; 406 } 407 function openModal(name) { 408 return { 409 type: "OPEN_MODAL", 410 name 411 }; 412 } 413 function closeModal() { 414 return { 415 type: "CLOSE_MODAL" 416 }; 417 } 418 419 420 ;// ./node_modules/@wordpress/interface/build-module/store/selectors.js 421 422 423 424 425 const getActiveComplementaryArea = (0,external_wp_data_namespaceObject.createRegistrySelector)( 426 (select) => (state, scope) => { 427 scope = normalizeComplementaryAreaScope(scope); 428 const isComplementaryAreaVisible = select(external_wp_preferences_namespaceObject.store).get( 429 scope, 430 "isComplementaryAreaVisible" 431 ); 432 if (isComplementaryAreaVisible === void 0) { 433 return void 0; 434 } 435 if (isComplementaryAreaVisible === false) { 436 return null; 437 } 438 return state?.complementaryAreas?.[scope]; 439 } 440 ); 441 const isComplementaryAreaLoading = (0,external_wp_data_namespaceObject.createRegistrySelector)( 442 (select) => (state, scope) => { 443 scope = normalizeComplementaryAreaScope(scope); 444 const isVisible = select(external_wp_preferences_namespaceObject.store).get( 445 scope, 446 "isComplementaryAreaVisible" 447 ); 448 const identifier = state?.complementaryAreas?.[scope]; 449 return isVisible && identifier === void 0; 450 } 451 ); 452 const isItemPinned = (0,external_wp_data_namespaceObject.createRegistrySelector)( 453 (select) => (state, scope, item) => { 454 scope = normalizeComplementaryAreaScope(scope); 455 item = normalizeComplementaryAreaName(scope, item); 456 const pinnedItems = select(external_wp_preferences_namespaceObject.store).get( 457 scope, 458 "pinnedItems" 459 ); 460 return pinnedItems?.[item] ?? true; 461 } 462 ); 463 const isFeatureActive = (0,external_wp_data_namespaceObject.createRegistrySelector)( 464 (select) => (state, scope, featureName) => { 465 external_wp_deprecated_default()( 466 `select( 'core/interface' ).isFeatureActive( scope, featureName )`, 467 { 468 since: "6.0", 469 alternative: `select( 'core/preferences' ).get( scope, featureName )` 470 } 471 ); 472 return !!select(external_wp_preferences_namespaceObject.store).get(scope, featureName); 473 } 474 ); 475 function isModalActive(state, modalName) { 476 return state.activeModal === modalName; 477 } 478 479 480 ;// ./node_modules/@wordpress/interface/build-module/store/reducer.js 481 482 function complementaryAreas(state = {}, action) { 483 switch (action.type) { 484 case "SET_DEFAULT_COMPLEMENTARY_AREA": { 485 const { scope, area } = action; 486 if (state[scope]) { 487 return state; 488 } 489 return { 490 ...state, 491 [scope]: area 492 }; 493 } 494 case "ENABLE_COMPLEMENTARY_AREA": { 495 const { scope, area } = action; 496 return { 497 ...state, 498 [scope]: area 499 }; 500 } 501 } 502 return state; 503 } 504 function activeModal(state = null, action) { 505 switch (action.type) { 506 case "OPEN_MODAL": 507 return action.name; 508 case "CLOSE_MODAL": 509 return null; 510 } 511 return state; 512 } 513 var reducer_reducer_default = (0,external_wp_data_namespaceObject.combineReducers)({ 514 complementaryAreas, 515 activeModal 516 }); 517 518 519 ;// ./node_modules/@wordpress/interface/build-module/store/constants.js 520 const STORE_NAME = "core/interface"; 521 522 523 ;// ./node_modules/@wordpress/interface/build-module/store/index.js 524 525 526 527 528 529 const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, { 530 reducer: reducer_reducer_default, 531 actions: actions_namespaceObject, 532 selectors: selectors_namespaceObject 533 }); 534 (0,external_wp_data_namespaceObject.register)(store); 535 536 537 ;// ./node_modules/@wordpress/interface/build-module/components/complementary-area-toggle/index.js 538 539 540 541 542 543 function roleSupportsCheckedState(role) { 544 return [ 545 "checkbox", 546 "option", 547 "radio", 548 "switch", 549 "menuitemcheckbox", 550 "menuitemradio", 551 "treeitem" 552 ].includes(role); 553 } 554 function ComplementaryAreaToggle({ 555 as = external_wp_components_namespaceObject.Button, 556 scope, 557 identifier: identifierProp, 558 icon: iconProp, 559 selectedIcon, 560 name, 561 shortcut, 562 ...props 563 }) { 564 const ComponentToUse = as; 565 const context = (0,external_wp_plugins_namespaceObject.usePluginContext)(); 566 const icon = iconProp || context.icon; 567 const identifier = identifierProp || `$context.name}/$name}`; 568 const isSelected = (0,external_wp_data_namespaceObject.useSelect)( 569 (select) => select(store).getActiveComplementaryArea(scope) === identifier, 570 [identifier, scope] 571 ); 572 const { enableComplementaryArea, disableComplementaryArea } = (0,external_wp_data_namespaceObject.useDispatch)(store); 573 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 574 ComponentToUse, 575 { 576 icon: selectedIcon && isSelected ? selectedIcon : icon, 577 "aria-controls": identifier.replace("/", ":"), 578 "aria-checked": roleSupportsCheckedState(props.role) ? isSelected : void 0, 579 onClick: () => { 580 if (isSelected) { 581 disableComplementaryArea(scope); 582 } else { 583 enableComplementaryArea(scope, identifier); 584 } 585 }, 586 shortcut, 587 ...props 588 } 589 ); 590 } 591 592 593 ;// ./node_modules/@wordpress/interface/build-module/components/complementary-area-header/index.js 594 595 596 597 598 const ComplementaryAreaHeader = ({ 599 children, 600 className, 601 toggleButtonProps 602 }) => { 603 const toggleButton = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ComplementaryAreaToggle, { icon: close_small_default, ...toggleButtonProps }); 604 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)( 605 "div", 606 { 607 className: dist_clsx( 608 "components-panel__header", 609 "interface-complementary-area-header", 610 className 611 ), 612 tabIndex: -1, 613 children: [ 614 children, 615 toggleButton 616 ] 617 } 618 ); 619 }; 620 var complementary_area_header_default = ComplementaryAreaHeader; 621 622 623 ;// ./node_modules/@wordpress/interface/build-module/components/action-item/index.js 624 625 626 627 const noop = () => { 628 }; 629 function ActionItemSlot({ 630 name, 631 as: Component = external_wp_components_namespaceObject.MenuGroup, 632 fillProps = {}, 633 bubblesVirtually, 634 ...props 635 }) { 636 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 637 external_wp_components_namespaceObject.Slot, 638 { 639 name, 640 bubblesVirtually, 641 fillProps, 642 children: (fills) => { 643 if (!external_wp_element_namespaceObject.Children.toArray(fills).length) { 644 return null; 645 } 646 const initializedByPlugins = []; 647 external_wp_element_namespaceObject.Children.forEach( 648 fills, 649 ({ 650 props: { __unstableExplicitMenuItem, __unstableTarget } 651 }) => { 652 if (__unstableTarget && __unstableExplicitMenuItem) { 653 initializedByPlugins.push(__unstableTarget); 654 } 655 } 656 ); 657 const children = external_wp_element_namespaceObject.Children.map(fills, (child) => { 658 if (!child.props.__unstableExplicitMenuItem && initializedByPlugins.includes( 659 child.props.__unstableTarget 660 )) { 661 return null; 662 } 663 return child; 664 }); 665 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, { ...props, children }); 666 } 667 } 668 ); 669 } 670 function ActionItem({ name, as: Component = external_wp_components_namespaceObject.Button, onClick, ...props }) { 671 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Fill, { name, children: ({ onClick: fpOnClick }) => { 672 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 673 Component, 674 { 675 onClick: onClick || fpOnClick ? (...args) => { 676 (onClick || noop)(...args); 677 (fpOnClick || noop)(...args); 678 } : void 0, 679 ...props 680 } 681 ); 682 } }); 683 } 684 ActionItem.Slot = ActionItemSlot; 685 var action_item_default = ActionItem; 686 687 688 ;// ./node_modules/@wordpress/interface/build-module/components/complementary-area-more-menu-item/index.js 689 690 691 692 693 694 const PluginsMenuItem = ({ 695 // Menu item is marked with unstable prop for backward compatibility. 696 // They are removed so they don't leak to DOM elements. 697 // @see https://github.com/WordPress/gutenberg/issues/14457 698 __unstableExplicitMenuItem, 699 __unstableTarget, 700 ...restProps 701 }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { ...restProps }); 702 function ComplementaryAreaMoreMenuItem({ 703 scope, 704 target, 705 __unstableExplicitMenuItem, 706 ...props 707 }) { 708 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 709 ComplementaryAreaToggle, 710 { 711 as: (toggleProps) => { 712 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 713 action_item_default, 714 { 715 __unstableExplicitMenuItem, 716 __unstableTarget: `$scope}/$target}`, 717 as: PluginsMenuItem, 718 name: `$scope}/plugin-more-menu`, 719 ...toggleProps 720 } 721 ); 722 }, 723 role: "menuitemcheckbox", 724 selectedIcon: check_default, 725 name: target, 726 scope, 727 ...props 728 } 729 ); 730 } 731 732 733 ;// ./node_modules/@wordpress/interface/build-module/components/pinned-items/index.js 734 735 736 737 function PinnedItems({ scope, ...props }) { 738 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Fill, { name: `PinnedItems/$scope}`, ...props }); 739 } 740 function PinnedItemsSlot({ scope, className, ...props }) { 741 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Slot, { name: `PinnedItems/$scope}`, ...props, children: (fills) => fills?.length > 0 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 742 "div", 743 { 744 className: dist_clsx( 745 className, 746 "interface-pinned-items" 747 ), 748 children: fills 749 } 750 ) }); 751 } 752 PinnedItems.Slot = PinnedItemsSlot; 753 var pinned_items_default = PinnedItems; 754 755 756 ;// ./node_modules/@wordpress/interface/build-module/components/complementary-area/index.js 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 const ANIMATION_DURATION = 0.3; 774 function ComplementaryAreaSlot({ scope, ...props }) { 775 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Slot, { name: `ComplementaryArea/$scope}`, ...props }); 776 } 777 const SIDEBAR_WIDTH = 280; 778 const variants = { 779 open: { width: SIDEBAR_WIDTH }, 780 closed: { width: 0 }, 781 mobileOpen: { width: "100vw" } 782 }; 783 function ComplementaryAreaFill({ 784 activeArea, 785 isActive, 786 scope, 787 children, 788 className, 789 id 790 }) { 791 const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); 792 const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<"); 793 const previousActiveArea = (0,external_wp_compose_namespaceObject.usePrevious)(activeArea); 794 const previousIsActive = (0,external_wp_compose_namespaceObject.usePrevious)(isActive); 795 const [, setState] = (0,external_wp_element_namespaceObject.useState)({}); 796 (0,external_wp_element_namespaceObject.useEffect)(() => { 797 setState({}); 798 }, [isActive]); 799 const transition = { 800 type: "tween", 801 duration: disableMotion || isMobileViewport || !!previousActiveArea && !!activeArea && activeArea !== previousActiveArea ? 0 : ANIMATION_DURATION, 802 ease: [0.6, 0, 0.4, 1] 803 }; 804 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Fill, { name: `ComplementaryArea/$scope}`, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableAnimatePresence, { initial: false, children: (previousIsActive || isActive) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 805 external_wp_components_namespaceObject.__unstableMotion.div, 806 { 807 variants, 808 initial: "closed", 809 animate: isMobileViewport ? "mobileOpen" : "open", 810 exit: "closed", 811 transition, 812 className: "interface-complementary-area__fill", 813 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 814 "div", 815 { 816 id, 817 className, 818 style: { 819 width: isMobileViewport ? "100vw" : SIDEBAR_WIDTH 820 }, 821 children 822 } 823 ) 824 } 825 ) }) }); 826 } 827 function useAdjustComplementaryListener(scope, identifier, activeArea, isActive, isSmall) { 828 const previousIsSmallRef = (0,external_wp_element_namespaceObject.useRef)(false); 829 const shouldOpenWhenNotSmallRef = (0,external_wp_element_namespaceObject.useRef)(false); 830 const { enableComplementaryArea, disableComplementaryArea } = (0,external_wp_data_namespaceObject.useDispatch)(store); 831 (0,external_wp_element_namespaceObject.useEffect)(() => { 832 if (isActive && isSmall && !previousIsSmallRef.current) { 833 disableComplementaryArea(scope); 834 shouldOpenWhenNotSmallRef.current = true; 835 } else if ( 836 // If there is a flag indicating the complementary area should be 837 // enabled when we go from small to big window size and we are going 838 // from a small to big window size. 839 shouldOpenWhenNotSmallRef.current && !isSmall && previousIsSmallRef.current 840 ) { 841 shouldOpenWhenNotSmallRef.current = false; 842 enableComplementaryArea(scope, identifier); 843 } else if ( 844 // If the flag is indicating the current complementary should be 845 // reopened but another complementary area becomes active, remove 846 // the flag. 847 shouldOpenWhenNotSmallRef.current && activeArea && activeArea !== identifier 848 ) { 849 shouldOpenWhenNotSmallRef.current = false; 850 } 851 if (isSmall !== previousIsSmallRef.current) { 852 previousIsSmallRef.current = isSmall; 853 } 854 }, [ 855 isActive, 856 isSmall, 857 scope, 858 identifier, 859 activeArea, 860 disableComplementaryArea, 861 enableComplementaryArea 862 ]); 863 } 864 function ComplementaryArea({ 865 children, 866 className, 867 closeLabel = (0,external_wp_i18n_namespaceObject.__)("Close plugin"), 868 identifier: identifierProp, 869 header, 870 headerClassName, 871 icon: iconProp, 872 isPinnable = true, 873 panelClassName, 874 scope, 875 name, 876 title, 877 toggleShortcut, 878 isActiveByDefault 879 }) { 880 const context = (0,external_wp_plugins_namespaceObject.usePluginContext)(); 881 const icon = iconProp || context.icon; 882 const identifier = identifierProp || `$context.name}/$name}`; 883 const [isReady, setIsReady] = (0,external_wp_element_namespaceObject.useState)(false); 884 const { 885 isLoading, 886 isActive, 887 isPinned, 888 activeArea, 889 isSmall, 890 isLarge, 891 showIconLabels 892 } = (0,external_wp_data_namespaceObject.useSelect)( 893 (select) => { 894 const { 895 getActiveComplementaryArea, 896 isComplementaryAreaLoading, 897 isItemPinned 898 } = select(store); 899 const { get } = select(external_wp_preferences_namespaceObject.store); 900 const _activeArea = getActiveComplementaryArea(scope); 901 return { 902 isLoading: isComplementaryAreaLoading(scope), 903 isActive: _activeArea === identifier, 904 isPinned: isItemPinned(scope, identifier), 905 activeArea: _activeArea, 906 isSmall: select(external_wp_viewport_namespaceObject.store).isViewportMatch("< medium"), 907 isLarge: select(external_wp_viewport_namespaceObject.store).isViewportMatch("large"), 908 showIconLabels: get("core", "showIconLabels") 909 }; 910 }, 911 [identifier, scope] 912 ); 913 const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<"); 914 useAdjustComplementaryListener( 915 scope, 916 identifier, 917 activeArea, 918 isActive, 919 isSmall 920 ); 921 const { 922 enableComplementaryArea, 923 disableComplementaryArea, 924 pinItem, 925 unpinItem 926 } = (0,external_wp_data_namespaceObject.useDispatch)(store); 927 (0,external_wp_element_namespaceObject.useEffect)(() => { 928 if (isActiveByDefault && activeArea === void 0 && !isSmall) { 929 enableComplementaryArea(scope, identifier); 930 } else if (activeArea === void 0 && isSmall) { 931 disableComplementaryArea(scope, identifier); 932 } 933 setIsReady(true); 934 }, [ 935 activeArea, 936 isActiveByDefault, 937 scope, 938 identifier, 939 isSmall, 940 enableComplementaryArea, 941 disableComplementaryArea 942 ]); 943 if (!isReady) { 944 return; 945 } 946 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [ 947 isPinnable && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(pinned_items_default, { scope, children: isPinned && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 948 ComplementaryAreaToggle, 949 { 950 scope, 951 identifier, 952 isPressed: isActive && (!showIconLabels || isLarge), 953 "aria-expanded": isActive, 954 "aria-disabled": isLoading, 955 label: title, 956 icon: showIconLabels ? check_default : icon, 957 showTooltip: !showIconLabels, 958 variant: showIconLabels ? "tertiary" : void 0, 959 size: "compact", 960 shortcut: toggleShortcut 961 } 962 ) }), 963 name && isPinnable && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 964 ComplementaryAreaMoreMenuItem, 965 { 966 target: name, 967 scope, 968 icon, 969 children: title 970 } 971 ), 972 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)( 973 ComplementaryAreaFill, 974 { 975 activeArea, 976 isActive, 977 className: dist_clsx("interface-complementary-area", className), 978 scope, 979 id: identifier.replace("/", ":"), 980 children: [ 981 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 982 complementary_area_header_default, 983 { 984 className: headerClassName, 985 closeLabel, 986 onClose: () => disableComplementaryArea(scope), 987 toggleButtonProps: { 988 label: closeLabel, 989 size: "compact", 990 shortcut: toggleShortcut, 991 scope, 992 identifier 993 }, 994 children: header || /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [ 995 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { className: "interface-complementary-area-header__title", children: title }), 996 isPinnable && !isMobileViewport && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 997 external_wp_components_namespaceObject.Button, 998 { 999 className: "interface-complementary-area__pin-unpin-item", 1000 icon: isPinned ? star_filled_default : star_empty_default, 1001 label: isPinned ? (0,external_wp_i18n_namespaceObject.__)("Unpin from toolbar") : (0,external_wp_i18n_namespaceObject.__)("Pin to toolbar"), 1002 onClick: () => (isPinned ? unpinItem : pinItem)( 1003 scope, 1004 identifier 1005 ), 1006 isPressed: isPinned, 1007 "aria-expanded": isPinned, 1008 size: "compact" 1009 } 1010 ) 1011 ] }) 1012 } 1013 ), 1014 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Panel, { className: panelClassName, children }) 1015 ] 1016 } 1017 ) 1018 ] }); 1019 } 1020 ComplementaryArea.Slot = ComplementaryAreaSlot; 1021 var complementary_area_default = ComplementaryArea; 1022 1023 1024 ;// ./node_modules/@wordpress/admin-ui/build-module/navigable-region/index.js 1025 1026 1027 1028 const NavigableRegion = (0,external_wp_element_namespaceObject.forwardRef)( 1029 ({ children, className, ariaLabel, as: Tag = "div", ...props }, ref) => { 1030 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 1031 Tag, 1032 { 1033 ref, 1034 className: dist_clsx("admin-ui-navigable-region", className), 1035 "aria-label": ariaLabel, 1036 role: "region", 1037 tabIndex: "-1", 1038 ...props, 1039 children 1040 } 1041 ); 1042 } 1043 ); 1044 NavigableRegion.displayName = "NavigableRegion"; 1045 var navigable_region_default = NavigableRegion; 1046 1047 1048 ;// ./node_modules/@wordpress/interface/build-module/components/interface-skeleton/index.js 1049 1050 1051 1052 1053 1054 1055 1056 const interface_skeleton_ANIMATION_DURATION = 0.25; 1057 const commonTransition = { 1058 type: "tween", 1059 duration: interface_skeleton_ANIMATION_DURATION, 1060 ease: [0.6, 0, 0.4, 1] 1061 }; 1062 function useHTMLClass(className) { 1063 (0,external_wp_element_namespaceObject.useEffect)(() => { 1064 const element = document && document.querySelector(`html:not(.$className})`); 1065 if (!element) { 1066 return; 1067 } 1068 element.classList.toggle(className); 1069 return () => { 1070 element.classList.toggle(className); 1071 }; 1072 }, [className]); 1073 } 1074 const headerVariants = { 1075 hidden: { opacity: 1, marginTop: -60 }, 1076 visible: { opacity: 1, marginTop: 0 }, 1077 distractionFreeHover: { 1078 opacity: 1, 1079 marginTop: 0, 1080 transition: { 1081 ...commonTransition, 1082 delay: 0.2, 1083 delayChildren: 0.2 1084 } 1085 }, 1086 distractionFreeHidden: { 1087 opacity: 0, 1088 marginTop: -60 1089 }, 1090 distractionFreeDisabled: { 1091 opacity: 0, 1092 marginTop: 0, 1093 transition: { 1094 ...commonTransition, 1095 delay: 0.8, 1096 delayChildren: 0.8 1097 } 1098 } 1099 }; 1100 function InterfaceSkeleton({ 1101 isDistractionFree, 1102 footer, 1103 header, 1104 editorNotices, 1105 sidebar, 1106 secondarySidebar, 1107 content, 1108 actions, 1109 labels, 1110 className 1111 }, ref) { 1112 const [secondarySidebarResizeListener, secondarySidebarSize] = (0,external_wp_compose_namespaceObject.useResizeObserver)(); 1113 const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<"); 1114 const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); 1115 const defaultTransition = { 1116 type: "tween", 1117 duration: disableMotion ? 0 : interface_skeleton_ANIMATION_DURATION, 1118 ease: [0.6, 0, 0.4, 1] 1119 }; 1120 useHTMLClass("interface-interface-skeleton__html-container"); 1121 const defaultLabels = { 1122 /* translators: accessibility text for the top bar landmark region. */ 1123 header: (0,external_wp_i18n_namespaceObject._x)("Header", "header landmark area"), 1124 /* translators: accessibility text for the content landmark region. */ 1125 body: (0,external_wp_i18n_namespaceObject.__)("Content"), 1126 /* translators: accessibility text for the secondary sidebar landmark region. */ 1127 secondarySidebar: (0,external_wp_i18n_namespaceObject.__)("Block Library"), 1128 /* translators: accessibility text for the settings landmark region. */ 1129 sidebar: (0,external_wp_i18n_namespaceObject._x)("Settings", "settings landmark area"), 1130 /* translators: accessibility text for the publish landmark region. */ 1131 actions: (0,external_wp_i18n_namespaceObject.__)("Publish"), 1132 /* translators: accessibility text for the footer landmark region. */ 1133 footer: (0,external_wp_i18n_namespaceObject.__)("Footer") 1134 }; 1135 const mergedLabels = { ...defaultLabels, ...labels }; 1136 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)( 1137 "div", 1138 { 1139 ref, 1140 className: dist_clsx( 1141 className, 1142 "interface-interface-skeleton", 1143 !!footer && "has-footer" 1144 ), 1145 children: [ 1146 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "interface-interface-skeleton__editor", children: [ 1147 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableAnimatePresence, { initial: false, children: !!header && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 1148 navigable_region_default, 1149 { 1150 as: external_wp_components_namespaceObject.__unstableMotion.div, 1151 className: "interface-interface-skeleton__header", 1152 "aria-label": mergedLabels.header, 1153 initial: isDistractionFree && !isMobileViewport ? "distractionFreeHidden" : "hidden", 1154 whileHover: isDistractionFree && !isMobileViewport ? "distractionFreeHover" : "visible", 1155 animate: isDistractionFree && !isMobileViewport ? "distractionFreeDisabled" : "visible", 1156 exit: isDistractionFree && !isMobileViewport ? "distractionFreeHidden" : "hidden", 1157 variants: headerVariants, 1158 transition: defaultTransition, 1159 children: header 1160 } 1161 ) }), 1162 isDistractionFree && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "interface-interface-skeleton__header", children: editorNotices }), 1163 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "interface-interface-skeleton__body", children: [ 1164 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableAnimatePresence, { initial: false, children: !!secondarySidebar && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 1165 navigable_region_default, 1166 { 1167 className: "interface-interface-skeleton__secondary-sidebar", 1168 ariaLabel: mergedLabels.secondarySidebar, 1169 as: external_wp_components_namespaceObject.__unstableMotion.div, 1170 initial: "closed", 1171 animate: "open", 1172 exit: "closed", 1173 variants: { 1174 open: { width: secondarySidebarSize.width }, 1175 closed: { width: 0 } 1176 }, 1177 transition: defaultTransition, 1178 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)( 1179 external_wp_components_namespaceObject.__unstableMotion.div, 1180 { 1181 style: { 1182 position: "absolute", 1183 width: isMobileViewport ? "100vw" : "fit-content", 1184 height: "100%", 1185 left: 0 1186 }, 1187 variants: { 1188 open: { x: 0 }, 1189 closed: { x: "-100%" } 1190 }, 1191 transition: defaultTransition, 1192 children: [ 1193 secondarySidebarResizeListener, 1194 secondarySidebar 1195 ] 1196 } 1197 ) 1198 } 1199 ) }), 1200 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 1201 navigable_region_default, 1202 { 1203 className: "interface-interface-skeleton__content", 1204 ariaLabel: mergedLabels.body, 1205 children: content 1206 } 1207 ), 1208 !!sidebar && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 1209 navigable_region_default, 1210 { 1211 className: "interface-interface-skeleton__sidebar", 1212 ariaLabel: mergedLabels.sidebar, 1213 children: sidebar 1214 } 1215 ), 1216 !!actions && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 1217 navigable_region_default, 1218 { 1219 className: "interface-interface-skeleton__actions", 1220 ariaLabel: mergedLabels.actions, 1221 children: actions 1222 } 1223 ) 1224 ] }) 1225 ] }), 1226 !!footer && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 1227 navigable_region_default, 1228 { 1229 className: "interface-interface-skeleton__footer", 1230 ariaLabel: mergedLabels.footer, 1231 children: footer 1232 } 1233 ) 1234 ] 1235 } 1236 ); 1237 } 1238 var interface_skeleton_default = (0,external_wp_element_namespaceObject.forwardRef)(InterfaceSkeleton); 1239 1240 1241 ;// ./node_modules/@wordpress/interface/build-module/components/index.js 1242 1243 1244 1245 1246 1247 1248 1249 1250 ;// ./node_modules/@wordpress/interface/build-module/index.js 1251 1252 1253 1254 1255 ;// external ["wp","blockEditor"] 1256 const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"]; 1257 ;// ./node_modules/@wordpress/edit-widgets/build-module/store/transformers.js 1258 1259 1260 function transformWidgetToBlock(widget) { 1261 if (widget.id_base === "block") { 1262 const parsedBlocks = (0,external_wp_blocks_namespaceObject.parse)(widget.instance.raw.content, { 1263 __unstableSkipAutop: true 1264 }); 1265 if (!parsedBlocks.length) { 1266 return (0,external_wp_widgets_namespaceObject.addWidgetIdToBlock)( 1267 (0,external_wp_blocks_namespaceObject.createBlock)("core/paragraph", {}, []), 1268 widget.id 1269 ); 1270 } 1271 return (0,external_wp_widgets_namespaceObject.addWidgetIdToBlock)(parsedBlocks[0], widget.id); 1272 } 1273 let attributes; 1274 if (widget._embedded.about[0].is_multi) { 1275 attributes = { 1276 idBase: widget.id_base, 1277 instance: widget.instance 1278 }; 1279 } else { 1280 attributes = { 1281 id: widget.id 1282 }; 1283 } 1284 return (0,external_wp_widgets_namespaceObject.addWidgetIdToBlock)( 1285 (0,external_wp_blocks_namespaceObject.createBlock)("core/legacy-widget", attributes, []), 1286 widget.id 1287 ); 1288 } 1289 function transformBlockToWidget(block, relatedWidget = {}) { 1290 let widget; 1291 const isValidLegacyWidgetBlock = block.name === "core/legacy-widget" && (block.attributes.id || block.attributes.instance); 1292 if (isValidLegacyWidgetBlock) { 1293 widget = { 1294 ...relatedWidget, 1295 id: block.attributes.id ?? relatedWidget.id, 1296 id_base: block.attributes.idBase ?? relatedWidget.id_base, 1297 instance: block.attributes.instance ?? relatedWidget.instance 1298 }; 1299 } else { 1300 widget = { 1301 ...relatedWidget, 1302 id_base: "block", 1303 instance: { 1304 raw: { 1305 content: (0,external_wp_blocks_namespaceObject.serialize)(block) 1306 } 1307 } 1308 }; 1309 } 1310 delete widget.rendered; 1311 delete widget.rendered_form; 1312 return widget; 1313 } 1314 1315 1316 ;// ./node_modules/@wordpress/edit-widgets/build-module/store/utils.js 1317 const KIND = "root"; 1318 const WIDGET_AREA_ENTITY_TYPE = "sidebar"; 1319 const POST_TYPE = "postType"; 1320 const buildWidgetAreaPostId = (widgetAreaId) => `widget-area-$widgetAreaId}`; 1321 const buildWidgetAreasPostId = () => `widget-areas`; 1322 function buildWidgetAreasQuery() { 1323 return { 1324 per_page: -1 1325 }; 1326 } 1327 function buildWidgetsQuery() { 1328 return { 1329 per_page: -1, 1330 _embed: "about" 1331 }; 1332 } 1333 const createStubPost = (id, blocks) => ({ 1334 id, 1335 slug: id, 1336 status: "draft", 1337 type: "page", 1338 blocks, 1339 meta: { 1340 widgetAreaId: id 1341 } 1342 }); 1343 1344 1345 ;// ./node_modules/@wordpress/edit-widgets/build-module/store/constants.js 1346 const constants_STORE_NAME = "core/edit-widgets"; 1347 1348 1349 ;// ./node_modules/@wordpress/edit-widgets/build-module/store/actions.js 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 const persistStubPost = (id, blocks) => ({ registry }) => { 1360 const stubPost = createStubPost(id, blocks); 1361 registry.dispatch(external_wp_coreData_namespaceObject.store).receiveEntityRecords( 1362 KIND, 1363 POST_TYPE, 1364 stubPost, 1365 { id: stubPost.id }, 1366 false 1367 ); 1368 return stubPost; 1369 }; 1370 const saveEditedWidgetAreas = () => async ({ select, dispatch, registry }) => { 1371 const editedWidgetAreas = select.getEditedWidgetAreas(); 1372 if (!editedWidgetAreas?.length) { 1373 return; 1374 } 1375 try { 1376 await dispatch.saveWidgetAreas(editedWidgetAreas); 1377 registry.dispatch(external_wp_notices_namespaceObject.store).createSuccessNotice((0,external_wp_i18n_namespaceObject.__)("Widgets saved."), { 1378 type: "snackbar" 1379 }); 1380 } catch (e) { 1381 registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice( 1382 /* translators: %s: The error message. */ 1383 (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("There was an error. %s"), e.message), 1384 { 1385 type: "snackbar" 1386 } 1387 ); 1388 } 1389 }; 1390 const saveWidgetAreas = (widgetAreas) => async ({ dispatch, registry }) => { 1391 try { 1392 for (const widgetArea of widgetAreas) { 1393 await dispatch.saveWidgetArea(widgetArea.id); 1394 } 1395 } finally { 1396 await registry.dispatch(external_wp_coreData_namespaceObject.store).finishResolution( 1397 "getEntityRecord", 1398 KIND, 1399 WIDGET_AREA_ENTITY_TYPE, 1400 buildWidgetAreasQuery() 1401 ); 1402 } 1403 }; 1404 const saveWidgetArea = (widgetAreaId) => async ({ dispatch, select, registry }) => { 1405 const widgets = select.getWidgets(); 1406 const post = registry.select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord( 1407 KIND, 1408 POST_TYPE, 1409 buildWidgetAreaPostId(widgetAreaId) 1410 ); 1411 const areaWidgets = Object.values(widgets).filter( 1412 ({ sidebar }) => sidebar === widgetAreaId 1413 ); 1414 const usedReferenceWidgets = []; 1415 const widgetsBlocks = post.blocks.filter((block) => { 1416 const { id } = block.attributes; 1417 if (block.name === "core/legacy-widget" && id) { 1418 if (usedReferenceWidgets.includes(id)) { 1419 return false; 1420 } 1421 usedReferenceWidgets.push(id); 1422 } 1423 return true; 1424 }); 1425 const deletedWidgets = []; 1426 for (const widget of areaWidgets) { 1427 const widgetsNewArea = select.getWidgetAreaForWidgetId(widget.id); 1428 if (!widgetsNewArea) { 1429 deletedWidgets.push(widget); 1430 } 1431 } 1432 const batchMeta = []; 1433 const batchTasks = []; 1434 const sidebarWidgetsIds = []; 1435 for (let i = 0; i < widgetsBlocks.length; i++) { 1436 const block = widgetsBlocks[i]; 1437 const widgetId = (0,external_wp_widgets_namespaceObject.getWidgetIdFromBlock)(block); 1438 const oldWidget = widgets[widgetId]; 1439 const widget = transformBlockToWidget(block, oldWidget); 1440 sidebarWidgetsIds.push(widgetId); 1441 if (oldWidget) { 1442 registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord( 1443 "root", 1444 "widget", 1445 widgetId, 1446 { 1447 ...widget, 1448 sidebar: widgetAreaId 1449 }, 1450 { undoIgnore: true } 1451 ); 1452 const hasEdits = registry.select(external_wp_coreData_namespaceObject.store).hasEditsForEntityRecord("root", "widget", widgetId); 1453 if (!hasEdits) { 1454 continue; 1455 } 1456 batchTasks.push( 1457 ({ saveEditedEntityRecord }) => saveEditedEntityRecord("root", "widget", widgetId) 1458 ); 1459 } else { 1460 batchTasks.push( 1461 ({ saveEntityRecord }) => saveEntityRecord("root", "widget", { 1462 ...widget, 1463 sidebar: widgetAreaId 1464 }) 1465 ); 1466 } 1467 batchMeta.push({ 1468 block, 1469 position: i, 1470 clientId: block.clientId 1471 }); 1472 } 1473 for (const widget of deletedWidgets) { 1474 batchTasks.push( 1475 ({ deleteEntityRecord }) => deleteEntityRecord("root", "widget", widget.id, { 1476 force: true 1477 }) 1478 ); 1479 } 1480 const records = await registry.dispatch(external_wp_coreData_namespaceObject.store).__experimentalBatch(batchTasks); 1481 const preservedRecords = records.filter( 1482 (record) => !record.hasOwnProperty("deleted") 1483 ); 1484 const failedWidgetNames = []; 1485 for (let i = 0; i < preservedRecords.length; i++) { 1486 const widget = preservedRecords[i]; 1487 const { block, position } = batchMeta[i]; 1488 post.blocks[position].attributes.__internalWidgetId = widget.id; 1489 const error = registry.select(external_wp_coreData_namespaceObject.store).getLastEntitySaveError("root", "widget", widget.id); 1490 if (error) { 1491 failedWidgetNames.push(block.attributes?.name || block?.name); 1492 } 1493 if (!sidebarWidgetsIds[position]) { 1494 sidebarWidgetsIds[position] = widget.id; 1495 } 1496 } 1497 if (failedWidgetNames.length) { 1498 throw new Error( 1499 (0,external_wp_i18n_namespaceObject.sprintf)( 1500 /* translators: %s: List of widget names */ 1501 (0,external_wp_i18n_namespaceObject.__)("Could not save the following widgets: %s."), 1502 failedWidgetNames.join(", ") 1503 ) 1504 ); 1505 } 1506 registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord( 1507 KIND, 1508 WIDGET_AREA_ENTITY_TYPE, 1509 widgetAreaId, 1510 { 1511 widgets: sidebarWidgetsIds 1512 }, 1513 { undoIgnore: true } 1514 ); 1515 dispatch(trySaveWidgetArea(widgetAreaId)); 1516 registry.dispatch(external_wp_coreData_namespaceObject.store).receiveEntityRecords(KIND, POST_TYPE, post, void 0); 1517 }; 1518 const trySaveWidgetArea = (widgetAreaId) => ({ registry }) => { 1519 registry.dispatch(external_wp_coreData_namespaceObject.store).saveEditedEntityRecord( 1520 KIND, 1521 WIDGET_AREA_ENTITY_TYPE, 1522 widgetAreaId, 1523 { 1524 throwOnError: true 1525 } 1526 ); 1527 }; 1528 function setWidgetIdForClientId(clientId, widgetId) { 1529 return { 1530 type: "SET_WIDGET_ID_FOR_CLIENT_ID", 1531 clientId, 1532 widgetId 1533 }; 1534 } 1535 function setWidgetAreasOpenState(widgetAreasOpenState) { 1536 return { 1537 type: "SET_WIDGET_AREAS_OPEN_STATE", 1538 widgetAreasOpenState 1539 }; 1540 } 1541 function setIsWidgetAreaOpen(clientId, isOpen) { 1542 return { 1543 type: "SET_IS_WIDGET_AREA_OPEN", 1544 clientId, 1545 isOpen 1546 }; 1547 } 1548 function setIsInserterOpened(value) { 1549 return { 1550 type: "SET_IS_INSERTER_OPENED", 1551 value 1552 }; 1553 } 1554 function setIsListViewOpened(isOpen) { 1555 return { 1556 type: "SET_IS_LIST_VIEW_OPENED", 1557 isOpen 1558 }; 1559 } 1560 const closeGeneralSidebar = () => ({ registry }) => { 1561 registry.dispatch(store).disableComplementaryArea(constants_STORE_NAME); 1562 }; 1563 const moveBlockToWidgetArea = (clientId, widgetAreaId) => async ({ dispatch, select, registry }) => { 1564 const sourceRootClientId = registry.select(external_wp_blockEditor_namespaceObject.store).getBlockRootClientId(clientId); 1565 const widgetAreas = registry.select(external_wp_blockEditor_namespaceObject.store).getBlocks(); 1566 const destinationWidgetAreaBlock = widgetAreas.find( 1567 ({ attributes }) => attributes.id === widgetAreaId 1568 ); 1569 const destinationRootClientId = destinationWidgetAreaBlock.clientId; 1570 const destinationInnerBlocksClientIds = registry.select(external_wp_blockEditor_namespaceObject.store).getBlockOrder(destinationRootClientId); 1571 const destinationIndex = destinationInnerBlocksClientIds.length; 1572 const isDestinationWidgetAreaOpen = select.getIsWidgetAreaOpen( 1573 destinationRootClientId 1574 ); 1575 if (!isDestinationWidgetAreaOpen) { 1576 dispatch.setIsWidgetAreaOpen(destinationRootClientId, true); 1577 } 1578 registry.dispatch(external_wp_blockEditor_namespaceObject.store).moveBlocksToPosition( 1579 [clientId], 1580 sourceRootClientId, 1581 destinationRootClientId, 1582 destinationIndex 1583 ); 1584 }; 1585 function unlockWidgetSaving(lockName) { 1586 return { 1587 type: "UNLOCK_WIDGET_SAVING", 1588 lockName 1589 }; 1590 } 1591 function lockWidgetSaving(lockName) { 1592 return { 1593 type: "LOCK_WIDGET_SAVING", 1594 lockName 1595 }; 1596 } 1597 1598 1599 ;// ./node_modules/@wordpress/edit-widgets/build-module/store/resolvers.js 1600 1601 1602 1603 1604 1605 const getWidgetAreas = () => async ({ dispatch, registry }) => { 1606 const query = buildWidgetAreasQuery(); 1607 const widgetAreas = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getEntityRecords(KIND, WIDGET_AREA_ENTITY_TYPE, query); 1608 const widgetAreaBlocks = []; 1609 const sortedWidgetAreas = widgetAreas.sort((a, b) => { 1610 if (a.id === "wp_inactive_widgets") { 1611 return 1; 1612 } 1613 if (b.id === "wp_inactive_widgets") { 1614 return -1; 1615 } 1616 return 0; 1617 }); 1618 for (const widgetArea of sortedWidgetAreas) { 1619 widgetAreaBlocks.push( 1620 (0,external_wp_blocks_namespaceObject.createBlock)("core/widget-area", { 1621 id: widgetArea.id, 1622 name: widgetArea.name 1623 }) 1624 ); 1625 if (!widgetArea.widgets.length) { 1626 dispatch( 1627 persistStubPost( 1628 buildWidgetAreaPostId(widgetArea.id), 1629 [] 1630 ) 1631 ); 1632 } 1633 } 1634 const widgetAreasOpenState = {}; 1635 widgetAreaBlocks.forEach((widgetAreaBlock, index) => { 1636 widgetAreasOpenState[widgetAreaBlock.clientId] = index === 0; 1637 }); 1638 dispatch(setWidgetAreasOpenState(widgetAreasOpenState)); 1639 dispatch( 1640 persistStubPost(buildWidgetAreasPostId(), widgetAreaBlocks) 1641 ); 1642 }; 1643 const getWidgets = () => async ({ dispatch, registry }) => { 1644 const query = buildWidgetsQuery(); 1645 const widgets = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getEntityRecords("root", "widget", query); 1646 const groupedBySidebar = {}; 1647 for (const widget of widgets) { 1648 const block = transformWidgetToBlock(widget); 1649 groupedBySidebar[widget.sidebar] = groupedBySidebar[widget.sidebar] || []; 1650 groupedBySidebar[widget.sidebar].push(block); 1651 } 1652 for (const sidebarId in groupedBySidebar) { 1653 if (groupedBySidebar.hasOwnProperty(sidebarId)) { 1654 dispatch( 1655 persistStubPost( 1656 buildWidgetAreaPostId(sidebarId), 1657 groupedBySidebar[sidebarId] 1658 ) 1659 ); 1660 } 1661 } 1662 }; 1663 1664 1665 ;// ./node_modules/@wordpress/edit-widgets/build-module/store/selectors.js 1666 1667 1668 1669 1670 1671 1672 const EMPTY_INSERTION_POINT = { 1673 rootClientId: void 0, 1674 insertionIndex: void 0 1675 }; 1676 const selectors_getWidgets = (0,external_wp_data_namespaceObject.createRegistrySelector)( 1677 (select) => (0,external_wp_data_namespaceObject.createSelector)( 1678 () => { 1679 const widgets = select(external_wp_coreData_namespaceObject.store).getEntityRecords( 1680 "root", 1681 "widget", 1682 buildWidgetsQuery() 1683 ); 1684 return ( 1685 // Key widgets by their ID. 1686 widgets?.reduce( 1687 (allWidgets, widget) => ({ 1688 ...allWidgets, 1689 [widget.id]: widget 1690 }), 1691 {} 1692 ) ?? {} 1693 ); 1694 }, 1695 () => [ 1696 select(external_wp_coreData_namespaceObject.store).getEntityRecords( 1697 "root", 1698 "widget", 1699 buildWidgetsQuery() 1700 ) 1701 ] 1702 ) 1703 ); 1704 const getWidget = (0,external_wp_data_namespaceObject.createRegistrySelector)( 1705 (select) => (state, id) => { 1706 const widgets = select(constants_STORE_NAME).getWidgets(); 1707 return widgets[id]; 1708 } 1709 ); 1710 const selectors_getWidgetAreas = (0,external_wp_data_namespaceObject.createRegistrySelector)((select) => () => { 1711 const query = buildWidgetAreasQuery(); 1712 return select(external_wp_coreData_namespaceObject.store).getEntityRecords( 1713 KIND, 1714 WIDGET_AREA_ENTITY_TYPE, 1715 query 1716 ); 1717 }); 1718 const getWidgetAreaForWidgetId = (0,external_wp_data_namespaceObject.createRegistrySelector)( 1719 (select) => (state, widgetId) => { 1720 const widgetAreas = select(constants_STORE_NAME).getWidgetAreas(); 1721 return widgetAreas.find((widgetArea) => { 1722 const post = select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord( 1723 KIND, 1724 POST_TYPE, 1725 buildWidgetAreaPostId(widgetArea.id) 1726 ); 1727 const blockWidgetIds = post.blocks.map( 1728 (block) => (0,external_wp_widgets_namespaceObject.getWidgetIdFromBlock)(block) 1729 ); 1730 return blockWidgetIds.includes(widgetId); 1731 }); 1732 } 1733 ); 1734 const getParentWidgetAreaBlock = (0,external_wp_data_namespaceObject.createRegistrySelector)( 1735 (select) => (state, clientId) => { 1736 const { getBlock, getBlockName, getBlockParents } = select(external_wp_blockEditor_namespaceObject.store); 1737 const blockParents = getBlockParents(clientId); 1738 const widgetAreaClientId = blockParents.find( 1739 (parentClientId) => getBlockName(parentClientId) === "core/widget-area" 1740 ); 1741 return getBlock(widgetAreaClientId); 1742 } 1743 ); 1744 const getEditedWidgetAreas = (0,external_wp_data_namespaceObject.createRegistrySelector)( 1745 (select) => (state, ids) => { 1746 let widgetAreas = select(constants_STORE_NAME).getWidgetAreas(); 1747 if (!widgetAreas) { 1748 return []; 1749 } 1750 if (ids) { 1751 widgetAreas = widgetAreas.filter( 1752 ({ id }) => ids.includes(id) 1753 ); 1754 } 1755 return widgetAreas.filter( 1756 ({ id }) => select(external_wp_coreData_namespaceObject.store).hasEditsForEntityRecord( 1757 KIND, 1758 POST_TYPE, 1759 buildWidgetAreaPostId(id) 1760 ) 1761 ).map( 1762 ({ id }) => select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord( 1763 KIND, 1764 WIDGET_AREA_ENTITY_TYPE, 1765 id 1766 ) 1767 ); 1768 } 1769 ); 1770 const getReferenceWidgetBlocks = (0,external_wp_data_namespaceObject.createRegistrySelector)( 1771 (select) => (state, referenceWidgetName = null) => { 1772 const results = []; 1773 const widgetAreas = select(constants_STORE_NAME).getWidgetAreas(); 1774 for (const _widgetArea of widgetAreas) { 1775 const post = select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord( 1776 KIND, 1777 POST_TYPE, 1778 buildWidgetAreaPostId(_widgetArea.id) 1779 ); 1780 for (const block of post.blocks) { 1781 if (block.name === "core/legacy-widget" && (!referenceWidgetName || block.attributes?.referenceWidgetName === referenceWidgetName)) { 1782 results.push(block); 1783 } 1784 } 1785 } 1786 return results; 1787 } 1788 ); 1789 const isSavingWidgetAreas = (0,external_wp_data_namespaceObject.createRegistrySelector)((select) => () => { 1790 const widgetAreasIds = select(constants_STORE_NAME).getWidgetAreas()?.map(({ id }) => id); 1791 if (!widgetAreasIds) { 1792 return false; 1793 } 1794 for (const id of widgetAreasIds) { 1795 const isSaving = select(external_wp_coreData_namespaceObject.store).isSavingEntityRecord( 1796 KIND, 1797 WIDGET_AREA_ENTITY_TYPE, 1798 id 1799 ); 1800 if (isSaving) { 1801 return true; 1802 } 1803 } 1804 const widgetIds = [ 1805 ...Object.keys(select(constants_STORE_NAME).getWidgets()), 1806 void 0 1807 // account for new widgets without an ID 1808 ]; 1809 for (const id of widgetIds) { 1810 const isSaving = select(external_wp_coreData_namespaceObject.store).isSavingEntityRecord( 1811 "root", 1812 "widget", 1813 id 1814 ); 1815 if (isSaving) { 1816 return true; 1817 } 1818 } 1819 return false; 1820 }); 1821 const getIsWidgetAreaOpen = (state, clientId) => { 1822 const { widgetAreasOpenState } = state; 1823 return !!widgetAreasOpenState[clientId]; 1824 }; 1825 function isInserterOpened(state) { 1826 return !!state.blockInserterPanel; 1827 } 1828 function __experimentalGetInsertionPoint(state) { 1829 if (typeof state.blockInserterPanel === "boolean") { 1830 return EMPTY_INSERTION_POINT; 1831 } 1832 return state.blockInserterPanel; 1833 } 1834 const canInsertBlockInWidgetArea = (0,external_wp_data_namespaceObject.createRegistrySelector)( 1835 (select) => (state, blockName) => { 1836 const widgetAreas = select(external_wp_blockEditor_namespaceObject.store).getBlocks(); 1837 const [firstWidgetArea] = widgetAreas; 1838 return select(external_wp_blockEditor_namespaceObject.store).canInsertBlockType( 1839 blockName, 1840 firstWidgetArea.clientId 1841 ); 1842 } 1843 ); 1844 function isListViewOpened(state) { 1845 return state.listViewPanel; 1846 } 1847 function isWidgetSavingLocked(state) { 1848 return Object.keys(state.widgetSavingLock).length > 0; 1849 } 1850 1851 1852 ;// ./node_modules/@wordpress/edit-widgets/build-module/store/private-selectors.js 1853 function getListViewToggleRef(state) { 1854 return state.listViewToggleRef; 1855 } 1856 function getInserterSidebarToggleRef(state) { 1857 return state.inserterSidebarToggleRef; 1858 } 1859 1860 1861 ;// external ["wp","privateApis"] 1862 const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"]; 1863 ;// ./node_modules/@wordpress/edit-widgets/build-module/lock-unlock.js 1864 1865 const { lock, unlock } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)( 1866 "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.", 1867 "@wordpress/edit-widgets" 1868 ); 1869 1870 1871 ;// ./node_modules/@wordpress/edit-widgets/build-module/store/index.js 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 const storeConfig = { 1882 reducer: reducer_default, 1883 selectors: store_selectors_namespaceObject, 1884 resolvers: resolvers_namespaceObject, 1885 actions: store_actions_namespaceObject 1886 }; 1887 const store_store = (0,external_wp_data_namespaceObject.createReduxStore)(constants_STORE_NAME, storeConfig); 1888 (0,external_wp_data_namespaceObject.register)(store_store); 1889 external_wp_apiFetch_default().use(function(options, next) { 1890 if (options.path?.indexOf("/wp/v2/types/widget-area") === 0) { 1891 return Promise.resolve({}); 1892 } 1893 return next(options); 1894 }); 1895 unlock(store_store).registerPrivateSelectors(private_selectors_namespaceObject); 1896 1897 1898 ;// external ["wp","hooks"] 1899 const external_wp_hooks_namespaceObject = window["wp"]["hooks"]; 1900 ;// ./node_modules/@wordpress/edit-widgets/build-module/filters/move-to-widget-area.js 1901 1902 1903 1904 1905 1906 1907 1908 const withMoveToWidgetAreaToolbarItem = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)( 1909 (BlockEdit) => (props) => { 1910 const { clientId, name: blockName } = props; 1911 const { widgetAreas, currentWidgetAreaId, canInsertBlockInWidgetArea } = (0,external_wp_data_namespaceObject.useSelect)( 1912 (select) => { 1913 if (blockName === "core/widget-area") { 1914 return {}; 1915 } 1916 const selectors = select(store_store); 1917 const widgetAreaBlock = selectors.getParentWidgetAreaBlock(clientId); 1918 return { 1919 widgetAreas: selectors.getWidgetAreas(), 1920 currentWidgetAreaId: widgetAreaBlock?.attributes?.id, 1921 canInsertBlockInWidgetArea: selectors.canInsertBlockInWidgetArea(blockName) 1922 }; 1923 }, 1924 [clientId, blockName] 1925 ); 1926 const { moveBlockToWidgetArea } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); 1927 const hasMultipleWidgetAreas = widgetAreas?.length > 1; 1928 const isMoveToWidgetAreaVisible = blockName !== "core/widget-area" && hasMultipleWidgetAreas && canInsertBlockInWidgetArea; 1929 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [ 1930 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockEdit, { ...props }, "edit"), 1931 isMoveToWidgetAreaVisible && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 1932 external_wp_widgets_namespaceObject.MoveToWidgetArea, 1933 { 1934 widgetAreas, 1935 currentWidgetAreaId, 1936 onSelect: (widgetAreaId) => { 1937 moveBlockToWidgetArea( 1938 props.clientId, 1939 widgetAreaId 1940 ); 1941 } 1942 } 1943 ) }) 1944 ] }); 1945 }, 1946 "withMoveToWidgetAreaToolbarItem" 1947 ); 1948 (0,external_wp_hooks_namespaceObject.addFilter)( 1949 "editor.BlockEdit", 1950 "core/edit-widgets/block-edit", 1951 withMoveToWidgetAreaToolbarItem 1952 ); 1953 1954 ;// external ["wp","mediaUtils"] 1955 const external_wp_mediaUtils_namespaceObject = window["wp"]["mediaUtils"]; 1956 ;// ./node_modules/@wordpress/edit-widgets/build-module/filters/replace-media-upload.js 1957 1958 1959 const replaceMediaUpload = () => external_wp_mediaUtils_namespaceObject.MediaUpload; 1960 (0,external_wp_hooks_namespaceObject.addFilter)( 1961 "editor.MediaUpload", 1962 "core/edit-widgets/replace-media-upload", 1963 replaceMediaUpload 1964 ); 1965 1966 ;// ./node_modules/@wordpress/edit-widgets/build-module/filters/index.js 1967 1968 1969 1970 ;// ./node_modules/@wordpress/edit-widgets/build-module/blocks/widget-area/block.json 1971 const block_namespaceObject = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/widget-area","title":"Widget Area","category":"widgets","attributes":{"id":{"type":"string"},"name":{"type":"string"}},"supports":{"html":false,"inserter":false,"customClassName":false,"reusable":false,"__experimentalToolbar":false,"__experimentalParentSelector":false,"__experimentalDisableBlockOverlay":true},"editorStyle":"wp-block-widget-area-editor","style":"wp-block-widget-area"}'); 1972 ;// ./node_modules/@wordpress/edit-widgets/build-module/blocks/widget-area/edit/use-is-dragging-within.js 1973 1974 const useIsDraggingWithin = (elementRef) => { 1975 const [isDraggingWithin, setIsDraggingWithin] = (0,external_wp_element_namespaceObject.useState)(false); 1976 (0,external_wp_element_namespaceObject.useEffect)(() => { 1977 const { ownerDocument } = elementRef.current; 1978 function handleDragStart(event) { 1979 handleDragEnter(event); 1980 } 1981 function handleDragEnd() { 1982 setIsDraggingWithin(false); 1983 } 1984 function handleDragEnter(event) { 1985 if (elementRef.current.contains(event.target)) { 1986 setIsDraggingWithin(true); 1987 } else { 1988 setIsDraggingWithin(false); 1989 } 1990 } 1991 ownerDocument.addEventListener("dragstart", handleDragStart); 1992 ownerDocument.addEventListener("dragend", handleDragEnd); 1993 ownerDocument.addEventListener("dragenter", handleDragEnter); 1994 return () => { 1995 ownerDocument.removeEventListener("dragstart", handleDragStart); 1996 ownerDocument.removeEventListener("dragend", handleDragEnd); 1997 ownerDocument.removeEventListener("dragenter", handleDragEnter); 1998 }; 1999 }, []); 2000 return isDraggingWithin; 2001 }; 2002 var use_is_dragging_within_default = useIsDraggingWithin; 2003 2004 2005 ;// ./node_modules/@wordpress/edit-widgets/build-module/blocks/widget-area/edit/inner-blocks.js 2006 2007 2008 2009 2010 2011 2012 function WidgetAreaInnerBlocks({ id }) { 2013 const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)( 2014 "root", 2015 "postType" 2016 ); 2017 const innerBlocksRef = (0,external_wp_element_namespaceObject.useRef)(); 2018 const isDraggingWithinInnerBlocks = use_is_dragging_within_default(innerBlocksRef); 2019 const shouldHighlightDropZone = isDraggingWithinInnerBlocks; 2020 const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)( 2021 { ref: innerBlocksRef }, 2022 { 2023 value: blocks, 2024 onInput, 2025 onChange, 2026 templateLock: false, 2027 renderAppender: external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender 2028 } 2029 ); 2030 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 2031 "div", 2032 { 2033 "data-widget-area-id": id, 2034 className: dist_clsx( 2035 "wp-block-widget-area__inner-blocks block-editor-inner-blocks editor-styles-wrapper", 2036 { 2037 "wp-block-widget-area__highlight-drop-zone": shouldHighlightDropZone 2038 } 2039 ), 2040 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps }) 2041 } 2042 ); 2043 } 2044 2045 2046 ;// ./node_modules/@wordpress/edit-widgets/build-module/blocks/widget-area/edit/index.js 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 function WidgetAreaEdit({ 2057 clientId, 2058 attributes: { id, name } 2059 }) { 2060 const isOpen = (0,external_wp_data_namespaceObject.useSelect)( 2061 (select) => select(store_store).getIsWidgetAreaOpen(clientId), 2062 [clientId] 2063 ); 2064 const { setIsWidgetAreaOpen } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); 2065 const wrapper = (0,external_wp_element_namespaceObject.useRef)(); 2066 const setOpen = (0,external_wp_element_namespaceObject.useCallback)( 2067 (openState) => setIsWidgetAreaOpen(clientId, openState), 2068 [clientId] 2069 ); 2070 const isDragging = useIsDragging(wrapper); 2071 const isDraggingWithin = use_is_dragging_within_default(wrapper); 2072 const [openedWhileDragging, setOpenedWhileDragging] = (0,external_wp_element_namespaceObject.useState)(false); 2073 (0,external_wp_element_namespaceObject.useEffect)(() => { 2074 if (!isDragging) { 2075 setOpenedWhileDragging(false); 2076 return; 2077 } 2078 if (isDraggingWithin && !isOpen) { 2079 setOpen(true); 2080 setOpenedWhileDragging(true); 2081 } else if (!isDraggingWithin && isOpen && openedWhileDragging) { 2082 setOpen(false); 2083 } 2084 }, [isOpen, isDragging, isDraggingWithin, openedWhileDragging]); 2085 const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); 2086 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Panel, { ref: wrapper, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 2087 external_wp_components_namespaceObject.PanelBody, 2088 { 2089 title: name, 2090 opened: isOpen, 2091 onToggle: () => { 2092 setIsWidgetAreaOpen(clientId, !isOpen); 2093 }, 2094 scrollAfterOpen: !isDragging, 2095 children: ({ opened }) => ( 2096 // This is required to ensure LegacyWidget blocks are not 2097 // unmounted when the panel is collapsed. Unmounting legacy 2098 // widgets may have unintended consequences (e.g. TinyMCE 2099 // not being properly reinitialized) 2100 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 2101 external_wp_components_namespaceObject.__unstableDisclosureContent, 2102 { 2103 className: "wp-block-widget-area__panel-body-content", 2104 visible: opened, 2105 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 2106 external_wp_coreData_namespaceObject.EntityProvider, 2107 { 2108 kind: "root", 2109 type: "postType", 2110 id: `widget-area-$id}`, 2111 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(WidgetAreaInnerBlocks, { id }) 2112 } 2113 ) 2114 } 2115 ) 2116 ) 2117 } 2118 ) }) }); 2119 } 2120 const useIsDragging = (elementRef) => { 2121 const [isDragging, setIsDragging] = (0,external_wp_element_namespaceObject.useState)(false); 2122 (0,external_wp_element_namespaceObject.useEffect)(() => { 2123 const { ownerDocument } = elementRef.current; 2124 function handleDragStart() { 2125 setIsDragging(true); 2126 } 2127 function handleDragEnd() { 2128 setIsDragging(false); 2129 } 2130 ownerDocument.addEventListener("dragstart", handleDragStart); 2131 ownerDocument.addEventListener("dragend", handleDragEnd); 2132 return () => { 2133 ownerDocument.removeEventListener("dragstart", handleDragStart); 2134 ownerDocument.removeEventListener("dragend", handleDragEnd); 2135 }; 2136 }, []); 2137 return isDragging; 2138 }; 2139 2140 2141 ;// ./node_modules/@wordpress/edit-widgets/build-module/blocks/widget-area/index.js 2142 2143 2144 2145 const { name: widget_area_name } = block_namespaceObject; 2146 const settings = { 2147 title: (0,external_wp_i18n_namespaceObject.__)("Widget Area"), 2148 description: (0,external_wp_i18n_namespaceObject.__)("A widget area container."), 2149 __experimentalLabel: ({ name: label }) => label, 2150 edit: WidgetAreaEdit 2151 }; 2152 2153 2154 ;// ./node_modules/@wordpress/edit-widgets/build-module/components/error-boundary/index.js 2155 2156 2157 2158 2159 2160 2161 2162 function CopyButton({ text, children }) { 2163 const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(text); 2164 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "secondary", ref, children }); 2165 } 2166 function ErrorBoundaryWarning({ message, error }) { 2167 const actions = [ 2168 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CopyButton, { text: error.stack, children: (0,external_wp_i18n_namespaceObject.__)("Copy Error") }, "copy-error") 2169 ]; 2170 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { className: "edit-widgets-error-boundary", actions, children: message }); 2171 } 2172 class ErrorBoundary extends external_wp_element_namespaceObject.Component { 2173 constructor() { 2174 super(...arguments); 2175 this.state = { 2176 error: null 2177 }; 2178 } 2179 componentDidCatch(error) { 2180 (0,external_wp_hooks_namespaceObject.doAction)("editor.ErrorBoundary.errorLogged", error); 2181 } 2182 static getDerivedStateFromError(error) { 2183 return { error }; 2184 } 2185 render() { 2186 if (!this.state.error) { 2187 return this.props.children; 2188 } 2189 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 2190 ErrorBoundaryWarning, 2191 { 2192 message: (0,external_wp_i18n_namespaceObject.__)( 2193 "The editor has encountered an unexpected error." 2194 ), 2195 error: this.state.error 2196 } 2197 ); 2198 } 2199 } 2200 2201 2202 ;// external ["wp","patterns"] 2203 const external_wp_patterns_namespaceObject = window["wp"]["patterns"]; 2204 ;// external ["wp","keyboardShortcuts"] 2205 const external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShortcuts"]; 2206 ;// external ["wp","keycodes"] 2207 const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"]; 2208 ;// ./node_modules/@wordpress/edit-widgets/build-module/components/keyboard-shortcuts/index.js 2209 2210 2211 2212 2213 2214 2215 2216 function KeyboardShortcuts() { 2217 const { redo, undo } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); 2218 const { saveEditedWidgetAreas } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); 2219 (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)("core/edit-widgets/undo", (event) => { 2220 undo(); 2221 event.preventDefault(); 2222 }); 2223 (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)("core/edit-widgets/redo", (event) => { 2224 redo(); 2225 event.preventDefault(); 2226 }); 2227 (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)("core/edit-widgets/save", (event) => { 2228 event.preventDefault(); 2229 saveEditedWidgetAreas(); 2230 }); 2231 return null; 2232 } 2233 function KeyboardShortcutsRegister() { 2234 const { registerShortcut } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_keyboardShortcuts_namespaceObject.store); 2235 (0,external_wp_element_namespaceObject.useEffect)(() => { 2236 registerShortcut({ 2237 name: "core/edit-widgets/undo", 2238 category: "global", 2239 description: (0,external_wp_i18n_namespaceObject.__)("Undo your last changes."), 2240 keyCombination: { 2241 modifier: "primary", 2242 character: "z" 2243 } 2244 }); 2245 registerShortcut({ 2246 name: "core/edit-widgets/redo", 2247 category: "global", 2248 description: (0,external_wp_i18n_namespaceObject.__)("Redo your last undo."), 2249 keyCombination: { 2250 modifier: "primaryShift", 2251 character: "z" 2252 }, 2253 // Disable on Apple OS because it conflicts with the browser's 2254 // history shortcut. It's a fine alias for both Windows and Linux. 2255 // Since there's no conflict for Ctrl+Shift+Z on both Windows and 2256 // Linux, we keep it as the default for consistency. 2257 aliases: (0,external_wp_keycodes_namespaceObject.isAppleOS)() ? [] : [ 2258 { 2259 modifier: "primary", 2260 character: "y" 2261 } 2262 ] 2263 }); 2264 registerShortcut({ 2265 name: "core/edit-widgets/save", 2266 category: "global", 2267 description: (0,external_wp_i18n_namespaceObject.__)("Save your changes."), 2268 keyCombination: { 2269 modifier: "primary", 2270 character: "s" 2271 } 2272 }); 2273 registerShortcut({ 2274 name: "core/edit-widgets/keyboard-shortcuts", 2275 category: "main", 2276 description: (0,external_wp_i18n_namespaceObject.__)("Display these keyboard shortcuts."), 2277 keyCombination: { 2278 modifier: "access", 2279 character: "h" 2280 } 2281 }); 2282 registerShortcut({ 2283 name: "core/edit-widgets/next-region", 2284 category: "global", 2285 description: (0,external_wp_i18n_namespaceObject.__)("Navigate to the next part of the editor."), 2286 keyCombination: { 2287 modifier: "ctrl", 2288 character: "`" 2289 }, 2290 aliases: [ 2291 { 2292 modifier: "access", 2293 character: "n" 2294 } 2295 ] 2296 }); 2297 registerShortcut({ 2298 name: "core/edit-widgets/previous-region", 2299 category: "global", 2300 description: (0,external_wp_i18n_namespaceObject.__)("Navigate to the previous part of the editor."), 2301 keyCombination: { 2302 modifier: "ctrlShift", 2303 character: "`" 2304 }, 2305 aliases: [ 2306 { 2307 modifier: "access", 2308 character: "p" 2309 }, 2310 { 2311 modifier: "ctrlShift", 2312 character: "~" 2313 } 2314 ] 2315 }); 2316 }, [registerShortcut]); 2317 return null; 2318 } 2319 KeyboardShortcuts.Register = KeyboardShortcutsRegister; 2320 var keyboard_shortcuts_default = KeyboardShortcuts; 2321 2322 2323 ;// ./node_modules/@wordpress/edit-widgets/build-module/hooks/use-last-selected-widget-area.js 2324 2325 2326 2327 2328 2329 const useLastSelectedWidgetArea = () => (0,external_wp_data_namespaceObject.useSelect)((select) => { 2330 const { getBlockSelectionEnd, getBlockName } = select(external_wp_blockEditor_namespaceObject.store); 2331 const selectionEndClientId = getBlockSelectionEnd(); 2332 if (getBlockName(selectionEndClientId) === "core/widget-area") { 2333 return selectionEndClientId; 2334 } 2335 const { getParentWidgetAreaBlock } = select(store_store); 2336 const widgetAreaBlock = getParentWidgetAreaBlock(selectionEndClientId); 2337 const widgetAreaBlockClientId = widgetAreaBlock?.clientId; 2338 if (widgetAreaBlockClientId) { 2339 return widgetAreaBlockClientId; 2340 } 2341 const { getEntityRecord } = select(external_wp_coreData_namespaceObject.store); 2342 const widgetAreasPost = getEntityRecord( 2343 KIND, 2344 POST_TYPE, 2345 buildWidgetAreasPostId() 2346 ); 2347 return widgetAreasPost?.blocks[0]?.clientId; 2348 }, []); 2349 var use_last_selected_widget_area_default = useLastSelectedWidgetArea; 2350 2351 2352 ;// ./node_modules/@wordpress/edit-widgets/build-module/constants.js 2353 const ALLOW_REUSABLE_BLOCKS = false; 2354 const ENABLE_EXPERIMENTAL_FSE_BLOCKS = false; 2355 2356 2357 ;// ./node_modules/@wordpress/edit-widgets/build-module/components/widget-areas-block-editor-provider/index.js 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 const { ExperimentalBlockEditorProvider } = unlock(external_wp_blockEditor_namespaceObject.privateApis); 2376 const { PatternsMenuItems } = unlock(external_wp_patterns_namespaceObject.privateApis); 2377 const { BlockKeyboardShortcuts } = unlock(external_wp_blockLibrary_namespaceObject.privateApis); 2378 const EMPTY_ARRAY = []; 2379 function WidgetAreasBlockEditorProvider({ 2380 blockEditorSettings, 2381 children, 2382 ...props 2383 }) { 2384 const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium"); 2385 const { 2386 hasUploadPermissions, 2387 reusableBlocks, 2388 isFixedToolbarActive, 2389 keepCaretInsideBlock, 2390 pageOnFront, 2391 pageForPosts 2392 } = (0,external_wp_data_namespaceObject.useSelect)((select) => { 2393 const { canUser, getEntityRecord, getEntityRecords } = select(external_wp_coreData_namespaceObject.store); 2394 const siteSettings = canUser("read", { 2395 kind: "root", 2396 name: "site" 2397 }) ? getEntityRecord("root", "site") : void 0; 2398 return { 2399 hasUploadPermissions: canUser("create", { 2400 kind: "postType", 2401 name: "attachment" 2402 }) ?? true, 2403 reusableBlocks: ALLOW_REUSABLE_BLOCKS ? getEntityRecords("postType", "wp_block") : EMPTY_ARRAY, 2404 isFixedToolbarActive: !!select(external_wp_preferences_namespaceObject.store).get( 2405 "core/edit-widgets", 2406 "fixedToolbar" 2407 ), 2408 keepCaretInsideBlock: !!select(external_wp_preferences_namespaceObject.store).get( 2409 "core/edit-widgets", 2410 "keepCaretInsideBlock" 2411 ), 2412 pageOnFront: siteSettings?.page_on_front, 2413 pageForPosts: siteSettings?.page_for_posts 2414 }; 2415 }, []); 2416 const { setIsInserterOpened } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); 2417 const settings = (0,external_wp_element_namespaceObject.useMemo)(() => { 2418 let mediaUploadBlockEditor; 2419 if (hasUploadPermissions) { 2420 mediaUploadBlockEditor = ({ onError, ...argumentsObject }) => { 2421 (0,external_wp_mediaUtils_namespaceObject.uploadMedia)({ 2422 wpAllowedMimeTypes: blockEditorSettings.allowedMimeTypes, 2423 onError: ({ message }) => onError(message), 2424 ...argumentsObject 2425 }); 2426 }; 2427 } 2428 return { 2429 ...blockEditorSettings, 2430 __experimentalReusableBlocks: reusableBlocks, 2431 hasFixedToolbar: isFixedToolbarActive || !isLargeViewport, 2432 keepCaretInsideBlock, 2433 mediaUpload: mediaUploadBlockEditor, 2434 templateLock: "all", 2435 __experimentalSetIsInserterOpened: setIsInserterOpened, 2436 pageOnFront, 2437 pageForPosts, 2438 editorTool: "edit" 2439 }; 2440 }, [ 2441 hasUploadPermissions, 2442 blockEditorSettings, 2443 isFixedToolbarActive, 2444 isLargeViewport, 2445 keepCaretInsideBlock, 2446 reusableBlocks, 2447 setIsInserterOpened, 2448 pageOnFront, 2449 pageForPosts 2450 ]); 2451 const widgetAreaId = use_last_selected_widget_area_default(); 2452 const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)( 2453 KIND, 2454 POST_TYPE, 2455 { id: buildWidgetAreasPostId() } 2456 ); 2457 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.SlotFillProvider, { children: [ 2458 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboard_shortcuts_default.Register, {}), 2459 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockKeyboardShortcuts, {}), 2460 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)( 2461 ExperimentalBlockEditorProvider, 2462 { 2463 value: blocks, 2464 onInput, 2465 onChange, 2466 settings, 2467 useSubRegistry: false, 2468 ...props, 2469 children: [ 2470 children, 2471 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternsMenuItems, { rootClientId: widgetAreaId }) 2472 ] 2473 } 2474 ) 2475 ] }); 2476 } 2477 2478 2479 ;// ./node_modules/@wordpress/icons/build-module/library/drawer-left.js 2480 2481 2482 var drawer_left_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 2483 external_wp_primitives_namespaceObject.Path, 2484 { 2485 fillRule: "evenodd", 2486 clipRule: "evenodd", 2487 d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM8.5 18.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h2.5v13zm10-.5c0 .3-.2.5-.5.5h-8v-13h8c.3 0 .5.2.5.5v12z" 2488 } 2489 ) }); 2490 2491 2492 ;// ./node_modules/@wordpress/icons/build-module/library/drawer-right.js 2493 2494 2495 var drawer_right_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 2496 external_wp_primitives_namespaceObject.Path, 2497 { 2498 fillRule: "evenodd", 2499 clipRule: "evenodd", 2500 d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z" 2501 } 2502 ) }); 2503 2504 2505 ;// ./node_modules/@wordpress/icons/build-module/library/block-default.js 2506 2507 2508 var block_default_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z" }) }); 2509 2510 2511 ;// external ["wp","url"] 2512 const external_wp_url_namespaceObject = window["wp"]["url"]; 2513 ;// external ["wp","dom"] 2514 const external_wp_dom_namespaceObject = window["wp"]["dom"]; 2515 ;// ./node_modules/@wordpress/edit-widgets/build-module/components/sidebar/widget-areas.js 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 function WidgetAreas({ selectedWidgetAreaId }) { 2527 const widgetAreas = (0,external_wp_data_namespaceObject.useSelect)( 2528 (select) => select(store_store).getWidgetAreas(), 2529 [] 2530 ); 2531 const selectedWidgetArea = (0,external_wp_element_namespaceObject.useMemo)( 2532 () => selectedWidgetAreaId && widgetAreas?.find( 2533 (widgetArea) => widgetArea.id === selectedWidgetAreaId 2534 ), 2535 [selectedWidgetAreaId, widgetAreas] 2536 ); 2537 let description; 2538 if (!selectedWidgetArea) { 2539 description = (0,external_wp_i18n_namespaceObject.__)( 2540 // eslint-disable-next-line no-restricted-syntax -- 'sidebar' is a common web design term for layouts 2541 "Widget Areas are global parts in your site\u2019s layout that can accept blocks. These vary by theme, but are typically parts like your Sidebar or Footer." 2542 ); 2543 } else if (selectedWidgetAreaId === "wp_inactive_widgets") { 2544 description = (0,external_wp_i18n_namespaceObject.__)( 2545 "Blocks in this Widget Area will not be displayed in your site." 2546 ); 2547 } else { 2548 description = selectedWidgetArea.description; 2549 } 2550 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-widgets-widget-areas", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "edit-widgets-widget-areas__top-container", children: [ 2551 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { icon: block_default_default }), 2552 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { children: [ 2553 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 2554 "p", 2555 { 2556 dangerouslySetInnerHTML: { 2557 __html: (0,external_wp_dom_namespaceObject.safeHTML)(description) 2558 } 2559 } 2560 ), 2561 widgetAreas?.length === 0 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.__)( 2562 "Your theme does not contain any Widget Areas." 2563 ) }), 2564 !selectedWidgetArea && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 2565 external_wp_components_namespaceObject.Button, 2566 { 2567 __next40pxDefaultSize: true, 2568 href: (0,external_wp_url_namespaceObject.addQueryArgs)("customize.php", { 2569 "autofocus[panel]": "widgets", 2570 return: window.location.pathname 2571 }), 2572 variant: "tertiary", 2573 children: (0,external_wp_i18n_namespaceObject.__)("Manage with live preview") 2574 } 2575 ) 2576 ] }) 2577 ] }) }); 2578 } 2579 2580 2581 ;// ./node_modules/@wordpress/edit-widgets/build-module/components/sidebar/index.js 2582 2583 2584 2585 2586 2587 2588 2589 2590 const SIDEBAR_ACTIVE_BY_DEFAULT = external_wp_element_namespaceObject.Platform.select({ 2591 web: true, 2592 native: false 2593 }); 2594 const BLOCK_INSPECTOR_IDENTIFIER = "edit-widgets/block-inspector"; 2595 const WIDGET_AREAS_IDENTIFIER = "edit-widgets/block-areas"; 2596 2597 2598 2599 const { Tabs } = unlock(external_wp_components_namespaceObject.privateApis); 2600 function SidebarHeader({ selectedWidgetAreaBlock }) { 2601 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tabs.TabList, { children: [ 2602 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.Tab, { tabId: WIDGET_AREAS_IDENTIFIER, children: selectedWidgetAreaBlock ? selectedWidgetAreaBlock.attributes.name : (0,external_wp_i18n_namespaceObject.__)("Widget Areas") }), 2603 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.Tab, { tabId: BLOCK_INSPECTOR_IDENTIFIER, children: (0,external_wp_i18n_namespaceObject.__)("Block") }) 2604 ] }); 2605 } 2606 function SidebarContent({ 2607 hasSelectedNonAreaBlock, 2608 currentArea, 2609 isGeneralSidebarOpen, 2610 selectedWidgetAreaBlock 2611 }) { 2612 const { enableComplementaryArea } = (0,external_wp_data_namespaceObject.useDispatch)(store); 2613 (0,external_wp_element_namespaceObject.useEffect)(() => { 2614 if (hasSelectedNonAreaBlock && currentArea === WIDGET_AREAS_IDENTIFIER && isGeneralSidebarOpen) { 2615 enableComplementaryArea( 2616 "core/edit-widgets", 2617 BLOCK_INSPECTOR_IDENTIFIER 2618 ); 2619 } 2620 if (!hasSelectedNonAreaBlock && currentArea === BLOCK_INSPECTOR_IDENTIFIER && isGeneralSidebarOpen) { 2621 enableComplementaryArea( 2622 "core/edit-widgets", 2623 WIDGET_AREAS_IDENTIFIER 2624 ); 2625 } 2626 }, [hasSelectedNonAreaBlock, enableComplementaryArea]); 2627 const tabsContextValue = (0,external_wp_element_namespaceObject.useContext)(Tabs.Context); 2628 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 2629 complementary_area_default, 2630 { 2631 className: "edit-widgets-sidebar", 2632 header: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.Context.Provider, { value: tabsContextValue, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 2633 SidebarHeader, 2634 { 2635 selectedWidgetAreaBlock 2636 } 2637 ) }), 2638 headerClassName: "edit-widgets-sidebar__panel-tabs", 2639 title: (0,external_wp_i18n_namespaceObject.__)("Settings"), 2640 closeLabel: (0,external_wp_i18n_namespaceObject.__)("Close Settings"), 2641 scope: "core/edit-widgets", 2642 identifier: currentArea, 2643 icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? drawer_left_default : drawer_right_default, 2644 isActiveByDefault: SIDEBAR_ACTIVE_BY_DEFAULT, 2645 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tabs.Context.Provider, { value: tabsContextValue, children: [ 2646 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 2647 Tabs.TabPanel, 2648 { 2649 tabId: WIDGET_AREAS_IDENTIFIER, 2650 focusable: false, 2651 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 2652 WidgetAreas, 2653 { 2654 selectedWidgetAreaId: selectedWidgetAreaBlock?.attributes.id 2655 } 2656 ) 2657 } 2658 ), 2659 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 2660 Tabs.TabPanel, 2661 { 2662 tabId: BLOCK_INSPECTOR_IDENTIFIER, 2663 focusable: false, 2664 children: hasSelectedNonAreaBlock ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockInspector, {}) : ( 2665 // Pretend that Widget Areas are part of the UI by not 2666 // showing the Block Inspector when one is selected. 2667 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-block-inspector__no-blocks", children: (0,external_wp_i18n_namespaceObject.__)("No block selected.") }) 2668 ) 2669 } 2670 ) 2671 ] }) 2672 } 2673 ); 2674 } 2675 function Sidebar() { 2676 const { 2677 currentArea, 2678 hasSelectedNonAreaBlock, 2679 isGeneralSidebarOpen, 2680 selectedWidgetAreaBlock 2681 } = (0,external_wp_data_namespaceObject.useSelect)((select) => { 2682 const { getSelectedBlock, getBlock, getBlockParentsByBlockName } = select(external_wp_blockEditor_namespaceObject.store); 2683 const { getActiveComplementaryArea } = select(store); 2684 const selectedBlock = getSelectedBlock(); 2685 const activeArea = getActiveComplementaryArea(store_store.name); 2686 let currentSelection = activeArea; 2687 if (!currentSelection) { 2688 if (selectedBlock) { 2689 currentSelection = BLOCK_INSPECTOR_IDENTIFIER; 2690 } else { 2691 currentSelection = WIDGET_AREAS_IDENTIFIER; 2692 } 2693 } 2694 let widgetAreaBlock; 2695 if (selectedBlock) { 2696 if (selectedBlock.name === "core/widget-area") { 2697 widgetAreaBlock = selectedBlock; 2698 } else { 2699 widgetAreaBlock = getBlock( 2700 getBlockParentsByBlockName( 2701 selectedBlock.clientId, 2702 "core/widget-area" 2703 )[0] 2704 ); 2705 } 2706 } 2707 return { 2708 currentArea: currentSelection, 2709 hasSelectedNonAreaBlock: !!(selectedBlock && selectedBlock.name !== "core/widget-area"), 2710 isGeneralSidebarOpen: !!activeArea, 2711 selectedWidgetAreaBlock: widgetAreaBlock 2712 }; 2713 }, []); 2714 const { enableComplementaryArea } = (0,external_wp_data_namespaceObject.useDispatch)(store); 2715 const onTabSelect = (0,external_wp_element_namespaceObject.useCallback)( 2716 (newSelectedTabId) => { 2717 if (!!newSelectedTabId) { 2718 enableComplementaryArea( 2719 store_store.name, 2720 newSelectedTabId 2721 ); 2722 } 2723 }, 2724 [enableComplementaryArea] 2725 ); 2726 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 2727 Tabs, 2728 { 2729 selectedTabId: isGeneralSidebarOpen ? currentArea : null, 2730 onSelect: onTabSelect, 2731 selectOnMove: false, 2732 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 2733 SidebarContent, 2734 { 2735 hasSelectedNonAreaBlock, 2736 currentArea, 2737 isGeneralSidebarOpen, 2738 selectedWidgetAreaBlock 2739 } 2740 ) 2741 } 2742 ); 2743 } 2744 2745 2746 ;// ./node_modules/@wordpress/icons/build-module/library/plus.js 2747 2748 2749 var plus_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z" }) }); 2750 2751 2752 ;// ./node_modules/@wordpress/icons/build-module/library/list-view.js 2753 2754 2755 var list_view_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z" }) }); 2756 2757 2758 ;// ./node_modules/@wordpress/icons/build-module/library/undo.js 2759 2760 2761 var undo_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 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" }) }); 2762 2763 2764 ;// ./node_modules/@wordpress/icons/build-module/library/redo.js 2765 2766 2767 var redo_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 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" }) }); 2768 2769 2770 ;// ./node_modules/@wordpress/edit-widgets/build-module/components/header/undo-redo/undo.js 2771 2772 2773 2774 2775 2776 2777 2778 2779 function UndoButton(props, ref) { 2780 const hasUndo = (0,external_wp_data_namespaceObject.useSelect)( 2781 (select) => select(external_wp_coreData_namespaceObject.store).hasUndo(), 2782 [] 2783 ); 2784 const { undo } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); 2785 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 2786 external_wp_components_namespaceObject.Button, 2787 { 2788 ...props, 2789 ref, 2790 icon: !(0,external_wp_i18n_namespaceObject.isRTL)() ? undo_default : redo_default, 2791 label: (0,external_wp_i18n_namespaceObject.__)("Undo"), 2792 shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary("z"), 2793 "aria-disabled": !hasUndo, 2794 onClick: hasUndo ? undo : void 0, 2795 size: "compact" 2796 } 2797 ); 2798 } 2799 var undo_undo_default = (0,external_wp_element_namespaceObject.forwardRef)(UndoButton); 2800 2801 2802 ;// ./node_modules/@wordpress/edit-widgets/build-module/components/header/undo-redo/redo.js 2803 2804 2805 2806 2807 2808 2809 2810 2811 function RedoButton(props, ref) { 2812 const shortcut = (0,external_wp_keycodes_namespaceObject.isAppleOS)() ? external_wp_keycodes_namespaceObject.displayShortcut.primaryShift("z") : external_wp_keycodes_namespaceObject.displayShortcut.primary("y"); 2813 const hasRedo = (0,external_wp_data_namespaceObject.useSelect)( 2814 (select) => select(external_wp_coreData_namespaceObject.store).hasRedo(), 2815 [] 2816 ); 2817 const { redo } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); 2818 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 2819 external_wp_components_namespaceObject.Button, 2820 { 2821 ...props, 2822 ref, 2823 icon: !(0,external_wp_i18n_namespaceObject.isRTL)() ? redo_default : undo_default, 2824 label: (0,external_wp_i18n_namespaceObject.__)("Redo"), 2825 shortcut, 2826 "aria-disabled": !hasRedo, 2827 onClick: hasRedo ? redo : void 0, 2828 size: "compact" 2829 } 2830 ); 2831 } 2832 var redo_redo_default = (0,external_wp_element_namespaceObject.forwardRef)(RedoButton); 2833 2834 2835 ;// ./node_modules/@wordpress/edit-widgets/build-module/components/header/document-tools/index.js 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 function DocumentTools() { 2849 const isMediumViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium"); 2850 const { 2851 isInserterOpen, 2852 isListViewOpen, 2853 inserterSidebarToggleRef, 2854 listViewToggleRef 2855 } = (0,external_wp_data_namespaceObject.useSelect)((select) => { 2856 const { 2857 isInserterOpened, 2858 getInserterSidebarToggleRef, 2859 isListViewOpened, 2860 getListViewToggleRef 2861 } = unlock(select(store_store)); 2862 return { 2863 isInserterOpen: isInserterOpened(), 2864 isListViewOpen: isListViewOpened(), 2865 inserterSidebarToggleRef: getInserterSidebarToggleRef(), 2866 listViewToggleRef: getListViewToggleRef() 2867 }; 2868 }, []); 2869 const { setIsInserterOpened, setIsListViewOpened } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); 2870 const toggleListView = (0,external_wp_element_namespaceObject.useCallback)( 2871 () => setIsListViewOpened(!isListViewOpen), 2872 [setIsListViewOpened, isListViewOpen] 2873 ); 2874 const toggleInserterSidebar = (0,external_wp_element_namespaceObject.useCallback)( 2875 () => setIsInserterOpened(!isInserterOpen), 2876 [setIsInserterOpened, isInserterOpen] 2877 ); 2878 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)( 2879 external_wp_blockEditor_namespaceObject.NavigableToolbar, 2880 { 2881 className: "edit-widgets-header-toolbar", 2882 "aria-label": (0,external_wp_i18n_namespaceObject.__)("Document tools"), 2883 variant: "unstyled", 2884 children: [ 2885 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 2886 external_wp_components_namespaceObject.ToolbarItem, 2887 { 2888 ref: inserterSidebarToggleRef, 2889 as: external_wp_components_namespaceObject.Button, 2890 className: "edit-widgets-header-toolbar__inserter-toggle", 2891 variant: "primary", 2892 isPressed: isInserterOpen, 2893 onMouseDown: (event) => { 2894 event.preventDefault(); 2895 }, 2896 onClick: toggleInserterSidebar, 2897 icon: plus_default, 2898 label: (0,external_wp_i18n_namespaceObject._x)( 2899 "Block Inserter", 2900 "Generic label for block inserter button" 2901 ), 2902 size: "compact" 2903 } 2904 ), 2905 isMediumViewport && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [ 2906 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, { as: undo_undo_default }), 2907 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, { as: redo_redo_default }), 2908 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 2909 external_wp_components_namespaceObject.ToolbarItem, 2910 { 2911 as: external_wp_components_namespaceObject.Button, 2912 className: "edit-widgets-header-toolbar__list-view-toggle", 2913 icon: list_view_default, 2914 isPressed: isListViewOpen, 2915 label: (0,external_wp_i18n_namespaceObject.__)("List View"), 2916 onClick: toggleListView, 2917 ref: listViewToggleRef, 2918 size: "compact" 2919 } 2920 ) 2921 ] }) 2922 ] 2923 } 2924 ); 2925 } 2926 var document_tools_default = DocumentTools; 2927 2928 2929 ;// ./node_modules/@wordpress/edit-widgets/build-module/components/save-button/index.js 2930 2931 2932 2933 2934 2935 function SaveButton() { 2936 const { hasEditedWidgetAreaIds, isSaving, isWidgetSaveLocked } = (0,external_wp_data_namespaceObject.useSelect)( 2937 (select) => { 2938 const { 2939 getEditedWidgetAreas, 2940 isSavingWidgetAreas, 2941 isWidgetSavingLocked 2942 } = select(store_store); 2943 return { 2944 hasEditedWidgetAreaIds: getEditedWidgetAreas()?.length > 0, 2945 isSaving: isSavingWidgetAreas(), 2946 isWidgetSaveLocked: isWidgetSavingLocked() 2947 }; 2948 }, 2949 [] 2950 ); 2951 const { saveEditedWidgetAreas } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); 2952 const isDisabled = isWidgetSaveLocked || isSaving || !hasEditedWidgetAreaIds; 2953 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 2954 external_wp_components_namespaceObject.Button, 2955 { 2956 variant: "primary", 2957 isBusy: isSaving, 2958 "aria-disabled": isDisabled, 2959 onClick: isDisabled ? void 0 : saveEditedWidgetAreas, 2960 size: "compact", 2961 children: isSaving ? (0,external_wp_i18n_namespaceObject.__)("Saving\u2026") : (0,external_wp_i18n_namespaceObject.__)("Update") 2962 } 2963 ); 2964 } 2965 var save_button_default = SaveButton; 2966 2967 2968 ;// ./node_modules/@wordpress/icons/build-module/library/more-vertical.js 2969 2970 2971 var more_vertical_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" }) }); 2972 2973 2974 ;// ./node_modules/@wordpress/icons/build-module/library/external.js 2975 2976 2977 var external_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { 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" }) }); 2978 2979 2980 ;// ./node_modules/@wordpress/edit-widgets/build-module/components/keyboard-shortcut-help-modal/config.js 2981 2982 const textFormattingShortcuts = [ 2983 { 2984 keyCombination: { modifier: "primary", character: "b" }, 2985 description: (0,external_wp_i18n_namespaceObject.__)("Make the selected text bold.") 2986 }, 2987 { 2988 keyCombination: { modifier: "primary", character: "i" }, 2989 description: (0,external_wp_i18n_namespaceObject.__)("Make the selected text italic.") 2990 }, 2991 { 2992 keyCombination: { modifier: "primary", character: "k" }, 2993 description: (0,external_wp_i18n_namespaceObject.__)("Convert the selected text into a link.") 2994 }, 2995 { 2996 keyCombination: { modifier: "primaryShift", character: "k" }, 2997 description: (0,external_wp_i18n_namespaceObject.__)("Remove a link.") 2998 }, 2999 { 3000 keyCombination: { character: "[[" }, 3001 description: (0,external_wp_i18n_namespaceObject.__)("Insert a link to a post or page.") 3002 }, 3003 { 3004 keyCombination: { modifier: "primary", character: "u" }, 3005 description: (0,external_wp_i18n_namespaceObject.__)("Underline the selected text.") 3006 }, 3007 { 3008 keyCombination: { modifier: "access", character: "d" }, 3009 description: (0,external_wp_i18n_namespaceObject.__)("Strikethrough the selected text.") 3010 }, 3011 { 3012 keyCombination: { modifier: "access", character: "x" }, 3013 description: (0,external_wp_i18n_namespaceObject.__)("Make the selected text inline code.") 3014 }, 3015 { 3016 keyCombination: { 3017 modifier: "access", 3018 character: "0" 3019 }, 3020 aliases: [ 3021 { 3022 modifier: "access", 3023 character: "7" 3024 } 3025 ], 3026 description: (0,external_wp_i18n_namespaceObject.__)("Convert the current heading to a paragraph.") 3027 }, 3028 { 3029 keyCombination: { modifier: "access", character: "1-6" }, 3030 description: (0,external_wp_i18n_namespaceObject.__)( 3031 "Convert the current paragraph or heading to a heading of level 1 to 6." 3032 ) 3033 }, 3034 { 3035 keyCombination: { modifier: "primaryShift", character: "SPACE" }, 3036 description: (0,external_wp_i18n_namespaceObject.__)("Add non breaking space.") 3037 } 3038 ]; 3039 3040 3041 ;// ./node_modules/@wordpress/edit-widgets/build-module/components/keyboard-shortcut-help-modal/shortcut.js 3042 3043 3044 3045 function KeyCombination({ keyCombination, forceAriaLabel }) { 3046 const shortcut = keyCombination.modifier ? external_wp_keycodes_namespaceObject.displayShortcutList[keyCombination.modifier]( 3047 keyCombination.character 3048 ) : keyCombination.character; 3049 const ariaLabel = keyCombination.modifier ? external_wp_keycodes_namespaceObject.shortcutAriaLabel[keyCombination.modifier]( 3050 keyCombination.character 3051 ) : keyCombination.character; 3052 const shortcuts = Array.isArray(shortcut) ? shortcut : [shortcut]; 3053 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3054 "kbd", 3055 { 3056 className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-key-combination", 3057 "aria-label": forceAriaLabel || ariaLabel, 3058 children: shortcuts.map((character, index) => { 3059 if (character === "+") { 3060 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.Fragment, { children: character }, index); 3061 } 3062 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3063 "kbd", 3064 { 3065 className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-key", 3066 children: character 3067 }, 3068 index 3069 ); 3070 }) 3071 } 3072 ); 3073 } 3074 function Shortcut({ description, keyCombination, aliases = [], ariaLabel }) { 3075 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [ 3076 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-description", children: description }), 3077 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-term", children: [ 3078 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3079 KeyCombination, 3080 { 3081 keyCombination, 3082 forceAriaLabel: ariaLabel 3083 } 3084 ), 3085 aliases.map((alias, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3086 KeyCombination, 3087 { 3088 keyCombination: alias, 3089 forceAriaLabel: ariaLabel 3090 }, 3091 index 3092 )) 3093 ] }) 3094 ] }); 3095 } 3096 var shortcut_default = Shortcut; 3097 3098 3099 ;// ./node_modules/@wordpress/edit-widgets/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js 3100 3101 3102 3103 3104 function DynamicShortcut({ name }) { 3105 const { keyCombination, description, aliases } = (0,external_wp_data_namespaceObject.useSelect)( 3106 (select) => { 3107 const { 3108 getShortcutKeyCombination, 3109 getShortcutDescription, 3110 getShortcutAliases 3111 } = select(external_wp_keyboardShortcuts_namespaceObject.store); 3112 return { 3113 keyCombination: getShortcutKeyCombination(name), 3114 aliases: getShortcutAliases(name), 3115 description: getShortcutDescription(name) 3116 }; 3117 }, 3118 [name] 3119 ); 3120 if (!keyCombination) { 3121 return null; 3122 } 3123 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3124 shortcut_default, 3125 { 3126 keyCombination, 3127 description, 3128 aliases 3129 } 3130 ); 3131 } 3132 var dynamic_shortcut_default = DynamicShortcut; 3133 3134 3135 ;// ./node_modules/@wordpress/edit-widgets/build-module/components/keyboard-shortcut-help-modal/index.js 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 const ShortcutList = ({ shortcuts }) => ( 3146 /* 3147 * Disable reason: The `list` ARIA role is redundant but 3148 * Safari+VoiceOver won't announce the list otherwise. 3149 */ 3150 /* eslint-disable jsx-a11y/no-redundant-roles */ 3151 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3152 "ul", 3153 { 3154 className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-list", 3155 role: "list", 3156 children: shortcuts.map((shortcut, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3157 "li", 3158 { 3159 className: "edit-widgets-keyboard-shortcut-help-modal__shortcut", 3160 children: typeof shortcut === "string" ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(dynamic_shortcut_default, { name: shortcut }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(shortcut_default, { ...shortcut }) 3161 }, 3162 index 3163 )) 3164 } 3165 ) 3166 ); 3167 const ShortcutSection = ({ title, shortcuts, className }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)( 3168 "section", 3169 { 3170 className: dist_clsx( 3171 "edit-widgets-keyboard-shortcut-help-modal__section", 3172 className 3173 ), 3174 children: [ 3175 !!title && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { className: "edit-widgets-keyboard-shortcut-help-modal__section-title", children: title }), 3176 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutList, { shortcuts }) 3177 ] 3178 } 3179 ); 3180 const ShortcutCategorySection = ({ 3181 title, 3182 categoryName, 3183 additionalShortcuts = [] 3184 }) => { 3185 const categoryShortcuts = (0,external_wp_data_namespaceObject.useSelect)( 3186 (select) => { 3187 return select(external_wp_keyboardShortcuts_namespaceObject.store).getCategoryShortcuts( 3188 categoryName 3189 ); 3190 }, 3191 [categoryName] 3192 ); 3193 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3194 ShortcutSection, 3195 { 3196 title, 3197 shortcuts: categoryShortcuts.concat(additionalShortcuts) 3198 } 3199 ); 3200 }; 3201 function KeyboardShortcutHelpModal({ 3202 isModalActive, 3203 toggleModal 3204 }) { 3205 (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)("core/edit-widgets/keyboard-shortcuts", toggleModal, { 3206 bindGlobal: true 3207 }); 3208 if (!isModalActive) { 3209 return null; 3210 } 3211 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)( 3212 external_wp_components_namespaceObject.Modal, 3213 { 3214 className: "edit-widgets-keyboard-shortcut-help-modal", 3215 title: (0,external_wp_i18n_namespaceObject.__)("Keyboard shortcuts"), 3216 onRequestClose: toggleModal, 3217 children: [ 3218 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3219 ShortcutSection, 3220 { 3221 className: "edit-widgets-keyboard-shortcut-help-modal__main-shortcuts", 3222 shortcuts: ["core/edit-widgets/keyboard-shortcuts"] 3223 } 3224 ), 3225 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3226 ShortcutCategorySection, 3227 { 3228 title: (0,external_wp_i18n_namespaceObject.__)("Global shortcuts"), 3229 categoryName: "global" 3230 } 3231 ), 3232 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3233 ShortcutCategorySection, 3234 { 3235 title: (0,external_wp_i18n_namespaceObject.__)("Selection shortcuts"), 3236 categoryName: "selection" 3237 } 3238 ), 3239 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3240 ShortcutCategorySection, 3241 { 3242 title: (0,external_wp_i18n_namespaceObject.__)("Block shortcuts"), 3243 categoryName: "block", 3244 additionalShortcuts: [ 3245 { 3246 keyCombination: { character: "/" }, 3247 description: (0,external_wp_i18n_namespaceObject.__)( 3248 "Change the block type after adding a new paragraph." 3249 ), 3250 /* translators: The forward-slash character. e.g. '/'. */ 3251 ariaLabel: (0,external_wp_i18n_namespaceObject.__)("Forward-slash") 3252 } 3253 ] 3254 } 3255 ), 3256 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3257 ShortcutSection, 3258 { 3259 title: (0,external_wp_i18n_namespaceObject.__)("Text formatting"), 3260 shortcuts: textFormattingShortcuts 3261 } 3262 ), 3263 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3264 ShortcutCategorySection, 3265 { 3266 title: (0,external_wp_i18n_namespaceObject.__)("List View shortcuts"), 3267 categoryName: "list-view" 3268 } 3269 ) 3270 ] 3271 } 3272 ); 3273 } 3274 3275 3276 ;// ./node_modules/@wordpress/edit-widgets/build-module/components/more-menu/tools-more-menu-group.js 3277 3278 3279 const { Fill: ToolsMoreMenuGroup, Slot } = (0,external_wp_components_namespaceObject.createSlotFill)( 3280 "EditWidgetsToolsMoreMenuGroup" 3281 ); 3282 ToolsMoreMenuGroup.Slot = ({ fillProps }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Slot, { fillProps, children: (fills) => fills.length > 0 && fills }); 3283 var tools_more_menu_group_default = ToolsMoreMenuGroup; 3284 3285 3286 ;// ./node_modules/@wordpress/edit-widgets/build-module/components/more-menu/index.js 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 function MoreMenu() { 3299 const [ 3300 isKeyboardShortcutsModalActive, 3301 setIsKeyboardShortcutsModalVisible 3302 ] = (0,external_wp_element_namespaceObject.useState)(false); 3303 const toggleKeyboardShortcutsModal = () => setIsKeyboardShortcutsModalVisible(!isKeyboardShortcutsModalActive); 3304 (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)( 3305 "core/edit-widgets/keyboard-shortcuts", 3306 toggleKeyboardShortcutsModal 3307 ); 3308 const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium"); 3309 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [ 3310 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3311 external_wp_components_namespaceObject.DropdownMenu, 3312 { 3313 icon: more_vertical_default, 3314 label: (0,external_wp_i18n_namespaceObject.__)("Options"), 3315 popoverProps: { 3316 placement: "bottom-end", 3317 className: "more-menu-dropdown__content" 3318 }, 3319 toggleProps: { 3320 tooltipPosition: "bottom", 3321 size: "compact" 3322 }, 3323 children: (onClose) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [ 3324 isLargeViewport && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { label: (0,external_wp_i18n_namespaceObject._x)("View", "noun"), children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3325 external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, 3326 { 3327 scope: "core/edit-widgets", 3328 name: "fixedToolbar", 3329 label: (0,external_wp_i18n_namespaceObject.__)("Top toolbar"), 3330 info: (0,external_wp_i18n_namespaceObject.__)( 3331 "Access all block and document tools in a single place" 3332 ), 3333 messageActivated: (0,external_wp_i18n_namespaceObject.__)( 3334 "Top toolbar activated" 3335 ), 3336 messageDeactivated: (0,external_wp_i18n_namespaceObject.__)( 3337 "Top toolbar deactivated" 3338 ) 3339 } 3340 ) }), 3341 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { label: (0,external_wp_i18n_namespaceObject.__)("Tools"), children: [ 3342 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3343 external_wp_components_namespaceObject.MenuItem, 3344 { 3345 onClick: () => { 3346 setIsKeyboardShortcutsModalVisible(true); 3347 }, 3348 shortcut: external_wp_keycodes_namespaceObject.displayShortcut.access("h"), 3349 children: (0,external_wp_i18n_namespaceObject.__)("Keyboard shortcuts") 3350 } 3351 ), 3352 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3353 external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, 3354 { 3355 scope: "core/edit-widgets", 3356 name: "welcomeGuide", 3357 label: (0,external_wp_i18n_namespaceObject.__)("Welcome Guide") 3358 } 3359 ), 3360 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)( 3361 external_wp_components_namespaceObject.MenuItem, 3362 { 3363 role: "menuitem", 3364 icon: external_default, 3365 href: (0,external_wp_i18n_namespaceObject.__)( 3366 "https://wordpress.org/documentation/article/block-based-widgets-editor/" 3367 ), 3368 target: "_blank", 3369 rel: "noopener noreferrer", 3370 children: [ 3371 (0,external_wp_i18n_namespaceObject.__)("Help"), 3372 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { 3373 as: "span", 3374 /* translators: accessibility text */ 3375 children: (0,external_wp_i18n_namespaceObject.__)("(opens in a new tab)") 3376 }) 3377 ] 3378 } 3379 ), 3380 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3381 tools_more_menu_group_default.Slot, 3382 { 3383 fillProps: { onClose } 3384 } 3385 ) 3386 ] }), 3387 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { label: (0,external_wp_i18n_namespaceObject.__)("Preferences"), children: [ 3388 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3389 external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, 3390 { 3391 scope: "core/edit-widgets", 3392 name: "keepCaretInsideBlock", 3393 label: (0,external_wp_i18n_namespaceObject.__)( 3394 "Contain text cursor inside block" 3395 ), 3396 info: (0,external_wp_i18n_namespaceObject.__)( 3397 "Aids screen readers by stopping text caret from leaving blocks." 3398 ), 3399 messageActivated: (0,external_wp_i18n_namespaceObject.__)( 3400 "Contain text cursor inside block activated" 3401 ), 3402 messageDeactivated: (0,external_wp_i18n_namespaceObject.__)( 3403 "Contain text cursor inside block deactivated" 3404 ) 3405 } 3406 ), 3407 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3408 external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, 3409 { 3410 scope: "core/edit-widgets", 3411 name: "themeStyles", 3412 info: (0,external_wp_i18n_namespaceObject.__)( 3413 "Make the editor look like your theme." 3414 ), 3415 label: (0,external_wp_i18n_namespaceObject.__)("Use theme styles") 3416 } 3417 ), 3418 isLargeViewport && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3419 external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, 3420 { 3421 scope: "core/edit-widgets", 3422 name: "showBlockBreadcrumbs", 3423 label: (0,external_wp_i18n_namespaceObject.__)("Display block breadcrumbs"), 3424 info: (0,external_wp_i18n_namespaceObject.__)( 3425 "Shows block breadcrumbs at the bottom of the editor." 3426 ), 3427 messageActivated: (0,external_wp_i18n_namespaceObject.__)( 3428 "Display block breadcrumbs activated" 3429 ), 3430 messageDeactivated: (0,external_wp_i18n_namespaceObject.__)( 3431 "Display block breadcrumbs deactivated" 3432 ) 3433 } 3434 ) 3435 ] }) 3436 ] }) 3437 } 3438 ), 3439 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3440 KeyboardShortcutHelpModal, 3441 { 3442 isModalActive: isKeyboardShortcutsModalActive, 3443 toggleModal: toggleKeyboardShortcutsModal 3444 } 3445 ) 3446 ] }); 3447 } 3448 3449 3450 ;// ./node_modules/@wordpress/edit-widgets/build-module/components/header/index.js 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 function Header() { 3464 const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium"); 3465 const blockToolbarRef = (0,external_wp_element_namespaceObject.useRef)(); 3466 const { hasFixedToolbar } = (0,external_wp_data_namespaceObject.useSelect)( 3467 (select) => ({ 3468 hasFixedToolbar: !!select(external_wp_preferences_namespaceObject.store).get( 3469 "core/edit-widgets", 3470 "fixedToolbar" 3471 ) 3472 }), 3473 [] 3474 ); 3475 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "edit-widgets-header", children: [ 3476 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "edit-widgets-header__navigable-toolbar-wrapper", children: [ 3477 isLargeViewport && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { className: "edit-widgets-header__title", children: (0,external_wp_i18n_namespaceObject.__)("Widgets") }), 3478 !isLargeViewport && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3479 external_wp_components_namespaceObject.VisuallyHidden, 3480 { 3481 as: "h1", 3482 className: "edit-widgets-header__title", 3483 children: (0,external_wp_i18n_namespaceObject.__)("Widgets") 3484 } 3485 ), 3486 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(document_tools_default, {}), 3487 hasFixedToolbar && isLargeViewport && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [ 3488 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "selected-block-tools-wrapper", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockToolbar, { hideDragHandle: true }) }), 3489 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3490 external_wp_components_namespaceObject.Popover.Slot, 3491 { 3492 ref: blockToolbarRef, 3493 name: "block-toolbar" 3494 } 3495 ) 3496 ] }) 3497 ] }), 3498 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "edit-widgets-header__actions", children: [ 3499 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(pinned_items_default.Slot, { scope: "core/edit-widgets" }), 3500 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(save_button_default, {}), 3501 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(MoreMenu, {}) 3502 ] }) 3503 ] }) }); 3504 } 3505 var header_default = Header; 3506 3507 3508 ;// ./node_modules/@wordpress/edit-widgets/build-module/components/notices/index.js 3509 3510 3511 3512 3513 const MAX_VISIBLE_NOTICES = -3; 3514 function Notices() { 3515 const { removeNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); 3516 const { notices } = (0,external_wp_data_namespaceObject.useSelect)((select) => { 3517 return { 3518 notices: select(external_wp_notices_namespaceObject.store).getNotices() 3519 }; 3520 }, []); 3521 const dismissibleNotices = notices.filter( 3522 ({ isDismissible, type }) => isDismissible && type === "default" 3523 ); 3524 const nonDismissibleNotices = notices.filter( 3525 ({ isDismissible, type }) => !isDismissible && type === "default" 3526 ); 3527 const snackbarNotices = notices.filter(({ type }) => type === "snackbar").slice(MAX_VISIBLE_NOTICES); 3528 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [ 3529 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3530 external_wp_components_namespaceObject.NoticeList, 3531 { 3532 notices: nonDismissibleNotices, 3533 className: "edit-widgets-notices__pinned" 3534 } 3535 ), 3536 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3537 external_wp_components_namespaceObject.NoticeList, 3538 { 3539 notices: dismissibleNotices, 3540 className: "edit-widgets-notices__dismissible", 3541 onRemove: removeNotice 3542 } 3543 ), 3544 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3545 external_wp_components_namespaceObject.SnackbarList, 3546 { 3547 notices: snackbarNotices, 3548 className: "edit-widgets-notices__snackbar", 3549 onRemove: removeNotice 3550 } 3551 ) 3552 ] }); 3553 } 3554 var notices_default = Notices; 3555 3556 3557 ;// ./node_modules/@wordpress/edit-widgets/build-module/components/widget-areas-block-editor-content/index.js 3558 3559 3560 3561 3562 3563 3564 3565 3566 function WidgetAreasBlockEditorContent({ 3567 blockEditorSettings 3568 }) { 3569 const hasThemeStyles = (0,external_wp_data_namespaceObject.useSelect)( 3570 (select) => !!select(external_wp_preferences_namespaceObject.store).get( 3571 "core/edit-widgets", 3572 "themeStyles" 3573 ), 3574 [] 3575 ); 3576 const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium"); 3577 const styles = (0,external_wp_element_namespaceObject.useMemo)(() => { 3578 return hasThemeStyles ? blockEditorSettings.styles : []; 3579 }, [blockEditorSettings, hasThemeStyles]); 3580 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "edit-widgets-block-editor", children: [ 3581 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(notices_default, {}), 3582 !isLargeViewport && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockToolbar, { hideDragHandle: true }), 3583 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockTools, { children: [ 3584 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboard_shortcuts_default, {}), 3585 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3586 external_wp_blockEditor_namespaceObject.__unstableEditorStyles, 3587 { 3588 styles, 3589 scope: ":where(.editor-styles-wrapper)" 3590 } 3591 ), 3592 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockSelectionClearer, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.WritingFlow, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockList, { className: "edit-widgets-main-block-list" }) }) }) 3593 ] }) 3594 ] }); 3595 } 3596 3597 3598 ;// ./node_modules/@wordpress/edit-widgets/build-module/hooks/use-widget-library-insertion-point.js 3599 3600 3601 3602 3603 3604 const useWidgetLibraryInsertionPoint = () => { 3605 const firstRootId = (0,external_wp_data_namespaceObject.useSelect)((select) => { 3606 const { getEntityRecord } = select(external_wp_coreData_namespaceObject.store); 3607 const widgetAreasPost = getEntityRecord( 3608 KIND, 3609 POST_TYPE, 3610 buildWidgetAreasPostId() 3611 ); 3612 return widgetAreasPost?.blocks[0]?.clientId; 3613 }, []); 3614 return (0,external_wp_data_namespaceObject.useSelect)( 3615 (select) => { 3616 const { 3617 getBlockRootClientId, 3618 getBlockSelectionEnd, 3619 getBlockOrder, 3620 getBlockIndex 3621 } = select(external_wp_blockEditor_namespaceObject.store); 3622 const insertionPoint = select(store_store).__experimentalGetInsertionPoint(); 3623 if (insertionPoint.rootClientId) { 3624 return insertionPoint; 3625 } 3626 const clientId = getBlockSelectionEnd() || firstRootId; 3627 const rootClientId = getBlockRootClientId(clientId); 3628 if (clientId && rootClientId === "") { 3629 return { 3630 rootClientId: clientId, 3631 insertionIndex: getBlockOrder(clientId).length 3632 }; 3633 } 3634 return { 3635 rootClientId, 3636 insertionIndex: getBlockIndex(clientId) + 1 3637 }; 3638 }, 3639 [firstRootId] 3640 ); 3641 }; 3642 var use_widget_library_insertion_point_default = useWidgetLibraryInsertionPoint; 3643 3644 3645 ;// ./node_modules/@wordpress/edit-widgets/build-module/components/secondary-sidebar/inserter-sidebar.js 3646 3647 3648 3649 3650 3651 3652 3653 function InserterSidebar() { 3654 const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<"); 3655 const { rootClientId, insertionIndex } = use_widget_library_insertion_point_default(); 3656 const { setIsInserterOpened } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); 3657 const closeInserter = (0,external_wp_element_namespaceObject.useCallback)(() => { 3658 return setIsInserterOpened(false); 3659 }, [setIsInserterOpened]); 3660 const libraryRef = (0,external_wp_element_namespaceObject.useRef)(); 3661 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-widgets-layout__inserter-panel", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-widgets-layout__inserter-panel-content", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3662 external_wp_blockEditor_namespaceObject.__experimentalLibrary, 3663 { 3664 showInserterHelpPanel: true, 3665 shouldFocusBlock: isMobileViewport, 3666 rootClientId, 3667 __experimentalInsertionIndex: insertionIndex, 3668 ref: libraryRef, 3669 onClose: closeInserter 3670 } 3671 ) }) }); 3672 } 3673 3674 3675 ;// ./node_modules/@wordpress/edit-widgets/build-module/components/secondary-sidebar/list-view-sidebar.js 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 function ListViewSidebar() { 3688 const { setIsListViewOpened } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); 3689 const { getListViewToggleRef } = unlock((0,external_wp_data_namespaceObject.useSelect)(store_store)); 3690 const [dropZoneElement, setDropZoneElement] = (0,external_wp_element_namespaceObject.useState)(null); 3691 const focusOnMountRef = (0,external_wp_compose_namespaceObject.useFocusOnMount)("firstElement"); 3692 const closeListView = (0,external_wp_element_namespaceObject.useCallback)(() => { 3693 setIsListViewOpened(false); 3694 getListViewToggleRef().current?.focus(); 3695 }, [getListViewToggleRef, setIsListViewOpened]); 3696 const closeOnEscape = (0,external_wp_element_namespaceObject.useCallback)( 3697 (event) => { 3698 if (event.keyCode === external_wp_keycodes_namespaceObject.ESCAPE && !event.defaultPrevented) { 3699 event.preventDefault(); 3700 closeListView(); 3701 } 3702 }, 3703 [closeListView] 3704 ); 3705 return ( 3706 // eslint-disable-next-line jsx-a11y/no-static-element-interactions 3707 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)( 3708 "div", 3709 { 3710 className: "edit-widgets-editor__list-view-panel", 3711 onKeyDown: closeOnEscape, 3712 children: [ 3713 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "edit-widgets-editor__list-view-panel-header", children: [ 3714 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("strong", { children: (0,external_wp_i18n_namespaceObject.__)("List View") }), 3715 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3716 external_wp_components_namespaceObject.Button, 3717 { 3718 icon: close_small_default, 3719 label: (0,external_wp_i18n_namespaceObject.__)("Close"), 3720 onClick: closeListView, 3721 size: "compact" 3722 } 3723 ) 3724 ] }), 3725 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3726 "div", 3727 { 3728 className: "edit-widgets-editor__list-view-panel-content", 3729 ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([focusOnMountRef, setDropZoneElement]), 3730 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalListView, { dropZoneElement }) 3731 } 3732 ) 3733 ] 3734 } 3735 ) 3736 ); 3737 } 3738 3739 3740 ;// ./node_modules/@wordpress/edit-widgets/build-module/components/secondary-sidebar/index.js 3741 3742 3743 3744 3745 3746 function SecondarySidebar() { 3747 const { isInserterOpen, isListViewOpen } = (0,external_wp_data_namespaceObject.useSelect)((select) => { 3748 const { isInserterOpened, isListViewOpened } = select(store_store); 3749 return { 3750 isInserterOpen: isInserterOpened(), 3751 isListViewOpen: isListViewOpened() 3752 }; 3753 }, []); 3754 if (isInserterOpen) { 3755 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(InserterSidebar, {}); 3756 } 3757 if (isListViewOpen) { 3758 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ListViewSidebar, {}); 3759 } 3760 return null; 3761 } 3762 3763 3764 ;// ./node_modules/@wordpress/edit-widgets/build-module/components/layout/interface.js 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 const interfaceLabels = { 3778 /* translators: accessibility text for the widgets screen top bar landmark region. */ 3779 header: (0,external_wp_i18n_namespaceObject.__)("Widgets top bar"), 3780 /* translators: accessibility text for the widgets screen content landmark region. */ 3781 body: (0,external_wp_i18n_namespaceObject.__)("Widgets and blocks"), 3782 /* translators: accessibility text for the widgets screen settings landmark region. */ 3783 sidebar: (0,external_wp_i18n_namespaceObject.__)("Widgets settings"), 3784 /* translators: accessibility text for the widgets screen footer landmark region. */ 3785 footer: (0,external_wp_i18n_namespaceObject.__)("Widgets footer") 3786 }; 3787 function Interface({ blockEditorSettings }) { 3788 const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<"); 3789 const isHugeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("huge", ">="); 3790 const { setIsInserterOpened, setIsListViewOpened, closeGeneralSidebar } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); 3791 const { 3792 hasBlockBreadCrumbsEnabled, 3793 hasSidebarEnabled, 3794 isInserterOpened, 3795 isListViewOpened 3796 } = (0,external_wp_data_namespaceObject.useSelect)( 3797 (select) => ({ 3798 hasSidebarEnabled: !!select( 3799 store 3800 ).getActiveComplementaryArea(store_store.name), 3801 isInserterOpened: !!select(store_store).isInserterOpened(), 3802 isListViewOpened: !!select(store_store).isListViewOpened(), 3803 hasBlockBreadCrumbsEnabled: !!select(external_wp_preferences_namespaceObject.store).get( 3804 "core/edit-widgets", 3805 "showBlockBreadcrumbs" 3806 ) 3807 }), 3808 [] 3809 ); 3810 (0,external_wp_element_namespaceObject.useEffect)(() => { 3811 if (hasSidebarEnabled && !isHugeViewport) { 3812 setIsInserterOpened(false); 3813 setIsListViewOpened(false); 3814 } 3815 }, [hasSidebarEnabled, isHugeViewport]); 3816 (0,external_wp_element_namespaceObject.useEffect)(() => { 3817 if ((isInserterOpened || isListViewOpened) && !isHugeViewport) { 3818 closeGeneralSidebar(); 3819 } 3820 }, [isInserterOpened, isListViewOpened, isHugeViewport]); 3821 const secondarySidebarLabel = isListViewOpened ? (0,external_wp_i18n_namespaceObject.__)("List View") : (0,external_wp_i18n_namespaceObject.__)("Block Library"); 3822 const hasSecondarySidebar = isListViewOpened || isInserterOpened; 3823 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3824 interface_skeleton_default, 3825 { 3826 labels: { 3827 ...interfaceLabels, 3828 secondarySidebar: secondarySidebarLabel 3829 }, 3830 header: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(header_default, {}), 3831 secondarySidebar: hasSecondarySidebar && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(SecondarySidebar, {}), 3832 sidebar: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(complementary_area_default.Slot, { scope: "core/edit-widgets" }), 3833 content: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3834 WidgetAreasBlockEditorContent, 3835 { 3836 blockEditorSettings 3837 } 3838 ) }), 3839 footer: hasBlockBreadCrumbsEnabled && !isMobileViewport && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-widgets-layout__footer", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockBreadcrumb, { rootLabelText: (0,external_wp_i18n_namespaceObject.__)("Widgets") }) }) 3840 } 3841 ); 3842 } 3843 var interface_default = Interface; 3844 3845 3846 ;// ./node_modules/@wordpress/edit-widgets/build-module/components/layout/unsaved-changes-warning.js 3847 3848 3849 3850 3851 function UnsavedChangesWarning() { 3852 const isDirty = (0,external_wp_data_namespaceObject.useSelect)((select) => { 3853 const { getEditedWidgetAreas } = select(store_store); 3854 const editedWidgetAreas = getEditedWidgetAreas(); 3855 return editedWidgetAreas?.length > 0; 3856 }, []); 3857 (0,external_wp_element_namespaceObject.useEffect)(() => { 3858 const warnIfUnsavedChanges = (event) => { 3859 if (isDirty) { 3860 event.returnValue = (0,external_wp_i18n_namespaceObject.__)( 3861 "You have unsaved changes. If you proceed, they will be lost." 3862 ); 3863 return event.returnValue; 3864 } 3865 }; 3866 window.addEventListener("beforeunload", warnIfUnsavedChanges); 3867 return () => { 3868 window.removeEventListener("beforeunload", warnIfUnsavedChanges); 3869 }; 3870 }, [isDirty]); 3871 return null; 3872 } 3873 3874 3875 ;// ./node_modules/@wordpress/edit-widgets/build-module/components/welcome-guide/index.js 3876 3877 3878 3879 3880 3881 3882 3883 function WelcomeGuide() { 3884 const isActive = (0,external_wp_data_namespaceObject.useSelect)( 3885 (select) => !!select(external_wp_preferences_namespaceObject.store).get( 3886 "core/edit-widgets", 3887 "welcomeGuide" 3888 ), 3889 [] 3890 ); 3891 const { toggle } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store); 3892 const widgetAreas = (0,external_wp_data_namespaceObject.useSelect)( 3893 (select) => select(store_store).getWidgetAreas({ per_page: -1 }), 3894 [] 3895 ); 3896 if (!isActive) { 3897 return null; 3898 } 3899 const isEntirelyBlockWidgets = widgetAreas?.every( 3900 (widgetArea) => widgetArea.id === "wp_inactive_widgets" || widgetArea.widgets.every( 3901 (widgetId) => widgetId.startsWith("block-") 3902 ) 3903 ); 3904 const numWidgetAreas = widgetAreas?.filter( 3905 (widgetArea) => widgetArea.id !== "wp_inactive_widgets" 3906 ).length ?? 0; 3907 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3908 external_wp_components_namespaceObject.Guide, 3909 { 3910 className: "edit-widgets-welcome-guide", 3911 contentLabel: (0,external_wp_i18n_namespaceObject.__)("Welcome to block Widgets"), 3912 finishButtonText: (0,external_wp_i18n_namespaceObject.__)("Get started"), 3913 onFinish: () => toggle("core/edit-widgets", "welcomeGuide"), 3914 pages: [ 3915 { 3916 image: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3917 WelcomeGuideImage, 3918 { 3919 nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.svg", 3920 animatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.gif" 3921 } 3922 ), 3923 content: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [ 3924 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { className: "edit-widgets-welcome-guide__heading", children: (0,external_wp_i18n_namespaceObject.__)("Welcome to block Widgets") }), 3925 isEntirelyBlockWidgets ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-widgets-welcome-guide__text", children: (0,external_wp_i18n_namespaceObject.sprintf)( 3926 // Translators: %s: Number of block areas in the current theme. 3927 (0,external_wp_i18n_namespaceObject._n)( 3928 "Your theme provides %s \u201Cblock\u201D area for you to add and edit content.\xA0Try adding a search bar, social icons, or other types of blocks here and see how they\u2019ll look on your site.", 3929 "Your theme provides %s different \u201Cblock\u201D areas for you to add and edit content.\xA0Try adding a search bar, social icons, or other types of blocks here and see how they\u2019ll look on your site.", 3930 numWidgetAreas 3931 ), 3932 numWidgetAreas 3933 ) }) }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [ 3934 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-widgets-welcome-guide__text", children: (0,external_wp_i18n_namespaceObject.__)( 3935 "You can now add any block to your site\u2019s widget areas. Don\u2019t worry, all of your favorite widgets still work flawlessly." 3936 ) }), 3937 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("p", { className: "edit-widgets-welcome-guide__text", children: [ 3938 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("strong", { children: (0,external_wp_i18n_namespaceObject.__)( 3939 "Want to stick with the old widgets?" 3940 ) }), 3941 " ", 3942 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3943 external_wp_components_namespaceObject.ExternalLink, 3944 { 3945 href: (0,external_wp_i18n_namespaceObject.__)( 3946 "https://wordpress.org/plugins/classic-widgets/" 3947 ), 3948 children: (0,external_wp_i18n_namespaceObject.__)( 3949 "Get the Classic Widgets plugin." 3950 ) 3951 } 3952 ) 3953 ] }) 3954 ] }) 3955 ] }) 3956 }, 3957 { 3958 image: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3959 WelcomeGuideImage, 3960 { 3961 nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-editor.svg", 3962 animatedSrc: "https://s.w.org/images/block-editor/welcome-editor.gif" 3963 } 3964 ), 3965 content: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [ 3966 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { className: "edit-widgets-welcome-guide__heading", children: (0,external_wp_i18n_namespaceObject.__)("Customize each block") }), 3967 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-widgets-welcome-guide__text", children: (0,external_wp_i18n_namespaceObject.__)( 3968 "Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected." 3969 ) }) 3970 ] }) 3971 }, 3972 { 3973 image: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3974 WelcomeGuideImage, 3975 { 3976 nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-library.svg", 3977 animatedSrc: "https://s.w.org/images/block-editor/welcome-library.gif" 3978 } 3979 ), 3980 content: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [ 3981 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { className: "edit-widgets-welcome-guide__heading", children: (0,external_wp_i18n_namespaceObject.__)("Explore all blocks") }), 3982 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-widgets-welcome-guide__text", children: (0,external_wp_element_namespaceObject.createInterpolateElement)( 3983 (0,external_wp_i18n_namespaceObject.__)( 3984 "All of the blocks available to you live in the block library. You\u2019ll find it wherever you see the <InserterIconImage /> icon." 3985 ), 3986 { 3987 InserterIconImage: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 3988 "img", 3989 { 3990 className: "edit-widgets-welcome-guide__inserter-icon", 3991 alt: (0,external_wp_i18n_namespaceObject.__)("inserter"), 3992 src: "data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A" 3993 } 3994 ) 3995 } 3996 ) }) 3997 ] }) 3998 }, 3999 { 4000 image: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 4001 WelcomeGuideImage, 4002 { 4003 nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.svg", 4004 animatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.gif" 4005 } 4006 ), 4007 content: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [ 4008 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { className: "edit-widgets-welcome-guide__heading", children: (0,external_wp_i18n_namespaceObject.__)("Learn more") }), 4009 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-widgets-welcome-guide__text", children: (0,external_wp_element_namespaceObject.createInterpolateElement)( 4010 (0,external_wp_i18n_namespaceObject.__)( 4011 "New to the block editor? Want to learn more about using it? <a>Here's a detailed guide.</a>" 4012 ), 4013 { 4014 a: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 4015 external_wp_components_namespaceObject.ExternalLink, 4016 { 4017 href: (0,external_wp_i18n_namespaceObject.__)( 4018 "https://wordpress.org/documentation/article/wordpress-block-editor/" 4019 ) 4020 } 4021 ) 4022 } 4023 ) }) 4024 ] }) 4025 } 4026 ] 4027 } 4028 ); 4029 } 4030 function WelcomeGuideImage({ nonAnimatedSrc, animatedSrc }) { 4031 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("picture", { className: "edit-widgets-welcome-guide__image", children: [ 4032 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 4033 "source", 4034 { 4035 srcSet: nonAnimatedSrc, 4036 media: "(prefers-reduced-motion: reduce)" 4037 } 4038 ), 4039 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { src: animatedSrc, width: "312", height: "240", alt: "" }) 4040 ] }); 4041 } 4042 4043 4044 ;// ./node_modules/@wordpress/edit-widgets/build-module/components/layout/index.js 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 function Layout({ blockEditorSettings }) { 4058 const { createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); 4059 function onPluginAreaError(name) { 4060 createErrorNotice( 4061 (0,external_wp_i18n_namespaceObject.sprintf)( 4062 /* translators: %s: plugin name */ 4063 (0,external_wp_i18n_namespaceObject.__)( 4064 'The "%s" plugin has encountered an error and cannot be rendered.' 4065 ), 4066 name 4067 ) 4068 ); 4069 } 4070 const navigateRegionsProps = (0,external_wp_components_namespaceObject.__unstableUseNavigateRegions)(); 4071 return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ErrorBoundary, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( 4072 "div", 4073 { 4074 className: navigateRegionsProps.className, 4075 ...navigateRegionsProps, 4076 ref: navigateRegionsProps.ref, 4077 children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)( 4078 WidgetAreasBlockEditorProvider, 4079 { 4080 blockEditorSettings, 4081 children: [ 4082 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(interface_default, { blockEditorSettings }), 4083 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Sidebar, {}), 4084 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_plugins_namespaceObject.PluginArea, { onError: onPluginAreaError }), 4085 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(UnsavedChangesWarning, {}), 4086 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuide, {}) 4087 ] 4088 } 4089 ) 4090 } 4091 ) }); 4092 } 4093 var layout_default = Layout; 4094 4095 4096 ;// ./node_modules/@wordpress/edit-widgets/build-module/index.js 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 const disabledBlocks = [ 4112 "core/more", 4113 "core/freeform", 4114 "core/template-part", 4115 ...ALLOW_REUSABLE_BLOCKS ? [] : ["core/block"] 4116 ]; 4117 function initializeEditor(id, settings) { 4118 const target = document.getElementById(id); 4119 const root = (0,external_wp_element_namespaceObject.createRoot)(target); 4120 const coreBlocks = (0,external_wp_blockLibrary_namespaceObject.__experimentalGetCoreBlocks)().filter((block) => { 4121 return !(disabledBlocks.includes(block.name) || block.name.startsWith("core/post") || block.name.startsWith("core/query") || block.name.startsWith("core/site") || block.name.startsWith("core/navigation")); 4122 }); 4123 (0,external_wp_data_namespaceObject.dispatch)(external_wp_preferences_namespaceObject.store).setDefaults("core/edit-widgets", { 4124 fixedToolbar: false, 4125 welcomeGuide: true, 4126 showBlockBreadcrumbs: true, 4127 themeStyles: true 4128 }); 4129 (0,external_wp_data_namespaceObject.dispatch)(external_wp_blocks_namespaceObject.store).reapplyBlockTypeFilters(); 4130 (0,external_wp_blockLibrary_namespaceObject.registerCoreBlocks)(coreBlocks); 4131 (0,external_wp_widgets_namespaceObject.registerLegacyWidgetBlock)(); 4132 if (false) {} 4133 (0,external_wp_widgets_namespaceObject.registerLegacyWidgetVariations)(settings); 4134 registerBlock(widget_area_namespaceObject); 4135 (0,external_wp_widgets_namespaceObject.registerWidgetGroupBlock)(); 4136 settings.__experimentalFetchLinkSuggestions = (search, searchOptions) => (0,external_wp_coreData_namespaceObject.__experimentalFetchLinkSuggestions)(search, searchOptions, settings); 4137 (0,external_wp_blocks_namespaceObject.setFreeformContentHandlerName)("core/html"); 4138 root.render( 4139 /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.StrictMode, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(layout_default, { blockEditorSettings: settings }) }) 4140 ); 4141 return root; 4142 } 4143 const initialize = initializeEditor; 4144 function reinitializeEditor() { 4145 external_wp_deprecated_default()("wp.editWidgets.reinitializeEditor", { 4146 since: "6.2", 4147 version: "6.3" 4148 }); 4149 } 4150 const registerBlock = (block) => { 4151 if (!block) { 4152 return; 4153 } 4154 const { metadata, settings, name } = block; 4155 if (metadata) { 4156 (0,external_wp_blocks_namespaceObject.unstable__bootstrapServerSideBlockDefinitions)({ [name]: metadata }); 4157 } 4158 (0,external_wp_blocks_namespaceObject.registerBlockType)(name, settings); 4159 }; 4160 4161 4162 4163 (window.wp = window.wp || {}).editWidgets = __webpack_exports__; 4164 /******/ })() 4165 ;
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated : Wed Oct 22 08:20:04 2025 | Cross-referenced by PHPXref |