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
/******/
2019-11-02 10:38:58 +01:00
/************************************************************************/
2022-06-16 14:03:35 +02:00
var _ _webpack _exports _ _ = { } ;
// ESM COMPAT FLAG
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
2019-11-02 10:38:58 +01:00
2022-06-16 14:03:35 +02:00
// EXPORTS
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , {
2025-02-28 08:42:11 +01:00
PluginBlockSettingsMenuItem : ( ) => ( /* reexport */ PluginBlockSettingsMenuItem ) ,
PluginDocumentSettingPanel : ( ) => ( /* reexport */ PluginDocumentSettingPanel ) ,
PluginMoreMenuItem : ( ) => ( /* reexport */ PluginMoreMenuItem ) ,
PluginPostPublishPanel : ( ) => ( /* reexport */ PluginPostPublishPanel ) ,
PluginPostStatusInfo : ( ) => ( /* reexport */ PluginPostStatusInfo ) ,
PluginPrePublishPanel : ( ) => ( /* reexport */ PluginPrePublishPanel ) ,
PluginSidebar : ( ) => ( /* reexport */ PluginSidebar ) ,
2024-04-17 11:32:24 +02:00
PluginSidebarMoreMenuItem : ( ) => ( /* reexport */ PluginSidebarMoreMenuItem ) ,
2025-12-12 13:15:55 +01:00
_ _experimentalFullscreenModeClose : ( ) => ( /* reexport */ fullscreen _mode _close _default ) ,
2025-02-28 08:42:11 +01:00
_ _experimentalMainDashboardButton : ( ) => ( /* binding */ _ _experimentalMainDashboardButton ) ,
_ _experimentalPluginPostExcerpt : ( ) => ( /* reexport */ _ _experimentalPluginPostExcerpt ) ,
2024-04-17 11:32:24 +02:00
initializeEditor : ( ) => ( /* binding */ initializeEditor ) ,
reinitializeEditor : ( ) => ( /* binding */ reinitializeEditor ) ,
2025-02-28 08:42:11 +01:00
store : ( ) => ( /* reexport */ store )
2022-06-16 14:03:35 +02:00
} ) ;
2021-04-27 08:32:47 +02:00
2025-02-28 08:42:11 +01:00
// NAMESPACE OBJECT: ./node_modules/@wordpress/edit-post/build-module/store/actions.js
2022-06-16 14:03:35 +02:00
var actions _namespaceObject = { } ;
_ _webpack _require _ _ . r ( actions _namespaceObject ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , {
2024-04-17 11:32:24 +02:00
_ _experimentalSetPreviewDeviceType : ( ) => ( _ _experimentalSetPreviewDeviceType ) ,
_ _unstableCreateTemplate : ( ) => ( _ _unstableCreateTemplate ) ,
closeGeneralSidebar : ( ) => ( closeGeneralSidebar ) ,
2025-02-28 08:42:11 +01:00
closeModal : ( ) => ( closeModal ) ,
2024-04-17 11:32:24 +02:00
closePublishSidebar : ( ) => ( closePublishSidebar ) ,
hideBlockTypes : ( ) => ( hideBlockTypes ) ,
initializeMetaBoxes : ( ) => ( initializeMetaBoxes ) ,
metaBoxUpdatesFailure : ( ) => ( metaBoxUpdatesFailure ) ,
metaBoxUpdatesSuccess : ( ) => ( metaBoxUpdatesSuccess ) ,
openGeneralSidebar : ( ) => ( openGeneralSidebar ) ,
2025-02-28 08:42:11 +01:00
openModal : ( ) => ( openModal ) ,
2024-04-17 11:32:24 +02:00
openPublishSidebar : ( ) => ( openPublishSidebar ) ,
removeEditorPanel : ( ) => ( removeEditorPanel ) ,
requestMetaBoxUpdates : ( ) => ( requestMetaBoxUpdates ) ,
setAvailableMetaBoxesPerLocation : ( ) => ( setAvailableMetaBoxesPerLocation ) ,
setIsEditingTemplate : ( ) => ( setIsEditingTemplate ) ,
setIsInserterOpened : ( ) => ( setIsInserterOpened ) ,
setIsListViewOpened : ( ) => ( setIsListViewOpened ) ,
showBlockTypes : ( ) => ( showBlockTypes ) ,
switchEditorMode : ( ) => ( switchEditorMode ) ,
toggleDistractionFree : ( ) => ( toggleDistractionFree ) ,
toggleEditorPanelEnabled : ( ) => ( toggleEditorPanelEnabled ) ,
toggleEditorPanelOpened : ( ) => ( toggleEditorPanelOpened ) ,
2025-02-28 08:42:11 +01:00
toggleFeature : ( ) => ( toggleFeature ) ,
2025-04-25 12:30:07 +02:00
toggleFullscreenMode : ( ) => ( toggleFullscreenMode ) ,
2024-04-17 11:32:24 +02:00
togglePinnedPluginItem : ( ) => ( togglePinnedPluginItem ) ,
togglePublishSidebar : ( ) => ( togglePublishSidebar ) ,
updatePreferredStyleVariations : ( ) => ( updatePreferredStyleVariations )
2022-06-16 14:03:35 +02:00
} ) ;
// NAMESPACE OBJECT: ./node_modules/@wordpress/edit-post/build-module/store/selectors.js
2025-02-28 08:42:11 +01:00
var selectors _namespaceObject = { } ;
_ _webpack _require _ _ . r ( selectors _namespaceObject ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , {
2024-04-17 11:32:24 +02:00
_ _experimentalGetInsertionPoint : ( ) => ( _ _experimentalGetInsertionPoint ) ,
_ _experimentalGetPreviewDeviceType : ( ) => ( _ _experimentalGetPreviewDeviceType ) ,
areMetaBoxesInitialized : ( ) => ( areMetaBoxesInitialized ) ,
getActiveGeneralSidebarName : ( ) => ( getActiveGeneralSidebarName ) ,
getActiveMetaBoxLocations : ( ) => ( getActiveMetaBoxLocations ) ,
getAllMetaBoxes : ( ) => ( getAllMetaBoxes ) ,
getEditedPostTemplate : ( ) => ( getEditedPostTemplate ) ,
getEditorMode : ( ) => ( getEditorMode ) ,
getHiddenBlockTypes : ( ) => ( getHiddenBlockTypes ) ,
getMetaBoxesPerLocation : ( ) => ( getMetaBoxesPerLocation ) ,
getPreference : ( ) => ( getPreference ) ,
getPreferences : ( ) => ( getPreferences ) ,
hasMetaBoxes : ( ) => ( hasMetaBoxes ) ,
isEditingTemplate : ( ) => ( isEditingTemplate ) ,
isEditorPanelEnabled : ( ) => ( isEditorPanelEnabled ) ,
isEditorPanelOpened : ( ) => ( isEditorPanelOpened ) ,
isEditorPanelRemoved : ( ) => ( isEditorPanelRemoved ) ,
isEditorSidebarOpened : ( ) => ( isEditorSidebarOpened ) ,
2025-02-28 08:42:11 +01:00
isFeatureActive : ( ) => ( isFeatureActive ) ,
2024-04-17 11:32:24 +02:00
isInserterOpened : ( ) => ( isInserterOpened ) ,
isListViewOpened : ( ) => ( isListViewOpened ) ,
isMetaBoxLocationActive : ( ) => ( isMetaBoxLocationActive ) ,
isMetaBoxLocationVisible : ( ) => ( isMetaBoxLocationVisible ) ,
2025-02-28 08:42:11 +01:00
isModalActive : ( ) => ( isModalActive ) ,
2024-04-17 11:32:24 +02:00
isPluginItemPinned : ( ) => ( isPluginItemPinned ) ,
isPluginSidebarOpened : ( ) => ( isPluginSidebarOpened ) ,
isPublishSidebarOpened : ( ) => ( isPublishSidebarOpened ) ,
isSavingMetaBoxes : ( ) => ( selectors _isSavingMetaBoxes )
2022-06-16 14:03:35 +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","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","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","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","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","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","editor"]
2024-04-17 11:32:24 +02:00
const external _wp _editor _namespaceObject = window [ "wp" ] [ "editor" ] ;
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-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/admin-ui/build-module/navigable-region/index.js
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 ;
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
; // external ["wp","plugins"]
2025-02-28 08:42:11 +01:00
const external _wp _plugins _namespaceObject = window [ "wp" ] [ "plugins" ] ;
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","primitives"]
2025-02-28 08:42:11 +01:00
const external _wp _primitives _namespaceObject = window [ "wp" ] [ "primitives" ] ;
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/icons/build-module/library/chevron-up.js
2022-04-02 10:26:41 +02:00
2025-12-12 13:15:55 +01:00
var chevron _up _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 : "M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z" } ) } ) ;
2022-04-02 10:26:41 +02:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/icons/build-module/library/chevron-down.js
2021-07-23 11:58:50 +02:00
2022-06-16 14:03:35 +02:00
2025-12-12 13:15:55 +01:00
var chevron _down _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 : "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z" } ) } ) ;
2023-12-07 09:44:11 +01:00
2025-04-25 12:30:07 +02:00
; // external ["wp","notices"]
2025-02-28 08:42:11 +01:00
const external _wp _notices _namespaceObject = window [ "wp" ] [ "notices" ] ;
2025-04-25 12:30:07 +02:00
; // external ["wp","commands"]
2025-02-28 08:42:11 +01:00
const external _wp _commands _namespaceObject = window [ "wp" ] [ "commands" ] ;
2025-04-25 12:30:07 +02:00
; // external ["wp","url"]
2025-02-28 08:42:11 +01:00
const external _wp _url _namespaceObject = window [ "wp" ] [ "url" ] ;
2025-04-25 12:30:07 +02:00
; // external ["wp","htmlEntities"]
2025-02-28 08:42:11 +01:00
const external _wp _htmlEntities _namespaceObject = window [ "wp" ] [ "htmlEntities" ] ;
2025-04-25 12:30:07 +02:00
; // external ["wp","coreData"]
2025-02-28 08:42:11 +01:00
const external _wp _coreData _namespaceObject = window [ "wp" ] [ "coreData" ] ;
2025-04-25 12:30:07 +02:00
; // external ["wp","components"]
2025-02-28 08:42:11 +01:00
const external _wp _components _namespaceObject = window [ "wp" ] [ "components" ] ;
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
; // ./node_modules/@wordpress/icons/build-module/library/wordpress.js
2021-07-23 11:58:50 +02:00
2021-04-27 08:32:47 +02:00
2025-12-12 13:15:55 +01:00
var wordpress _default = /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _primitives _namespaceObject . SVG , { xmlns : "http://www.w3.org/2000/svg" , viewBox : "-2 -2 24 24" , children : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _primitives _namespaceObject . Path , { d : "M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z" } ) } ) ;
2021-04-27 08:32:47 +02:00
2020-05-06 17:23:38 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/icons/build-module/library/arrow-up-left.js
2020-05-06 17:23:38 +02:00
2019-11-15 22:59:44 +01:00
2025-12-12 13:15:55 +01:00
var arrow _up _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 , { d : "M14 6H6v8h1.5V8.5L17 18l1-1-9.5-9.5H14V6Z" } ) } ) ;
2019-11-02 10:38:58 +01:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-post/build-module/components/back-button/fullscreen-mode-close.js
2019-11-02 10:38:58 +01:00
2020-12-10 14:06:04 +01:00
2020-05-06 17:23:38 +02:00
2025-12-12 13:15:55 +01:00
const siteIconVariants = {
edit : {
clipPath : "inset(0% round 0px)"
} ,
hover : {
clipPath : "inset( 22% round 2px )"
} ,
tap : {
clipPath : "inset(0% round 0px)"
}
} ;
const toggleHomeIconVariants = {
edit : {
opacity : 0 ,
scale : 0.2
} ,
hover : {
opacity : 1 ,
scale : 1 ,
clipPath : "inset( 22% round 2px )"
}
} ;
function FullscreenModeClose ( { showTooltip , icon , href , initialPost } ) {
const { isRequestingSiteIcon , postType , siteIconUrl } = ( 0 , external _wp _data _namespaceObject . useSelect ) (
( select ) => {
const { getCurrentPostType } = select ( external _wp _editor _namespaceObject . store ) ;
const { getEntityRecord , getPostType , isResolving } = select ( external _wp _coreData _namespaceObject . store ) ;
const siteData = getEntityRecord ( "root" , "__unstableBase" , void 0 ) || { } ;
const _postType = initialPost ? . type || getCurrentPostType ( ) ;
return {
isRequestingSiteIcon : isResolving ( "getEntityRecord" , [
"root" ,
"__unstableBase" ,
void 0
] ) ,
postType : getPostType ( _postType ) ,
siteIconUrl : siteData . site _icon _url
} ;
} ,
[ initialPost ? . type ]
) ;
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 transition = {
duration : disableMotion ? 0 : 0.2
} ;
2025-02-28 08:42:11 +01:00
if ( ! postType ) {
return null ;
2023-12-07 09:44:11 +01:00
}
2025-12-12 13:15:55 +01:00
let siteIconContent ;
if ( isRequestingSiteIcon && ! siteIconUrl ) {
siteIconContent = /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( "div" , { className : "edit-post-fullscreen-mode-close-site-icon__image" } ) ;
} else if ( siteIconUrl ) {
siteIconContent = /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
"img" ,
{
className : "edit-post-fullscreen-mode-close-site-icon__image" ,
alt : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Site Icon" ) ,
src : siteIconUrl
2025-02-28 08:42:11 +01:00
}
2025-12-12 13:15:55 +01:00
) ;
} else {
siteIconContent = /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _components _namespaceObject . Icon ,
{
className : "edit-post-fullscreen-mode-close-site-icon__icon" ,
icon : wordpress _default ,
size : 48
}
) ;
2025-02-28 08:42:11 +01:00
}
2025-12-12 13:15:55 +01:00
const buttonIcon = icon ? /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _components _namespaceObject . Icon , { size : "36px" , icon } ) : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( "div" , { className : "edit-post-fullscreen-mode-close-site-icon" , children : siteIconContent } ) ;
const classes = dist _clsx ( "edit-post-fullscreen-mode-close" , {
"has-icon" : siteIconUrl
2025-02-28 08:42:11 +01:00
} ) ;
2025-12-12 13:15:55 +01:00
const buttonHref = href ? ? ( 0 , external _wp _url _namespaceObject . addQueryArgs ) ( "edit.php" , {
2025-02-28 08:42:11 +01:00
post _type : postType . slug
} ) ;
2025-12-12 13:15:55 +01:00
const buttonLabel = postType ? . labels ? . view _items ? ? ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Back" ) ;
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) (
external _wp _components _namespaceObject . _ _unstableMotion . div ,
{
className : "edit-post-fullscreen-mode-close__view-mode-toggle" ,
animate : "edit" ,
initial : "edit" ,
whileHover : "hover" ,
whileTap : "tap" ,
transition ,
children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _components _namespaceObject . Button ,
{
_ _next40pxDefaultSize : true ,
className : classes ,
href : buttonHref ,
label : buttonLabel ,
showTooltip ,
tooltipPosition : "middle right" ,
children : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _components _namespaceObject . _ _unstableMotion . div , { variants : ! disableMotion && siteIconVariants , children : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( "div" , { className : "edit-post-fullscreen-mode-close__view-mode-toggle-icon" , children : buttonIcon } ) } )
}
) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _components _namespaceObject . _ _unstableMotion . div ,
{
className : dist _clsx (
"edit-post-fullscreen-mode-close__back-icon" ,
{
"has-site-icon" : siteIconUrl
}
) ,
variants : ! disableMotion && toggleHomeIconVariants ,
children : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _components _namespaceObject . Icon , { icon : arrow _up _left _default } )
}
)
]
}
) ;
2025-02-28 08:42:11 +01:00
}
2025-12-12 13:15:55 +01:00
var fullscreen _mode _close _default = FullscreenModeClose ;
2023-09-26 10:33:34 +02:00
2025-04-25 12:30:07 +02:00
; // external ["wp","privateApis"]
2025-02-28 08:42:11 +01:00
const external _wp _privateApis _namespaceObject = window [ "wp" ] [ "privateApis" ] ;
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/edit-post/build-module/lock-unlock.js
2020-09-15 14:29:22 +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-post"
) ;
2020-09-15 14:29:22 +02:00
2019-11-02 10:38:58 +01:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-post/build-module/components/back-button/index.js
2020-09-15 14:29:22 +02:00
2019-11-02 10:38:58 +01:00
2020-09-15 14:29:22 +02:00
2023-04-26 17:39:43 +02:00
2025-12-12 13:15:55 +01:00
const { BackButton : BackButtonFill } = unlock ( external _wp _editor _namespaceObject . privateApis ) ;
2025-02-28 08:42:11 +01:00
const slideX = {
2025-12-12 13:15:55 +01:00
hidden : { x : "-100%" } ,
distractionFreeInactive : { x : 0 } ,
hover : { x : 0 , transition : { type : "tween" , delay : 0.2 } }
2025-02-28 08:42:11 +01:00
} ;
2025-12-12 13:15:55 +01:00
function BackButton ( { initialPost } ) {
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( BackButtonFill , { children : ( { length } ) => length <= 1 && /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _components _namespaceObject . _ _unstableMotion . div ,
{
2025-02-28 08:42:11 +01:00
variants : slideX ,
2025-12-12 13:15:55 +01:00
transition : { type : "tween" , delay : 0.8 } ,
children : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
fullscreen _mode _close _default ,
{
showTooltip : true ,
initialPost
}
)
}
) } ) ;
2025-02-28 08:42:11 +01:00
}
2025-12-12 13:15:55 +01:00
var back _button _default = BackButton ;
2023-04-26 17:39:43 +02:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/edit-post/build-module/store/constants.js
2025-12-12 13:15:55 +01:00
const STORE _NAME = "core/edit-post" ;
const VIEW _AS _LINK _SELECTOR = "#wp-admin-bar-view a" ;
const VIEW _AS _PREVIEW _LINK _SELECTOR = "#wp-admin-bar-preview a" ;
2023-12-07 09:44:11 +01:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-post/build-module/components/editor-initialization/listener-hooks.js
2022-04-02 10:26:41 +02:00
2025-02-28 08:42:11 +01:00
2023-12-07 09:44:11 +01:00
2025-02-28 08:42:11 +01:00
const useUpdatePostLinkListener = ( ) => {
2025-12-12 13:15:55 +01:00
const { isViewable , newPermalink } = ( 0 , external _wp _data _namespaceObject . useSelect ) ( ( select ) => {
const { getPostType } = select ( external _wp _coreData _namespaceObject . store ) ;
const { getCurrentPost , getEditedPostAttribute } = select ( external _wp _editor _namespaceObject . store ) ;
const postType = getPostType ( getEditedPostAttribute ( "type" ) ) ;
return {
isViewable : postType ? . viewable ,
newPermalink : getCurrentPost ( ) . link
} ;
} , [ ] ) ;
2025-02-28 08:42:11 +01:00
const nodeToUpdateRef = ( 0 , external _wp _element _namespaceObject . useRef ) ( ) ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
nodeToUpdateRef . current = document . querySelector ( VIEW _AS _PREVIEW _LINK _SELECTOR ) || document . querySelector ( VIEW _AS _LINK _SELECTOR ) ;
} , [ ] ) ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
if ( ! newPermalink || ! nodeToUpdateRef . current ) {
return ;
}
2025-12-12 13:15:55 +01:00
if ( ! isViewable ) {
nodeToUpdateRef . current . style . display = "none" ;
return ;
}
nodeToUpdateRef . current . style . display = "" ;
nodeToUpdateRef . current . setAttribute ( "href" , newPermalink ) ;
} , [ newPermalink , isViewable ] ) ;
2025-02-28 08:42:11 +01:00
} ;
2023-12-07 09:44:11 +01:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-post/build-module/components/editor-initialization/index.js
2023-12-07 09:44:11 +01:00
2025-02-28 08:42:11 +01:00
function EditorInitialization ( ) {
useUpdatePostLinkListener ( ) ;
return null ;
2023-09-26 10:33:34 +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
; // external ["wp","keyboardShortcuts"]
2025-02-28 08:42:11 +01:00
const external _wp _keyboardShortcuts _namespaceObject = window [ "wp" ] [ "keyboardShortcuts" ] ;
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/edit-post/build-module/store/reducer.js
2025-12-12 13:15:55 +01:00
2025-02-28 08:42:11 +01:00
function isSavingMetaBoxes ( state = false , action ) {
switch ( action . type ) {
2025-12-12 13:15:55 +01:00
case "REQUEST_META_BOX_UPDATES" :
2025-02-28 08:42:11 +01:00
return true ;
2025-12-12 13:15:55 +01:00
case "META_BOX_UPDATES_SUCCESS" :
case "META_BOX_UPDATES_FAILURE" :
2025-02-28 08:42:11 +01:00
return false ;
default :
return state ;
2023-12-07 09:44:11 +01:00
}
2025-02-28 08:42:11 +01:00
}
function mergeMetaboxes ( metaboxes = [ ] , newMetaboxes ) {
const mergedMetaboxes = [ ... metaboxes ] ;
for ( const metabox of newMetaboxes ) {
2025-12-12 13:15:55 +01:00
const existing = mergedMetaboxes . findIndex (
( box ) => box . id === metabox . id
) ;
2025-02-28 08:42:11 +01:00
if ( existing !== - 1 ) {
mergedMetaboxes [ existing ] = metabox ;
} else {
mergedMetaboxes . push ( metabox ) ;
}
2022-12-15 17:47:31 +01:00
}
2025-02-28 08:42:11 +01:00
return mergedMetaboxes ;
}
function metaBoxLocations ( state = { } , action ) {
2022-12-15 17:47:31 +01:00
switch ( action . type ) {
2025-12-12 13:15:55 +01:00
case "SET_META_BOXES_PER_LOCATIONS" : {
const newState = { ... state } ;
for ( const [ location , metaboxes ] of Object . entries (
action . metaBoxesPerLocation
) ) {
newState [ location ] = mergeMetaboxes (
newState [ location ] ,
metaboxes
) ;
2022-12-15 17:47:31 +01:00
}
2025-12-12 13:15:55 +01:00
return newState ;
}
2022-12-15 17:47:31 +01:00
}
return state ;
}
2025-02-28 08:42:11 +01:00
function metaBoxesInitialized ( state = false , action ) {
2023-09-26 10:33:34 +02:00
switch ( action . type ) {
2025-12-12 13:15:55 +01:00
case "META_BOXES_INITIALIZED" :
2025-02-28 08:42:11 +01:00
return true ;
2023-09-26 10:33:34 +02:00
}
return state ;
}
2025-02-28 08:42:11 +01:00
const metaBoxes = ( 0 , external _wp _data _namespaceObject . combineReducers ) ( {
isSaving : isSavingMetaBoxes ,
locations : metaBoxLocations ,
initialized : metaBoxesInitialized
} ) ;
2025-12-12 13:15:55 +01:00
var reducer _default = ( 0 , external _wp _data _namespaceObject . combineReducers ) ( {
2025-02-28 08:42:11 +01:00
metaBoxes
2025-12-12 13:15:55 +01:00
} ) ;
2022-12-15 17:47:31 +01:00
2025-04-25 12:30:07 +02:00
; // external ["wp","apiFetch"]
2025-02-28 08:42:11 +01:00
const external _wp _apiFetch _namespaceObject = window [ "wp" ] [ "apiFetch" ] ;
var external _wp _apiFetch _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( external _wp _apiFetch _namespaceObject ) ;
2025-04-25 12:30:07 +02:00
; // external ["wp","hooks"]
2025-02-28 08:42:11 +01:00
const external _wp _hooks _namespaceObject = window [ "wp" ] [ "hooks" ] ;
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/edit-post/build-module/utils/meta-boxes.js
2025-12-12 13:15:55 +01:00
const getMetaBoxContainer = ( location ) => {
const area = document . querySelector (
` .edit-post-meta-boxes-area.is- ${ location } .metabox-location- ${ location } `
) ;
2025-02-28 08:42:11 +01:00
if ( area ) {
return area ;
}
2025-12-12 13:15:55 +01:00
return document . querySelector ( "#metaboxes .metabox-location-" + location ) ;
2025-02-28 08:42:11 +01:00
} ;
2019-11-02 10:38:58 +01:00
2023-12-07 09:44:11 +01:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-post/build-module/store/actions.js
2019-11-02 10:38:58 +01:00
2022-06-16 14:03:35 +02:00
2022-12-15 17:47:31 +01:00
2025-04-25 12:30:07 +02:00
2021-04-27 08:32:47 +02:00
2025-02-28 08:42:11 +01:00
2025-12-12 13:15:55 +01:00
const { interfaceStore } = unlock ( external _wp _editor _namespaceObject . privateApis ) ;
const openGeneralSidebar = ( name ) => ( { registry } ) => {
registry . dispatch ( interfaceStore ) . enableComplementaryArea ( "core" , name ) ;
2025-02-28 08:42:11 +01:00
} ;
2025-12-12 13:15:55 +01:00
const closeGeneralSidebar = ( ) => ( { registry } ) => registry . dispatch ( interfaceStore ) . disableComplementaryArea ( "core" ) ;
const openModal = ( name ) => ( { registry } ) => {
2025-02-28 08:42:11 +01:00
external _wp _deprecated _default ( ) ( "select( 'core/edit-post' ).openModal( name )" , {
2025-12-12 13:15:55 +01:00
since : "6.3" ,
2025-02-28 08:42:11 +01:00
alternative : "select( 'core/interface').openModal( name )"
2023-09-26 10:33:34 +02:00
} ) ;
2025-02-28 08:42:11 +01:00
return registry . dispatch ( interfaceStore ) . openModal ( name ) ;
} ;
2025-12-12 13:15:55 +01:00
const closeModal = ( ) => ( { registry } ) => {
2025-02-28 08:42:11 +01:00
external _wp _deprecated _default ( ) ( "select( 'core/edit-post' ).closeModal()" , {
2025-12-12 13:15:55 +01:00
since : "6.3" ,
2025-02-28 08:42:11 +01:00
alternative : "select( 'core/interface').closeModal()"
} ) ;
return registry . dispatch ( interfaceStore ) . closeModal ( ) ;
} ;
2025-12-12 13:15:55 +01:00
const openPublishSidebar = ( ) => ( { registry } ) => {
2025-02-28 08:42:11 +01:00
external _wp _deprecated _default ( ) ( "dispatch( 'core/edit-post' ).openPublishSidebar" , {
2025-12-12 13:15:55 +01:00
since : "6.6" ,
2025-02-28 08:42:11 +01:00
alternative : "dispatch( 'core/editor').openPublishSidebar"
} ) ;
registry . dispatch ( external _wp _editor _namespaceObject . store ) . openPublishSidebar ( ) ;
} ;
2025-12-12 13:15:55 +01:00
const closePublishSidebar = ( ) => ( { registry } ) => {
2025-02-28 08:42:11 +01:00
external _wp _deprecated _default ( ) ( "dispatch( 'core/edit-post' ).closePublishSidebar" , {
2025-12-12 13:15:55 +01:00
since : "6.6" ,
2025-02-28 08:42:11 +01:00
alternative : "dispatch( 'core/editor').closePublishSidebar"
2023-09-26 10:33:34 +02:00
} ) ;
2025-02-28 08:42:11 +01:00
registry . dispatch ( external _wp _editor _namespaceObject . store ) . closePublishSidebar ( ) ;
2022-06-16 14:03:35 +02:00
} ;
2025-12-12 13:15:55 +01:00
const togglePublishSidebar = ( ) => ( { registry } ) => {
2025-02-28 08:42:11 +01:00
external _wp _deprecated _default ( ) ( "dispatch( 'core/edit-post' ).togglePublishSidebar" , {
2025-12-12 13:15:55 +01:00
since : "6.6" ,
2025-02-28 08:42:11 +01:00
alternative : "dispatch( 'core/editor').togglePublishSidebar"
2022-04-02 10:26:41 +02:00
} ) ;
2025-02-28 08:42:11 +01:00
registry . dispatch ( external _wp _editor _namespaceObject . store ) . togglePublishSidebar ( ) ;
} ;
2025-12-12 13:15:55 +01:00
const toggleEditorPanelEnabled = ( panelName ) => ( { registry } ) => {
2025-02-28 08:42:11 +01:00
external _wp _deprecated _default ( ) ( "dispatch( 'core/edit-post' ).toggleEditorPanelEnabled" , {
2025-12-12 13:15:55 +01:00
since : "6.5" ,
2025-02-28 08:42:11 +01:00
alternative : "dispatch( 'core/editor').toggleEditorPanelEnabled"
} ) ;
registry . dispatch ( external _wp _editor _namespaceObject . store ) . toggleEditorPanelEnabled ( panelName ) ;
} ;
2025-12-12 13:15:55 +01:00
const toggleEditorPanelOpened = ( panelName ) => ( { registry } ) => {
2025-02-28 08:42:11 +01:00
external _wp _deprecated _default ( ) ( "dispatch( 'core/edit-post' ).toggleEditorPanelOpened" , {
2025-12-12 13:15:55 +01:00
since : "6.5" ,
2025-02-28 08:42:11 +01:00
alternative : "dispatch( 'core/editor').toggleEditorPanelOpened"
2023-09-26 10:33:34 +02:00
} ) ;
2025-02-28 08:42:11 +01:00
registry . dispatch ( external _wp _editor _namespaceObject . store ) . toggleEditorPanelOpened ( panelName ) ;
} ;
2025-12-12 13:15:55 +01:00
const removeEditorPanel = ( panelName ) => ( { registry } ) => {
2025-02-28 08:42:11 +01:00
external _wp _deprecated _default ( ) ( "dispatch( 'core/edit-post' ).removeEditorPanel" , {
2025-12-12 13:15:55 +01:00
since : "6.5" ,
2025-02-28 08:42:11 +01:00
alternative : "dispatch( 'core/editor').removeEditorPanel"
} ) ;
registry . dispatch ( external _wp _editor _namespaceObject . store ) . removeEditorPanel ( panelName ) ;
} ;
2025-12-12 13:15:55 +01:00
const toggleFeature = ( feature ) => ( { registry } ) => registry . dispatch ( external _wp _preferences _namespaceObject . store ) . toggle ( "core/edit-post" , feature ) ;
const switchEditorMode = ( mode ) => ( { registry } ) => {
2025-02-28 08:42:11 +01:00
external _wp _deprecated _default ( ) ( "dispatch( 'core/edit-post' ).switchEditorMode" , {
2025-12-12 13:15:55 +01:00
since : "6.6" ,
2025-02-28 08:42:11 +01:00
alternative : "dispatch( 'core/editor').switchEditorMode"
} ) ;
registry . dispatch ( external _wp _editor _namespaceObject . store ) . switchEditorMode ( mode ) ;
} ;
2025-12-12 13:15:55 +01:00
const togglePinnedPluginItem = ( pluginName ) => ( { registry } ) => {
const isPinned = registry . select ( interfaceStore ) . isItemPinned ( "core" , pluginName ) ;
registry . dispatch ( interfaceStore ) [ isPinned ? "unpinItem" : "pinItem" ] ( "core" , pluginName ) ;
2025-02-28 08:42:11 +01:00
} ;
function updatePreferredStyleVariations ( ) {
external _wp _deprecated _default ( ) ( "dispatch( 'core/edit-post' ).updatePreferredStyleVariations" , {
2025-12-12 13:15:55 +01:00
since : "6.6" ,
hint : "Preferred Style Variations are not supported anymore."
2023-09-26 10:33:34 +02:00
} ) ;
2025-12-12 13:15:55 +01:00
return { type : "NOTHING" } ;
2021-04-27 08:32:47 +02:00
}
2025-12-12 13:15:55 +01:00
const showBlockTypes = ( blockNames ) => ( { registry } ) => {
2025-02-28 08:42:11 +01:00
unlock ( registry . dispatch ( external _wp _editor _namespaceObject . store ) ) . showBlockTypes ( blockNames ) ;
} ;
2025-12-12 13:15:55 +01:00
const hideBlockTypes = ( blockNames ) => ( { registry } ) => {
2025-02-28 08:42:11 +01:00
unlock ( registry . dispatch ( external _wp _editor _namespaceObject . store ) ) . hideBlockTypes ( blockNames ) ;
} ;
function setAvailableMetaBoxesPerLocation ( metaBoxesPerLocation ) {
return {
2025-12-12 13:15:55 +01:00
type : "SET_META_BOXES_PER_LOCATIONS" ,
2025-02-28 08:42:11 +01:00
metaBoxesPerLocation
} ;
}
2025-12-12 13:15:55 +01:00
const requestMetaBoxUpdates = ( ) => async ( { registry , select , dispatch } ) => {
2025-02-28 08:42:11 +01:00
dispatch ( {
2025-12-12 13:15:55 +01:00
type : "REQUEST_META_BOX_UPDATES"
2025-02-28 08:42:11 +01:00
} ) ;
if ( window . tinyMCE ) {
window . tinyMCE . triggerSave ( ) ;
}
2025-12-12 13:15:55 +01:00
const baseFormData = new window . FormData (
document . querySelector ( ".metabox-base-form" )
) ;
const postId = baseFormData . get ( "post_ID" ) ;
const postType = baseFormData . get ( "post_type" ) ;
const post = registry . select ( external _wp _coreData _namespaceObject . store ) . getEditedEntityRecord ( "postType" , postType , postId ) ;
const additionalData = [
post . comment _status ? [ "comment_status" , post . comment _status ] : false ,
post . ping _status ? [ "ping_status" , post . ping _status ] : false ,
post . sticky ? [ "sticky" , post . sticky ] : false ,
post . author ? [ "post_author" , post . author ] : false
] . filter ( Boolean ) ;
2025-02-28 08:42:11 +01:00
const activeMetaBoxLocations = select . getActiveMetaBoxLocations ( ) ;
2025-12-12 13:15:55 +01:00
const formDataToMerge = [
baseFormData ,
... activeMetaBoxLocations . map (
( location ) => new window . FormData ( getMetaBoxContainer ( location ) )
)
] ;
2025-02-28 08:42:11 +01:00
const formData = formDataToMerge . reduce ( ( memo , currentFormData ) => {
for ( const [ key , value ] of currentFormData ) {
memo . append ( key , value ) ;
}
return memo ;
} , new window . FormData ( ) ) ;
2025-12-12 13:15:55 +01:00
additionalData . forEach (
( [ key , value ] ) => formData . append ( key , value )
) ;
2025-02-28 08:42:11 +01:00
try {
await external _wp _apiFetch _default ( ) ( {
url : window . _wpMetaBoxUrl ,
2025-12-12 13:15:55 +01:00
method : "POST" ,
2025-02-28 08:42:11 +01:00
body : formData ,
parse : false
} ) ;
dispatch . metaBoxUpdatesSuccess ( ) ;
} catch {
dispatch . metaBoxUpdatesFailure ( ) ;
}
} ;
function metaBoxUpdatesSuccess ( ) {
return {
2025-12-12 13:15:55 +01:00
type : "META_BOX_UPDATES_SUCCESS"
2025-02-28 08:42:11 +01:00
} ;
}
function metaBoxUpdatesFailure ( ) {
return {
2025-12-12 13:15:55 +01:00
type : "META_BOX_UPDATES_FAILURE"
2025-02-28 08:42:11 +01:00
} ;
2022-04-02 10:26:41 +02:00
}
2025-12-12 13:15:55 +01:00
const _ _experimentalSetPreviewDeviceType = ( deviceType ) => ( { registry } ) => {
external _wp _deprecated _default ( ) (
"dispatch( 'core/edit-post' ).__experimentalSetPreviewDeviceType" ,
{
since : "6.5" ,
version : "6.7" ,
hint : "registry.dispatch( editorStore ).setDeviceType"
}
) ;
2025-02-28 08:42:11 +01:00
registry . dispatch ( external _wp _editor _namespaceObject . store ) . setDeviceType ( deviceType ) ;
2022-06-16 14:03:35 +02:00
} ;
2025-12-12 13:15:55 +01:00
const setIsInserterOpened = ( value ) => ( { registry } ) => {
2025-02-28 08:42:11 +01:00
external _wp _deprecated _default ( ) ( "dispatch( 'core/edit-post' ).setIsInserterOpened" , {
2025-12-12 13:15:55 +01:00
since : "6.5" ,
2025-02-28 08:42:11 +01:00
alternative : "dispatch( 'core/editor').setIsInserterOpened"
} ) ;
registry . dispatch ( external _wp _editor _namespaceObject . store ) . setIsInserterOpened ( value ) ;
} ;
2025-12-12 13:15:55 +01:00
const setIsListViewOpened = ( isOpen ) => ( { registry } ) => {
2025-02-28 08:42:11 +01:00
external _wp _deprecated _default ( ) ( "dispatch( 'core/edit-post' ).setIsListViewOpened" , {
2025-12-12 13:15:55 +01:00
since : "6.5" ,
2025-02-28 08:42:11 +01:00
alternative : "dispatch( 'core/editor').setIsListViewOpened"
} ) ;
registry . dispatch ( external _wp _editor _namespaceObject . store ) . setIsListViewOpened ( isOpen ) ;
} ;
function setIsEditingTemplate ( ) {
external _wp _deprecated _default ( ) ( "dispatch( 'core/edit-post' ).setIsEditingTemplate" , {
2025-12-12 13:15:55 +01:00
since : "6.5" ,
2025-02-28 08:42:11 +01:00
alternative : "dispatch( 'core/editor').setRenderingMode"
} ) ;
2025-12-12 13:15:55 +01:00
return { type : "NOTHING" } ;
2025-02-28 08:42:11 +01:00
}
function _ _unstableCreateTemplate ( ) {
external _wp _deprecated _default ( ) ( "dispatch( 'core/edit-post' ).__unstableCreateTemplate" , {
2025-12-12 13:15:55 +01:00
since : "6.5"
2025-02-28 08:42:11 +01:00
} ) ;
2025-12-12 13:15:55 +01:00
return { type : "NOTHING" } ;
2022-06-16 14:03:35 +02:00
}
2025-02-28 08:42:11 +01:00
let actions _metaBoxesInitialized = false ;
2025-12-12 13:15:55 +01:00
const initializeMetaBoxes = ( ) => ( { registry , select , dispatch } ) => {
2025-02-28 08:42:11 +01:00
const isEditorReady = registry . select ( external _wp _editor _namespaceObject . store ) . _ _unstableIsEditorReady ( ) ;
if ( ! isEditorReady ) {
return ;
}
if ( actions _metaBoxesInitialized ) {
return ;
}
const postType = registry . select ( external _wp _editor _namespaceObject . store ) . getCurrentPostType ( ) ;
if ( window . postboxes . page !== postType ) {
window . postboxes . add _postbox _toggles ( postType ) ;
}
actions _metaBoxesInitialized = true ;
2025-12-12 13:15:55 +01:00
( 0 , external _wp _hooks _namespaceObject . addAction ) (
"editor.savePost" ,
"core/edit-post/save-metaboxes" ,
async ( post , options ) => {
if ( ! options . isAutosave && select . hasMetaBoxes ( ) ) {
await dispatch . requestMetaBoxUpdates ( ) ;
}
2025-02-28 08:42:11 +01:00
}
2025-12-12 13:15:55 +01:00
) ;
2025-02-28 08:42:11 +01:00
dispatch ( {
2025-12-12 13:15:55 +01:00
type : "META_BOXES_INITIALIZED"
2025-02-28 08:42:11 +01:00
} ) ;
} ;
2025-12-12 13:15:55 +01:00
const toggleDistractionFree = ( ) => ( { registry } ) => {
2025-02-28 08:42:11 +01:00
external _wp _deprecated _default ( ) ( "dispatch( 'core/edit-post' ).toggleDistractionFree" , {
2025-12-12 13:15:55 +01:00
since : "6.6" ,
2025-02-28 08:42:11 +01:00
alternative : "dispatch( 'core/editor').toggleDistractionFree"
} ) ;
registry . dispatch ( external _wp _editor _namespaceObject . store ) . toggleDistractionFree ( ) ;
} ;
2025-12-12 13:15:55 +01:00
const toggleFullscreenMode = ( ) => ( { registry } ) => {
const isFullscreen = registry . select ( external _wp _preferences _namespaceObject . store ) . get ( "core/edit-post" , "fullscreenMode" ) ;
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . toggle ( "core/edit-post" , "fullscreenMode" ) ;
registry . dispatch ( external _wp _notices _namespaceObject . store ) . createInfoNotice (
isFullscreen ? ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Fullscreen mode deactivated." ) : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Fullscreen mode activated." ) ,
{
id : "core/edit-post/toggle-fullscreen-mode/notice" ,
type : "snackbar" ,
actions : [
{
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Undo" ) ,
onClick : ( ) => {
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . toggle (
"core/edit-post" ,
"fullscreenMode"
) ;
}
}
]
}
) ;
2025-04-25 12:30:07 +02:00
} ;
2020-05-06 17:23:38 +02:00
2021-04-27 08:32:47 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-post/build-module/store/selectors.js
2021-04-27 08:32:47 +02:00
2019-11-15 22:59:44 +01:00
2019-11-02 10:38:58 +01:00
2025-12-12 13:15:55 +01:00
const { interfaceStore : selectors _interfaceStore } = unlock ( external _wp _editor _namespaceObject . privateApis ) ;
2025-02-28 08:42:11 +01:00
const EMPTY _ARRAY = [ ] ;
const EMPTY _OBJECT = { } ;
2025-12-12 13:15:55 +01:00
const getEditorMode = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) (
( select ) => ( ) => select ( external _wp _preferences _namespaceObject . store ) . get ( "core" , "editorMode" ) ? ? "visual"
) ;
const isEditorSidebarOpened = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) (
( select ) => ( ) => {
const activeGeneralSidebar = select ( selectors _interfaceStore ) . getActiveComplementaryArea ( "core" ) ;
return [ "edit-post/document" , "edit-post/block" ] . includes (
activeGeneralSidebar
) ;
}
) ;
const isPluginSidebarOpened = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) (
( select ) => ( ) => {
const activeGeneralSidebar = select ( selectors _interfaceStore ) . getActiveComplementaryArea ( "core" ) ;
return ! ! activeGeneralSidebar && ! [ "edit-post/document" , "edit-post/block" ] . includes (
activeGeneralSidebar
) ;
}
) ;
const getActiveGeneralSidebarName = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) (
( select ) => ( ) => {
return select ( selectors _interfaceStore ) . getActiveComplementaryArea ( "core" ) ;
}
) ;
2025-02-28 08:42:11 +01:00
function convertPanelsToOldFormat ( inactivePanels , openPanels ) {
2025-12-12 13:15:55 +01:00
const panelsWithEnabledState = inactivePanels ? . reduce (
( accumulatedPanels , panelName ) => ( {
... accumulatedPanels ,
[ panelName ] : {
enabled : false
}
} ) ,
{ }
) ;
2025-02-28 08:42:11 +01:00
const panels = openPanels ? . reduce ( ( accumulatedPanels , panelName ) => {
const currentPanelState = accumulatedPanels ? . [ panelName ] ;
return {
... accumulatedPanels ,
[ panelName ] : {
... currentPanelState ,
opened : true
}
} ;
2025-12-12 13:15:55 +01:00
} , panelsWithEnabledState ? ? { } ) ;
return panels ? ? panelsWithEnabledState ? ? EMPTY _OBJECT ;
2025-02-28 08:42:11 +01:00
}
2025-12-12 13:15:55 +01:00
const getPreferences = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( ( select ) => ( ) => {
2025-02-28 08:42:11 +01:00
external _wp _deprecated _default ( ) ( ` select( 'core/edit-post' ).getPreferences ` , {
2025-12-12 13:15:55 +01:00
since : "6.0" ,
2025-02-28 08:42:11 +01:00
alternative : ` select( 'core/preferences' ).get `
2023-09-26 10:33:34 +02:00
} ) ;
2025-12-12 13:15:55 +01:00
const corePreferences = [ "editorMode" , "hiddenBlockTypes" ] . reduce (
( accumulatedPrefs , preferenceKey ) => {
const value = select ( external _wp _preferences _namespaceObject . store ) . get (
"core" ,
preferenceKey
) ;
return {
... accumulatedPrefs ,
[ preferenceKey ] : value
} ;
} ,
{ }
) ;
const inactivePanels = select ( external _wp _preferences _namespaceObject . store ) . get (
"core" ,
"inactivePanels"
) ;
const openPanels = select ( external _wp _preferences _namespaceObject . store ) . get ( "core" , "openPanels" ) ;
2025-02-28 08:42:11 +01:00
const panels = convertPanelsToOldFormat ( inactivePanels , openPanels ) ;
2023-04-26 17:39:43 +02:00
return {
2025-02-28 08:42:11 +01:00
... corePreferences ,
panels
2023-04-26 17:39:43 +02:00
} ;
2025-02-28 08:42:11 +01:00
} ) ;
function getPreference ( state , preferenceKey , defaultValue ) {
external _wp _deprecated _default ( ) ( ` select( 'core/edit-post' ).getPreference ` , {
2025-12-12 13:15:55 +01:00
since : "6.0" ,
2025-02-28 08:42:11 +01:00
alternative : ` select( 'core/preferences' ).get `
} ) ;
const preferences = getPreferences ( state ) ;
const value = preferences [ preferenceKey ] ;
2025-12-12 13:15:55 +01:00
return value === void 0 ? defaultValue : value ;
2025-02-28 08:42:11 +01:00
}
2025-12-12 13:15:55 +01:00
const getHiddenBlockTypes = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( ( select ) => ( ) => {
return select ( external _wp _preferences _namespaceObject . store ) . get ( "core" , "hiddenBlockTypes" ) ? ? EMPTY _ARRAY ;
2025-02-28 08:42:11 +01:00
} ) ;
2025-12-12 13:15:55 +01:00
const isPublishSidebarOpened = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) (
( select ) => ( ) => {
external _wp _deprecated _default ( ) ( ` select( 'core/edit-post' ).isPublishSidebarOpened ` , {
since : "6.6" ,
alternative : ` select( 'core/editor' ).isPublishSidebarOpened `
} ) ;
return select ( external _wp _editor _namespaceObject . store ) . isPublishSidebarOpened ( ) ;
}
) ;
const isEditorPanelRemoved = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) (
( select ) => ( state , panelName ) => {
external _wp _deprecated _default ( ) ( ` select( 'core/edit-post' ).isEditorPanelRemoved ` , {
since : "6.5" ,
alternative : ` select( 'core/editor' ).isEditorPanelRemoved `
} ) ;
return select ( external _wp _editor _namespaceObject . store ) . isEditorPanelRemoved ( panelName ) ;
}
) ;
const isEditorPanelEnabled = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) (
( select ) => ( state , panelName ) => {
external _wp _deprecated _default ( ) ( ` select( 'core/edit-post' ).isEditorPanelEnabled ` , {
since : "6.5" ,
alternative : ` select( 'core/editor' ).isEditorPanelEnabled `
} ) ;
return select ( external _wp _editor _namespaceObject . store ) . isEditorPanelEnabled ( panelName ) ;
}
) ;
const isEditorPanelOpened = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) (
( select ) => ( state , panelName ) => {
external _wp _deprecated _default ( ) ( ` select( 'core/edit-post' ).isEditorPanelOpened ` , {
since : "6.5" ,
alternative : ` select( 'core/editor' ).isEditorPanelOpened `
} ) ;
return select ( external _wp _editor _namespaceObject . store ) . isEditorPanelOpened ( panelName ) ;
}
) ;
const isModalActive = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) (
( select ) => ( state , modalName ) => {
external _wp _deprecated _default ( ) ( ` select( 'core/edit-post' ).isModalActive ` , {
since : "6.3" ,
alternative : ` select( 'core/interface' ).isModalActive `
} ) ;
return ! ! select ( selectors _interfaceStore ) . isModalActive ( modalName ) ;
}
) ;
const isFeatureActive = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) (
( select ) => ( state , feature ) => {
return ! ! select ( external _wp _preferences _namespaceObject . store ) . get ( "core/edit-post" , feature ) ;
}
) ;
const isPluginItemPinned = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) (
( select ) => ( state , pluginName ) => {
return select ( selectors _interfaceStore ) . isItemPinned ( "core" , pluginName ) ;
}
) ;
const getActiveMetaBoxLocations = ( 0 , external _wp _data _namespaceObject . createSelector ) (
( state ) => {
return Object . keys ( state . metaBoxes . locations ) . filter (
( location ) => isMetaBoxLocationActive ( state , location )
) ;
} ,
( state ) => [ state . metaBoxes . locations ]
) ;
const isMetaBoxLocationVisible = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) (
( select ) => ( state , location ) => {
return isMetaBoxLocationActive ( state , location ) && getMetaBoxesPerLocation ( state , location ) ? . some ( ( { id } ) => {
return select ( external _wp _editor _namespaceObject . store ) . isEditorPanelEnabled (
` meta-box- ${ id } `
) ;
} ) ;
}
) ;
2025-02-28 08:42:11 +01:00
function isMetaBoxLocationActive ( state , location ) {
const metaBoxes = getMetaBoxesPerLocation ( state , location ) ;
return ! ! metaBoxes && metaBoxes . length !== 0 ;
}
function getMetaBoxesPerLocation ( state , location ) {
return state . metaBoxes . locations [ location ] ;
2021-07-23 11:58:50 +02:00
}
2025-12-12 13:15:55 +01:00
const getAllMetaBoxes = ( 0 , external _wp _data _namespaceObject . createSelector ) (
( state ) => {
return Object . values ( state . metaBoxes . locations ) . flat ( ) ;
} ,
( state ) => [ state . metaBoxes . locations ]
) ;
2025-02-28 08:42:11 +01:00
function hasMetaBoxes ( state ) {
return getActiveMetaBoxLocations ( state ) . length > 0 ;
}
function selectors _isSavingMetaBoxes ( state ) {
return state . metaBoxes . isSaving ;
}
2025-12-12 13:15:55 +01:00
const _ _experimentalGetPreviewDeviceType = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) (
( select ) => ( ) => {
external _wp _deprecated _default ( ) (
` select( 'core/edit-site' ).__experimentalGetPreviewDeviceType ` ,
{
since : "6.5" ,
version : "6.7" ,
alternative : ` select( 'core/editor' ).getDeviceType `
}
) ;
return select ( external _wp _editor _namespaceObject . store ) . getDeviceType ( ) ;
}
) ;
const isInserterOpened = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( ( select ) => ( ) => {
2025-02-28 08:42:11 +01:00
external _wp _deprecated _default ( ) ( ` select( 'core/edit-post' ).isInserterOpened ` , {
2025-12-12 13:15:55 +01:00
since : "6.5" ,
2025-02-28 08:42:11 +01:00
alternative : ` select( 'core/editor' ).isInserterOpened `
2024-04-17 11:32:24 +02:00
} ) ;
2025-02-28 08:42:11 +01:00
return select ( external _wp _editor _namespaceObject . store ) . isInserterOpened ( ) ;
} ) ;
2025-12-12 13:15:55 +01:00
const _ _experimentalGetInsertionPoint = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) (
( select ) => ( ) => {
external _wp _deprecated _default ( ) (
` select( 'core/edit-post' ).__experimentalGetInsertionPoint ` ,
{
since : "6.5" ,
version : "6.7"
}
) ;
return unlock ( select ( external _wp _editor _namespaceObject . store ) ) . getInserter ( ) ;
}
) ;
const isListViewOpened = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( ( select ) => ( ) => {
2025-02-28 08:42:11 +01:00
external _wp _deprecated _default ( ) ( ` select( 'core/edit-post' ).isListViewOpened ` , {
2025-12-12 13:15:55 +01:00
since : "6.5" ,
2025-02-28 08:42:11 +01:00
alternative : ` select( 'core/editor' ).isListViewOpened `
2023-09-26 10:33:34 +02:00
} ) ;
2025-02-28 08:42:11 +01:00
return select ( external _wp _editor _namespaceObject . store ) . isListViewOpened ( ) ;
} ) ;
2025-12-12 13:15:55 +01:00
const isEditingTemplate = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( ( select ) => ( ) => {
2025-02-28 08:42:11 +01:00
external _wp _deprecated _default ( ) ( ` select( 'core/edit-post' ).isEditingTemplate ` , {
2025-12-12 13:15:55 +01:00
since : "6.5" ,
2025-02-28 08:42:11 +01:00
alternative : ` select( 'core/editor' ).getRenderingMode `
} ) ;
2025-12-12 13:15:55 +01:00
return select ( external _wp _editor _namespaceObject . store ) . getCurrentPostType ( ) === "wp_template" ;
2025-02-28 08:42:11 +01:00
} ) ;
function areMetaBoxesInitialized ( state ) {
return state . metaBoxes . initialized ;
2021-07-23 11:58:50 +02:00
}
2025-12-12 13:15:55 +01:00
const getEditedPostTemplate = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) (
( select ) => ( ) => {
const { id : postId , type : postType } = select ( external _wp _editor _namespaceObject . store ) . getCurrentPost ( ) ;
const templateId = unlock ( select ( external _wp _coreData _namespaceObject . store ) ) . getTemplateId (
postType ,
postId
) ;
if ( ! templateId ) {
return void 0 ;
}
return select ( external _wp _coreData _namespaceObject . store ) . getEditedEntityRecord (
"postType" ,
"wp_template" ,
templateId
) ;
2025-02-28 08:42:11 +01:00
}
2025-12-12 13:15:55 +01:00
) ;
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-post/build-module/store/index.js
2021-07-23 11:58:50 +02:00
2025-02-28 08:42:11 +01:00
const store = ( 0 , external _wp _data _namespaceObject . createReduxStore ) ( STORE _NAME , {
2025-12-12 13:15:55 +01:00
reducer : reducer _default ,
2025-02-28 08:42:11 +01:00
actions : actions _namespaceObject ,
selectors : selectors _namespaceObject
2021-07-23 11:58:50 +02:00
} ) ;
2025-02-28 08:42:11 +01:00
( 0 , external _wp _data _namespaceObject . register ) ( store ) ;
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-post/build-module/components/keyboard-shortcuts/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
function KeyboardShortcuts ( ) {
2025-12-12 13:15:55 +01:00
const { toggleFullscreenMode } = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store ) ;
const { registerShortcut } = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _keyboardShortcuts _namespaceObject . store ) ;
2025-02-28 08:42:11 +01:00
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
registerShortcut ( {
2025-12-12 13:15:55 +01:00
name : "core/edit-post/toggle-fullscreen" ,
category : "global" ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Enable or disable fullscreen mode." ) ,
2025-02-28 08:42:11 +01:00
keyCombination : {
2025-12-12 13:15:55 +01:00
modifier : "secondary" ,
character : "f"
2025-02-28 08:42:11 +01:00
}
} ) ;
} , [ ] ) ;
2025-12-12 13:15:55 +01:00
( 0 , external _wp _keyboardShortcuts _namespaceObject . useShortcut ) ( "core/edit-post/toggle-fullscreen" , ( ) => {
2025-04-25 12:30:07 +02:00
toggleFullscreenMode ( ) ;
2021-07-23 11:58:50 +02:00
} ) ;
2025-02-28 08:42:11 +01:00
return null ;
2021-07-23 11:58:50 +02:00
}
2025-12-12 13:15:55 +01:00
var keyboard _shortcuts _default = KeyboardShortcuts ;
2021-07-23 11:58:50 +02:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/edit-post/build-module/components/init-pattern-modal/index.js
2021-07-23 11:58:50 +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
function InitPatternModal ( ) {
2025-12-12 13:15:55 +01:00
const { editPost } = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _editor _namespaceObject . store ) ;
const [ syncType , setSyncType ] = ( 0 , external _wp _element _namespaceObject . useState ) ( void 0 ) ;
const [ title , setTitle ] = ( 0 , external _wp _element _namespaceObject . useState ) ( "" ) ;
const { postType , isNewPost } = ( 0 , external _wp _data _namespaceObject . useSelect ) ( ( select ) => {
const { getEditedPostAttribute , isCleanNewPost } = select ( external _wp _editor _namespaceObject . store ) ;
2021-07-23 11:58:50 +02:00
return {
2025-12-12 13:15:55 +01:00
postType : getEditedPostAttribute ( "type" ) ,
2025-02-28 08:42:11 +01:00
isNewPost : isCleanNewPost ( )
2021-07-23 11:58:50 +02:00
} ;
} , [ ] ) ;
2025-12-12 13:15:55 +01:00
const [ isModalOpen , setIsModalOpen ] = ( 0 , external _wp _element _namespaceObject . useState ) (
( ) => isNewPost && postType === "wp_block"
) ;
if ( postType !== "wp_block" || ! isNewPost ) {
2021-07-23 11:58:50 +02:00
return null ;
}
2025-12-12 13:15:55 +01:00
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _ReactJSXRuntime _namespaceObject . Fragment , { children : isModalOpen && /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _components _namespaceObject . Modal ,
{
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Create pattern" ) ,
2025-02-28 08:42:11 +01:00
onRequestClose : ( ) => {
setIsModalOpen ( false ) ;
} ,
overlayClassName : "reusable-blocks-menu-items__convert-modal" ,
2025-12-12 13:15:55 +01:00
children : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
"form" ,
{
onSubmit : ( event ) => {
event . preventDefault ( ) ;
setIsModalOpen ( false ) ;
editPost ( {
title ,
meta : {
wp _pattern _sync _status : syncType
}
} ) ;
} ,
children : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( external _wp _components _namespaceObject . _ _experimentalVStack , { spacing : "5" , children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _components _namespaceObject . TextControl ,
{
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Name" ) ,
value : title ,
onChange : setTitle ,
placeholder : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "My pattern" ) ,
className : "patterns-create-modal__name-input" ,
_ _nextHasNoMarginBottom : true ,
_ _next40pxDefaultSize : true
}
) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _components _namespaceObject . ToggleControl ,
{
_ _nextHasNoMarginBottom : true ,
label : ( 0 , external _wp _i18n _namespaceObject . _x ) ( "Synced" , "pattern (singular)" ) ,
help : ( 0 , external _wp _i18n _namespaceObject . _ _ ) (
"Sync this pattern across multiple locations."
) ,
checked : ! syncType ,
onChange : ( ) => {
setSyncType (
! syncType ? "unsynced" : void 0
) ;
}
}
) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _components _namespaceObject . _ _experimentalHStack , { justify : "right" , children : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _components _namespaceObject . Button ,
{
_ _next40pxDefaultSize : true ,
variant : "primary" ,
type : "submit" ,
disabled : ! title ,
accessibleWhenDisabled : true ,
children : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Create" )
}
) } )
] } )
}
)
}
) } ) ;
2021-07-23 11:58:50 +02:00
}
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-post/build-module/components/browser-url/index.js
2021-07-23 11:58:50 +02:00
2025-02-28 08:42:11 +01:00
function getPostEditURL ( postId ) {
2025-12-12 13:15:55 +01:00
return ( 0 , external _wp _url _namespaceObject . addQueryArgs ) ( "post.php" , { post : postId , action : "edit" } ) ;
2025-02-28 08:42:11 +01:00
}
2025-12-12 13:15:55 +01:00
function BrowserURL ( ) {
const [ historyId , setHistoryId ] = ( 0 , external _wp _element _namespaceObject . useState ) ( null ) ;
const { postId , postStatus } = ( 0 , external _wp _data _namespaceObject . useSelect ) ( ( select ) => {
const { getCurrentPost } = select ( external _wp _editor _namespaceObject . store ) ;
const post = getCurrentPost ( ) ;
let { id , status , type } = post ;
const isTemplate = [ "wp_template" , "wp_template_part" ] . includes (
type
) ;
if ( isTemplate ) {
id = post . wp _id ;
}
return {
postId : id ,
postStatus : status
2025-02-28 08:42:11 +01:00
} ;
2025-12-12 13:15:55 +01:00
} , [ ] ) ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
if ( postId && postId !== historyId && postStatus !== "auto-draft" ) {
window . history . replaceState (
{ id : postId } ,
"Post " + postId ,
getPostEditURL ( postId )
) ;
setHistoryId ( postId ) ;
2025-02-28 08:42:11 +01:00
}
2025-12-12 13:15:55 +01:00
} , [ postId , postStatus , historyId ] ) ;
return null ;
2025-02-28 08:42:11 +01:00
}
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-post/build-module/components/meta-boxes/meta-boxes-area/index.js
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
function MetaBoxesArea ( { location } ) {
2025-02-28 08:42:11 +01:00
const container = ( 0 , external _wp _element _namespaceObject . useRef ) ( null ) ;
const formRef = ( 0 , external _wp _element _namespaceObject . useRef ) ( null ) ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
2025-12-12 13:15:55 +01:00
formRef . current = document . querySelector (
".metabox-location-" + location
) ;
2025-02-28 08:42:11 +01:00
if ( formRef . current ) {
container . current . appendChild ( formRef . current ) ;
}
return ( ) => {
if ( formRef . current ) {
2025-12-12 13:15:55 +01:00
document . querySelector ( "#metaboxes" ) . appendChild ( formRef . current ) ;
2025-02-28 08:42:11 +01:00
}
} ;
} , [ location ] ) ;
2025-12-12 13:15:55 +01:00
const isSaving = ( 0 , external _wp _data _namespaceObject . useSelect ) ( ( select ) => {
2025-02-28 08:42:11 +01:00
return select ( store ) . isSavingMetaBoxes ( ) ;
} , [ ] ) ;
2025-12-12 13:15:55 +01:00
const classes = dist _clsx ( "edit-post-meta-boxes-area" , ` is- ${ location } ` , {
"is-loading" : isSaving
2025-02-28 08:42:11 +01:00
} ) ;
2025-12-12 13:15:55 +01:00
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( "div" , { className : classes , children : [
isSaving && /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _components _namespaceObject . Spinner , { } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
"div" ,
{
className : "edit-post-meta-boxes-area__container" ,
ref : container
}
) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( "div" , { className : "edit-post-meta-boxes-area__clear" } )
] } ) ;
2021-07-23 11:58:50 +02:00
}
2025-12-12 13:15:55 +01:00
var meta _boxes _area _default = MetaBoxesArea ;
2021-07-23 11:58:50 +02:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/edit-post/build-module/components/meta-boxes/meta-box-visibility.js
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
function MetaBoxVisibility ( { id } ) {
const isVisible = ( 0 , external _wp _data _namespaceObject . useSelect ) (
( select ) => {
return select ( external _wp _editor _namespaceObject . store ) . isEditorPanelEnabled (
` meta-box- ${ id } `
) ;
} ,
[ id ]
) ;
2025-04-25 12:30:07 +02:00
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
2025-02-28 08:42:11 +01:00
const element = document . getElementById ( id ) ;
if ( ! element ) {
return ;
}
if ( isVisible ) {
2025-12-12 13:15:55 +01:00
element . classList . remove ( "is-hidden" ) ;
2025-02-28 08:42:11 +01:00
} else {
2025-12-12 13:15:55 +01:00
element . classList . add ( "is-hidden" ) ;
2022-06-16 14:03:35 +02:00
}
2025-04-25 12:30:07 +02:00
} , [ id , isVisible ] ) ;
return null ;
2024-04-17 11:32:24 +02:00
}
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-post/build-module/components/meta-boxes/index.js
2024-04-17 11:32:24 +02:00
2025-12-12 13:15:55 +01:00
function MetaBoxes ( { location } ) {
const metaBoxes = ( 0 , external _wp _data _namespaceObject . useSelect ) (
( select ) => select ( store ) . getMetaBoxesPerLocation ( location ) ,
[ location ]
) ;
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( external _ReactJSXRuntime _namespaceObject . Fragment , { children : [
( metaBoxes ? ? [ ] ) . map ( ( { id } ) => /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( MetaBoxVisibility , { id } , id ) ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( meta _boxes _area _default , { location } )
] } ) ;
2025-02-28 08:42:11 +01:00
}
2025-12-12 13:15:55 +01:00
2025-04-25 12:30:07 +02:00
; // external ["wp","keycodes"]
2025-02-28 08:42:11 +01:00
const external _wp _keycodes _namespaceObject = window [ "wp" ] [ "keycodes" ] ;
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/edit-post/build-module/components/more-menu/manage-patterns-menu-item.js
2024-04-17 11:32:24 +02:00
2025-02-28 08:42:11 +01:00
function ManagePatternsMenuItem ( ) {
2025-12-12 13:15:55 +01:00
const url = ( 0 , external _wp _data _namespaceObject . useSelect ) ( ( select ) => {
const { canUser } = select ( external _wp _coreData _namespaceObject . store ) ;
const defaultUrl = ( 0 , external _wp _url _namespaceObject . addQueryArgs ) ( "edit.php" , {
post _type : "wp_block"
2025-02-28 08:42:11 +01:00
} ) ;
2025-12-12 13:15:55 +01:00
const patternsUrl = ( 0 , external _wp _url _namespaceObject . addQueryArgs ) ( "site-editor.php" , {
p : "/pattern"
2025-02-28 08:42:11 +01:00
} ) ;
2025-12-12 13:15:55 +01:00
return canUser ( "create" , {
kind : "postType" ,
name : "wp_template"
2025-02-28 08:42:11 +01:00
} ) ? patternsUrl : defaultUrl ;
} , [ ] ) ;
2025-12-12 13:15:55 +01:00
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _components _namespaceObject . MenuItem , { role : "menuitem" , href : url , children : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Manage patterns" ) } ) ;
2025-02-28 08:42:11 +01:00
}
2025-12-12 13:15:55 +01:00
var manage _patterns _menu _item _default = ManagePatternsMenuItem ;
2025-02-28 08:42:11 +01:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/edit-post/build-module/components/more-menu/welcome-guide-menu-item.js
2024-04-17 11:32:24 +02:00
2025-02-28 08:42:11 +01:00
function WelcomeGuideMenuItem ( ) {
2025-12-12 13:15:55 +01:00
const isEditingTemplate = ( 0 , external _wp _data _namespaceObject . useSelect ) (
( select ) => select ( external _wp _editor _namespaceObject . store ) . getCurrentPostType ( ) === "wp_template" ,
[ ]
) ;
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _preferences _namespaceObject . PreferenceToggleMenuItem ,
{
scope : "core/edit-post" ,
name : isEditingTemplate ? "welcomeGuideTemplate" : "welcomeGuide" ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Welcome Guide" )
}
) ;
2025-02-28 08:42:11 +01:00
}
2024-04-17 11:32:24 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/enable-custom-fields.js
2024-04-17 11:32:24 +02:00
2025-12-12 13:15:55 +01:00
const { PreferenceBaseOption } = unlock ( external _wp _preferences _namespaceObject . privateApis ) ;
2025-02-28 08:42:11 +01:00
function submitCustomFieldsForm ( ) {
2025-12-12 13:15:55 +01:00
const customFieldsForm = document . getElementById (
"toggle-custom-fields-form"
) ;
customFieldsForm . querySelector ( '[name="_wp_http_referer"]' ) . setAttribute ( "value" , ( 0 , external _wp _url _namespaceObject . getPathAndQueryString ) ( window . location . href ) ) ;
2025-02-28 08:42:11 +01:00
customFieldsForm . submit ( ) ;
}
2025-12-12 13:15:55 +01:00
function CustomFieldsConfirmation ( { willEnable } ) {
2025-02-28 08:42:11 +01:00
const [ isReloading , setIsReloading ] = ( 0 , external _wp _element _namespaceObject . useState ) ( false ) ;
2025-12-12 13:15:55 +01:00
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( external _ReactJSXRuntime _namespaceObject . Fragment , { children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( "p" , { className : "edit-post-preferences-modal__custom-fields-confirmation-message" , children : ( 0 , external _wp _i18n _namespaceObject . _ _ ) (
"A page reload is required for this change. Make sure your content is saved before reloading."
) } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _components _namespaceObject . Button ,
{
_ _next40pxDefaultSize : true ,
variant : "secondary" ,
isBusy : isReloading ,
accessibleWhenDisabled : true ,
disabled : isReloading ,
onClick : ( ) => {
setIsReloading ( true ) ;
submitCustomFieldsForm ( ) ;
} ,
children : willEnable ? ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Show & Reload Page" ) : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Hide & Reload Page" )
}
)
] } ) ;
2025-02-28 08:42:11 +01:00
}
2025-12-12 13:15:55 +01:00
function EnableCustomFieldsOption ( { label } ) {
const areCustomFieldsEnabled = ( 0 , external _wp _data _namespaceObject . useSelect ) ( ( select ) => {
2025-04-25 12:30:07 +02:00
return ! ! select ( external _wp _editor _namespaceObject . store ) . getEditorSettings ( ) . enableCustomFields ;
} , [ ] ) ;
2025-02-28 08:42:11 +01:00
const [ isChecked , setIsChecked ] = ( 0 , external _wp _element _namespaceObject . useState ) ( areCustomFieldsEnabled ) ;
2025-12-12 13:15:55 +01:00
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
PreferenceBaseOption ,
{
label ,
isChecked ,
onChange : setIsChecked ,
children : isChecked !== areCustomFieldsEnabled && /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( CustomFieldsConfirmation , { willEnable : isChecked } )
}
) ;
2023-12-07 09:44:11 +01:00
}
2025-02-28 08:42:11 +01:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/enable-panel.js
2025-02-28 08:42:11 +01:00
2022-06-16 14:03:35 +02:00
2025-04-25 12:30:07 +02:00
2025-12-12 13:15:55 +01:00
const { PreferenceBaseOption : enable _panel _PreferenceBaseOption } = unlock ( external _wp _preferences _namespaceObject . privateApis ) ;
2025-04-25 12:30:07 +02:00
function EnablePanelOption ( props ) {
2025-12-12 13:15:55 +01:00
const { toggleEditorPanelEnabled } = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _editor _namespaceObject . store ) ;
const { isChecked , isRemoved } = ( 0 , external _wp _data _namespaceObject . useSelect ) (
( select ) => {
const { isEditorPanelEnabled , isEditorPanelRemoved } = select ( external _wp _editor _namespaceObject . store ) ;
return {
isChecked : isEditorPanelEnabled ( props . panelName ) ,
isRemoved : isEditorPanelRemoved ( props . panelName )
} ;
} ,
[ props . panelName ]
) ;
2025-04-25 12:30:07 +02:00
if ( isRemoved ) {
return null ;
}
2025-12-12 13:15:55 +01:00
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
enable _panel _PreferenceBaseOption ,
{
isChecked ,
onChange : ( ) => toggleEditorPanelEnabled ( props . panelName ) ,
... props
}
) ;
2025-04-25 12:30:07 +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
; // ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/meta-boxes-section.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
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
const { PreferencesModalSection } = unlock ( external _wp _preferences _namespaceObject . privateApis ) ;
2025-02-28 08:42:11 +01:00
function MetaBoxesSection ( {
areCustomFieldsRegistered ,
metaBoxes ,
... sectionProps
} ) {
2025-12-12 13:15:55 +01:00
const thirdPartyMetaBoxes = metaBoxes . filter (
( { id } ) => id !== "postcustom"
) ;
2025-02-28 08:42:11 +01:00
if ( ! areCustomFieldsRegistered && thirdPartyMetaBoxes . length === 0 ) {
return null ;
}
2025-12-12 13:15:55 +01:00
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( PreferencesModalSection , { ... sectionProps , children : [
areCustomFieldsRegistered && /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( EnableCustomFieldsOption , { label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Custom fields" ) } ) ,
thirdPartyMetaBoxes . map ( ( { id , title } ) => /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
EnablePanelOption ,
{
label : title ,
panelName : ` meta-box- ${ id } `
} ,
id
) )
] } ) ;
2025-02-28 08:42:11 +01:00
}
2025-12-12 13:15:55 +01:00
var meta _boxes _section _default = ( 0 , external _wp _data _namespaceObject . withSelect ) ( ( select ) => {
const { getEditorSettings } = select ( external _wp _editor _namespaceObject . store ) ;
const { getAllMetaBoxes } = select ( store ) ;
2025-02-28 08:42:11 +01:00
return {
// This setting should not live in the block editor's store.
2025-12-12 13:15:55 +01:00
areCustomFieldsRegistered : getEditorSettings ( ) . enableCustomFields !== void 0 ,
2025-02-28 08:42:11 +01:00
metaBoxes : getAllMetaBoxes ( )
} ;
2025-12-12 13:15:55 +01:00
} ) ( MetaBoxesSection ) ;
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/index.js
2024-04-17 11:32:24 +02:00
2022-06-16 14:03:35 +02:00
2025-12-12 13:15:55 +01:00
const { PreferenceToggleControl } = unlock ( external _wp _preferences _namespaceObject . privateApis ) ;
const { PreferencesModal } = unlock ( external _wp _editor _namespaceObject . privateApis ) ;
2025-02-28 08:42:11 +01:00
function EditPostPreferencesModal ( ) {
const extraSections = {
2025-12-12 13:15:55 +01:00
general : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( meta _boxes _section _default , { title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Advanced" ) } ) ,
appearance : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
PreferenceToggleControl ,
{
scope : "core/edit-post" ,
featureName : "themeStyles" ,
help : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Make the editor look like your theme." ) ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Use theme styles" )
}
)
2025-02-28 08:42:11 +01:00
} ;
2025-12-12 13:15:55 +01:00
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( PreferencesModal , { extraSections } ) ;
2025-02-28 08:42:11 +01:00
}
2022-06-16 14:03:35 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-post/build-module/components/more-menu/index.js
2022-06-16 14:03:35 +02:00
2025-02-28 08:42:11 +01:00
2022-06-16 14:03:35 +02:00
2025-12-12 13:15:55 +01:00
const { ToolsMoreMenuGroup , ViewMoreMenuGroup } = unlock ( external _wp _editor _namespaceObject . privateApis ) ;
2025-02-28 08:42:11 +01:00
const MoreMenu = ( ) => {
2025-12-12 13:15:55 +01:00
const isLargeViewport = ( 0 , external _wp _compose _namespaceObject . useViewportMatch ) ( "large" ) ;
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( external _ReactJSXRuntime _namespaceObject . Fragment , { children : [
isLargeViewport && /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( ViewMoreMenuGroup , { children : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _preferences _namespaceObject . PreferenceToggleMenuItem ,
{
2025-02-28 08:42:11 +01:00
scope : "core/edit-post" ,
name : "fullscreenMode" ,
2025-12-12 13:15:55 +01:00
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Fullscreen mode" ) ,
info : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Show and hide the admin user interface" ) ,
messageActivated : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Fullscreen mode activated." ) ,
messageDeactivated : ( 0 , external _wp _i18n _namespaceObject . _ _ ) (
"Fullscreen mode deactivated."
) ,
shortcut : external _wp _keycodes _namespaceObject . displayShortcut . secondary ( "f" )
}
) } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( ToolsMoreMenuGroup , { children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( manage _patterns _menu _item _default , { } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( WelcomeGuideMenuItem , { } )
] } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( EditPostPreferencesModal , { } )
] } ) ;
2021-07-23 11:58:50 +02:00
} ;
2025-12-12 13:15:55 +01:00
var more _menu _default = MoreMenu ;
2023-09-26 10:33:34 +02:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/image.js
2023-09-26 10:33:34 +02:00
2025-12-12 13:15:55 +01:00
function WelcomeGuideImage ( { nonAnimatedSrc , animatedSrc } ) {
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( "picture" , { className : "edit-post-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 : "" } )
] } ) ;
2025-02-28 08:42:11 +01:00
}
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/default.js
2025-02-28 08:42:11 +01:00
function WelcomeGuideDefault ( ) {
2025-12-12 13:15:55 +01:00
const { toggleFeature } = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store ) ;
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _components _namespaceObject . Guide ,
{
className : "edit-post-welcome-guide" ,
contentLabel : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Welcome to the editor" ) ,
finishButtonText : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Get started" ) ,
onFinish : ( ) => toggleFeature ( "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-post-welcome-guide__heading" , children : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Welcome to the editor" ) } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( "p" , { className : "edit-post-welcome-guide__text" , children : ( 0 , external _wp _i18n _namespaceObject . _ _ ) (
"In the WordPress editor, each paragraph, image, or video is presented as a distinct \u201Cblock\u201D of content."
) } )
] } )
} ,
{
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-post-welcome-guide__heading" , children : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Customize each block" ) } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( "p" , { className : "edit-post-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-post-welcome-guide__heading" , children : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Explore all blocks" ) } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( "p" , { className : "edit-post-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" ,
{
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-post-welcome-guide__heading" , children : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Learn more" ) } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( "p" , { className : "edit-post-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/"
)
}
)
}
) } )
] } )
}
]
}
) ;
2025-02-28 08:42:11 +01:00
}
2024-04-17 11:32:24 +02:00
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/template.js
2023-12-07 09:44:11 +01:00
2025-02-28 08:42:11 +01:00
function WelcomeGuideTemplate ( ) {
2025-12-12 13:15:55 +01:00
const { toggleFeature } = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store ) ;
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
external _wp _components _namespaceObject . Guide ,
{
className : "edit-template-welcome-guide" ,
contentLabel : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Welcome to the template editor" ) ,
finishButtonText : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Get started" ) ,
onFinish : ( ) => toggleFeature ( "welcomeGuideTemplate" ) ,
pages : [
{
image : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
WelcomeGuideImage ,
{
nonAnimatedSrc : "https://s.w.org/images/block-editor/welcome-template-editor.svg" ,
animatedSrc : "https://s.w.org/images/block-editor/welcome-template-editor.gif"
}
) ,
content : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( external _ReactJSXRuntime _namespaceObject . Fragment , { children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( "h1" , { className : "edit-post-welcome-guide__heading" , children : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Welcome to the template editor" ) } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( "p" , { className : "edit-post-welcome-guide__text" , children : ( 0 , external _wp _i18n _namespaceObject . _ _ ) (
"Templates help define the layout of the site. You can customize all aspects of your posts and pages using blocks and patterns in this editor."
) } )
] } )
}
]
}
) ;
2021-07-23 11:58:50 +02:00
}
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/index.js
2021-07-23 11:58:50 +02:00
2025-02-28 08:42:11 +01:00
2022-04-02 10:26:41 +02:00
2023-12-07 09:44:11 +01:00
2025-12-12 13:15:55 +01:00
function WelcomeGuide ( { postType } ) {
const { isActive , isEditingTemplate } = ( 0 , external _wp _data _namespaceObject . useSelect ) (
( select ) => {
const { isFeatureActive } = select ( store ) ;
const _isEditingTemplate = postType === "wp_template" ;
const feature = _isEditingTemplate ? "welcomeGuideTemplate" : "welcomeGuide" ;
return {
isActive : isFeatureActive ( feature ) ,
isEditingTemplate : _isEditingTemplate
} ;
} ,
[ postType ]
) ;
2025-02-28 08:42:11 +01:00
if ( ! isActive ) {
return null ;
}
2025-12-12 13:15:55 +01:00
return isEditingTemplate ? /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( WelcomeGuideTemplate , { } ) : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( WelcomeGuideDefault , { } ) ;
2025-02-28 08:42:11 +01:00
}
2024-04-17 11:32:24 +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/fullscreen.js
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
var fullscreen _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 : "M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z" } ) } ) ;
2025-02-28 08:42:11 +01:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/edit-post/build-module/commands/use-commands.js
2025-02-28 08:42:11 +01:00
function useCommands ( ) {
2025-12-12 13:15:55 +01:00
const { isFullscreen } = ( 0 , external _wp _data _namespaceObject . useSelect ) ( ( select ) => {
const { get } = select ( external _wp _preferences _namespaceObject . store ) ;
2024-04-17 11:32:24 +02:00
return {
2025-12-12 13:15:55 +01:00
isFullscreen : get ( "core/edit-post" , "fullscreenMode" )
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 { toggle } = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _preferences _namespaceObject . store ) ;
const { createInfoNotice } = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _notices _namespaceObject . store ) ;
2025-02-28 08:42:11 +01:00
( 0 , external _wp _commands _namespaceObject . useCommand ) ( {
2025-12-12 13:15:55 +01:00
name : "core/toggle-fullscreen-mode" ,
label : isFullscreen ? ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Exit fullscreen" ) : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Enter fullscreen" ) ,
icon : fullscreen _default ,
callback : ( { close } ) => {
toggle ( "core/edit-post" , "fullscreenMode" ) ;
2025-02-28 08:42:11 +01:00
close ( ) ;
2025-12-12 13:15:55 +01:00
createInfoNotice (
isFullscreen ? ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Fullscreen off." ) : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Fullscreen on." ) ,
{
id : "core/edit-post/toggle-fullscreen-mode/notice" ,
type : "snackbar" ,
actions : [
{
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Undo" ) ,
onClick : ( ) => {
toggle ( "core/edit-post" , "fullscreenMode" ) ;
}
}
]
}
) ;
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-02-28 08:42:11 +01:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-post/build-module/components/layout/use-padding-appender.js
2025-02-28 08:42:11 +01:00
2025-04-25 12:30:07 +02:00
const CSS = ':root :where(.editor-styles-wrapper)::after {content: ""; display: block; height: 40vh;}' ;
function usePaddingAppender ( enabled ) {
2025-02-28 08:42:11 +01:00
const registry = ( 0 , external _wp _data _namespaceObject . useRegistry ) ( ) ;
2025-12-12 13:15:55 +01:00
const effect = ( 0 , external _wp _compose _namespaceObject . useRefEffect ) (
( node ) => {
function onMouseDown ( event ) {
if ( event . target !== node && // Tests for the parent element because in the iframed editor if the click is
// below the padding the target will be the parent element (html) and should
// still be treated as intent to append.
event . target !== node . parentElement ) {
return ;
}
const lastChild = node . lastElementChild ;
if ( ! lastChild ) {
return ;
}
const lastChildRect = lastChild . getBoundingClientRect ( ) ;
if ( event . clientY < lastChildRect . bottom ) {
return ;
}
event . preventDefault ( ) ;
const blockOrder = registry . select ( external _wp _blockEditor _namespaceObject . store ) . getBlockOrder ( "" ) ;
const lastBlockClientId = blockOrder [ blockOrder . length - 1 ] ;
const lastBlock = registry . select ( external _wp _blockEditor _namespaceObject . store ) . getBlock ( lastBlockClientId ) ;
const { selectBlock , insertDefaultBlock } = registry . dispatch ( external _wp _blockEditor _namespaceObject . store ) ;
if ( lastBlock && ( 0 , external _wp _blocks _namespaceObject . isUnmodifiedDefaultBlock ) ( lastBlock ) ) {
selectBlock ( lastBlockClientId ) ;
} else {
insertDefaultBlock ( ) ;
}
2025-02-28 08:42:11 +01:00
}
2025-12-12 13:15:55 +01:00
const { ownerDocument } = node ;
ownerDocument . addEventListener ( "pointerdown" , onMouseDown ) ;
return ( ) => {
ownerDocument . removeEventListener ( "pointerdown" , onMouseDown ) ;
} ;
} ,
[ registry ]
) ;
2025-04-25 12:30:07 +02:00
return enabled ? [ effect , CSS ] : [ ] ;
2025-02-28 08:42:11 +01:00
}
2021-07-23 11:58:50 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-post/build-module/components/layout/use-should-iframe.js
2023-12-07 09:44:11 +01:00
2025-02-28 08:42:11 +01:00
2025-04-25 12:30:07 +02:00
2025-02-28 08:42:11 +01:00
const isGutenbergPlugin = false ? 0 : false ;
function useShouldIframe ( ) {
2025-12-12 13:15:55 +01:00
return ( 0 , external _wp _data _namespaceObject . useSelect ) ( ( select ) => {
const { getEditorSettings , getCurrentPostType , getDeviceType } = select ( external _wp _editor _namespaceObject . store ) ;
2025-04-25 12:30:07 +02:00
return (
// If the theme is block based and the Gutenberg plugin is active,
// we ALWAYS use the iframe for consistency across the post and site
// editor.
2025-12-12 13:15:55 +01:00
isGutenbergPlugin && getEditorSettings ( ) . _ _unstableIsBlockBasedTheme || // We also still want to iframe all the special
2025-04-25 12:30:07 +02:00
// editor features and modes such as device previews, zoom out, and
// template/pattern editing.
2025-12-12 13:15:55 +01:00
getDeviceType ( ) !== "Desktop" || [ "wp_template" , "wp_block" ] . includes ( getCurrentPostType ( ) ) || unlock ( select ( external _wp _blockEditor _namespaceObject . store ) ) . isZoomOut ( ) || // Finally, still iframe the editor if all blocks are v3 (which means
2025-04-25 12:30:07 +02:00
// they are marked as iframe-compatible).
2025-12-12 13:15:55 +01:00
select ( external _wp _blocks _namespaceObject . store ) . getBlockTypes ( ) . every ( ( type ) => type . apiVersion >= 3 )
2025-04-25 12:30:07 +02:00
) ;
2025-02-28 08:42:11 +01:00
} , [ ] ) ;
2024-04-17 11:32:24 +02:00
}
2023-09-26 10:33:34 +02:00
2025-12-12 13:15:55 +01:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/edit-post/build-module/hooks/use-navigate-to-entity-record.js
2025-12-12 13:15:55 +01:00
2025-02-28 08:42:11 +01:00
function useNavigateToEntityRecord ( initialPostId , initialPostType , defaultRenderingMode ) {
2025-12-12 13:15:55 +01:00
const [ postHistory , dispatch ] = ( 0 , external _wp _element _namespaceObject . useReducer ) (
( historyState , { type , post : post2 , previousRenderingMode : previousRenderingMode2 } ) => {
if ( type === "push" ) {
return [ ... historyState , { post : post2 , previousRenderingMode : previousRenderingMode2 } ] ;
2023-09-26 10:33:34 +02:00
}
2025-12-12 13:15:55 +01:00
if ( type === "pop" ) {
if ( historyState . length > 1 ) {
return historyState . slice ( 0 , - 1 ) ;
}
}
return historyState ;
} ,
[
{
post : { postId : initialPostId , postType : initialPostType }
}
]
) ;
const { post , previousRenderingMode } = postHistory [ postHistory . length - 1 ] ;
const { getRenderingMode } = ( 0 , external _wp _data _namespaceObject . useSelect ) ( external _wp _editor _namespaceObject . store ) ;
const { setRenderingMode } = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _editor _namespaceObject . store ) ;
const onNavigateToEntityRecord = ( 0 , external _wp _element _namespaceObject . useCallback ) (
( params ) => {
dispatch ( {
type : "push" ,
post : { postId : params . postId , postType : params . postType } ,
// Save the current rendering mode so we can restore it when navigating back.
previousRenderingMode : getRenderingMode ( )
} ) ;
setRenderingMode ( defaultRenderingMode ) ;
} ,
[ getRenderingMode , setRenderingMode , defaultRenderingMode ]
) ;
2024-04-17 11:32:24 +02:00
const onNavigateToPreviousEntityRecord = ( 0 , external _wp _element _namespaceObject . useCallback ) ( ( ) => {
2025-12-12 13:15:55 +01:00
dispatch ( { type : "pop" } ) ;
2025-02-28 08:42:11 +01:00
if ( previousRenderingMode ) {
setRenderingMode ( previousRenderingMode ) ;
}
} , [ setRenderingMode , previousRenderingMode ] ) ;
2024-04-17 11:32:24 +02:00
return {
2025-02-28 08:42:11 +01:00
currentPost : post ,
2024-04-17 11:32:24 +02:00
onNavigateToEntityRecord ,
2025-12-12 13:15:55 +01:00
onNavigateToPreviousEntityRecord : postHistory . length > 1 ? onNavigateToPreviousEntityRecord : void 0
2024-04-17 11:32:24 +02:00
} ;
2023-09-26 10:33:34 +02:00
}
2025-02-28 08:42:11 +01:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-post/build-module/components/meta-boxes/use-meta-box-initialization.js
2025-02-28 08:42:11 +01:00
2025-12-12 13:15:55 +01:00
const useMetaBoxInitialization = ( enabled ) => {
const isEnabledAndEditorReady = ( 0 , external _wp _data _namespaceObject . useSelect ) (
( select ) => enabled && select ( external _wp _editor _namespaceObject . store ) . _ _unstableIsEditorReady ( ) ,
[ enabled ]
) ;
const { initializeMetaBoxes } = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store ) ;
2025-02-28 08:42:11 +01:00
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
if ( isEnabledAndEditorReady ) {
initializeMetaBoxes ( ) ;
}
} , [ isEnabledAndEditorReady , initializeMetaBoxes ] ) ;
} ;
2023-09-26 10:33:34 +02:00
2025-12-12 13:15:55 +01:00
; // ./node_modules/@wordpress/edit-post/build-module/components/layout/index.js
2021-07-23 11:58:50 +02:00
2022-04-02 10:26:41 +02:00
2023-09-26 10:33:34 +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 { getLayoutStyles } = unlock ( external _wp _blockEditor _namespaceObject . privateApis ) ;
const { useCommandContext } = unlock ( external _wp _commands _namespaceObject . privateApis ) ;
const { Editor , FullscreenMode } = unlock ( external _wp _editor _namespaceObject . privateApis ) ;
const { BlockKeyboardShortcuts } = unlock ( external _wp _blockLibrary _namespaceObject . privateApis ) ;
const DESIGN _POST _TYPES = [
"wp_template" ,
"wp_template_part" ,
"wp_block" ,
"wp_navigation"
] ;
2025-04-25 12:30:07 +02:00
function useEditorStyles ( ... additionalStyles ) {
2025-12-12 13:15:55 +01:00
const { hasThemeStyleSupport , editorSettings } = ( 0 , external _wp _data _namespaceObject . useSelect ) ( ( select ) => {
2025-02-28 08:42:11 +01:00
return {
2025-12-12 13:15:55 +01:00
hasThemeStyleSupport : select ( store ) . isFeatureActive ( "themeStyles" ) ,
2025-04-25 12:30:07 +02:00
editorSettings : select ( external _wp _editor _namespaceObject . store ) . getEditorSettings ( )
2025-02-28 08:42:11 +01:00
} ;
} , [ ] ) ;
2025-12-12 13:15:55 +01:00
const addedStyles = additionalStyles . join ( "\n" ) ;
2025-02-28 08:42:11 +01:00
return ( 0 , external _wp _element _namespaceObject . useMemo ) ( ( ) => {
2025-12-12 13:15:55 +01:00
const presetStyles = editorSettings . styles ? . filter (
( style ) => style . _ _unstableType && style . _ _unstableType !== "theme"
) ? ? [ ] ;
const defaultEditorStyles = [
... editorSettings ? . defaultEditorStyles ? ? [ ] ,
... presetStyles
] ;
const hasThemeStyles = hasThemeStyleSupport && presetStyles . length !== ( editorSettings . styles ? . length ? ? 0 ) ;
2025-02-28 08:42:11 +01:00
if ( ! editorSettings . disableLayoutStyles && ! hasThemeStyles ) {
defaultEditorStyles . push ( {
css : getLayoutStyles ( {
style : { } ,
2025-12-12 13:15:55 +01:00
selector : "body" ,
2025-02-28 08:42:11 +01:00
hasBlockGapSupport : false ,
hasFallbackGapSupport : true ,
2025-12-12 13:15:55 +01:00
fallbackGapValue : "0.5em"
2025-02-28 08:42:11 +01:00
} )
} ) ;
}
2025-12-12 13:15:55 +01:00
const baseStyles = hasThemeStyles ? editorSettings . styles ? ? [ ] : defaultEditorStyles ;
2025-04-25 12:30:07 +02:00
if ( addedStyles ) {
2025-12-12 13:15:55 +01:00
return [ ... baseStyles , { css : addedStyles } ] ;
2025-02-28 08:42:11 +01:00
}
return baseStyles ;
2025-12-12 13:15:55 +01:00
} , [
editorSettings . defaultEditorStyles ,
editorSettings . disableLayoutStyles ,
editorSettings . styles ,
hasThemeStyleSupport ,
addedStyles
] ) ;
2025-02-28 08:42:11 +01:00
}
2025-12-12 13:15:55 +01:00
function MetaBoxesMain ( { isLegacy } ) {
const [ isOpen , openHeight , hasAnyVisible ] = ( 0 , external _wp _data _namespaceObject . useSelect ) ( ( select ) => {
const { get } = select ( external _wp _preferences _namespaceObject . store ) ;
const { isMetaBoxLocationVisible } = select ( store ) ;
return [
! ! get ( "core/edit-post" , "metaBoxesMainIsOpen" ) ,
get ( "core/edit-post" , "metaBoxesMainOpenHeight" ) ,
isMetaBoxLocationVisible ( "normal" ) || isMetaBoxLocationVisible ( "advanced" ) || isMetaBoxLocationVisible ( "side" )
] ;
2025-02-28 08:42:11 +01:00
} , [ ] ) ;
2025-12-12 13:15:55 +01:00
const { set : setPreference } = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _preferences _namespaceObject . store ) ;
2025-02-28 08:42:11 +01:00
const metaBoxesMainRef = ( 0 , external _wp _element _namespaceObject . useRef ) ( ) ;
2025-12-12 13:15:55 +01:00
const isShort = ( 0 , external _wp _compose _namespaceObject . useMediaQuery ) ( "(max-height: 549px)" ) ;
const [ { min , max } , setHeightConstraints ] = ( 0 , external _wp _element _namespaceObject . useState ) ( ( ) => ( { } ) ) ;
const effectSizeConstraints = ( 0 , external _wp _compose _namespaceObject . useRefEffect ) ( ( node ) => {
const container = node . closest (
".interface-interface-skeleton__content"
) ;
if ( ! container ) {
return ;
}
const noticeLists = container . querySelectorAll (
":scope > .components-notice-list"
) ;
const resizeHandle = container . querySelector (
".edit-post-meta-boxes-main__presenter"
) ;
2025-02-28 08:42:11 +01:00
const deriveConstraints = ( ) => {
const fullHeight = container . offsetHeight ;
let nextMax = fullHeight ;
for ( const element of noticeLists ) {
nextMax -= element . offsetHeight ;
}
const nextMin = resizeHandle . offsetHeight ;
2025-12-12 13:15:55 +01:00
setHeightConstraints ( { min : nextMin , max : nextMax } ) ;
2025-02-28 08:42:11 +01:00
} ;
const observer = new window . ResizeObserver ( deriveConstraints ) ;
observer . observe ( container ) ;
for ( const element of noticeLists ) {
observer . observe ( element ) ;
}
return ( ) => observer . disconnect ( ) ;
} , [ ] ) ;
2025-12-12 13:15:55 +01:00
const resizeDataRef = ( 0 , external _wp _element _namespaceObject . useRef ) ( { } ) ;
2025-02-28 08:42:11 +01:00
const separatorRef = ( 0 , external _wp _element _namespaceObject . useRef ) ( ) ;
const separatorHelpId = ( 0 , external _wp _element _namespaceObject . useId ) ( ) ;
2025-12-12 13:15:55 +01:00
const applyHeight = ( candidateHeight = "auto" , isPersistent , isInstant ) => {
if ( candidateHeight === "auto" ) {
isPersistent = false ;
2025-02-28 08:42:11 +01:00
} else {
2025-12-12 13:15:55 +01:00
candidateHeight = Math . min ( max , Math . max ( min , candidateHeight ) ) ;
}
if ( isPersistent ) {
setPreference (
"core/edit-post" ,
"metaBoxesMainOpenHeight" ,
candidateHeight
) ;
} else if ( ! isShort ) {
separatorRef . current . ariaValueNow = getAriaValueNow ( candidateHeight ) ;
2025-02-28 08:42:11 +01:00
}
if ( isInstant ) {
metaBoxesMainRef . current . updateSize ( {
2025-12-12 13:15:55 +01:00
height : candidateHeight ,
2025-02-28 08:42:11 +01:00
// Oddly, when the event that triggered this was not from the mouse (e.g. keydown),
// if `width` is left unspecified a subsequent drag gesture applies a fixed
// width and the pane fails to widen/narrow with parent width changes from
// sidebars opening/closing or window resizes.
2025-12-12 13:15:55 +01:00
width : "auto"
2025-02-28 08:42:11 +01:00
} ) ;
}
} ;
2025-12-12 13:15:55 +01:00
const getRenderValues = ( 0 , external _wp _compose _namespaceObject . useEvent ) ( ( ) => ( { isOpen , openHeight , min } ) ) ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
const fresh = getRenderValues ( ) ;
if ( fresh . min !== void 0 && metaBoxesMainRef . current ) {
const usedOpenHeight = isShort ? "auto" : fresh . openHeight ;
const usedHeight = fresh . isOpen ? usedOpenHeight : fresh . min ;
applyHeight ( usedHeight , false , true ) ;
}
} , [ isShort ] ) ;
2025-02-28 08:42:11 +01:00
if ( ! hasAnyVisible ) {
return ;
}
2025-12-12 13:15:55 +01:00
const contents = /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) (
"div" ,
{
className : "edit-post-layout__metaboxes edit-post-meta-boxes-main__liner" ,
hidden : ! isLegacy && ! isOpen ,
children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( MetaBoxes , { location : "normal" } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( MetaBoxes , { location : "advanced" } )
]
}
) ;
2025-06-09 10:07:10 +02:00
if ( isLegacy ) {
return contents ;
}
2025-12-12 13:15:55 +01:00
const isAutoHeight = openHeight === void 0 ;
const getAriaValueNow = ( height ) => Math . round ( ( height - min ) / ( max - min ) * 100 ) ;
const usedAriaValueNow = max === void 0 || isAutoHeight ? 50 : getAriaValueNow ( openHeight ) ;
const persistIsOpen = ( to = ! isOpen ) => setPreference ( "core/edit-post" , "metaBoxesMainIsOpen" , to ) ;
const onSeparatorKeyDown = ( event ) => {
const delta = { ArrowUp : 20 , ArrowDown : - 20 } [ event . key ] ;
2025-02-28 08:42:11 +01:00
if ( delta ) {
const pane = metaBoxesMainRef . current . resizable ;
const fromHeight = isAutoHeight ? pane . offsetHeight : openHeight ;
const nextHeight = delta + fromHeight ;
applyHeight ( nextHeight , true , true ) ;
2025-12-12 13:15:55 +01:00
persistIsOpen ( nextHeight > min ) ;
2025-02-28 08:42:11 +01:00
event . preventDefault ( ) ;
}
} ;
2025-12-12 13:15:55 +01:00
const paneLabel = ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Meta Boxes" ) ;
const toggle = /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) (
"button" ,
{
"aria-expanded" : isOpen ,
onClick : ( { detail } ) => {
const { isToggleInferred } = resizeDataRef . current ;
if ( isShort || ! detail || isToggleInferred ) {
persistIsOpen ( ) ;
const usedOpenHeight = isShort ? "auto" : openHeight ;
const usedHeight = isOpen ? min : usedOpenHeight ;
applyHeight ( usedHeight , false , true ) ;
}
2025-02-28 08:42:11 +01:00
} ,
2025-12-12 13:15:55 +01:00
... isShort && {
onMouseDown : ( event ) => event . stopPropagation ( ) ,
onTouchStart : ( event ) => event . stopPropagation ( )
2025-02-28 08:42:11 +01:00
} ,
2025-12-12 13:15:55 +01:00
children : [
paneLabel ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _components _namespaceObject . Icon , { icon : isOpen ? chevron _up _default : chevron _down _default } )
]
}
) ;
const separator = ! isShort && /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( external _ReactJSXRuntime _namespaceObject . Fragment , { children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _components _namespaceObject . Tooltip , { text : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Drag to resize" ) , children : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
"button" ,
{
ref : separatorRef ,
role : "separator" ,
"aria-valuenow" : usedAriaValueNow ,
"aria-label" : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Drag to resize" ) ,
"aria-describedby" : separatorHelpId ,
onKeyDown : onSeparatorKeyDown
}
) } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _components _namespaceObject . VisuallyHidden , { id : separatorHelpId , children : ( 0 , external _wp _i18n _namespaceObject . _ _ ) (
"Use up and down arrow keys to resize the meta box panel."
) } )
] } ) ;
const paneProps = (
/** @type {Parameters<typeof ResizableBox>[0]} */
{
as : navigable _region _default ,
ref : metaBoxesMainRef ,
className : "edit-post-meta-boxes-main" ,
defaultSize : { height : isOpen ? openHeight : 0 } ,
minHeight : min ,
maxHeight : max ,
enable : { top : true } ,
handleClasses : { top : "edit-post-meta-boxes-main__presenter" } ,
2025-02-28 08:42:11 +01:00
handleComponent : {
2025-12-12 13:15:55 +01:00
top : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( external _ReactJSXRuntime _namespaceObject . Fragment , { children : [
toggle ,
separator
] } )
2025-02-28 08:42:11 +01:00
} ,
// Avoids hiccups while dragging over objects like iframes and ensures that
// the event to end the drag is captured by the target (resize handle)
// whether or not it’ s under the pointer.
2025-12-12 13:15:55 +01:00
onPointerDown : ( { pointerId , target } ) => {
if ( separatorRef . current ? . parentElement . contains ( target ) ) {
2025-04-25 12:30:07 +02:00
target . setPointerCapture ( pointerId ) ;
}
2025-02-28 08:42:11 +01:00
} ,
2025-12-12 13:15:55 +01:00
onResizeStart : ( { timeStamp } , direction , elementRef ) => {
2025-02-28 08:42:11 +01:00
if ( isAutoHeight ) {
applyHeight ( elementRef . offsetHeight , false , true ) ;
}
2025-12-12 13:15:55 +01:00
elementRef . classList . add ( "is-resizing" ) ;
resizeDataRef . current = { timeStamp , maxDelta : 0 } ;
2025-02-28 08:42:11 +01:00
} ,
2025-12-12 13:15:55 +01:00
onResize : ( event , direction , elementRef , delta ) => {
const { maxDelta } = resizeDataRef . current ;
const newDelta = Math . abs ( delta . height ) ;
resizeDataRef . current . maxDelta = Math . max ( maxDelta , newDelta ) ;
applyHeight ( metaBoxesMainRef . current . state . height ) ;
} ,
onResizeStop : ( event , direction , elementRef ) => {
elementRef . classList . remove ( "is-resizing" ) ;
const duration = event . timeStamp - resizeDataRef . current . timeStamp ;
const wasSeparator = event . target === separatorRef . current ;
const { maxDelta } = resizeDataRef . current ;
const isToggleInferred = maxDelta < 1 || duration < 144 && maxDelta < 5 ;
if ( isShort || ! wasSeparator && isToggleInferred ) {
resizeDataRef . current . isToggleInferred = true ;
} else {
const { height } = metaBoxesMainRef . current . state ;
const nextIsOpen = height > min ;
persistIsOpen ( nextIsOpen ) ;
if ( nextIsOpen ) {
applyHeight ( height , true ) ;
}
}
}
}
) ;
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( external _wp _components _namespaceObject . ResizableBox , { "aria-label" : paneLabel , ... paneProps , children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( "meta" , { ref : effectSizeConstraints } ) ,
contents
] } ) ;
2025-02-28 08:42:11 +01:00
}
function Layout ( {
2024-04-17 11:32:24 +02:00
postId : initialPostId ,
postType : initialPostType ,
2023-09-26 10:33:34 +02:00
settings ,
2025-02-28 08:42:11 +01:00
initialEdits
2023-09-26 10:33:34 +02:00
} ) {
2025-02-28 08:42:11 +01:00
useCommands ( ) ;
const shouldIframe = useShouldIframe ( ) ;
2025-12-12 13:15:55 +01:00
const { createErrorNotice } = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _notices _namespaceObject . store ) ;
2025-02-28 08:42:11 +01:00
const {
2025-12-12 13:15:55 +01:00
currentPost : { postId : currentPostId , postType : currentPostType } ,
2024-04-17 11:32:24 +02:00
onNavigateToEntityRecord ,
onNavigateToPreviousEntityRecord
2025-12-12 13:15:55 +01:00
} = useNavigateToEntityRecord (
initialPostId ,
initialPostType ,
"post-only"
) ;
const isEditingTemplate = currentPostType === "wp_template" ;
2024-04-17 11:32:24 +02:00
const {
2025-02-28 08:42:11 +01:00
mode ,
isFullscreenActive ,
2025-04-25 12:30:07 +02:00
hasResolvedMode ,
2025-02-28 08:42:11 +01:00
hasActiveMetaboxes ,
hasBlockSelected ,
showIconLabels ,
isDistractionFree ,
showMetaBoxes ,
isWelcomeGuideVisible ,
templateId ,
2025-06-09 10:07:10 +02:00
enablePaddingAppender ,
isDevicePreview
2025-12-12 13:15:55 +01:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) (
( select ) => {
const { get } = select ( external _wp _preferences _namespaceObject . store ) ;
const { isFeatureActive , hasMetaBoxes } = select ( store ) ;
const { canUser , getPostType , getTemplateId } = unlock (
select ( external _wp _coreData _namespaceObject . store )
) ;
const supportsTemplateMode = settings . supportsTemplateMode ;
const isViewable = getPostType ( currentPostType ) ? . viewable ? ? false ;
const canViewTemplate = canUser ( "read" , {
kind : "postType" ,
name : "wp_template"
} ) ;
const { getBlockSelectionStart , isZoomOut } = unlock (
select ( external _wp _blockEditor _namespaceObject . store )
) ;
const {
getEditorMode ,
getRenderingMode ,
getDefaultRenderingMode ,
getDeviceType
} = unlock ( select ( external _wp _editor _namespaceObject . store ) ) ;
const isRenderingPostOnly = getRenderingMode ( ) === "post-only" ;
const isNotDesignPostType = ! DESIGN _POST _TYPES . includes ( currentPostType ) ;
const isDirectlyEditingPattern = currentPostType === "wp_block" && ! onNavigateToPreviousEntityRecord ;
const _templateId = getTemplateId ( currentPostType , currentPostId ) ;
const defaultMode = getDefaultRenderingMode ( currentPostType ) ;
return {
mode : getEditorMode ( ) ,
isFullscreenActive : isFeatureActive ( "fullscreenMode" ) ,
hasActiveMetaboxes : hasMetaBoxes ( ) ,
hasResolvedMode : defaultMode === "template-locked" ? ! ! _templateId : defaultMode !== void 0 ,
hasBlockSelected : ! ! getBlockSelectionStart ( ) ,
showIconLabels : get ( "core" , "showIconLabels" ) ,
isDistractionFree : get ( "core" , "distractionFree" ) ,
showMetaBoxes : isNotDesignPostType && ! isZoomOut ( ) || isDirectlyEditingPattern ,
isWelcomeGuideVisible : isFeatureActive ( "welcomeGuide" ) ,
templateId : supportsTemplateMode && isViewable && canViewTemplate && ! isEditingTemplate ? _templateId : null ,
enablePaddingAppender : ! isZoomOut ( ) && isRenderingPostOnly && isNotDesignPostType ,
isDevicePreview : getDeviceType ( ) !== "Desktop"
} ;
} ,
[
currentPostType ,
currentPostId ,
isEditingTemplate ,
settings . supportsTemplateMode ,
onNavigateToPreviousEntityRecord
]
) ;
2025-04-25 12:30:07 +02:00
useMetaBoxInitialization ( hasActiveMetaboxes && hasResolvedMode ) ;
2025-12-12 13:15:55 +01:00
const [ paddingAppenderRef , paddingStyle ] = usePaddingAppender (
enablePaddingAppender
) ;
const commandContext = hasBlockSelected ? "block-selection-edit" : "entity-edit" ;
2025-02-28 08:42:11 +01:00
useCommandContext ( commandContext ) ;
2025-12-12 13:15:55 +01:00
const editorSettings = ( 0 , external _wp _element _namespaceObject . useMemo ) (
( ) => ( {
... settings ,
onNavigateToEntityRecord ,
onNavigateToPreviousEntityRecord ,
defaultRenderingMode : "post-only"
} ) ,
[ settings , onNavigateToEntityRecord , onNavigateToPreviousEntityRecord ]
) ;
2025-04-25 12:30:07 +02:00
const styles = useEditorStyles ( paddingStyle ) ;
2025-02-28 08:42:11 +01:00
if ( showIconLabels ) {
2025-12-12 13:15:55 +01:00
document . body . classList . add ( "show-icon-labels" ) ;
2025-02-28 08:42:11 +01:00
} else {
2025-12-12 13:15:55 +01:00
document . body . classList . remove ( "show-icon-labels" ) ;
2021-07-23 11:58:50 +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
const className = dist _clsx ( "edit-post-layout" , "is-mode-" + mode , {
"has-metaboxes" : hasActiveMetaboxes
2025-02-28 08:42:11 +01: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
)
) ;
2025-02-28 08:42:11 +01:00
}
2025-12-12 13:15:55 +01:00
const { createSuccessNotice } = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _notices _namespaceObject . store ) ;
const onActionPerformed = ( 0 , external _wp _element _namespaceObject . useCallback ) (
( actionId , items ) => {
switch ( actionId ) {
case "move-to-trash" :
{
document . location . href = ( 0 , external _wp _url _namespaceObject . addQueryArgs ) ( "edit.php" , {
trashed : 1 ,
post _type : items [ 0 ] . type ,
ids : items [ 0 ] . id
} ) ;
}
break ;
case "duplicate-post" :
{
const newItem = items [ 0 ] ;
const title = typeof newItem . title === "string" ? newItem . title : newItem . title ? . rendered ;
createSuccessNotice (
( 0 , external _wp _i18n _namespaceObject . sprintf ) (
// translators: %s: Title of the created post or template, e.g: "Hello world".
( 0 , external _wp _i18n _namespaceObject . _ _ ) ( '"%s" successfully created.' ) ,
( 0 , external _wp _htmlEntities _namespaceObject . decodeEntities ) ( title ) || ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "(no title)" )
) ,
{
type : "snackbar" ,
id : "duplicate-post-action" ,
actions : [
{
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Edit" ) ,
onClick : ( ) => {
const postId = newItem . id ;
document . location . href = ( 0 , external _wp _url _namespaceObject . addQueryArgs ) ( "post.php" , {
post : postId ,
action : "edit"
} ) ;
}
}
]
2025-02-28 08:42:11 +01:00
}
2025-12-12 13:15:55 +01:00
) ;
}
break ;
}
} ,
[ createSuccessNotice ]
) ;
2025-02-28 08:42:11 +01:00
const initialPost = ( 0 , external _wp _element _namespaceObject . useMemo ) ( ( ) => {
return {
type : initialPostType ,
id : initialPostId
} ;
} , [ initialPostType , initialPostId ] ) ;
2025-12-12 13:15:55 +01:00
const backButton = ( 0 , external _wp _compose _namespaceObject . useViewportMatch ) ( "medium" ) && isFullscreenActive ? /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( back _button _default , { initialPost } ) : null ;
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _components _namespaceObject . SlotFillProvider , { children : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( external _wp _editor _namespaceObject . ErrorBoundary , { canCopyContent : true , children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( WelcomeGuide , { postType : currentPostType } ) ,
/* @__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 ) (
Editor ,
{
settings : editorSettings ,
initialEdits ,
postType : currentPostType ,
postId : currentPostId ,
templateId ,
className ,
styles ,
forceIsDirty : hasActiveMetaboxes ,
contentRef : paddingAppenderRef ,
disableIframe : ! shouldIframe ,
autoFocus : ! isWelcomeGuideVisible ,
onActionPerformed ,
extraSidebarPanels : showMetaBoxes && /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( MetaBoxes , { location : "side" } ) ,
extraContent : ! isDistractionFree && showMetaBoxes && /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
MetaBoxesMain ,
{
isLegacy : ! shouldIframe || isDevicePreview
}
) ,
children : [
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _editor _namespaceObject . PostLockedModal , { } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( EditorInitialization , { } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( FullscreenMode , { isActive : isFullscreenActive } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( BrowserURL , { } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _editor _namespaceObject . UnsavedChangesWarning , { } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _editor _namespaceObject . AutosaveMonitor , { } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _editor _namespaceObject . LocalAutosaveMonitor , { } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( keyboard _shortcuts _default , { } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _editor _namespaceObject . EditorKeyboardShortcutsRegister , { } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( BlockKeyboardShortcuts , { } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( InitPatternModal , { } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _plugins _namespaceObject . PluginArea , { onError : onPluginAreaError } ) ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( more _menu _default , { } ) ,
backButton ,
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _editor _namespaceObject . EditorSnackbars , { } )
]
}
)
}
)
] } ) } ) ;
2021-07-23 11:58:50 +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-post/build-module/deprecated.js
2021-07-23 11:58:50 +02:00
2023-12-07 09:44:11 +01:00
2025-02-28 08:42:11 +01:00
2025-12-12 13:15:55 +01:00
const { PluginPostExcerpt } = unlock ( external _wp _editor _namespaceObject . privateApis ) ;
const isSiteEditor = ( 0 , external _wp _url _namespaceObject . getPath ) ( window . location . href ) ? . includes (
"site-editor.php"
) ;
const deprecateSlot = ( name ) => {
2025-02-28 08:42:11 +01:00
external _wp _deprecated _default ( ) ( ` wp.editPost. ${ name } ` , {
2025-12-12 13:15:55 +01:00
since : "6.6" ,
2025-02-28 08:42:11 +01:00
alternative : ` wp.editor. ${ name } `
} ) ;
} ;
function PluginBlockSettingsMenuItem ( props ) {
if ( isSiteEditor ) {
2023-09-26 10:33:34 +02:00
return null ;
}
2025-12-12 13:15:55 +01:00
deprecateSlot ( "PluginBlockSettingsMenuItem" ) ;
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _editor _namespaceObject . PluginBlockSettingsMenuItem , { ... props } ) ;
2025-02-28 08:42:11 +01:00
}
function PluginDocumentSettingPanel ( props ) {
if ( isSiteEditor ) {
return null ;
}
2025-12-12 13:15:55 +01:00
deprecateSlot ( "PluginDocumentSettingPanel" ) ;
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _editor _namespaceObject . PluginDocumentSettingPanel , { ... props } ) ;
2025-02-28 08:42:11 +01:00
}
function PluginMoreMenuItem ( props ) {
if ( isSiteEditor ) {
return null ;
}
2025-12-12 13:15:55 +01:00
deprecateSlot ( "PluginMoreMenuItem" ) ;
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _editor _namespaceObject . PluginMoreMenuItem , { ... props } ) ;
2025-02-28 08:42:11 +01:00
}
function PluginPrePublishPanel ( props ) {
if ( isSiteEditor ) {
return null ;
}
2025-12-12 13:15:55 +01:00
deprecateSlot ( "PluginPrePublishPanel" ) ;
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _editor _namespaceObject . PluginPrePublishPanel , { ... props } ) ;
2025-02-28 08:42:11 +01:00
}
function PluginPostPublishPanel ( props ) {
if ( isSiteEditor ) {
return null ;
}
2025-12-12 13:15:55 +01:00
deprecateSlot ( "PluginPostPublishPanel" ) ;
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _editor _namespaceObject . PluginPostPublishPanel , { ... props } ) ;
2025-02-28 08:42:11 +01:00
}
function PluginPostStatusInfo ( props ) {
if ( isSiteEditor ) {
return null ;
}
2025-12-12 13:15:55 +01:00
deprecateSlot ( "PluginPostStatusInfo" ) ;
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _editor _namespaceObject . PluginPostStatusInfo , { ... props } ) ;
2025-02-28 08:42:11 +01:00
}
function PluginSidebar ( props ) {
if ( isSiteEditor ) {
return null ;
}
2025-12-12 13:15:55 +01:00
deprecateSlot ( "PluginSidebar" ) ;
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _editor _namespaceObject . PluginSidebar , { ... props } ) ;
2025-02-28 08:42:11 +01:00
}
2022-06-16 14:03:35 +02:00
function PluginSidebarMoreMenuItem ( props ) {
2025-02-28 08:42:11 +01:00
if ( isSiteEditor ) {
return null ;
}
2025-12-12 13:15:55 +01:00
deprecateSlot ( "PluginSidebarMoreMenuItem" ) ;
return /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _editor _namespaceObject . PluginSidebarMoreMenuItem , { ... props } ) ;
2022-06-16 14:03:35 +02:00
}
2025-02-28 08:42:11 +01:00
function _ _experimentalPluginPostExcerpt ( ) {
if ( isSiteEditor ) {
return null ;
}
2025-12-12 13:15:55 +01:00
external _wp _deprecated _default ( ) ( "wp.editPost.__experimentalPluginPostExcerpt" , {
since : "6.6" ,
hint : "Core and custom panels can be access programmatically using their panel name." ,
link : "https://developer.wordpress.org/block-editor/reference-guides/slotfills/plugin-document-setting-panel/#accessing-a-panel-programmatically"
2025-02-28 08:42:11 +01:00
} ) ;
return PluginPostExcerpt ;
}
2019-11-02 10:38:58 +01:00
2025-04-25 12:30:07 +02:00
; // ./node_modules/@wordpress/edit-post/build-module/index.js
2019-11-02 10:38:58 +01:00
2023-04-26 17:39:43 +02:00
2023-12-07 09:44:11 +01:00
2019-11-02 10:38:58 +01:00
2024-04-17 11:32:24 +02:00
const {
2025-02-28 08:42:11 +01:00
BackButton : _ _experimentalMainDashboardButton ,
registerCoreBlockBindingsSources
2024-04-17 11:32:24 +02:00
} = unlock ( external _wp _editor _namespaceObject . privateApis ) ;
2022-06-16 14:03:35 +02:00
function initializeEditor ( id , postType , postId , settings , initialEdits ) {
2025-12-12 13:15:55 +01:00
const isMediumOrBigger = window . matchMedia ( "(min-width: 782px)" ) . matches ;
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
( 0 , external _wp _data _namespaceObject . dispatch ) ( external _wp _preferences _namespaceObject . store ) . setDefaults ( "core/edit-post" , {
2024-04-17 11:32:24 +02:00
fullscreenMode : true ,
themeStyles : true ,
welcomeGuide : true ,
welcomeGuideTemplate : true
} ) ;
2025-12-12 13:15:55 +01:00
( 0 , external _wp _data _namespaceObject . dispatch ) ( external _wp _preferences _namespaceObject . store ) . setDefaults ( "core" , {
2024-04-17 11:32:24 +02:00
allowRightClickOverrides : true ,
2025-12-12 13:15:55 +01:00
editorMode : "visual" ,
editorTool : "edit" ,
2022-06-16 14:03:35 +02:00
fixedToolbar : false ,
hiddenBlockTypes : [ ] ,
inactivePanels : [ ] ,
2025-12-12 13:15:55 +01:00
openPanels : [ "post-status" ] ,
2022-06-16 14:03:35 +02:00
showBlockBreadcrumbs : true ,
showIconLabels : false ,
2025-02-28 08:42:11 +01:00
showListViewByDefault : false ,
enableChoosePatternModal : true ,
isPublishSidebarEnabled : true
} ) ;
if ( window . _ _experimentalMediaProcessing ) {
2025-12-12 13:15:55 +01:00
( 0 , external _wp _data _namespaceObject . dispatch ) ( external _wp _preferences _namespaceObject . store ) . setDefaults ( "core/media" , {
2025-02-28 08:42:11 +01:00
requireApproval : true ,
optimizeOnUpload : true
} ) ;
}
2023-12-07 09:44:11 +01:00
( 0 , external _wp _data _namespaceObject . dispatch ) ( external _wp _blocks _namespaceObject . store ) . reapplyBlockTypeFilters ( ) ;
2025-12-12 13:15:55 +01:00
if ( isMediumOrBigger && ( 0 , external _wp _data _namespaceObject . select ) ( external _wp _preferences _namespaceObject . store ) . get ( "core" , "showListViewByDefault" ) && ! ( 0 , external _wp _data _namespaceObject . select ) ( external _wp _preferences _namespaceObject . store ) . get ( "core" , "distractionFree" ) ) {
2024-04-17 11:32:24 +02:00
( 0 , external _wp _data _namespaceObject . dispatch ) ( external _wp _editor _namespaceObject . store ) . setIsListViewOpened ( true ) ;
2022-12-15 17:47:31 +01:00
}
2022-06-16 14:03:35 +02:00
( 0 , external _wp _blockLibrary _namespaceObject . registerCoreBlocks ) ( ) ;
2025-02-28 08:42:11 +01:00
registerCoreBlockBindingsSources ( ) ;
2025-12-12 13:15:55 +01:00
( 0 , external _wp _widgets _namespaceObject . registerLegacyWidgetBlock ) ( { inserter : false } ) ;
( 0 , external _wp _widgets _namespaceObject . registerWidgetGroupBlock ) ( { inserter : false } ) ;
2022-12-15 17:47:31 +01:00
if ( false ) { }
2025-12-12 13:15:55 +01:00
const documentMode = document . compatMode === "CSS1Compat" ? "Standards" : "Quirks" ;
if ( documentMode !== "Standards" ) {
console . warn (
"Your browser is using Quirks Mode. \nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins."
) ;
2023-12-07 09:44:11 +01:00
}
2025-12-12 13:15:55 +01:00
const isIphone = window . navigator . userAgent . indexOf ( "iPhone" ) !== - 1 ;
2022-06-16 14:03:35 +02:00
if ( isIphone ) {
2025-12-12 13:15:55 +01:00
window . addEventListener ( "scroll" , ( event ) => {
const editorScrollContainer = document . getElementsByClassName (
"interface-interface-skeleton__body"
) [ 0 ] ;
2022-06-16 14:03:35 +02:00
if ( event . target === document ) {
if ( window . scrollY > 100 ) {
editorScrollContainer . scrollTop = editorScrollContainer . scrollTop + window . scrollY ;
2023-12-07 09:44:11 +01:00
}
2025-12-12 13:15:55 +01:00
if ( document . getElementsByClassName ( "is-mode-visual" ) [ 0 ] ) {
2022-06-16 14:03:35 +02:00
window . scrollTo ( 0 , 0 ) ;
}
}
} ) ;
2023-12-07 09:44:11 +01:00
}
2025-12-12 13:15:55 +01:00
window . addEventListener ( "dragover" , ( e ) => e . preventDefault ( ) , false ) ;
window . addEventListener ( "drop" , ( e ) => e . preventDefault ( ) , false ) ;
root . render (
/* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _element _namespaceObject . StrictMode , { children : /* @__PURE__ */ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) (
layout _default ,
{
settings ,
postId ,
postType ,
initialEdits
}
) } )
) ;
2023-04-26 17:39:43 +02:00
return root ;
}
function reinitializeEditor ( ) {
2025-12-12 13:15:55 +01:00
external _wp _deprecated _default ( ) ( "wp.editPost.reinitializeEditor" , {
since : "6.2" ,
version : "6.3"
2023-04-26 17:39:43 +02:00
} ) ;
2022-06-16 14:03:35 +02:00
}
2021-07-23 11:58:50 +02:00
2022-06-16 14:03:35 +02:00
( window . wp = window . wp || { } ) . editPost = _ _webpack _exports _ _ ;
/******/ } ) ( )
;