2024-04-17 11:32:24 +02:00
/******/ ( ( ) => { // webpackBootstrap
2025-02-28 08:42:11 +01:00
/******/ "use strict" ;
/******/ // The require scope
/******/ var _ _webpack _require _ _ = { } ;
2022-06-16 14:03:35 +02:00
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
2024-04-17 11:32:24 +02:00
/******/ ( ( ) => {
2022-06-16 14:03:35 +02:00
/******/ // getDefaultExport function for compatibility with non-harmony modules
2024-04-17 11:32:24 +02:00
/******/ _ _webpack _require _ _ . n = ( module ) => {
2022-06-16 14:03:35 +02:00
/******/ var getter = module && module . _ _esModule ?
2024-04-17 11:32:24 +02:00
/******/ ( ) => ( module [ 'default' ] ) :
/******/ ( ) => ( module ) ;
2022-06-16 14:03:35 +02:00
/******/ _ _webpack _require _ _ . d ( getter , { a : getter } ) ;
/******/ return getter ;
/******/ } ;
2024-04-17 11:32:24 +02:00
/******/ } ) ( ) ;
2022-06-16 14:03:35 +02:00
/******/
/******/ /* webpack/runtime/define property getters */
2024-04-17 11:32:24 +02:00
/******/ ( ( ) => {
2022-06-16 14:03:35 +02:00
/******/ // define getter functions for harmony exports
2024-04-17 11:32:24 +02:00
/******/ _ _webpack _require _ _ . d = ( exports , definition ) => {
2022-06-16 14:03:35 +02:00
/******/ for ( var key in definition ) {
/******/ if ( _ _webpack _require _ _ . o ( definition , key ) && ! _ _webpack _require _ _ . o ( exports , key ) ) {
/******/ Object . defineProperty ( exports , key , { enumerable : true , get : definition [ key ] } ) ;
/******/ }
/******/ }
/******/ } ;
2024-04-17 11:32:24 +02:00
/******/ } ) ( ) ;
2022-06-16 14:03:35 +02:00
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
2024-04-17 11:32:24 +02:00
/******/ ( ( ) => {
/******/ _ _webpack _require _ _ . o = ( obj , prop ) => ( Object . prototype . hasOwnProperty . call ( obj , prop ) )
/******/ } ) ( ) ;
2022-06-16 14:03:35 +02:00
/******/
/******/ /* webpack/runtime/make namespace object */
2024-04-17 11:32:24 +02:00
/******/ ( ( ) => {
2022-06-16 14:03:35 +02:00
/******/ // define __esModule on exports
2024-04-17 11:32:24 +02:00
/******/ _ _webpack _require _ _ . r = ( exports ) => {
2022-06-16 14:03:35 +02:00
/******/ if ( typeof Symbol !== 'undefined' && Symbol . toStringTag ) {
/******/ Object . defineProperty ( exports , Symbol . toStringTag , { value : 'Module' } ) ;
/******/ }
/******/ Object . defineProperty ( exports , '__esModule' , { value : true } ) ;
/******/ } ;
2024-04-17 11:32:24 +02:00
/******/ } ) ( ) ;
2022-06-16 14:03:35 +02:00
/******/
/************************************************************************/
var _ _webpack _exports _ _ = { } ;
2021-07-23 11:58:50 +02:00
// ESM COMPAT FLAG
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
// EXPORTS
2022-06-16 14:03:35 +02:00
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , {
2024-04-17 11:32:24 +02:00
initialize : ( ) => ( /* binding */ initialize ) ,
initializeEditor : ( ) => ( /* binding */ initializeEditor ) ,
reinitializeEditor : ( ) => ( /* binding */ reinitializeEditor ) ,
store : ( ) => ( /* reexport */ store _store )
2022-06-16 14:03:35 +02:00
} ) ;
2021-07-23 11:58:50 +02:00
2022-06-16 14:03:35 +02:00
// NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/store/actions.js
2021-07-23 11:58:50 +02:00
var actions _namespaceObject = { } ;
_ _webpack _require _ _ . r ( actions _namespaceObject ) ;
2022-06-16 14:03:35 +02:00
_ _webpack _require _ _ . d ( actions _namespaceObject , {
2024-04-17 11:32:24 +02:00
closeModal : ( ) => ( closeModal ) ,
disableComplementaryArea : ( ) => ( disableComplementaryArea ) ,
enableComplementaryArea : ( ) => ( enableComplementaryArea ) ,
openModal : ( ) => ( openModal ) ,
pinItem : ( ) => ( pinItem ) ,
setDefaultComplementaryArea : ( ) => ( setDefaultComplementaryArea ) ,
setFeatureDefaults : ( ) => ( setFeatureDefaults ) ,
setFeatureValue : ( ) => ( setFeatureValue ) ,
toggleFeature : ( ) => ( toggleFeature ) ,
unpinItem : ( ) => ( unpinItem )
2022-06-16 14:03:35 +02:00
} ) ;
// NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/store/selectors.js
var selectors _namespaceObject = { } ;
_ _webpack _require _ _ . r ( selectors _namespaceObject ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , {
2024-04-17 11:32:24 +02:00
getActiveComplementaryArea : ( ) => ( getActiveComplementaryArea ) ,
isComplementaryAreaLoading : ( ) => ( isComplementaryAreaLoading ) ,
isFeatureActive : ( ) => ( isFeatureActive ) ,
isItemPinned : ( ) => ( isItemPinned ) ,
isModalActive : ( ) => ( isModalActive )
2022-06-16 14:03:35 +02:00
} ) ;
// NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/store/actions.js
var store _actions _namespaceObject = { } ;
_ _webpack _require _ _ . r ( store _actions _namespaceObject ) ;
_ _webpack _require _ _ . d ( store _actions _namespaceObject , {
2024-04-17 11:32:24 +02:00
closeGeneralSidebar : ( ) => ( closeGeneralSidebar ) ,
2025-12-12 13:15:55 +01:00
lockWidgetSaving : ( ) => ( lockWidgetSaving ) ,
2024-04-17 11:32:24 +02:00
moveBlockToWidgetArea : ( ) => ( moveBlockToWidgetArea ) ,
persistStubPost : ( ) => ( persistStubPost ) ,
saveEditedWidgetAreas : ( ) => ( saveEditedWidgetAreas ) ,
saveWidgetArea : ( ) => ( saveWidgetArea ) ,
saveWidgetAreas : ( ) => ( saveWidgetAreas ) ,
setIsInserterOpened : ( ) => ( setIsInserterOpened ) ,
setIsListViewOpened : ( ) => ( setIsListViewOpened ) ,
setIsWidgetAreaOpen : ( ) => ( setIsWidgetAreaOpen ) ,
setWidgetAreasOpenState : ( ) => ( setWidgetAreasOpenState ) ,
2025-12-12 13:15:55 +01:00
setWidgetIdForClientId : ( ) => ( setWidgetIdForClientId ) ,
unlockWidgetSaving : ( ) => ( unlockWidgetSaving )
2022-06-16 14:03:35 +02:00
} ) ;
2021-07-23 11:58:50 +02:00
// NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/store/resolvers.js
var resolvers _namespaceObject = { } ;
_ _webpack _require _ _ . r ( resolvers _namespaceObject ) ;
2022-06-16 14:03:35 +02:00
_ _webpack _require _ _ . d ( resolvers _namespaceObject , {
2024-04-17 11:32:24 +02:00
getWidgetAreas : ( ) => ( getWidgetAreas ) ,
getWidgets : ( ) => ( getWidgets )
2022-06-16 14:03:35 +02:00
} ) ;
2021-07-23 11:58:50 +02:00
// NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/store/selectors.js
2022-06-16 14:03:35 +02:00
var store _selectors _namespaceObject = { } ;
_ _webpack _require _ _ . r ( store _selectors _namespaceObject ) ;
_ _webpack _require _ _ . d ( store _selectors _namespaceObject , {
2024-04-17 11:32:24 +02:00
_ _experimentalGetInsertionPoint : ( ) => ( _ _experimentalGetInsertionPoint ) ,
canInsertBlockInWidgetArea : ( ) => ( canInsertBlockInWidgetArea ) ,
getEditedWidgetAreas : ( ) => ( getEditedWidgetAreas ) ,
getIsWidgetAreaOpen : ( ) => ( getIsWidgetAreaOpen ) ,
getParentWidgetAreaBlock : ( ) => ( getParentWidgetAreaBlock ) ,
getReferenceWidgetBlocks : ( ) => ( getReferenceWidgetBlocks ) ,
getWidget : ( ) => ( getWidget ) ,
getWidgetAreaForWidgetId : ( ) => ( getWidgetAreaForWidgetId ) ,
getWidgetAreas : ( ) => ( selectors _getWidgetAreas ) ,
getWidgets : ( ) => ( selectors _getWidgets ) ,
isInserterOpened : ( ) => ( isInserterOpened ) ,
isListViewOpened : ( ) => ( isListViewOpened ) ,
2025-12-12 13:15:55 +01:00
isSavingWidgetAreas : ( ) => ( isSavingWidgetAreas ) ,
isWidgetSavingLocked : ( ) => ( isWidgetSavingLocked )
2024-04-17 11:32:24 +02:00
} ) ;
// NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/store/private-selectors.js
var private _selectors _namespaceObject = { } ;
_ _webpack _require _ _ . r ( private _selectors _namespaceObject ) ;
_ _webpack _require _ _ . d ( private _selectors _namespaceObject , {
2025-02-28 08:42:11 +01:00
getInserterSidebarToggleRef : ( ) => ( getInserterSidebarToggleRef ) ,
2024-04-17 11:32:24 +02:00
getListViewToggleRef : ( ) => ( getListViewToggleRef )
2022-06-16 14:03:35 +02:00
} ) ;
2021-07-23 11:58:50 +02:00
// NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/blocks/widget-area/index.js
var widget _area _namespaceObject = { } ;
_ _webpack _require _ _ . r ( widget _area _namespaceObject ) ;
2022-06-16 14:03:35 +02:00
_ _webpack _require _ _ . d ( widget _area _namespaceObject , {
2025-12-12 13:15:55 +01:00
metadata : ( ) => ( block _namespaceObject ) ,
2024-04-17 11:32:24 +02:00
name : ( ) => ( widget _area _name ) ,
settings : ( ) => ( settings )
2022-06-16 14:03:35 +02:00
} ) ;
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
; // external "ReactJSXRuntime"
const external _ReactJSXRuntime _namespaceObject = window [ "ReactJSXRuntime" ] ;
2025-04-25 12:30:07 +02:00
; // external ["wp","blocks"]
2024-04-17 11:32:24 +02:00
const external _wp _blocks _namespaceObject = window [ "wp" ] [ "blocks" ] ;
2025-04-25 12:30:07 +02:00
; // external ["wp","data"]
2024-04-17 11:32:24 +02:00
const external _wp _data _namespaceObject = window [ "wp" ] [ "data" ] ;
2025-04-25 12:30:07 +02:00
; // external ["wp","deprecated"]
2024-04-17 11:32:24 +02:00
const external _wp _deprecated _namespaceObject = window [ "wp" ] [ "deprecated" ] ;
2023-04-26 17:39:43 +02:00
var external _wp _deprecated _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( external _wp _deprecated _namespaceObject ) ;
2025-04-25 12:30:07 +02:00
; // external ["wp","element"]
2024-04-17 11:32:24 +02:00
const external _wp _element _namespaceObject = window [ "wp" ] [ "element" ] ;
2025-04-25 12:30:07 +02:00
; // external ["wp","blockLibrary"]
2024-04-17 11:32:24 +02:00
const external _wp _blockLibrary _namespaceObject = window [ "wp" ] [ "blockLibrary" ] ;
2025-04-25 12:30:07 +02:00
; // external ["wp","coreData"]
2024-04-17 11:32:24 +02:00
const external _wp _coreData _namespaceObject = window [ "wp" ] [ "coreData" ] ;
2025-04-25 12:30:07 +02:00
; // external ["wp","widgets"]
2024-04-17 11:32:24 +02:00
const external _wp _widgets _namespaceObject = window [ "wp" ] [ "widgets" ] ;
2025-04-25 12:30:07 +02:00
; // external ["wp","preferences"]
2024-04-17 11:32:24 +02:00
const external _wp _preferences _namespaceObject = window [ "wp" ] [ "preferences" ] ;
2025-04-25 12:30:07 +02:00
; // external ["wp","apiFetch"]
2024-04-17 11:32:24 +02:00
const external _wp _apiFetch _namespaceObject = window [ "wp" ] [ "apiFetch" ] ;
2022-06-16 14:03:35 +02:00
var external _wp _apiFetch _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( external _wp _apiFetch _namespaceObject ) ;
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/edit-widgets/build-module/store/reducer.js
2025-12-12 13:15:55 +01:00
2023-09-26 10:33:34 +02:00
function widgetAreasOpenState ( state = { } , action ) {
2025-12-12 13:15:55 +01:00
const { type } = action ;
2021-07-23 11:58:50 +02:00
switch ( type ) {
2025-12-12 13:15:55 +01:00
case "SET_WIDGET_AREAS_OPEN_STATE" : {
return action . widgetAreasOpenState ;
}
case "SET_IS_WIDGET_AREA_OPEN" : {
const { clientId , isOpen } = action ;
return {
... state ,
[ clientId ] : isOpen
} ;
}
default : {
return state ;
}
2021-07-23 11:58:50 +02:00
}
}
2023-09-26 10:33:34 +02:00
function blockInserterPanel ( state = false , action ) {
2021-07-23 11:58:50 +02:00
switch ( action . type ) {
2025-12-12 13:15:55 +01:00
case "SET_IS_LIST_VIEW_OPENED" :
2022-04-02 10:26:41 +02:00
return action . isOpen ? false : state ;
2025-12-12 13:15:55 +01:00
case "SET_IS_INSERTER_OPENED" :
2021-07-23 11:58:50 +02:00
return action . value ;
}
return state ;
}
2023-09-26 10:33:34 +02:00
function listViewPanel ( state = false , action ) {
2022-04-02 10:26:41 +02:00
switch ( action . type ) {
2025-12-12 13:15:55 +01:00
case "SET_IS_INSERTER_OPENED" :
2022-04-02 10:26:41 +02:00
return action . value ? false : state ;
2025-12-12 13:15:55 +01:00
case "SET_IS_LIST_VIEW_OPENED" :
2022-04-02 10:26:41 +02:00
return action . isOpen ;
2021-07-23 11:58:50 +02:00
}
2022-04-02 10:26:41 +02:00
return state ;
}
2025-12-12 13:15:55 +01:00
function listViewToggleRef ( state = { current : null } ) {
2024-04-17 11:32:24 +02:00
return state ;
}
2025-12-12 13:15:55 +01:00
function inserterSidebarToggleRef ( state = { current : null } ) {
2025-02-28 08:42:11 +01:00
return state ;
}
2025-12-12 13:15:55 +01:00
function widgetSavingLock ( state = { } , action ) {
switch ( action . type ) {
case "LOCK_WIDGET_SAVING" :
return { ... state , [ action . lockName ] : true } ;
case "UNLOCK_WIDGET_SAVING" : {
const { [ action . lockName ] : removedLockName , ... restState } = state ;
return restState ;
}
}
return state ;
}
var reducer _default = ( 0 , external _wp _data _namespaceObject . combineReducers ) ( {
2021-07-23 11:58:50 +02:00
blockInserterPanel ,
2025-02-28 08:42:11 +01:00
inserterSidebarToggleRef ,
2022-04-02 10:26:41 +02:00
listViewPanel ,
2025-02-28 08:42:11 +01:00
listViewToggleRef ,
2025-12-12 13:15:55 +01:00
widgetAreasOpenState ,
widgetSavingLock
} ) ;
2021-07-23 11:58:50 +02:00
2025-04-25 12:30:07 +02:00
; // external ["wp","i18n"]
2024-04-17 11:32:24 +02:00
const external _wp _i18n _namespaceObject = window [ "wp" ] [ "i18n" ] ;
2025-04-25 12:30:07 +02:00
; // external ["wp","notices"]
2024-04-17 11:32:24 +02:00
const external _wp _notices _namespaceObject = window [ "wp" ] [ "notices" ] ;
2025-04-25 12:30:07 +02:00
; // ./node_modules/clsx/dist/clsx.mjs
2025-02-28 08:42:11 +01:00
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 ) ;
2025-04-25 12:30:07 +02:00
; // external ["wp","components"]
2024-04-17 11:32:24 +02:00
const external _wp _components _namespaceObject = window [ "wp" ] [ "components" ] ;
2025-04-25 12:30:07 +02:00
; // external ["wp","primitives"]
2024-04-17 11:32:24 +02:00
const external _wp _primitives _namespaceObject = window [ "wp" ] [ "primitives" ] ;
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/icons/build-module/library/check.js
2022-04-02 10:26:41 +02:00
2025-02-28 08:42:11 +01:00
2025-12-12 13:15:55 +01:00
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" } ) } ) ;
2022-06-16 14:03:35 +02:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/icons/build-module/library/star-filled.js
2022-04-02 10:26:41 +02:00
2025-02-28 08:42:11 +01:00
2025-12-12 13:15:55 +01:00
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" } ) } ) ;
2022-04-02 10:26:41 +02:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/icons/build-module/library/star-empty.js
2022-04-02 10:26:41 +02:00
2025-02-28 08:42:11 +01:00
2025-12-12 13:15:55 +01:00
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 ) (
external _wp _primitives _namespaceObject . Path ,
{
2025-02-28 08:42:11 +01:00
fillRule : "evenodd" ,
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" ,
clipRule : "evenodd"
2025-12-12 13:15:55 +01:00
}
) } ) ;
2022-04-02 10:26:41 +02:00
2025-04-25 12:30:07 +02:00
; // external ["wp","viewport"]
2024-04-17 11:32:24 +02:00
const external _wp _viewport _namespaceObject = window [ "wp" ] [ "viewport" ] ;
2025-04-25 12:30:07 +02:00
; // external ["wp","compose"]
2025-02-28 08:42:11 +01:00
const external _wp _compose _namespaceObject = window [ "wp" ] [ "compose" ] ;
2025-04-25 12:30:07 +02:00
; // external ["wp","plugins"]
const external _wp _plugins _namespaceObject = window [ "wp" ] [ "plugins" ] ;
; // ./node_modules/@wordpress/icons/build-module/library/close-small.js
2021-07-23 11:58:50 +02:00
2025-02-28 08:42:11 +01:00
2025-12-12 13:15:55 +01:00
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" } ) } ) ;
2022-06-16 14:03:35 +02:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/interface/build-module/store/deprecated.js
2025-02-28 08:42:11 +01:00
function normalizeComplementaryAreaScope ( scope ) {
2025-12-12 13:15:55 +01:00
if ( [ "core/edit-post" , "core/edit-site" ] . includes ( scope ) ) {
2025-02-28 08:42:11 +01:00
external _wp _deprecated _default ( ) ( ` ${ scope } interface scope ` , {
2025-12-12 13:15:55 +01:00
alternative : "core interface scope" ,
hint : "core/edit-post and core/edit-site are merging." ,
version : "6.6"
2025-02-28 08:42:11 +01:00
} ) ;
2025-12-12 13:15:55 +01:00
return "core" ;
2025-02-28 08:42:11 +01:00
}
return scope ;
}
function normalizeComplementaryAreaName ( scope , name ) {
2025-12-12 13:15:55 +01:00
if ( scope === "core" && name === "edit-site/template" ) {
2025-02-28 08:42:11 +01:00
external _wp _deprecated _default ( ) ( ` edit-site/template sidebar ` , {
2025-12-12 13:15:55 +01:00
alternative : "edit-post/document" ,
version : "6.6"
2025-02-28 08:42:11 +01:00
} ) ;
2025-12-12 13:15:55 +01:00
return "edit-post/document" ;
2025-02-28 08:42:11 +01:00
}
2025-12-12 13:15:55 +01:00
if ( scope === "core" && name === "edit-site/block-inspector" ) {
2025-02-28 08:42:11 +01:00
external _wp _deprecated _default ( ) ( ` edit-site/block-inspector sidebar ` , {
2025-12-12 13:15:55 +01:00
alternative : "edit-post/block" ,
version : "6.6"
2025-02-28 08:42:11 +01:00
} ) ;
2025-12-12 13:15:55 +01:00
return "edit-post/block" ;
2025-02-28 08:42:11 +01:00
}
return name ;
}
2022-06-16 14:03:35 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/interface/build-module/store/actions.js
2023-12-07 09:44:11 +01:00
2025-02-28 08:42:11 +01:00
const setDefaultComplementaryArea = ( scope , area ) => {
scope = normalizeComplementaryAreaScope ( scope ) ;
area = normalizeComplementaryAreaName ( scope , area ) ;
return {
2025-12-12 13:15:55 +01:00
type : "SET_DEFAULT_COMPLEMENTARY_AREA" ,
2025-02-28 08:42:11 +01:00
scope ,
area
} ;
} ;
2025-12-12 13:15:55 +01:00
const enableComplementaryArea = ( scope , area ) => ( { registry , dispatch } ) => {
2022-06-16 14:03:35 +02:00
if ( ! area ) {
return ;
}
2025-02-28 08:42:11 +01:00
scope = normalizeComplementaryAreaScope ( scope ) ;
area = normalizeComplementaryAreaName ( scope , area ) ;
2025-12-12 13:15:55 +01:00
const isComplementaryAreaVisible = registry . select ( external _wp _preferences _namespaceObject . store ) . get ( scope , "isComplementaryAreaVisible" ) ;
2022-12-15 17:47:31 +01:00
if ( ! isComplementaryAreaVisible ) {
2025-12-12 13:15:55 +01:00
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . set ( scope , "isComplementaryAreaVisible" , true ) ;
2022-12-15 17:47:31 +01:00
}
dispatch ( {
2025-12-12 13:15:55 +01:00
type : "ENABLE_COMPLEMENTARY_AREA" ,
2022-12-15 17:47:31 +01:00
scope ,
area
} ) ;
2022-06-16 14:03:35 +02:00
} ;
2025-12-12 13:15:55 +01:00
const disableComplementaryArea = ( scope ) => ( { registry } ) => {
2025-02-28 08:42:11 +01:00
scope = normalizeComplementaryAreaScope ( scope ) ;
2025-12-12 13:15:55 +01:00
const isComplementaryAreaVisible = registry . select ( external _wp _preferences _namespaceObject . store ) . get ( scope , "isComplementaryAreaVisible" ) ;
2022-12-15 17:47:31 +01:00
if ( isComplementaryAreaVisible ) {
2025-12-12 13:15:55 +01:00
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . set ( scope , "isComplementaryAreaVisible" , false ) ;
2022-12-15 17:47:31 +01:00
}
2022-06-16 14:03:35 +02:00
} ;
2025-12-12 13:15:55 +01:00
const pinItem = ( scope , item ) => ( { registry } ) => {
2022-06-16 14:03:35 +02:00
if ( ! item ) {
return ;
}
2025-02-28 08:42:11 +01:00
scope = normalizeComplementaryAreaScope ( scope ) ;
item = normalizeComplementaryAreaName ( scope , item ) ;
2025-12-12 13:15:55 +01:00
const pinnedItems = registry . select ( external _wp _preferences _namespaceObject . store ) . get ( scope , "pinnedItems" ) ;
2023-09-26 10:33:34 +02:00
if ( pinnedItems ? . [ item ] === true ) {
2022-06-16 14:03:35 +02:00
return ;
}
2025-12-12 13:15:55 +01:00
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . set ( scope , "pinnedItems" , {
2023-12-07 09:44:11 +01:00
... pinnedItems ,
2022-06-16 14:03:35 +02:00
[ item ] : true
} ) ;
} ;
2025-12-12 13:15:55 +01:00
const unpinItem = ( scope , item ) => ( { registry } ) => {
2022-06-16 14:03:35 +02:00
if ( ! item ) {
return ;
}
2025-02-28 08:42:11 +01:00
scope = normalizeComplementaryAreaScope ( scope ) ;
item = normalizeComplementaryAreaName ( scope , item ) ;
2025-12-12 13:15:55 +01:00
const pinnedItems = registry . select ( external _wp _preferences _namespaceObject . store ) . get ( scope , "pinnedItems" ) ;
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . set ( scope , "pinnedItems" , {
2023-12-07 09:44:11 +01:00
... pinnedItems ,
2022-06-16 14:03:35 +02:00
[ item ] : false
} ) ;
} ;
function toggleFeature ( scope , featureName ) {
2025-12-12 13:15:55 +01:00
return function ( { registry } ) {
2022-06-16 14:03:35 +02:00
external _wp _deprecated _default ( ) ( ` dispatch( 'core/interface' ).toggleFeature ` , {
2025-12-12 13:15:55 +01:00
since : "6.0" ,
2022-06-16 14:03:35 +02:00
alternative : ` dispatch( 'core/preferences' ).toggle `
} ) ;
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . toggle ( scope , featureName ) ;
2021-07-23 11:58:50 +02:00
} ;
}
2022-06-16 14:03:35 +02:00
function setFeatureValue ( scope , featureName , value ) {
2025-12-12 13:15:55 +01:00
return function ( { registry } ) {
2022-06-16 14:03:35 +02:00
external _wp _deprecated _default ( ) ( ` dispatch( 'core/interface' ).setFeatureValue ` , {
2025-12-12 13:15:55 +01:00
since : "6.0" ,
2022-06-16 14:03:35 +02:00
alternative : ` dispatch( 'core/preferences' ).set `
} ) ;
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . set ( scope , featureName , ! ! value ) ;
2021-07-23 11:58:50 +02:00
} ;
}
2022-06-16 14:03:35 +02:00
function setFeatureDefaults ( scope , defaults ) {
2025-12-12 13:15:55 +01:00
return function ( { registry } ) {
2022-06-16 14:03:35 +02:00
external _wp _deprecated _default ( ) ( ` dispatch( 'core/interface' ).setFeatureDefaults ` , {
2025-12-12 13:15:55 +01:00
since : "6.0" ,
2022-06-16 14:03:35 +02:00
alternative : ` dispatch( 'core/preferences' ).setDefaults `
} ) ;
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . setDefaults ( scope , defaults ) ;
} ;
}
2023-09-26 10:33:34 +02:00
function openModal ( name ) {
return {
2025-12-12 13:15:55 +01:00
type : "OPEN_MODAL" ,
2023-09-26 10:33:34 +02:00
name
} ;
}
function closeModal ( ) {
return {
2025-12-12 13:15:55 +01:00
type : "CLOSE_MODAL"
2023-09-26 10:33:34 +02:00
} ;
}
2021-07-23 11:58:50 +02:00
2022-06-16 14:03:35 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/interface/build-module/store/selectors.js
2023-12-07 09:44:11 +01:00
2025-02-28 08:42:11 +01:00
2023-12-07 09:44:11 +01:00
2025-12-12 13:15:55 +01:00
const getActiveComplementaryArea = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) (
( select ) => ( state , scope ) => {
scope = normalizeComplementaryAreaScope ( scope ) ;
const isComplementaryAreaVisible = select ( external _wp _preferences _namespaceObject . store ) . get (
scope ,
"isComplementaryAreaVisible"
) ;
if ( isComplementaryAreaVisible === void 0 ) {
return void 0 ;
}
if ( isComplementaryAreaVisible === false ) {
return null ;
}
return state ? . complementaryAreas ? . [ scope ] ;
2023-12-07 09:44:11 +01:00
}
2025-12-12 13:15:55 +01:00
) ;
const isComplementaryAreaLoading = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) (
( select ) => ( state , scope ) => {
scope = normalizeComplementaryAreaScope ( scope ) ;
const isVisible = select ( external _wp _preferences _namespaceObject . store ) . get (
scope ,
"isComplementaryAreaVisible"
) ;
const identifier = state ? . complementaryAreas ? . [ scope ] ;
return isVisible && identifier === void 0 ;
2022-12-15 17:47:31 +01:00
}
2025-12-12 13:15:55 +01:00
) ;
const isItemPinned = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) (
( select ) => ( state , scope , item ) => {
scope = normalizeComplementaryAreaScope ( scope ) ;
item = normalizeComplementaryAreaName ( scope , item ) ;
const pinnedItems = select ( external _wp _preferences _namespaceObject . store ) . get (
scope ,
"pinnedItems"
) ;
return pinnedItems ? . [ item ] ? ? true ;
}
) ;
const isFeatureActive = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) (
( select ) => ( state , scope , featureName ) => {
external _wp _deprecated _default ( ) (
` select( 'core/interface' ).isFeatureActive( scope, featureName ) ` ,
{
since : "6.0" ,
alternative : ` select( 'core/preferences' ).get( scope, featureName ) `
}
) ;
return ! ! select ( external _wp _preferences _namespaceObject . store ) . get ( scope , featureName ) ;
}
) ;
2023-09-26 10:33:34 +02:00
function isModalActive ( state , modalName ) {
return state . activeModal === modalName ;
}
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/interface/build-module/store/reducer.js
2022-12-15 17:47:31 +01:00
2023-09-26 10:33:34 +02:00
function complementaryAreas ( state = { } , action ) {
2022-12-15 17:47:31 +01:00
switch ( action . type ) {
2025-12-12 13:15:55 +01:00
case "SET_DEFAULT_COMPLEMENTARY_AREA" : {
const { scope , area } = action ;
if ( state [ scope ] ) {
return state ;
2022-12-15 17:47:31 +01:00
}
2025-12-12 13:15:55 +01:00
return {
... state ,
[ scope ] : area
} ;
}
case "ENABLE_COMPLEMENTARY_AREA" : {
const { scope , area } = action ;
return {
... state ,
[ scope ] : area
} ;
}
2022-12-15 17:47:31 +01:00
}
return state ;
}
2023-09-26 10:33:34 +02:00
function activeModal ( state = null , action ) {
switch ( action . type ) {
2025-12-12 13:15:55 +01:00
case "OPEN_MODAL" :
2023-09-26 10:33:34 +02:00
return action . name ;
2025-12-12 13:15:55 +01:00
case "CLOSE_MODAL" :
2023-09-26 10:33:34 +02:00
return null ;
}
return state ;
}
2025-12-12 13:15:55 +01:00
var reducer _reducer _default = ( 0 , external _wp _data _namespaceObject . combineReducers ) ( {
2023-09-26 10:33:34 +02:00
complementaryAreas ,
activeModal
2025-12-12 13:15:55 +01:00
} ) ;
2022-12-15 17:47:31 +01:00
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/interface/build-module/store/constants.js
const STORE _NAME = "core/interface" ;
2021-07-23 11:58:50 +02:00
2023-12-07 09:44:11 +01:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/interface/build-module/store/index.js
2021-07-23 11:58:50 +02:00
2022-12-15 17:47:31 +01:00
2022-06-16 14:03:35 +02:00
const store = ( 0 , external _wp _data _namespaceObject . createReduxStore ) ( STORE _NAME , {
2025-12-12 13:15:55 +01:00
reducer : reducer _reducer _default ,
2022-06-16 14:03:35 +02:00
actions : actions _namespaceObject ,
selectors : selectors _namespaceObject
2023-12-07 09:44:11 +01:00
} ) ;
2022-06-16 14:03:35 +02:00
( 0 , external _wp _data _namespaceObject . register ) ( store ) ;
2022-04-02 10:26:41 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/interface/build-module/components/complementary-area-toggle/index.js
2022-04-02 10:26:41 +02:00
2023-12-07 09:44:11 +01:00
2021-07-23 11:58:50 +02:00
2025-02-28 08:42:11 +01:00
function roleSupportsCheckedState ( role ) {
2025-12-12 13:15:55 +01:00
return [
"checkbox" ,
"option" ,
"radio" ,
"switch" ,
"menuitemcheckbox" ,
"menuitemradio" ,
"treeitem"
] . includes ( role ) ;
2025-02-28 08:42:11 +01:00
}
2023-09-26 10:33:34 +02:00
function ComplementaryAreaToggle ( {
as = external _wp _components _namespaceObject . Button ,
scope ,
2025-04-25 12:30:07 +02:00
identifier : identifierProp ,
icon : iconProp ,
2023-09-26 10:33:34 +02:00
selectedIcon ,
name ,
2025-02-28 08:42:11 +01:00
shortcut ,
2023-09-26 10:33:34 +02:00
... props
} ) {
2022-06-16 14:03:35 +02:00
const ComponentToUse = as ;
2025-04-25 12:30:07 +02:00
const context = ( 0 , external _wp _plugins _namespaceObject . usePluginContext ) ( ) ;
const icon = iconProp || context . icon ;
const identifier = identifierProp || ` ${ context . name } / ${ name } ` ;
2025-12-12 13:15:55 +01:00
const isSelected = ( 0 , external _wp _data _namespaceObject . useSelect ) (
( select ) => select ( store ) . getActiveComplementaryArea ( scope ) === identifier ,
[ identifier , scope ]
) ;
const { enableComplementaryArea , disableComplementaryArea } = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store ) ;
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
ComponentToUse ,
{
icon : selectedIcon && isSelected ? selectedIcon : icon ,
"aria-controls" : identifier . replace ( "/" , ":" ) ,
"aria-checked" : roleSupportsCheckedState ( props . role ) ? isSelected : void 0 ,
onClick : ( ) => {
if ( isSelected ) {
disableComplementaryArea ( scope ) ;
} else {
enableComplementaryArea ( scope , identifier ) ;
}
} ,
shortcut ,
... props
}
) ;
2022-06-16 14:03:35 +02:00
}
2021-07-23 11:58:50 +02:00
2023-12-07 09:44:11 +01:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/interface/build-module/components/complementary-area-header/index.js
2021-07-23 11:58:50 +02:00
2025-02-28 08:42:11 +01:00
2023-09-26 10:33:34 +02:00
const ComplementaryAreaHeader = ( {
children ,
className ,
toggleButtonProps
} ) => {
2025-12-12 13:15:55 +01:00
const toggleButton = /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( ComplementaryAreaToggle , { icon : close _small _default , ... toggleButtonProps } ) ;
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) (
"div" ,
{
className : dist _clsx (
"components-panel__header" ,
"interface-complementary-area-header" ,
className
) ,
tabIndex : - 1 ,
children : [
children ,
toggleButton
]
}
) ;
2022-04-02 10:26:41 +02:00
} ;
2025-12-12 13:15:55 +01:00
var complementary _area _header _default = ComplementaryAreaHeader ;
2021-07-23 11:58:50 +02:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/interface/build-module/components/action-item/index.js
2021-07-23 11:58:50 +02:00
2025-02-28 08:42:11 +01:00
2025-12-12 13:15:55 +01:00
const noop = ( ) => {
} ;
2023-09-26 10:33:34 +02:00
function ActionItemSlot ( {
name ,
2025-04-25 12:30:07 +02:00
as : Component = external _wp _components _namespaceObject . MenuGroup ,
2023-09-26 10:33:34 +02:00
fillProps = { } ,
bubblesVirtually ,
... props
} ) {
2025-12-12 13:15:55 +01:00
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _components _namespaceObject . Slot ,
{
name ,
bubblesVirtually ,
fillProps ,
children : ( fills ) => {
if ( ! external _wp _element _namespaceObject . Children . toArray ( fills ) . length ) {
2025-02-28 08:42:11 +01:00
return null ;
}
2025-12-12 13:15:55 +01:00
const initializedByPlugins = [ ] ;
external _wp _element _namespaceObject . Children . forEach (
fills ,
( {
props : { _ _unstableExplicitMenuItem , _ _unstableTarget }
} ) => {
if ( _ _unstableTarget && _ _unstableExplicitMenuItem ) {
initializedByPlugins . push ( _ _unstableTarget ) ;
}
}
) ;
const children = external _wp _element _namespaceObject . Children . map ( fills , ( child ) => {
if ( ! child . props . _ _unstableExplicitMenuItem && initializedByPlugins . includes (
child . props . _ _unstableTarget
) ) {
return null ;
}
return child ;
} ) ;
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( Component , { ... props , children } ) ;
}
2025-02-28 08:42:11 +01:00
}
2025-12-12 13:15:55 +01:00
) ;
2022-06-16 14:03:35 +02:00
}
2025-12-12 13:15:55 +01:00
function ActionItem ( { name , as : Component = external _wp _components _namespaceObject . Button , onClick , ... props } ) {
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _components _namespaceObject . Fill , { name , children : ( { onClick : fpOnClick } ) => {
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
Component ,
{
2025-02-28 08:42:11 +01:00
onClick : onClick || fpOnClick ? ( ... args ) => {
( onClick || noop ) ( ... args ) ;
( fpOnClick || noop ) ( ... args ) ;
2025-12-12 13:15:55 +01:00
} : void 0 ,
2025-02-28 08:42:11 +01:00
... props
2025-12-12 13:15:55 +01:00
}
) ;
} } ) ;
2022-06-16 14:03:35 +02:00
}
ActionItem . Slot = ActionItemSlot ;
2025-12-12 13:15:55 +01:00
var action _item _default = ActionItem ;
2022-06-16 14:03:35 +02:00
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/interface/build-module/components/complementary-area-more-menu-item/index.js
2021-07-23 11:58:50 +02:00
2023-12-07 09:44:11 +01:00
2021-07-23 11:58:50 +02:00
2025-02-28 08:42:11 +01:00
2023-09-26 10:33:34 +02:00
const PluginsMenuItem = ( {
// Menu item is marked with unstable prop for backward compatibility.
// They are removed so they don't leak to DOM elements.
// @see https://github.com/WordPress/gutenberg/issues/14457
_ _unstableExplicitMenuItem ,
_ _unstableTarget ,
... restProps
2025-12-12 13:15:55 +01:00
} ) => /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _components _namespaceObject . MenuItem , { ... restProps } ) ;
2023-09-26 10:33:34 +02:00
function ComplementaryAreaMoreMenuItem ( {
scope ,
target ,
_ _unstableExplicitMenuItem ,
... props
} ) {
2025-12-12 13:15:55 +01:00
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
ComplementaryAreaToggle ,
{
as : ( toggleProps ) => {
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
action _item _default ,
{
_ _unstableExplicitMenuItem ,
_ _unstableTarget : ` ${ scope } / ${ target } ` ,
as : PluginsMenuItem ,
name : ` ${ scope } /plugin-more-menu ` ,
... toggleProps
}
) ;
} ,
role : "menuitemcheckbox" ,
selectedIcon : check _default ,
name : target ,
scope ,
... props
}
) ;
2022-06-16 14:03:35 +02:00
}
2022-04-02 10:26:41 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/interface/build-module/components/pinned-items/index.js
2023-12-07 09:44:11 +01:00
2021-07-23 11:58:50 +02:00
2025-02-28 08:42:11 +01:00
2025-12-12 13:15:55 +01:00
function PinnedItems ( { scope , ... props } ) {
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _components _namespaceObject . Fill , { name : ` PinnedItems/ ${ scope } ` , ... props } ) ;
2022-06-16 14:03:35 +02:00
}
2025-12-12 13:15:55 +01:00
function PinnedItemsSlot ( { scope , className , ... props } ) {
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 ) (
"div" ,
{
className : dist _clsx (
className ,
"interface-pinned-items"
) ,
2025-02-28 08:42:11 +01:00
children : fills
2025-12-12 13:15:55 +01:00
}
) } ) ;
2022-06-16 14:03:35 +02:00
}
PinnedItems . Slot = PinnedItemsSlot ;
2025-12-12 13:15:55 +01:00
var pinned _items _default = PinnedItems ;
2021-07-23 11:58:50 +02:00
2023-12-07 09:44:11 +01:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/interface/build-module/components/complementary-area/index.js
2022-04-02 10:26:41 +02:00
2021-07-23 11:58:50 +02:00
2022-06-16 14:03:35 +02:00
2024-04-17 11:32:24 +02:00
2025-02-28 08:42:11 +01:00
2025-04-25 12:30:07 +02:00
2021-07-23 11:58:50 +02:00
2025-02-28 08:42:11 +01:00
const ANIMATION _DURATION = 0.3 ;
2025-12-12 13:15:55 +01:00
function ComplementaryAreaSlot ( { scope , ... props } ) {
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _components _namespaceObject . Slot , { name : ` ComplementaryArea/ ${ scope } ` , ... props } ) ;
2022-06-16 14:03:35 +02:00
}
2025-02-28 08:42:11 +01:00
const SIDEBAR _WIDTH = 280 ;
const variants = {
2025-12-12 13:15:55 +01:00
open : { width : SIDEBAR _WIDTH } ,
closed : { width : 0 } ,
mobileOpen : { width : "100vw" }
2025-02-28 08:42:11 +01:00
} ;
2023-09-26 10:33:34 +02:00
function ComplementaryAreaFill ( {
2025-02-28 08:42:11 +01:00
activeArea ,
isActive ,
2023-09-26 10:33:34 +02:00
scope ,
children ,
2023-12-07 09:44:11 +01:00
className ,
id
2023-09-26 10:33:34 +02:00
} ) {
2025-02-28 08:42:11 +01:00
const disableMotion = ( 0 , external _wp _compose _namespaceObject . useReducedMotion ) ( ) ;
2025-12-12 13:15:55 +01:00
const isMobileViewport = ( 0 , external _wp _compose _namespaceObject . useViewportMatch ) ( "medium" , "<" ) ;
2025-02-28 08:42:11 +01:00
const previousActiveArea = ( 0 , external _wp _compose _namespaceObject . usePrevious ) ( activeArea ) ;
const previousIsActive = ( 0 , external _wp _compose _namespaceObject . usePrevious ) ( isActive ) ;
const [ , setState ] = ( 0 , external _wp _element _namespaceObject . useState ) ( { } ) ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
setState ( { } ) ;
} , [ isActive ] ) ;
const transition = {
2025-12-12 13:15:55 +01:00
type : "tween" ,
2025-02-28 08:42:11 +01:00
duration : disableMotion || isMobileViewport || ! ! previousActiveArea && ! ! activeArea && activeArea !== previousActiveArea ? 0 : ANIMATION _DURATION ,
ease : [ 0.6 , 0 , 0.4 , 1 ]
} ;
2025-12-12 13:15:55 +01:00
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 ) (
external _wp _components _namespaceObject . _ _unstableMotion . div ,
{
variants ,
initial : "closed" ,
animate : isMobileViewport ? "mobileOpen" : "open" ,
exit : "closed" ,
transition ,
className : "interface-complementary-area__fill" ,
children : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
"div" ,
{
id ,
className ,
2025-02-28 08:42:11 +01:00
style : {
2025-12-12 13:15:55 +01:00
width : isMobileViewport ? "100vw" : SIDEBAR _WIDTH
2025-02-28 08:42:11 +01:00
} ,
2025-12-12 13:15:55 +01:00
children
}
)
}
) } ) } ) ;
2022-06-16 14:03:35 +02:00
}
function useAdjustComplementaryListener ( scope , identifier , activeArea , isActive , isSmall ) {
2025-02-28 08:42:11 +01:00
const previousIsSmallRef = ( 0 , external _wp _element _namespaceObject . useRef ) ( false ) ;
const shouldOpenWhenNotSmallRef = ( 0 , external _wp _element _namespaceObject . useRef ) ( false ) ;
2025-12-12 13:15:55 +01:00
const { enableComplementaryArea , disableComplementaryArea } = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store ) ;
2022-06-16 14:03:35 +02:00
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
2025-02-28 08:42:11 +01:00
if ( isActive && isSmall && ! previousIsSmallRef . current ) {
2023-12-07 09:44:11 +01:00
disableComplementaryArea ( scope ) ;
2025-02-28 08:42:11 +01:00
shouldOpenWhenNotSmallRef . current = true ;
2023-12-07 09:44:11 +01:00
} else if (
2025-12-12 13:15:55 +01:00
// If there is a flag indicating the complementary area should be
// enabled when we go from small to big window size and we are going
// from a small to big window size.
shouldOpenWhenNotSmallRef . current && ! isSmall && previousIsSmallRef . current
) {
2025-02-28 08:42:11 +01:00
shouldOpenWhenNotSmallRef . current = false ;
2022-06-16 14:03:35 +02:00
enableComplementaryArea ( scope , identifier ) ;
2023-12-07 09:44:11 +01:00
} else if (
2025-12-12 13:15:55 +01:00
// If the flag is indicating the current complementary should be
// reopened but another complementary area becomes active, remove
// the flag.
shouldOpenWhenNotSmallRef . current && activeArea && activeArea !== identifier
) {
2025-02-28 08:42:11 +01:00
shouldOpenWhenNotSmallRef . current = false ;
2021-07-23 11:58:50 +02:00
}
2025-02-28 08:42:11 +01:00
if ( isSmall !== previousIsSmallRef . current ) {
previousIsSmallRef . current = isSmall ;
2022-06-16 14:03:35 +02:00
}
2025-12-12 13:15:55 +01:00
} , [
isActive ,
isSmall ,
scope ,
identifier ,
activeArea ,
disableComplementaryArea ,
enableComplementaryArea
] ) ;
2022-06-16 14:03:35 +02:00
}
2023-09-26 10:33:34 +02:00
function ComplementaryArea ( {
children ,
className ,
2025-12-12 13:15:55 +01:00
closeLabel = ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Close plugin" ) ,
2025-04-25 12:30:07 +02:00
identifier : identifierProp ,
2023-09-26 10:33:34 +02:00
header ,
headerClassName ,
2025-04-25 12:30:07 +02:00
icon : iconProp ,
2023-09-26 10:33:34 +02:00
isPinnable = true ,
panelClassName ,
scope ,
name ,
title ,
toggleShortcut ,
2024-04-17 11:32:24 +02:00
isActiveByDefault
2023-09-26 10:33:34 +02:00
} ) {
2025-04-25 12:30:07 +02:00
const context = ( 0 , external _wp _plugins _namespaceObject . usePluginContext ) ( ) ;
const icon = iconProp || context . icon ;
const identifier = identifierProp || ` ${ context . name } / ${ name } ` ;
2025-02-28 08:42:11 +01:00
const [ isReady , setIsReady ] = ( 0 , external _wp _element _namespaceObject . useState ) ( false ) ;
2021-07-23 11:58:50 +02:00
const {
2023-09-26 10:33:34 +02:00
isLoading ,
2022-06-16 14:03:35 +02:00
isActive ,
isPinned ,
activeArea ,
isSmall ,
2024-04-17 11:32:24 +02:00
isLarge ,
showIconLabels
2025-12-12 13:15:55 +01:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) (
( select ) => {
const {
getActiveComplementaryArea ,
isComplementaryAreaLoading ,
isItemPinned
} = select ( store ) ;
const { get } = select ( external _wp _preferences _namespaceObject . store ) ;
const _activeArea = getActiveComplementaryArea ( scope ) ;
return {
isLoading : isComplementaryAreaLoading ( scope ) ,
isActive : _activeArea === identifier ,
isPinned : isItemPinned ( scope , identifier ) ,
activeArea : _activeArea ,
isSmall : select ( external _wp _viewport _namespaceObject . store ) . isViewportMatch ( "< medium" ) ,
isLarge : select ( external _wp _viewport _namespaceObject . store ) . isViewportMatch ( "large" ) ,
showIconLabels : get ( "core" , "showIconLabels" )
} ;
} ,
[ identifier , scope ]
) ;
const isMobileViewport = ( 0 , external _wp _compose _namespaceObject . useViewportMatch ) ( "medium" , "<" ) ;
useAdjustComplementaryListener (
scope ,
identifier ,
activeArea ,
isActive ,
isSmall
) ;
2022-04-02 10:26:41 +02:00
const {
2022-06-16 14:03:35 +02:00
enableComplementaryArea ,
disableComplementaryArea ,
pinItem ,
unpinItem
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store ) ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
2025-12-12 13:15:55 +01:00
if ( isActiveByDefault && activeArea === void 0 && ! isSmall ) {
2022-06-16 14:03:35 +02:00
enableComplementaryArea ( scope , identifier ) ;
2025-12-12 13:15:55 +01:00
} else if ( activeArea === void 0 && isSmall ) {
2023-09-26 10:33:34 +02:00
disableComplementaryArea ( scope , identifier ) ;
2022-06-16 14:03:35 +02:00
}
2025-02-28 08:42:11 +01:00
setIsReady ( true ) ;
2025-12-12 13:15:55 +01:00
} , [
activeArea ,
isActiveByDefault ,
scope ,
identifier ,
isSmall ,
enableComplementaryArea ,
disableComplementaryArea
] ) ;
2025-02-28 08:42:11 +01:00
if ( ! isReady ) {
return ;
}
2025-12-12 13:15:55 +01:00
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( external _ReactJSXRuntime _namespaceObject . Fragment , { children : [
isPinnable && /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( pinned _items _default , { scope , children : isPinned && /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
ComplementaryAreaToggle ,
{
scope ,
identifier ,
2025-02-28 08:42:11 +01:00
isPressed : isActive && ( ! showIconLabels || isLarge ) ,
"aria-expanded" : isActive ,
"aria-disabled" : isLoading ,
label : title ,
2025-12-12 13:15:55 +01:00
icon : showIconLabels ? check _default : icon ,
2025-02-28 08:42:11 +01:00
showTooltip : ! showIconLabels ,
2025-12-12 13:15:55 +01:00
variant : showIconLabels ? "tertiary" : void 0 ,
2025-02-28 08:42:11 +01:00
size : "compact" ,
shortcut : toggleShortcut
2025-12-12 13:15:55 +01:00
}
) } ) ,
name && isPinnable && /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
ComplementaryAreaMoreMenuItem ,
{
target : name ,
scope ,
icon ,
identifier ,
children : title
}
) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) (
ComplementaryAreaFill ,
{
activeArea ,
isActive ,
className : dist _clsx ( "interface-complementary-area" , className ) ,
scope ,
id : identifier . replace ( "/" , ":" ) ,
children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
complementary _area _header _default ,
{
className : headerClassName ,
closeLabel ,
onClose : ( ) => disableComplementaryArea ( scope ) ,
toggleButtonProps : {
label : closeLabel ,
size : "compact" ,
shortcut : toggleShortcut ,
scope ,
identifier
} ,
children : header || /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( external _ReactJSXRuntime _namespaceObject . Fragment , { children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( "h2" , { className : "interface-complementary-area-header__title" , children : title } ) ,
isPinnable && ! isMobileViewport && /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _components _namespaceObject . Button ,
{
className : "interface-complementary-area__pin-unpin-item" ,
icon : isPinned ? star _filled _default : star _empty _default ,
label : isPinned ? ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Unpin from toolbar" ) : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Pin to toolbar" ) ,
onClick : ( ) => ( isPinned ? unpinItem : pinItem ) (
scope ,
identifier
) ,
isPressed : isPinned ,
"aria-expanded" : isPinned ,
size : "compact"
}
)
] } )
}
) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _components _namespaceObject . Panel , { className : panelClassName , children } )
]
}
)
] } ) ;
2022-04-02 10:26:41 +02:00
}
2025-04-25 12:30:07 +02:00
ComplementaryArea . Slot = ComplementaryAreaSlot ;
2025-12-12 13:15:55 +01:00
var complementary _area _default = ComplementaryArea ;
2025-02-28 08:42:11 +01:00
2023-04-26 17:39:43 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/admin-ui/build-module/navigable-region/index.js
2023-04-26 17:39:43 +02:00
2025-02-28 08:42:11 +01:00
2023-04-26 17:39:43 +02:00
2025-12-12 13:15:55 +01:00
const NavigableRegion = ( 0 , external _wp _element _namespaceObject . forwardRef ) (
( { children , className , ariaLabel , as : Tag = "div" , ... props } , ref ) => {
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
Tag ,
{
ref ,
className : dist _clsx ( "admin-ui-navigable-region" , className ) ,
"aria-label" : ariaLabel ,
role : "region" ,
tabIndex : "-1" ,
... props ,
children
}
) ;
}
) ;
NavigableRegion . displayName = "NavigableRegion" ;
var navigable _region _default = NavigableRegion ;
2021-07-23 11:58:50 +02:00
2023-12-07 09:44:11 +01:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/interface/build-module/components/interface-skeleton/index.js
2021-07-23 11:58:50 +02:00
2023-04-26 17:39:43 +02:00
2025-02-28 08:42:11 +01:00
const interface _skeleton _ANIMATION _DURATION = 0.25 ;
const commonTransition = {
2025-12-12 13:15:55 +01:00
type : "tween" ,
2025-02-28 08:42:11 +01:00
duration : interface _skeleton _ANIMATION _DURATION ,
ease : [ 0.6 , 0 , 0.4 , 1 ]
} ;
2022-06-16 14:03:35 +02:00
function useHTMLClass ( className ) {
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
const element = document && document . querySelector ( ` html:not(. ${ className } ) ` ) ;
if ( ! element ) {
return ;
}
element . classList . toggle ( className ) ;
return ( ) => {
element . classList . toggle ( className ) ;
} ;
} , [ className ] ) ;
}
2023-09-26 10:33:34 +02:00
const headerVariants = {
2025-12-12 13:15:55 +01:00
hidden : { opacity : 1 , marginTop : - 60 } ,
visible : { opacity : 1 , marginTop : 0 } ,
2025-02-28 08:42:11 +01:00
distractionFreeHover : {
opacity : 1 ,
marginTop : 0 ,
2023-09-26 10:33:34 +02:00
transition : {
2025-02-28 08:42:11 +01:00
... commonTransition ,
2023-09-26 10:33:34 +02:00
delay : 0.2 ,
delayChildren : 0.2
}
} ,
2025-02-28 08:42:11 +01:00
distractionFreeHidden : {
opacity : 0 ,
marginTop : - 60
} ,
distractionFreeDisabled : {
opacity : 0 ,
marginTop : 0 ,
2023-09-26 10:33:34 +02:00
transition : {
2025-02-28 08:42:11 +01:00
... commonTransition ,
delay : 0.8 ,
delayChildren : 0.8
2023-09-26 10:33:34 +02:00
}
}
} ;
function InterfaceSkeleton ( {
isDistractionFree ,
footer ,
header ,
editorNotices ,
sidebar ,
secondarySidebar ,
content ,
actions ,
labels ,
2025-02-28 08:42:11 +01:00
className
2023-09-26 10:33:34 +02:00
} , ref ) {
2025-02-28 08:42:11 +01:00
const [ secondarySidebarResizeListener , secondarySidebarSize ] = ( 0 , external _wp _compose _namespaceObject . useResizeObserver ) ( ) ;
2025-12-12 13:15:55 +01:00
const isMobileViewport = ( 0 , external _wp _compose _namespaceObject . useViewportMatch ) ( "medium" , "<" ) ;
2025-02-28 08:42:11 +01:00
const disableMotion = ( 0 , external _wp _compose _namespaceObject . useReducedMotion ) ( ) ;
const defaultTransition = {
2025-12-12 13:15:55 +01:00
type : "tween" ,
2025-02-28 08:42:11 +01:00
duration : disableMotion ? 0 : interface _skeleton _ANIMATION _DURATION ,
ease : [ 0.6 , 0 , 0.4 , 1 ]
} ;
2025-12-12 13:15:55 +01:00
useHTMLClass ( "interface-interface-skeleton__html-container" ) ;
2022-06-16 14:03:35 +02:00
const defaultLabels = {
/* translators: accessibility text for the top bar landmark region. */
2025-12-12 13:15:55 +01:00
header : ( 0 , external _wp _i18n _namespaceObject . _x ) ( "Header" , "header landmark area" ) ,
2022-06-16 14:03:35 +02:00
/* translators: accessibility text for the content landmark region. */
2025-12-12 13:15:55 +01:00
body : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Content" ) ,
2022-06-16 14:03:35 +02:00
/* translators: accessibility text for the secondary sidebar landmark region. */
2025-12-12 13:15:55 +01:00
secondarySidebar : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Block Library" ) ,
2022-06-16 14:03:35 +02:00
/* translators: accessibility text for the settings landmark region. */
2025-12-12 13:15:55 +01:00
sidebar : ( 0 , external _wp _i18n _namespaceObject . _x ) ( "Settings" , "settings landmark area" ) ,
2022-06-16 14:03:35 +02:00
/* translators: accessibility text for the publish landmark region. */
2025-12-12 13:15:55 +01:00
actions : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Publish" ) ,
2022-06-16 14:03:35 +02:00
/* translators: accessibility text for the footer landmark region. */
2025-12-12 13:15:55 +01:00
footer : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Footer" )
2022-06-16 14:03:35 +02:00
} ;
2025-12-12 13:15:55 +01:00
const mergedLabels = { ... defaultLabels , ... labels } ;
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) (
"div" ,
{
ref ,
className : dist _clsx (
className ,
"interface-interface-skeleton" ,
! ! footer && "has-footer"
) ,
children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( "div" , { className : "interface-interface-skeleton__editor" , children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _components _namespaceObject . _ _unstableAnimatePresence , { initial : false , children : ! ! header && /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
navigable _region _default ,
{
as : external _wp _components _namespaceObject . _ _unstableMotion . div ,
className : "interface-interface-skeleton__header" ,
"aria-label" : mergedLabels . header ,
initial : isDistractionFree && ! isMobileViewport ? "distractionFreeHidden" : "hidden" ,
whileHover : isDistractionFree && ! isMobileViewport ? "distractionFreeHover" : "visible" ,
animate : isDistractionFree && ! isMobileViewport ? "distractionFreeDisabled" : "visible" ,
exit : isDistractionFree && ! isMobileViewport ? "distractionFreeHidden" : "hidden" ,
variants : headerVariants ,
2025-02-28 08:42:11 +01:00
transition : defaultTransition ,
2025-12-12 13:15:55 +01:00
children : header
}
) } ) ,
isDistractionFree && /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( "div" , { className : "interface-interface-skeleton__header" , children : editorNotices } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( "div" , { className : "interface-interface-skeleton__body" , children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _components _namespaceObject . _ _unstableAnimatePresence , { initial : false , children : ! ! secondarySidebar && /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
navigable _region _default ,
{
className : "interface-interface-skeleton__secondary-sidebar" ,
ariaLabel : mergedLabels . secondarySidebar ,
as : external _wp _components _namespaceObject . _ _unstableMotion . div ,
initial : "closed" ,
animate : "open" ,
exit : "closed" ,
variants : {
open : { width : secondarySidebarSize . width } ,
closed : { width : 0 }
} ,
transition : defaultTransition ,
children : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) (
external _wp _components _namespaceObject . _ _unstableMotion . div ,
{
style : {
position : "absolute" ,
width : isMobileViewport ? "100vw" : "fit-content" ,
height : "100%" ,
left : 0
} ,
variants : {
open : { x : 0 } ,
closed : { x : "-100%" }
} ,
transition : defaultTransition ,
children : [
secondarySidebarResizeListener ,
secondarySidebar
]
}
)
}
) } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
navigable _region _default ,
{
className : "interface-interface-skeleton__content" ,
ariaLabel : mergedLabels . body ,
children : content
}
) ,
! ! sidebar && /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
navigable _region _default ,
{
className : "interface-interface-skeleton__sidebar" ,
ariaLabel : mergedLabels . sidebar ,
children : sidebar
}
) ,
! ! actions && /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
navigable _region _default ,
{
className : "interface-interface-skeleton__actions" ,
ariaLabel : mergedLabels . actions ,
children : actions
}
)
] } )
] } ) ,
! ! footer && /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
navigable _region _default ,
{
className : "interface-interface-skeleton__footer" ,
ariaLabel : mergedLabels . footer ,
children : footer
}
)
]
}
) ;
2022-06-16 14:03:35 +02:00
}
2025-12-12 13:15:55 +01:00
var interface _skeleton _default = ( 0 , external _wp _element _namespaceObject . forwardRef ) ( InterfaceSkeleton ) ;
2021-07-23 11:58:50 +02:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/interface/build-module/components/index.js
2021-07-23 11:58:50 +02:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/interface/build-module/index.js
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
2025-04-25 12:30:07 +02:00
; // external ["wp","blockEditor"]
2024-04-17 11:32:24 +02:00
const external _wp _blockEditor _namespaceObject = window [ "wp" ] [ "blockEditor" ] ;
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/edit-widgets/build-module/store/transformers.js
2021-07-23 11:58:50 +02:00
2022-06-16 14:03:35 +02:00
function transformWidgetToBlock ( widget ) {
2025-12-12 13:15:55 +01:00
if ( widget . id _base === "block" ) {
2022-12-15 17:47:31 +01:00
const parsedBlocks = ( 0 , external _wp _blocks _namespaceObject . parse ) ( widget . instance . raw . content , {
_ _unstableSkipAutop : true
} ) ;
2022-06-16 14:03:35 +02:00
if ( ! parsedBlocks . length ) {
2025-12-12 13:15:55 +01:00
return ( 0 , external _wp _widgets _namespaceObject . addWidgetIdToBlock ) (
( 0 , external _wp _blocks _namespaceObject . createBlock ) ( "core/paragraph" , { } , [ ] ) ,
widget . id
) ;
2022-06-16 14:03:35 +02:00
}
return ( 0 , external _wp _widgets _namespaceObject . addWidgetIdToBlock ) ( parsedBlocks [ 0 ] , widget . id ) ;
}
let attributes ;
if ( widget . _embedded . about [ 0 ] . is _multi ) {
attributes = {
idBase : widget . id _base ,
instance : widget . instance
} ;
} else {
attributes = {
id : widget . id
} ;
}
2025-12-12 13:15:55 +01:00
return ( 0 , external _wp _widgets _namespaceObject . addWidgetIdToBlock ) (
( 0 , external _wp _blocks _namespaceObject . createBlock ) ( "core/legacy-widget" , attributes , [ ] ) ,
widget . id
) ;
2022-06-16 14:03:35 +02:00
}
2023-09-26 10:33:34 +02:00
function transformBlockToWidget ( block , relatedWidget = { } ) {
2022-06-16 14:03:35 +02:00
let widget ;
2025-12-12 13:15:55 +01:00
const isValidLegacyWidgetBlock = block . name === "core/legacy-widget" && ( block . attributes . id || block . attributes . instance ) ;
2022-06-16 14:03:35 +02:00
if ( isValidLegacyWidgetBlock ) {
2023-12-07 09:44:11 +01:00
widget = {
... relatedWidget ,
2025-12-12 13:15:55 +01:00
id : block . attributes . id ? ? relatedWidget . id ,
id _base : block . attributes . idBase ? ? relatedWidget . id _base ,
instance : block . attributes . instance ? ? relatedWidget . instance
2022-06-16 14:03:35 +02:00
} ;
} else {
2023-12-07 09:44:11 +01:00
widget = {
... relatedWidget ,
2025-12-12 13:15:55 +01:00
id _base : "block" ,
2022-06-16 14:03:35 +02:00
instance : {
raw : {
content : ( 0 , external _wp _blocks _namespaceObject . serialize ) ( block )
}
}
} ;
2023-12-07 09:44:11 +01:00
}
2022-06-16 14:03:35 +02:00
delete widget . rendered ;
delete widget . rendered _form ;
return widget ;
2021-07-23 11:58:50 +02:00
}
2022-06-16 14:03:35 +02:00
2025-12-12 13:15:55 +01:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/edit-widgets/build-module/store/utils.js
2025-12-12 13:15:55 +01:00
const KIND = "root" ;
const WIDGET _AREA _ENTITY _TYPE = "sidebar" ;
const POST _TYPE = "postType" ;
const buildWidgetAreaPostId = ( widgetAreaId ) => ` widget-area- ${ widgetAreaId } ` ;
2022-06-16 14:03:35 +02:00
const buildWidgetAreasPostId = ( ) => ` widget-areas ` ;
function buildWidgetAreasQuery ( ) {
return {
per _page : - 1
} ;
2022-04-02 10:26:41 +02:00
}
2022-06-16 14:03:35 +02:00
function buildWidgetsQuery ( ) {
return {
per _page : - 1 ,
2025-12-12 13:15:55 +01:00
_embed : "about"
2022-06-16 14:03:35 +02:00
} ;
}
const createStubPost = ( id , blocks ) => ( {
id ,
slug : id ,
2025-12-12 13:15:55 +01:00
status : "draft" ,
type : "page" ,
2022-06-16 14:03:35 +02:00
blocks ,
meta : {
widgetAreaId : id
2022-04-02 10:26:41 +02:00
}
2022-06-16 14:03:35 +02:00
} ) ;
2022-04-02 10:26:41 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-widgets/build-module/store/constants.js
const constants _STORE _NAME = "core/edit-widgets" ;
2022-04-02 10:26:41 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-widgets/build-module/store/actions.js
2022-04-02 10:26:41 +02:00
2021-07-23 11:58:50 +02:00
2023-12-07 09:44:11 +01:00
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
const persistStubPost = ( id , blocks ) => ( { registry } ) => {
2022-06-16 14:03:35 +02:00
const stubPost = createStubPost ( id , blocks ) ;
2025-12-12 13:15:55 +01:00
registry . dispatch ( external _wp _coreData _namespaceObject . store ) . receiveEntityRecords (
KIND ,
POST _TYPE ,
stubPost ,
{ id : stubPost . id } ,
false
) ;
2022-06-16 14:03:35 +02:00
return stubPost ;
} ;
2025-12-12 13:15:55 +01:00
const saveEditedWidgetAreas = ( ) => async ( { select , dispatch , registry } ) => {
2022-06-16 14:03:35 +02:00
const editedWidgetAreas = select . getEditedWidgetAreas ( ) ;
2023-09-26 10:33:34 +02:00
if ( ! editedWidgetAreas ? . length ) {
2022-06-16 14:03:35 +02:00
return ;
}
try {
await dispatch . saveWidgetAreas ( editedWidgetAreas ) ;
2025-12-12 13:15:55 +01:00
registry . dispatch ( external _wp _notices _namespaceObject . store ) . createSuccessNotice ( ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Widgets saved." ) , {
type : "snackbar"
2021-07-23 11:58:50 +02:00
} ) ;
2022-06-16 14:03:35 +02:00
} catch ( e ) {
2025-12-12 13:15:55 +01:00
registry . dispatch ( external _wp _notices _namespaceObject . store ) . createErrorNotice (
/* translators: %s: The error message. */
( 0 , external _wp _i18n _namespaceObject . sprintf ) ( ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "There was an error. %s" ) , e . message ) ,
{
type : "snackbar"
}
) ;
2022-06-16 14:03:35 +02:00
}
} ;
2025-12-12 13:15:55 +01:00
const saveWidgetAreas = ( widgetAreas ) => async ( { dispatch , registry } ) => {
2022-06-16 14:03:35 +02:00
try {
for ( const widgetArea of widgetAreas ) {
await dispatch . saveWidgetArea ( widgetArea . id ) ;
}
} finally {
2025-12-12 13:15:55 +01:00
await registry . dispatch ( external _wp _coreData _namespaceObject . store ) . finishResolution (
"getEntityRecord" ,
KIND ,
WIDGET _AREA _ENTITY _TYPE ,
buildWidgetAreasQuery ( )
) ;
2021-07-23 11:58:50 +02:00
}
2022-06-16 14:03:35 +02:00
} ;
2025-12-12 13:15:55 +01:00
const saveWidgetArea = ( widgetAreaId ) => async ( { dispatch , select , registry } ) => {
2022-06-16 14:03:35 +02:00
const widgets = select . getWidgets ( ) ;
2025-12-12 13:15:55 +01:00
const post = registry . select ( external _wp _coreData _namespaceObject . store ) . getEditedEntityRecord (
KIND ,
POST _TYPE ,
buildWidgetAreaPostId ( widgetAreaId )
) ;
const areaWidgets = Object . values ( widgets ) . filter (
( { sidebar } ) => sidebar === widgetAreaId
) ;
2022-06-16 14:03:35 +02:00
const usedReferenceWidgets = [ ] ;
2025-12-12 13:15:55 +01:00
const widgetsBlocks = post . blocks . filter ( ( block ) => {
const { id } = block . attributes ;
if ( block . name === "core/legacy-widget" && id ) {
2022-06-16 14:03:35 +02:00
if ( usedReferenceWidgets . includes ( id ) ) {
return false ;
}
usedReferenceWidgets . push ( id ) ;
}
return true ;
2023-12-07 09:44:11 +01:00
} ) ;
2022-06-16 14:03:35 +02:00
const deletedWidgets = [ ] ;
for ( const widget of areaWidgets ) {
const widgetsNewArea = select . getWidgetAreaForWidgetId ( widget . id ) ;
if ( ! widgetsNewArea ) {
deletedWidgets . push ( widget ) ;
}
}
const batchMeta = [ ] ;
const batchTasks = [ ] ;
const sidebarWidgetsIds = [ ] ;
for ( let i = 0 ; i < widgetsBlocks . length ; i ++ ) {
const block = widgetsBlocks [ i ] ;
const widgetId = ( 0 , external _wp _widgets _namespaceObject . getWidgetIdFromBlock ) ( block ) ;
const oldWidget = widgets [ widgetId ] ;
2023-12-07 09:44:11 +01:00
const widget = transformBlockToWidget ( block , oldWidget ) ;
sidebarWidgetsIds . push ( widgetId ) ;
2022-06-16 14:03:35 +02:00
if ( oldWidget ) {
2025-12-12 13:15:55 +01:00
registry . dispatch ( external _wp _coreData _namespaceObject . store ) . editEntityRecord (
"root" ,
"widget" ,
widgetId ,
{
... widget ,
sidebar : widgetAreaId
} ,
{ undoIgnore : true }
) ;
const hasEdits = registry . select ( external _wp _coreData _namespaceObject . store ) . hasEditsForEntityRecord ( "root" , "widget" , widgetId ) ;
2022-06-16 14:03:35 +02:00
if ( ! hasEdits ) {
continue ;
}
2025-12-12 13:15:55 +01:00
batchTasks . push (
( { saveEditedEntityRecord } ) => saveEditedEntityRecord ( "root" , "widget" , widgetId )
) ;
2022-06-16 14:03:35 +02:00
} else {
2025-12-12 13:15:55 +01:00
batchTasks . push (
( { saveEntityRecord } ) => saveEntityRecord ( "root" , "widget" , {
... widget ,
sidebar : widgetAreaId
} )
) ;
2021-07-23 11:58:50 +02:00
}
2022-06-16 14:03:35 +02:00
batchMeta . push ( {
block ,
position : i ,
clientId : block . clientId
} ) ;
}
for ( const widget of deletedWidgets ) {
2025-12-12 13:15:55 +01:00
batchTasks . push (
( { deleteEntityRecord } ) => deleteEntityRecord ( "root" , "widget" , widget . id , {
force : true
} )
) ;
2022-06-16 14:03:35 +02:00
}
const records = await registry . dispatch ( external _wp _coreData _namespaceObject . store ) . _ _experimentalBatch ( batchTasks ) ;
2025-12-12 13:15:55 +01:00
const preservedRecords = records . filter (
( record ) => ! record . hasOwnProperty ( "deleted" )
) ;
2022-06-16 14:03:35 +02:00
const failedWidgetNames = [ ] ;
for ( let i = 0 ; i < preservedRecords . length ; i ++ ) {
const widget = preservedRecords [ i ] ;
2025-12-12 13:15:55 +01:00
const { block , position } = batchMeta [ i ] ;
2022-06-16 14:03:35 +02:00
post . blocks [ position ] . attributes . _ _internalWidgetId = widget . id ;
2025-12-12 13:15:55 +01:00
const error = registry . select ( external _wp _coreData _namespaceObject . store ) . getLastEntitySaveError ( "root" , "widget" , widget . id ) ;
2022-06-16 14:03:35 +02:00
if ( error ) {
2023-09-26 10:33:34 +02:00
failedWidgetNames . push ( block . attributes ? . name || block ? . name ) ;
2022-04-02 10:26:41 +02:00
}
2022-06-16 14:03:35 +02:00
if ( ! sidebarWidgetsIds [ position ] ) {
sidebarWidgetsIds [ position ] = widget . id ;
}
}
if ( failedWidgetNames . length ) {
2025-12-12 13:15:55 +01:00
throw new Error (
( 0 , external _wp _i18n _namespaceObject . sprintf ) (
/* translators: %s: List of widget names */
( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Could not save the following widgets: %s." ) ,
failedWidgetNames . join ( ", " )
)
) ;
2022-06-16 14:03:35 +02:00
}
2025-12-12 13:15:55 +01:00
registry . dispatch ( external _wp _coreData _namespaceObject . store ) . editEntityRecord (
KIND ,
WIDGET _AREA _ENTITY _TYPE ,
widgetAreaId ,
{
widgets : sidebarWidgetsIds
} ,
{ undoIgnore : true }
) ;
2022-06-16 14:03:35 +02:00
dispatch ( trySaveWidgetArea ( widgetAreaId ) ) ;
2025-12-12 13:15:55 +01:00
registry . dispatch ( external _wp _coreData _namespaceObject . store ) . receiveEntityRecords ( KIND , POST _TYPE , post , void 0 ) ;
2022-06-16 14:03:35 +02:00
} ;
2025-12-12 13:15:55 +01:00
const trySaveWidgetArea = ( widgetAreaId ) => ( { registry } ) => {
registry . dispatch ( external _wp _coreData _namespaceObject . store ) . saveEditedEntityRecord (
KIND ,
WIDGET _AREA _ENTITY _TYPE ,
widgetAreaId ,
{
throwOnError : true
}
) ;
2022-06-16 14:03:35 +02:00
} ;
function setWidgetIdForClientId ( clientId , widgetId ) {
return {
2025-12-12 13:15:55 +01:00
type : "SET_WIDGET_ID_FOR_CLIENT_ID" ,
2022-06-16 14:03:35 +02:00
clientId ,
widgetId
} ;
}
function setWidgetAreasOpenState ( widgetAreasOpenState ) {
return {
2025-12-12 13:15:55 +01:00
type : "SET_WIDGET_AREAS_OPEN_STATE" ,
2022-06-16 14:03:35 +02:00
widgetAreasOpenState
} ;
}
function setIsWidgetAreaOpen ( clientId , isOpen ) {
return {
2025-12-12 13:15:55 +01:00
type : "SET_IS_WIDGET_AREA_OPEN" ,
2022-06-16 14:03:35 +02:00
clientId ,
isOpen
} ;
}
function setIsInserterOpened ( value ) {
return {
2025-12-12 13:15:55 +01:00
type : "SET_IS_INSERTER_OPENED" ,
2022-06-16 14:03:35 +02:00
value
} ;
2021-07-23 11:58:50 +02:00
}
2022-06-16 14:03:35 +02:00
function setIsListViewOpened ( isOpen ) {
return {
2025-12-12 13:15:55 +01:00
type : "SET_IS_LIST_VIEW_OPENED" ,
2022-06-16 14:03:35 +02:00
isOpen
} ;
}
2025-12-12 13:15:55 +01:00
const closeGeneralSidebar = ( ) => ( { registry } ) => {
2022-06-16 14:03:35 +02:00
registry . dispatch ( store ) . disableComplementaryArea ( constants _STORE _NAME ) ;
} ;
2025-12-12 13:15:55 +01:00
const moveBlockToWidgetArea = ( clientId , widgetAreaId ) => async ( { dispatch , select , registry } ) => {
2023-12-07 09:44:11 +01:00
const sourceRootClientId = registry . select ( external _wp _blockEditor _namespaceObject . store ) . getBlockRootClientId ( clientId ) ;
2022-06-16 14:03:35 +02:00
const widgetAreas = registry . select ( external _wp _blockEditor _namespaceObject . store ) . getBlocks ( ) ;
2025-12-12 13:15:55 +01:00
const destinationWidgetAreaBlock = widgetAreas . find (
( { attributes } ) => attributes . id === widgetAreaId
) ;
2023-12-07 09:44:11 +01:00
const destinationRootClientId = destinationWidgetAreaBlock . clientId ;
2022-06-16 14:03:35 +02:00
const destinationInnerBlocksClientIds = registry . select ( external _wp _blockEditor _namespaceObject . store ) . getBlockOrder ( destinationRootClientId ) ;
2023-12-07 09:44:11 +01:00
const destinationIndex = destinationInnerBlocksClientIds . length ;
2025-12-12 13:15:55 +01:00
const isDestinationWidgetAreaOpen = select . getIsWidgetAreaOpen (
destinationRootClientId
) ;
2022-06-16 14:03:35 +02:00
if ( ! isDestinationWidgetAreaOpen ) {
dispatch . setIsWidgetAreaOpen ( destinationRootClientId , true ) ;
2023-12-07 09:44:11 +01:00
}
2025-12-12 13:15:55 +01:00
registry . dispatch ( external _wp _blockEditor _namespaceObject . store ) . moveBlocksToPosition (
[ clientId ] ,
sourceRootClientId ,
destinationRootClientId ,
destinationIndex
) ;
2022-06-16 14:03:35 +02:00
} ;
2025-12-12 13:15:55 +01:00
function unlockWidgetSaving ( lockName ) {
return {
type : "UNLOCK_WIDGET_SAVING" ,
lockName
} ;
}
function lockWidgetSaving ( lockName ) {
return {
type : "LOCK_WIDGET_SAVING" ,
lockName
} ;
}
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-widgets/build-module/store/resolvers.js
2023-12-07 09:44:11 +01:00
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
const getWidgetAreas = ( ) => async ( { dispatch , registry } ) => {
2022-06-16 14:03:35 +02:00
const query = buildWidgetAreasQuery ( ) ;
const widgetAreas = await registry . resolveSelect ( external _wp _coreData _namespaceObject . store ) . getEntityRecords ( KIND , WIDGET _AREA _ENTITY _TYPE , query ) ;
const widgetAreaBlocks = [ ] ;
const sortedWidgetAreas = widgetAreas . sort ( ( a , b ) => {
2025-12-12 13:15:55 +01:00
if ( a . id === "wp_inactive_widgets" ) {
2022-06-16 14:03:35 +02:00
return 1 ;
}
2025-12-12 13:15:55 +01:00
if ( b . id === "wp_inactive_widgets" ) {
2022-06-16 14:03:35 +02:00
return - 1 ;
}
return 0 ;
} ) ;
for ( const widgetArea of sortedWidgetAreas ) {
2025-12-12 13:15:55 +01:00
widgetAreaBlocks . push (
( 0 , external _wp _blocks _namespaceObject . createBlock ) ( "core/widget-area" , {
id : widgetArea . id ,
name : widgetArea . name
} )
) ;
2022-06-16 14:03:35 +02:00
if ( ! widgetArea . widgets . length ) {
2025-12-12 13:15:55 +01:00
dispatch (
persistStubPost (
buildWidgetAreaPostId ( widgetArea . id ) ,
[ ]
)
) ;
2021-07-23 11:58:50 +02:00
}
2022-06-16 14:03:35 +02:00
}
const widgetAreasOpenState = { } ;
widgetAreaBlocks . forEach ( ( widgetAreaBlock , index ) => {
widgetAreasOpenState [ widgetAreaBlock . clientId ] = index === 0 ;
} ) ;
dispatch ( setWidgetAreasOpenState ( widgetAreasOpenState ) ) ;
2025-12-12 13:15:55 +01:00
dispatch (
persistStubPost ( buildWidgetAreasPostId ( ) , widgetAreaBlocks )
) ;
2022-06-16 14:03:35 +02:00
} ;
2025-12-12 13:15:55 +01:00
const getWidgets = ( ) => async ( { dispatch , registry } ) => {
2022-06-16 14:03:35 +02:00
const query = buildWidgetsQuery ( ) ;
2025-12-12 13:15:55 +01:00
const widgets = await registry . resolveSelect ( external _wp _coreData _namespaceObject . store ) . getEntityRecords ( "root" , "widget" , query ) ;
2022-06-16 14:03:35 +02:00
const groupedBySidebar = { } ;
for ( const widget of widgets ) {
const block = transformWidgetToBlock ( widget ) ;
groupedBySidebar [ widget . sidebar ] = groupedBySidebar [ widget . sidebar ] || [ ] ;
groupedBySidebar [ widget . sidebar ] . push ( block ) ;
}
for ( const sidebarId in groupedBySidebar ) {
if ( groupedBySidebar . hasOwnProperty ( sidebarId ) ) {
2025-12-12 13:15:55 +01:00
dispatch (
persistStubPost (
buildWidgetAreaPostId ( sidebarId ) ,
groupedBySidebar [ sidebarId ]
)
) ;
2022-06-16 14:03:35 +02:00
}
}
} ;
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-widgets/build-module/store/selectors.js
2021-07-23 11:58:50 +02:00
2022-06-16 14:03:35 +02:00
2023-12-07 09:44:11 +01:00
2021-07-23 11:58:50 +02:00
2023-12-07 09:44:11 +01:00
const EMPTY _INSERTION _POINT = {
2025-12-12 13:15:55 +01:00
rootClientId : void 0 ,
insertionIndex : void 0
2023-12-07 09:44:11 +01:00
} ;
2025-12-12 13:15:55 +01:00
const selectors _getWidgets = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) (
( select ) => ( 0 , external _wp _data _namespaceObject . createSelector ) (
( ) => {
const widgets = select ( external _wp _coreData _namespaceObject . store ) . getEntityRecords (
"root" ,
"widget" ,
buildWidgetsQuery ( )
) ;
return (
// Key widgets by their ID.
widgets ? . reduce (
( allWidgets , widget ) => ( {
... allWidgets ,
[ widget . id ] : widget
} ) ,
{ }
) ? ? { }
) ;
} ,
( ) => [
select ( external _wp _coreData _namespaceObject . store ) . getEntityRecords (
"root" ,
"widget" ,
buildWidgetsQuery ( )
)
]
)
) ;
const getWidget = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) (
( select ) => ( state , id ) => {
const widgets = select ( constants _STORE _NAME ) . getWidgets ( ) ;
return widgets [ id ] ;
}
) ;
const selectors _getWidgetAreas = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( ( select ) => ( ) => {
2022-06-16 14:03:35 +02:00
const query = buildWidgetAreasQuery ( ) ;
2025-12-12 13:15:55 +01:00
return select ( external _wp _coreData _namespaceObject . store ) . getEntityRecords (
KIND ,
WIDGET _AREA _ENTITY _TYPE ,
query
) ;
2022-06-16 14:03:35 +02:00
} ) ;
2025-12-12 13:15:55 +01:00
const getWidgetAreaForWidgetId = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) (
( select ) => ( state , widgetId ) => {
const widgetAreas = select ( constants _STORE _NAME ) . getWidgetAreas ( ) ;
return widgetAreas . find ( ( widgetArea ) => {
const post = select ( external _wp _coreData _namespaceObject . store ) . getEditedEntityRecord (
KIND ,
POST _TYPE ,
buildWidgetAreaPostId ( widgetArea . id )
) ;
const blockWidgetIds = post . blocks . map (
( block ) => ( 0 , external _wp _widgets _namespaceObject . getWidgetIdFromBlock ) ( block )
) ;
return blockWidgetIds . includes ( widgetId ) ;
} ) ;
2022-06-16 14:03:35 +02:00
}
2025-12-12 13:15:55 +01:00
) ;
const getParentWidgetAreaBlock = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) (
( select ) => ( state , clientId ) => {
const { getBlock , getBlockName , getBlockParents } = select ( external _wp _blockEditor _namespaceObject . store ) ;
const blockParents = getBlockParents ( clientId ) ;
const widgetAreaClientId = blockParents . find (
( parentClientId ) => getBlockName ( parentClientId ) === "core/widget-area"
) ;
return getBlock ( widgetAreaClientId ) ;
2022-06-16 14:03:35 +02:00
}
2025-12-12 13:15:55 +01:00
) ;
const getEditedWidgetAreas = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) (
( select ) => ( state , ids ) => {
let widgetAreas = select ( constants _STORE _NAME ) . getWidgetAreas ( ) ;
if ( ! widgetAreas ) {
return [ ] ;
}
if ( ids ) {
widgetAreas = widgetAreas . filter (
( { id } ) => ids . includes ( id )
) ;
}
return widgetAreas . filter (
( { id } ) => select ( external _wp _coreData _namespaceObject . store ) . hasEditsForEntityRecord (
KIND ,
POST _TYPE ,
buildWidgetAreaPostId ( id )
)
) . map (
( { id } ) => select ( external _wp _coreData _namespaceObject . store ) . getEditedEntityRecord (
KIND ,
WIDGET _AREA _ENTITY _TYPE ,
id
)
) ;
}
) ;
const getReferenceWidgetBlocks = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) (
( select ) => ( state , referenceWidgetName = null ) => {
const results = [ ] ;
const widgetAreas = select ( constants _STORE _NAME ) . getWidgetAreas ( ) ;
for ( const _widgetArea of widgetAreas ) {
const post = select ( external _wp _coreData _namespaceObject . store ) . getEditedEntityRecord (
KIND ,
POST _TYPE ,
buildWidgetAreaPostId ( _widgetArea . id )
) ;
for ( const block of post . blocks ) {
if ( block . name === "core/legacy-widget" && ( ! referenceWidgetName || block . attributes ? . referenceWidgetName === referenceWidgetName ) ) {
results . push ( block ) ;
}
2022-06-16 14:03:35 +02:00
}
}
2025-12-12 13:15:55 +01:00
return results ;
2022-06-16 14:03:35 +02:00
}
2025-12-12 13:15:55 +01:00
) ;
const isSavingWidgetAreas = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( ( select ) => ( ) => {
const widgetAreasIds = select ( constants _STORE _NAME ) . getWidgetAreas ( ) ? . map ( ( { id } ) => id ) ;
2022-06-16 14:03:35 +02:00
if ( ! widgetAreasIds ) {
return false ;
}
for ( const id of widgetAreasIds ) {
2025-12-12 13:15:55 +01:00
const isSaving = select ( external _wp _coreData _namespaceObject . store ) . isSavingEntityRecord (
KIND ,
WIDGET _AREA _ENTITY _TYPE ,
id
) ;
2022-06-16 14:03:35 +02:00
if ( isSaving ) {
return true ;
}
}
2025-12-12 13:15:55 +01:00
const widgetIds = [
... Object . keys ( select ( constants _STORE _NAME ) . getWidgets ( ) ) ,
void 0
// account for new widgets without an ID
2022-06-16 14:03:35 +02:00
] ;
for ( const id of widgetIds ) {
2025-12-12 13:15:55 +01:00
const isSaving = select ( external _wp _coreData _namespaceObject . store ) . isSavingEntityRecord (
"root" ,
"widget" ,
id
) ;
2022-06-16 14:03:35 +02:00
if ( isSaving ) {
return true ;
}
}
return false ;
} ) ;
const getIsWidgetAreaOpen = ( state , clientId ) => {
2025-12-12 13:15:55 +01:00
const { widgetAreasOpenState } = state ;
2022-06-16 14:03:35 +02:00
return ! ! widgetAreasOpenState [ clientId ] ;
} ;
function isInserterOpened ( state ) {
return ! ! state . blockInserterPanel ;
}
function _ _experimentalGetInsertionPoint ( state ) {
2025-12-12 13:15:55 +01:00
if ( typeof state . blockInserterPanel === "boolean" ) {
2023-12-07 09:44:11 +01:00
return EMPTY _INSERTION _POINT ;
}
return state . blockInserterPanel ;
2021-07-23 11:58:50 +02:00
}
2025-12-12 13:15:55 +01:00
const canInsertBlockInWidgetArea = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) (
( select ) => ( state , blockName ) => {
const widgetAreas = select ( external _wp _blockEditor _namespaceObject . store ) . getBlocks ( ) ;
const [ firstWidgetArea ] = widgetAreas ;
return select ( external _wp _blockEditor _namespaceObject . store ) . canInsertBlockType (
blockName ,
firstWidgetArea . clientId
) ;
}
) ;
2022-06-16 14:03:35 +02:00
function isListViewOpened ( state ) {
return state . listViewPanel ;
2021-07-23 11:58:50 +02:00
}
2025-12-12 13:15:55 +01:00
function isWidgetSavingLocked ( state ) {
return Object . keys ( state . widgetSavingLock ) . length > 0 ;
}
2021-07-23 11:58:50 +02:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/edit-widgets/build-module/store/private-selectors.js
2024-04-17 11:32:24 +02:00
function getListViewToggleRef ( state ) {
return state . listViewToggleRef ;
}
2025-02-28 08:42:11 +01:00
function getInserterSidebarToggleRef ( state ) {
return state . inserterSidebarToggleRef ;
}
2024-04-17 11:32:24 +02:00
2025-12-12 13:15:55 +01:00
2025-04-25 12:30:07 +02:00
; // external ["wp","privateApis"]
2024-04-17 11:32:24 +02:00
const external _wp _privateApis _namespaceObject = window [ "wp" ] [ "privateApis" ] ;
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/edit-widgets/build-module/lock-unlock.js
2024-04-17 11:32:24 +02:00
2025-12-12 13:15:55 +01:00
const { lock , unlock } = ( 0 , external _wp _privateApis _namespaceObject . _ _dangerousOptInToUnstableAPIsOnlyForCoreModules ) (
"I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress." ,
"@wordpress/edit-widgets"
) ;
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-widgets/build-module/store/index.js
2023-12-07 09:44:11 +01:00
2021-07-23 11:58:50 +02:00
2024-04-17 11:32:24 +02:00
2022-06-16 14:03:35 +02:00
const storeConfig = {
2025-12-12 13:15:55 +01:00
reducer : reducer _default ,
2022-06-16 14:03:35 +02:00
selectors : store _selectors _namespaceObject ,
resolvers : resolvers _namespaceObject ,
actions : store _actions _namespaceObject
} ;
const store _store = ( 0 , external _wp _data _namespaceObject . createReduxStore ) ( constants _STORE _NAME , storeConfig ) ;
2023-12-07 09:44:11 +01:00
( 0 , external _wp _data _namespaceObject . register ) ( store _store ) ;
2025-12-12 13:15:55 +01:00
external _wp _apiFetch _default ( ) . use ( function ( options , next ) {
if ( options . path ? . indexOf ( "/wp/v2/types/widget-area" ) === 0 ) {
2022-06-16 14:03:35 +02:00
return Promise . resolve ( { } ) ;
}
return next ( options ) ;
} ) ;
2024-04-17 11:32:24 +02:00
unlock ( store _store ) . registerPrivateSelectors ( private _selectors _namespaceObject ) ;
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
2025-04-25 12:30:07 +02:00
; // external ["wp","hooks"]
2024-04-17 11:32:24 +02:00
const external _wp _hooks _namespaceObject = window [ "wp" ] [ "hooks" ] ;
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/edit-widgets/build-module/filters/move-to-widget-area.js
2021-07-23 11:58:50 +02:00
2023-12-07 09:44:11 +01:00
2022-06-16 14:03:35 +02:00
2025-12-12 13:15:55 +01:00
const withMoveToWidgetAreaToolbarItem = ( 0 , external _wp _compose _namespaceObject . createHigherOrderComponent ) (
( BlockEdit ) => ( props ) => {
const { clientId , name : blockName } = props ;
const { widgetAreas , currentWidgetAreaId , canInsertBlockInWidgetArea } = ( 0 , external _wp _data _namespaceObject . useSelect ) (
( select ) => {
if ( blockName === "core/widget-area" ) {
return { } ;
2025-02-28 08:42:11 +01:00
}
2025-12-12 13:15:55 +01:00
const selectors = select ( store _store ) ;
const widgetAreaBlock = selectors . getParentWidgetAreaBlock ( clientId ) ;
return {
widgetAreas : selectors . getWidgetAreas ( ) ,
currentWidgetAreaId : widgetAreaBlock ? . attributes ? . id ,
canInsertBlockInWidgetArea : selectors . canInsertBlockInWidgetArea ( blockName )
} ;
} ,
[ clientId , blockName ]
) ;
const { moveBlockToWidgetArea } = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
const hasMultipleWidgetAreas = widgetAreas ? . length > 1 ;
const isMoveToWidgetAreaVisible = blockName !== "core/widget-area" && hasMultipleWidgetAreas && canInsertBlockInWidgetArea ;
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( external _ReactJSXRuntime _namespaceObject . Fragment , { children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( BlockEdit , { ... props } , "edit" ) ,
isMoveToWidgetAreaVisible && /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _blockEditor _namespaceObject . BlockControls , { children : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _widgets _namespaceObject . MoveToWidgetArea ,
{
widgetAreas ,
currentWidgetAreaId ,
onSelect : ( widgetAreaId ) => {
moveBlockToWidgetArea (
props . clientId ,
widgetAreaId
) ;
}
}
) } )
] } ) ;
} ,
"withMoveToWidgetAreaToolbarItem"
) ;
( 0 , external _wp _hooks _namespaceObject . addFilter ) (
"editor.BlockEdit" ,
"core/edit-widgets/block-edit" ,
withMoveToWidgetAreaToolbarItem
) ;
2021-07-23 11:58:50 +02:00
2025-04-25 12:30:07 +02:00
; // external ["wp","mediaUtils"]
2024-04-17 11:32:24 +02:00
const external _wp _mediaUtils _namespaceObject = window [ "wp" ] [ "mediaUtils" ] ;
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/edit-widgets/build-module/filters/replace-media-upload.js
2021-07-23 11:58:50 +02:00
2022-06-16 14:03:35 +02:00
const replaceMediaUpload = ( ) => external _wp _mediaUtils _namespaceObject . MediaUpload ;
2025-12-12 13:15:55 +01:00
( 0 , external _wp _hooks _namespaceObject . addFilter ) (
"editor.MediaUpload" ,
"core/edit-widgets/replace-media-upload" ,
replaceMediaUpload
) ;
2022-06-16 14:03:35 +02:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/edit-widgets/build-module/filters/index.js
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-widgets/build-module/blocks/widget-area/block.json
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"}' ) ;
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/edit-widgets/build-module/blocks/widget-area/edit/use-is-dragging-within.js
2023-12-07 09:44:11 +01:00
2025-12-12 13:15:55 +01:00
const useIsDraggingWithin = ( elementRef ) => {
2022-06-16 14:03:35 +02:00
const [ isDraggingWithin , setIsDraggingWithin ] = ( 0 , external _wp _element _namespaceObject . useState ) ( false ) ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
2025-12-12 13:15:55 +01:00
const { ownerDocument } = elementRef . current ;
2022-06-16 14:03:35 +02:00
function handleDragStart ( event ) {
handleDragEnter ( event ) ;
2023-12-07 09:44:11 +01:00
}
2022-06-16 14:03:35 +02:00
function handleDragEnd ( ) {
setIsDraggingWithin ( false ) ;
2022-04-02 10:26:41 +02:00
}
2022-06-16 14:03:35 +02:00
function handleDragEnter ( event ) {
if ( elementRef . current . contains ( event . target ) ) {
setIsDraggingWithin ( true ) ;
} else {
setIsDraggingWithin ( false ) ;
}
2023-12-07 09:44:11 +01:00
}
2025-12-12 13:15:55 +01:00
ownerDocument . addEventListener ( "dragstart" , handleDragStart ) ;
ownerDocument . addEventListener ( "dragend" , handleDragEnd ) ;
ownerDocument . addEventListener ( "dragenter" , handleDragEnter ) ;
2022-06-16 14:03:35 +02:00
return ( ) => {
2025-12-12 13:15:55 +01:00
ownerDocument . removeEventListener ( "dragstart" , handleDragStart ) ;
ownerDocument . removeEventListener ( "dragend" , handleDragEnd ) ;
ownerDocument . removeEventListener ( "dragenter" , handleDragEnter ) ;
2021-07-23 11:58:50 +02:00
} ;
2022-06-16 14:03:35 +02:00
} , [ ] ) ;
return isDraggingWithin ;
2021-07-23 11:58:50 +02:00
} ;
2025-12-12 13:15:55 +01:00
var use _is _dragging _within _default = useIsDraggingWithin ;
2022-04-02 10:26:41 +02:00
2023-12-07 09:44:11 +01:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-widgets/build-module/blocks/widget-area/edit/inner-blocks.js
2022-04-02 10:26:41 +02:00
2025-02-28 08:42:11 +01:00
2025-12-12 13:15:55 +01:00
function WidgetAreaInnerBlocks ( { id } ) {
const [ blocks , onInput , onChange ] = ( 0 , external _wp _coreData _namespaceObject . useEntityBlockEditor ) (
"root" ,
"postType"
) ;
2022-06-16 14:03:35 +02:00
const innerBlocksRef = ( 0 , external _wp _element _namespaceObject . useRef ) ( ) ;
2025-12-12 13:15:55 +01:00
const isDraggingWithinInnerBlocks = use _is _dragging _within _default ( innerBlocksRef ) ;
2023-12-07 09:44:11 +01:00
const shouldHighlightDropZone = isDraggingWithinInnerBlocks ;
2025-12-12 13:15:55 +01:00
const innerBlocksProps = ( 0 , external _wp _blockEditor _namespaceObject . useInnerBlocksProps ) (
{ ref : innerBlocksRef } ,
{
value : blocks ,
onInput ,
onChange ,
templateLock : false ,
renderAppender : external _wp _blockEditor _namespaceObject . InnerBlocks . ButtonBlockAppender
}
) ;
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
"div" ,
{
"data-widget-area-id" : id ,
className : dist _clsx (
"wp-block-widget-area__inner-blocks block-editor-inner-blocks editor-styles-wrapper" ,
{
"wp-block-widget-area__highlight-drop-zone" : shouldHighlightDropZone
}
) ,
children : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( "div" , { ... innerBlocksProps } )
}
) ;
2022-04-02 10:26:41 +02:00
}
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-widgets/build-module/blocks/widget-area/edit/index.js
2022-04-02 10:26:41 +02:00
2023-12-07 09:44:11 +01:00
2022-04-02 10:26:41 +02:00
2023-09-26 10:33:34 +02:00
function WidgetAreaEdit ( {
clientId ,
2025-12-12 13:15:55 +01:00
attributes : { id , name }
2023-09-26 10:33:34 +02:00
} ) {
2025-12-12 13:15:55 +01:00
const isOpen = ( 0 , external _wp _data _namespaceObject . useSelect ) (
( select ) => select ( store _store ) . getIsWidgetAreaOpen ( clientId ) ,
[ clientId ]
) ;
const { setIsWidgetAreaOpen } = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
2022-06-16 14:03:35 +02:00
const wrapper = ( 0 , external _wp _element _namespaceObject . useRef ) ( ) ;
2025-12-12 13:15:55 +01:00
const setOpen = ( 0 , external _wp _element _namespaceObject . useCallback ) (
( openState ) => setIsWidgetAreaOpen ( clientId , openState ) ,
[ clientId ]
) ;
2022-06-16 14:03:35 +02:00
const isDragging = useIsDragging ( wrapper ) ;
2025-12-12 13:15:55 +01:00
const isDraggingWithin = use _is _dragging _within _default ( wrapper ) ;
2022-06-16 14:03:35 +02:00
const [ openedWhileDragging , setOpenedWhileDragging ] = ( 0 , external _wp _element _namespaceObject . useState ) ( false ) ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
if ( ! isDragging ) {
setOpenedWhileDragging ( false ) ;
return ;
2022-04-02 10:26:41 +02:00
}
2022-06-16 14:03:35 +02:00
if ( isDraggingWithin && ! isOpen ) {
setOpen ( true ) ;
setOpenedWhileDragging ( true ) ;
} else if ( ! isDraggingWithin && isOpen && openedWhileDragging ) {
setOpen ( false ) ;
}
} , [ isOpen , isDragging , isDraggingWithin , openedWhileDragging ] ) ;
2025-12-12 13:15:55 +01:00
const blockProps = ( 0 , external _wp _blockEditor _namespaceObject . useBlockProps ) ( ) ;
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 ) (
external _wp _components _namespaceObject . PanelBody ,
{
2025-02-28 08:42:11 +01:00
title : name ,
opened : isOpen ,
onToggle : ( ) => {
setIsWidgetAreaOpen ( clientId , ! isOpen ) ;
} ,
scrollAfterOpen : ! isDragging ,
2025-12-12 13:15:55 +01:00
children : ( { opened } ) => (
// This is required to ensure LegacyWidget blocks are not
// unmounted when the panel is collapsed. Unmounting legacy
// widgets may have unintended consequences (e.g. TinyMCE
// not being properly reinitialized)
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _components _namespaceObject . _ _unstableDisclosureContent ,
{
className : "wp-block-widget-area__panel-body-content" ,
visible : opened ,
children : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _coreData _namespaceObject . EntityProvider ,
{
kind : "root" ,
type : "postType" ,
id : ` widget-area- ${ id } ` ,
children : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( WidgetAreaInnerBlocks , { id } )
}
)
}
)
)
}
) } ) } ) ;
2022-04-02 10:26:41 +02:00
}
2025-12-12 13:15:55 +01:00
const useIsDragging = ( elementRef ) => {
2022-06-16 14:03:35 +02:00
const [ isDragging , setIsDragging ] = ( 0 , external _wp _element _namespaceObject . useState ) ( false ) ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
2025-12-12 13:15:55 +01:00
const { ownerDocument } = elementRef . current ;
2022-06-16 14:03:35 +02:00
function handleDragStart ( ) {
setIsDragging ( true ) ;
}
function handleDragEnd ( ) {
setIsDragging ( false ) ;
}
2025-12-12 13:15:55 +01:00
ownerDocument . addEventListener ( "dragstart" , handleDragStart ) ;
ownerDocument . addEventListener ( "dragend" , handleDragEnd ) ;
2022-06-16 14:03:35 +02:00
return ( ) => {
2025-12-12 13:15:55 +01:00
ownerDocument . removeEventListener ( "dragstart" , handleDragStart ) ;
ownerDocument . removeEventListener ( "dragend" , handleDragEnd ) ;
2022-06-16 14:03:35 +02:00
} ;
} , [ ] ) ;
return isDragging ;
} ;
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/edit-widgets/build-module/blocks/widget-area/index.js
2022-06-16 14:03:35 +02:00
2025-12-12 13:15:55 +01:00
const { name : widget _area _name } = block _namespaceObject ;
2022-06-16 14:03:35 +02:00
const settings = {
2025-12-12 13:15:55 +01:00
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Widget Area" ) ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "A widget area container." ) ,
_ _experimentalLabel : ( { name : label } ) => label ,
2022-06-16 14:03:35 +02:00
edit : WidgetAreaEdit
} ;
2025-12-12 13:15:55 +01:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/edit-widgets/build-module/components/error-boundary/index.js
2022-04-02 10:26:41 +02:00
2022-06-16 14:03:35 +02:00
2025-02-28 08:42:11 +01:00
2025-12-12 13:15:55 +01:00
function CopyButton ( { text , children } ) {
2022-06-16 14:03:35 +02:00
const ref = ( 0 , external _wp _compose _namespaceObject . useCopyToClipboard ) ( text ) ;
2025-12-12 13:15:55 +01:00
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _components _namespaceObject . Button , { _ _next40pxDefaultSize : true , variant : "secondary" , ref , children } ) ;
2022-06-16 14:03:35 +02:00
}
2025-12-12 13:15:55 +01:00
function ErrorBoundaryWarning ( { message , error } ) {
const actions = [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( CopyButton , { text : error . stack , children : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Copy Error" ) } , "copy-error" )
] ;
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _blockEditor _namespaceObject . Warning , { className : "edit-widgets-error-boundary" , actions , children : message } ) ;
2023-04-26 17:39:43 +02:00
}
2022-06-16 14:03:35 +02:00
class ErrorBoundary extends external _wp _element _namespaceObject . Component {
constructor ( ) {
super ( ... arguments ) ;
this . state = {
error : null
2022-04-02 10:26:41 +02:00
} ;
2022-06-16 14:03:35 +02:00
}
componentDidCatch ( error ) {
2025-12-12 13:15:55 +01:00
( 0 , external _wp _hooks _namespaceObject . doAction ) ( "editor.ErrorBoundary.errorLogged" , error ) ;
2022-04-02 10:26:41 +02:00
}
2023-04-26 17:39:43 +02:00
static getDerivedStateFromError ( error ) {
2025-12-12 13:15:55 +01:00
return { error } ;
2022-04-02 10:26:41 +02:00
}
2022-06-16 14:03:35 +02:00
render ( ) {
2023-04-26 17:39:43 +02:00
if ( ! this . state . error ) {
2022-06-16 14:03:35 +02:00
return this . props . children ;
}
2025-12-12 13:15:55 +01:00
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
ErrorBoundaryWarning ,
{
message : ( 0 , external _wp _i18n _namespaceObject . _ _ ) (
"The editor has encountered an unexpected error."
) ,
error : this . state . error
}
) ;
2022-06-16 14:03:35 +02:00
}
}
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
2025-04-25 12:30:07 +02:00
; // external ["wp","patterns"]
2024-04-17 11:32:24 +02:00
const external _wp _patterns _namespaceObject = window [ "wp" ] [ "patterns" ] ;
2025-04-25 12:30:07 +02:00
; // external ["wp","keyboardShortcuts"]
2024-04-17 11:32:24 +02:00
const external _wp _keyboardShortcuts _namespaceObject = window [ "wp" ] [ "keyboardShortcuts" ] ;
2025-04-25 12:30:07 +02:00
; // external ["wp","keycodes"]
2024-04-17 11:32:24 +02:00
const external _wp _keycodes _namespaceObject = window [ "wp" ] [ "keycodes" ] ;
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/edit-widgets/build-module/components/keyboard-shortcuts/index.js
2021-07-23 11:58:50 +02:00
2023-04-26 17:39:43 +02:00
2023-09-26 10:33:34 +02:00
2022-06-16 14:03:35 +02:00
function KeyboardShortcuts ( ) {
2025-12-12 13:15:55 +01:00
const { redo , undo } = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _coreData _namespaceObject . store ) ;
const { saveEditedWidgetAreas } = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
( 0 , external _wp _keyboardShortcuts _namespaceObject . useShortcut ) ( "core/edit-widgets/undo" , ( event ) => {
2022-06-16 14:03:35 +02:00
undo ( ) ;
event . preventDefault ( ) ;
} ) ;
2025-12-12 13:15:55 +01:00
( 0 , external _wp _keyboardShortcuts _namespaceObject . useShortcut ) ( "core/edit-widgets/redo" , ( event ) => {
2022-06-16 14:03:35 +02:00
redo ( ) ;
event . preventDefault ( ) ;
} ) ;
2025-12-12 13:15:55 +01:00
( 0 , external _wp _keyboardShortcuts _namespaceObject . useShortcut ) ( "core/edit-widgets/save" , ( event ) => {
2022-06-16 14:03:35 +02:00
event . preventDefault ( ) ;
saveEditedWidgetAreas ( ) ;
2021-07-23 11:58:50 +02:00
} ) ;
2022-06-16 14:03:35 +02:00
return null ;
2021-07-23 11:58:50 +02:00
}
2022-06-16 14:03:35 +02:00
function KeyboardShortcutsRegister ( ) {
2025-12-12 13:15:55 +01:00
const { registerShortcut } = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _keyboardShortcuts _namespaceObject . store ) ;
2022-06-16 14:03:35 +02:00
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
registerShortcut ( {
2025-12-12 13:15:55 +01:00
name : "core/edit-widgets/undo" ,
category : "global" ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Undo your last changes." ) ,
2022-06-16 14:03:35 +02:00
keyCombination : {
2025-12-12 13:15:55 +01:00
modifier : "primary" ,
character : "z"
2021-07-23 11:58:50 +02:00
}
2022-06-16 14:03:35 +02:00
} ) ;
registerShortcut ( {
2025-12-12 13:15:55 +01:00
name : "core/edit-widgets/redo" ,
category : "global" ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Redo your last undo." ) ,
2022-06-16 14:03:35 +02:00
keyCombination : {
2025-12-12 13:15:55 +01:00
modifier : "primaryShift" ,
character : "z"
2023-04-26 17:39:43 +02:00
} ,
// Disable on Apple OS because it conflicts with the browser's
// history shortcut. It's a fine alias for both Windows and Linux.
// Since there's no conflict for Ctrl+Shift+Z on both Windows and
// Linux, we keep it as the default for consistency.
2025-12-12 13:15:55 +01:00
aliases : ( 0 , external _wp _keycodes _namespaceObject . isAppleOS ) ( ) ? [ ] : [
{
modifier : "primary" ,
character : "y"
}
]
2022-06-16 14:03:35 +02:00
} ) ;
registerShortcut ( {
2025-12-12 13:15:55 +01:00
name : "core/edit-widgets/save" ,
category : "global" ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Save your changes." ) ,
2022-06-16 14:03:35 +02:00
keyCombination : {
2025-12-12 13:15:55 +01:00
modifier : "primary" ,
character : "s"
2022-06-16 14:03:35 +02:00
}
} ) ;
registerShortcut ( {
2025-12-12 13:15:55 +01:00
name : "core/edit-widgets/keyboard-shortcuts" ,
category : "main" ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Display these keyboard shortcuts." ) ,
2022-06-16 14:03:35 +02:00
keyCombination : {
2025-12-12 13:15:55 +01:00
modifier : "access" ,
character : "h"
2022-06-16 14:03:35 +02:00
}
} ) ;
registerShortcut ( {
2025-12-12 13:15:55 +01:00
name : "core/edit-widgets/next-region" ,
category : "global" ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Navigate to the next part of the editor." ) ,
2022-06-16 14:03:35 +02:00
keyCombination : {
2025-12-12 13:15:55 +01:00
modifier : "ctrl" ,
character : "`"
2022-06-16 14:03:35 +02:00
} ,
2025-12-12 13:15:55 +01:00
aliases : [
{
modifier : "access" ,
character : "n"
}
]
2022-06-16 14:03:35 +02:00
} ) ;
registerShortcut ( {
2025-12-12 13:15:55 +01:00
name : "core/edit-widgets/previous-region" ,
category : "global" ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Navigate to the previous part of the editor." ) ,
2022-06-16 14:03:35 +02:00
keyCombination : {
2025-12-12 13:15:55 +01:00
modifier : "ctrlShift" ,
character : "`"
2022-06-16 14:03:35 +02:00
} ,
2025-12-12 13:15:55 +01:00
aliases : [
{
modifier : "access" ,
character : "p"
} ,
{
modifier : "ctrlShift" ,
character : "~"
}
]
2022-06-16 14:03:35 +02:00
} ) ;
} , [ registerShortcut ] ) ;
2021-07-23 11:58:50 +02:00
return null ;
}
2022-06-16 14:03:35 +02:00
KeyboardShortcuts . Register = KeyboardShortcutsRegister ;
2025-12-12 13:15:55 +01:00
var keyboard _shortcuts _default = KeyboardShortcuts ;
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-widgets/build-module/hooks/use-last-selected-widget-area.js
2021-07-23 11:58:50 +02:00
2023-12-07 09:44:11 +01:00
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
const useLastSelectedWidgetArea = ( ) => ( 0 , external _wp _data _namespaceObject . useSelect ) ( ( select ) => {
const { getBlockSelectionEnd , getBlockName } = select ( external _wp _blockEditor _namespaceObject . store ) ;
2023-12-07 09:44:11 +01:00
const selectionEndClientId = getBlockSelectionEnd ( ) ;
2025-12-12 13:15:55 +01:00
if ( getBlockName ( selectionEndClientId ) === "core/widget-area" ) {
2022-06-16 14:03:35 +02:00
return selectionEndClientId ;
2021-07-23 11:58:50 +02:00
}
2025-12-12 13:15:55 +01:00
const { getParentWidgetAreaBlock } = select ( store _store ) ;
2022-06-16 14:03:35 +02:00
const widgetAreaBlock = getParentWidgetAreaBlock ( selectionEndClientId ) ;
2023-09-26 10:33:34 +02:00
const widgetAreaBlockClientId = widgetAreaBlock ? . clientId ;
2022-06-16 14:03:35 +02:00
if ( widgetAreaBlockClientId ) {
return widgetAreaBlockClientId ;
2023-12-07 09:44:11 +01:00
}
2025-12-12 13:15:55 +01:00
const { getEntityRecord } = select ( external _wp _coreData _namespaceObject . store ) ;
const widgetAreasPost = getEntityRecord (
KIND ,
POST _TYPE ,
buildWidgetAreasPostId ( )
) ;
2023-09-26 10:33:34 +02:00
return widgetAreasPost ? . blocks [ 0 ] ? . clientId ;
2022-06-16 14:03:35 +02:00
} , [ ] ) ;
2025-12-12 13:15:55 +01:00
var use _last _selected _widget _area _default = useLastSelectedWidgetArea ;
2022-06-16 14:03:35 +02:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/edit-widgets/build-module/constants.js
2022-06-16 14:03:35 +02:00
const ALLOW _REUSABLE _BLOCKS = false ;
const ENABLE _EXPERIMENTAL _FSE _BLOCKS = false ;
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-widgets/build-module/components/widget-areas-block-editor-provider/index.js
2021-07-23 11:58:50 +02:00
2022-06-16 14:03:35 +02:00
2024-04-17 11:32:24 +02:00
2025-02-28 08:42:11 +01:00
2021-07-23 11:58:50 +02:00
2025-02-28 08:42:11 +01:00
2025-12-12 13:15:55 +01:00
const { ExperimentalBlockEditorProvider } = unlock ( external _wp _blockEditor _namespaceObject . privateApis ) ;
const { PatternsMenuItems } = unlock ( external _wp _patterns _namespaceObject . privateApis ) ;
const { BlockKeyboardShortcuts } = unlock ( external _wp _blockLibrary _namespaceObject . privateApis ) ;
2025-02-28 08:42:11 +01:00
const EMPTY _ARRAY = [ ] ;
2023-09-26 10:33:34 +02:00
function WidgetAreasBlockEditorProvider ( {
blockEditorSettings ,
children ,
... props
} ) {
2025-12-12 13:15:55 +01:00
const isLargeViewport = ( 0 , external _wp _compose _namespaceObject . useViewportMatch ) ( "medium" ) ;
2022-06-16 14:03:35 +02:00
const {
2025-02-28 08:42:11 +01:00
hasUploadPermissions ,
2022-06-16 14:03:35 +02:00
reusableBlocks ,
isFixedToolbarActive ,
2024-04-17 11:32:24 +02:00
keepCaretInsideBlock ,
pageOnFront ,
pageForPosts
2025-12-12 13:15:55 +01:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( ( select ) => {
const { canUser , getEntityRecord , getEntityRecords } = select ( external _wp _coreData _namespaceObject . store ) ;
const siteSettings = canUser ( "read" , {
kind : "root" ,
name : "site"
} ) ? getEntityRecord ( "root" , "site" ) : void 0 ;
2024-04-17 11:32:24 +02:00
return {
2025-12-12 13:15:55 +01:00
hasUploadPermissions : canUser ( "create" , {
kind : "postType" ,
name : "attachment"
} ) ? ? true ,
reusableBlocks : ALLOW _REUSABLE _BLOCKS ? getEntityRecords ( "postType" , "wp_block" ) : EMPTY _ARRAY ,
isFixedToolbarActive : ! ! select ( external _wp _preferences _namespaceObject . store ) . get (
"core/edit-widgets" ,
"fixedToolbar"
) ,
keepCaretInsideBlock : ! ! select ( external _wp _preferences _namespaceObject . store ) . get (
"core/edit-widgets" ,
"keepCaretInsideBlock"
) ,
2024-04-17 11:32:24 +02:00
pageOnFront : siteSettings ? . page _on _front ,
pageForPosts : siteSettings ? . page _for _posts
} ;
} , [ ] ) ;
2025-12-12 13:15:55 +01:00
const { setIsInserterOpened } = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
2022-06-16 14:03:35 +02:00
const settings = ( 0 , external _wp _element _namespaceObject . useMemo ) ( ( ) => {
let mediaUploadBlockEditor ;
2025-02-28 08:42:11 +01:00
if ( hasUploadPermissions ) {
2025-12-12 13:15:55 +01:00
mediaUploadBlockEditor = ( { onError , ... argumentsObject } ) => {
2022-06-16 14:03:35 +02:00
( 0 , external _wp _mediaUtils _namespaceObject . uploadMedia ) ( {
wpAllowedMimeTypes : blockEditorSettings . allowedMimeTypes ,
2025-12-12 13:15:55 +01:00
onError : ( { message } ) => onError ( message ) ,
2022-06-16 14:03:35 +02:00
... argumentsObject
} ) ;
} ;
}
2023-12-07 09:44:11 +01:00
return {
... blockEditorSettings ,
2022-06-16 14:03:35 +02:00
_ _experimentalReusableBlocks : reusableBlocks ,
2024-04-17 11:32:24 +02:00
hasFixedToolbar : isFixedToolbarActive || ! isLargeViewport ,
2022-06-16 14:03:35 +02:00
keepCaretInsideBlock ,
mediaUpload : mediaUploadBlockEditor ,
2025-12-12 13:15:55 +01:00
templateLock : "all" ,
2024-04-17 11:32:24 +02:00
_ _experimentalSetIsInserterOpened : setIsInserterOpened ,
pageOnFront ,
2025-04-25 12:30:07 +02:00
pageForPosts ,
2025-12-12 13:15:55 +01:00
editorTool : "edit"
2022-06-16 14:03:35 +02:00
} ;
2025-12-12 13:15:55 +01:00
} , [
hasUploadPermissions ,
blockEditorSettings ,
isFixedToolbarActive ,
isLargeViewport ,
keepCaretInsideBlock ,
reusableBlocks ,
setIsInserterOpened ,
pageOnFront ,
pageForPosts
] ) ;
const widgetAreaId = use _last _selected _widget _area _default ( ) ;
const [ blocks , onInput , onChange ] = ( 0 , external _wp _coreData _namespaceObject . useEntityBlockEditor ) (
KIND ,
POST _TYPE ,
{ id : buildWidgetAreasPostId ( ) }
) ;
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( external _wp _components _namespaceObject . SlotFillProvider , { children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( keyboard _shortcuts _default . Register , { } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( BlockKeyboardShortcuts , { } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) (
ExperimentalBlockEditorProvider ,
{
value : blocks ,
onInput ,
onChange ,
settings ,
useSubRegistry : false ,
... props ,
children : [
children ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( PatternsMenuItems , { rootClientId : widgetAreaId } )
]
}
)
] } ) ;
2022-06-16 14:03:35 +02:00
}
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/icons/build-module/library/drawer-left.js
2021-07-23 11:58:50 +02:00
2025-02-28 08:42:11 +01:00
2025-12-12 13:15:55 +01:00
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 ) (
external _wp _primitives _namespaceObject . Path ,
{
2025-02-28 08:42:11 +01:00
fillRule : "evenodd" ,
clipRule : "evenodd" ,
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"
2025-12-12 13:15:55 +01:00
}
) } ) ;
2023-09-26 10:33:34 +02:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/icons/build-module/library/drawer-right.js
2023-09-26 10:33:34 +02:00
2025-02-28 08:42:11 +01:00
2025-12-12 13:15:55 +01:00
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 ) (
external _wp _primitives _namespaceObject . Path ,
{
2025-02-28 08:42:11 +01:00
fillRule : "evenodd" ,
clipRule : "evenodd" ,
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"
2025-12-12 13:15:55 +01:00
}
) } ) ;
2022-06-16 14:03:35 +02:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/icons/build-module/library/block-default.js
2021-07-23 11:58:50 +02:00
2025-02-28 08:42:11 +01:00
2025-12-12 13:15:55 +01:00
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" } ) } ) ;
2021-07-23 11:58:50 +02:00
2025-04-25 12:30:07 +02:00
; // external ["wp","url"]
2024-04-17 11:32:24 +02:00
const external _wp _url _namespaceObject = window [ "wp" ] [ "url" ] ;
2025-04-25 12:30:07 +02:00
; // external ["wp","dom"]
2024-04-17 11:32:24 +02:00
const external _wp _dom _namespaceObject = window [ "wp" ] [ "dom" ] ;
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/edit-widgets/build-module/components/sidebar/widget-areas.js
2021-07-23 11:58:50 +02:00
2022-04-02 10:26:41 +02:00
2022-06-16 14:03:35 +02:00
2023-12-07 09:44:11 +01:00
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
function WidgetAreas ( { selectedWidgetAreaId } ) {
const widgetAreas = ( 0 , external _wp _data _namespaceObject . useSelect ) (
( select ) => select ( store _store ) . getWidgetAreas ( ) ,
[ ]
) ;
const selectedWidgetArea = ( 0 , external _wp _element _namespaceObject . useMemo ) (
( ) => selectedWidgetAreaId && widgetAreas ? . find (
( widgetArea ) => widgetArea . id === selectedWidgetAreaId
) ,
[ selectedWidgetAreaId , widgetAreas ]
) ;
2022-06-16 14:03:35 +02:00
let description ;
if ( ! selectedWidgetArea ) {
2025-04-25 12:30:07 +02:00
description = ( 0 , external _wp _i18n _namespaceObject . _ _ ) (
2025-12-12 13:15:55 +01:00
// eslint-disable-next-line no-restricted-syntax -- 'sidebar' is a common web design term for layouts
"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."
) ;
} else if ( selectedWidgetAreaId === "wp_inactive_widgets" ) {
description = ( 0 , external _wp _i18n _namespaceObject . _ _ ) (
"Blocks in this Widget Area will not be displayed in your site."
) ;
2022-06-16 14:03:35 +02:00
} else {
description = selectedWidgetArea . description ;
}
2025-12-12 13:15:55 +01:00
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 : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _blockEditor _namespaceObject . BlockIcon , { icon : block _default _default } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( "div" , { children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
"p" ,
{
2025-02-28 08:42:11 +01:00
dangerouslySetInnerHTML : {
_ _html : ( 0 , external _wp _dom _namespaceObject . safeHTML ) ( description )
}
2025-12-12 13:15:55 +01:00
}
) ,
widgetAreas ? . length === 0 && /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( "p" , { children : ( 0 , external _wp _i18n _namespaceObject . _ _ ) (
"Your theme does not contain any Widget Areas."
) } ) ,
! selectedWidgetArea && /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _components _namespaceObject . Button ,
{
2025-02-28 08:42:11 +01:00
_ _next40pxDefaultSize : true ,
2025-12-12 13:15:55 +01:00
href : ( 0 , external _wp _url _namespaceObject . addQueryArgs ) ( "customize.php" , {
"autofocus[panel]" : "widgets" ,
2025-02-28 08:42:11 +01:00
return : window . location . pathname
} ) ,
variant : "tertiary" ,
2025-12-12 13:15:55 +01:00
children : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Manage with live preview" )
}
)
] } )
] } ) } ) ;
2022-06-16 14:03:35 +02:00
}
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/edit-widgets/build-module/components/sidebar/index.js
2025-12-12 13:15:55 +01:00
2021-07-23 11:58:50 +02:00
2022-06-16 14:03:35 +02:00
const SIDEBAR _ACTIVE _BY _DEFAULT = external _wp _element _namespaceObject . Platform . select ( {
web : true ,
native : false
} ) ;
2025-12-12 13:15:55 +01:00
const BLOCK _INSPECTOR _IDENTIFIER = "edit-widgets/block-inspector" ;
const WIDGET _AREAS _IDENTIFIER = "edit-widgets/block-areas" ;
2021-07-23 11:58:50 +02:00
2024-04-17 11:32:24 +02:00
2025-02-28 08:42:11 +01:00
2025-12-12 13:15:55 +01:00
const { Tabs } = unlock ( external _wp _components _namespaceObject . privateApis ) ;
function SidebarHeader ( { selectedWidgetAreaBlock } ) {
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( Tabs . TabList , { children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( Tabs . Tab , { tabId : WIDGET _AREAS _IDENTIFIER , children : selectedWidgetAreaBlock ? selectedWidgetAreaBlock . attributes . name : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Widget Areas" ) } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( Tabs . Tab , { tabId : BLOCK _INSPECTOR _IDENTIFIER , children : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Block" ) } )
] } ) ;
2024-04-17 11:32:24 +02:00
}
function SidebarContent ( {
hasSelectedNonAreaBlock ,
currentArea ,
isGeneralSidebarOpen ,
selectedWidgetAreaBlock
2023-09-26 10:33:34 +02:00
} ) {
2025-12-12 13:15:55 +01:00
const { enableComplementaryArea } = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store ) ;
2024-04-17 11:32:24 +02:00
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
if ( hasSelectedNonAreaBlock && currentArea === WIDGET _AREAS _IDENTIFIER && isGeneralSidebarOpen ) {
2025-12-12 13:15:55 +01:00
enableComplementaryArea (
"core/edit-widgets" ,
BLOCK _INSPECTOR _IDENTIFIER
) ;
2024-04-17 11:32:24 +02:00
}
if ( ! hasSelectedNonAreaBlock && currentArea === BLOCK _INSPECTOR _IDENTIFIER && isGeneralSidebarOpen ) {
2025-12-12 13:15:55 +01:00
enableComplementaryArea (
"core/edit-widgets" ,
WIDGET _AREAS _IDENTIFIER
) ;
2024-04-17 11:32:24 +02:00
}
} , [ hasSelectedNonAreaBlock , enableComplementaryArea ] ) ;
const tabsContextValue = ( 0 , external _wp _element _namespaceObject . useContext ) ( Tabs . Context ) ;
2025-12-12 13:15:55 +01:00
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
complementary _area _default ,
{
className : "edit-widgets-sidebar" ,
header : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( Tabs . Context . Provider , { value : tabsContextValue , children : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
SidebarHeader ,
{
selectedWidgetAreaBlock
}
) } ) ,
headerClassName : "edit-widgets-sidebar__panel-tabs" ,
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Settings" ) ,
closeLabel : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Close Settings" ) ,
scope : "core/edit-widgets" ,
identifier : currentArea ,
icon : ( 0 , external _wp _i18n _namespaceObject . isRTL ) ( ) ? drawer _left _default : drawer _right _default ,
isActiveByDefault : SIDEBAR _ACTIVE _BY _DEFAULT ,
children : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( Tabs . Context . Provider , { value : tabsContextValue , children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
Tabs . TabPanel ,
{
tabId : WIDGET _AREAS _IDENTIFIER ,
focusable : false ,
children : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
WidgetAreas ,
{
selectedWidgetAreaId : selectedWidgetAreaBlock ? . attributes . id
}
)
}
) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
Tabs . TabPanel ,
{
tabId : BLOCK _INSPECTOR _IDENTIFIER ,
focusable : false ,
children : hasSelectedNonAreaBlock ? /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _blockEditor _namespaceObject . BlockInspector , { } ) : (
// Pretend that Widget Areas are part of the UI by not
// showing the Block Inspector when one is selected.
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( "span" , { className : "block-editor-block-inspector__no-blocks" , children : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "No block selected." ) } )
)
}
)
] } )
}
) ;
2022-06-16 14:03:35 +02:00
}
function Sidebar ( ) {
const {
currentArea ,
hasSelectedNonAreaBlock ,
isGeneralSidebarOpen ,
selectedWidgetAreaBlock
2025-12-12 13:15:55 +01:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( ( select ) => {
const { getSelectedBlock , getBlock , getBlockParentsByBlockName } = select ( external _wp _blockEditor _namespaceObject . store ) ;
const { getActiveComplementaryArea } = select ( store ) ;
2022-06-16 14:03:35 +02:00
const selectedBlock = getSelectedBlock ( ) ;
const activeArea = getActiveComplementaryArea ( store _store . name ) ;
let currentSelection = activeArea ;
if ( ! currentSelection ) {
if ( selectedBlock ) {
currentSelection = BLOCK _INSPECTOR _IDENTIFIER ;
} else {
currentSelection = WIDGET _AREAS _IDENTIFIER ;
}
}
let widgetAreaBlock ;
if ( selectedBlock ) {
2025-12-12 13:15:55 +01:00
if ( selectedBlock . name === "core/widget-area" ) {
2022-06-16 14:03:35 +02:00
widgetAreaBlock = selectedBlock ;
} else {
2025-12-12 13:15:55 +01:00
widgetAreaBlock = getBlock (
getBlockParentsByBlockName (
selectedBlock . clientId ,
"core/widget-area"
) [ 0 ]
) ;
2022-06-16 14:03:35 +02:00
}
}
return {
currentArea : currentSelection ,
2025-12-12 13:15:55 +01:00
hasSelectedNonAreaBlock : ! ! ( selectedBlock && selectedBlock . name !== "core/widget-area" ) ,
2022-06-16 14:03:35 +02:00
isGeneralSidebarOpen : ! ! activeArea ,
selectedWidgetAreaBlock : widgetAreaBlock
} ;
2023-12-07 09:44:11 +01:00
} , [ ] ) ;
2025-12-12 13:15:55 +01:00
const { enableComplementaryArea } = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store ) ;
const onTabSelect = ( 0 , external _wp _element _namespaceObject . useCallback ) (
( newSelectedTabId ) => {
if ( ! ! newSelectedTabId ) {
enableComplementaryArea (
store _store . name ,
newSelectedTabId
) ;
}
} ,
[ enableComplementaryArea ]
) ;
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
Tabs ,
{
selectedTabId : isGeneralSidebarOpen ? currentArea : null ,
onSelect : onTabSelect ,
selectOnMove : false ,
children : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
SidebarContent ,
{
hasSelectedNonAreaBlock ,
currentArea ,
isGeneralSidebarOpen ,
selectedWidgetAreaBlock
}
)
2022-06-16 14:03:35 +02:00
}
2025-12-12 13:15:55 +01:00
) ;
2022-06-16 14:03:35 +02:00
}
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/icons/build-module/library/plus.js
2021-07-23 11:58:50 +02:00
2025-02-28 08:42:11 +01:00
2025-12-12 13:15:55 +01:00
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" } ) } ) ;
2021-07-23 11:58:50 +02:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/icons/build-module/library/list-view.js
2021-07-23 11:58:50 +02:00
2025-02-28 08:42:11 +01:00
2025-12-12 13:15:55 +01:00
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" } ) } ) ;
2021-07-23 11:58:50 +02:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/icons/build-module/library/undo.js
2021-07-23 11:58:50 +02:00
2025-02-28 08:42:11 +01:00
2025-12-12 13:15:55 +01:00
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" } ) } ) ;
2022-04-02 10:26:41 +02:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/icons/build-module/library/redo.js
2022-04-02 10:26:41 +02:00
2025-02-28 08:42:11 +01:00
2025-12-12 13:15:55 +01:00
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" } ) } ) ;
2021-07-23 11:58:50 +02:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/edit-widgets/build-module/components/header/undo-redo/undo.js
2021-07-23 11:58:50 +02:00
2024-04-17 11:32:24 +02:00
2025-02-28 08:42:11 +01:00
2024-04-17 11:32:24 +02:00
function UndoButton ( props , ref ) {
2025-12-12 13:15:55 +01:00
const hasUndo = ( 0 , external _wp _data _namespaceObject . useSelect ) (
( select ) => select ( external _wp _coreData _namespaceObject . store ) . hasUndo ( ) ,
[ ]
) ;
const { undo } = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _coreData _namespaceObject . store ) ;
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _components _namespaceObject . Button ,
{
... props ,
ref ,
icon : ! ( 0 , external _wp _i18n _namespaceObject . isRTL ) ( ) ? undo _default : redo _default ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Undo" ) ,
shortcut : external _wp _keycodes _namespaceObject . displayShortcut . primary ( "z" ) ,
"aria-disabled" : ! hasUndo ,
onClick : hasUndo ? undo : void 0 ,
size : "compact"
}
) ;
2022-06-16 14:03:35 +02:00
}
2025-12-12 13:15:55 +01:00
var undo _undo _default = ( 0 , external _wp _element _namespaceObject . forwardRef ) ( UndoButton ) ;
2021-07-23 11:58:50 +02:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/edit-widgets/build-module/components/header/undo-redo/redo.js
2021-07-23 11:58:50 +02:00
2024-04-17 11:32:24 +02:00
2025-02-28 08:42:11 +01:00
2024-04-17 11:32:24 +02:00
function RedoButton ( props , ref ) {
2025-12-12 13:15:55 +01:00
const shortcut = ( 0 , external _wp _keycodes _namespaceObject . isAppleOS ) ( ) ? external _wp _keycodes _namespaceObject . displayShortcut . primaryShift ( "z" ) : external _wp _keycodes _namespaceObject . displayShortcut . primary ( "y" ) ;
const hasRedo = ( 0 , external _wp _data _namespaceObject . useSelect ) (
( select ) => select ( external _wp _coreData _namespaceObject . store ) . hasRedo ( ) ,
[ ]
) ;
const { redo } = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _coreData _namespaceObject . store ) ;
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _components _namespaceObject . Button ,
{
... props ,
ref ,
icon : ! ( 0 , external _wp _i18n _namespaceObject . isRTL ) ( ) ? redo _default : undo _default ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Redo" ) ,
shortcut ,
"aria-disabled" : ! hasRedo ,
onClick : hasRedo ? redo : void 0 ,
size : "compact"
}
) ;
2022-06-16 14:03:35 +02:00
}
2025-12-12 13:15:55 +01:00
var redo _redo _default = ( 0 , external _wp _element _namespaceObject . forwardRef ) ( RedoButton ) ;
2024-04-17 11:32:24 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-widgets/build-module/components/header/document-tools/index.js
2024-04-17 11:32:24 +02:00
function DocumentTools ( ) {
2025-12-12 13:15:55 +01:00
const isMediumViewport = ( 0 , external _wp _compose _namespaceObject . useViewportMatch ) ( "medium" ) ;
2024-04-17 11:32:24 +02:00
const {
isInserterOpen ,
isListViewOpen ,
2025-02-28 08:42:11 +01:00
inserterSidebarToggleRef ,
2024-04-17 11:32:24 +02:00
listViewToggleRef
2025-12-12 13:15:55 +01:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( ( select ) => {
2024-04-17 11:32:24 +02:00
const {
isInserterOpened ,
2025-02-28 08:42:11 +01:00
getInserterSidebarToggleRef ,
2024-04-17 11:32:24 +02:00
isListViewOpened ,
getListViewToggleRef
} = unlock ( select ( store _store ) ) ;
return {
isInserterOpen : isInserterOpened ( ) ,
isListViewOpen : isListViewOpened ( ) ,
2025-02-28 08:42:11 +01:00
inserterSidebarToggleRef : getInserterSidebarToggleRef ( ) ,
2024-04-17 11:32:24 +02:00
listViewToggleRef : getListViewToggleRef ( )
} ;
} , [ ] ) ;
2025-12-12 13:15:55 +01:00
const { setIsInserterOpened , setIsListViewOpened } = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
const toggleListView = ( 0 , external _wp _element _namespaceObject . useCallback ) (
( ) => setIsListViewOpened ( ! isListViewOpen ) ,
[ setIsListViewOpened , isListViewOpen ]
) ;
const toggleInserterSidebar = ( 0 , external _wp _element _namespaceObject . useCallback ) (
( ) => setIsInserterOpened ( ! isInserterOpen ) ,
[ setIsInserterOpened , isInserterOpen ]
) ;
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) (
external _wp _blockEditor _namespaceObject . NavigableToolbar ,
{
className : "edit-widgets-header-toolbar" ,
"aria-label" : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Document tools" ) ,
variant : "unstyled" ,
children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _components _namespaceObject . ToolbarItem ,
{
ref : inserterSidebarToggleRef ,
as : external _wp _components _namespaceObject . Button ,
className : "edit-widgets-header-toolbar__inserter-toggle" ,
variant : "primary" ,
isPressed : isInserterOpen ,
onMouseDown : ( event ) => {
event . preventDefault ( ) ;
} ,
onClick : toggleInserterSidebar ,
icon : plus _default ,
label : ( 0 , external _wp _i18n _namespaceObject . _x ) (
"Block Inserter" ,
"Generic label for block inserter button"
) ,
size : "compact"
}
) ,
isMediumViewport && /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( external _ReactJSXRuntime _namespaceObject . Fragment , { children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _components _namespaceObject . ToolbarItem , { as : undo _undo _default } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _components _namespaceObject . ToolbarItem , { as : redo _redo _default } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _components _namespaceObject . ToolbarItem ,
{
as : external _wp _components _namespaceObject . Button ,
className : "edit-widgets-header-toolbar__list-view-toggle" ,
icon : list _view _default ,
isPressed : isListViewOpen ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "List View" ) ,
onClick : toggleListView ,
ref : listViewToggleRef ,
size : "compact"
}
)
] } )
]
}
) ;
2024-04-17 11:32:24 +02:00
}
2025-12-12 13:15:55 +01:00
var document _tools _default = DocumentTools ;
2024-04-17 11:32:24 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-widgets/build-module/components/save-button/index.js
2024-04-17 11:32:24 +02:00
2025-02-28 08:42:11 +01:00
2024-04-17 11:32:24 +02:00
function SaveButton ( ) {
2025-12-12 13:15:55 +01:00
const { hasEditedWidgetAreaIds , isSaving , isWidgetSaveLocked } = ( 0 , external _wp _data _namespaceObject . useSelect ) (
( select ) => {
const {
getEditedWidgetAreas ,
isSavingWidgetAreas ,
isWidgetSavingLocked
} = select ( store _store ) ;
return {
hasEditedWidgetAreaIds : getEditedWidgetAreas ( ) ? . length > 0 ,
isSaving : isSavingWidgetAreas ( ) ,
isWidgetSaveLocked : isWidgetSavingLocked ( )
} ;
} ,
[ ]
) ;
const { saveEditedWidgetAreas } = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
const isDisabled = isWidgetSaveLocked || isSaving || ! hasEditedWidgetAreaIds ;
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _components _namespaceObject . Button ,
{
variant : "primary" ,
isBusy : isSaving ,
"aria-disabled" : isDisabled ,
onClick : isDisabled ? void 0 : saveEditedWidgetAreas ,
size : "compact" ,
children : isSaving ? ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Saving\u2026" ) : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Update" )
}
) ;
2024-04-17 11:32:24 +02:00
}
2025-12-12 13:15:55 +01:00
var save _button _default = SaveButton ;
2021-07-23 11:58:50 +02:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/icons/build-module/library/more-vertical.js
2025-02-28 08:42:11 +01:00
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
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" } ) } ) ;
2025-02-28 08:42:11 +01:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/icons/build-module/library/external.js
2021-07-23 11:58:50 +02:00
2025-02-28 08:42:11 +01:00
2025-12-12 13:15:55 +01:00
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" } ) } ) ;
2021-07-23 11:58:50 +02:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/edit-widgets/build-module/components/keyboard-shortcut-help-modal/config.js
2025-12-12 13:15:55 +01:00
const textFormattingShortcuts = [
{
keyCombination : { modifier : "primary" , character : "b" } ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Make the selected text bold." )
2022-06-16 14:03:35 +02:00
} ,
2025-12-12 13:15:55 +01:00
{
keyCombination : { modifier : "primary" , character : "i" } ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Make the selected text italic." )
2022-06-16 14:03:35 +02:00
} ,
2025-12-12 13:15:55 +01:00
{
keyCombination : { modifier : "primary" , character : "k" } ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Convert the selected text into a link." )
2022-06-16 14:03:35 +02:00
} ,
2025-12-12 13:15:55 +01:00
{
keyCombination : { modifier : "primaryShift" , character : "k" } ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Remove a link." )
2022-12-15 17:47:31 +01:00
} ,
2025-12-12 13:15:55 +01:00
{
keyCombination : { character : "[[" } ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Insert a link to a post or page." )
2022-06-16 14:03:35 +02:00
} ,
2025-12-12 13:15:55 +01:00
{
keyCombination : { modifier : "primary" , character : "u" } ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Underline the selected text." )
2022-12-15 17:47:31 +01:00
} ,
2025-12-12 13:15:55 +01:00
{
keyCombination : { modifier : "access" , character : "d" } ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Strikethrough the selected text." )
2022-12-15 17:47:31 +01:00
} ,
2025-12-12 13:15:55 +01:00
{
keyCombination : { modifier : "access" , character : "x" } ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Make the selected text inline code." )
2023-09-26 10:33:34 +02:00
} ,
2025-12-12 13:15:55 +01:00
{
keyCombination : {
modifier : "access" ,
character : "0"
} ,
aliases : [
{
modifier : "access" ,
character : "7"
}
] ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Convert the current heading to a paragraph." )
2023-09-26 10:33:34 +02:00
} ,
2025-12-12 13:15:55 +01:00
{
keyCombination : { modifier : "access" , character : "1-6" } ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) (
"Convert the current paragraph or heading to a heading of level 1 to 6."
)
2025-02-28 08:42:11 +01:00
} ,
2025-12-12 13:15:55 +01:00
{
keyCombination : { modifier : "primaryShift" , character : "SPACE" } ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Add non breaking space." )
}
] ;
2022-04-02 10:26:41 +02:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/edit-widgets/build-module/components/keyboard-shortcut-help-modal/shortcut.js
2021-07-23 11:58:50 +02:00
2025-02-28 08:42:11 +01:00
2025-12-12 13:15:55 +01:00
function KeyCombination ( { keyCombination , forceAriaLabel } ) {
const shortcut = keyCombination . modifier ? external _wp _keycodes _namespaceObject . displayShortcutList [ keyCombination . modifier ] (
keyCombination . character
) : keyCombination . character ;
const ariaLabel = keyCombination . modifier ? external _wp _keycodes _namespaceObject . shortcutAriaLabel [ keyCombination . modifier ] (
keyCombination . character
) : keyCombination . character ;
2022-12-15 17:47:31 +01:00
const shortcuts = Array . isArray ( shortcut ) ? shortcut : [ shortcut ] ;
2025-12-12 13:15:55 +01:00
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
"kbd" ,
{
className : "edit-widgets-keyboard-shortcut-help-modal__shortcut-key-combination" ,
"aria-label" : forceAriaLabel || ariaLabel ,
children : shortcuts . map ( ( character , index ) => {
if ( character === "+" ) {
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _element _namespaceObject . Fragment , { children : character } , index ) ;
}
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
"kbd" ,
{
className : "edit-widgets-keyboard-shortcut-help-modal__shortcut-key" ,
children : character
} ,
index
) ;
} )
}
) ;
2022-06-16 14:03:35 +02:00
}
2025-12-12 13:15:55 +01:00
function Shortcut ( { description , keyCombination , aliases = [ ] , ariaLabel } ) {
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( external _ReactJSXRuntime _namespaceObject . Fragment , { children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( "div" , { className : "edit-widgets-keyboard-shortcut-help-modal__shortcut-description" , children : description } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( "div" , { className : "edit-widgets-keyboard-shortcut-help-modal__shortcut-term" , children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
KeyCombination ,
{
keyCombination ,
forceAriaLabel : ariaLabel
}
) ,
aliases . map ( ( alias , index ) => /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
KeyCombination ,
{
keyCombination : alias ,
forceAriaLabel : ariaLabel
} ,
index
) )
] } )
] } ) ;
2022-06-16 14:03:35 +02:00
}
2025-12-12 13:15:55 +01:00
var shortcut _default = Shortcut ;
2022-04-02 10:26:41 +02:00
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-widgets/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js
2021-07-23 11:58:50 +02:00
2023-12-07 09:44:11 +01:00
2021-07-23 11:58:50 +02:00
2025-02-28 08:42:11 +01:00
2025-12-12 13:15:55 +01:00
function DynamicShortcut ( { name } ) {
const { keyCombination , description , aliases } = ( 0 , external _wp _data _namespaceObject . useSelect ) (
( select ) => {
const {
getShortcutKeyCombination ,
getShortcutDescription ,
getShortcutAliases
} = select ( external _wp _keyboardShortcuts _namespaceObject . store ) ;
return {
keyCombination : getShortcutKeyCombination ( name ) ,
aliases : getShortcutAliases ( name ) ,
description : getShortcutDescription ( name )
} ;
} ,
[ name ]
) ;
2022-06-16 14:03:35 +02:00
if ( ! keyCombination ) {
return null ;
2021-07-23 11:58:50 +02:00
}
2025-12-12 13:15:55 +01:00
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
shortcut _default ,
{
keyCombination ,
description ,
aliases
}
) ;
2021-07-23 11:58:50 +02:00
}
2025-12-12 13:15:55 +01:00
var dynamic _shortcut _default = DynamicShortcut ;
2021-07-23 11:58:50 +02:00
2023-12-07 09:44:11 +01:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-widgets/build-module/components/keyboard-shortcut-help-modal/index.js
2021-07-23 11:58:50 +02:00
2022-04-02 10:26:41 +02:00
2025-02-28 08:42:11 +01:00
2025-12-12 13:15:55 +01:00
const ShortcutList = ( { shortcuts } ) => (
/ *
* Disable reason : The ` list ` ARIA role is redundant but
* Safari + VoiceOver won ' t announce the list otherwise .
* /
/* eslint-disable jsx-a11y/no-redundant-roles */
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
"ul" ,
{
className : "edit-widgets-keyboard-shortcut-help-modal__shortcut-list" ,
role : "list" ,
children : shortcuts . map ( ( shortcut , index ) => /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
"li" ,
{
className : "edit-widgets-keyboard-shortcut-help-modal__shortcut" ,
children : typeof shortcut === "string" ? /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( dynamic _shortcut _default , { name : shortcut } ) : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( shortcut _default , { ... shortcut } )
} ,
index
) )
}
)
) ;
const ShortcutSection = ( { title , shortcuts , className } ) => /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) (
"section" ,
{
className : dist _clsx (
"edit-widgets-keyboard-shortcut-help-modal__section" ,
className
) ,
children : [
! ! title && /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( "h2" , { className : "edit-widgets-keyboard-shortcut-help-modal__section-title" , children : title } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( ShortcutList , { shortcuts } )
]
}
) ;
2023-09-26 10:33:34 +02:00
const ShortcutCategorySection = ( {
title ,
categoryName ,
additionalShortcuts = [ ]
} ) => {
2025-12-12 13:15:55 +01:00
const categoryShortcuts = ( 0 , external _wp _data _namespaceObject . useSelect ) (
( select ) => {
return select ( external _wp _keyboardShortcuts _namespaceObject . store ) . getCategoryShortcuts (
categoryName
) ;
} ,
[ categoryName ]
) ;
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
ShortcutSection ,
{
title ,
shortcuts : categoryShortcuts . concat ( additionalShortcuts )
}
) ;
2022-06-16 14:03:35 +02:00
} ;
2023-09-26 10:33:34 +02:00
function KeyboardShortcutHelpModal ( {
isModalActive ,
toggleModal
} ) {
2025-12-12 13:15:55 +01:00
( 0 , external _wp _keyboardShortcuts _namespaceObject . useShortcut ) ( "core/edit-widgets/keyboard-shortcuts" , toggleModal , {
2022-06-16 14:03:35 +02:00
bindGlobal : true
} ) ;
if ( ! isModalActive ) {
return null ;
}
2025-12-12 13:15:55 +01:00
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) (
external _wp _components _namespaceObject . Modal ,
{
className : "edit-widgets-keyboard-shortcut-help-modal" ,
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Keyboard shortcuts" ) ,
onRequestClose : toggleModal ,
children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
ShortcutSection ,
{
className : "edit-widgets-keyboard-shortcut-help-modal__main-shortcuts" ,
shortcuts : [ "core/edit-widgets/keyboard-shortcuts" ]
}
) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
ShortcutCategorySection ,
{
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Global shortcuts" ) ,
categoryName : "global"
}
) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
ShortcutCategorySection ,
{
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Selection shortcuts" ) ,
categoryName : "selection"
}
) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
ShortcutCategorySection ,
{
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Block shortcuts" ) ,
categoryName : "block" ,
additionalShortcuts : [
{
keyCombination : { character : "/" } ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) (
"Change the block type after adding a new paragraph."
) ,
/* translators: The forward-slash character. e.g. '/'. */
ariaLabel : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Forward-slash" )
}
]
}
) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
ShortcutSection ,
{
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Text formatting" ) ,
shortcuts : textFormattingShortcuts
}
) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
ShortcutCategorySection ,
{
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "List View shortcuts" ) ,
categoryName : "list-view"
}
)
]
}
) ;
2021-07-23 11:58:50 +02:00
}
2022-04-02 10:26:41 +02:00
2025-12-12 13:15:55 +01:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/edit-widgets/build-module/components/more-menu/tools-more-menu-group.js
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
const { Fill : ToolsMoreMenuGroup , Slot } = ( 0 , external _wp _components _namespaceObject . createSlotFill ) (
"EditWidgetsToolsMoreMenuGroup"
) ;
ToolsMoreMenuGroup . Slot = ( { fillProps } ) => /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( Slot , { fillProps , children : ( fills ) => fills . length > 0 && fills } ) ;
var tools _more _menu _group _default = ToolsMoreMenuGroup ;
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-widgets/build-module/components/more-menu/index.js
2021-07-23 11:58:50 +02:00
2025-02-28 08:42:11 +01:00
2022-06-16 14:03:35 +02:00
function MoreMenu ( ) {
2025-12-12 13:15:55 +01:00
const [
isKeyboardShortcutsModalActive ,
setIsKeyboardShortcutsModalVisible
] = ( 0 , external _wp _element _namespaceObject . useState ) ( false ) ;
2022-06-16 14:03:35 +02:00
const toggleKeyboardShortcutsModal = ( ) => setIsKeyboardShortcutsModalVisible ( ! isKeyboardShortcutsModalActive ) ;
2025-12-12 13:15:55 +01:00
( 0 , external _wp _keyboardShortcuts _namespaceObject . useShortcut ) (
"core/edit-widgets/keyboard-shortcuts" ,
toggleKeyboardShortcutsModal
) ;
const isLargeViewport = ( 0 , external _wp _compose _namespaceObject . useViewportMatch ) ( "medium" ) ;
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( external _ReactJSXRuntime _namespaceObject . Fragment , { children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _components _namespaceObject . DropdownMenu ,
{
icon : more _vertical _default ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Options" ) ,
popoverProps : {
placement : "bottom-end" ,
className : "more-menu-dropdown__content"
} ,
toggleProps : {
tooltipPosition : "bottom" ,
size : "compact"
} ,
children : ( onClose ) => /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( external _ReactJSXRuntime _namespaceObject . Fragment , { children : [
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 ) (
external _wp _preferences _namespaceObject . PreferenceToggleMenuItem ,
{
scope : "core/edit-widgets" ,
name : "fixedToolbar" ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Top toolbar" ) ,
info : ( 0 , external _wp _i18n _namespaceObject . _ _ ) (
"Access all block and document tools in a single place"
) ,
messageActivated : ( 0 , external _wp _i18n _namespaceObject . _ _ ) (
"Top toolbar activated"
) ,
messageDeactivated : ( 0 , external _wp _i18n _namespaceObject . _ _ ) (
"Top toolbar deactivated"
)
2025-02-28 08:42:11 +01:00
}
2025-12-12 13:15:55 +01:00
) } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( external _wp _components _namespaceObject . MenuGroup , { label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Tools" ) , children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _components _namespaceObject . MenuItem ,
{
onClick : ( ) => {
setIsKeyboardShortcutsModalVisible ( true ) ;
} ,
shortcut : external _wp _keycodes _namespaceObject . displayShortcut . access ( "h" ) ,
children : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Keyboard shortcuts" )
}
) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _preferences _namespaceObject . PreferenceToggleMenuItem ,
{
scope : "core/edit-widgets" ,
name : "welcomeGuide" ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Welcome Guide" )
}
) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) (
external _wp _components _namespaceObject . MenuItem ,
{
role : "menuitem" ,
icon : external _default ,
href : ( 0 , external _wp _i18n _namespaceObject . _ _ ) (
"https://wordpress.org/documentation/article/block-based-widgets-editor/"
) ,
target : "_blank" ,
rel : "noopener noreferrer" ,
children : [
( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Help" ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _components _namespaceObject . VisuallyHidden , {
as : "span" ,
/* translators: accessibility text */
children : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "(opens in a new tab)" )
} )
]
}
) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
tools _more _menu _group _default . Slot ,
{
fillProps : { onClose }
}
)
] } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( external _wp _components _namespaceObject . MenuGroup , { label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Preferences" ) , children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _preferences _namespaceObject . PreferenceToggleMenuItem ,
{
scope : "core/edit-widgets" ,
name : "keepCaretInsideBlock" ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) (
"Contain text cursor inside block"
) ,
info : ( 0 , external _wp _i18n _namespaceObject . _ _ ) (
"Aids screen readers by stopping text caret from leaving blocks."
) ,
messageActivated : ( 0 , external _wp _i18n _namespaceObject . _ _ ) (
"Contain text cursor inside block activated"
) ,
messageDeactivated : ( 0 , external _wp _i18n _namespaceObject . _ _ ) (
"Contain text cursor inside block deactivated"
)
}
) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _preferences _namespaceObject . PreferenceToggleMenuItem ,
{
scope : "core/edit-widgets" ,
name : "themeStyles" ,
info : ( 0 , external _wp _i18n _namespaceObject . _ _ ) (
"Make the editor look like your theme."
) ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Use theme styles" )
}
) ,
isLargeViewport && /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _preferences _namespaceObject . PreferenceToggleMenuItem ,
{
scope : "core/edit-widgets" ,
name : "showBlockBreadcrumbs" ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Display block breadcrumbs" ) ,
info : ( 0 , external _wp _i18n _namespaceObject . _ _ ) (
"Shows block breadcrumbs at the bottom of the editor."
) ,
messageActivated : ( 0 , external _wp _i18n _namespaceObject . _ _ ) (
"Display block breadcrumbs activated"
) ,
messageDeactivated : ( 0 , external _wp _i18n _namespaceObject . _ _ ) (
"Display block breadcrumbs deactivated"
)
}
)
] } )
] } )
}
) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
KeyboardShortcutHelpModal ,
{
isModalActive : isKeyboardShortcutsModalActive ,
toggleModal : toggleKeyboardShortcutsModal
}
)
] } ) ;
2021-07-23 11:58:50 +02:00
}
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-widgets/build-module/components/header/index.js
2021-07-23 11:58:50 +02:00
2023-12-07 09:44:11 +01:00
2021-07-23 11:58:50 +02:00
2025-02-28 08:42:11 +01:00
2024-04-17 11:32:24 +02:00
function Header ( ) {
2025-12-12 13:15:55 +01:00
const isLargeViewport = ( 0 , external _wp _compose _namespaceObject . useViewportMatch ) ( "medium" ) ;
2024-04-17 11:32:24 +02:00
const blockToolbarRef = ( 0 , external _wp _element _namespaceObject . useRef ) ( ) ;
2025-12-12 13:15:55 +01:00
const { hasFixedToolbar } = ( 0 , external _wp _data _namespaceObject . useSelect ) (
( select ) => ( {
hasFixedToolbar : ! ! select ( external _wp _preferences _namespaceObject . store ) . get (
"core/edit-widgets" ,
"fixedToolbar"
)
} ) ,
[ ]
) ;
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _ReactJSXRuntime _namespaceObject . Fragment , { children : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( "div" , { className : "edit-widgets-header" , children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( "div" , { className : "edit-widgets-header__navigable-toolbar-wrapper" , children : [
isLargeViewport && /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( "h1" , { className : "edit-widgets-header__title" , children : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Widgets" ) } ) ,
! isLargeViewport && /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _components _namespaceObject . VisuallyHidden ,
{
2025-02-28 08:42:11 +01:00
as : "h1" ,
className : "edit-widgets-header__title" ,
2025-12-12 13:15:55 +01:00
children : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Widgets" )
}
) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( document _tools _default , { } ) ,
hasFixedToolbar && isLargeViewport && /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( external _ReactJSXRuntime _namespaceObject . Fragment , { children : [
/* @__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 } ) } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _components _namespaceObject . Popover . Slot ,
{
2025-02-28 08:42:11 +01:00
ref : blockToolbarRef ,
name : "block-toolbar"
2025-12-12 13:15:55 +01:00
}
)
] } )
] } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( "div" , { className : "edit-widgets-header__actions" , children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( pinned _items _default . Slot , { scope : "core/edit-widgets" } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( save _button _default , { } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( MoreMenu , { } )
] } )
] } ) } ) ;
2022-06-16 14:03:35 +02:00
}
2025-12-12 13:15:55 +01:00
var header _default = Header ;
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-widgets/build-module/components/notices/index.js
2021-07-23 11:58:50 +02:00
2024-04-17 11:32:24 +02:00
2025-02-28 08:42:11 +01:00
2024-04-17 11:32:24 +02:00
const MAX _VISIBLE _NOTICES = - 3 ;
2022-06-16 14:03:35 +02:00
function Notices ( ) {
2025-12-12 13:15:55 +01:00
const { removeNotice } = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _notices _namespaceObject . store ) ;
const { notices } = ( 0 , external _wp _data _namespaceObject . useSelect ) ( ( select ) => {
2022-06-16 14:03:35 +02:00
return {
notices : select ( external _wp _notices _namespaceObject . store ) . getNotices ( )
} ;
} , [ ] ) ;
2025-12-12 13:15:55 +01:00
const dismissibleNotices = notices . filter (
( { isDismissible , type } ) => isDismissible && type === "default"
) ;
const nonDismissibleNotices = notices . filter (
( { isDismissible , type } ) => ! isDismissible && type === "default"
) ;
const snackbarNotices = notices . filter ( ( { type } ) => type === "snackbar" ) . slice ( MAX _VISIBLE _NOTICES ) ;
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( external _ReactJSXRuntime _namespaceObject . Fragment , { children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _components _namespaceObject . NoticeList ,
{
notices : nonDismissibleNotices ,
className : "edit-widgets-notices__pinned"
}
) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _components _namespaceObject . NoticeList ,
{
notices : dismissibleNotices ,
className : "edit-widgets-notices__dismissible" ,
onRemove : removeNotice
}
) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _components _namespaceObject . SnackbarList ,
{
notices : snackbarNotices ,
className : "edit-widgets-notices__snackbar" ,
onRemove : removeNotice
}
)
] } ) ;
2021-07-23 11:58:50 +02:00
}
2025-12-12 13:15:55 +01:00
var notices _default = Notices ;
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-widgets/build-module/components/widget-areas-block-editor-content/index.js
2021-07-23 11:58:50 +02:00
2022-06-16 14:03:35 +02:00
2023-12-07 09:44:11 +01:00
2024-04-17 11:32:24 +02:00
2021-07-23 11:58:50 +02:00
2025-02-28 08:42:11 +01:00
2023-09-26 10:33:34 +02:00
function WidgetAreasBlockEditorContent ( {
blockEditorSettings
} ) {
2025-12-12 13:15:55 +01:00
const hasThemeStyles = ( 0 , external _wp _data _namespaceObject . useSelect ) (
( select ) => ! ! select ( external _wp _preferences _namespaceObject . store ) . get (
"core/edit-widgets" ,
"themeStyles"
) ,
[ ]
) ;
const isLargeViewport = ( 0 , external _wp _compose _namespaceObject . useViewportMatch ) ( "medium" ) ;
2022-06-16 14:03:35 +02:00
const styles = ( 0 , external _wp _element _namespaceObject . useMemo ) ( ( ) => {
return hasThemeStyles ? blockEditorSettings . styles : [ ] ;
} , [ blockEditorSettings , hasThemeStyles ] ) ;
2025-12-12 13:15:55 +01:00
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( "div" , { className : "edit-widgets-block-editor" , children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( notices _default , { } ) ,
! isLargeViewport && /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _blockEditor _namespaceObject . BlockToolbar , { hideDragHandle : true } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( external _wp _blockEditor _namespaceObject . BlockTools , { children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( keyboard _shortcuts _default , { } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _blockEditor _namespaceObject . _ _unstableEditorStyles ,
{
styles ,
scope : ":where(.editor-styles-wrapper)"
}
) ,
/* @__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" } ) } ) } )
] } )
] } ) ;
2021-07-23 11:58:50 +02:00
}
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-widgets/build-module/hooks/use-widget-library-insertion-point.js
2021-07-23 11:58:50 +02:00
2023-12-07 09:44:11 +01:00
2021-07-23 11:58:50 +02:00
2022-06-16 14:03:35 +02:00
const useWidgetLibraryInsertionPoint = ( ) => {
2025-12-12 13:15:55 +01:00
const firstRootId = ( 0 , external _wp _data _namespaceObject . useSelect ) ( ( select ) => {
const { getEntityRecord } = select ( external _wp _coreData _namespaceObject . store ) ;
const widgetAreasPost = getEntityRecord (
KIND ,
POST _TYPE ,
buildWidgetAreasPostId ( )
) ;
2023-09-26 10:33:34 +02:00
return widgetAreasPost ? . blocks [ 0 ] ? . clientId ;
2022-06-16 14:03:35 +02:00
} , [ ] ) ;
2025-12-12 13:15:55 +01:00
return ( 0 , external _wp _data _namespaceObject . useSelect ) (
( select ) => {
const {
getBlockRootClientId ,
getBlockSelectionEnd ,
getBlockOrder ,
getBlockIndex
} = select ( external _wp _blockEditor _namespaceObject . store ) ;
const insertionPoint = select ( store _store ) . _ _experimentalGetInsertionPoint ( ) ;
if ( insertionPoint . rootClientId ) {
return insertionPoint ;
}
const clientId = getBlockSelectionEnd ( ) || firstRootId ;
const rootClientId = getBlockRootClientId ( clientId ) ;
if ( clientId && rootClientId === "" ) {
return {
rootClientId : clientId ,
insertionIndex : getBlockOrder ( clientId ) . length
} ;
}
2022-06-16 14:03:35 +02:00
return {
2025-12-12 13:15:55 +01:00
rootClientId ,
insertionIndex : getBlockIndex ( clientId ) + 1
2022-06-16 14:03:35 +02:00
} ;
2025-12-12 13:15:55 +01:00
} ,
[ firstRootId ]
) ;
2022-04-02 10:26:41 +02:00
} ;
2025-12-12 13:15:55 +01:00
var use _widget _library _insertion _point _default = useWidgetLibraryInsertionPoint ;
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-widgets/build-module/components/secondary-sidebar/inserter-sidebar.js
2022-06-16 14:03:35 +02:00
2021-07-23 11:58:50 +02:00
2025-02-28 08:42:11 +01:00
2022-06-16 14:03:35 +02:00
function InserterSidebar ( ) {
2025-12-12 13:15:55 +01:00
const isMobileViewport = ( 0 , external _wp _compose _namespaceObject . useViewportMatch ) ( "medium" , "<" ) ;
const { rootClientId , insertionIndex } = use _widget _library _insertion _point _default ( ) ;
const { setIsInserterOpened } = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
2022-06-16 14:03:35 +02:00
const closeInserter = ( 0 , external _wp _element _namespaceObject . useCallback ) ( ( ) => {
return setIsInserterOpened ( false ) ;
} , [ setIsInserterOpened ] ) ;
const libraryRef = ( 0 , external _wp _element _namespaceObject . useRef ) ( ) ;
2025-12-12 13:15:55 +01:00
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 ) (
external _wp _blockEditor _namespaceObject . _ _experimentalLibrary ,
{
showInserterHelpPanel : true ,
shouldFocusBlock : isMobileViewport ,
rootClientId ,
_ _experimentalInsertionIndex : insertionIndex ,
ref : libraryRef ,
onClose : closeInserter
}
) } ) } ) ;
2022-06-16 14:03:35 +02:00
}
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-widgets/build-module/components/secondary-sidebar/list-view-sidebar.js
2021-07-23 11:58:50 +02:00
2023-09-26 10:33:34 +02:00
2023-12-07 09:44:11 +01:00
2021-07-23 11:58:50 +02:00
2024-04-17 11:32:24 +02:00
2025-02-28 08:42:11 +01:00
2024-04-17 11:32:24 +02:00
function ListViewSidebar ( ) {
2025-12-12 13:15:55 +01:00
const { setIsListViewOpened } = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
const { getListViewToggleRef } = unlock ( ( 0 , external _wp _data _namespaceObject . useSelect ) ( store _store ) ) ;
2023-09-26 10:33:34 +02:00
const [ dropZoneElement , setDropZoneElement ] = ( 0 , external _wp _element _namespaceObject . useState ) ( null ) ;
2025-12-12 13:15:55 +01:00
const focusOnMountRef = ( 0 , external _wp _compose _namespaceObject . useFocusOnMount ) ( "firstElement" ) ;
2023-12-07 09:44:11 +01:00
const closeListView = ( 0 , external _wp _element _namespaceObject . useCallback ) ( ( ) => {
setIsListViewOpened ( false ) ;
2024-04-17 11:32:24 +02:00
getListViewToggleRef ( ) . current ? . focus ( ) ;
} , [ getListViewToggleRef , setIsListViewOpened ] ) ;
2025-12-12 13:15:55 +01:00
const closeOnEscape = ( 0 , external _wp _element _namespaceObject . useCallback ) (
( event ) => {
if ( event . keyCode === external _wp _keycodes _namespaceObject . ESCAPE && ! event . defaultPrevented ) {
event . preventDefault ( ) ;
closeListView ( ) ;
}
} ,
[ closeListView ]
) ;
2023-12-07 09:44:11 +01:00
return (
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
2025-12-12 13:15:55 +01:00
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) (
"div" ,
{
className : "edit-widgets-editor__list-view-panel" ,
onKeyDown : closeOnEscape ,
children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( "div" , { className : "edit-widgets-editor__list-view-panel-header" , children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( "strong" , { children : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "List View" ) } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _components _namespaceObject . Button ,
{
icon : close _small _default ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Close" ) ,
onClick : closeListView ,
size : "compact"
}
)
] } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
"div" ,
{
className : "edit-widgets-editor__list-view-panel-content" ,
ref : ( 0 , external _wp _compose _namespaceObject . useMergeRefs ) ( [ focusOnMountRef , setDropZoneElement ] ) ,
children : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _blockEditor _namespaceObject . _ _experimentalListView , { dropZoneElement } )
}
)
]
}
)
2022-06-16 14:03:35 +02:00
) ;
}
2022-04-02 10:26:41 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-widgets/build-module/components/secondary-sidebar/index.js
2022-04-02 10:26:41 +02:00
2025-02-28 08:42:11 +01:00
2024-04-17 11:32:24 +02:00
function SecondarySidebar ( ) {
2025-12-12 13:15:55 +01:00
const { isInserterOpen , isListViewOpen } = ( 0 , external _wp _data _namespaceObject . useSelect ) ( ( select ) => {
const { isInserterOpened , isListViewOpened } = select ( store _store ) ;
2022-06-16 14:03:35 +02:00
return {
isInserterOpen : isInserterOpened ( ) ,
isListViewOpen : isListViewOpened ( )
} ;
} , [ ] ) ;
if ( isInserterOpen ) {
2025-12-12 13:15:55 +01:00
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( InserterSidebar , { } ) ;
2022-06-16 14:03:35 +02:00
}
if ( isListViewOpen ) {
2025-12-12 13:15:55 +01:00
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( ListViewSidebar , { } ) ;
2022-06-16 14:03:35 +02:00
}
return null ;
}
2022-04-02 10:26:41 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-widgets/build-module/components/layout/interface.js
2022-04-02 10:26:41 +02:00
2022-06-16 14:03:35 +02:00
2022-04-02 10:26:41 +02:00
2022-06-16 14:03:35 +02:00
2025-02-28 08:42:11 +01:00
2022-06-16 14:03:35 +02:00
const interfaceLabels = {
/* translators: accessibility text for the widgets screen top bar landmark region. */
2025-12-12 13:15:55 +01:00
header : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Widgets top bar" ) ,
2022-06-16 14:03:35 +02:00
/* translators: accessibility text for the widgets screen content landmark region. */
2025-12-12 13:15:55 +01:00
body : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Widgets and blocks" ) ,
2022-06-16 14:03:35 +02:00
/* translators: accessibility text for the widgets screen settings landmark region. */
2025-12-12 13:15:55 +01:00
sidebar : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Widgets settings" ) ,
2022-06-16 14:03:35 +02:00
/* translators: accessibility text for the widgets screen footer landmark region. */
2025-12-12 13:15:55 +01:00
footer : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Widgets footer" )
2022-06-16 14:03:35 +02:00
} ;
2025-12-12 13:15:55 +01:00
function Interface ( { blockEditorSettings } ) {
const isMobileViewport = ( 0 , external _wp _compose _namespaceObject . useViewportMatch ) ( "medium" , "<" ) ;
const isHugeViewport = ( 0 , external _wp _compose _namespaceObject . useViewportMatch ) ( "huge" , ">=" ) ;
const { setIsInserterOpened , setIsListViewOpened , closeGeneralSidebar } = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
2022-04-02 10:26:41 +02:00
const {
2022-06-16 14:03:35 +02:00
hasBlockBreadCrumbsEnabled ,
hasSidebarEnabled ,
isInserterOpened ,
2025-02-28 08:42:11 +01:00
isListViewOpened
2025-12-12 13:15:55 +01:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) (
( select ) => ( {
hasSidebarEnabled : ! ! select (
store
) . getActiveComplementaryArea ( store _store . name ) ,
isInserterOpened : ! ! select ( store _store ) . isInserterOpened ( ) ,
isListViewOpened : ! ! select ( store _store ) . isListViewOpened ( ) ,
hasBlockBreadCrumbsEnabled : ! ! select ( external _wp _preferences _namespaceObject . store ) . get (
"core/edit-widgets" ,
"showBlockBreadcrumbs"
)
} ) ,
[ ]
) ;
2022-06-16 14:03:35 +02:00
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
if ( hasSidebarEnabled && ! isHugeViewport ) {
setIsInserterOpened ( false ) ;
setIsListViewOpened ( false ) ;
2022-04-02 10:26:41 +02:00
}
2022-06-16 14:03:35 +02:00
} , [ hasSidebarEnabled , isHugeViewport ] ) ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
if ( ( isInserterOpened || isListViewOpened ) && ! isHugeViewport ) {
closeGeneralSidebar ( ) ;
}
} , [ isInserterOpened , isListViewOpened , isHugeViewport ] ) ;
2025-12-12 13:15:55 +01:00
const secondarySidebarLabel = isListViewOpened ? ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "List View" ) : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Block Library" ) ;
2022-06-16 14:03:35 +02:00
const hasSecondarySidebar = isListViewOpened || isInserterOpened ;
2025-12-12 13:15:55 +01:00
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
interface _skeleton _default ,
{
labels : {
... interfaceLabels ,
secondarySidebar : secondarySidebarLabel
} ,
header : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( header _default , { } ) ,
secondarySidebar : hasSecondarySidebar && /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( SecondarySidebar , { } ) ,
sidebar : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( complementary _area _default . Slot , { scope : "core/edit-widgets" } ) ,
content : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _ReactJSXRuntime _namespaceObject . Fragment , { children : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
WidgetAreasBlockEditorContent ,
{
blockEditorSettings
}
) } ) ,
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" ) } ) } )
}
) ;
2022-04-02 10:26:41 +02:00
}
2025-12-12 13:15:55 +01:00
var interface _default = Interface ;
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-widgets/build-module/components/layout/unsaved-changes-warning.js
2021-07-23 11:58:50 +02:00
2023-12-07 09:44:11 +01:00
2021-07-23 11:58:50 +02:00
2022-06-16 14:03:35 +02:00
function UnsavedChangesWarning ( ) {
2025-12-12 13:15:55 +01:00
const isDirty = ( 0 , external _wp _data _namespaceObject . useSelect ) ( ( select ) => {
const { getEditedWidgetAreas } = select ( store _store ) ;
2022-06-16 14:03:35 +02:00
const editedWidgetAreas = getEditedWidgetAreas ( ) ;
2023-09-26 10:33:34 +02:00
return editedWidgetAreas ? . length > 0 ;
2022-06-16 14:03:35 +02:00
} , [ ] ) ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
2025-12-12 13:15:55 +01:00
const warnIfUnsavedChanges = ( event ) => {
2022-06-16 14:03:35 +02:00
if ( isDirty ) {
2025-12-12 13:15:55 +01:00
event . returnValue = ( 0 , external _wp _i18n _namespaceObject . _ _ ) (
"You have unsaved changes. If you proceed, they will be lost."
) ;
2022-06-16 14:03:35 +02:00
return event . returnValue ;
}
} ;
2025-12-12 13:15:55 +01:00
window . addEventListener ( "beforeunload" , warnIfUnsavedChanges ) ;
2022-06-16 14:03:35 +02:00
return ( ) => {
2025-12-12 13:15:55 +01:00
window . removeEventListener ( "beforeunload" , warnIfUnsavedChanges ) ;
2022-06-16 14:03:35 +02:00
} ;
} , [ isDirty ] ) ;
return null ;
}
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-widgets/build-module/components/welcome-guide/index.js
2021-07-23 11:58:50 +02:00
2023-12-07 09:44:11 +01:00
2021-07-23 11:58:50 +02:00
2025-02-28 08:42:11 +01:00
2022-06-16 14:03:35 +02:00
function WelcomeGuide ( ) {
2025-12-12 13:15:55 +01:00
const isActive = ( 0 , external _wp _data _namespaceObject . useSelect ) (
( select ) => ! ! select ( external _wp _preferences _namespaceObject . store ) . get (
"core/edit-widgets" ,
"welcomeGuide"
) ,
[ ]
) ;
const { toggle } = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _preferences _namespaceObject . store ) ;
const widgetAreas = ( 0 , external _wp _data _namespaceObject . useSelect ) (
( select ) => select ( store _store ) . getWidgetAreas ( { per _page : - 1 } ) ,
[ ]
) ;
2022-06-16 14:03:35 +02:00
if ( ! isActive ) {
return null ;
}
2025-12-12 13:15:55 +01:00
const isEntirelyBlockWidgets = widgetAreas ? . every (
( widgetArea ) => widgetArea . id === "wp_inactive_widgets" || widgetArea . widgets . every (
( widgetId ) => widgetId . startsWith ( "block-" )
)
) ;
const numWidgetAreas = widgetAreas ? . filter (
( widgetArea ) => widgetArea . id !== "wp_inactive_widgets"
) . length ? ? 0 ;
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _components _namespaceObject . Guide ,
{
className : "edit-widgets-welcome-guide" ,
contentLabel : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Welcome to block Widgets" ) ,
finishButtonText : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Get started" ) ,
onFinish : ( ) => toggle ( "core/edit-widgets" , "welcomeGuide" ) ,
pages : [
{
image : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
WelcomeGuideImage ,
{
nonAnimatedSrc : "https://s.w.org/images/block-editor/welcome-canvas.svg" ,
animatedSrc : "https://s.w.org/images/block-editor/welcome-canvas.gif"
}
) ,
content : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( external _ReactJSXRuntime _namespaceObject . Fragment , { children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( "h1" , { className : "edit-widgets-welcome-guide__heading" , children : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Welcome to block Widgets" ) } ) ,
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 ) (
// Translators: %s: Number of block areas in the current theme.
( 0 , external _wp _i18n _namespaceObject . _n ) (
"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." ,
"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." ,
numWidgetAreas
) ,
numWidgetAreas
) } ) } ) : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( external _ReactJSXRuntime _namespaceObject . Fragment , { children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( "p" , { className : "edit-widgets-welcome-guide__text" , children : ( 0 , external _wp _i18n _namespaceObject . _ _ ) (
"You can now add any block to your site\u2019s widget areas. Don\u2019t worry, all of your favorite widgets still work flawlessly."
) } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( "p" , { className : "edit-widgets-welcome-guide__text" , children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( "strong" , { children : ( 0 , external _wp _i18n _namespaceObject . _ _ ) (
"Want to stick with the old widgets?"
) } ) ,
" " ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _components _namespaceObject . ExternalLink ,
{
href : ( 0 , external _wp _i18n _namespaceObject . _ _ ) (
"https://wordpress.org/plugins/classic-widgets/"
) ,
children : ( 0 , external _wp _i18n _namespaceObject . _ _ ) (
"Get the Classic Widgets plugin."
)
}
)
] } )
] } )
] } )
} ,
{
image : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
WelcomeGuideImage ,
{
nonAnimatedSrc : "https://s.w.org/images/block-editor/welcome-editor.svg" ,
animatedSrc : "https://s.w.org/images/block-editor/welcome-editor.gif"
}
) ,
content : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( external _ReactJSXRuntime _namespaceObject . Fragment , { children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( "h1" , { className : "edit-widgets-welcome-guide__heading" , children : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Customize each block" ) } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( "p" , { className : "edit-widgets-welcome-guide__text" , children : ( 0 , external _wp _i18n _namespaceObject . _ _ ) (
"Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected."
) } )
] } )
} ,
{
image : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
WelcomeGuideImage ,
{
nonAnimatedSrc : "https://s.w.org/images/block-editor/welcome-library.svg" ,
animatedSrc : "https://s.w.org/images/block-editor/welcome-library.gif"
}
) ,
content : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( external _ReactJSXRuntime _namespaceObject . Fragment , { children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( "h1" , { className : "edit-widgets-welcome-guide__heading" , children : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Explore all blocks" ) } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( "p" , { className : "edit-widgets-welcome-guide__text" , children : ( 0 , external _wp _element _namespaceObject . createInterpolateElement ) (
( 0 , external _wp _i18n _namespaceObject . _ _ ) (
"All of the blocks available to you live in the block library. You\u2019ll find it wherever you see the <InserterIconImage /> icon."
) ,
{
InserterIconImage : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
"img" ,
{
className : "edit-widgets-welcome-guide__inserter-icon" ,
alt : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "inserter" ) ,
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"
}
)
}
) } )
] } )
} ,
{
image : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
WelcomeGuideImage ,
{
nonAnimatedSrc : "https://s.w.org/images/block-editor/welcome-documentation.svg" ,
animatedSrc : "https://s.w.org/images/block-editor/welcome-documentation.gif"
}
) ,
content : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( external _ReactJSXRuntime _namespaceObject . Fragment , { children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( "h1" , { className : "edit-widgets-welcome-guide__heading" , children : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Learn more" ) } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( "p" , { className : "edit-widgets-welcome-guide__text" , children : ( 0 , external _wp _element _namespaceObject . createInterpolateElement ) (
( 0 , external _wp _i18n _namespaceObject . _ _ ) (
"New to the block editor? Want to learn more about using it? <a>Here's a detailed guide.</a>"
) ,
{
a : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _components _namespaceObject . ExternalLink ,
{
href : ( 0 , external _wp _i18n _namespaceObject . _ _ ) (
"https://wordpress.org/documentation/article/wordpress-block-editor/"
)
}
)
}
) } )
] } )
}
]
}
) ;
2022-06-16 14:03:35 +02:00
}
2025-12-12 13:15:55 +01:00
function WelcomeGuideImage ( { nonAnimatedSrc , animatedSrc } ) {
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( "picture" , { className : "edit-widgets-welcome-guide__image" , children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
"source" ,
{
srcSet : nonAnimatedSrc ,
media : "(prefers-reduced-motion: reduce)"
}
) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( "img" , { src : animatedSrc , width : "312" , height : "240" , alt : "" } )
] } ) ;
2022-06-16 14:03:35 +02:00
}
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-widgets/build-module/components/layout/index.js
2021-07-23 11:58:50 +02:00
2025-02-28 08:42:11 +01:00
2021-07-23 11:58:50 +02:00
2025-02-28 08:42:11 +01:00
2025-12-12 13:15:55 +01:00
function Layout ( { blockEditorSettings } ) {
const { createErrorNotice } = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _notices _namespaceObject . store ) ;
2022-06-16 14:03:35 +02:00
function onPluginAreaError ( name ) {
2025-12-12 13:15:55 +01:00
createErrorNotice (
( 0 , external _wp _i18n _namespaceObject . sprintf ) (
/* translators: %s: plugin name */
( 0 , external _wp _i18n _namespaceObject . _ _ ) (
'The "%s" plugin has encountered an error and cannot be rendered.'
) ,
name
)
) ;
2022-06-16 14:03:35 +02:00
}
2025-02-28 08:42:11 +01:00
const navigateRegionsProps = ( 0 , external _wp _components _namespaceObject . _ _unstableUseNavigateRegions ) ( ) ;
2025-12-12 13:15:55 +01:00
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( ErrorBoundary , { children : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
"div" ,
{
2025-02-28 08:42:11 +01:00
className : navigateRegionsProps . className ,
... navigateRegionsProps ,
ref : navigateRegionsProps . ref ,
2025-12-12 13:15:55 +01:00
children : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) (
WidgetAreasBlockEditorProvider ,
{
blockEditorSettings ,
children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( interface _default , { blockEditorSettings } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( Sidebar , { } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _plugins _namespaceObject . PluginArea , { onError : onPluginAreaError } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( UnsavedChangesWarning , { } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( WelcomeGuide , { } )
]
}
)
}
) } ) ;
2022-06-16 14:03:35 +02:00
}
2025-12-12 13:15:55 +01:00
var layout _default = Layout ;
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-widgets/build-module/index.js
2021-07-23 11:58:50 +02:00
2023-04-26 17:39:43 +02:00
2023-12-07 09:44:11 +01:00
2021-07-23 11:58:50 +02:00
2025-02-28 08:42:11 +01:00
2023-12-07 09:44:11 +01:00
2025-12-12 13:15:55 +01:00
const disabledBlocks = [
"core/more" ,
"core/freeform" ,
"core/template-part" ,
... ALLOW _REUSABLE _BLOCKS ? [ ] : [ "core/block" ]
] ;
2023-04-26 17:39:43 +02:00
function initializeEditor ( id , settings ) {
2022-06-16 14:03:35 +02:00
const target = document . getElementById ( id ) ;
2023-04-26 17:39:43 +02:00
const root = ( 0 , external _wp _element _namespaceObject . createRoot ) ( target ) ;
2025-12-12 13:15:55 +01:00
const coreBlocks = ( 0 , external _wp _blockLibrary _namespaceObject . _ _experimentalGetCoreBlocks ) ( ) . filter ( ( block ) => {
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" ) ) ;
2022-06-16 14:03:35 +02:00
} ) ;
2025-12-12 13:15:55 +01:00
( 0 , external _wp _data _namespaceObject . dispatch ) ( external _wp _preferences _namespaceObject . store ) . setDefaults ( "core/edit-widgets" , {
2022-06-16 14:03:35 +02:00
fixedToolbar : false ,
welcomeGuide : true ,
showBlockBreadcrumbs : true ,
themeStyles : true
} ) ;
2023-12-07 09:44:11 +01:00
( 0 , external _wp _data _namespaceObject . dispatch ) ( external _wp _blocks _namespaceObject . store ) . reapplyBlockTypeFilters ( ) ;
2022-06-16 14:03:35 +02:00
( 0 , external _wp _blockLibrary _namespaceObject . registerCoreBlocks ) ( coreBlocks ) ;
( 0 , external _wp _widgets _namespaceObject . registerLegacyWidgetBlock ) ( ) ;
if ( false ) { }
( 0 , external _wp _widgets _namespaceObject . registerLegacyWidgetVariations ) ( settings ) ;
registerBlock ( widget _area _namespaceObject ) ;
( 0 , external _wp _widgets _namespaceObject . registerWidgetGroupBlock ) ( ) ;
2023-12-07 09:44:11 +01:00
settings . _ _experimentalFetchLinkSuggestions = ( search , searchOptions ) => ( 0 , external _wp _coreData _namespaceObject . _ _experimentalFetchLinkSuggestions ) ( search , searchOptions , settings ) ;
2025-12-12 13:15:55 +01:00
( 0 , external _wp _blocks _namespaceObject . setFreeformContentHandlerName ) ( "core/html" ) ;
root . render (
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _element _namespaceObject . StrictMode , { children : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( layout _default , { blockEditorSettings : settings } ) } )
) ;
2023-04-26 17:39:43 +02:00
return root ;
}
const initialize = initializeEditor ;
function reinitializeEditor ( ) {
2025-12-12 13:15:55 +01:00
external _wp _deprecated _default ( ) ( "wp.editWidgets.reinitializeEditor" , {
since : "6.2" ,
version : "6.3"
2023-04-26 17:39:43 +02:00
} ) ;
2021-07-23 11:58:50 +02:00
}
2025-12-12 13:15:55 +01:00
const registerBlock = ( block ) => {
2022-06-16 14:03:35 +02:00
if ( ! block ) {
return ;
}
2025-12-12 13:15:55 +01:00
const { metadata , settings , name } = block ;
2022-06-16 14:03:35 +02:00
if ( metadata ) {
2025-12-12 13:15:55 +01:00
( 0 , external _wp _blocks _namespaceObject . unstable _ _bootstrapServerSideBlockDefinitions ) ( { [ name ] : metadata } ) ;
2022-06-16 14:03:35 +02:00
}
( 0 , external _wp _blocks _namespaceObject . registerBlockType ) ( name , settings ) ;
} ;
2021-07-23 11:58:50 +02:00
2023-12-07 09:44:11 +01:00
2025-12-12 13:15:55 +01:00
2022-06-16 14:03:35 +02:00
( window . wp = window . wp || { } ) . editWidgets = _ _webpack _exports _ _ ;
/******/ } ) ( )
;