2023-09-21 15:26:32 +02:00
/******/ ( function ( ) { // webpackBootstrap
2022-04-11 14:04:30 +02:00
/******/ var _ _webpack _modules _ _ = ( {
/***/ 4403 :
2023-09-21 15:26:32 +02:00
/***/ ( function ( module , exports ) {
2022-04-11 14:04:30 +02:00
var _ _WEBPACK _AMD _DEFINE _ARRAY _ _ , _ _WEBPACK _AMD _DEFINE _RESULT _ _ ; / * !
2022-09-20 17:43:29 +02:00
Copyright ( c ) 2018 Jed Watson .
Licensed under the MIT License ( MIT ) , see
http : //jedwatson.github.io/classnames
2022-04-11 14:04:30 +02:00
* /
/* global define */
( function ( ) {
'use strict' ;
var hasOwn = { } . hasOwnProperty ;
2022-09-20 17:43:29 +02:00
var nativeCodeString = '[native code]' ;
2022-04-11 14:04:30 +02:00
function classNames ( ) {
var classes = [ ] ;
for ( var i = 0 ; i < arguments . length ; i ++ ) {
var arg = arguments [ i ] ;
if ( ! arg ) continue ;
var argType = typeof arg ;
if ( argType === 'string' || argType === 'number' ) {
classes . push ( arg ) ;
} else if ( Array . isArray ( arg ) ) {
if ( arg . length ) {
var inner = classNames . apply ( null , arg ) ;
if ( inner ) {
classes . push ( inner ) ;
}
}
} else if ( argType === 'object' ) {
2022-09-20 17:43:29 +02:00
if ( arg . toString !== Object . prototype . toString && ! arg . toString . toString ( ) . includes ( '[native code]' ) ) {
2022-04-11 14:04:30 +02:00
classes . push ( arg . toString ( ) ) ;
2022-09-20 17:43:29 +02:00
continue ;
}
for ( var key in arg ) {
if ( hasOwn . call ( arg , key ) && arg [ key ] ) {
classes . push ( key ) ;
}
2022-04-11 14:04:30 +02:00
}
}
}
return classes . join ( ' ' ) ;
}
if ( true && module . exports ) {
classNames . default = classNames ;
module . exports = classNames ;
} else if ( true ) {
// register as 'classnames', consistent with npm package name
! ( _ _WEBPACK _AMD _DEFINE _ARRAY _ _ = [ ] , _ _WEBPACK _AMD _DEFINE _RESULT _ _ = ( function ( ) {
return classNames ;
} ) . apply ( exports , _ _WEBPACK _AMD _DEFINE _ARRAY _ _ ) ,
_ _WEBPACK _AMD _DEFINE _RESULT _ _ !== undefined && ( module . exports = _ _WEBPACK _AMD _DEFINE _RESULT _ _ ) ) ;
} else { }
} ( ) ) ;
/***/ } )
/******/ } ) ;
/************************************************************************/
2018-12-14 05:41:57 +01:00
/******/ // The module cache
2022-04-11 14:04:30 +02:00
/******/ var _ _webpack _module _cache _ _ = { } ;
/******/
2018-12-14 05:41:57 +01:00
/******/ // The require function
/******/ function _ _webpack _require _ _ ( moduleId ) {
/******/ // Check if module is in cache
2022-04-11 14:04:30 +02:00
/******/ var cachedModule = _ _webpack _module _cache _ _ [ moduleId ] ;
/******/ if ( cachedModule !== undefined ) {
/******/ return cachedModule . exports ;
2018-12-14 05:41:57 +01:00
/******/ }
/******/ // Create a new module (and put it into the cache)
2022-04-11 14:04:30 +02:00
/******/ var module = _ _webpack _module _cache _ _ [ moduleId ] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
2018-12-14 05:41:57 +01:00
/******/ exports : { }
/******/ } ;
2022-04-11 14:04:30 +02:00
/******/
2018-12-14 05:41:57 +01:00
/******/ // Execute the module function
2022-04-11 14:04:30 +02:00
/******/ _ _webpack _modules _ _ [ moduleId ] ( module , module . exports , _ _webpack _require _ _ ) ;
/******/
2018-12-14 05:41:57 +01:00
/******/ // Return the exports of the module
/******/ return module . exports ;
/******/ }
2022-04-11 14:04:30 +02:00
/******/
2018-12-14 05:41:57 +01:00
/************************************************************************/
2022-04-11 14:04:30 +02:00
/******/ /* webpack/runtime/compat get default export */
2023-09-21 15:26:32 +02:00
/******/ ! function ( ) {
2022-04-11 14:04:30 +02:00
/******/ // getDefaultExport function for compatibility with non-harmony modules
2023-09-21 15:26:32 +02:00
/******/ _ _webpack _require _ _ . n = function ( module ) {
2022-04-11 14:04:30 +02:00
/******/ var getter = module && module . _ _esModule ?
2023-09-21 15:26:32 +02:00
/******/ function ( ) { return module [ 'default' ] ; } :
/******/ function ( ) { return module ; } ;
2022-04-11 14:04:30 +02:00
/******/ _ _webpack _require _ _ . d ( getter , { a : getter } ) ;
/******/ return getter ;
/******/ } ;
2023-09-21 15:26:32 +02:00
/******/ } ( ) ;
2022-04-11 14:04:30 +02:00
/******/
/******/ /* webpack/runtime/define property getters */
2023-09-21 15:26:32 +02:00
/******/ ! function ( ) {
2022-04-11 14:04:30 +02:00
/******/ // define getter functions for harmony exports
2023-09-21 15:26:32 +02:00
/******/ _ _webpack _require _ _ . d = function ( exports , definition ) {
2022-04-11 14:04:30 +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 ] } ) ;
/******/ }
/******/ }
/******/ } ;
2023-09-21 15:26:32 +02:00
/******/ } ( ) ;
2022-04-11 14:04:30 +02:00
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
2023-09-21 15:26:32 +02:00
/******/ ! function ( ) {
/******/ _ _webpack _require _ _ . o = function ( obj , prop ) { return Object . prototype . hasOwnProperty . call ( obj , prop ) ; }
/******/ } ( ) ;
2022-04-11 14:04:30 +02:00
/******/
/******/ /* webpack/runtime/make namespace object */
2023-09-21 15:26:32 +02:00
/******/ ! function ( ) {
2022-04-11 14:04:30 +02:00
/******/ // define __esModule on exports
2023-09-21 15:26:32 +02:00
/******/ _ _webpack _require _ _ . r = function ( exports ) {
2022-04-11 14:04:30 +02:00
/******/ if ( typeof Symbol !== 'undefined' && Symbol . toStringTag ) {
/******/ Object . defineProperty ( exports , Symbol . toStringTag , { value : 'Module' } ) ;
/******/ }
/******/ Object . defineProperty ( exports , '__esModule' , { value : true } ) ;
/******/ } ;
2023-09-21 15:26:32 +02:00
/******/ } ( ) ;
2022-04-11 14:04:30 +02:00
/******/
/************************************************************************/
var _ _webpack _exports _ _ = { } ;
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
2023-09-21 15:26:32 +02:00
! function ( ) {
2021-05-19 17:09:27 +02:00
"use strict" ;
2022-04-11 14:04:30 +02:00
// ESM COMPAT FLAG
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
2020-06-26 15:33:47 +02:00
2022-04-11 14:04:30 +02:00
// EXPORTS
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , {
2023-09-21 15:26:32 +02:00
PluginBlockSettingsMenuItem : function ( ) { return /* reexport */ plugin _block _settings _menu _item ; } ,
PluginDocumentSettingPanel : function ( ) { return /* reexport */ plugin _document _setting _panel ; } ,
PluginMoreMenuItem : function ( ) { return /* reexport */ plugin _more _menu _item ; } ,
PluginPostPublishPanel : function ( ) { return /* reexport */ plugin _post _publish _panel ; } ,
PluginPostStatusInfo : function ( ) { return /* reexport */ plugin _post _status _info ; } ,
PluginPrePublishPanel : function ( ) { return /* reexport */ plugin _pre _publish _panel ; } ,
PluginSidebar : function ( ) { return /* reexport */ PluginSidebarEditPost ; } ,
PluginSidebarMoreMenuItem : function ( ) { return /* reexport */ PluginSidebarMoreMenuItem ; } ,
_ _experimentalFullscreenModeClose : function ( ) { return /* reexport */ fullscreen _mode _close ; } ,
_ _experimentalMainDashboardButton : function ( ) { return /* reexport */ main _dashboard _button ; } ,
initializeEditor : function ( ) { return /* binding */ initializeEditor ; } ,
reinitializeEditor : function ( ) { return /* binding */ reinitializeEditor ; } ,
store : function ( ) { return /* reexport */ store _store ; }
2022-04-11 14:04:30 +02:00
} ) ;
2020-06-26 15:33:47 +02:00
2022-04-11 14:04:30 +02:00
// NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/store/actions.js
var actions _namespaceObject = { } ;
_ _webpack _require _ _ . r ( actions _namespaceObject ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , {
2023-09-21 15:26:32 +02:00
closeModal : function ( ) { return closeModal ; } ,
disableComplementaryArea : function ( ) { return disableComplementaryArea ; } ,
enableComplementaryArea : function ( ) { return enableComplementaryArea ; } ,
openModal : function ( ) { return openModal ; } ,
pinItem : function ( ) { return pinItem ; } ,
setDefaultComplementaryArea : function ( ) { return setDefaultComplementaryArea ; } ,
setFeatureDefaults : function ( ) { return setFeatureDefaults ; } ,
setFeatureValue : function ( ) { return setFeatureValue ; } ,
toggleFeature : function ( ) { return toggleFeature ; } ,
unpinItem : function ( ) { return unpinItem ; }
2022-04-11 14:04:30 +02:00
} ) ;
2020-07-21 14:14:37 +02:00
2022-04-11 14:04:30 +02:00
// NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/store/selectors.js
var selectors _namespaceObject = { } ;
_ _webpack _require _ _ . r ( selectors _namespaceObject ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , {
2023-09-21 15:26:32 +02:00
getActiveComplementaryArea : function ( ) { return getActiveComplementaryArea ; } ,
isComplementaryAreaLoading : function ( ) { return isComplementaryAreaLoading ; } ,
isFeatureActive : function ( ) { return isFeatureActive ; } ,
isItemPinned : function ( ) { return isItemPinned ; } ,
isModalActive : function ( ) { return isModalActive ; }
2022-04-11 14:04:30 +02:00
} ) ;
2021-01-28 03:04:13 +01:00
2022-04-11 14:04:30 +02:00
// NAMESPACE OBJECT: ./node_modules/@wordpress/edit-post/build-module/store/actions.js
var store _actions _namespaceObject = { } ;
_ _webpack _require _ _ . r ( store _actions _namespaceObject ) ;
_ _webpack _require _ _ . d ( store _actions _namespaceObject , {
2023-09-21 15:26:32 +02:00
_ _experimentalSetPreviewDeviceType : function ( ) { return _ _experimentalSetPreviewDeviceType ; } ,
_ _unstableCreateTemplate : function ( ) { return _ _unstableCreateTemplate ; } ,
_ _unstableSwitchToTemplateMode : function ( ) { return _ _unstableSwitchToTemplateMode ; } ,
closeGeneralSidebar : function ( ) { return closeGeneralSidebar ; } ,
closeModal : function ( ) { return actions _closeModal ; } ,
closePublishSidebar : function ( ) { return closePublishSidebar ; } ,
hideBlockTypes : function ( ) { return hideBlockTypes ; } ,
initializeMetaBoxes : function ( ) { return initializeMetaBoxes ; } ,
metaBoxUpdatesFailure : function ( ) { return metaBoxUpdatesFailure ; } ,
metaBoxUpdatesSuccess : function ( ) { return metaBoxUpdatesSuccess ; } ,
openGeneralSidebar : function ( ) { return openGeneralSidebar ; } ,
openModal : function ( ) { return actions _openModal ; } ,
openPublishSidebar : function ( ) { return openPublishSidebar ; } ,
removeEditorPanel : function ( ) { return removeEditorPanel ; } ,
requestMetaBoxUpdates : function ( ) { return requestMetaBoxUpdates ; } ,
setAvailableMetaBoxesPerLocation : function ( ) { return setAvailableMetaBoxesPerLocation ; } ,
setIsEditingTemplate : function ( ) { return setIsEditingTemplate ; } ,
setIsInserterOpened : function ( ) { return setIsInserterOpened ; } ,
setIsListViewOpened : function ( ) { return setIsListViewOpened ; } ,
showBlockTypes : function ( ) { return showBlockTypes ; } ,
switchEditorMode : function ( ) { return switchEditorMode ; } ,
2023-09-26 16:23:26 +02:00
toggleDistractionFree : function ( ) { return toggleDistractionFree ; } ,
2023-09-21 15:26:32 +02:00
toggleEditorPanelEnabled : function ( ) { return toggleEditorPanelEnabled ; } ,
toggleEditorPanelOpened : function ( ) { return toggleEditorPanelOpened ; } ,
toggleFeature : function ( ) { return actions _toggleFeature ; } ,
togglePinnedPluginItem : function ( ) { return togglePinnedPluginItem ; } ,
togglePublishSidebar : function ( ) { return togglePublishSidebar ; } ,
updatePreferredStyleVariations : function ( ) { return updatePreferredStyleVariations ; }
2022-04-11 14:04:30 +02:00
} ) ;
2021-01-28 03:04:13 +01:00
2022-04-11 14:04:30 +02:00
// NAMESPACE OBJECT: ./node_modules/@wordpress/edit-post/build-module/store/selectors.js
var store _selectors _namespaceObject = { } ;
_ _webpack _require _ _ . r ( store _selectors _namespaceObject ) ;
_ _webpack _require _ _ . d ( store _selectors _namespaceObject , {
2023-09-21 15:26:32 +02:00
_ _experimentalGetInsertionPoint : function ( ) { return _ _experimentalGetInsertionPoint ; } ,
_ _experimentalGetPreviewDeviceType : function ( ) { return _ _experimentalGetPreviewDeviceType ; } ,
areMetaBoxesInitialized : function ( ) { return areMetaBoxesInitialized ; } ,
getActiveGeneralSidebarName : function ( ) { return getActiveGeneralSidebarName ; } ,
getActiveMetaBoxLocations : function ( ) { return getActiveMetaBoxLocations ; } ,
getAllMetaBoxes : function ( ) { return getAllMetaBoxes ; } ,
getEditedPostTemplate : function ( ) { return getEditedPostTemplate ; } ,
getEditorMode : function ( ) { return getEditorMode ; } ,
getHiddenBlockTypes : function ( ) { return getHiddenBlockTypes ; } ,
getMetaBoxesPerLocation : function ( ) { return getMetaBoxesPerLocation ; } ,
getPreference : function ( ) { return getPreference ; } ,
getPreferences : function ( ) { return getPreferences ; } ,
hasMetaBoxes : function ( ) { return hasMetaBoxes ; } ,
isEditingTemplate : function ( ) { return selectors _isEditingTemplate ; } ,
isEditorPanelEnabled : function ( ) { return isEditorPanelEnabled ; } ,
isEditorPanelOpened : function ( ) { return isEditorPanelOpened ; } ,
isEditorPanelRemoved : function ( ) { return isEditorPanelRemoved ; } ,
isEditorSidebarOpened : function ( ) { return isEditorSidebarOpened ; } ,
isFeatureActive : function ( ) { return selectors _isFeatureActive ; } ,
isInserterOpened : function ( ) { return isInserterOpened ; } ,
isListViewOpened : function ( ) { return isListViewOpened ; } ,
isMetaBoxLocationActive : function ( ) { return isMetaBoxLocationActive ; } ,
isMetaBoxLocationVisible : function ( ) { return isMetaBoxLocationVisible ; } ,
isModalActive : function ( ) { return selectors _isModalActive ; } ,
isPluginItemPinned : function ( ) { return isPluginItemPinned ; } ,
isPluginSidebarOpened : function ( ) { return isPluginSidebarOpened ; } ,
isPublishSidebarOpened : function ( ) { return isPublishSidebarOpened ; } ,
isSavingMetaBoxes : function ( ) { return selectors _isSavingMetaBoxes ; }
2022-04-11 14:04:30 +02:00
} ) ;
2021-05-20 14:20:04 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: external ["wp","element"]
2023-09-21 15:26:32 +02:00
var external _wp _element _namespaceObject = window [ "wp" ] [ "element" ] ;
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: external ["wp","blocks"]
2023-09-21 15:26:32 +02:00
var external _wp _blocks _namespaceObject = window [ "wp" ] [ "blocks" ] ;
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: external ["wp","blockLibrary"]
2023-09-21 15:26:32 +02:00
var external _wp _blockLibrary _namespaceObject = window [ "wp" ] [ "blockLibrary" ] ;
2023-02-07 08:04:52 +01:00
; // CONCATENATED MODULE: external ["wp","deprecated"]
2023-09-21 15:26:32 +02:00
var external _wp _deprecated _namespaceObject = window [ "wp" ] [ "deprecated" ] ;
2023-02-07 08:04:52 +01:00
var external _wp _deprecated _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( external _wp _deprecated _namespaceObject ) ;
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: external ["wp","data"]
2023-09-21 15:26:32 +02:00
var external _wp _data _namespaceObject = window [ "wp" ] [ "data" ] ;
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: external ["wp","hooks"]
2023-09-21 15:26:32 +02:00
var external _wp _hooks _namespaceObject = window [ "wp" ] [ "hooks" ] ;
2022-04-12 17:12:47 +02:00
; // CONCATENATED MODULE: external ["wp","preferences"]
2023-09-21 15:26:32 +02:00
var external _wp _preferences _namespaceObject = window [ "wp" ] [ "preferences" ] ;
2023-02-07 08:04:52 +01:00
; // CONCATENATED MODULE: external ["wp","widgets"]
2023-09-21 15:26:32 +02:00
var external _wp _widgets _namespaceObject = window [ "wp" ] [ "widgets" ] ;
2022-04-12 17:12:47 +02:00
; // CONCATENATED MODULE: external ["wp","mediaUtils"]
2023-09-21 15:26:32 +02:00
var external _wp _mediaUtils _namespaceObject = window [ "wp" ] [ "mediaUtils" ] ;
2022-04-12 17:12:47 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/hooks/components/index.js
/ * *
* WordPress dependencies
* /
const replaceMediaUpload = ( ) => external _wp _mediaUtils _namespaceObject . MediaUpload ;
( 0 , external _wp _hooks _namespaceObject . addFilter ) ( 'editor.MediaUpload' , 'core/edit-post/replace-media-upload' , replaceMediaUpload ) ;
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: external ["wp","components"]
2023-09-21 15:26:32 +02:00
var external _wp _components _namespaceObject = window [ "wp" ] [ "components" ] ;
2022-04-12 17:12:47 +02:00
; // CONCATENATED MODULE: external ["wp","blockEditor"]
2023-09-21 15:26:32 +02:00
var external _wp _blockEditor _namespaceObject = window [ "wp" ] [ "blockEditor" ] ;
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: external ["wp","i18n"]
2023-09-21 15:26:32 +02:00
var external _wp _i18n _namespaceObject = window [ "wp" ] [ "i18n" ] ;
2022-04-12 17:12:47 +02:00
; // CONCATENATED MODULE: external ["wp","compose"]
2023-09-21 15:26:32 +02:00
var external _wp _compose _namespaceObject = window [ "wp" ] [ "compose" ] ;
2022-04-12 17:12:47 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/hooks/validate-multiple-use/index.js
2021-11-08 15:29:21 +01:00
/ * *
* WordPress dependencies
* /
2022-04-12 17:12:47 +02:00
const enhance = ( 0 , external _wp _compose _namespaceObject . compose ) (
2021-11-08 15:29:21 +01:00
/ * *
2022-04-12 17:12:47 +02:00
* For blocks whose block type doesn ' t support ` multiple ` , provides the
* wrapped component with ` originalBlockClientId ` -- a reference to the
* first block of the same type in the content -- if and only if that
* "original" block is not the current one . Thus , an inexisting
* ` originalBlockClientId ` prop signals that the block is valid .
*
* @ param { WPComponent } WrappedBlockEdit A filtered BlockEdit instance .
*
* @ return { WPComponent } Enhanced component with merged state data props .
2021-11-08 15:29:21 +01:00
* /
2022-04-12 17:12:47 +02:00
( 0 , external _wp _data _namespaceObject . withSelect ) ( ( select , block ) => {
2023-09-26 16:23:26 +02:00
const multiple = ( 0 , external _wp _blocks _namespaceObject . hasBlockSupport ) ( block . name , 'multiple' , true ) ;
2021-05-19 17:09:27 +02:00
2023-09-26 16:23:26 +02:00
// For block types with `multiple` support, there is no "original
// block" to be found in the content, as the block itself is valid.
2022-04-12 17:12:47 +02:00
if ( multiple ) {
return { } ;
2023-09-26 16:23:26 +02:00
}
2022-04-12 17:12:47 +02:00
2023-09-26 16:23:26 +02:00
// Otherwise, only pass `originalBlockClientId` if it refers to a different
// block from the current one.
2022-04-12 17:12:47 +02:00
const blocks = select ( external _wp _blockEditor _namespaceObject . store ) . getBlocks ( ) ;
2023-06-27 16:24:19 +02:00
const firstOfSameType = blocks . find ( ( {
name
} ) => block . name === name ) ;
2022-04-12 17:12:47 +02:00
const isInvalid = firstOfSameType && firstOfSameType . clientId !== block . clientId ;
return {
originalBlockClientId : isInvalid && firstOfSameType . clientId
} ;
2023-06-27 16:24:19 +02:00
} ) , ( 0 , external _wp _data _namespaceObject . withDispatch ) ( ( dispatch , {
originalBlockClientId
} ) => ( {
selectFirst : ( ) => dispatch ( external _wp _blockEditor _namespaceObject . store ) . selectBlock ( originalBlockClientId )
} ) ) ) ;
2022-04-12 17:12:47 +02:00
const withMultipleValidation = ( 0 , external _wp _compose _namespaceObject . createHigherOrderComponent ) ( BlockEdit => {
2023-06-27 16:24:19 +02:00
return enhance ( ( {
originalBlockClientId ,
selectFirst ,
... props
} ) => {
2022-04-12 17:12:47 +02:00
if ( ! originalBlockClientId ) {
2023-09-26 16:23:26 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( BlockEdit , {
... props
2023-06-27 16:24:19 +02:00
} ) ;
2022-04-12 17:12:47 +02:00
}
const blockType = ( 0 , external _wp _blocks _namespaceObject . getBlockType ) ( props . name ) ;
const outboundType = getOutboundType ( props . name ) ;
return [ ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
key : "invalid-preview" ,
style : {
minHeight : '60px'
}
2023-06-27 16:24:19 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( BlockEdit , {
key : "block-edit" ,
... props
} ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . Warning , {
2022-04-12 17:12:47 +02:00
key : "multiple-use-warning" ,
actions : [ ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
key : "find-original" ,
variant : "secondary" ,
onClick : selectFirst
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Find original' ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
key : "remove" ,
variant : "secondary" ,
onClick : ( ) => props . onReplace ( [ ] )
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Remove' ) ) , outboundType && ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
key : "transform" ,
variant : "secondary" ,
onClick : ( ) => props . onReplace ( ( 0 , external _wp _blocks _namespaceObject . createBlock ) ( outboundType . name , props . attributes ) )
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Transform into:' ) , " " , outboundType . title ) ]
2023-06-27 16:24:19 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( "strong" , null , blockType ? . title , ": " ) , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'This block can only be used once.' ) ) ] ;
2022-04-12 17:12:47 +02:00
} ) ;
} , 'withMultipleValidation' ) ;
2023-09-26 16:23:26 +02:00
2022-04-12 17:12:47 +02:00
/ * *
* Given a base block name , returns the default block type to which to offer
* transforms .
*
* @ param { string } blockName Base block name .
*
* @ return { ? Object } The chosen default block type .
* /
function getOutboundType ( blockName ) {
// Grab the first outbound transform.
2023-06-27 16:24:19 +02:00
const transform = ( 0 , external _wp _blocks _namespaceObject . findTransform ) ( ( 0 , external _wp _blocks _namespaceObject . getBlockTransforms ) ( 'to' , blockName ) , ( {
type ,
blocks
} ) => type === 'block' && blocks . length === 1 // What about when .length > 1?
2022-04-12 17:12:47 +02:00
) ;
if ( ! transform ) {
return null ;
}
return ( 0 , external _wp _blocks _namespaceObject . getBlockType ) ( transform . blocks [ 0 ] ) ;
}
( 0 , external _wp _hooks _namespaceObject . addFilter ) ( 'editor.BlockEdit' , 'core/edit-post/validate-multiple-use/with-multiple-validation' , withMultipleValidation ) ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/hooks/index.js
/ * *
* Internal dependencies
* /
2021-05-20 14:20:04 +02:00
2022-04-12 17:12:47 +02:00
2023-07-11 08:59:09 +02:00
; // CONCATENATED MODULE: external ["wp","coreData"]
2023-09-21 15:26:32 +02:00
var external _wp _coreData _namespaceObject = window [ "wp" ] [ "coreData" ] ;
2023-07-11 08:59:09 +02:00
; // CONCATENATED MODULE: external ["wp","editor"]
2023-09-21 15:26:32 +02:00
var external _wp _editor _namespaceObject = window [ "wp" ] [ "editor" ] ;
2022-04-12 17:12:47 +02:00
; // CONCATENATED MODULE: external ["wp","primitives"]
2023-09-21 15:26:32 +02:00
var external _wp _primitives _namespaceObject = window [ "wp" ] [ "primitives" ] ;
2022-04-12 17:12:47 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/external.js
2021-05-25 10:40:25 +02:00
/ * *
* WordPress dependencies
* /
2022-04-12 17:12:47 +02:00
const external = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
2021-05-25 10:40:25 +02:00
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
2023-06-27 16:24:19 +02:00
d : "M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"
2021-05-25 10:40:25 +02:00
} ) ) ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var library _external = ( external ) ;
2021-05-25 10:40:25 +02:00
2022-04-12 17:12:47 +02:00
; // CONCATENATED MODULE: external ["wp","plugins"]
2023-09-21 15:26:32 +02:00
var external _wp _plugins _namespaceObject = window [ "wp" ] [ "plugins" ] ;
2022-04-12 17:12:47 +02:00
; // CONCATENATED MODULE: external ["wp","url"]
2023-09-21 15:26:32 +02:00
var external _wp _url _namespaceObject = window [ "wp" ] [ "url" ] ;
2022-04-12 17:12:47 +02:00
; // CONCATENATED MODULE: external ["wp","notices"]
2023-09-21 15:26:32 +02:00
var external _wp _notices _namespaceObject = window [ "wp" ] [ "notices" ] ;
2022-04-12 17:12:47 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/plugins/copy-content-menu-item/index.js
2021-05-20 14:20:04 +02:00
/ * *
* WordPress dependencies
* /
2022-04-12 17:12:47 +02:00
function CopyContentMenuItem ( ) {
const {
createNotice
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _notices _namespaceObject . store ) ;
2023-09-26 16:23:26 +02:00
const {
getEditedPostAttribute
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( external _wp _editor _namespaceObject . store ) ;
function getText ( ) {
return getEditedPostAttribute ( 'content' ) ;
}
2022-04-12 17:12:47 +02:00
function onSuccess ( ) {
createNotice ( 'info' , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'All content copied.' ) , {
isDismissible : true ,
type : 'snackbar'
} ) ;
}
const ref = ( 0 , external _wp _compose _namespaceObject . useCopyToClipboard ) ( getText , onSuccess ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . MenuItem , {
ref : ref
2022-09-20 17:43:29 +02:00
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Copy all blocks' ) ) ;
2022-04-12 17:12:47 +02:00
}
; // CONCATENATED MODULE: external ["wp","keycodes"]
2023-09-21 15:26:32 +02:00
var external _wp _keycodes _namespaceObject = window [ "wp" ] [ "keycodes" ] ;
2022-04-12 17:12:47 +02:00
// EXTERNAL MODULE: ./node_modules/classnames/index.js
var classnames = _ _webpack _require _ _ ( 4403 ) ;
var classnames _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( classnames ) ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/check.js
/ * *
* WordPress dependencies
* /
const check = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
d : "M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"
} ) ) ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var library _check = ( check ) ;
2022-04-12 17:12:47 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/star-filled.js
/ * *
* WordPress dependencies
* /
const starFilled = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
d : "M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"
} ) ) ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var star _filled = ( starFilled ) ;
2022-04-12 17:12:47 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/star-empty.js
/ * *
* WordPress dependencies
* /
const starEmpty = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
fillRule : "evenodd" ,
d : "M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z" ,
clipRule : "evenodd"
} ) ) ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var star _empty = ( starEmpty ) ;
2022-04-12 17:12:47 +02:00
; // CONCATENATED MODULE: external ["wp","viewport"]
2023-09-21 15:26:32 +02:00
var external _wp _viewport _namespaceObject = window [ "wp" ] [ "viewport" ] ;
2022-04-12 17:12:47 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close-small.js
/ * *
* WordPress dependencies
* /
const closeSmall = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
d : "M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"
} ) ) ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var close _small = ( closeSmall ) ;
2022-04-12 17:12:47 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/actions.js
/ * *
* WordPress dependencies
* /
2023-09-26 16:23:26 +02:00
2022-09-20 17:43:29 +02:00
/ * *
* Set a default complementary area .
*
* @ param { string } scope Complementary area scope .
* @ param { string } area Area identifier .
*
* @ return { Object } Action object .
* /
const setDefaultComplementaryArea = ( scope , area ) => ( {
type : 'SET_DEFAULT_COMPLEMENTARY_AREA' ,
scope ,
area
} ) ;
2023-09-26 16:23:26 +02:00
2022-04-12 17:12:47 +02:00
/ * *
* Enable the complementary area .
*
* @ param { string } scope Complementary area scope .
* @ param { string } area Area identifier .
* /
2023-06-27 16:24:19 +02:00
const enableComplementaryArea = ( scope , area ) => ( {
registry ,
dispatch
} ) => {
2022-04-12 17:12:47 +02:00
// Return early if there's no area.
if ( ! area ) {
return ;
}
2022-09-20 17:43:29 +02:00
const isComplementaryAreaVisible = registry . select ( external _wp _preferences _namespaceObject . store ) . get ( scope , 'isComplementaryAreaVisible' ) ;
if ( ! isComplementaryAreaVisible ) {
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . set ( scope , 'isComplementaryAreaVisible' , true ) ;
}
dispatch ( {
type : 'ENABLE_COMPLEMENTARY_AREA' ,
scope ,
area
} ) ;
2022-04-12 17:12:47 +02:00
} ;
2023-09-26 16:23:26 +02:00
2022-04-12 17:12:47 +02:00
/ * *
* Disable the complementary area .
*
* @ param { string } scope Complementary area scope .
* /
2023-06-27 16:24:19 +02:00
const disableComplementaryArea = scope => ( {
registry
} ) => {
2022-09-20 17:43:29 +02:00
const isComplementaryAreaVisible = registry . select ( external _wp _preferences _namespaceObject . store ) . get ( scope , 'isComplementaryAreaVisible' ) ;
if ( isComplementaryAreaVisible ) {
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . set ( scope , 'isComplementaryAreaVisible' , false ) ;
}
2022-04-12 17:12:47 +02:00
} ;
2023-09-26 16:23:26 +02:00
2022-04-12 17:12:47 +02:00
/ * *
* Pins an item .
*
* @ param { string } scope Item scope .
* @ param { string } item Item identifier .
*
* @ return { Object } Action object .
* /
2023-06-27 16:24:19 +02:00
const pinItem = ( scope , item ) => ( {
registry
} ) => {
2022-04-12 17:12:47 +02:00
// Return early if there's no item.
if ( ! item ) {
return ;
}
2023-09-26 16:23:26 +02:00
const pinnedItems = registry . select ( external _wp _preferences _namespaceObject . store ) . get ( scope , 'pinnedItems' ) ;
2022-04-12 17:12:47 +02:00
2023-09-26 16:23:26 +02:00
// The item is already pinned, there's nothing to do.
2023-06-27 16:24:19 +02:00
if ( pinnedItems ? . [ item ] === true ) {
2022-04-12 17:12:47 +02:00
return ;
}
2023-09-26 16:23:26 +02:00
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . set ( scope , 'pinnedItems' , {
... pinnedItems ,
2022-04-12 17:12:47 +02:00
[ item ] : true
} ) ;
} ;
2023-09-26 16:23:26 +02:00
2022-04-12 17:12:47 +02:00
/ * *
* Unpins an item .
*
* @ param { string } scope Item scope .
* @ param { string } item Item identifier .
* /
2023-06-27 16:24:19 +02:00
const unpinItem = ( scope , item ) => ( {
registry
} ) => {
2022-04-12 17:12:47 +02:00
// Return early if there's no item.
if ( ! item ) {
return ;
}
const pinnedItems = registry . select ( external _wp _preferences _namespaceObject . store ) . get ( scope , 'pinnedItems' ) ;
2023-09-26 16:23:26 +02:00
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . set ( scope , 'pinnedItems' , {
... pinnedItems ,
2022-04-12 17:12:47 +02:00
[ item ] : false
} ) ;
} ;
2023-09-26 16:23:26 +02:00
2022-04-12 17:12:47 +02:00
/ * *
* Returns an action object used in signalling that a feature should be toggled .
*
* @ param { string } scope The feature scope ( e . g . core / edit - post ) .
* @ param { string } featureName The feature name .
* /
function toggleFeature ( scope , featureName ) {
2023-06-27 16:24:19 +02:00
return function ( {
registry
} ) {
2022-05-10 16:49:35 +02:00
external _wp _deprecated _default ( ) ( ` dispatch( 'core/interface' ).toggleFeature ` , {
2022-04-12 17:12:47 +02:00
since : '6.0' ,
2022-05-10 16:49:35 +02:00
alternative : ` dispatch( 'core/preferences' ).toggle `
2022-04-12 17:12:47 +02:00
} ) ;
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . toggle ( scope , featureName ) ;
} ;
}
2023-09-26 16:23:26 +02:00
2022-04-12 17:12:47 +02:00
/ * *
* Returns an action object used in signalling that a feature should be set to
* a true or false value
*
* @ param { string } scope The feature scope ( e . g . core / edit - post ) .
* @ param { string } featureName The feature name .
* @ param { boolean } value The value to set .
*
* @ return { Object } Action object .
* /
function setFeatureValue ( scope , featureName , value ) {
2023-06-27 16:24:19 +02:00
return function ( {
registry
} ) {
2022-05-10 16:49:35 +02:00
external _wp _deprecated _default ( ) ( ` dispatch( 'core/interface' ).setFeatureValue ` , {
2022-04-12 17:12:47 +02:00
since : '6.0' ,
2022-05-10 16:49:35 +02:00
alternative : ` dispatch( 'core/preferences' ).set `
2022-04-12 17:12:47 +02:00
} ) ;
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . set ( scope , featureName , ! ! value ) ;
} ;
}
2023-09-26 16:23:26 +02:00
2022-04-12 17:12:47 +02:00
/ * *
* Returns an action object used in signalling that defaults should be set for features .
*
* @ param { string } scope The feature scope ( e . g . core / edit - post ) .
* @ param { Object < string , boolean > } defaults A key / value map of feature names to values .
*
* @ return { Object } Action object .
* /
function setFeatureDefaults ( scope , defaults ) {
2023-06-27 16:24:19 +02:00
return function ( {
registry
} ) {
2022-05-10 16:49:35 +02:00
external _wp _deprecated _default ( ) ( ` dispatch( 'core/interface' ).setFeatureDefaults ` , {
2022-04-12 17:12:47 +02:00
since : '6.0' ,
2022-05-10 16:49:35 +02:00
alternative : ` dispatch( 'core/preferences' ).setDefaults `
2022-04-12 17:12:47 +02:00
} ) ;
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . setDefaults ( scope , defaults ) ;
} ;
}
2023-09-26 16:23:26 +02:00
2022-04-12 17:12:47 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Returns an action object used in signalling that the user opened a modal .
2022-04-12 17:12:47 +02:00
*
2023-06-28 09:04:13 +02:00
* @ param { string } name A string that uniquely identifies the modal .
2022-04-12 17:12:47 +02:00
*
2023-06-28 09:04:13 +02:00
* @ return { Object } Action object .
* /
function openModal ( name ) {
return {
type : 'OPEN_MODAL' ,
name
} ;
}
2023-09-26 16:23:26 +02:00
2023-06-28 09:04:13 +02:00
/ * *
* Returns an action object signalling that the user closed a modal .
*
* @ return { Object } Action object .
* /
function closeModal ( ) {
return {
type : 'CLOSE_MODAL'
} ;
}
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/selectors.js
/ * *
* WordPress dependencies
* /
2023-09-26 16:23:26 +02:00
2023-06-28 09:04:13 +02:00
/ * *
* Returns the complementary area that is active in a given scope .
*
* @ param { Object } state Global application state .
* @ param { string } scope Item scope .
*
* @ return { string | null | undefined } The complementary area that is active in the given scope .
2022-04-12 17:12:47 +02:00
* /
const getActiveComplementaryArea = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( select => ( state , scope ) => {
2023-09-26 16:23:26 +02:00
const isComplementaryAreaVisible = select ( external _wp _preferences _namespaceObject . store ) . get ( scope , 'isComplementaryAreaVisible' ) ;
// Return `undefined` to indicate that the user has never toggled
2022-09-20 17:43:29 +02:00
// visibility, this is the vanilla default. Other code relies on this
// nuance in the return value.
if ( isComplementaryAreaVisible === undefined ) {
return undefined ;
2023-09-26 16:23:26 +02:00
}
2022-09-20 17:43:29 +02:00
2023-09-26 16:23:26 +02:00
// Return `null` to indicate the user hid the complementary area.
2023-06-27 16:24:19 +02:00
if ( isComplementaryAreaVisible === false ) {
2022-09-20 17:43:29 +02:00
return null ;
}
2023-06-27 16:24:19 +02:00
return state ? . complementaryAreas ? . [ scope ] ;
} ) ;
const isComplementaryAreaLoading = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( select => ( state , scope ) => {
const isVisible = select ( external _wp _preferences _namespaceObject . store ) . get ( scope , 'isComplementaryAreaVisible' ) ;
const identifier = state ? . complementaryAreas ? . [ scope ] ;
return isVisible && identifier === undefined ;
2022-04-12 17:12:47 +02:00
} ) ;
2023-09-26 16:23:26 +02:00
2022-04-12 17:12:47 +02:00
/ * *
* Returns a boolean indicating if an item is pinned or not .
*
* @ param { Object } state Global application state .
* @ param { string } scope Scope .
* @ param { string } item Item to check .
*
* @ return { boolean } True if the item is pinned and false otherwise .
* /
const isItemPinned = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( select => ( state , scope , item ) => {
var _pinnedItems$item ;
const pinnedItems = select ( external _wp _preferences _namespaceObject . store ) . get ( scope , 'pinnedItems' ) ;
2023-06-27 16:24:19 +02:00
return ( _pinnedItems$item = pinnedItems ? . [ item ] ) !== null && _pinnedItems$item !== void 0 ? _pinnedItems$item : true ;
2022-04-12 17:12:47 +02:00
} ) ;
2023-09-26 16:23:26 +02:00
2022-04-12 17:12:47 +02:00
/ * *
* Returns a boolean indicating whether a feature is active for a particular
* scope .
*
* @ param { Object } state The store state .
* @ param { string } scope The scope of the feature ( e . g . core / edit - post ) .
* @ param { string } featureName The name of the feature .
*
* @ return { boolean } Is the feature enabled ?
* /
const isFeatureActive = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( select => ( state , scope , featureName ) => {
2022-05-10 16:49:35 +02:00
external _wp _deprecated _default ( ) ( ` select( 'core/interface' ).isFeatureActive( scope, featureName ) ` , {
2022-04-12 17:12:47 +02:00
since : '6.0' ,
2022-05-10 16:49:35 +02:00
alternative : ` select( 'core/preferences' ).get( scope, featureName ) `
2022-04-12 17:12:47 +02:00
} ) ;
return ! ! select ( external _wp _preferences _namespaceObject . store ) . get ( scope , featureName ) ;
} ) ;
2023-09-26 16:23:26 +02:00
2023-06-28 09:04:13 +02:00
/ * *
* Returns true if a modal is active , or false otherwise .
*
* @ param { Object } state Global application state .
* @ param { string } modalName A string that uniquely identifies the modal .
*
* @ return { boolean } Whether the modal is active .
* /
function isModalActive ( state , modalName ) {
return state . activeModal === modalName ;
}
2022-04-12 17:12:47 +02:00
2022-09-20 17:43:29 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/reducer.js
/ * *
* WordPress dependencies
* /
2023-06-27 16:24:19 +02:00
function complementaryAreas ( state = { } , action ) {
2022-09-20 17:43:29 +02:00
switch ( action . type ) {
case 'SET_DEFAULT_COMPLEMENTARY_AREA' :
{
const {
scope ,
area
2023-09-26 16:23:26 +02:00
} = action ;
2022-09-20 17:43:29 +02:00
2023-09-26 16:23:26 +02:00
// If there's already an area, don't overwrite it.
2022-09-20 17:43:29 +02:00
if ( state [ scope ] ) {
return state ;
}
2023-09-26 16:23:26 +02:00
return {
... state ,
2022-09-20 17:43:29 +02:00
[ scope ] : area
} ;
}
case 'ENABLE_COMPLEMENTARY_AREA' :
{
const {
scope ,
area
} = action ;
2023-09-26 16:23:26 +02:00
return {
... state ,
2022-09-20 17:43:29 +02:00
[ scope ] : area
} ;
}
}
return state ;
}
2023-09-26 16:23:26 +02:00
2023-06-28 09:04:13 +02:00
/ * *
* Reducer for storing the name of the open modal , or null if no modal is open .
*
* @ param { Object } state Previous state .
* @ param { Object } action Action object containing the ` name ` of the modal
*
* @ return { Object } Updated state
* /
function activeModal ( state = null , action ) {
switch ( action . type ) {
case 'OPEN_MODAL' :
return action . name ;
case 'CLOSE_MODAL' :
return null ;
}
return state ;
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var reducer = ( ( 0 , external _wp _data _namespaceObject . combineReducers ) ( {
2023-06-28 09:04:13 +02:00
complementaryAreas ,
activeModal
2022-09-20 17:43:29 +02:00
} ) ) ;
2022-04-12 17:12:47 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/constants.js
/ * *
* The identifier for the data store .
*
* @ type { string }
* /
const STORE _NAME = 'core/interface' ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/index.js
/ * *
* WordPress dependencies
* /
2023-09-26 16:23:26 +02:00
2022-04-12 17:12:47 +02:00
/ * *
* Internal dependencies
* /
2022-04-11 14:04:30 +02:00
2022-09-20 17:43:29 +02:00
2022-04-11 14:04:30 +02:00
/ * *
* Store definition for the interface namespace .
2021-05-21 12:14:23 +02:00
*
2022-04-11 14:04:30 +02:00
* @ see https : //github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
2021-05-21 12:14:23 +02:00
*
2022-04-11 14:04:30 +02:00
* @ type { Object }
2021-05-21 12:14:23 +02:00
* /
2022-04-11 14:04:30 +02:00
const store = ( 0 , external _wp _data _namespaceObject . createReduxStore ) ( STORE _NAME , {
2023-06-28 09:04:13 +02:00
reducer : reducer ,
2022-04-11 14:04:30 +02:00
actions : actions _namespaceObject ,
2022-04-12 17:12:47 +02:00
selectors : selectors _namespaceObject
2023-09-26 16:23:26 +02:00
} ) ;
2022-04-11 14:04:30 +02:00
2023-09-26 16:23:26 +02:00
// Once we build a more generic persistence plugin that works across types of stores
// we'd be able to replace this with a register call.
2022-04-12 17:12:47 +02:00
( 0 , external _wp _data _namespaceObject . register ) ( store ) ;
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area-context/index.js
/ * *
* WordPress dependencies
* /
2023-09-21 15:26:32 +02:00
/* harmony default export */ var complementary _area _context = ( ( 0 , external _wp _plugins _namespaceObject . withPluginContext ) ( ( context , ownProps ) => {
2022-04-11 14:04:30 +02:00
return {
icon : ownProps . icon || context . icon ,
identifier : ownProps . identifier || ` ${ context . name } / ${ ownProps . name } `
} ;
} ) ) ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area-toggle/index.js
2021-11-15 13:50:17 +01:00
2022-04-11 14:04:30 +02:00
/ * *
* WordPress dependencies
2021-05-19 17:09:27 +02:00
* /
2020-07-07 16:43:35 +02:00
2021-11-15 13:50:17 +01:00
2023-09-26 16:23:26 +02:00
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 21:08:24 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* Internal dependencies
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 21:08:24 +02:00
* /
2023-06-27 16:24:19 +02:00
function ComplementaryAreaToggle ( {
as = external _wp _components _namespaceObject . Button ,
scope ,
identifier ,
icon ,
selectedIcon ,
name ,
... props
} ) {
2022-04-11 14:04:30 +02:00
const ComponentToUse = as ;
2023-09-26 16:23:26 +02:00
const isSelected = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => select ( store ) . getActiveComplementaryArea ( scope ) === identifier , [ identifier , scope ] ) ;
2022-04-11 14:04:30 +02:00
const {
enableComplementaryArea ,
disableComplementaryArea
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store ) ;
2023-06-27 16:24:19 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( ComponentToUse , {
2022-04-11 14:04:30 +02:00
icon : selectedIcon && isSelected ? selectedIcon : icon ,
2023-09-26 16:23:26 +02:00
"aria-controls" : identifier . replace ( '/' , ':' ) ,
2022-04-11 14:04:30 +02:00
onClick : ( ) => {
if ( isSelected ) {
disableComplementaryArea ( scope ) ;
} else {
enableComplementaryArea ( scope , identifier ) ;
}
2023-06-27 16:24:19 +02:00
} ,
... props
} ) ;
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 21:08:24 +02:00
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var complementary _area _toggle = ( complementary _area _context ( ComplementaryAreaToggle ) ) ;
2021-02-02 06:17:13 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area-header/index.js
2021-02-02 06:17:13 +01:00
2022-04-11 14:04:30 +02:00
/ * *
* External dependencies
* /
2021-05-07 13:48:27 +02:00
2023-09-26 16:23:26 +02:00
2022-04-11 14:04:30 +02:00
/ * *
* WordPress dependencies
* /
2021-11-08 15:29:21 +01:00
2021-05-19 17:09:27 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* Internal dependencies
2021-05-19 17:09:27 +02:00
* /
2021-05-07 13:48:27 +02:00
2023-06-27 16:24:19 +02:00
const ComplementaryAreaHeader = ( {
smallScreenTitle ,
children ,
className ,
toggleButtonProps
} ) => {
const toggleButton = ( 0 , external _wp _element _namespaceObject . createElement ) ( complementary _area _toggle , {
icon : close _small ,
... toggleButtonProps
} ) ;
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "components-panel__header interface-complementary-area-header__small"
} , smallScreenTitle && ( 0 , external _wp _element _namespaceObject . createElement ) ( "span" , {
className : "interface-complementary-area-header__small-title"
} , smallScreenTitle ) , toggleButton ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : classnames _default ( ) ( 'components-panel__header' , 'interface-complementary-area-header' , className ) ,
tabIndex : - 1
} , children , toggleButton ) ) ;
2021-05-19 17:09:27 +02:00
} ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var complementary _area _header = ( ComplementaryAreaHeader ) ;
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/action-item/index.js
2021-01-28 03:04:13 +01:00
/ * *
* WordPress dependencies
* /
2018-12-18 04:14:52 +01:00
2022-09-20 17:43:29 +02:00
const noop = ( ) => { } ;
2023-06-27 16:24:19 +02:00
function ActionItemSlot ( {
name ,
as : Component = external _wp _components _namespaceObject . ButtonGroup ,
fillProps = { } ,
bubblesVirtually ,
... props
} ) {
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Slot , {
name : name ,
bubblesVirtually : bubblesVirtually ,
fillProps : fillProps
} , fills => {
2022-09-20 17:43:29 +02:00
if ( ! external _wp _element _namespaceObject . Children . toArray ( fills ) . length ) {
2022-04-11 14:04:30 +02:00
return null ;
2023-09-26 16:23:26 +02:00
}
// Special handling exists for backward compatibility.
2022-04-11 14:04:30 +02:00
// It ensures that menu items created by plugin authors aren't
// duplicated with automatically injected menu items coming
// from pinnable plugin sidebars.
// @see https://github.com/WordPress/gutenberg/issues/14457
const initializedByPlugins = [ ] ;
2023-06-27 16:24:19 +02:00
external _wp _element _namespaceObject . Children . forEach ( fills , ( {
props : {
_ _unstableExplicitMenuItem ,
_ _unstableTarget
}
} ) => {
2022-04-11 14:04:30 +02:00
if ( _ _unstableTarget && _ _unstableExplicitMenuItem ) {
initializedByPlugins . push ( _ _unstableTarget ) ;
}
} ) ;
const children = external _wp _element _namespaceObject . Children . map ( fills , child => {
if ( ! child . props . _ _unstableExplicitMenuItem && initializedByPlugins . includes ( child . props . _ _unstableTarget ) ) {
return null ;
}
return child ;
} ) ;
2023-09-26 16:23:26 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( Component , {
... props
2023-06-27 16:24:19 +02:00
} , children ) ;
2022-04-11 14:04:30 +02:00
} ) ;
}
2023-06-27 16:24:19 +02:00
function ActionItem ( {
name ,
as : Component = external _wp _components _namespaceObject . Button ,
onClick ,
... props
} ) {
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Fill , {
name : name
2023-06-27 16:24:19 +02:00
} , ( {
onClick : fpOnClick
} ) => {
return ( 0 , external _wp _element _namespaceObject . createElement ) ( Component , {
onClick : onClick || fpOnClick ? ( ... args ) => {
( onClick || noop ) ( ... args ) ;
( fpOnClick || noop ) ( ... args ) ;
} : undefined ,
... props
} ) ;
2022-04-11 14:04:30 +02:00
} ) ;
}
ActionItem . Slot = ActionItemSlot ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var action _item = ( ActionItem ) ;
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area-more-menu-item/index.js
2019-03-07 10:09:59 +01:00
2021-05-19 17:09:27 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* WordPress dependencies
2021-05-19 17:09:27 +02:00
* /
2020-06-26 15:33:47 +02:00
2022-04-11 14:04:30 +02:00
2023-09-26 16:23:26 +02:00
2021-05-19 17:09:27 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* Internal dependencies
2021-05-19 17:09:27 +02:00
* /
2020-06-26 15:33:47 +02:00
2023-06-27 16:24:19 +02:00
const PluginsMenuItem = ( {
// Menu item is marked with unstable prop for backward compatibility.
// They are removed so they don't leak to DOM elements.
// @see https://github.com/WordPress/gutenberg/issues/14457
_ _unstableExplicitMenuItem ,
_ _unstableTarget ,
... restProps
2023-09-26 16:23:26 +02:00
} ) => ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . MenuItem , {
... restProps
2023-06-27 16:24:19 +02:00
} ) ;
function ComplementaryAreaMoreMenuItem ( {
scope ,
target ,
_ _unstableExplicitMenuItem ,
... props
} ) {
return ( 0 , external _wp _element _namespaceObject . createElement ) ( complementary _area _toggle , {
2022-04-11 14:04:30 +02:00
as : toggleProps => {
2023-06-27 16:24:19 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( action _item , {
2022-04-11 14:04:30 +02:00
_ _unstableExplicitMenuItem : _ _unstableExplicitMenuItem ,
_ _unstableTarget : ` ${ scope } / ${ target } ` ,
as : PluginsMenuItem ,
2023-06-27 16:24:19 +02:00
name : ` ${ scope } /plugin-more-menu ` ,
... toggleProps
} ) ;
2022-04-11 14:04:30 +02:00
} ,
role : "menuitemcheckbox" ,
selectedIcon : library _check ,
name : target ,
2023-06-27 16:24:19 +02:00
scope : scope ,
... props
} ) ;
2021-05-19 17:09:27 +02:00
}
2021-05-07 13:48:27 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/pinned-items/index.js
2021-05-19 17:09:27 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* External dependencies
2021-05-19 17:09:27 +02:00
* /
2021-05-07 13:48:27 +02:00
2023-09-26 16:23:26 +02:00
2021-05-19 17:09:27 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* WordPress dependencies
2021-05-19 17:09:27 +02:00
* /
2021-05-07 13:48:27 +02:00
2023-06-27 16:24:19 +02:00
function PinnedItems ( {
scope ,
... props
} ) {
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Fill , {
name : ` PinnedItems/ ${ scope } ` ,
2022-04-11 14:04:30 +02:00
... props
2023-06-27 16:24:19 +02:00
} ) ;
2021-05-19 17:09:27 +02:00
}
2023-06-27 16:24:19 +02:00
function PinnedItemsSlot ( {
scope ,
className ,
... props
} ) {
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Slot , {
name : ` PinnedItems/ ${ scope } ` ,
2022-04-11 14:04:30 +02:00
... props
2023-06-27 16:24:19 +02:00
} , fills => fills ? . length > 0 && ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
2022-04-11 14:04:30 +02:00
className : classnames _default ( ) ( className , 'interface-pinned-items' )
} , fills ) ) ;
2021-05-19 17:09:27 +02:00
}
2022-04-11 14:04:30 +02:00
PinnedItems . Slot = PinnedItemsSlot ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var pinned _items = ( PinnedItems ) ;
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area/index.js
2020-06-26 15:33:47 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* External dependencies
2020-06-26 15:33:47 +02:00
* /
2023-09-26 16:23:26 +02:00
2020-06-26 15:33:47 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* WordPress dependencies
2020-06-26 15:33:47 +02:00
* /
2021-01-28 03:04:13 +01:00
2020-06-26 15:33:47 +02:00
2021-11-08 15:29:21 +01:00
2020-06-26 15:33:47 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* Internal dependencies
2021-05-19 17:09:27 +02:00
* /
2021-11-08 15:29:21 +01:00
2020-06-26 15:33:47 +02:00
2021-05-19 17:09:27 +02:00
2021-05-21 12:14:23 +02:00
2021-05-19 17:09:27 +02:00
2023-06-27 16:24:19 +02:00
function ComplementaryAreaSlot ( {
scope ,
... props
} ) {
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Slot , {
name : ` ComplementaryArea/ ${ scope } ` ,
2022-04-11 14:04:30 +02:00
... props
2023-06-27 16:24:19 +02:00
} ) ;
2021-04-15 17:19:43 +02:00
}
2023-06-27 16:24:19 +02:00
function ComplementaryAreaFill ( {
scope ,
children ,
2023-09-26 16:23:26 +02:00
className ,
id
2023-06-27 16:24:19 +02:00
} ) {
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Fill , {
name : ` ComplementaryArea/ ${ scope } `
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
2023-09-26 16:23:26 +02:00
id : id ,
2022-04-11 14:04:30 +02:00
className : className
} , children ) ) ;
2021-11-08 15:29:21 +01:00
}
2022-04-11 14:04:30 +02:00
function useAdjustComplementaryListener ( scope , identifier , activeArea , isActive , isSmall ) {
const previousIsSmall = ( 0 , external _wp _element _namespaceObject . useRef ) ( false ) ;
const shouldOpenWhenNotSmall = ( 0 , external _wp _element _namespaceObject . useRef ) ( false ) ;
const {
enableComplementaryArea ,
disableComplementaryArea
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store ) ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
2023-06-27 16:24:19 +02:00
// If the complementary area is active and the editor is switching from
// a big to a small window size.
2022-04-11 14:04:30 +02:00
if ( isActive && isSmall && ! previousIsSmall . current ) {
2023-09-26 16:23:26 +02:00
disableComplementaryArea ( scope ) ;
// Flag the complementary area to be reopened when the window size
2023-06-27 16:24:19 +02:00
// goes from small to big.
2022-04-11 14:04:30 +02:00
shouldOpenWhenNotSmall . current = true ;
2023-09-26 16:23:26 +02:00
} else if (
// If there is a flag indicating the complementary area should be
2023-06-27 16:24:19 +02:00
// enabled when we go from small to big window size and we are going
// from a small to big window size.
2022-04-11 14:04:30 +02:00
shouldOpenWhenNotSmall . current && ! isSmall && previousIsSmall . current ) {
2023-06-27 16:24:19 +02:00
// Remove the flag indicating the complementary area should be
// enabled.
shouldOpenWhenNotSmall . current = false ;
2022-04-11 14:04:30 +02:00
enableComplementaryArea ( scope , identifier ) ;
2023-09-26 16:23:26 +02:00
} else if (
// If the flag is indicating the current complementary should be
2023-06-27 16:24:19 +02:00
// reopened but another complementary area becomes active, remove
// the flag.
2022-04-11 14:04:30 +02:00
shouldOpenWhenNotSmall . current && activeArea && activeArea !== identifier ) {
shouldOpenWhenNotSmall . current = false ;
}
if ( isSmall !== previousIsSmall . current ) {
previousIsSmall . current = isSmall ;
}
2023-09-26 16:23:26 +02:00
} , [ isActive , isSmall , scope , identifier , activeArea , disableComplementaryArea , enableComplementaryArea ] ) ;
2022-04-11 14:04:30 +02:00
}
2023-06-27 16:24:19 +02:00
function ComplementaryArea ( {
children ,
className ,
closeLabel = ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Close plugin' ) ,
identifier ,
header ,
headerClassName ,
icon ,
isPinnable = true ,
panelClassName ,
scope ,
name ,
smallScreenTitle ,
title ,
toggleShortcut ,
isActiveByDefault ,
showIconLabels = false
} ) {
2022-04-11 14:04:30 +02:00
const {
2023-06-27 16:24:19 +02:00
isLoading ,
2022-04-11 14:04:30 +02:00
isActive ,
isPinned ,
activeArea ,
isSmall ,
isLarge
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
const {
getActiveComplementaryArea ,
2023-06-27 16:24:19 +02:00
isComplementaryAreaLoading ,
2022-04-11 14:04:30 +02:00
isItemPinned
} = select ( store ) ;
const _activeArea = getActiveComplementaryArea ( scope ) ;
return {
2023-06-27 16:24:19 +02:00
isLoading : isComplementaryAreaLoading ( scope ) ,
2022-04-11 14:04:30 +02:00
isActive : _activeArea === identifier ,
isPinned : isItemPinned ( scope , identifier ) ,
activeArea : _activeArea ,
isSmall : select ( external _wp _viewport _namespaceObject . store ) . isViewportMatch ( '< medium' ) ,
isLarge : select ( external _wp _viewport _namespaceObject . store ) . isViewportMatch ( 'large' )
} ;
} , [ identifier , scope ] ) ;
useAdjustComplementaryListener ( scope , identifier , activeArea , isActive , isSmall ) ;
const {
enableComplementaryArea ,
disableComplementaryArea ,
pinItem ,
unpinItem
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store ) ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
2023-06-27 16:24:19 +02:00
// Set initial visibility: For large screens, enable if it's active by
// default. For small screens, always initially disable.
2022-04-11 14:04:30 +02:00
if ( isActiveByDefault && activeArea === undefined && ! isSmall ) {
enableComplementaryArea ( scope , identifier ) ;
2023-06-27 16:24:19 +02:00
} else if ( activeArea === undefined && isSmall ) {
disableComplementaryArea ( scope , identifier ) ;
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 21:08:24 +02:00
}
2023-09-26 16:23:26 +02:00
} , [ activeArea , isActiveByDefault , scope , identifier , isSmall , enableComplementaryArea , disableComplementaryArea ] ) ;
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , isPinnable && ( 0 , external _wp _element _namespaceObject . createElement ) ( pinned _items , {
scope : scope
} , isPinned && ( 0 , external _wp _element _namespaceObject . createElement ) ( complementary _area _toggle , {
scope : scope ,
identifier : identifier ,
isPressed : isActive && ( ! showIconLabels || isLarge ) ,
"aria-expanded" : isActive ,
2023-06-27 16:24:19 +02:00
"aria-disabled" : isLoading ,
2022-04-11 14:04:30 +02:00
label : title ,
icon : showIconLabels ? library _check : icon ,
showTooltip : ! showIconLabels ,
variant : showIconLabels ? 'tertiary' : undefined
} ) ) , name && isPinnable && ( 0 , external _wp _element _namespaceObject . createElement ) ( ComplementaryAreaMoreMenuItem , {
target : name ,
scope : scope ,
icon : icon
} , title ) , isActive && ( 0 , external _wp _element _namespaceObject . createElement ) ( ComplementaryAreaFill , {
className : classnames _default ( ) ( 'interface-complementary-area' , className ) ,
2023-09-26 16:23:26 +02:00
scope : scope ,
id : identifier . replace ( '/' , ':' )
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( complementary _area _header , {
className : headerClassName ,
closeLabel : closeLabel ,
onClose : ( ) => disableComplementaryArea ( scope ) ,
smallScreenTitle : smallScreenTitle ,
toggleButtonProps : {
label : closeLabel ,
shortcut : toggleShortcut ,
scope ,
identifier
}
} , header || ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( "strong" , null , title ) , isPinnable && ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
className : "interface-complementary-area__pin-unpin-item" ,
icon : isPinned ? star _filled : star _empty ,
label : isPinned ? ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Unpin from toolbar' ) : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Pin to toolbar' ) ,
onClick : ( ) => ( isPinned ? unpinItem : pinItem ) ( scope , identifier ) ,
isPressed : isPinned ,
"aria-expanded" : isPinned
} ) ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Panel , {
className : panelClassName
} , children ) ) ) ;
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 21:08:24 +02:00
}
2022-04-11 14:04:30 +02:00
const ComplementaryAreaWrapped = complementary _area _context ( ComplementaryArea ) ;
ComplementaryAreaWrapped . Slot = ComplementaryAreaSlot ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var complementary _area = ( ComplementaryAreaWrapped ) ;
2021-05-07 13:48:27 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/fullscreen-mode/index.js
2021-05-07 13:48:27 +02:00
/ * *
* WordPress dependencies
* /
2023-06-27 16:24:19 +02:00
const FullscreenMode = ( {
isActive
} ) => {
2022-04-11 14:04:30 +02:00
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
2023-09-26 16:23:26 +02:00
let isSticky = false ;
// `is-fullscreen-mode` is set in PHP as a body class by Gutenberg, and this causes
2022-04-11 14:04:30 +02:00
// `sticky-menu` to be applied by WordPress and prevents the admin menu being scrolled
// even if `is-fullscreen-mode` is then removed. Let's remove `sticky-menu` here as
2022-04-12 17:12:47 +02:00
// a consequence of the FullscreenMode setup.
2022-04-11 14:04:30 +02:00
if ( document . body . classList . contains ( 'sticky-menu' ) ) {
isSticky = true ;
document . body . classList . remove ( 'sticky-menu' ) ;
}
return ( ) => {
if ( isSticky ) {
document . body . classList . add ( 'sticky-menu' ) ;
}
} ;
} , [ ] ) ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
if ( isActive ) {
document . body . classList . add ( 'is-fullscreen-mode' ) ;
} else {
document . body . classList . remove ( 'is-fullscreen-mode' ) ;
}
return ( ) => {
if ( isActive ) {
document . body . classList . remove ( 'is-fullscreen-mode' ) ;
}
} ;
} , [ isActive ] ) ;
return null ;
} ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var fullscreen _mode = ( FullscreenMode ) ;
2022-04-11 14:04:30 +02:00
2023-02-07 08:04:52 +01:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/navigable-region/index.js
/ * *
* External dependencies
* /
2023-06-27 16:24:19 +02:00
function NavigableRegion ( {
children ,
className ,
ariaLabel ,
as : Tag = 'div' ,
... props
} ) {
return ( 0 , external _wp _element _namespaceObject . createElement ) ( Tag , {
2023-02-07 08:04:52 +01:00
className : classnames _default ( ) ( 'interface-navigable-region' , className ) ,
"aria-label" : ariaLabel ,
role : "region" ,
2023-06-27 16:24:19 +02:00
tabIndex : "-1" ,
... props
} , children ) ;
2023-02-07 08:04:52 +01:00
}
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/interface-skeleton/index.js
2019-10-15 17:37:08 +02:00
2021-01-28 03:04:13 +01:00
/ * *
2022-04-11 14:04:30 +02:00
* External dependencies
2021-01-28 03:04:13 +01:00
* /
2019-03-07 10:09:59 +01:00
2023-09-26 16:23:26 +02:00
2021-01-28 03:04:13 +01:00
/ * *
2022-04-11 14:04:30 +02:00
* WordPress dependencies
2021-01-28 03:04:13 +01:00
* /
2020-03-24 00:40:19 +01:00
2022-04-11 14:04:30 +02:00
2023-02-07 08:04:52 +01:00
/ * *
* Internal dependencies
* /
2022-04-11 14:04:30 +02:00
function useHTMLClass ( className ) {
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
const element = document && document . querySelector ( ` html:not(. ${ className } ) ` ) ;
if ( ! element ) {
return ;
}
element . classList . toggle ( className ) ;
return ( ) => {
element . classList . toggle ( className ) ;
} ;
} , [ className ] ) ;
2021-01-28 03:04:13 +01:00
}
2023-06-27 16:24:19 +02:00
const headerVariants = {
hidden : {
opacity : 0
} ,
hover : {
opacity : 1 ,
transition : {
type : 'tween' ,
delay : 0.2 ,
delayChildren : 0.2
}
} ,
distractionFreeInactive : {
opacity : 1 ,
transition : {
delay : 0
}
}
} ;
function InterfaceSkeleton ( {
isDistractionFree ,
footer ,
header ,
editorNotices ,
sidebar ,
secondarySidebar ,
notices ,
content ,
2023-09-26 16:23:26 +02:00
contentProps ,
2023-06-27 16:24:19 +02:00
actions ,
labels ,
className ,
enableRegionNavigation = true ,
// Todo: does this need to be a prop.
// Can we use a dependency to keyboard-shortcuts directly?
shortcuts
} , ref ) {
2022-04-11 14:04:30 +02:00
const navigateRegionsProps = ( 0 , external _wp _components _namespaceObject . _ _unstableUseNavigateRegions ) ( shortcuts ) ;
useHTMLClass ( 'interface-interface-skeleton__html-container' ) ;
const defaultLabels = {
/* translators: accessibility text for the top bar landmark region. */
header : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Header' ) ,
/* translators: accessibility text for the content landmark region. */
body : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Content' ) ,
/* translators: accessibility text for the secondary sidebar landmark region. */
secondarySidebar : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Block Library' ) ,
/* translators: accessibility text for the settings landmark region. */
sidebar : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Settings' ) ,
/* translators: accessibility text for the publish landmark region. */
actions : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Publish' ) ,
/* translators: accessibility text for the footer landmark region. */
footer : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Footer' )
} ;
2023-09-26 16:23:26 +02:00
const mergedLabels = {
... defaultLabels ,
2022-04-11 14:04:30 +02:00
... labels
} ;
2023-09-26 16:23:26 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
... ( enableRegionNavigation ? navigateRegionsProps : { } ) ,
2023-02-07 08:04:52 +01:00
ref : ( 0 , external _wp _compose _namespaceObject . useMergeRefs ) ( [ ref , enableRegionNavigation ? navigateRegionsProps . ref : undefined ] ) ,
2022-04-11 14:04:30 +02:00
className : classnames _default ( ) ( className , 'interface-interface-skeleton' , navigateRegionsProps . className , ! ! footer && 'has-footer' )
2023-06-27 16:24:19 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
2022-04-11 14:04:30 +02:00
className : "interface-interface-skeleton__editor"
2023-06-27 16:24:19 +02:00
} , ! ! header && ( 0 , external _wp _element _namespaceObject . createElement ) ( NavigableRegion , {
2023-02-07 08:04:52 +01:00
as : external _wp _components _namespaceObject . _ _unstableMotion . div ,
2022-04-11 14:04:30 +02:00
className : "interface-interface-skeleton__header" ,
"aria-label" : mergedLabels . header ,
2023-06-27 16:24:19 +02:00
initial : isDistractionFree ? 'hidden' : 'distractionFreeInactive' ,
whileHover : isDistractionFree ? 'hover' : 'distractionFreeInactive' ,
animate : isDistractionFree ? 'hidden' : 'distractionFreeInactive' ,
2023-02-07 08:04:52 +01:00
variants : headerVariants ,
2023-06-27 16:24:19 +02:00
transition : isDistractionFree ? {
2023-02-07 08:04:52 +01:00
type : 'tween' ,
delay : 0.8
2023-06-27 16:24:19 +02:00
} : undefined
2023-02-07 08:04:52 +01:00
} , header ) , isDistractionFree && ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "interface-interface-skeleton__header"
} , editorNotices ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
2022-04-11 14:04:30 +02:00
className : "interface-interface-skeleton__body"
2023-02-07 08:04:52 +01:00
} , ! ! secondarySidebar && ( 0 , external _wp _element _namespaceObject . createElement ) ( NavigableRegion , {
2022-04-11 14:04:30 +02:00
className : "interface-interface-skeleton__secondary-sidebar" ,
2023-02-07 08:04:52 +01:00
ariaLabel : mergedLabels . secondarySidebar
2022-04-11 14:04:30 +02:00
} , secondarySidebar ) , ! ! notices && ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "interface-interface-skeleton__notices"
2023-02-07 08:04:52 +01:00
} , notices ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( NavigableRegion , {
2022-04-11 14:04:30 +02:00
className : "interface-interface-skeleton__content" ,
2023-09-26 16:23:26 +02:00
ariaLabel : mergedLabels . body ,
... contentProps
2023-02-07 08:04:52 +01:00
} , content ) , ! ! sidebar && ( 0 , external _wp _element _namespaceObject . createElement ) ( NavigableRegion , {
2022-04-11 14:04:30 +02:00
className : "interface-interface-skeleton__sidebar" ,
2023-02-07 08:04:52 +01:00
ariaLabel : mergedLabels . sidebar
} , sidebar ) , ! ! actions && ( 0 , external _wp _element _namespaceObject . createElement ) ( NavigableRegion , {
2022-04-11 14:04:30 +02:00
className : "interface-interface-skeleton__actions" ,
2023-02-07 08:04:52 +01:00
ariaLabel : mergedLabels . actions
} , actions ) ) ) , ! ! footer && ( 0 , external _wp _element _namespaceObject . createElement ) ( NavigableRegion , {
2022-04-11 14:04:30 +02:00
className : "interface-interface-skeleton__footer" ,
2023-02-07 08:04:52 +01:00
ariaLabel : mergedLabels . footer
2022-04-11 14:04:30 +02:00
} , footer ) ) ;
2021-01-28 03:04:13 +01:00
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var interface _skeleton = ( ( 0 , external _wp _element _namespaceObject . forwardRef ) ( InterfaceSkeleton ) ) ;
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/more-vertical.js
2021-05-19 17:09:27 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* WordPress dependencies
2021-05-19 17:09:27 +02:00
* /
2020-06-26 15:33:47 +02:00
2022-04-11 14:04:30 +02:00
const moreVertical = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
d : "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"
} ) ) ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var more _vertical = ( moreVertical ) ;
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/more-menu-dropdown/index.js
2020-06-26 15:33:47 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* External dependencies
2020-06-26 15:33:47 +02:00
* /
2023-09-26 16:23:26 +02:00
2021-01-28 03:04:13 +01:00
/ * *
2022-04-11 14:04:30 +02:00
* WordPress dependencies
2021-01-28 03:04:13 +01:00
* /
2020-06-26 15:33:47 +02:00
2022-04-11 14:04:30 +02:00
2023-06-27 16:24:19 +02:00
function MoreMenuDropdown ( {
as : DropdownComponent = external _wp _components _namespaceObject . DropdownMenu ,
className ,
/* translators: button label text should, if possible, be under 16 characters. */
label = ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Options' ) ,
popoverProps ,
toggleProps ,
children
} ) {
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( DropdownComponent , {
className : classnames _default ( ) ( 'interface-more-menu-dropdown' , className ) ,
icon : more _vertical ,
label : label ,
popoverProps : {
2023-02-07 08:04:52 +01:00
placement : 'bottom-end' ,
2022-04-11 14:04:30 +02:00
... popoverProps ,
2023-06-27 16:24:19 +02:00
className : classnames _default ( ) ( 'interface-more-menu-dropdown__content' , popoverProps ? . className )
2022-04-11 14:04:30 +02:00
} ,
toggleProps : {
tooltipPosition : 'bottom' ,
... toggleProps
}
} , onClose => children ( onClose ) ) ;
2021-01-28 03:04:13 +01:00
}
2022-04-11 14:04:30 +02:00
2022-04-12 17:12:47 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/preferences-modal/index.js
2022-04-11 14:04:30 +02:00
2020-06-26 15:33:47 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* WordPress dependencies
2020-06-26 15:33:47 +02:00
* /
2022-04-11 14:04:30 +02:00
2023-06-27 16:24:19 +02:00
function PreferencesModal ( {
closeModal ,
children
} ) {
2022-04-12 17:12:47 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Modal , {
className : "interface-preferences-modal" ,
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Preferences' ) ,
onRequestClose : closeModal
} , children ) ;
2021-01-28 03:04:13 +01:00
}
2018-12-14 05:41:57 +01:00
2022-04-12 17:12:47 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js
2021-01-28 03:04:13 +01:00
/ * *
2021-05-19 17:09:27 +02:00
* WordPress dependencies
2021-01-28 03:04:13 +01:00
* /
2020-01-22 23:06:21 +01:00
2023-09-26 16:23:26 +02:00
2022-04-12 17:12:47 +02:00
/** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */
2021-05-19 17:09:27 +02:00
2021-01-28 03:04:13 +01:00
/ * *
2022-04-12 17:12:47 +02:00
* Return an SVG icon .
2021-01-28 03:04:13 +01:00
*
2023-09-26 16:23:26 +02:00
* @ param { IconProps } props icon is the SVG component to render
* size is a number specifiying the icon size in pixels
* Other props will be passed to wrapped SVG component
* @ param { import ( 'react' ) . ForwardedRef < HTMLElement > } ref The forwarded ref to the SVG element .
2021-01-28 03:04:13 +01:00
*
2022-04-12 17:12:47 +02:00
* @ return { JSX . Element } Icon component
2021-01-28 03:04:13 +01:00
* /
2023-06-27 16:24:19 +02:00
function Icon ( {
icon ,
size = 24 ,
... props
2023-09-26 16:23:26 +02:00
} , ref ) {
2022-04-12 17:12:47 +02:00
return ( 0 , external _wp _element _namespaceObject . cloneElement ) ( icon , {
width : size ,
height : size ,
2023-09-26 16:23:26 +02:00
... props ,
ref
2022-04-11 14:04:30 +02:00
} ) ;
}
2023-09-26 16:23:26 +02:00
/* harmony default export */ var icon = ( ( 0 , external _wp _element _namespaceObject . forwardRef ) ( Icon ) ) ;
2021-01-28 03:04:13 +01:00
2022-04-12 17:12:47 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-left.js
2021-01-28 03:04:13 +01:00
2022-04-11 14:04:30 +02:00
/ * *
* WordPress dependencies
* /
2020-07-21 14:14:37 +02:00
2022-04-12 17:12:47 +02:00
const chevronLeft = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
2022-04-11 14:04:30 +02:00
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
2022-04-12 17:12:47 +02:00
d : "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"
2022-04-11 14:04:30 +02:00
} ) ) ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var chevron _left = ( chevronLeft ) ;
2021-11-08 15:29:21 +01:00
2022-04-12 17:12:47 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-right.js
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
/ * *
* WordPress dependencies
* /
2021-11-08 15:29:21 +01:00
2022-04-12 17:12:47 +02:00
const chevronRight = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
d : "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"
} ) ) ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var chevron _right = ( chevronRight ) ;
2020-12-01 13:19:43 +01:00
2022-04-12 17:12:47 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/preferences-modal-tabs/index.js
2020-12-01 13:19:43 +01:00
2021-05-07 13:48:27 +02:00
/ * *
2021-05-19 17:09:27 +02:00
* WordPress dependencies
2021-05-07 13:48:27 +02:00
* /
2021-05-19 17:09:27 +02:00
2022-04-12 17:12:47 +02:00
const PREFERENCES _MENU = 'preferences-menu' ;
2023-06-27 16:24:19 +02:00
function PreferencesModalTabs ( {
sections
} ) {
2023-09-26 16:23:26 +02:00
const isLargeViewport = ( 0 , external _wp _compose _namespaceObject . useViewportMatch ) ( 'medium' ) ;
2022-04-11 14:04:30 +02:00
2023-09-26 16:23:26 +02:00
// This is also used to sync the two different rendered components
// between small and large viewports.
2022-04-12 17:12:47 +02:00
const [ activeMenu , setActiveMenu ] = ( 0 , external _wp _element _namespaceObject . useState ) ( PREFERENCES _MENU ) ;
/ * *
* Create helper objects from ` sections ` for easier data handling .
* ` tabs ` is used for creating the ` TabPanel ` and ` sectionsContentMap `
* is used for easier access to active tab ' s content .
* /
const {
tabs ,
sectionsContentMap
} = ( 0 , external _wp _element _namespaceObject . useMemo ) ( ( ) => {
let mappedTabs = {
tabs : [ ] ,
sectionsContentMap : { }
} ;
if ( sections . length ) {
2023-06-27 16:24:19 +02:00
mappedTabs = sections . reduce ( ( accumulator , {
name ,
tabLabel : title ,
content
} ) => {
2022-04-12 17:12:47 +02:00
accumulator . tabs . push ( {
name ,
title
} ) ;
accumulator . sectionsContentMap [ name ] = content ;
return accumulator ;
} , {
tabs : [ ] ,
sectionsContentMap : { }
} ) ;
2021-11-08 15:29:21 +01:00
}
2022-04-12 17:12:47 +02:00
return mappedTabs ;
} , [ sections ] ) ;
const getCurrentTab = ( 0 , external _wp _element _namespaceObject . useCallback ) ( tab => sectionsContentMap [ tab . name ] || null , [ sectionsContentMap ] ) ;
2023-09-26 16:23:26 +02:00
let modalContent ;
// We render different components based on the viewport size.
2022-04-12 17:12:47 +02:00
if ( isLargeViewport ) {
modalContent = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . TabPanel , {
className : "interface-preferences__tabs" ,
tabs : tabs ,
initialTabName : activeMenu !== PREFERENCES _MENU ? activeMenu : undefined ,
onSelect : setActiveMenu ,
orientation : "vertical"
} , getCurrentTab ) ;
} else {
modalContent = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _experimentalNavigatorProvider , {
initialPath : "/" ,
className : "interface-preferences__provider"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _experimentalNavigatorScreen , {
path : "/"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Card , {
isBorderless : true ,
size : "small"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . CardBody , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _experimentalItemGroup , null , tabs . map ( tab => {
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _experimentalNavigatorButton , {
key : tab . name ,
path : tab . name ,
as : external _wp _components _namespaceObject . _ _experimentalItem ,
isAction : true
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _experimentalHStack , {
justify : "space-between"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . FlexItem , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _experimentalTruncate , null , tab . title ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . FlexItem , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( icon , {
icon : ( 0 , external _wp _i18n _namespaceObject . isRTL ) ( ) ? chevron _left : chevron _right
} ) ) ) ) ;
} ) ) ) ) ) , sections . length && sections . map ( section => {
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _experimentalNavigatorScreen , {
key : ` ${ section . name } -menu ` ,
path : section . name
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Card , {
isBorderless : true ,
size : "large"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . CardHeader , {
isBorderless : false ,
justify : "left" ,
size : "small" ,
gap : "6"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _experimentalNavigatorBackButton , {
icon : ( 0 , external _wp _i18n _namespaceObject . isRTL ) ( ) ? chevron _right : chevron _left ,
"aria-label" : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Navigate to the previous view' )
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _experimentalText , {
size : "16"
} , section . tabLabel ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . CardBody , null , section . content ) ) ) ;
} ) ) ;
2022-04-11 14:04:30 +02:00
}
2022-04-12 17:12:47 +02:00
return modalContent ;
2021-05-20 14:20:04 +02:00
}
2022-04-11 14:04:30 +02:00
2022-04-12 17:12:47 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/preferences-modal-section/index.js
2022-04-11 14:04:30 +02:00
2023-06-27 16:24:19 +02:00
const Section = ( {
description ,
title ,
children
} ) => ( 0 , external _wp _element _namespaceObject . createElement ) ( "fieldset" , {
className : "interface-preferences-modal__section"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( "legend" , {
className : "interface-preferences-modal__section-legend"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( "h2" , {
className : "interface-preferences-modal__section-title"
} , title ) , description && ( 0 , external _wp _element _namespaceObject . createElement ) ( "p" , {
className : "interface-preferences-modal__section-description"
} , description ) ) , children ) ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var preferences _modal _section = ( Section ) ;
2022-04-11 14:04:30 +02:00
2022-04-12 17:12:47 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/preferences-modal-base-option/index.js
2022-04-11 14:04:30 +02:00
2021-05-20 14:20:04 +02:00
/ * *
2022-04-12 17:12:47 +02:00
* WordPress dependencies
2021-05-20 14:20:04 +02:00
* /
2020-01-22 23:06:21 +01:00
2023-06-27 16:24:19 +02:00
function BaseOption ( {
help ,
label ,
isChecked ,
onChange ,
children
} ) {
2022-04-12 17:12:47 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "interface-preferences-modal__option"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . ToggleControl , {
2022-09-20 17:43:29 +02:00
_ _nextHasNoMarginBottom : true ,
2022-04-12 17:12:47 +02:00
help : help ,
label : label ,
checked : isChecked ,
onChange : onChange
} ) , children ) ;
2021-05-20 14:20:04 +02:00
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var preferences _modal _base _option = ( BaseOption ) ;
2021-11-08 15:29:21 +01:00
2022-04-12 17:12:47 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/index.js
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
2021-11-08 15:29:21 +01:00
2020-01-22 23:06:21 +01:00
2021-05-20 14:20:04 +02:00
2020-10-20 15:36:16 +02:00
2021-05-19 17:09:27 +02:00
2022-04-11 14:04:30 +02:00
2023-02-07 08:04:52 +01:00
2022-04-12 17:12:47 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/index.js
2022-04-11 14:04:30 +02:00
2023-06-28 09:04:13 +02:00
; // CONCATENATED MODULE: external ["wp","keyboardShortcuts"]
2023-09-21 15:26:32 +02:00
var external _wp _keyboardShortcuts _namespaceObject = window [ "wp" ] [ "keyboardShortcuts" ] ;
2023-06-28 09:04:13 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/keyboard-shortcut-help-modal/config.js
2021-11-08 15:29:21 +01:00
/ * *
2023-06-28 09:04:13 +02:00
* WordPress dependencies
2021-11-08 15:29:21 +01:00
* /
2023-06-28 09:04:13 +02:00
const textFormattingShortcuts = [ {
keyCombination : {
modifier : 'primary' ,
character : 'b'
} ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Make the selected text bold.' )
} , {
keyCombination : {
modifier : 'primary' ,
character : 'i'
} ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Make the selected text italic.' )
} , {
keyCombination : {
modifier : 'primary' ,
character : 'k'
} ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Convert the selected text into a link.' )
} , {
keyCombination : {
modifier : 'primaryShift' ,
character : 'k'
} ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Remove a link.' )
} , {
keyCombination : {
character : '[['
} ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Insert a link to a post or page.' )
} , {
keyCombination : {
modifier : 'primary' ,
character : 'u'
} ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Underline the selected text.' )
} , {
keyCombination : {
modifier : 'access' ,
character : 'd'
} ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Strikethrough the selected text.' )
} , {
keyCombination : {
modifier : 'access' ,
character : 'x'
} ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Make the selected text inline code.' )
} , {
keyCombination : {
modifier : 'access' ,
character : '0'
} ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Convert the current heading to a paragraph.' )
} , {
keyCombination : {
modifier : 'access' ,
character : '1-6'
} ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Convert the current paragraph or heading to a heading of level 1 to 6.' )
} ] ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/keyboard-shortcut-help-modal/shortcut.js
2021-11-08 15:29:21 +01:00
2021-05-20 14:20:04 +02:00
/ * *
* WordPress dependencies
* /
2021-05-19 17:09:27 +02:00
2023-06-28 09:04:13 +02:00
function KeyCombination ( {
keyCombination ,
forceAriaLabel
} ) {
const shortcut = keyCombination . modifier ? external _wp _keycodes _namespaceObject . displayShortcutList [ keyCombination . modifier ] ( keyCombination . character ) : keyCombination . character ;
const ariaLabel = keyCombination . modifier ? external _wp _keycodes _namespaceObject . shortcutAriaLabel [ keyCombination . modifier ] ( keyCombination . character ) : keyCombination . character ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( "kbd" , {
className : "edit-post-keyboard-shortcut-help-modal__shortcut-key-combination" ,
"aria-label" : forceAriaLabel || ariaLabel
} , ( Array . isArray ( shortcut ) ? shortcut : [ shortcut ] ) . map ( ( character , index ) => {
if ( character === '+' ) {
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , {
key : index
} , character ) ;
}
return ( 0 , external _wp _element _namespaceObject . createElement ) ( "kbd" , {
key : index ,
className : "edit-post-keyboard-shortcut-help-modal__shortcut-key"
} , character ) ;
} ) ) ;
}
function Shortcut ( {
description ,
keyCombination ,
aliases = [ ] ,
ariaLabel
} ) {
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "edit-post-keyboard-shortcut-help-modal__shortcut-description"
} , description ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "edit-post-keyboard-shortcut-help-modal__shortcut-term"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( KeyCombination , {
keyCombination : keyCombination ,
forceAriaLabel : ariaLabel
} ) , aliases . map ( ( alias , index ) => ( 0 , external _wp _element _namespaceObject . createElement ) ( KeyCombination , {
keyCombination : alias ,
forceAriaLabel : ariaLabel ,
key : index
} ) ) ) ) ;
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var keyboard _shortcut _help _modal _shortcut = ( Shortcut ) ;
2021-05-19 17:09:27 +02:00
2023-06-28 09:04:13 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js
2021-05-19 17:09:27 +02:00
2023-06-28 09:04:13 +02:00
/ * *
* WordPress dependencies
* /
2021-05-19 17:09:27 +02:00
2023-09-26 16:23:26 +02:00
2021-11-08 15:29:21 +01:00
/ * *
2022-04-11 14:04:30 +02:00
* Internal dependencies
2021-11-08 15:29:21 +01:00
* /
2021-05-19 17:09:27 +02:00
2023-06-28 09:04:13 +02:00
function DynamicShortcut ( {
name
} ) {
const {
keyCombination ,
description ,
aliases
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
const {
getShortcutKeyCombination ,
getShortcutDescription ,
getShortcutAliases
} = select ( external _wp _keyboardShortcuts _namespaceObject . store ) ;
return {
keyCombination : getShortcutKeyCombination ( name ) ,
aliases : getShortcutAliases ( name ) ,
description : getShortcutDescription ( name )
} ;
} , [ name ] ) ;
if ( ! keyCombination ) {
return null ;
}
return ( 0 , external _wp _element _namespaceObject . createElement ) ( keyboard _shortcut _help _modal _shortcut , {
keyCombination : keyCombination ,
description : description ,
aliases : aliases
} ) ;
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var dynamic _shortcut = ( DynamicShortcut ) ;
2023-06-28 09:04:13 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/keyboard-shortcut-help-modal/index.js
2021-01-28 03:04:13 +01:00
/ * *
2023-06-28 09:04:13 +02:00
* External dependencies
2021-01-28 03:04:13 +01:00
* /
2021-05-19 17:09:27 +02:00
2023-09-26 16:23:26 +02:00
2021-01-28 03:04:13 +01:00
/ * *
2023-06-28 09:04:13 +02:00
* WordPress dependencies
2021-01-28 03:04:13 +01:00
* /
2020-01-22 23:06:21 +01:00
2018-12-14 05:41:57 +01:00
2020-06-26 15:33:47 +02:00
2023-06-28 09:04:13 +02:00
2019-09-19 17:19:18 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Internal dependencies
2019-09-19 17:19:18 +02:00
* /
2018-12-14 05:41:57 +01:00
2022-04-12 17:12:47 +02:00
2023-06-28 09:04:13 +02:00
const KEYBOARD _SHORTCUT _HELP _MODAL _NAME = 'edit-post/keyboard-shortcut-help' ;
const ShortcutList = ( {
shortcuts
} ) =>
/ *
* Disable reason : The ` list ` ARIA role is redundant but
* Safari + VoiceOver won ' t announce the list otherwise .
2021-05-19 17:09:27 +02:00
* /
2023-06-28 09:04:13 +02:00
/* eslint-disable jsx-a11y/no-redundant-roles */
( 0 , external _wp _element _namespaceObject . createElement ) ( "ul" , {
className : "edit-post-keyboard-shortcut-help-modal__shortcut-list" ,
role : "list"
} , shortcuts . map ( ( shortcut , index ) => ( 0 , external _wp _element _namespaceObject . createElement ) ( "li" , {
className : "edit-post-keyboard-shortcut-help-modal__shortcut" ,
key : index
} , typeof shortcut === 'string' ? ( 0 , external _wp _element _namespaceObject . createElement ) ( dynamic _shortcut , {
name : shortcut
2023-09-26 16:23:26 +02:00
} ) : ( 0 , external _wp _element _namespaceObject . createElement ) ( keyboard _shortcut _help _modal _shortcut , {
... shortcut
2023-06-28 09:04:13 +02:00
} ) ) ) )
2023-09-26 16:23:26 +02:00
/* eslint-enable jsx-a11y/no-redundant-roles */ ;
2022-04-12 17:12:47 +02:00
2023-06-28 09:04:13 +02:00
const ShortcutSection = ( {
title ,
shortcuts ,
className
} ) => ( 0 , external _wp _element _namespaceObject . createElement ) ( "section" , {
className : classnames _default ( ) ( 'edit-post-keyboard-shortcut-help-modal__section' , className )
} , ! ! title && ( 0 , external _wp _element _namespaceObject . createElement ) ( "h2" , {
className : "edit-post-keyboard-shortcut-help-modal__section-title"
} , title ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( ShortcutList , {
shortcuts : shortcuts
} ) ) ;
const ShortcutCategorySection = ( {
title ,
categoryName ,
additionalShortcuts = [ ]
} ) => {
const categoryShortcuts = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
return select ( external _wp _keyboardShortcuts _namespaceObject . store ) . getCategoryShortcuts ( categoryName ) ;
} , [ categoryName ] ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( ShortcutSection , {
title : title ,
shortcuts : categoryShortcuts . concat ( additionalShortcuts )
} ) ;
} ;
function KeyboardShortcutHelpModal ( {
isModalActive ,
toggleModal
} ) {
( 0 , external _wp _keyboardShortcuts _namespaceObject . useShortcut ) ( 'core/edit-post/keyboard-shortcuts' , toggleModal ) ;
if ( ! isModalActive ) {
return null ;
2022-04-12 17:12:47 +02:00
}
2023-06-28 09:04:13 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Modal , {
className : "edit-post-keyboard-shortcut-help-modal" ,
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Keyboard shortcuts' ) ,
closeButtonLabel : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Close' ) ,
onRequestClose : toggleModal
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( ShortcutSection , {
className : "edit-post-keyboard-shortcut-help-modal__main-shortcuts" ,
shortcuts : [ 'core/edit-post/keyboard-shortcuts' ]
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( ShortcutCategorySection , {
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Global shortcuts' ) ,
categoryName : "global"
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( ShortcutCategorySection , {
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Selection shortcuts' ) ,
categoryName : "selection"
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( ShortcutCategorySection , {
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Block shortcuts' ) ,
categoryName : "block" ,
additionalShortcuts : [ {
keyCombination : {
character : '/'
} ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Change the block type after adding a new paragraph.' ) ,
/* translators: The forward-slash character. e.g. '/'. */
ariaLabel : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Forward-slash' )
} ]
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( ShortcutSection , {
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Text formatting' ) ,
shortcuts : textFormattingShortcuts
} ) ) ;
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var keyboard _shortcut _help _modal = ( ( 0 , external _wp _compose _namespaceObject . compose ) ( [ ( 0 , external _wp _data _namespaceObject . withSelect ) ( select => ( {
2023-06-28 09:04:13 +02:00
isModalActive : select ( store ) . isModalActive ( KEYBOARD _SHORTCUT _HELP _MODAL _NAME )
} ) ) , ( 0 , external _wp _data _namespaceObject . withDispatch ) ( ( dispatch , {
isModalActive
} ) => {
const {
openModal ,
closeModal
} = dispatch ( store ) ;
2022-04-11 14:04:30 +02:00
return {
2023-06-28 09:04:13 +02:00
toggleModal : ( ) => isModalActive ? closeModal ( ) : openModal ( KEYBOARD _SHORTCUT _HELP _MODAL _NAME )
2022-04-11 14:04:30 +02:00
} ;
2023-06-28 09:04:13 +02:00
} ) ] ) ( KeyboardShortcutHelpModal ) ) ;
2022-04-12 17:12:47 +02:00
2023-06-28 09:04:13 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js
2021-01-28 03:04:13 +01:00
2022-04-11 14:04:30 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* WordPress dependencies
2022-04-11 14:04:30 +02:00
* /
2018-12-14 05:41:57 +01:00
2020-06-26 15:33:47 +02:00
2022-04-12 17:12:47 +02:00
2023-09-26 16:23:26 +02:00
2018-12-18 04:14:52 +01:00
/ * *
2023-06-28 09:04:13 +02:00
* Internal dependencies
2018-12-18 04:14:52 +01:00
* /
2018-12-14 05:41:57 +01:00
2023-06-28 09:04:13 +02:00
function KeyboardShortcutsHelpMenuItem ( {
openModal
} ) {
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . MenuItem , {
onClick : ( ) => {
openModal ( KEYBOARD _SHORTCUT _HELP _MODAL _NAME ) ;
} ,
shortcut : external _wp _keycodes _namespaceObject . displayShortcut . access ( 'h' )
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Keyboard shortcuts' ) ) ;
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var keyboard _shortcuts _help _menu _item = ( ( 0 , external _wp _data _namespaceObject . withDispatch ) ( dispatch => {
2023-06-28 09:04:13 +02:00
const {
openModal
} = dispatch ( store ) ;
return {
openModal
} ;
} ) ( KeyboardShortcutsHelpMenuItem ) ) ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/tools-more-menu-group/index.js
2022-04-11 14:04:30 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* WordPress dependencies
2022-04-11 14:04:30 +02:00
* /
2021-01-28 03:04:13 +01:00
2022-04-12 17:12:47 +02:00
2023-06-28 09:04:13 +02:00
const {
Fill : ToolsMoreMenuGroup ,
Slot
} = ( 0 , external _wp _components _namespaceObject . createSlotFill ) ( 'ToolsMoreMenuGroup' ) ;
ToolsMoreMenuGroup . Slot = ( {
fillProps
} ) => ( 0 , external _wp _element _namespaceObject . createElement ) ( Slot , {
fillProps : fillProps
} , fills => fills . length > 0 && ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . MenuGroup , {
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Tools' )
} , fills ) ) ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var tools _more _menu _group = ( ToolsMoreMenuGroup ) ;
2023-06-28 09:04:13 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/store/reducer.js
2022-04-11 14:04:30 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* WordPress dependencies
* /
2023-09-26 16:23:26 +02:00
2023-06-28 09:04:13 +02:00
/ * *
* Reducer storing the list of all programmatically removed panels .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ param { Array } state Current state .
* @ param { Object } action Action object .
*
* @ return { Array } Updated state .
2022-04-11 14:04:30 +02:00
* /
2023-06-28 09:04:13 +02:00
function removedPanels ( state = [ ] , action ) {
switch ( action . type ) {
case 'REMOVE_PANEL' :
if ( ! state . includes ( action . panelName ) ) {
return [ ... state , action . panelName ] ;
}
}
return state ;
}
function publishSidebarActive ( state = false , action ) {
switch ( action . type ) {
case 'OPEN_PUBLISH_SIDEBAR' :
return true ;
case 'CLOSE_PUBLISH_SIDEBAR' :
return false ;
case 'TOGGLE_PUBLISH_SIDEBAR' :
return ! state ;
}
return state ;
2023-02-07 08:04:52 +01:00
}
2023-09-26 16:23:26 +02:00
2018-12-14 05:41:57 +01:00
/ * *
2023-06-28 09:04:13 +02:00
* Reducer keeping track of the meta boxes isSaving state .
* A "true" value means the meta boxes saving request is in - flight .
*
*
* @ param { boolean } state Previous state .
* @ param { Object } action Action Object .
*
* @ return { Object } Updated state .
2018-12-14 05:41:57 +01:00
* /
2023-06-28 09:04:13 +02:00
function isSavingMetaBoxes ( state = false , action ) {
switch ( action . type ) {
case 'REQUEST_META_BOX_UPDATES' :
return true ;
case 'META_BOX_UPDATES_SUCCESS' :
case 'META_BOX_UPDATES_FAILURE' :
return false ;
default :
return state ;
}
}
function mergeMetaboxes ( metaboxes = [ ] , newMetaboxes ) {
const mergedMetaboxes = [ ... metaboxes ] ;
for ( const metabox of newMetaboxes ) {
const existing = mergedMetaboxes . findIndex ( box => box . id === metabox . id ) ;
if ( existing !== - 1 ) {
mergedMetaboxes [ existing ] = metabox ;
} else {
mergedMetaboxes . push ( metabox ) ;
2022-04-11 14:04:30 +02:00
}
}
2023-06-28 09:04:13 +02:00
return mergedMetaboxes ;
2022-04-11 14:04:30 +02:00
}
2023-09-26 16:23:26 +02:00
2019-09-19 17:19:18 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Reducer keeping track of the meta boxes per location .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ param { boolean } state Previous state .
* @ param { Object } action Action Object .
*
* @ return { Object } Updated state .
2019-09-19 17:19:18 +02:00
* /
2023-06-28 09:04:13 +02:00
function metaBoxLocations ( state = { } , action ) {
switch ( action . type ) {
case 'SET_META_BOXES_PER_LOCATIONS' :
{
2023-09-26 16:23:26 +02:00
const newState = {
... state
2023-06-28 09:04:13 +02:00
} ;
for ( const [ location , metaboxes ] of Object . entries ( action . metaBoxesPerLocation ) ) {
newState [ location ] = mergeMetaboxes ( newState [ location ] , metaboxes ) ;
}
return newState ;
}
}
return state ;
2021-05-19 17:09:27 +02:00
}
2023-09-26 16:23:26 +02:00
2022-04-11 14:04:30 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Reducer returning the editing canvas device type .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ param { Object } state Current state .
* @ param { Object } action Dispatched action .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ return { Object } Updated state .
2022-04-11 14:04:30 +02:00
* /
2023-06-28 09:04:13 +02:00
function deviceType ( state = 'Desktop' , action ) {
switch ( action . type ) {
case 'SET_PREVIEW_DEVICE_TYPE' :
return action . deviceType ;
}
return state ;
2021-05-19 17:09:27 +02:00
}
2023-09-26 16:23:26 +02:00
2022-04-11 14:04:30 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Reducer to set the block inserter panel open or closed .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* Note : this reducer interacts with the list view panel reducer
* to make sure that only one of the two panels is open at the same time .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ param { Object } state Current state .
* @ param { Object } action Dispatched action .
2022-04-11 14:04:30 +02:00
* /
2023-06-28 09:04:13 +02:00
function blockInserterPanel ( state = false , action ) {
switch ( action . type ) {
case 'SET_IS_LIST_VIEW_OPENED' :
return action . isOpen ? false : state ;
case 'SET_IS_INSERTER_OPENED' :
return action . value ;
}
return state ;
2022-04-11 14:04:30 +02:00
}
2023-09-26 16:23:26 +02:00
2022-04-11 14:04:30 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Reducer to set the list view panel open or closed .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* Note : this reducer interacts with the inserter panel reducer
* to make sure that only one of the two panels is open at the same time .
*
* @ param { Object } state Current state .
* @ param { Object } action Dispatched action .
2022-04-11 14:04:30 +02:00
* /
2023-06-28 09:04:13 +02:00
function listViewPanel ( state = false , action ) {
switch ( action . type ) {
case 'SET_IS_INSERTER_OPENED' :
return action . value ? false : state ;
case 'SET_IS_LIST_VIEW_OPENED' :
return action . isOpen ;
}
return state ;
2022-04-11 14:04:30 +02:00
}
2023-09-26 16:23:26 +02:00
2022-04-11 14:04:30 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Reducer tracking whether template editing is on or off .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ param { boolean } state
* @ param { Object } action
2022-04-11 14:04:30 +02:00
* /
2023-06-28 09:04:13 +02:00
function isEditingTemplate ( state = false , action ) {
switch ( action . type ) {
case 'SET_IS_EDITING_TEMPLATE' :
return action . value ;
}
return state ;
2022-04-11 14:04:30 +02:00
}
2023-09-26 16:23:26 +02:00
2022-04-11 14:04:30 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Reducer tracking whether meta boxes are initialized .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ param { boolean } state
* @ param { Object } action
*
* @ return { boolean } Updated state .
2022-04-11 14:04:30 +02:00
* /
2023-06-28 09:04:13 +02:00
function metaBoxesInitialized ( state = false , action ) {
switch ( action . type ) {
case 'META_BOXES_INITIALIZED' :
return true ;
2023-06-27 16:24:19 +02:00
}
2023-06-28 09:04:13 +02:00
return state ;
}
const metaBoxes = ( 0 , external _wp _data _namespaceObject . combineReducers ) ( {
isSaving : isSavingMetaBoxes ,
locations : metaBoxLocations ,
initialized : metaBoxesInitialized
} ) ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var store _reducer = ( ( 0 , external _wp _data _namespaceObject . combineReducers ) ( {
2023-06-28 09:04:13 +02:00
metaBoxes ,
publishSidebarActive ,
removedPanels ,
deviceType ,
blockInserterPanel ,
listViewPanel ,
isEditingTemplate
} ) ) ;
2021-01-28 03:04:13 +01:00
2023-06-28 09:04:13 +02:00
; // CONCATENATED MODULE: external ["wp","apiFetch"]
2023-09-21 15:26:32 +02:00
var external _wp _apiFetch _namespaceObject = window [ "wp" ] [ "apiFetch" ] ;
2023-06-28 09:04:13 +02:00
var external _wp _apiFetch _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( external _wp _apiFetch _namespaceObject ) ;
; // CONCATENATED MODULE: external ["wp","a11y"]
2023-09-21 15:26:32 +02:00
var external _wp _a11y _namespaceObject = window [ "wp" ] [ "a11y" ] ;
2023-06-28 09:04:13 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/utils/meta-boxes.js
/ * *
* Function returning the current Meta Boxes DOM Node in the editor
* whether the meta box area is opened or not .
* If the MetaBox Area is visible returns it , and returns the original container instead .
*
* @ param { string } location Meta Box location .
*
* @ return { string } HTML content .
* /
const getMetaBoxContainer = location => {
const area = document . querySelector ( ` .edit-post-meta-boxes-area.is- ${ location } .metabox-location- ${ location } ` ) ;
if ( area ) {
return area ;
2022-04-11 14:04:30 +02:00
}
2023-06-28 09:04:13 +02:00
return document . querySelector ( '#metaboxes .metabox-location-' + location ) ;
} ;
2022-04-12 17:12:47 +02:00
2023-06-28 09:04:13 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/store/actions.js
/ * *
* WordPress dependencies
* /
2021-01-28 03:04:13 +01:00
2020-06-26 15:33:47 +02:00
2021-01-28 03:04:13 +01:00
2022-09-20 17:43:29 +02:00
2021-01-28 03:04:13 +01:00
2023-09-26 16:23:26 +02:00
2022-04-11 14:04:30 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Internal dependencies
2022-09-20 17:43:29 +02:00
* /
2023-06-28 09:04:13 +02:00
2021-01-28 03:04:13 +01:00
2022-04-11 14:04:30 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Returns an action object used in signalling that the user opened an editor sidebar .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ param { ? string } name Sidebar name to be opened .
2022-04-11 14:04:30 +02:00
* /
2023-06-28 09:04:13 +02:00
const openGeneralSidebar = name => ( {
2023-09-26 16:23:26 +02:00
dispatch ,
2023-06-28 09:04:13 +02:00
registry
2023-09-26 16:23:26 +02:00
} ) => {
const isDistractionFree = registry . select ( external _wp _preferences _namespaceObject . store ) . get ( 'core/edit-post' , 'distractionFree' ) ;
if ( isDistractionFree ) {
dispatch . toggleDistractionFree ( ) ;
}
registry . dispatch ( store ) . enableComplementaryArea ( store _store . name , name ) ;
} ;
2021-01-28 03:04:13 +01:00
2023-09-26 16:23:26 +02:00
/ * *
* Returns an action object signalling that the user closed the sidebar .
* /
2023-06-28 09:04:13 +02:00
const closeGeneralSidebar = ( ) => ( {
registry
} ) => registry . dispatch ( store ) . disableComplementaryArea ( store _store . name ) ;
2023-09-26 16:23:26 +02:00
2022-04-11 14:04:30 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Returns an action object used in signalling that the user opened a modal .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ deprecated since WP 6.3 use ` core/interface ` store ' s action with the same name instead .
2022-09-20 17:43:29 +02:00
*
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ param { string } name A string that uniquely identifies the modal .
*
* @ return { Object } Action object .
2022-04-11 14:04:30 +02:00
* /
2023-06-28 09:04:13 +02:00
const actions _openModal = name => ( {
registry
} ) => {
external _wp _deprecated _default ( ) ( "select( 'core/edit-post' ).openModal( name )" , {
since : '6.3' ,
alternative : "select( 'core/interface').openModal( name )"
} ) ;
return registry . dispatch ( store ) . openModal ( name ) ;
} ;
2023-09-26 16:23:26 +02:00
2022-04-11 14:04:30 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Returns an action object signalling that the user closed a modal .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ deprecated since WP 6.3 use ` core/interface ` store ' s action with the same name instead .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ return { Object } Action object .
2022-04-11 14:04:30 +02:00
* /
2023-06-28 09:04:13 +02:00
const actions _closeModal = ( ) => ( {
registry
} ) => {
external _wp _deprecated _default ( ) ( "select( 'core/edit-post' ).closeModal()" , {
since : '6.3' ,
alternative : "select( 'core/interface').closeModal()"
} ) ;
return registry . dispatch ( store ) . closeModal ( ) ;
} ;
2023-09-26 16:23:26 +02:00
2022-04-11 14:04:30 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Returns an action object used in signalling that the user opened the publish
* sidebar .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ return { Object } Action object
2022-04-11 14:04:30 +02:00
* /
2023-06-28 09:04:13 +02:00
function openPublishSidebar ( ) {
return {
type : 'OPEN_PUBLISH_SIDEBAR'
} ;
2021-05-19 17:09:27 +02:00
}
2023-09-26 16:23:26 +02:00
2021-05-19 17:09:27 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Returns an action object used in signalling that the user closed the
* publish sidebar .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ return { Object } Action object .
* /
function closePublishSidebar ( ) {
return {
type : 'CLOSE_PUBLISH_SIDEBAR'
} ;
}
2023-09-26 16:23:26 +02:00
2023-06-28 09:04:13 +02:00
/ * *
* Returns an action object used in signalling that the user toggles the publish sidebar .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ return { Object } Action object
2021-05-19 17:09:27 +02:00
* /
2023-06-28 09:04:13 +02:00
function togglePublishSidebar ( ) {
return {
type : 'TOGGLE_PUBLISH_SIDEBAR'
} ;
2022-04-11 14:04:30 +02:00
}
2023-09-26 16:23:26 +02:00
2021-05-19 17:09:27 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Returns an action object used to enable or disable a panel in the editor .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ param { string } panelName A string that identifies the panel to enable or disable .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ return { Object } Action object .
2021-05-19 17:09:27 +02:00
* /
2023-06-28 09:04:13 +02:00
const toggleEditorPanelEnabled = panelName => ( {
registry
} ) => {
var _registry$select$get ;
const inactivePanels = ( _registry$select$get = registry . select ( external _wp _preferences _namespaceObject . store ) . get ( 'core/edit-post' , 'inactivePanels' ) ) !== null && _registry$select$get !== void 0 ? _registry$select$get : [ ] ;
2023-09-26 16:23:26 +02:00
const isPanelInactive = ! ! inactivePanels ? . includes ( panelName ) ;
2021-11-08 15:29:21 +01:00
2023-09-26 16:23:26 +02:00
// If the panel is inactive, remove it to enable it, else add it to
// make it inactive.
2023-06-28 09:04:13 +02:00
let updatedInactivePanels ;
if ( isPanelInactive ) {
updatedInactivePanels = inactivePanels . filter ( invactivePanelName => invactivePanelName !== panelName ) ;
} else {
updatedInactivePanels = [ ... inactivePanels , panelName ] ;
}
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . set ( 'core/edit-post' , 'inactivePanels' , updatedInactivePanels ) ;
} ;
2023-09-26 16:23:26 +02:00
2023-06-28 09:04:13 +02:00
/ * *
* Opens a closed panel and closes an open panel .
*
* @ param { string } panelName A string that identifies the panel to open or close .
* /
const toggleEditorPanelOpened = panelName => ( {
registry
} ) => {
var _registry$select$get2 ;
const openPanels = ( _registry$select$get2 = registry . select ( external _wp _preferences _namespaceObject . store ) . get ( 'core/edit-post' , 'openPanels' ) ) !== null && _registry$select$get2 !== void 0 ? _registry$select$get2 : [ ] ;
2023-09-26 16:23:26 +02:00
const isPanelOpen = ! ! openPanels ? . includes ( panelName ) ;
2021-11-08 15:29:21 +01:00
2023-09-26 16:23:26 +02:00
// If the panel is open, remove it to close it, else add it to
// make it open.
2023-06-28 09:04:13 +02:00
let updatedOpenPanels ;
if ( isPanelOpen ) {
updatedOpenPanels = openPanels . filter ( openPanelName => openPanelName !== panelName ) ;
} else {
updatedOpenPanels = [ ... openPanels , panelName ] ;
}
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . set ( 'core/edit-post' , 'openPanels' , updatedOpenPanels ) ;
} ;
2023-09-26 16:23:26 +02:00
2023-06-28 09:04:13 +02:00
/ * *
* Returns an action object used to remove a panel from the editor .
*
* @ param { string } panelName A string that identifies the panel to remove .
*
* @ return { Object } Action object .
* /
function removeEditorPanel ( panelName ) {
return {
type : 'REMOVE_PANEL' ,
panelName
} ;
2022-04-11 14:04:30 +02:00
}
2023-09-26 16:23:26 +02:00
2022-04-11 14:04:30 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Triggers an action used to toggle a feature flag .
*
* @ param { string } feature Feature name .
2022-04-11 14:04:30 +02:00
* /
2023-06-28 09:04:13 +02:00
const actions _toggleFeature = feature => ( {
registry
} ) => registry . dispatch ( external _wp _preferences _namespaceObject . store ) . toggle ( 'core/edit-post' , feature ) ;
2023-09-26 16:23:26 +02:00
2021-11-08 15:29:21 +01:00
/ * *
2023-06-28 09:04:13 +02:00
* Triggers an action used to switch editor mode .
*
* @ param { string } mode The editor mode .
2021-11-08 15:29:21 +01:00
* /
2023-06-28 09:04:13 +02:00
const switchEditorMode = mode => ( {
2023-09-26 16:23:26 +02:00
dispatch ,
2023-06-28 09:04:13 +02:00
registry
} ) => {
2023-09-26 16:23:26 +02:00
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . set ( 'core/edit-post' , 'editorMode' , mode ) ;
2021-11-08 15:29:21 +01:00
2023-09-26 16:23:26 +02:00
// Unselect blocks when we switch to the code editor.
2023-06-28 09:04:13 +02:00
if ( mode !== 'visual' ) {
registry . dispatch ( external _wp _blockEditor _namespaceObject . store ) . clearSelectedBlock ( ) ;
}
2023-09-26 16:23:26 +02:00
if ( mode === 'text' && registry . select ( external _wp _preferences _namespaceObject . store ) . get ( 'core/edit-post' , 'distractionFree' ) ) {
dispatch . toggleDistractionFree ( ) ;
}
2023-06-28 09:04:13 +02:00
const message = mode === 'visual' ? ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Visual editor selected' ) : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Code editor selected' ) ;
( 0 , external _wp _a11y _namespaceObject . speak ) ( message , 'assertive' ) ;
} ;
2023-09-26 16:23:26 +02:00
2021-11-08 15:29:21 +01:00
/ * *
2023-06-28 09:04:13 +02:00
* Triggers an action object used to toggle a plugin name flag .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ param { string } pluginName Plugin name .
* /
const togglePinnedPluginItem = pluginName => ( {
registry
} ) => {
const isPinned = registry . select ( store ) . isItemPinned ( 'core/edit-post' , pluginName ) ;
registry . dispatch ( store ) [ isPinned ? 'unpinItem' : 'pinItem' ] ( 'core/edit-post' , pluginName ) ;
} ;
2023-09-26 16:23:26 +02:00
2023-06-28 09:04:13 +02:00
/ * *
* Returns an action object used in signaling that a style should be auto - applied when a block is created .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ param { string } blockName Name of the block .
* @ param { ? string } blockStyle Name of the style that should be auto applied . If undefined , the "auto apply" setting of the block is removed .
2021-11-08 15:29:21 +01:00
* /
2023-06-28 09:04:13 +02:00
const updatePreferredStyleVariations = ( blockName , blockStyle ) => ( {
registry
} ) => {
var _registry$select$get3 ;
if ( ! blockName ) {
return ;
}
2023-09-26 16:23:26 +02:00
const existingVariations = ( _registry$select$get3 = registry . select ( external _wp _preferences _namespaceObject . store ) . get ( 'core/edit-post' , 'preferredStyleVariations' ) ) !== null && _registry$select$get3 !== void 0 ? _registry$select$get3 : { } ;
2023-06-28 09:04:13 +02:00
2023-09-26 16:23:26 +02:00
// When the blockStyle is omitted, remove the block's preferred variation.
2023-06-28 09:04:13 +02:00
if ( ! blockStyle ) {
2023-09-26 16:23:26 +02:00
const updatedVariations = {
... existingVariations
2023-06-28 09:04:13 +02:00
} ;
delete updatedVariations [ blockName ] ;
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . set ( 'core/edit-post' , 'preferredStyleVariations' , updatedVariations ) ;
} else {
// Else add the variation.
2023-09-26 16:23:26 +02:00
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . set ( 'core/edit-post' , 'preferredStyleVariations' , {
... existingVariations ,
2023-06-28 09:04:13 +02:00
[ blockName ] : blockStyle
} ) ;
}
} ;
2023-09-26 16:23:26 +02:00
2021-05-20 14:20:04 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Update the provided block types to be visible .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ param { string [ ] } blockNames Names of block types to show .
2021-05-20 14:20:04 +02:00
* /
2023-06-28 09:04:13 +02:00
const showBlockTypes = blockNames => ( {
registry
} ) => {
var _registry$select$get4 ;
const existingBlockNames = ( _registry$select$get4 = registry . select ( external _wp _preferences _namespaceObject . store ) . get ( 'core/edit-post' , 'hiddenBlockTypes' ) ) !== null && _registry$select$get4 !== void 0 ? _registry$select$get4 : [ ] ;
const newBlockNames = existingBlockNames . filter ( type => ! ( Array . isArray ( blockNames ) ? blockNames : [ blockNames ] ) . includes ( type ) ) ;
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . set ( 'core/edit-post' , 'hiddenBlockTypes' , newBlockNames ) ;
} ;
2023-09-26 16:23:26 +02:00
2021-05-20 14:20:04 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Update the provided block types to be hidden .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ param { string [ ] } blockNames Names of block types to hide .
2021-05-20 14:20:04 +02:00
* /
2023-06-28 09:04:13 +02:00
const hideBlockTypes = blockNames => ( {
registry
} ) => {
var _registry$select$get5 ;
const existingBlockNames = ( _registry$select$get5 = registry . select ( external _wp _preferences _namespaceObject . store ) . get ( 'core/edit-post' , 'hiddenBlockTypes' ) ) !== null && _registry$select$get5 !== void 0 ? _registry$select$get5 : [ ] ;
const mergedBlockNames = new Set ( [ ... existingBlockNames , ... ( Array . isArray ( blockNames ) ? blockNames : [ blockNames ] ) ] ) ;
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . set ( 'core/edit-post' , 'hiddenBlockTypes' , [ ... mergedBlockNames ] ) ;
} ;
2023-09-26 16:23:26 +02:00
2021-05-20 14:20:04 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Stores info about which Meta boxes are available in which location .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ param { Object } metaBoxesPerLocation Meta boxes per location .
2021-05-20 14:20:04 +02:00
* /
2023-06-28 09:04:13 +02:00
function setAvailableMetaBoxesPerLocation ( metaBoxesPerLocation ) {
return {
type : 'SET_META_BOXES_PER_LOCATIONS' ,
metaBoxesPerLocation
} ;
}
2023-09-26 16:23:26 +02:00
2022-04-12 17:12:47 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Update a metabox .
2022-04-12 17:12:47 +02:00
* /
2023-06-28 09:04:13 +02:00
const requestMetaBoxUpdates = ( ) => async ( {
registry ,
select ,
dispatch
} ) => {
dispatch ( {
type : 'REQUEST_META_BOX_UPDATES'
2023-09-26 16:23:26 +02:00
} ) ;
2022-04-12 17:12:47 +02:00
2023-09-26 16:23:26 +02:00
// Saves the wp_editor fields.
2023-06-28 09:04:13 +02:00
if ( window . tinyMCE ) {
window . tinyMCE . triggerSave ( ) ;
2023-09-26 16:23:26 +02:00
}
2022-04-12 17:12:47 +02:00
2023-09-26 16:23:26 +02:00
// Additional data needed for backward compatibility.
// If we do not provide this data, the post will be overridden with the default values.
2023-06-28 09:04:13 +02:00
const post = registry . select ( external _wp _editor _namespaceObject . store ) . getCurrentPost ( ) ;
2023-09-26 16:23:26 +02:00
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 ) ;
2021-05-07 13:48:27 +02:00
2023-09-26 16:23:26 +02:00
// We gather all the metaboxes locations data and the base form data.
2023-06-28 09:04:13 +02:00
const baseFormData = new window . FormData ( document . querySelector ( '.metabox-base-form' ) ) ;
const activeMetaBoxLocations = select . getActiveMetaBoxLocations ( ) ;
2023-09-26 16:23:26 +02:00
const formDataToMerge = [ baseFormData , ... activeMetaBoxLocations . map ( location => new window . FormData ( getMetaBoxContainer ( location ) ) ) ] ;
2022-04-12 17:12:47 +02:00
2023-09-26 16:23:26 +02:00
// Merge all form data objects into a single one.
2023-06-28 09:04:13 +02:00
const formData = formDataToMerge . reduce ( ( memo , currentFormData ) => {
for ( const [ key , value ] of currentFormData ) {
memo . append ( key , value ) ;
}
return memo ;
} , new window . FormData ( ) ) ;
additionalData . forEach ( ( [ key , value ] ) => formData . append ( key , value ) ) ;
try {
// Save the metaboxes.
await external _wp _apiFetch _default ( ) ( {
url : window . _wpMetaBoxUrl ,
method : 'POST' ,
body : formData ,
parse : false
} ) ;
dispatch . metaBoxUpdatesSuccess ( ) ;
} catch {
dispatch . metaBoxUpdatesFailure ( ) ;
}
} ;
2023-09-26 16:23:26 +02:00
2021-05-19 17:09:27 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Returns an action object used to signal a successful meta box update .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ return { Object } Action object .
2021-05-19 17:09:27 +02:00
* /
2023-06-28 09:04:13 +02:00
function metaBoxUpdatesSuccess ( ) {
return {
type : 'META_BOX_UPDATES_SUCCESS'
} ;
2022-04-11 14:04:30 +02:00
}
2023-09-26 16:23:26 +02:00
2022-04-12 17:12:47 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Returns an action object used to signal a failed meta box update .
2022-04-12 17:12:47 +02:00
*
2023-06-28 09:04:13 +02:00
* @ return { Object } Action object .
2022-04-12 17:12:47 +02:00
* /
2023-06-28 09:04:13 +02:00
function metaBoxUpdatesFailure ( ) {
return {
type : 'META_BOX_UPDATES_FAILURE'
} ;
}
2023-09-26 16:23:26 +02:00
2019-09-19 17:19:18 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Returns an action object used to toggle the width of the editing canvas .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ param { string } deviceType
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ return { Object } Action object .
2019-09-19 17:19:18 +02:00
* /
2023-06-28 09:04:13 +02:00
function _ _experimentalSetPreviewDeviceType ( deviceType ) {
return {
type : 'SET_PREVIEW_DEVICE_TYPE' ,
deviceType
} ;
2021-05-19 17:09:27 +02:00
}
2023-09-26 16:23:26 +02:00
2021-05-07 13:48:27 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Returns an action object used to open / close the inserter .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ param { boolean | Object } value Whether the inserter should be
* opened ( true ) or closed ( false ) .
* To specify an insertion point ,
* use an object .
* @ param { string } value . rootClientId The root client ID to insert at .
* @ param { number } value . insertionIndex The index to insert at .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ return { Object } Action object .
2021-05-07 13:48:27 +02:00
* /
2023-06-28 09:04:13 +02:00
function setIsInserterOpened ( value ) {
return {
type : 'SET_IS_INSERTER_OPENED' ,
value
} ;
2022-04-11 14:04:30 +02:00
}
2023-09-26 16:23:26 +02:00
2021-05-19 17:09:27 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Returns an action object used to open / close the list view .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ param { boolean } isOpen A boolean representing whether the list view should be opened or closed .
* @ return { Object } Action object .
2021-05-19 17:09:27 +02:00
* /
2023-09-26 16:23:26 +02:00
const setIsListViewOpened = isOpen => ( {
dispatch ,
registry
} ) => {
const isDistractionFree = registry . select ( external _wp _preferences _namespaceObject . store ) . get ( 'core/edit-post' , 'distractionFree' ) ;
if ( isDistractionFree && isOpen ) {
dispatch . toggleDistractionFree ( ) ;
}
dispatch ( {
2023-06-28 09:04:13 +02:00
type : 'SET_IS_LIST_VIEW_OPENED' ,
isOpen
2023-09-26 16:23:26 +02:00
} ) ;
} ;
2021-01-28 03:04:13 +01:00
/ * *
2023-06-28 09:04:13 +02:00
* Returns an action object used to switch to template editing .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ param { boolean } value Is editing template .
* @ return { Object } Action object .
2021-05-07 13:48:27 +02:00
* /
2023-06-28 09:04:13 +02:00
function setIsEditingTemplate ( value ) {
return {
type : 'SET_IS_EDITING_TEMPLATE' ,
value
} ;
}
2023-09-26 16:23:26 +02:00
2021-05-07 13:48:27 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Switches to the template mode .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ param { boolean } newTemplate Is new template .
2021-01-28 03:04:13 +01:00
* /
2023-06-28 09:04:13 +02:00
const _ _unstableSwitchToTemplateMode = ( newTemplate = false ) => ( {
registry ,
select ,
dispatch
} ) => {
dispatch ( setIsEditingTemplate ( true ) ) ;
const isWelcomeGuideActive = select . isFeatureActive ( 'welcomeGuideTemplate' ) ;
if ( ! isWelcomeGuideActive ) {
const message = newTemplate ? ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Custom template created. You're in template mode now." ) : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Editing template. Changes made here affect all posts and pages that use the template.' ) ;
registry . dispatch ( external _wp _notices _namespaceObject . store ) . createSuccessNotice ( message , {
type : 'snackbar'
} ) ;
}
} ;
2023-09-26 16:23:26 +02:00
2021-01-28 03:04:13 +01:00
/ * *
2023-06-28 09:04:13 +02:00
* Create a block based template .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ param { Object ? } template Template to create and assign .
2021-01-28 03:04:13 +01:00
* /
2023-06-28 09:04:13 +02:00
const _ _unstableCreateTemplate = template => async ( {
registry
} ) => {
const savedTemplate = await registry . dispatch ( external _wp _coreData _namespaceObject . store ) . saveEntityRecord ( 'postType' , 'wp_template' , template ) ;
const post = registry . select ( external _wp _editor _namespaceObject . store ) . getCurrentPost ( ) ;
registry . dispatch ( external _wp _coreData _namespaceObject . store ) . editEntityRecord ( 'postType' , post . type , post . id , {
template : savedTemplate . slug
} ) ;
} ;
let actions _metaBoxesInitialized = false ;
2023-09-26 16:23:26 +02:00
2021-05-19 17:09:27 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Initializes WordPress ` postboxes ` script and the logic for saving meta boxes .
2021-05-19 17:09:27 +02:00
* /
2023-06-28 09:04:13 +02:00
const initializeMetaBoxes = ( ) => ( {
registry ,
select ,
dispatch
} ) => {
const isEditorReady = registry . select ( external _wp _editor _namespaceObject . store ) . _ _unstableIsEditorReady ( ) ;
if ( ! isEditorReady ) {
return ;
2023-09-26 16:23:26 +02:00
}
// Only initialize once.
2023-06-28 09:04:13 +02:00
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 ;
2023-09-26 16:23:26 +02:00
// Save metaboxes on save completion, except for autosaves.
( 0 , external _wp _hooks _namespaceObject . addFilter ) ( 'editor.__unstableSavePost' , 'core/edit-post/save-metaboxes' , ( previous , options ) => previous . then ( ( ) => {
if ( options . isAutosave ) {
return ;
2023-06-28 09:04:13 +02:00
}
2023-09-26 16:23:26 +02:00
if ( ! select . hasMetaBoxes ( ) ) {
return ;
}
return dispatch . requestMetaBoxUpdates ( ) ;
} ) ) ;
2023-06-28 09:04:13 +02:00
dispatch ( {
type : 'META_BOXES_INITIALIZED'
} ) ;
} ;
2023-09-26 16:23:26 +02:00
/ * *
* Action that toggles Distraction free mode .
* Distraction free mode expects there are no sidebars , as due to the
* z - index values set , you can ' t close sidebars .
* /
const toggleDistractionFree = ( ) => ( {
dispatch ,
registry
} ) => {
const isDistractionFree = registry . select ( external _wp _preferences _namespaceObject . store ) . get ( 'core/edit-post' , 'distractionFree' ) ;
if ( ! isDistractionFree ) {
registry . batch ( ( ) => {
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . set ( 'core/edit-post' , 'fixedToolbar' , false ) ;
dispatch . setIsInserterOpened ( false ) ;
dispatch . setIsListViewOpened ( false ) ;
dispatch . closeGeneralSidebar ( ) ;
} ) ;
}
registry . batch ( ( ) => {
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . set ( 'core/edit-post' , 'distractionFree' , ! isDistractionFree ) ;
registry . dispatch ( external _wp _notices _namespaceObject . store ) . createInfoNotice ( isDistractionFree ? ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Distraction free off.' ) : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Distraction free on.' ) , {
id : 'core/edit-post/distraction-free-mode/notice' ,
type : 'snackbar'
} ) ;
} ) ;
} ;
2023-06-28 09:04:13 +02:00
; // CONCATENATED MODULE: ./node_modules/rememo/rememo.js
/** @typedef {(...args: any[]) => *[]} GetDependants */
/** @typedef {() => void} Clear */
2021-05-19 17:09:27 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* @ typedef { {
* getDependants : GetDependants ,
* clear : Clear
* } } EnhancedSelector
2021-05-19 17:09:27 +02:00
* /
2021-04-15 17:19:43 +02:00
2021-05-19 17:09:27 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Internal cache entry .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ typedef CacheNode
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ property { ? CacheNode | undefined } [ prev ] Previous node .
* @ property { ? CacheNode | undefined } [ next ] Next node .
* @ property { * [ ] } args Function arguments for cache entry .
* @ property { * } val Function result .
2022-04-11 14:04:30 +02:00
* /
2021-05-07 13:48:27 +02:00
2022-04-11 14:04:30 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* @ typedef Cache
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ property { Clear } clear Function to clear cache .
* @ property { boolean } [ isUniqueByDependants ] Whether dependants are valid in
* considering cache uniqueness . A cache is unique if dependents are all arrays
* or objects .
* @ property { CacheNode ? } [ head ] Cache head .
* @ property { * [ ] } [ lastDependants ] Dependants from previous invocation .
2022-04-11 14:04:30 +02:00
* /
2021-05-07 13:48:27 +02:00
2022-04-11 14:04:30 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Arbitrary value used as key for referencing cache object in WeakMap tree .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ type { { } }
2022-04-11 14:04:30 +02:00
* /
2023-06-28 09:04:13 +02:00
var LEAF _KEY = { } ;
2021-05-07 13:48:27 +02:00
2022-04-11 14:04:30 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Returns the first argument as the sole entry in an array .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ template T
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ param { T } value Value to return .
*
* @ return { [ T ] } Value returned as entry in array .
2022-04-11 14:04:30 +02:00
* /
2023-06-28 09:04:13 +02:00
function arrayOf ( value ) {
return [ value ] ;
}
2021-05-07 13:48:27 +02:00
2022-04-11 14:04:30 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Returns true if the value passed is object - like , or false otherwise . A value
* is object - like if it can support property assignment , e . g . object or array .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ param { * } value Value to test .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ return { boolean } Whether value is object - like .
2022-04-11 14:04:30 +02:00
* /
2023-06-28 09:04:13 +02:00
function isObjectLike ( value ) {
return ! ! value && 'object' === typeof value ;
2022-04-11 14:04:30 +02:00
}
2021-05-07 13:48:27 +02:00
2022-04-11 14:04:30 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Creates and returns a new cache object .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ return { Cache } Cache object .
2022-04-11 14:04:30 +02:00
* /
2023-06-28 09:04:13 +02:00
function createCache ( ) {
/** @type {Cache} */
var cache = {
clear : function ( ) {
cache . head = null ;
} ,
} ;
2021-05-07 13:48:27 +02:00
2023-06-28 09:04:13 +02:00
return cache ;
2022-04-11 14:04:30 +02:00
}
2021-05-07 13:48:27 +02:00
2022-04-11 14:04:30 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Returns true if entries within the two arrays are strictly equal by
* reference from a starting index .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ param { * [ ] } a First array .
* @ param { * [ ] } b Second array .
* @ param { number } fromIndex Index from which to start comparison .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ return { boolean } Whether arrays are shallowly equal .
2022-04-11 14:04:30 +02:00
* /
2023-06-28 09:04:13 +02:00
function isShallowEqual ( a , b , fromIndex ) {
var i ;
2021-05-07 13:48:27 +02:00
2023-06-28 09:04:13 +02:00
if ( a . length !== b . length ) {
return false ;
}
2021-05-20 14:20:04 +02:00
2023-06-28 09:04:13 +02:00
for ( i = fromIndex ; i < a . length ; i ++ ) {
if ( a [ i ] !== b [ i ] ) {
return false ;
}
}
2021-05-20 14:20:04 +02:00
2023-06-28 09:04:13 +02:00
return true ;
2022-04-11 14:04:30 +02:00
}
2021-05-20 14:20:04 +02:00
2022-04-11 14:04:30 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Returns a memoized selector function . The getDependants function argument is
* called before the memoized selector and is expected to return an immutable
* reference or array of references on which the selector depends for computing
* its own return value . The memoize cache is preserved only as long as those
* dependant references remain the same . If getDependants returns a different
* reference ( s ) , the cache is cleared and the selector value regenerated .
2022-04-11 14:04:30 +02:00
*
2023-06-28 09:04:13 +02:00
* @ template { ( ... args : * [ ] ) => * } S
*
* @ param { S } selector Selector function .
* @ param { GetDependants = } getDependants Dependant getter returning an array of
* references used in cache bust consideration .
2022-04-11 14:04:30 +02:00
* /
2023-06-28 09:04:13 +02:00
/* harmony default export */ function rememo ( selector , getDependants ) {
/** @type {WeakMap<*,*>} */
var rootCache ;
2021-05-20 14:20:04 +02:00
2023-06-28 09:04:13 +02:00
/** @type {GetDependants} */
var normalizedGetDependants = getDependants ? getDependants : arrayOf ;
2021-05-20 14:20:04 +02:00
2023-06-28 09:04:13 +02:00
/ * *
* Returns the cache for a given dependants array . When possible , a WeakMap
* will be used to create a unique cache for each set of dependants . This
* is feasible due to the nature of WeakMap in allowing garbage collection
* to occur on entries where the key object is no longer referenced . Since
* WeakMap requires the key to be an object , this is only possible when the
* dependant is object - like . The root cache is created as a hierarchy where
* each top - level key is the first entry in a dependants set , the value a
* WeakMap where each key is the next dependant , and so on . This continues
* so long as the dependants are object - like . If no dependants are object -
* like , then the cache is shared across all invocations .
*
* @ see isObjectLike
*
* @ param { * [ ] } dependants Selector dependants .
*
* @ return { Cache } Cache object .
* /
function getCache ( dependants ) {
var caches = rootCache ,
isUniqueByDependants = true ,
i ,
dependant ,
map ,
cache ;
2021-05-20 14:20:04 +02:00
2023-06-28 09:04:13 +02:00
for ( i = 0 ; i < dependants . length ; i ++ ) {
dependant = dependants [ i ] ;
2021-05-20 14:20:04 +02:00
2023-06-28 09:04:13 +02:00
// Can only compose WeakMap from object-like key.
if ( ! isObjectLike ( dependant ) ) {
isUniqueByDependants = false ;
break ;
}
2021-05-20 14:20:04 +02:00
2023-06-28 09:04:13 +02:00
// Does current segment of cache already have a WeakMap?
if ( caches . has ( dependant ) ) {
// Traverse into nested WeakMap.
caches = caches . get ( dependant ) ;
} else {
// Create, set, and traverse into a new one.
map = new WeakMap ( ) ;
caches . set ( dependant , map ) ;
caches = map ;
}
}
2021-05-20 14:20:04 +02:00
2023-06-28 09:04:13 +02:00
// We use an arbitrary (but consistent) object as key for the last item
// in the WeakMap to serve as our running cache.
if ( ! caches . has ( LEAF _KEY ) ) {
cache = createCache ( ) ;
cache . isUniqueByDependants = isUniqueByDependants ;
caches . set ( LEAF _KEY , cache ) ;
}
2021-05-20 14:20:04 +02:00
2023-06-28 09:04:13 +02:00
return caches . get ( LEAF _KEY ) ;
}
2021-05-20 14:20:04 +02:00
2023-06-28 09:04:13 +02:00
/ * *
* Resets root memoization cache .
* /
function clear ( ) {
rootCache = new WeakMap ( ) ;
}
2021-05-20 14:20:04 +02:00
2023-06-28 09:04:13 +02:00
/* eslint-disable jsdoc/check-param-names */
/ * *
* The augmented selector call , considering first whether dependants have
* changed before passing it to underlying memoize function .
*
* @ param { * } source Source object for derivation .
* @ param { ... * } extraArgs Additional arguments to pass to selector .
*
* @ return { * } Selector result .
* /
/* eslint-enable jsdoc/check-param-names */
function callSelector ( /* source, ...extraArgs */ ) {
var len = arguments . length ,
cache ,
node ,
i ,
args ,
dependants ;
2021-06-01 10:10:04 +02:00
2023-06-28 09:04:13 +02:00
// Create copy of arguments (avoid leaking deoptimization).
args = new Array ( len ) ;
for ( i = 0 ; i < len ; i ++ ) {
args [ i ] = arguments [ i ] ;
}
2021-06-01 10:10:04 +02:00
2023-06-28 09:04:13 +02:00
dependants = normalizedGetDependants . apply ( null , args ) ;
cache = getCache ( dependants ) ;
2021-06-01 10:10:04 +02:00
2023-06-28 09:04:13 +02:00
// If not guaranteed uniqueness by dependants (primitive type), shallow
// compare against last dependants and, if references have changed,
// destroy cache to recalculate result.
if ( ! cache . isUniqueByDependants ) {
if (
cache . lastDependants &&
! isShallowEqual ( dependants , cache . lastDependants , 0 )
) {
cache . clear ( ) ;
}
2021-05-07 13:48:27 +02:00
2023-06-28 09:04:13 +02:00
cache . lastDependants = dependants ;
}
2021-05-07 13:48:27 +02:00
2023-06-28 09:04:13 +02:00
node = cache . head ;
while ( node ) {
// Check whether node arguments match arguments
if ( ! isShallowEqual ( node . args , args , 1 ) ) {
node = node . next ;
continue ;
}
2021-05-07 13:48:27 +02:00
2023-06-28 09:04:13 +02:00
// At this point we can assume we've found a match
2021-05-07 13:48:27 +02:00
2023-06-28 09:04:13 +02:00
// Surface matched node to head if not already
if ( node !== cache . head ) {
// Adjust siblings to point to each other.
/** @type {CacheNode} */ ( node . prev ) . next = node . next ;
if ( node . next ) {
node . next . prev = node . prev ;
}
2020-06-26 15:33:47 +02:00
2023-06-28 09:04:13 +02:00
node . next = cache . head ;
node . prev = null ;
/** @type {CacheNode} */ ( cache . head ) . prev = node ;
cache . head = node ;
}
2020-06-26 15:33:47 +02:00
2023-06-28 09:04:13 +02:00
// Return immediately
return node . val ;
}
2021-05-19 17:09:27 +02:00
2023-06-28 09:04:13 +02:00
// No cached value found. Continue to insertion phase:
2022-01-04 06:39:28 +01:00
2023-06-28 09:04:13 +02:00
node = /** @type {CacheNode} */ ( {
// Generate the result from original function
val : selector . apply ( null , args ) ,
} ) ;
2021-05-19 17:09:27 +02:00
2023-06-28 09:04:13 +02:00
// Avoid including the source object in the cache.
args [ 0 ] = null ;
node . args = args ;
2020-06-26 15:33:47 +02:00
2023-06-28 09:04:13 +02:00
// Don't need to check whether node is already head, since it would
// have been returned above already if it was
2020-06-26 15:33:47 +02:00
2023-06-28 09:04:13 +02:00
// Shift existing head down list
if ( cache . head ) {
cache . head . prev = node ;
node . next = cache . head ;
}
2020-06-26 15:33:47 +02:00
2023-06-28 09:04:13 +02:00
cache . head = node ;
2020-06-26 15:33:47 +02:00
2023-06-28 09:04:13 +02:00
return node . val ;
}
2020-06-26 15:33:47 +02:00
2023-06-28 09:04:13 +02:00
callSelector . getDependants = normalizedGetDependants ;
callSelector . clear = clear ;
clear ( ) ;
2020-06-26 15:33:47 +02:00
2023-06-28 09:04:13 +02:00
return /** @type {S & EnhancedSelector} */ ( callSelector ) ;
2022-04-11 14:04:30 +02:00
}
2020-06-26 15:33:47 +02:00
2023-06-28 09:04:13 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/store/selectors.js
/ * *
* External dependencies
* /
2020-06-26 15:33:47 +02:00
2023-09-26 16:23:26 +02:00
2021-05-19 17:09:27 +02:00
/ * *
* WordPress dependencies
* /
2020-06-26 15:33:47 +02:00
2021-05-19 17:09:27 +02:00
2023-06-28 09:04:13 +02:00
const EMPTY _ARRAY = [ ] ;
const EMPTY _OBJECT = { } ;
2023-09-26 16:23:26 +02:00
const EMPTY _INSERTION _POINT = {
rootClientId : undefined ,
insertionIndex : undefined ,
filterValue : undefined
} ;
2021-05-07 13:48:27 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Returns the current editing mode .
*
* @ param { Object } state Global application state .
*
* @ return { string } Editing mode .
2021-05-07 13:48:27 +02:00
* /
2023-06-28 09:04:13 +02:00
const getEditorMode = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( select => ( ) => {
var _select$get ;
return ( _select$get = select ( external _wp _preferences _namespaceObject . store ) . get ( 'core/edit-post' , 'editorMode' ) ) !== null && _select$get !== void 0 ? _select$get : 'visual' ;
} ) ;
2023-09-26 16:23:26 +02:00
2021-05-07 13:48:27 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Returns true if the editor sidebar is opened .
*
* @ param { Object } state Global application state
*
* @ return { boolean } Whether the editor sidebar is opened .
2021-05-07 13:48:27 +02:00
* /
2023-06-28 09:04:13 +02:00
const isEditorSidebarOpened = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( select => ( ) => {
const activeGeneralSidebar = select ( store ) . getActiveComplementaryArea ( 'core/edit-post' ) ;
return [ 'edit-post/document' , 'edit-post/block' ] . includes ( activeGeneralSidebar ) ;
} ) ;
2023-09-26 16:23:26 +02:00
2021-05-07 13:48:27 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Returns true if the plugin sidebar is opened .
*
* @ param { Object } state Global application state .
*
* @ return { boolean } Whether the plugin sidebar is opened .
2021-05-07 13:48:27 +02:00
* /
2023-06-28 09:04:13 +02:00
const isPluginSidebarOpened = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( select => ( ) => {
const activeGeneralSidebar = select ( store ) . getActiveComplementaryArea ( 'core/edit-post' ) ;
return ! ! activeGeneralSidebar && ! [ 'edit-post/document' , 'edit-post/block' ] . includes ( activeGeneralSidebar ) ;
} ) ;
2023-09-26 16:23:26 +02:00
2021-05-07 13:48:27 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Returns the current active general sidebar name , or null if there is no
* general sidebar active . The active general sidebar is a unique name to
* identify either an editor or plugin sidebar .
*
* Examples :
*
* - ` edit-post/document `
* - ` my-plugin/insert-image-sidebar `
*
* @ param { Object } state Global application state .
*
* @ return { ? string } Active general sidebar name .
2021-05-07 13:48:27 +02:00
* /
2023-06-28 09:04:13 +02:00
const getActiveGeneralSidebarName = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( select => ( ) => {
return select ( store ) . getActiveComplementaryArea ( 'core/edit-post' ) ;
2021-05-19 17:09:27 +02:00
} ) ;
2023-09-26 16:23:26 +02:00
2020-06-26 15:33:47 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Converts panels from the new preferences store format to the old format
* that the post editor previously used .
*
* The resultant converted data should look like this :
* {
* panelName : {
* enabled : false ,
* opened : true ,
* } ,
* anotherPanelName : {
* opened : true
* } ,
* }
*
* @ param { string [ ] | undefined } inactivePanels An array of inactive panel names .
* @ param { string [ ] | undefined } openPanels An array of open panel names .
*
* @ return { Object } The converted panel data .
2021-05-07 13:48:27 +02:00
* /
2023-06-28 09:04:13 +02:00
function convertPanelsToOldFormat ( inactivePanels , openPanels ) {
var _ref ;
// First reduce the inactive panels.
2023-09-26 16:23:26 +02:00
const panelsWithEnabledState = inactivePanels ? . reduce ( ( accumulatedPanels , panelName ) => ( {
... accumulatedPanels ,
2023-06-28 09:04:13 +02:00
[ panelName ] : {
enabled : false
}
2023-09-26 16:23:26 +02:00
} ) , { } ) ;
// Then reduce the open panels, passing in the result of the previous
2023-06-28 09:04:13 +02:00
// reduction as the initial value so that both open and inactive
// panel state is combined.
const panels = openPanels ? . reduce ( ( accumulatedPanels , panelName ) => {
const currentPanelState = accumulatedPanels ? . [ panelName ] ;
2023-09-26 16:23:26 +02:00
return {
... accumulatedPanels ,
[ panelName ] : {
... currentPanelState ,
2023-06-28 09:04:13 +02:00
opened : true
}
} ;
2023-09-26 16:23:26 +02:00
} , panelsWithEnabledState !== null && panelsWithEnabledState !== void 0 ? panelsWithEnabledState : { } ) ;
// The panels variable will only be set if openPanels wasn't `undefined`.
2023-06-28 09:04:13 +02:00
// If it isn't set just return `panelsWithEnabledState`, and if that isn't
// set return an empty object.
return ( _ref = panels !== null && panels !== void 0 ? panels : panelsWithEnabledState ) !== null && _ref !== void 0 ? _ref : EMPTY _OBJECT ;
}
2023-09-26 16:23:26 +02:00
2020-06-26 15:33:47 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Returns the preferences ( these preferences are persisted locally ) .
*
* @ param { Object } state Global application state .
*
* @ return { Object } Preferences Object .
2020-06-26 15:33:47 +02:00
* /
2023-06-28 09:04:13 +02:00
const getPreferences = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( select => ( ) => {
external _wp _deprecated _default ( ) ( ` select( 'core/edit-post' ).getPreferences ` , {
since : '6.0' ,
alternative : ` select( 'core/preferences' ).get `
2023-09-26 16:23:26 +02:00
} ) ;
// These preferences now exist in the preferences store.
2023-06-28 09:04:13 +02:00
// Fetch them so that they can be merged into the post
// editor preferences.
const preferences = [ 'hiddenBlockTypes' , 'editorMode' , 'preferredStyleVariations' ] . reduce ( ( accumulatedPrefs , preferenceKey ) => {
const value = select ( external _wp _preferences _namespaceObject . store ) . get ( 'core/edit-post' , preferenceKey ) ;
2023-09-26 16:23:26 +02:00
return {
... accumulatedPrefs ,
2023-06-28 09:04:13 +02:00
[ preferenceKey ] : value
} ;
2023-09-26 16:23:26 +02:00
} , { } ) ;
// Panels were a preference, but the data structure changed when the state
2023-06-28 09:04:13 +02:00
// was migrated to the preferences store. They need to be converted from
// the new preferences store format to old format to ensure no breaking
// changes for plugins.
const inactivePanels = select ( external _wp _preferences _namespaceObject . store ) . get ( 'core/edit-post' , 'inactivePanels' ) ;
const openPanels = select ( external _wp _preferences _namespaceObject . store ) . get ( 'core/edit-post' , 'openPanels' ) ;
const panels = convertPanelsToOldFormat ( inactivePanels , openPanels ) ;
2023-09-26 16:23:26 +02:00
return {
... preferences ,
2023-06-28 09:04:13 +02:00
panels
} ;
} ) ;
2023-09-26 16:23:26 +02:00
2022-04-11 14:04:30 +02:00
/ * *
2023-06-28 09:04:13 +02:00
*
* @ param { Object } state Global application state .
* @ param { string } preferenceKey Preference Key .
* @ param { * } defaultValue Default Value .
*
* @ return { * } Preference Value .
2022-04-11 14:04:30 +02:00
* /
2023-06-28 09:04:13 +02:00
function getPreference ( state , preferenceKey , defaultValue ) {
external _wp _deprecated _default ( ) ( ` select( 'core/edit-post' ).getPreference ` , {
since : '6.0' ,
alternative : ` select( 'core/preferences' ).get `
2023-09-26 16:23:26 +02:00
} ) ;
2021-05-07 13:48:27 +02:00
2023-09-26 16:23:26 +02:00
// Avoid using the `getPreferences` registry selector where possible.
2023-06-28 09:04:13 +02:00
const preferences = getPreferences ( state ) ;
const value = preferences [ preferenceKey ] ;
return value === undefined ? defaultValue : value ;
}
2023-09-26 16:23:26 +02:00
2023-06-28 09:04:13 +02:00
/ * *
* Returns an array of blocks that are hidden .
*
* @ return { Array } A list of the hidden block types
* /
const getHiddenBlockTypes = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( select => ( ) => {
var _select$get2 ;
return ( _select$get2 = select ( external _wp _preferences _namespaceObject . store ) . get ( 'core/edit-post' , 'hiddenBlockTypes' ) ) !== null && _select$get2 !== void 0 ? _select$get2 : EMPTY _ARRAY ;
} ) ;
2023-09-26 16:23:26 +02:00
2021-05-07 13:48:27 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Returns true if the publish sidebar is opened .
*
* @ param { Object } state Global application state
*
* @ return { boolean } Whether the publish sidebar is open .
2021-05-07 13:48:27 +02:00
* /
2023-06-28 09:04:13 +02:00
function isPublishSidebarOpened ( state ) {
return state . publishSidebarActive ;
}
2023-09-26 16:23:26 +02:00
2021-05-07 13:48:27 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Returns true if the given panel was programmatically removed , or false otherwise .
* All panels are not removed by default .
*
* @ param { Object } state Global application state .
* @ param { string } panelName A string that identifies the panel .
*
* @ return { boolean } Whether or not the panel is removed .
2021-05-07 13:48:27 +02:00
* /
2023-06-28 09:04:13 +02:00
function isEditorPanelRemoved ( state , panelName ) {
return state . removedPanels . includes ( panelName ) ;
}
2023-09-26 16:23:26 +02:00
2023-06-28 09:04:13 +02:00
/ * *
* Returns true if the given panel is enabled , or false otherwise . Panels are
* enabled by default .
*
* @ param { Object } state Global application state .
* @ param { string } panelName A string that identifies the panel .
*
* @ return { boolean } Whether or not the panel is enabled .
* /
const isEditorPanelEnabled = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( select => ( state , panelName ) => {
const inactivePanels = select ( external _wp _preferences _namespaceObject . store ) . get ( 'core/edit-post' , 'inactivePanels' ) ;
return ! isEditorPanelRemoved ( state , panelName ) && ! inactivePanels ? . includes ( panelName ) ;
} ) ;
2023-09-26 16:23:26 +02:00
2021-05-07 13:48:27 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Returns true if the given panel is open , or false otherwise . Panels are
* closed by default .
*
* @ param { Object } state Global application state .
* @ param { string } panelName A string that identifies the panel .
*
* @ return { boolean } Whether or not the panel is open .
2021-05-07 13:48:27 +02:00
* /
2023-06-28 09:04:13 +02:00
const isEditorPanelOpened = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( select => ( state , panelName ) => {
const openPanels = select ( external _wp _preferences _namespaceObject . store ) . get ( 'core/edit-post' , 'openPanels' ) ;
return ! ! openPanels ? . includes ( panelName ) ;
} ) ;
2023-09-26 16:23:26 +02:00
2023-06-28 09:04:13 +02:00
/ * *
* Returns true if a modal is active , or false otherwise .
*
* @ deprecated since WP 6.3 use ` core/interface ` store ' s selector with the same name instead .
*
* @ param { Object } state Global application state .
* @ param { string } modalName A string that uniquely identifies the modal .
*
* @ return { boolean } Whether the modal is active .
* /
const selectors _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 ( store ) . isModalActive ( modalName ) ;
} ) ;
2023-09-26 16:23:26 +02:00
2023-06-28 09:04:13 +02:00
/ * *
* Returns whether the given feature is enabled or not .
*
* @ param { Object } state Global application state .
* @ param { string } feature Feature slug .
*
* @ return { boolean } Is active .
* /
const selectors _isFeatureActive = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( select => ( state , feature ) => {
return ! ! select ( external _wp _preferences _namespaceObject . store ) . get ( 'core/edit-post' , feature ) ;
} ) ;
2023-09-26 16:23:26 +02:00
2023-06-28 09:04:13 +02:00
/ * *
* Returns true if the plugin item is pinned to the header .
* When the value is not set it defaults to true .
*
* @ param { Object } state Global application state .
* @ param { string } pluginName Plugin item name .
*
* @ return { boolean } Whether the plugin item is pinned .
* /
const isPluginItemPinned = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( select => ( state , pluginName ) => {
return select ( store ) . isItemPinned ( 'core/edit-post' , pluginName ) ;
} ) ;
2023-09-26 16:23:26 +02:00
2023-06-28 09:04:13 +02:00
/ * *
* Returns an array of active meta box locations .
*
* @ param { Object } state Post editor state .
*
* @ return { string [ ] } Active meta box locations .
* /
const getActiveMetaBoxLocations = rememo ( state => {
return Object . keys ( state . metaBoxes . locations ) . filter ( location => isMetaBoxLocationActive ( state , location ) ) ;
} , state => [ state . metaBoxes . locations ] ) ;
2023-09-26 16:23:26 +02:00
2023-06-28 09:04:13 +02:00
/ * *
* Returns true if a metabox location is active and visible
*
* @ param { Object } state Post editor state .
* @ param { string } location Meta box location to test .
*
* @ return { boolean } Whether the meta box location is active and visible .
* /
function isMetaBoxLocationVisible ( state , location ) {
return isMetaBoxLocationActive ( state , location ) && getMetaBoxesPerLocation ( state , location ) ? . some ( ( {
id
} ) => {
return isEditorPanelEnabled ( state , ` meta-box- ${ id } ` ) ;
} ) ;
2021-05-19 17:09:27 +02:00
}
2023-09-26 16:23:26 +02:00
2022-10-04 17:06:52 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Returns true if there is an active meta box in the given location , or false
* otherwise .
2022-10-04 17:06:52 +02:00
*
2023-06-28 09:04:13 +02:00
* @ param { Object } state Post editor state .
* @ param { string } location Meta box location to test .
2022-10-04 17:06:52 +02:00
*
2023-06-28 09:04:13 +02:00
* @ return { boolean } Whether the meta box location is active .
2022-10-04 17:06:52 +02:00
* /
2023-06-28 09:04:13 +02:00
function isMetaBoxLocationActive ( state , location ) {
const metaBoxes = getMetaBoxesPerLocation ( state , location ) ;
return ! ! metaBoxes && metaBoxes . length !== 0 ;
2022-10-04 17:06:52 +02:00
}
2023-09-26 16:23:26 +02:00
2023-06-28 09:04:13 +02:00
/ * *
* Returns the list of all the available meta boxes for a given location .
*
* @ param { Object } state Global application state .
* @ param { string } location Meta box location to test .
*
* @ return { ? Array } List of meta boxes .
* /
function getMetaBoxesPerLocation ( state , location ) {
return state . metaBoxes . locations [ location ] ;
}
2023-09-26 16:23:26 +02:00
2023-06-28 09:04:13 +02:00
/ * *
* Returns the list of all the available meta boxes .
*
* @ param { Object } state Global application state .
*
* @ return { Array } List of meta boxes .
* /
const getAllMetaBoxes = rememo ( state => {
return Object . values ( state . metaBoxes . locations ) . flat ( ) ;
} , state => [ state . metaBoxes . locations ] ) ;
2023-09-26 16:23:26 +02:00
2023-06-28 09:04:13 +02:00
/ * *
* Returns true if the post is using Meta Boxes
*
* @ param { Object } state Global application state
*
* @ return { boolean } Whether there are metaboxes or not .
* /
function hasMetaBoxes ( state ) {
return getActiveMetaBoxLocations ( state ) . length > 0 ;
}
2023-09-26 16:23:26 +02:00
2023-06-28 09:04:13 +02:00
/ * *
* Returns true if the Meta Boxes are being saved .
*
* @ param { Object } state Global application state .
*
* @ return { boolean } Whether the metaboxes are being saved .
* /
function selectors _isSavingMetaBoxes ( state ) {
return state . metaBoxes . isSaving ;
}
2023-09-26 16:23:26 +02:00
2023-06-28 09:04:13 +02:00
/ * *
* Returns the current editing canvas device type .
*
* @ param { Object } state Global application state .
*
* @ return { string } Device type .
* /
function _ _experimentalGetPreviewDeviceType ( state ) {
return state . deviceType ;
}
2023-09-26 16:23:26 +02:00
2023-06-28 09:04:13 +02:00
/ * *
* Returns true if the inserter is opened .
*
* @ param { Object } state Global application state .
*
* @ return { boolean } Whether the inserter is opened .
* /
function isInserterOpened ( state ) {
return ! ! state . blockInserterPanel ;
}
2023-09-26 16:23:26 +02:00
2023-06-28 09:04:13 +02:00
/ * *
* Get the insertion point for the inserter .
*
* @ param { Object } state Global application state .
*
* @ return { Object } The root client ID , index to insert at and starting filter value .
* /
function _ _experimentalGetInsertionPoint ( state ) {
2023-09-26 16:23:26 +02:00
if ( typeof state . blockInserterPanel === 'boolean' ) {
return EMPTY _INSERTION _POINT ;
}
return state . blockInserterPanel ;
2023-06-28 09:04:13 +02:00
}
2023-09-26 16:23:26 +02:00
2023-06-28 09:04:13 +02:00
/ * *
* Returns true if the list view is opened .
*
* @ param { Object } state Global application state .
*
* @ return { boolean } Whether the list view is opened .
* /
function isListViewOpened ( state ) {
return state . listViewPanel ;
}
2023-09-26 16:23:26 +02:00
2023-06-28 09:04:13 +02:00
/ * *
* Returns true if the template editing mode is enabled .
*
* @ param { Object } state Global application state .
*
* @ return { boolean } Whether we ' re editing the template .
* /
function selectors _isEditingTemplate ( state ) {
return state . isEditingTemplate ;
}
2023-09-26 16:23:26 +02:00
2023-06-28 09:04:13 +02:00
/ * *
* Returns true if meta boxes are initialized .
*
* @ param { Object } state Global application state .
*
* @ return { boolean } Whether meta boxes are initialized .
* /
function areMetaBoxesInitialized ( state ) {
return state . metaBoxes . initialized ;
}
2023-09-26 16:23:26 +02:00
2023-06-28 09:04:13 +02:00
/ * *
* Retrieves the template of the currently edited post .
*
* @ return { Object ? } Post Template .
* /
const getEditedPostTemplate = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( select => ( ) => {
const currentTemplate = select ( external _wp _editor _namespaceObject . store ) . getEditedPostAttribute ( 'template' ) ;
if ( currentTemplate ) {
const templateWithSameSlug = select ( external _wp _coreData _namespaceObject . store ) . getEntityRecords ( 'postType' , 'wp_template' , {
per _page : - 1
} ) ? . find ( template => template . slug === currentTemplate ) ;
if ( ! templateWithSameSlug ) {
return templateWithSameSlug ;
}
return select ( external _wp _coreData _namespaceObject . store ) . getEditedEntityRecord ( 'postType' , 'wp_template' , templateWithSameSlug . id ) ;
2021-05-19 17:09:27 +02:00
}
2023-06-28 09:04:13 +02:00
const post = select ( external _wp _editor _namespaceObject . store ) . getCurrentPost ( ) ;
if ( post . link ) {
return select ( external _wp _coreData _namespaceObject . store ) . _ _experimentalGetTemplateForLink ( post . link ) ;
2021-05-19 17:09:27 +02:00
}
2023-06-28 09:04:13 +02:00
return null ;
} ) ;
2022-10-04 17:06:52 +02:00
2023-06-28 09:04:13 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/store/constants.js
/ * *
* The identifier for the data store .
*
* @ type { string }
* /
const constants _STORE _NAME = 'core/edit-post' ;
2023-09-26 16:23:26 +02:00
2023-06-28 09:04:13 +02:00
/ * *
* CSS selector string for the admin bar view post link anchor tag .
*
* @ type { string }
* /
const VIEW _AS _LINK _SELECTOR = '#wp-admin-bar-view a' ;
2023-09-26 16:23:26 +02:00
2023-06-28 09:04:13 +02:00
/ * *
* CSS selector string for the admin bar preview post link anchor tag .
*
* @ type { string }
* /
const VIEW _AS _PREVIEW _LINK _SELECTOR = '#wp-admin-bar-preview a' ;
2022-09-20 17:43:29 +02:00
2023-06-28 09:04:13 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/store/index.js
/ * *
* WordPress dependencies
* /
2023-06-27 16:24:19 +02:00
2023-09-26 16:23:26 +02:00
2023-06-28 09:04:13 +02:00
/ * *
* Internal dependencies
* /
2023-06-27 16:24:19 +02:00
2022-10-04 17:06:52 +02:00
2023-06-28 09:04:13 +02:00
/ * *
* Store definition for the edit post namespace .
*
* @ see https : //github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
*
* @ type { Object }
* /
const store _store = ( 0 , external _wp _data _namespaceObject . createReduxStore ) ( constants _STORE _NAME , {
reducer : store _reducer ,
actions : store _actions _namespaceObject ,
selectors : store _selectors _namespaceObject
} ) ;
( 0 , external _wp _data _namespaceObject . register ) ( store _store ) ;
2023-06-27 16:24:19 +02:00
2023-06-28 09:04:13 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/plugins/welcome-guide-menu-item/index.js
/ * *
* WordPress dependencies
* /
2023-09-26 16:23:26 +02:00
2023-06-28 09:04:13 +02:00
/ * *
* Internal dependencies
* /
function WelcomeGuideMenuItem ( ) {
const isTemplateMode = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => select ( store _store ) . isEditingTemplate ( ) , [ ] ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _preferences _namespaceObject . PreferenceToggleMenuItem , {
scope : "core/edit-post" ,
name : isTemplateMode ? 'welcomeGuideTemplate' : 'welcomeGuide' ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Welcome Guide' )
} ) ;
2021-05-19 17:09:27 +02:00
}
2021-05-07 13:48:27 +02:00
2023-06-28 09:04:13 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/plugins/index.js
/ * *
* WordPress dependencies
* /
2023-07-11 08:59:09 +02:00
2023-09-26 16:23:26 +02:00
2023-06-28 09:04:13 +02:00
/ * *
* Internal dependencies
* /
2023-07-11 08:59:09 +02:00
function ManagePatternsMenuItem ( ) {
const url = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
const {
canUser
} = select ( external _wp _coreData _namespaceObject . store ) ;
const {
getEditorSettings
} = select ( external _wp _editor _namespaceObject . store ) ;
const isBlockTheme = getEditorSettings ( ) . _ _unstableIsBlockBasedTheme ;
const defaultUrl = ( 0 , external _wp _url _namespaceObject . addQueryArgs ) ( 'edit.php' , {
post _type : 'wp_block'
} ) ;
const patternsUrl = ( 0 , external _wp _url _namespaceObject . addQueryArgs ) ( 'site-editor.php' , {
path : '/patterns'
2023-09-26 16:23:26 +02:00
} ) ;
// The site editor and templates both check whether the user has
2023-07-11 08:59:09 +02:00
// edit_theme_options capabilities. We can leverage that here and not
// display the manage patterns link if the user can't access it.
return canUser ( 'read' , 'templates' ) && isBlockTheme ? patternsUrl : defaultUrl ;
} , [ ] ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . MenuItem , {
role : "menuitem" ,
href : url
2023-07-18 09:20:48 +02:00
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Manage patterns' ) ) ;
2023-07-11 08:59:09 +02:00
}
2023-06-28 09:04:13 +02:00
( 0 , external _wp _plugins _namespaceObject . registerPlugin ) ( 'edit-post' , {
render ( ) {
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( tools _more _menu _group , null , ( {
onClose
2023-07-11 08:59:09 +02:00
} ) => ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( ManagePatternsMenuItem , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( keyboard _shortcuts _help _menu _item , {
2023-06-28 09:04:13 +02:00
onSelect : onClose
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( WelcomeGuideMenuItem , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( CopyContentMenuItem , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . MenuItem , {
role : "menuitem" ,
icon : library _external ,
href : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'https://wordpress.org/documentation/article/wordpress-block-editor/' ) ,
target : "_blank" ,
rel : "noopener noreferrer"
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Help' ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . VisuallyHidden , {
as : "span"
2023-09-26 16:23:26 +02:00
} , /* translators: accessibility text */
2023-06-28 09:04:13 +02:00
( 0 , external _wp _i18n _namespaceObject . _ _ ) ( '(opens in a new tab)' ) ) ) ) ) ) ;
}
} ) ;
; // CONCATENATED MODULE: external ["wp","commands"]
2023-09-21 15:26:32 +02:00
var external _wp _commands _namespaceObject = window [ "wp" ] [ "commands" ] ;
2023-06-28 09:04:13 +02:00
; // CONCATENATED MODULE: external ["wp","coreCommands"]
2023-09-21 15:26:32 +02:00
var external _wp _coreCommands _namespaceObject = window [ "wp" ] [ "coreCommands" ] ;
2023-06-28 09:04:13 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/text-editor/index.js
2021-05-07 13:48:27 +02:00
/ * *
* WordPress dependencies
* /
2021-05-21 12:14:23 +02:00
2023-09-26 16:23:26 +02:00
2021-05-07 13:48:27 +02:00
/ * *
* Internal dependencies
* /
2023-06-28 09:04:13 +02:00
function TextEditor ( ) {
const isRichEditingEnabled = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
return select ( external _wp _editor _namespaceObject . store ) . getEditorSettings ( ) . richEditingEnabled ;
2021-05-19 17:09:27 +02:00
} , [ ] ) ;
2023-02-07 08:04:52 +01:00
const {
2023-06-28 09:04:13 +02:00
switchEditorMode
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
2023-06-28 09:04:13 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "edit-post-text-editor"
2023-09-26 16:23:26 +02:00
} , isRichEditingEnabled && ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
2023-06-28 09:04:13 +02:00
className : "edit-post-text-editor__toolbar"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( "h2" , null , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Editing code' ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
variant : "tertiary" ,
onClick : ( ) => switchEditorMode ( 'visual' ) ,
shortcut : external _wp _keycodes _namespaceObject . displayShortcut . secondary ( 'm' )
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Exit code editor' ) ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "edit-post-text-editor__body"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostTitle , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostTextEditor , null ) ) ) ;
}
2023-02-07 08:04:52 +01:00
2023-06-28 09:04:13 +02:00
; // CONCATENATED MODULE: external ["wp","privateApis"]
2023-09-21 15:26:32 +02:00
var external _wp _privateApis _namespaceObject = window [ "wp" ] [ "privateApis" ] ;
2023-06-28 09:04:13 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/lock-unlock.js
/ * *
* WordPress dependencies
* /
2023-02-07 08:04:52 +01:00
2023-06-28 09:04:13 +02:00
const {
lock ,
unlock
Editor: Update npm packages ahead of 6.4 RC1.
Updates the npm packages and code for:
* [https://github.com/WordPress/gutenberg/pull/55121 List: fix forward merging of nested list]
* [https://github.com/WordPress/gutenberg/pull/55182 Update consent string for using private APIs.]
* [https://github.com/WordPress/gutenberg/pull/55204 useBlockSettings: add missing useMemo dependencies]
* [https://github.com/WordPress/gutenberg/pull/55120 Remove the lightbox filter and view file when the lightbox setting is disabled.]
* [https://github.com/WordPress/gutenberg/pull/55245 Patterns: Remove the version enforcement for npm in engines field]
* [https://github.com/WordPress/gutenberg/pull/55237 Remove `@return void` from PHP function docs]
* [https://github.com/WordPress/gutenberg/pull/55141 Image: Disable lightbox editor UI for linked images]
* [https://github.com/WordPress/gutenberg/pull/55269 Image: Stop crashing with Lightbox on image blocks without an image]
* [https://github.com/WordPress/gutenberg/pull/55021 Update fullscreen icon]
* [https://github.com/WordPress/gutenberg/pull/55217 Template Part block: Fall back to current theme if no theme attribute is given.] This change is part of fix for a performance regression re-introduced by [56818].
References:
* [https://github.com/WordPress/gutenberg/pull/55298 Gutenberg PR 55298] Cherry-pick commits
Follow-up to [56818], [56816].
Props ellatrix, peterwilsoncc, jsnajdr, afercia, gziolo, isabel_brison, artemiosans, richtabor, bernhard-reiter, flixos90, mikachan, spacedmonkey, hellofromTonya.
See #59583, #59411.
Built from https://develop.svn.wordpress.org/trunk@56849
git-svn-id: http://core.svn.wordpress.org/trunk@56361 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-12 15:58:15 +02:00
} = ( 0 , external _wp _privateApis _namespaceObject . _ _dangerousOptInToUnstableAPIsOnlyForCoreModules ) ( 'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.' , '@wordpress/edit-post' ) ;
2021-05-07 13:48:27 +02:00
2023-06-28 09:04:13 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/visual-editor/index.js
2023-06-27 16:24:19 +02:00
2023-06-28 09:04:13 +02:00
/ * *
* External dependencies
* /
2021-05-07 13:48:27 +02:00
2023-09-26 16:23:26 +02:00
2021-05-07 13:48:27 +02:00
/ * *
* WordPress dependencies
* /
2023-06-28 09:04:13 +02:00
2021-05-07 13:48:27 +02:00
/ * *
2023-06-28 09:04:13 +02:00
* Internal dependencies
2021-05-07 13:48:27 +02:00
* /
2023-06-28 09:04:13 +02:00
const {
LayoutStyle ,
useLayoutClasses ,
2023-09-26 16:23:26 +02:00
useLayoutStyles ,
ExperimentalBlockCanvas : BlockCanvas
2023-06-28 09:04:13 +02:00
} = unlock ( external _wp _blockEditor _namespaceObject . privateApis ) ;
const isGutenbergPlugin = false ? 0 : false ;
/ * *
* Given an array of nested blocks , find the first Post Content
* block inside it , recursing through any nesting levels ,
* and return its attributes .
*
* @ param { Array } blocks A list of blocks .
*
* @ return { Object | undefined } The Post Content block .
* /
function getPostContentAttributes ( blocks ) {
for ( let i = 0 ; i < blocks . length ; i ++ ) {
if ( blocks [ i ] . name === 'core/post-content' ) {
return blocks [ i ] . attributes ;
2021-05-07 13:48:27 +02:00
}
2023-06-28 09:04:13 +02:00
if ( blocks [ i ] . innerBlocks . length ) {
const nestedPostContent = getPostContentAttributes ( blocks [ i ] . innerBlocks ) ;
if ( nestedPostContent ) {
return nestedPostContent ;
}
}
}
2021-05-07 13:48:27 +02:00
}
2023-09-26 16:23:26 +02:00
function checkForPostContentAtRootLevel ( blocks ) {
for ( let i = 0 ; i < blocks . length ; i ++ ) {
if ( blocks [ i ] . name === 'core/post-content' ) {
return true ;
}
}
return false ;
}
function VisualEditor ( {
styles
} ) {
const {
deviceType ,
2023-06-28 09:04:13 +02:00
isWelcomeGuideVisible ,
isTemplateMode ,
postContentAttributes ,
editedPostTemplate = { } ,
wrapperBlockName ,
wrapperUniqueId ,
isBlockBasedTheme ,
hasV3BlocksOnly
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
const {
isFeatureActive ,
isEditingTemplate ,
getEditedPostTemplate ,
_ _experimentalGetPreviewDeviceType
} = select ( store _store ) ;
const {
getCurrentPostId ,
getCurrentPostType ,
getEditorSettings
} = select ( external _wp _editor _namespaceObject . store ) ;
const {
getBlockTypes
} = select ( external _wp _blocks _namespaceObject . store ) ;
const _isTemplateMode = isEditingTemplate ( ) ;
2023-09-26 16:23:26 +02:00
const postTypeSlug = getCurrentPostType ( ) ;
2023-06-28 09:04:13 +02:00
let _wrapperBlockName ;
2023-09-26 16:23:26 +02:00
if ( postTypeSlug === 'wp_block' ) {
2023-06-28 09:04:13 +02:00
_wrapperBlockName = 'core/block' ;
} else if ( ! _isTemplateMode ) {
_wrapperBlockName = 'core/post-content' ;
}
const editorSettings = getEditorSettings ( ) ;
const supportsTemplateMode = editorSettings . supportsTemplateMode ;
2023-09-26 16:23:26 +02:00
const postType = select ( external _wp _coreData _namespaceObject . store ) . getPostType ( postTypeSlug ) ;
2023-06-28 09:04:13 +02:00
const canEditTemplate = select ( external _wp _coreData _namespaceObject . store ) . canUser ( 'create' , 'templates' ) ;
return {
deviceType : _ _experimentalGetPreviewDeviceType ( ) ,
isWelcomeGuideVisible : isFeatureActive ( 'welcomeGuide' ) ,
isTemplateMode : _isTemplateMode ,
postContentAttributes : getEditorSettings ( ) . postContentAttributes ,
// Post template fetch returns a 404 on classic themes, which
// messes with e2e tests, so check it's a block theme first.
2023-09-26 16:23:26 +02:00
editedPostTemplate : postType ? . viewable && supportsTemplateMode && canEditTemplate ? getEditedPostTemplate ( ) : undefined ,
2023-06-28 09:04:13 +02:00
wrapperBlockName : _wrapperBlockName ,
wrapperUniqueId : getCurrentPostId ( ) ,
isBlockBasedTheme : editorSettings . _ _unstableIsBlockBasedTheme ,
hasV3BlocksOnly : getBlockTypes ( ) . every ( type => {
return type . apiVersion >= 3 ;
} )
} ;
} , [ ] ) ;
const {
isCleanNewPost
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( external _wp _editor _namespaceObject . store ) ;
const hasMetaBoxes = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => select ( store _store ) . hasMetaBoxes ( ) , [ ] ) ;
const {
hasRootPaddingAwareAlignments ,
isFocusMode ,
themeHasDisabledLayoutStyles ,
themeSupportsLayout
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
const _settings = select ( external _wp _blockEditor _namespaceObject . store ) . getSettings ( ) ;
return {
themeHasDisabledLayoutStyles : _settings . disableLayoutStyles ,
themeSupportsLayout : _settings . supportsLayout ,
isFocusMode : _settings . focusMode ,
hasRootPaddingAwareAlignments : _settings . _ _experimentalFeatures ? . useRootPaddingAwareAlignments
} ;
} , [ ] ) ;
const desktopCanvasStyles = {
height : '100%' ,
width : '100%' ,
2023-09-26 16:23:26 +02:00
marginLeft : 'auto' ,
marginRight : 'auto' ,
2023-06-28 09:04:13 +02:00
display : 'flex' ,
flexFlow : 'column' ,
// Default background color so that grey
// .edit-post-editor-regions__content color doesn't show through.
background : 'white'
} ;
2023-09-26 16:23:26 +02:00
const templateModeStyles = {
... desktopCanvasStyles ,
2023-06-28 09:04:13 +02:00
borderRadius : '2px 2px 0 0' ,
border : '1px solid #ddd' ,
borderBottom : 0
} ;
const resizedCanvasStyles = ( 0 , external _wp _blockEditor _namespaceObject . _ _experimentalUseResizeCanvas ) ( deviceType , isTemplateMode ) ;
const globalLayoutSettings = ( 0 , external _wp _blockEditor _namespaceObject . useSetting ) ( 'layout' ) ;
const previewMode = 'is-' + deviceType . toLowerCase ( ) + '-preview' ;
let animatedStyles = isTemplateMode ? templateModeStyles : desktopCanvasStyles ;
if ( resizedCanvasStyles ) {
animatedStyles = resizedCanvasStyles ;
}
2023-09-26 16:23:26 +02:00
let paddingBottom ;
2021-05-07 13:48:27 +02:00
2023-09-26 16:23:26 +02:00
// Add a constant padding for the typewritter effect. When typing at the
2023-06-28 09:04:13 +02:00
// bottom, there needs to be room to scroll up.
if ( ! hasMetaBoxes && ! resizedCanvasStyles && ! isTemplateMode ) {
paddingBottom = '40vh' ;
}
const ref = ( 0 , external _wp _element _namespaceObject . useRef ) ( ) ;
2023-09-26 16:23:26 +02:00
const contentRef = ( 0 , external _wp _compose _namespaceObject . useMergeRefs ) ( [ ref , ( 0 , external _wp _blockEditor _namespaceObject . _ _unstableUseTypewriter ) ( ) ] ) ;
2021-05-07 13:48:27 +02:00
2023-09-26 16:23:26 +02:00
// fallbackLayout is used if there is no Post Content,
// and for Post Title.
2023-06-28 09:04:13 +02:00
const fallbackLayout = ( 0 , external _wp _element _namespaceObject . useMemo ) ( ( ) => {
if ( isTemplateMode ) {
return {
type : 'default'
} ;
}
if ( themeSupportsLayout ) {
// We need to ensure support for wide and full alignments,
// so we add the constrained type.
2023-09-26 16:23:26 +02:00
return {
... globalLayoutSettings ,
2023-06-28 09:04:13 +02:00
type : 'constrained'
} ;
2023-09-26 16:23:26 +02:00
}
// Set default layout for classic themes so all alignments are supported.
2021-05-19 17:09:27 +02:00
return {
2023-06-28 09:04:13 +02:00
type : 'default'
2021-05-19 17:09:27 +02:00
} ;
2023-06-28 09:04:13 +02:00
} , [ isTemplateMode , themeSupportsLayout , globalLayoutSettings ] ) ;
const newestPostContentAttributes = ( 0 , external _wp _element _namespaceObject . useMemo ) ( ( ) => {
if ( ! editedPostTemplate ? . content && ! editedPostTemplate ? . blocks ) {
return postContentAttributes ;
2023-09-26 16:23:26 +02:00
}
// When in template editing mode, we can access the blocks directly.
2023-06-28 09:04:13 +02:00
if ( editedPostTemplate ? . blocks ) {
return getPostContentAttributes ( editedPostTemplate ? . blocks ) ;
2023-09-26 16:23:26 +02:00
}
// If there are no blocks, we have to parse the content string.
2023-06-28 09:04:13 +02:00
// Best double-check it's a string otherwise the parse function gets unhappy.
const parseableContent = typeof editedPostTemplate ? . content === 'string' ? editedPostTemplate ? . content : '' ;
return getPostContentAttributes ( ( 0 , external _wp _blocks _namespaceObject . parse ) ( parseableContent ) ) || { } ;
} , [ editedPostTemplate ? . content , editedPostTemplate ? . blocks , postContentAttributes ] ) ;
2023-09-26 16:23:26 +02:00
const hasPostContentAtRootLevel = ( 0 , external _wp _element _namespaceObject . useMemo ) ( ( ) => {
if ( ! editedPostTemplate ? . content && ! editedPostTemplate ? . blocks ) {
return false ;
}
// When in template editing mode, we can access the blocks directly.
if ( editedPostTemplate ? . blocks ) {
return checkForPostContentAtRootLevel ( editedPostTemplate ? . blocks ) ;
}
// If there are no blocks, we have to parse the content string.
// Best double-check it's a string otherwise the parse function gets unhappy.
const parseableContent = typeof editedPostTemplate ? . content === 'string' ? editedPostTemplate ? . content : '' ;
return checkForPostContentAtRootLevel ( ( 0 , external _wp _blocks _namespaceObject . parse ) ( parseableContent ) ) || false ;
} , [ editedPostTemplate ? . content , editedPostTemplate ? . blocks ] ) ;
2023-06-28 09:04:13 +02:00
const {
layout = { } ,
align = ''
} = newestPostContentAttributes || { } ;
const postContentLayoutClasses = useLayoutClasses ( newestPostContentAttributes , 'core/post-content' ) ;
const blockListLayoutClass = classnames _default ( ) ( {
'is-layout-flow' : ! themeSupportsLayout
} , themeSupportsLayout && postContentLayoutClasses , align && ` align ${ align } ` ) ;
2023-09-26 16:23:26 +02:00
const postContentLayoutStyles = useLayoutStyles ( newestPostContentAttributes , 'core/post-content' , '.block-editor-block-list__layout.is-root-container' ) ;
2023-06-28 09:04:13 +02:00
2023-09-26 16:23:26 +02:00
// Update type for blocks using legacy layouts.
2023-06-28 09:04:13 +02:00
const postContentLayout = ( 0 , external _wp _element _namespaceObject . useMemo ) ( ( ) => {
2023-09-26 16:23:26 +02:00
return layout && ( layout ? . type === 'constrained' || layout ? . inherit || layout ? . contentSize || layout ? . wideSize ) ? {
... globalLayoutSettings ,
2023-06-28 09:04:13 +02:00
... layout ,
type : 'constrained'
2023-09-26 16:23:26 +02:00
} : {
... globalLayoutSettings ,
2023-06-28 09:04:13 +02:00
... layout ,
type : 'default'
} ;
2023-09-26 16:23:26 +02:00
} , [ layout ? . type , layout ? . inherit , layout ? . contentSize , layout ? . wideSize , globalLayoutSettings ] ) ;
2021-05-07 13:48:27 +02:00
2023-09-26 16:23:26 +02:00
// If there is a Post Content block we use its layout for the block list;
// if not, this must be a classic theme, in which case we use the fallback layout.
2023-06-28 09:04:13 +02:00
const blockListLayout = postContentAttributes ? postContentLayout : fallbackLayout ;
2023-09-26 16:23:26 +02:00
const postEditorLayout = blockListLayout ? . type === 'default' && ! hasPostContentAtRootLevel ? fallbackLayout : blockListLayout ;
const observeTypingRef = ( 0 , external _wp _blockEditor _namespaceObject . _ _unstableUseTypingObserver ) ( ) ;
2023-06-28 09:04:13 +02:00
const titleRef = ( 0 , external _wp _element _namespaceObject . useRef ) ( ) ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
if ( isWelcomeGuideVisible || ! isCleanNewPost ( ) ) {
return ;
}
titleRef ? . current ? . focus ( ) ;
} , [ isWelcomeGuideVisible , isCleanNewPost ] ) ;
styles = ( 0 , external _wp _element _namespaceObject . useMemo ) ( ( ) => [ ... styles , {
// We should move this in to future to the body.
css : ` .edit-post-visual-editor__post-title-wrapper{margin-top:4rem} ` + ( paddingBottom ? ` body{padding-bottom: ${ paddingBottom } } ` : '' )
2023-09-26 16:23:26 +02:00
} ] , [ styles ] ) ;
2023-06-28 09:04:13 +02:00
2023-09-26 16:23:26 +02:00
// Add some styles for alignwide/alignfull Post Content and its children.
2023-06-28 09:04:13 +02:00
const alignCSS = ` .is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;}
. is - root - container . alignwide : where ( . is - layout - flow ) > : not ( . alignleft ) : not ( . alignright ) { max - width : var ( -- wp -- style -- global -- wide - size ) ; }
. is - root - container . alignfull { max - width : none ; margin - left : auto ; margin - right : auto ; }
. is - root - container . alignfull : where ( . is - layout - flow ) > : not ( . alignleft ) : not ( . alignright ) { max - width : none ; } ` ;
2023-09-06 05:19:44 +02:00
const isToBeIframed = ( hasV3BlocksOnly || isGutenbergPlugin && isBlockBasedTheme ) && ! hasMetaBoxes || isTemplateMode || deviceType === 'Tablet' || deviceType === 'Mobile' ;
2023-06-28 09:04:13 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . BlockTools , {
_ _unstableContentRef : ref ,
className : classnames _default ( ) ( 'edit-post-visual-editor' , {
2023-09-06 05:19:44 +02:00
'is-template-mode' : isTemplateMode ,
'has-inline-canvas' : ! isToBeIframed
2023-06-28 09:04:13 +02:00
} )
2023-09-26 16:23:26 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _unstableMotion . div , {
2023-06-28 09:04:13 +02:00
className : "edit-post-visual-editor__content-area" ,
animate : {
padding : isTemplateMode ? '48px 48px 0' : 0
2023-09-26 16:23:26 +02:00
}
2023-06-28 09:04:13 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _unstableMotion . div , {
animate : animatedStyles ,
initial : desktopCanvasStyles ,
className : previewMode
2023-09-26 16:23:26 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( BlockCanvas , {
2023-09-06 05:19:44 +02:00
shouldIframe : isToBeIframed ,
2023-06-28 09:04:13 +02:00
contentRef : contentRef ,
2023-09-26 16:23:26 +02:00
styles : styles ,
height : "100%"
2023-06-28 09:04:13 +02:00
} , themeSupportsLayout && ! themeHasDisabledLayoutStyles && ! isTemplateMode && ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( LayoutStyle , {
selector : ".edit-post-visual-editor__post-title-wrapper" ,
layout : fallbackLayout
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( LayoutStyle , {
selector : ".block-editor-block-list__layout.is-root-container" ,
2023-09-26 16:23:26 +02:00
layout : postEditorLayout
2023-06-28 09:04:13 +02:00
} ) , align && ( 0 , external _wp _element _namespaceObject . createElement ) ( LayoutStyle , {
css : alignCSS
} ) , postContentLayoutStyles && ( 0 , external _wp _element _namespaceObject . createElement ) ( LayoutStyle , {
layout : postContentLayout ,
css : postContentLayoutStyles
} ) ) , ! isTemplateMode && ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : classnames _default ( ) ( 'edit-post-visual-editor__post-title-wrapper' , {
'is-focus-mode' : isFocusMode ,
'has-global-padding' : hasRootPaddingAwareAlignments
} ) ,
2023-09-26 16:23:26 +02:00
contentEditable : false ,
ref : observeTypingRef
2023-06-28 09:04:13 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostTitle , {
ref : titleRef
} ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . _ _experimentalRecursionProvider , {
blockName : wrapperBlockName ,
uniqueId : wrapperUniqueId
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . BlockList , {
className : isTemplateMode ? 'wp-site-blocks' : ` ${ blockListLayoutClass } wp-block-post-content ` // Ensure root level blocks receive default/flow blockGap styling rules.
,
2023-09-26 16:23:26 +02:00
2023-06-28 09:04:13 +02:00
layout : blockListLayout
} ) ) ) ) ) ) ;
}
2021-05-07 13:48:27 +02:00
2023-06-28 09:04:13 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/keyboard-shortcuts/index.js
2021-05-07 13:48:27 +02:00
/ * *
2021-05-19 17:09:27 +02:00
* WordPress dependencies
2021-05-07 13:48:27 +02:00
* /
2023-06-28 09:04:13 +02:00
2021-05-07 13:48:27 +02:00
/ * *
2021-05-19 17:09:27 +02:00
* Internal dependencies
2021-05-07 13:48:27 +02:00
* /
2023-06-28 09:04:13 +02:00
function KeyboardShortcuts ( ) {
const {
getBlockSelectionStart
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( external _wp _blockEditor _namespaceObject . store ) ;
const {
getEditorMode ,
isEditorSidebarOpened ,
2023-09-26 16:23:26 +02:00
isListViewOpened
2023-06-28 09:04:13 +02:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( store _store ) ;
const isModeToggleDisabled = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
const {
richEditingEnabled ,
codeEditingEnabled
} = select ( external _wp _editor _namespaceObject . store ) . getEditorSettings ( ) ;
return ! richEditingEnabled || ! codeEditingEnabled ;
} , [ ] ) ;
const {
switchEditorMode ,
openGeneralSidebar ,
closeGeneralSidebar ,
toggleFeature ,
setIsListViewOpened ,
2023-09-26 16:23:26 +02:00
toggleDistractionFree
2023-06-28 09:04:13 +02:00
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
const {
registerShortcut
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _keyboardShortcuts _namespaceObject . store ) ;
const {
replaceBlocks
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _blockEditor _namespaceObject . store ) ;
const {
getBlockName ,
getSelectedBlockClientId ,
getBlockAttributes
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( external _wp _blockEditor _namespaceObject . store ) ;
const handleTextLevelShortcut = ( event , level ) => {
event . preventDefault ( ) ;
const destinationBlockName = level === 0 ? 'core/paragraph' : 'core/heading' ;
const currentClientId = getSelectedBlockClientId ( ) ;
if ( currentClientId === null ) {
return ;
}
const blockName = getBlockName ( currentClientId ) ;
if ( blockName !== 'core/paragraph' && blockName !== 'core/heading' ) {
return ;
}
const attributes = getBlockAttributes ( currentClientId ) ;
const textAlign = blockName === 'core/paragraph' ? 'align' : 'textAlign' ;
const destinationTextAlign = destinationBlockName === 'core/paragraph' ? 'align' : 'textAlign' ;
replaceBlocks ( currentClientId , ( 0 , external _wp _blocks _namespaceObject . createBlock ) ( destinationBlockName , {
level ,
content : attributes . content ,
... {
[ destinationTextAlign ] : attributes [ textAlign ]
}
} ) ) ;
} ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
registerShortcut ( {
name : 'core/edit-post/toggle-mode' ,
category : 'global' ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Switch between visual editor and code editor.' ) ,
2021-05-19 17:09:27 +02:00
keyCombination : {
2023-06-28 09:04:13 +02:00
modifier : 'secondary' ,
character : 'm'
}
} ) ;
registerShortcut ( {
name : 'core/edit-post/toggle-distraction-free' ,
category : 'global' ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Toggle distraction free mode.' ) ,
keyCombination : {
modifier : 'primaryShift' ,
character : '\\'
}
} ) ;
registerShortcut ( {
name : 'core/edit-post/toggle-fullscreen' ,
category : 'global' ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Toggle fullscreen mode.' ) ,
keyCombination : {
modifier : 'secondary' ,
character : 'f'
}
} ) ;
registerShortcut ( {
name : 'core/edit-post/toggle-list-view' ,
category : 'global' ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Open the block list view.' ) ,
keyCombination : {
modifier : 'access' ,
character : 'o'
}
} ) ;
registerShortcut ( {
name : 'core/edit-post/toggle-sidebar' ,
category : 'global' ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Show or hide the Settings sidebar.' ) ,
keyCombination : {
modifier : 'primaryShift' ,
character : ','
}
} ) ;
registerShortcut ( {
name : 'core/edit-post/next-region' ,
category : 'global' ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Navigate to the next part of the editor.' ) ,
keyCombination : {
modifier : 'ctrl' ,
character : '`'
2021-05-19 17:09:27 +02:00
} ,
2023-06-28 09:04:13 +02:00
aliases : [ {
modifier : 'access' ,
character : 'n'
} ]
} ) ;
registerShortcut ( {
name : 'core/edit-post/previous-region' ,
category : 'global' ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Navigate to the previous part of the editor.' ) ,
keyCombination : {
modifier : 'ctrlShift' ,
character : '`'
} ,
aliases : [ {
modifier : 'access' ,
character : 'p'
} , {
modifier : 'ctrlShift' ,
character : '~'
} ]
} ) ;
registerShortcut ( {
name : 'core/edit-post/keyboard-shortcuts' ,
category : 'main' ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Display these keyboard shortcuts.' ) ,
keyCombination : {
modifier : 'access' ,
character : 'h'
}
} ) ;
registerShortcut ( {
name : 'core/edit-post/transform-heading-to-paragraph' ,
category : 'block-library' ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Transform heading to paragraph.' ) ,
keyCombination : {
modifier : 'access' ,
character : ` 0 `
}
} ) ;
[ 1 , 2 , 3 , 4 , 5 , 6 ] . forEach ( level => {
registerShortcut ( {
name : ` core/edit-post/transform-paragraph-to-heading- ${ level } ` ,
category : 'block-library' ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Transform paragraph to heading.' ) ,
keyCombination : {
modifier : 'access' ,
character : ` ${ level } `
}
} ) ;
} ) ;
} , [ ] ) ;
( 0 , external _wp _keyboardShortcuts _namespaceObject . useShortcut ) ( 'core/edit-post/toggle-mode' , ( ) => {
switchEditorMode ( getEditorMode ( ) === 'visual' ? 'text' : 'visual' ) ;
} , {
isDisabled : isModeToggleDisabled
} ) ;
( 0 , external _wp _keyboardShortcuts _namespaceObject . useShortcut ) ( 'core/edit-post/toggle-fullscreen' , ( ) => {
toggleFeature ( 'fullscreenMode' ) ;
} ) ;
( 0 , external _wp _keyboardShortcuts _namespaceObject . useShortcut ) ( 'core/edit-post/toggle-distraction-free' , ( ) => {
toggleDistractionFree ( ) ;
} ) ;
( 0 , external _wp _keyboardShortcuts _namespaceObject . useShortcut ) ( 'core/edit-post/toggle-sidebar' , event => {
// This shortcut has no known clashes, but use preventDefault to prevent any
// obscure shortcuts from triggering.
event . preventDefault ( ) ;
if ( isEditorSidebarOpened ( ) ) {
closeGeneralSidebar ( ) ;
} else {
const sidebarToOpen = getBlockSelectionStart ( ) ? 'edit-post/block' : 'edit-post/document' ;
openGeneralSidebar ( sidebarToOpen ) ;
}
2023-09-26 16:23:26 +02:00
} ) ;
2023-06-28 09:04:13 +02:00
2023-09-26 16:23:26 +02:00
// Only opens the list view. Other functionality for this shortcut happens in the rendered sidebar.
( 0 , external _wp _keyboardShortcuts _namespaceObject . useShortcut ) ( 'core/edit-post/toggle-list-view' , event => {
2023-06-28 09:04:13 +02:00
if ( ! isListViewOpened ( ) ) {
2023-09-26 16:23:26 +02:00
event . preventDefault ( ) ;
2023-06-28 09:04:13 +02:00
setIsListViewOpened ( true ) ;
}
} ) ;
( 0 , external _wp _keyboardShortcuts _namespaceObject . useShortcut ) ( 'core/edit-post/transform-heading-to-paragraph' , event => handleTextLevelShortcut ( event , 0 ) ) ;
[ 1 , 2 , 3 , 4 , 5 , 6 ] . forEach ( level => {
//the loop is based off on a constant therefore
//the hook will execute the same way every time
//eslint-disable-next-line react-hooks/rules-of-hooks
( 0 , external _wp _keyboardShortcuts _namespaceObject . useShortcut ) ( ` core/edit-post/transform-paragraph-to-heading- ${ level } ` , event => handleTextLevelShortcut ( event , level ) ) ;
} ) ;
return null ;
2021-05-19 17:09:27 +02:00
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var keyboard _shortcuts = ( KeyboardShortcuts ) ;
2021-05-07 13:48:27 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/options/enable-custom-fields.js
/ * *
* WordPress dependencies
* /
2023-09-26 16:23:26 +02:00
function submitCustomFieldsForm ( ) {
const customFieldsForm = document . getElementById ( 'toggle-custom-fields-form' ) ;
// Ensure the referrer values is up to update with any
customFieldsForm . querySelector ( '[name="_wp_http_referer"]' ) . setAttribute ( 'value' , ( 0 , external _wp _url _namespaceObject . getPathAndQueryString ) ( window . location . href ) ) ;
customFieldsForm . submit ( ) ;
}
2023-06-27 16:24:19 +02:00
function CustomFieldsConfirmation ( {
willEnable
} ) {
2022-04-11 14:04:30 +02:00
const [ isReloading , setIsReloading ] = ( 0 , external _wp _element _namespaceObject . useState ) ( false ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( "p" , {
className : "edit-post-preferences-modal__custom-fields-confirmation-message"
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'A page reload is required for this change. Make sure your content is saved before reloading.' ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
className : "edit-post-preferences-modal__custom-fields-confirmation-button" ,
variant : "secondary" ,
isBusy : isReloading ,
disabled : isReloading ,
onClick : ( ) => {
setIsReloading ( true ) ;
2023-09-26 16:23:26 +02:00
submitCustomFieldsForm ( ) ;
2022-04-11 14:04:30 +02:00
}
2023-06-27 16:24:19 +02:00
} , willEnable ? ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Show & Reload Page' ) : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Hide & Reload Page' ) ) ) ;
2022-04-11 14:04:30 +02:00
}
2023-06-27 16:24:19 +02:00
function EnableCustomFieldsOption ( {
label ,
areCustomFieldsEnabled
} ) {
2022-04-11 14:04:30 +02:00
const [ isChecked , setIsChecked ] = ( 0 , external _wp _element _namespaceObject . useState ) ( areCustomFieldsEnabled ) ;
2022-04-12 17:12:47 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( preferences _modal _base _option , {
2022-04-11 14:04:30 +02:00
label : label ,
isChecked : isChecked ,
onChange : setIsChecked
} , isChecked !== areCustomFieldsEnabled && ( 0 , external _wp _element _namespaceObject . createElement ) ( CustomFieldsConfirmation , {
willEnable : isChecked
} ) ) ;
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var enable _custom _fields = ( ( 0 , external _wp _data _namespaceObject . withSelect ) ( select => ( {
2022-04-11 14:04:30 +02:00
areCustomFieldsEnabled : ! ! select ( external _wp _editor _namespaceObject . store ) . getEditorSettings ( ) . enableCustomFields
} ) ) ( EnableCustomFieldsOption ) ) ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/options/enable-panel.js
/ * *
* WordPress dependencies
* /
2022-04-12 17:12:47 +02:00
2023-09-26 16:23:26 +02:00
2022-04-11 14:04:30 +02:00
/ * *
* Internal dependencies
* /
2023-09-21 15:26:32 +02:00
/* harmony default export */ var enable _panel = ( ( 0 , external _wp _compose _namespaceObject . compose ) ( ( 0 , external _wp _data _namespaceObject . withSelect ) ( ( select , {
2023-06-27 16:24:19 +02:00
panelName
} ) => {
2022-04-11 14:04:30 +02:00
const {
isEditorPanelEnabled ,
isEditorPanelRemoved
} = select ( store _store ) ;
return {
isRemoved : isEditorPanelRemoved ( panelName ) ,
isChecked : isEditorPanelEnabled ( panelName )
} ;
2023-06-27 16:24:19 +02:00
} ) , ( 0 , external _wp _compose _namespaceObject . ifCondition ) ( ( {
isRemoved
} ) => ! isRemoved ) , ( 0 , external _wp _data _namespaceObject . withDispatch ) ( ( dispatch , {
panelName
} ) => ( {
onChange : ( ) => dispatch ( store _store ) . toggleEditorPanelEnabled ( panelName )
} ) ) ) ( preferences _modal _base _option ) ) ;
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js
/ * *
* WordPress dependencies
* /
2023-09-26 16:23:26 +02:00
2022-04-11 14:04:30 +02:00
/ * *
* Internal dependencies
* /
const {
Fill ,
Slot : enable _plugin _document _setting _panel _Slot
} = ( 0 , external _wp _components _namespaceObject . createSlotFill ) ( 'EnablePluginDocumentSettingPanelOption' ) ;
2023-06-27 16:24:19 +02:00
const EnablePluginDocumentSettingPanelOption = ( {
label ,
panelName
} ) => ( 0 , external _wp _element _namespaceObject . createElement ) ( Fill , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( enable _panel , {
label : label ,
panelName : panelName
} ) ) ;
2022-04-11 14:04:30 +02:00
EnablePluginDocumentSettingPanelOption . Slot = enable _plugin _document _setting _panel _Slot ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var enable _plugin _document _setting _panel = ( EnablePluginDocumentSettingPanelOption ) ;
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/options/enable-publish-sidebar.js
/ * *
* WordPress dependencies
* /
2022-04-12 17:12:47 +02:00
2023-09-21 15:26:32 +02:00
/* harmony default export */ var enable _publish _sidebar = ( ( 0 , external _wp _compose _namespaceObject . compose ) ( ( 0 , external _wp _data _namespaceObject . withSelect ) ( select => ( {
2022-04-11 14:04:30 +02:00
isChecked : select ( external _wp _editor _namespaceObject . store ) . isPublishSidebarEnabled ( )
} ) ) , ( 0 , external _wp _data _namespaceObject . withDispatch ) ( dispatch => {
const {
enablePublishSidebar ,
disablePublishSidebar
} = dispatch ( external _wp _editor _namespaceObject . store ) ;
return {
onChange : isEnabled => isEnabled ? enablePublishSidebar ( ) : disablePublishSidebar ( )
} ;
2023-09-26 16:23:26 +02:00
} ) ,
// In < medium viewports we override this option and always show the publish sidebar.
2022-04-11 14:04:30 +02:00
// See the edit-post's header component for the specific logic.
2022-04-12 17:12:47 +02:00
( 0 , external _wp _viewport _namespaceObject . ifViewportMatches ) ( 'medium' ) ) ( preferences _modal _base _option ) ) ;
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/options/enable-feature.js
/ * *
* WordPress dependencies
* /
2022-04-12 17:12:47 +02:00
2023-09-26 16:23:26 +02:00
2022-04-11 14:04:30 +02:00
/ * *
* Internal dependencies
* /
2023-09-21 15:26:32 +02:00
/* harmony default export */ var enable _feature = ( ( 0 , external _wp _compose _namespaceObject . compose ) ( ( 0 , external _wp _data _namespaceObject . withSelect ) ( ( select , {
2023-06-27 16:24:19 +02:00
featureName
} ) => {
2022-04-11 14:04:30 +02:00
const {
isFeatureActive
} = select ( store _store ) ;
return {
isChecked : isFeatureActive ( featureName )
} ;
2023-06-27 16:24:19 +02:00
} ) , ( 0 , external _wp _data _namespaceObject . withDispatch ) ( ( dispatch , {
featureName ,
onToggle = ( ) => { }
} ) => ( {
onChange : ( ) => {
onToggle ( ) ;
dispatch ( store _store ) . toggleFeature ( featureName ) ;
}
} ) ) ) ( preferences _modal _base _option ) ) ;
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/options/index.js
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/meta-boxes-section.js
/ * *
* WordPress dependencies
* /
2023-09-26 16:23:26 +02:00
2022-04-11 14:04:30 +02:00
/ * *
* Internal dependencies
* /
2023-06-27 16:24:19 +02:00
function MetaBoxesSection ( {
areCustomFieldsRegistered ,
metaBoxes ,
... sectionProps
} ) {
2021-11-08 15:29:21 +01:00
// The 'Custom Fields' meta box is a special case that we handle separately.
2023-06-27 16:24:19 +02:00
const thirdPartyMetaBoxes = metaBoxes . filter ( ( {
id
} ) => id !== 'postcustom' ) ;
2021-11-08 15:29:21 +01:00
if ( ! areCustomFieldsRegistered && thirdPartyMetaBoxes . length === 0 ) {
return null ;
}
2023-09-26 16:23:26 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( preferences _modal _section , {
... sectionProps
2023-06-27 16:24:19 +02:00
} , areCustomFieldsRegistered && ( 0 , external _wp _element _namespaceObject . createElement ) ( enable _custom _fields , {
2022-04-11 14:04:30 +02:00
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Custom fields' )
2023-06-27 16:24:19 +02:00
} ) , thirdPartyMetaBoxes . map ( ( {
id ,
title
} ) => ( 0 , external _wp _element _namespaceObject . createElement ) ( enable _panel , {
key : id ,
label : title ,
panelName : ` meta-box- ${ id } `
} ) ) ) ;
2021-11-08 15:29:21 +01:00
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var meta _boxes _section = ( ( 0 , external _wp _data _namespaceObject . withSelect ) ( select => {
2021-11-08 15:29:21 +01:00
const {
getEditorSettings
2022-04-11 14:04:30 +02:00
} = select ( external _wp _editor _namespaceObject . store ) ;
2021-11-08 15:29:21 +01:00
const {
getAllMetaBoxes
2022-04-11 14:04:30 +02:00
} = select ( store _store ) ;
2021-11-08 15:29:21 +01:00
return {
// This setting should not live in the block editor's store.
areCustomFieldsRegistered : getEditorSettings ( ) . enableCustomFields !== undefined ,
metaBoxes : getAllMetaBoxes ( )
} ;
} ) ( MetaBoxesSection ) ) ;
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/block-manager/checklist.js
2021-05-07 13:48:27 +02:00
/ * *
2021-05-19 17:09:27 +02:00
* WordPress dependencies
2021-05-07 13:48:27 +02:00
* /
2023-06-27 16:24:19 +02:00
function BlockTypesChecklist ( {
blockTypes ,
value ,
onItemChange
} ) {
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( "ul" , {
2021-11-08 15:29:21 +01:00
className : "edit-post-block-manager__checklist"
2022-04-11 14:04:30 +02:00
} , blockTypes . map ( blockType => ( 0 , external _wp _element _namespaceObject . createElement ) ( "li" , {
2021-05-19 17:09:27 +02:00
key : blockType . name ,
2021-11-08 15:29:21 +01:00
className : "edit-post-block-manager__checklist-item"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . CheckboxControl , {
2023-02-07 08:04:52 +01:00
_ _nextHasNoMarginBottom : true ,
label : blockType . title ,
2021-05-19 17:09:27 +02:00
checked : value . includes ( blockType . name ) ,
2023-06-27 16:24:19 +02:00
onChange : ( ... args ) => onItemChange ( blockType . name , ... args )
2023-02-07 08:04:52 +01:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . BlockIcon , {
icon : blockType . icon
2021-05-07 13:48:27 +02:00
} ) ) ) ) ;
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var checklist = ( BlockTypesChecklist ) ;
2021-05-07 13:48:27 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/block-manager/category.js
2021-05-07 13:48:27 +02:00
/ * *
* WordPress dependencies
* /
2023-09-26 16:23:26 +02:00
2021-05-07 13:48:27 +02:00
/ * *
* Internal dependencies
* /
2023-06-27 16:24:19 +02:00
function BlockManagerCategory ( {
title ,
blockTypes
} ) {
2022-04-12 17:12:47 +02:00
const instanceId = ( 0 , external _wp _compose _namespaceObject . useInstanceId ) ( BlockManagerCategory ) ;
2021-05-19 17:09:27 +02:00
const {
2022-04-12 17:12:47 +02:00
defaultAllowedBlockTypes ,
hiddenBlockTypes
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
const {
getEditorSettings
} = select ( external _wp _editor _namespaceObject . store ) ;
const {
getHiddenBlockTypes
} = select ( store _store ) ;
return {
defaultAllowedBlockTypes : getEditorSettings ( ) . defaultAllowedBlockTypes ,
hiddenBlockTypes : getHiddenBlockTypes ( )
} ;
} , [ ] ) ;
2022-04-11 14:04:30 +02:00
const filteredBlockTypes = ( 0 , external _wp _element _namespaceObject . useMemo ) ( ( ) => {
2022-04-12 17:12:47 +02:00
if ( defaultAllowedBlockTypes === true ) {
2021-05-19 17:09:27 +02:00
return blockTypes ;
}
2023-06-27 16:24:19 +02:00
return blockTypes . filter ( ( {
name
} ) => {
return defaultAllowedBlockTypes ? . includes ( name ) ;
2021-05-19 17:09:27 +02:00
} ) ;
2022-04-12 17:12:47 +02:00
} , [ defaultAllowedBlockTypes , blockTypes ] ) ;
const {
showBlockTypes ,
hideBlockTypes
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
const toggleVisible = ( 0 , external _wp _element _namespaceObject . useCallback ) ( ( blockName , nextIsChecked ) => {
if ( nextIsChecked ) {
showBlockTypes ( blockName ) ;
} else {
hideBlockTypes ( blockName ) ;
}
} , [ ] ) ;
const toggleAllVisible = ( 0 , external _wp _element _namespaceObject . useCallback ) ( nextIsChecked => {
2023-06-27 16:24:19 +02:00
const blockNames = blockTypes . map ( ( {
name
} ) => name ) ;
2022-04-12 17:12:47 +02:00
if ( nextIsChecked ) {
showBlockTypes ( blockNames ) ;
} else {
hideBlockTypes ( blockNames ) ;
}
} , [ blockTypes ] ) ;
2021-05-19 17:09:27 +02:00
if ( ! filteredBlockTypes . length ) {
return null ;
}
2023-06-27 16:24:19 +02:00
const checkedBlockNames = filteredBlockTypes . map ( ( {
name
} ) => name ) . filter ( type => ! hiddenBlockTypes . includes ( type ) ) ;
2021-11-08 15:29:21 +01:00
const titleId = 'edit-post-block-manager__category-title-' + instanceId ;
2021-05-19 17:09:27 +02:00
const isAllChecked = checkedBlockNames . length === filteredBlockTypes . length ;
2023-02-07 08:04:52 +01:00
const isIndeterminate = ! isAllChecked && checkedBlockNames . length > 0 ;
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
2021-05-19 17:09:27 +02:00
role : "group" ,
"aria-labelledby" : titleId ,
2021-11-08 15:29:21 +01:00
className : "edit-post-block-manager__category"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . CheckboxControl , {
2023-02-07 08:04:52 +01:00
_ _nextHasNoMarginBottom : true ,
2021-05-19 17:09:27 +02:00
checked : isAllChecked ,
onChange : toggleAllVisible ,
2021-11-08 15:29:21 +01:00
className : "edit-post-block-manager__category-title" ,
2023-02-07 08:04:52 +01:00
indeterminate : isIndeterminate ,
2022-04-11 14:04:30 +02:00
label : ( 0 , external _wp _element _namespaceObject . createElement ) ( "span" , {
2021-05-19 17:09:27 +02:00
id : titleId
} , title )
2022-04-11 14:04:30 +02:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( checklist , {
2021-05-19 17:09:27 +02:00
blockTypes : filteredBlockTypes ,
value : checkedBlockNames ,
onItemChange : toggleVisible
} ) ) ;
2021-05-07 13:48:27 +02:00
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var block _manager _category = ( BlockManagerCategory ) ;
2021-05-07 13:48:27 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/block-manager/index.js
2021-05-07 13:48:27 +02:00
/ * *
2021-05-19 17:09:27 +02:00
* WordPress dependencies
2021-05-07 13:48:27 +02:00
* /
2022-04-12 17:12:47 +02:00
2023-09-26 16:23:26 +02:00
2021-05-19 17:09:27 +02:00
/ * *
* Internal dependencies
* /
2021-05-07 13:48:27 +02:00
2023-06-27 16:24:19 +02:00
function BlockManager ( {
blockTypes ,
categories ,
hasBlockSupport ,
isMatchingSearchTerm ,
numberOfHiddenBlocks ,
enableAllBlockTypes
} ) {
2022-04-12 17:12:47 +02:00
const debouncedSpeak = ( 0 , external _wp _compose _namespaceObject . useDebounce ) ( external _wp _a11y _namespaceObject . speak , 500 ) ;
2023-09-26 16:23:26 +02:00
const [ search , setSearch ] = ( 0 , external _wp _element _namespaceObject . useState ) ( '' ) ;
// Filtering occurs here (as opposed to `withSelect`) to avoid
2021-05-19 17:09:27 +02:00
// wasted renders by consequence of `Array#filter` producing
// a new value reference on each call.
2023-09-26 16:23:26 +02:00
blockTypes = blockTypes . filter ( blockType => hasBlockSupport ( blockType , 'inserter' , true ) && ( ! search || isMatchingSearchTerm ( blockType , search ) ) && ( ! blockType . parent || blockType . parent . includes ( 'core/post-content' ) ) ) ;
2021-11-08 15:29:21 +01:00
2023-09-26 16:23:26 +02:00
// Announce search results on change
2022-04-12 17:12:47 +02:00
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
if ( ! search ) {
return ;
}
const count = blockTypes . length ;
2023-09-26 16:23:26 +02:00
const resultsFoundMessage = ( 0 , external _wp _i18n _namespaceObject . sprintf ) ( /* translators: %d: number of results. */
2022-04-12 17:12:47 +02:00
( 0 , external _wp _i18n _namespaceObject . _n ) ( '%d result found.' , '%d results found.' , count ) , count ) ;
debouncedSpeak ( resultsFoundMessage ) ;
} , [ blockTypes . length , search , debouncedSpeak ] ) ;
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
2021-11-08 15:29:21 +01:00
className : "edit-post-block-manager__content"
2022-04-11 14:04:30 +02:00
} , ! ! numberOfHiddenBlocks && ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
2021-11-08 15:29:21 +01:00
className : "edit-post-block-manager__disabled-blocks-count"
2023-09-26 16:23:26 +02:00
} , ( 0 , external _wp _i18n _namespaceObject . sprintf ) ( /* translators: %d: number of blocks. */
2023-06-27 16:24:19 +02:00
( 0 , external _wp _i18n _namespaceObject . _n ) ( '%d block is hidden.' , '%d blocks are hidden.' , numberOfHiddenBlocks ) , numberOfHiddenBlocks ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
variant : "link" ,
onClick : ( ) => enableAllBlockTypes ( blockTypes )
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Reset' ) ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . SearchControl , {
2023-02-07 08:04:52 +01:00
_ _nextHasNoMarginBottom : true ,
2022-04-11 14:04:30 +02:00
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Search for a block' ) ,
placeholder : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Search for a block' ) ,
2021-11-08 15:29:21 +01:00
value : search ,
onChange : nextSearch => setSearch ( nextSearch ) ,
className : "edit-post-block-manager__search"
2022-04-11 14:04:30 +02:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
2021-05-19 17:09:27 +02:00
tabIndex : "0" ,
role : "region" ,
2022-04-11 14:04:30 +02:00
"aria-label" : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Available block types' ) ,
2021-11-08 15:29:21 +01:00
className : "edit-post-block-manager__results"
2022-04-11 14:04:30 +02:00
} , blockTypes . length === 0 && ( 0 , external _wp _element _namespaceObject . createElement ) ( "p" , {
2021-11-08 15:29:21 +01:00
className : "edit-post-block-manager__no-results"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'No blocks found.' ) ) , categories . map ( category => ( 0 , external _wp _element _namespaceObject . createElement ) ( block _manager _category , {
2021-05-19 17:09:27 +02:00
key : category . slug ,
title : category . title ,
2023-02-07 08:04:52 +01:00
blockTypes : blockTypes . filter ( blockType => blockType . category === category . slug )
2022-04-11 14:04:30 +02:00
} ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( block _manager _category , {
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Uncategorized' ) ,
2023-06-27 16:24:19 +02:00
blockTypes : blockTypes . filter ( ( {
category
} ) => ! category )
2021-05-19 17:09:27 +02:00
} ) ) ) ;
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var block _manager = ( ( 0 , external _wp _compose _namespaceObject . compose ) ( [ ( 0 , external _wp _data _namespaceObject . withSelect ) ( select => {
2021-05-19 17:09:27 +02:00
const {
getBlockTypes ,
getCategories ,
hasBlockSupport ,
2021-11-08 15:29:21 +01:00
isMatchingSearchTerm
2022-04-11 14:04:30 +02:00
} = select ( external _wp _blocks _namespaceObject . store ) ;
2021-05-19 17:09:27 +02:00
const {
2022-04-12 17:12:47 +02:00
getHiddenBlockTypes
2023-09-26 16:23:26 +02:00
} = select ( store _store ) ;
// Some hidden blocks become unregistered
2022-09-20 17:43:29 +02:00
// by removing for instance the plugin that registered them, yet
// they're still remain as hidden by the user's action.
// We consider "hidden", blocks which were hidden and
// are still registered.
const blockTypes = getBlockTypes ( ) ;
const hiddenBlockTypes = getHiddenBlockTypes ( ) . filter ( hiddenBlock => {
return blockTypes . some ( registeredBlock => registeredBlock . name === hiddenBlock ) ;
} ) ;
const numberOfHiddenBlocks = Array . isArray ( hiddenBlockTypes ) && hiddenBlockTypes . length ;
2021-05-19 17:09:27 +02:00
return {
2022-09-20 17:43:29 +02:00
blockTypes ,
2021-11-08 15:29:21 +01:00
categories : getCategories ( ) ,
hasBlockSupport ,
isMatchingSearchTerm ,
numberOfHiddenBlocks
2021-05-19 17:09:27 +02:00
} ;
2023-06-27 16:24:19 +02:00
} ) , ( 0 , external _wp _data _namespaceObject . withDispatch ) ( dispatch => {
const {
showBlockTypes
} = dispatch ( store _store ) ;
return {
enableAllBlockTypes : blockTypes => {
const blockNames = blockTypes . map ( ( {
name
} ) => name ) ;
showBlockTypes ( blockNames ) ;
}
} ;
} ) ] ) ( BlockManager ) ) ;
2018-12-14 05:41:57 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/index.js
2018-12-14 05:41:57 +01:00
2021-05-07 13:48:27 +02:00
/ * *
* WordPress dependencies
* /
2018-12-14 05:41:57 +01:00
2018-12-19 04:16:48 +01:00
2019-09-19 17:19:18 +02:00
2018-12-14 05:41:57 +01:00
2023-09-26 16:23:26 +02:00
2018-12-14 05:41:57 +01:00
/ * *
2021-05-19 17:09:27 +02:00
* Internal dependencies
2018-12-14 05:41:57 +01:00
* /
2021-01-28 03:04:13 +01:00
2020-06-26 15:33:47 +02:00
2023-06-28 09:04:13 +02:00
const PREFERENCES _MODAL _NAME = 'edit-post/preferences' ;
2022-04-12 17:12:47 +02:00
function EditPostPreferencesModal ( ) {
2022-04-11 14:04:30 +02:00
const isLargeViewport = ( 0 , external _wp _compose _namespaceObject . useViewportMatch ) ( 'medium' ) ;
2021-05-19 17:09:27 +02:00
const {
closeModal
2023-06-28 09:04:13 +02:00
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store ) ;
2023-02-07 08:04:52 +01:00
const [ isModalActive , showBlockBreadcrumbsOption ] = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
2021-05-19 17:09:27 +02:00
const {
getEditorSettings
2022-04-11 14:04:30 +02:00
} = select ( external _wp _editor _namespaceObject . store ) ;
2021-05-19 17:09:27 +02:00
const {
getEditorMode ,
isFeatureActive
2022-04-11 14:04:30 +02:00
} = select ( store _store ) ;
2023-06-28 09:04:13 +02:00
const modalActive = select ( store ) . isModalActive ( PREFERENCES _MODAL _NAME ) ;
2021-05-19 17:09:27 +02:00
const mode = getEditorMode ( ) ;
const isRichEditingEnabled = getEditorSettings ( ) . richEditingEnabled ;
2023-02-07 08:04:52 +01:00
const isDistractionFreeEnabled = isFeatureActive ( 'distractionFree' ) ;
return [ modalActive , ! isDistractionFreeEnabled && isLargeViewport && isRichEditingEnabled && mode === 'visual' , isDistractionFreeEnabled ] ;
2021-05-19 17:09:27 +02:00
} , [ isLargeViewport ] ) ;
2023-02-07 08:04:52 +01:00
const {
closeGeneralSidebar ,
setIsListViewOpened ,
setIsInserterOpened
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
const {
set : setPreference
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _preferences _namespaceObject . store ) ;
const toggleDistractionFree = ( ) => {
setPreference ( 'core/edit-post' , 'fixedToolbar' , false ) ;
setIsInserterOpened ( false ) ;
setIsListViewOpened ( false ) ;
closeGeneralSidebar ( ) ;
} ;
2022-04-11 14:04:30 +02:00
const sections = ( 0 , external _wp _element _namespaceObject . useMemo ) ( ( ) => [ {
2021-05-19 17:09:27 +02:00
name : 'general' ,
2022-04-11 14:04:30 +02:00
tabLabel : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'General' ) ,
2022-04-12 17:12:47 +02:00
content : ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , isLargeViewport && ( 0 , external _wp _element _namespaceObject . createElement ) ( preferences _modal _section , {
2022-04-11 14:04:30 +02:00
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Publishing' ) ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Change options related to publishing.' )
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( enable _publish _sidebar , {
help : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Review settings, such as visibility and tags.' ) ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Include pre-publish checklist' )
2022-04-12 17:12:47 +02:00
} ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( preferences _modal _section , {
2022-04-11 14:04:30 +02:00
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Appearance' ) ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Customize options related to the block editor interface and editing flow.' )
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( enable _feature , {
2023-02-07 08:04:52 +01:00
featureName : "distractionFree" ,
onToggle : toggleDistractionFree ,
help : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Reduce visual distractions by hiding the toolbar and other elements to focus on writing.' ) ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Distraction free' )
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( enable _feature , {
2021-05-19 17:09:27 +02:00
featureName : "focusMode" ,
2022-04-11 14:04:30 +02:00
help : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Highlights the current block and fades other content.' ) ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Spotlight mode' )
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( enable _feature , {
2021-05-19 17:09:27 +02:00
featureName : "showIconLabels" ,
2022-09-20 17:43:29 +02:00
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Show button text labels' ) ,
help : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Show text instead of icons on buttons.' )
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( enable _feature , {
featureName : "showListViewByDefault" ,
help : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Opens the block list view sidebar by default.' ) ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Always open list view' )
2022-04-11 14:04:30 +02:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( enable _feature , {
2021-05-19 17:09:27 +02:00
featureName : "themeStyles" ,
2022-04-11 14:04:30 +02:00
help : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Make the editor look like your theme.' ) ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Use theme styles' )
} ) , showBlockBreadcrumbsOption && ( 0 , external _wp _element _namespaceObject . createElement ) ( enable _feature , {
2021-11-08 15:29:21 +01:00
featureName : "showBlockBreadcrumbs" ,
2022-04-11 14:04:30 +02:00
help : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Shows block breadcrumbs at the bottom of the editor.' ) ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Display block breadcrumbs' )
2021-11-08 15:29:21 +01:00
} ) ) )
2021-05-19 17:09:27 +02:00
} , {
name : 'blocks' ,
2022-04-11 14:04:30 +02:00
tabLabel : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Blocks' ) ,
2022-04-12 17:12:47 +02:00
content : ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( preferences _modal _section , {
2022-04-11 14:04:30 +02:00
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Block interactions' ) ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Customize how you interact with blocks in the block library and editing canvas.' )
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( enable _feature , {
2021-05-19 17:09:27 +02:00
featureName : "mostUsedBlocks" ,
2022-04-11 14:04:30 +02:00
help : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Places the most frequent blocks in the block library.' ) ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Show most used blocks' )
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( enable _feature , {
2021-05-19 17:09:27 +02:00
featureName : "keepCaretInsideBlock" ,
2022-04-11 14:04:30 +02:00
help : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Aids screen readers by stopping text caret from leaving blocks.' ) ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Contain text cursor inside block' )
2022-04-12 17:12:47 +02:00
} ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( preferences _modal _section , {
2022-04-11 14:04:30 +02:00
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Visible blocks' ) ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later." )
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( block _manager , null ) ) )
2021-05-19 17:09:27 +02:00
} , {
name : 'panels' ,
2022-04-11 14:04:30 +02:00
tabLabel : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Panels' ) ,
2022-04-12 17:12:47 +02:00
content : ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( preferences _modal _section , {
2022-04-11 14:04:30 +02:00
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Document settings' ) ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Choose what displays in the panel.' )
2022-09-20 17:43:29 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( enable _plugin _document _setting _panel . Slot , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostTaxonomies , {
2022-04-11 14:04:30 +02:00
taxonomyWrapper : ( content , taxonomy ) => ( 0 , external _wp _element _namespaceObject . createElement ) ( enable _panel , {
2023-06-27 16:24:19 +02:00
label : taxonomy . labels . menu _name ,
2021-05-19 17:09:27 +02:00
panelName : ` taxonomy-panel- ${ taxonomy . slug } `
} )
2022-04-11 14:04:30 +02:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostFeaturedImageCheck , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( enable _panel , {
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Featured image' ) ,
2021-05-19 17:09:27 +02:00
panelName : "featured-image"
2022-04-11 14:04:30 +02:00
} ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostExcerptCheck , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( enable _panel , {
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Excerpt' ) ,
2021-05-19 17:09:27 +02:00
panelName : "post-excerpt"
2022-04-11 14:04:30 +02:00
} ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostTypeSupportCheck , {
2021-05-19 17:09:27 +02:00
supportKeys : [ 'comments' , 'trackbacks' ]
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( enable _panel , {
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Discussion' ) ,
2021-05-19 17:09:27 +02:00
panelName : "discussion-panel"
2022-04-11 14:04:30 +02:00
} ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PageAttributesCheck , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( enable _panel , {
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Page attributes' ) ,
2021-05-19 17:09:27 +02:00
panelName : "page-attributes"
2022-04-11 14:04:30 +02:00
} ) ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( meta _boxes _section , {
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Additional' ) ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Add extra areas to the editor.' )
2021-11-08 15:29:21 +01:00
} ) )
2022-09-20 17:43:29 +02:00
} ] , [ isLargeViewport , showBlockBreadcrumbsOption ] ) ;
2021-05-19 17:09:27 +02:00
if ( ! isModalActive ) {
return null ;
}
2022-04-12 17:12:47 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( PreferencesModal , {
closeModal : closeModal
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( PreferencesModalTabs , {
sections : sections
} ) ) ;
2021-05-19 17:09:27 +02:00
}
2020-07-07 16:43:35 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/browser-url/index.js
2021-05-19 17:09:27 +02:00
/ * *
* WordPress dependencies
* /
2020-07-07 16:43:35 +02:00
2021-11-08 15:29:21 +01:00
2023-09-26 16:23:26 +02:00
2021-05-19 17:09:27 +02:00
/ * *
* Returns the Post ' s Edit URL .
*
* @ param { number } postId Post ID .
*
* @ return { string } Post edit URL .
* /
function getPostEditURL ( postId ) {
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _url _namespaceObject . addQueryArgs ) ( 'post.php' , {
2021-05-19 17:09:27 +02:00
post : postId ,
action : 'edit'
} ) ;
}
2023-09-26 16:23:26 +02:00
2021-05-07 13:48:27 +02:00
/ * *
2021-05-19 17:09:27 +02:00
* Returns the Post ' s Trashed URL .
*
2021-11-08 15:29:21 +01:00
* @ param { number } postId Post ID .
2021-05-19 17:09:27 +02:00
* @ param { string } postType Post Type .
*
* @ return { string } Post trashed URL .
2021-05-07 13:48:27 +02:00
* /
2021-05-19 17:09:27 +02:00
function getPostTrashedURL ( postId , postType ) {
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _url _namespaceObject . addQueryArgs ) ( 'edit.php' , {
2021-05-19 17:09:27 +02:00
trashed : 1 ,
post _type : postType ,
ids : postId
} ) ;
2021-01-28 03:04:13 +01:00
}
2022-04-11 14:04:30 +02:00
class BrowserURL extends external _wp _element _namespaceObject . Component {
2021-05-19 17:09:27 +02:00
constructor ( ) {
super ( ... arguments ) ;
this . state = {
historyId : null
} ;
}
componentDidUpdate ( prevProps ) {
const {
postId ,
postStatus ,
postType ,
isSavingPost
} = this . props ;
const {
historyId
2023-09-26 16:23:26 +02:00
} = this . state ;
2021-05-19 17:09:27 +02:00
2023-09-26 16:23:26 +02:00
// Posts are still dirty while saving so wait for saving to finish
// to avoid the unsaved changes warning when trashing posts.
2021-05-19 17:09:27 +02:00
if ( postStatus === 'trash' && ! isSavingPost ) {
this . setTrashURL ( postId , postType ) ;
return ;
}
if ( ( postId !== prevProps . postId || postId !== historyId ) && postStatus !== 'auto-draft' && postId ) {
this . setBrowserURL ( postId ) ;
2021-05-07 13:48:27 +02:00
}
2021-05-19 17:09:27 +02:00
}
2023-09-26 16:23:26 +02:00
2021-05-19 17:09:27 +02:00
/ * *
* Navigates the browser to the post trashed URL to show a notice about the trashed post .
*
2021-11-08 15:29:21 +01:00
* @ param { number } postId Post ID .
* @ param { string } postType Post Type .
2021-05-19 17:09:27 +02:00
* /
setTrashURL ( postId , postType ) {
window . location . href = getPostTrashedURL ( postId , postType ) ;
}
2023-09-26 16:23:26 +02:00
2021-05-19 17:09:27 +02:00
/ * *
* Replaces the browser URL with a post editor link for the given post ID .
*
* Note it is important that , since this function may be called when the
* editor first loads , the result generated ` getPostEditURL ` matches that
* produced by the server . Otherwise , the URL will change unexpectedly .
*
* @ param { number } postId Post ID for which to generate post editor URL .
* /
setBrowserURL ( postId ) {
window . history . replaceState ( {
id : postId
} , 'Post ' + postId , getPostEditURL ( postId ) ) ;
this . setState ( ( ) => ( {
historyId : postId
} ) ) ;
}
render ( ) {
return null ;
}
2021-05-07 13:48:27 +02:00
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var browser _url = ( ( 0 , external _wp _data _namespaceObject . withSelect ) ( select => {
2021-05-19 17:09:27 +02:00
const {
getCurrentPost ,
isSavingPost
2022-04-11 14:04:30 +02:00
} = select ( external _wp _editor _namespaceObject . store ) ;
2021-05-19 17:09:27 +02:00
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 ,
postType : type ,
isSavingPost : isSavingPost ( )
} ;
2022-04-11 14:04:30 +02:00
} ) ( BrowserURL ) ) ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/wordpress.js
/ * *
* WordPress dependencies
* /
2021-05-19 17:09:27 +02:00
2022-04-11 14:04:30 +02:00
const wordpress = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "-2 -2 24 24"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( 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"
} ) ) ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var library _wordpress = ( wordpress ) ;
2021-05-19 17:09:27 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/fullscreen-mode-close/index.js
2019-10-15 17:37:08 +02:00
2021-01-28 03:04:13 +01:00
/ * *
2021-05-07 13:48:27 +02:00
* External dependencies
2021-01-28 03:04:13 +01:00
* /
2020-01-08 12:57:23 +01:00
2023-09-26 16:23:26 +02:00
2021-05-07 13:48:27 +02:00
/ * *
* WordPress dependencies
* /
2020-01-08 12:57:23 +01:00
2021-01-28 03:04:13 +01:00
2021-05-19 17:09:27 +02:00
2021-11-08 15:29:21 +01:00
2021-05-07 13:48:27 +02:00
/ * *
* Internal dependencies
* /
2020-01-08 12:57:23 +01:00
2023-06-27 16:24:19 +02:00
function FullscreenModeClose ( {
showTooltip ,
icon ,
href
} ) {
var _postType$labels$view ;
2021-05-19 17:09:27 +02:00
const {
isActive ,
isRequestingSiteIcon ,
postType ,
siteIconUrl
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
2021-05-19 17:09:27 +02:00
const {
getCurrentPostType
2022-04-11 14:04:30 +02:00
} = select ( external _wp _editor _namespaceObject . store ) ;
2021-05-19 17:09:27 +02:00
const {
isFeatureActive
2022-04-11 14:04:30 +02:00
} = select ( store _store ) ;
2021-05-19 17:09:27 +02:00
const {
getEntityRecord ,
2021-11-08 15:29:21 +01:00
getPostType ,
isResolving
2022-04-11 14:04:30 +02:00
} = select ( external _wp _coreData _namespaceObject . store ) ;
2021-05-19 17:09:27 +02:00
const siteData = getEntityRecord ( 'root' , '__unstableBase' , undefined ) || { } ;
return {
isActive : isFeatureActive ( 'fullscreenMode' ) ,
2021-11-08 15:29:21 +01:00
isRequestingSiteIcon : isResolving ( 'getEntityRecord' , [ 'root' , '__unstableBase' , undefined ] ) ,
2021-05-19 17:09:27 +02:00
postType : getPostType ( getCurrentPostType ( ) ) ,
siteIconUrl : siteData . site _icon _url
} ;
} , [ ] ) ;
2022-04-11 14:04:30 +02:00
const disableMotion = ( 0 , external _wp _compose _namespaceObject . useReducedMotion ) ( ) ;
2021-05-19 17:09:27 +02:00
if ( ! isActive || ! postType ) {
2021-05-07 13:48:27 +02:00
return null ;
}
2022-04-11 14:04:30 +02:00
let buttonIcon = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Icon , {
2021-05-19 17:09:27 +02:00
size : "36px" ,
2022-04-11 14:04:30 +02:00
icon : library _wordpress
2021-05-19 17:09:27 +02:00
} ) ;
2021-11-08 15:29:21 +01:00
const effect = {
expand : {
2022-04-12 17:12:47 +02:00
scale : 1.25 ,
2021-11-08 15:29:21 +01:00
transition : {
type : 'tween' ,
2022-04-12 17:12:47 +02:00
duration : '0.3'
2021-11-08 15:29:21 +01:00
}
}
} ;
2021-05-19 17:09:27 +02:00
if ( siteIconUrl ) {
2022-04-11 14:04:30 +02:00
buttonIcon = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _unstableMotion . img , {
2021-11-08 15:29:21 +01:00
variants : ! disableMotion && effect ,
2022-04-11 14:04:30 +02:00
alt : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Site Icon' ) ,
2021-05-19 17:09:27 +02:00
className : "edit-post-fullscreen-mode-close_site-icon" ,
src : siteIconUrl
} ) ;
2021-05-07 13:48:27 +02:00
}
2021-05-19 17:09:27 +02:00
if ( isRequestingSiteIcon ) {
buttonIcon = null ;
2023-09-26 16:23:26 +02:00
}
2021-05-19 17:09:27 +02:00
2023-09-26 16:23:26 +02:00
// Override default icon if custom icon is provided via props.
2021-05-19 17:09:27 +02:00
if ( icon ) {
2022-04-11 14:04:30 +02:00
buttonIcon = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Icon , {
2021-05-19 17:09:27 +02:00
size : "36px" ,
icon : icon
} ) ;
}
2022-04-12 17:12:47 +02:00
const classes = classnames _default ( ) ( {
'edit-post-fullscreen-mode-close' : true ,
'has-icon' : siteIconUrl
} ) ;
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _unstableMotion . div , {
2021-11-08 15:29:21 +01:00
whileHover : "expand"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
2022-04-12 17:12:47 +02:00
className : classes ,
2022-04-11 14:04:30 +02:00
href : href !== null && href !== void 0 ? href : ( 0 , external _wp _url _namespaceObject . addQueryArgs ) ( 'edit.php' , {
2021-05-19 17:09:27 +02:00
post _type : postType . slug
} ) ,
2023-06-27 16:24:19 +02:00
label : ( _postType$labels$view = postType ? . labels ? . view _items ) !== null && _postType$labels$view !== void 0 ? _postType$labels$view : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Back' ) ,
2021-05-19 17:09:27 +02:00
showTooltip : showTooltip
2021-11-08 15:29:21 +01:00
} , buttonIcon ) ) ;
2021-05-07 13:48:27 +02:00
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var fullscreen _mode _close = ( FullscreenModeClose ) ;
2018-12-14 05:41:57 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/list-view.js
/ * *
* WordPress dependencies
* /
const listView = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
viewBox : "0 0 24 24" ,
xmlns : "http://www.w3.org/2000/svg"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
2023-06-27 16:24:19 +02:00
d : "M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"
2022-04-11 14:04:30 +02:00
} ) ) ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var list _view = ( listView ) ;
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/plus.js
2021-05-21 12:14:23 +02:00
2022-04-11 14:04:30 +02:00
/ * *
* WordPress dependencies
* /
const plus = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
d : "M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"
} ) ) ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var library _plus = ( plus ) ;
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/header-toolbar/index.js
2021-05-21 12:14:23 +02:00
/ * *
* WordPress dependencies
* /
2021-06-25 17:52:22 +02:00
2023-07-07 09:21:17 +02:00
2023-09-26 16:23:26 +02:00
2021-05-21 12:14:23 +02:00
/ * *
* Internal dependencies
* /
2023-06-27 16:24:19 +02:00
const {
useShouldContextualToolbarShow
} = unlock ( external _wp _blockEditor _namespaceObject . privateApis ) ;
2021-11-08 15:29:21 +01:00
const preventDefault = event => {
event . preventDefault ( ) ;
} ;
2023-09-26 16:23:26 +02:00
function HeaderToolbar ( {
setListViewToggleElement
} ) {
2022-04-11 14:04:30 +02:00
const inserterButton = ( 0 , external _wp _element _namespaceObject . useRef ) ( ) ;
2021-05-21 12:14:23 +02:00
const {
2021-06-25 17:52:22 +02:00
setIsInserterOpened ,
setIsListViewOpened
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
2021-05-21 12:14:23 +02:00
const {
2021-06-25 17:52:22 +02:00
isInserterEnabled ,
isInserterOpened ,
isTextModeEnabled ,
showIconLabels ,
isListViewOpen ,
2023-09-26 16:23:26 +02:00
listViewShortcut ,
hasFixedToolbar
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
2021-05-21 12:14:23 +02:00
const {
2021-06-25 17:52:22 +02:00
hasInserterItems ,
getBlockRootClientId ,
getBlockSelectionEnd
2022-04-11 14:04:30 +02:00
} = select ( external _wp _blockEditor _namespaceObject . store ) ;
2021-06-25 17:52:22 +02:00
const {
getEditorSettings
2022-04-11 14:04:30 +02:00
} = select ( external _wp _editor _namespaceObject . store ) ;
2021-06-25 17:52:22 +02:00
const {
getEditorMode ,
isFeatureActive ,
isListViewOpened
2022-04-11 14:04:30 +02:00
} = select ( store _store ) ;
2021-06-25 17:52:22 +02:00
const {
getShortcutRepresentation
2022-04-11 14:04:30 +02:00
} = select ( external _wp _keyboardShortcuts _namespaceObject . store ) ;
2023-09-26 16:23:26 +02:00
const {
get : getPreference
} = select ( external _wp _preferences _namespaceObject . store ) ;
2021-05-21 12:14:23 +02:00
return {
2021-06-25 17:52:22 +02:00
// This setting (richEditingEnabled) should not live in the block editor's setting.
isInserterEnabled : getEditorMode ( ) === 'visual' && getEditorSettings ( ) . richEditingEnabled && hasInserterItems ( getBlockRootClientId ( getBlockSelectionEnd ( ) ) ) ,
2022-04-11 14:04:30 +02:00
isInserterOpened : select ( store _store ) . isInserterOpened ( ) ,
2021-06-25 17:52:22 +02:00
isTextModeEnabled : getEditorMode ( ) === 'text' ,
showIconLabels : isFeatureActive ( 'showIconLabels' ) ,
isListViewOpen : isListViewOpened ( ) ,
2023-09-26 16:23:26 +02:00
listViewShortcut : getShortcutRepresentation ( 'core/edit-post/toggle-list-view' ) ,
hasFixedToolbar : getPreference ( 'core/edit-post' , 'fixedToolbar' )
2021-05-21 12:14:23 +02:00
} ;
} , [ ] ) ;
2022-04-11 14:04:30 +02:00
const isLargeViewport = ( 0 , external _wp _compose _namespaceObject . useViewportMatch ) ( 'medium' ) ;
const isWideViewport = ( 0 , external _wp _compose _namespaceObject . useViewportMatch ) ( 'wide' ) ;
2023-06-27 16:24:19 +02:00
const {
shouldShowContextualToolbar ,
canFocusHiddenToolbar ,
fixedToolbarCanBeFocused
2023-09-26 16:23:26 +02:00
} = useShouldContextualToolbarShow ( ) ;
// If there's a block toolbar to be focused, disable the focus shortcut for the document toolbar.
2023-06-27 16:24:19 +02:00
// There's a fixed block toolbar when the fixed toolbar option is enabled or when the browser width is less than the large viewport.
const blockToolbarCanBeFocused = shouldShowContextualToolbar || canFocusHiddenToolbar || fixedToolbarCanBeFocused ;
2021-06-25 17:52:22 +02:00
/* translators: accessibility text for the editor toolbar */
2022-04-11 14:04:30 +02:00
const toolbarAriaLabel = ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Document tools' ) ;
const toggleListView = ( 0 , external _wp _element _namespaceObject . useCallback ) ( ( ) => setIsListViewOpened ( ! isListViewOpen ) , [ setIsListViewOpened , isListViewOpen ] ) ;
const overflowItems = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . ToolbarItem , {
as : external _wp _components _namespaceObject . Button ,
2023-02-07 08:04:52 +01:00
className : "edit-post-header-toolbar__document-overview-toggle" ,
2022-04-11 14:04:30 +02:00
icon : list _view ,
2021-06-25 17:52:22 +02:00
disabled : isTextModeEnabled ,
isPressed : isListViewOpen
2023-09-26 16:23:26 +02:00
/* translators: button label text should, if possible, be under 16 characters. */ ,
2023-02-07 08:04:52 +01:00
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Document Overview' ) ,
2021-11-08 15:29:21 +01:00
onClick : toggleListView ,
2021-06-25 17:52:22 +02:00
shortcut : listViewShortcut ,
2022-09-20 17:43:29 +02:00
showTooltip : ! showIconLabels ,
2023-09-26 16:23:26 +02:00
variant : showIconLabels ? 'tertiary' : undefined ,
"aria-expanded" : isListViewOpen ,
ref : setListViewToggleElement
2021-06-25 17:52:22 +02:00
} ) ) ;
2023-02-14 16:44:36 +01:00
const toggleInserter = ( 0 , external _wp _element _namespaceObject . useCallback ) ( ( ) => {
2021-11-08 15:29:21 +01:00
if ( isInserterOpened ) {
2023-02-14 16:44:36 +01:00
// Focusing the inserter button should close the inserter popover.
// However, there are some cases it won't close when the focus is lost.
// See https://github.com/WordPress/gutenberg/issues/43090 for more details.
2021-11-08 15:29:21 +01:00
inserterButton . current . focus ( ) ;
2023-02-14 16:44:36 +01:00
setIsInserterOpened ( false ) ;
2021-11-08 15:29:21 +01:00
} else {
setIsInserterOpened ( true ) ;
}
} , [ isInserterOpened , setIsInserterOpened ] ) ;
2022-09-20 17:43:29 +02:00
2023-09-26 16:23:26 +02:00
/* translators: button label text should, if possible, be under 16 characters. */
2022-09-20 17:43:29 +02:00
const longLabel = ( 0 , external _wp _i18n _namespaceObject . _x ) ( 'Toggle block inserter' , 'Generic label for block inserter button' ) ;
const shortLabel = ! isInserterOpened ? ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Add' ) : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Close' ) ;
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . NavigableToolbar , {
2021-06-25 17:52:22 +02:00
className : "edit-post-header-toolbar" ,
2023-06-27 16:24:19 +02:00
"aria-label" : toolbarAriaLabel ,
shouldUseKeyboardFocusShortcut : ! blockToolbarCanBeFocused
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
2021-06-25 17:52:22 +02:00
className : "edit-post-header-toolbar__left"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . ToolbarItem , {
2021-06-25 17:52:22 +02:00
ref : inserterButton ,
2022-04-11 14:04:30 +02:00
as : external _wp _components _namespaceObject . Button ,
2021-06-25 17:52:22 +02:00
className : "edit-post-header-toolbar__inserter-toggle" ,
2021-11-08 15:29:21 +01:00
variant : "primary" ,
2021-06-25 17:52:22 +02:00
isPressed : isInserterOpened ,
2021-11-08 15:29:21 +01:00
onMouseDown : preventDefault ,
2023-02-14 16:44:36 +01:00
onClick : toggleInserter ,
2021-06-25 17:52:22 +02:00
disabled : ! isInserterEnabled ,
2022-09-20 17:43:29 +02:00
icon : library _plus ,
label : showIconLabels ? shortLabel : longLabel ,
2023-09-26 16:23:26 +02:00
showTooltip : ! showIconLabels ,
"aria-expanded" : isInserterOpened
2023-07-07 09:21:17 +02:00
} ) , ( isWideViewport || ! showIconLabels ) && ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , isLargeViewport && ! hasFixedToolbar && ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . ToolbarItem , {
2022-04-11 14:04:30 +02:00
as : external _wp _blockEditor _namespaceObject . ToolSelector ,
2021-06-25 17:52:22 +02:00
showTooltip : ! showIconLabels ,
2021-11-08 15:29:21 +01:00
variant : showIconLabels ? 'tertiary' : undefined ,
2021-06-25 17:52:22 +02:00
disabled : isTextModeEnabled
2022-04-11 14:04:30 +02:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . ToolbarItem , {
as : external _wp _editor _namespaceObject . EditorHistoryUndo ,
2021-06-25 17:52:22 +02:00
showTooltip : ! showIconLabels ,
2021-11-08 15:29:21 +01:00
variant : showIconLabels ? 'tertiary' : undefined
2022-04-11 14:04:30 +02:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . ToolbarItem , {
as : external _wp _editor _namespaceObject . EditorHistoryRedo ,
2021-06-25 17:52:22 +02:00
showTooltip : ! showIconLabels ,
2021-11-08 15:29:21 +01:00
variant : showIconLabels ? 'tertiary' : undefined
2021-06-25 17:52:22 +02:00
} ) , overflowItems ) ) ) ;
2021-05-21 12:14:23 +02:00
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var header _toolbar = ( HeaderToolbar ) ;
2021-05-21 12:14:23 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/mode-switcher/index.js
2021-05-21 12:14:23 +02:00
/ * *
* WordPress dependencies
* /
2021-11-08 15:29:21 +01:00
2023-09-26 16:23:26 +02:00
2021-06-25 17:52:22 +02:00
/ * *
* Internal dependencies
* /
2021-05-21 12:14:23 +02:00
/ * *
2021-06-25 17:52:22 +02:00
* Set of available mode options .
*
* @ type { Array }
2021-05-21 12:14:23 +02:00
* /
2021-06-25 17:52:22 +02:00
const MODES = [ {
value : 'visual' ,
2022-04-11 14:04:30 +02:00
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Visual editor' )
2021-06-25 17:52:22 +02:00
} , {
value : 'text' ,
2022-04-11 14:04:30 +02:00
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Code editor' )
2021-06-25 17:52:22 +02:00
} ] ;
function ModeSwitcher ( ) {
2021-05-21 12:14:23 +02:00
const {
2021-06-25 17:52:22 +02:00
shortcut ,
isRichEditingEnabled ,
isCodeEditingEnabled ,
2022-01-04 06:39:28 +01:00
isEditingTemplate ,
2021-06-25 17:52:22 +02:00
mode
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => ( {
shortcut : select ( external _wp _keyboardShortcuts _namespaceObject . store ) . getShortcutRepresentation ( 'core/edit-post/toggle-mode' ) ,
isRichEditingEnabled : select ( external _wp _editor _namespaceObject . store ) . getEditorSettings ( ) . richEditingEnabled ,
isCodeEditingEnabled : select ( external _wp _editor _namespaceObject . store ) . getEditorSettings ( ) . codeEditingEnabled ,
isEditingTemplate : select ( store _store ) . isEditingTemplate ( ) ,
mode : select ( store _store ) . getEditorMode ( )
2021-06-25 17:52:22 +02:00
} ) , [ ] ) ;
2021-05-21 12:14:23 +02:00
const {
2021-06-25 17:52:22 +02:00
switchEditorMode
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
2022-01-04 06:39:28 +01:00
if ( isEditingTemplate ) {
return null ;
}
2023-09-26 16:23:26 +02:00
let selectedMode = mode ;
if ( ! isRichEditingEnabled && mode === 'visual' ) {
selectedMode = 'text' ;
}
if ( ! isCodeEditingEnabled && mode === 'text' ) {
selectedMode = 'visual' ;
2021-05-21 12:14:23 +02:00
}
2021-06-25 17:52:22 +02:00
const choices = MODES . map ( choice => {
2023-09-26 16:23:26 +02:00
if ( ! isCodeEditingEnabled && choice . value === 'text' ) {
choice = {
... choice ,
disabled : true
} ;
}
if ( ! isRichEditingEnabled && choice . value === 'visual' ) {
choice = {
... choice ,
disabled : true ,
info : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'You can enable the visual editor in your profile settings.' )
} ;
}
if ( choice . value !== selectedMode && ! choice . disabled ) {
return {
... choice ,
2021-06-25 17:52:22 +02:00
shortcut
} ;
2021-05-21 12:14:23 +02:00
}
2021-06-25 17:52:22 +02:00
return choice ;
} ) ;
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . MenuGroup , {
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Editor' )
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . MenuItemsChoice , {
2021-06-25 17:52:22 +02:00
choices : choices ,
2023-09-26 16:23:26 +02:00
value : selectedMode ,
2021-06-25 17:52:22 +02:00
onSelect : switchEditorMode
} ) ) ;
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var mode _switcher = ( ModeSwitcher ) ;
2021-06-25 17:52:22 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/preferences-menu-item/index.js
2021-06-25 17:52:22 +02:00
/ * *
* WordPress dependencies
2021-06-15 17:30:24 +02:00
* /
2021-06-25 17:52:22 +02:00
2023-06-28 09:04:13 +02:00
2023-09-26 16:23:26 +02:00
2021-06-15 17:30:24 +02:00
/ * *
* Internal dependencies
* /
2021-06-25 17:52:22 +02:00
function PreferencesMenuItem ( ) {
2021-06-15 17:30:24 +02:00
const {
2021-06-25 17:52:22 +02:00
openModal
2023-06-28 09:04:13 +02:00
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store ) ;
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . MenuItem , {
2021-06-25 17:52:22 +02:00
onClick : ( ) => {
2023-06-28 09:04:13 +02:00
openModal ( PREFERENCES _MODAL _NAME ) ;
2021-06-25 17:52:22 +02:00
}
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Preferences' ) ) ;
2021-06-15 17:30:24 +02:00
}
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/writing-menu/index.js
2021-06-15 17:30:24 +02:00
2021-06-25 17:52:22 +02:00
/ * *
* WordPress dependencies
* /
2021-05-19 17:09:27 +02:00
2021-06-25 17:52:22 +02:00
2023-02-07 08:04:52 +01:00
2023-09-26 16:23:26 +02:00
2023-02-07 08:04:52 +01:00
/ * *
* Internal dependencies
* /
2021-06-25 17:52:22 +02:00
function WritingMenu ( ) {
2023-02-07 08:04:52 +01:00
const registry = ( 0 , external _wp _data _namespaceObject . useRegistry ) ( ) ;
const isDistractionFree = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => select ( external _wp _blockEditor _namespaceObject . store ) . getSettings ( ) . isDistractionFree , [ ] ) ;
const {
setIsInserterOpened ,
setIsListViewOpened ,
closeGeneralSidebar
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
const {
set : setPreference
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _preferences _namespaceObject . store ) ;
const toggleDistractionFree = ( ) => {
registry . batch ( ( ) => {
setPreference ( 'core/edit-post' , 'fixedToolbar' , false ) ;
setIsInserterOpened ( false ) ;
setIsListViewOpened ( false ) ;
closeGeneralSidebar ( ) ;
} ) ;
} ;
2022-04-11 14:04:30 +02:00
const isLargeViewport = ( 0 , external _wp _compose _namespaceObject . useViewportMatch ) ( 'medium' ) ;
2021-06-25 17:52:22 +02:00
if ( ! isLargeViewport ) {
return null ;
2021-05-19 17:09:27 +02:00
}
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . MenuGroup , {
label : ( 0 , external _wp _i18n _namespaceObject . _x ) ( 'View' , 'noun' )
2022-04-12 17:12:47 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _preferences _namespaceObject . PreferenceToggleMenuItem , {
2021-11-08 15:29:21 +01:00
scope : "core/edit-post" ,
2023-02-07 08:04:52 +01:00
disabled : isDistractionFree ,
2022-04-12 17:12:47 +02:00
name : "fixedToolbar" ,
2022-04-11 14:04:30 +02:00
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Top toolbar' ) ,
info : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Access all block and document tools in a single place' ) ,
messageActivated : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Top toolbar activated' ) ,
messageDeactivated : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Top toolbar deactivated' )
2022-04-12 17:12:47 +02:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _preferences _namespaceObject . PreferenceToggleMenuItem , {
2021-11-08 15:29:21 +01:00
scope : "core/edit-post" ,
2022-04-12 17:12:47 +02:00
name : "focusMode" ,
2022-04-11 14:04:30 +02:00
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Spotlight mode' ) ,
info : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Focus on one block at a time' ) ,
messageActivated : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Spotlight mode activated' ) ,
messageDeactivated : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Spotlight mode deactivated' )
2022-04-12 17:12:47 +02:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _preferences _namespaceObject . PreferenceToggleMenuItem , {
2021-11-08 15:29:21 +01:00
scope : "core/edit-post" ,
2022-04-12 17:12:47 +02:00
name : "fullscreenMode" ,
2022-04-11 14:04:30 +02:00
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Fullscreen mode' ) ,
2023-02-07 08:04:52 +01:00
info : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Show and hide admin UI' ) ,
2022-04-11 14:04:30 +02:00
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' )
2023-02-07 08:04:52 +01:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _preferences _namespaceObject . PreferenceToggleMenuItem , {
scope : "core/edit-post" ,
name : "distractionFree" ,
onToggle : toggleDistractionFree ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Distraction free' ) ,
info : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Write with calmness' ) ,
messageActivated : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Distraction free mode activated' ) ,
messageDeactivated : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Distraction free mode deactivated' ) ,
shortcut : external _wp _keycodes _namespaceObject . displayShortcut . primaryShift ( '\\' )
2021-06-25 17:52:22 +02:00
} ) ) ;
2020-01-08 12:57:23 +01:00
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var writing _menu = ( WritingMenu ) ;
2021-05-07 13:48:27 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/more-menu/index.js
2018-12-14 05:41:57 +01:00
2019-10-15 17:37:08 +02:00
/ * *
2021-01-28 03:04:13 +01:00
* WordPress dependencies
2019-10-15 17:37:08 +02:00
* /
2018-12-14 05:41:57 +01:00
2019-03-21 13:48:00 +01:00
2023-09-26 16:23:26 +02:00
2019-09-19 17:19:18 +02:00
/ * *
2021-05-19 17:09:27 +02:00
* Internal dependencies
2019-09-19 17:19:18 +02:00
* /
2019-03-21 13:48:00 +01:00
2019-09-19 17:19:18 +02:00
2019-03-21 13:48:00 +01:00
2021-01-28 03:04:13 +01:00
2023-06-27 16:24:19 +02:00
const MoreMenu = ( {
showIconLabels
} ) => {
2022-04-11 14:04:30 +02:00
const isLargeViewport = ( 0 , external _wp _compose _namespaceObject . useViewportMatch ) ( 'large' ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( MoreMenuDropdown , {
2021-06-25 17:52:22 +02:00
toggleProps : {
showTooltip : ! showIconLabels ,
2021-11-08 15:29:21 +01:00
... ( showIconLabels && {
variant : 'tertiary'
} )
2021-06-25 17:52:22 +02:00
}
2023-06-27 16:24:19 +02:00
} , ( {
onClose
} ) => ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , showIconLabels && ! isLargeViewport && ( 0 , external _wp _element _namespaceObject . createElement ) ( pinned _items . Slot , {
className : showIconLabels && 'show-icon-labels' ,
scope : "core/edit-post"
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( writing _menu , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( mode _switcher , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( action _item . Slot , {
name : "core/edit-post/plugin-more-menu" ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Plugins' ) ,
as : external _wp _components _namespaceObject . MenuGroup ,
fillProps : {
onClick : onClose
}
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( tools _more _menu _group . Slot , {
fillProps : {
2021-06-25 17:52:22 +02:00
onClose
2023-06-27 16:24:19 +02:00
}
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . MenuGroup , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( PreferencesMenuItem , null ) ) ) ) ;
2021-06-25 17:52:22 +02:00
} ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var more _menu = ( MoreMenu ) ;
2021-01-28 03:04:13 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/post-publish-button-or-toggle.js
2019-03-21 13:48:00 +01:00
2021-01-28 03:04:13 +01:00
/ * *
* WordPress dependencies
* /
2019-10-15 17:37:08 +02:00
2019-03-21 13:48:00 +01:00
2023-09-26 16:23:26 +02:00
2021-01-28 03:04:13 +01:00
/ * *
2021-05-07 13:48:27 +02:00
* Internal dependencies
2021-01-28 03:04:13 +01:00
* /
2023-06-27 16:24:19 +02:00
function PostPublishButtonOrToggle ( {
forceIsDirty ,
hasPublishAction ,
isBeingScheduled ,
isPending ,
isPublished ,
isPublishSidebarEnabled ,
isPublishSidebarOpened ,
isScheduled ,
togglePublishSidebar ,
setEntitiesSavedStatesCallback
} ) {
2021-06-25 17:52:22 +02:00
const IS _TOGGLE = 'toggle' ;
const IS _BUTTON = 'button' ;
2022-04-11 14:04:30 +02:00
const isSmallerThanMediumViewport = ( 0 , external _wp _compose _namespaceObject . useViewportMatch ) ( 'medium' , '<' ) ;
2021-06-25 17:52:22 +02:00
let component ;
2023-09-26 16:23:26 +02:00
2021-06-25 17:52:22 +02:00
/ * *
* Conditions to show a BUTTON ( publish directly ) or a TOGGLE ( open publish sidebar ) :
*
* 1 ) We want to show a BUTTON when the post status is at the _final stage _
2023-06-27 16:24:19 +02:00
* for a particular role ( see https : //wordpress.org/documentation/article/post-status/):
2021-06-25 17:52:22 +02:00
*
* - is published
* - is scheduled to be published
* - is pending and can ' t be published ( but only for viewports >= medium ) .
* Originally , we considered showing a button for pending posts that couldn ' t be published
* ( for example , for an author with the contributor role ) . Some languages can have
* long translations for "Submit for review" , so given the lack of UI real estate available
* we decided to take into account the viewport in that case .
* See : https : //github.com/WordPress/gutenberg/issues/10475
*
* 2 ) Then , in small viewports , we ' ll show a TOGGLE .
*
* 3 ) Finally , we ' ll use the publish sidebar status to decide :
*
* - if it is enabled , we show a TOGGLE
* - if it is disabled , we show a BUTTON
* /
if ( isPublished || isScheduled && isBeingScheduled || isPending && ! hasPublishAction && ! isSmallerThanMediumViewport ) {
component = IS _BUTTON ;
} else if ( isSmallerThanMediumViewport ) {
component = IS _TOGGLE ;
} else if ( isPublishSidebarEnabled ) {
component = IS _TOGGLE ;
} else {
component = IS _BUTTON ;
}
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostPublishButton , {
2021-06-25 17:52:22 +02:00
forceIsDirty : forceIsDirty ,
isOpen : isPublishSidebarOpened ,
isToggle : component === IS _TOGGLE ,
onToggle : togglePublishSidebar ,
setEntitiesSavedStatesCallback : setEntitiesSavedStatesCallback
} ) ;
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var post _publish _button _or _toggle = ( ( 0 , external _wp _compose _namespaceObject . compose ) ( ( 0 , external _wp _data _namespaceObject . withSelect ) ( select => {
2023-06-27 16:24:19 +02:00
var _select$getCurrentPos ;
return {
hasPublishAction : ( _select$getCurrentPos = select ( external _wp _editor _namespaceObject . store ) . getCurrentPost ( ) ? . _links ? . [ 'wp:action-publish' ] ) !== null && _select$getCurrentPos !== void 0 ? _select$getCurrentPos : false ,
isBeingScheduled : select ( external _wp _editor _namespaceObject . store ) . isEditedPostBeingScheduled ( ) ,
isPending : select ( external _wp _editor _namespaceObject . store ) . isCurrentPostPending ( ) ,
isPublished : select ( external _wp _editor _namespaceObject . store ) . isCurrentPostPublished ( ) ,
isPublishSidebarEnabled : select ( external _wp _editor _namespaceObject . store ) . isPublishSidebarEnabled ( ) ,
isPublishSidebarOpened : select ( store _store ) . isPublishSidebarOpened ( ) ,
isScheduled : select ( external _wp _editor _namespaceObject . store ) . isCurrentPostScheduled ( )
} ;
} ) , ( 0 , external _wp _data _namespaceObject . withDispatch ) ( dispatch => {
2021-06-25 17:52:22 +02:00
const {
togglePublishSidebar
2022-04-11 14:04:30 +02:00
} = dispatch ( store _store ) ;
2021-06-25 17:52:22 +02:00
return {
togglePublishSidebar
} ;
} ) ) ( PostPublishButtonOrToggle ) ) ;
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/device-preview/index.js
2021-06-25 17:52:22 +02:00
2021-01-28 03:04:13 +01:00
/ * *
2021-06-25 17:52:22 +02:00
* WordPress dependencies
2021-01-28 03:04:13 +01:00
* /
2019-09-19 17:19:18 +02:00
2021-05-07 13:48:27 +02:00
2019-10-15 17:37:08 +02:00
2019-03-21 13:48:00 +01:00
2020-06-26 15:33:47 +02:00
2021-06-25 17:52:22 +02:00
2022-09-20 17:43:29 +02:00
2023-09-26 16:23:26 +02:00
2021-06-25 17:52:22 +02:00
/ * *
* Internal dependencies
* /
function DevicePreview ( ) {
const {
hasActiveMetaboxes ,
isPostSaveable ,
2022-09-20 17:43:29 +02:00
isViewable ,
2021-06-25 17:52:22 +02:00
deviceType
2022-09-20 17:43:29 +02:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
2023-06-27 16:24:19 +02:00
var _postType$viewable ;
2022-09-20 17:43:29 +02:00
const {
getEditedPostAttribute
} = select ( external _wp _editor _namespaceObject . store ) ;
const {
getPostType
} = select ( external _wp _coreData _namespaceObject . store ) ;
const postType = getPostType ( getEditedPostAttribute ( 'type' ) ) ;
return {
hasActiveMetaboxes : select ( store _store ) . hasMetaBoxes ( ) ,
isPostSaveable : select ( external _wp _editor _namespaceObject . store ) . isEditedPostSaveable ( ) ,
2023-06-27 16:24:19 +02:00
isViewable : ( _postType$viewable = postType ? . viewable ) !== null && _postType$viewable !== void 0 ? _postType$viewable : false ,
2022-09-20 17:43:29 +02:00
deviceType : select ( store _store ) . _ _experimentalGetPreviewDeviceType ( )
} ;
} , [ ] ) ;
2021-06-25 17:52:22 +02:00
const {
_ _experimentalSetPreviewDeviceType : setPreviewDeviceType
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . _ _experimentalPreviewOptions , {
2021-06-25 17:52:22 +02:00
isEnabled : isPostSaveable ,
className : "edit-post-post-preview-dropdown" ,
deviceType : deviceType ,
2023-06-27 16:24:19 +02:00
setDeviceType : setPreviewDeviceType ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Preview' )
2023-09-26 16:23:26 +02:00
} , ( {
onClose
} ) => isViewable && ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . MenuGroup , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
2021-06-25 17:52:22 +02:00
className : "edit-post-header-preview__grouping-external"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostPreviewButton , {
2023-09-26 16:23:26 +02:00
className : "edit-post-header-preview__button-external" ,
2021-06-25 17:52:22 +02:00
role : "menuitem" ,
forceIsAutosaveable : hasActiveMetaboxes ,
2022-04-11 14:04:30 +02:00
textContent : ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Preview in new tab' ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Icon , {
icon : library _external
2023-09-26 16:23:26 +02:00
} ) ) ,
onPreview : onClose
2021-06-25 17:52:22 +02:00
} ) ) ) ) ;
2021-05-19 17:09:27 +02:00
}
2021-01-28 03:04:13 +01:00
2023-06-27 16:24:19 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/view-link/index.js
/ * *
* WordPress dependencies
* /
function ViewLink ( ) {
const {
permalink ,
isPublished ,
label
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
// Grab post type to retrieve the view_item label.
const postTypeSlug = select ( external _wp _editor _namespaceObject . store ) . getCurrentPostType ( ) ;
const postType = select ( external _wp _coreData _namespaceObject . store ) . getPostType ( postTypeSlug ) ;
return {
permalink : select ( external _wp _editor _namespaceObject . store ) . getPermalink ( ) ,
isPublished : select ( external _wp _editor _namespaceObject . store ) . isCurrentPostPublished ( ) ,
label : postType ? . labels . view _item
} ;
2023-09-26 16:23:26 +02:00
} , [ ] ) ;
2023-06-27 16:24:19 +02:00
2023-09-26 16:23:26 +02:00
// Only render the view button if the post is published and has a permalink.
2023-06-27 16:24:19 +02:00
if ( ! isPublished || ! permalink ) {
return null ;
}
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
icon : library _external ,
label : label || ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'View post' ) ,
href : permalink ,
target : "_blank"
} ) ;
}
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/main-dashboard-button/index.js
2020-06-26 15:33:47 +02:00
/ * *
* WordPress dependencies
* /
2021-06-25 17:52:22 +02:00
const slotName = '__experimentalMainDashboardButton' ;
const {
2022-04-11 14:04:30 +02:00
Fill : main _dashboard _button _Fill ,
2021-06-25 17:52:22 +02:00
Slot : MainDashboardButtonSlot
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _components _namespaceObject . createSlotFill ) ( slotName ) ;
const MainDashboardButton = main _dashboard _button _Fill ;
2023-06-27 16:24:19 +02:00
const main _dashboard _button _Slot = ( {
children
} ) => {
2023-02-07 08:04:52 +01:00
const fills = ( 0 , external _wp _components _namespaceObject . _ _experimentalUseSlotFills ) ( slotName ) ;
const hasFills = Boolean ( fills && fills . length ) ;
2021-06-25 17:52:22 +02:00
if ( ! hasFills ) {
return children ;
}
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( MainDashboardButtonSlot , {
2021-06-25 17:52:22 +02:00
bubblesVirtually : true
} ) ;
} ;
MainDashboardButton . Slot = main _dashboard _button _Slot ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var main _dashboard _button = ( MainDashboardButton ) ;
2019-10-15 17:37:08 +02:00
2023-06-27 16:24:19 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-right-small.js
2022-04-11 14:04:30 +02:00
/ * *
* WordPress dependencies
* /
2023-06-27 16:24:19 +02:00
const chevronRightSmall = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
2023-06-27 16:24:19 +02:00
d : "M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"
2022-04-11 14:04:30 +02:00
} ) ) ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var chevron _right _small = ( chevronRightSmall ) ;
2019-03-21 13:48:00 +01:00
2023-06-27 16:24:19 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-left-small.js
2020-06-26 15:33:47 +02:00
2021-05-07 13:48:27 +02:00
/ * *
* WordPress dependencies
* /
2019-10-15 17:37:08 +02:00
2023-06-27 16:24:19 +02:00
const chevronLeftSmall = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
d : "m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"
} ) ) ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var chevron _left _small = ( chevronLeftSmall ) ;
2019-10-15 17:37:08 +02:00
2023-06-27 16:24:19 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/layout.js
2020-02-06 22:03:31 +01:00
2021-05-19 17:09:27 +02:00
/ * *
* WordPress dependencies
* /
2019-10-15 17:37:08 +02:00
2023-06-27 16:24:19 +02:00
const layout = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
d : "M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"
} ) ) ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var library _layout = ( layout ) ;
2019-10-15 17:37:08 +02:00
2023-07-28 09:40:16 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/document-actions/index.js
2020-10-13 15:10:30 +02:00
2020-01-08 12:57:23 +01:00
/ * *
2021-01-28 03:04:13 +01:00
* WordPress dependencies
2020-01-08 12:57:23 +01:00
* /
2018-12-14 05:41:57 +01:00
2021-05-07 13:48:27 +02:00
2019-10-15 17:37:08 +02:00
2018-12-14 05:41:57 +01:00
2020-01-08 12:57:23 +01:00
2023-09-26 16:23:26 +02:00
2021-05-19 17:09:27 +02:00
/ * *
* Internal dependencies
* /
2021-05-07 13:48:27 +02:00
2023-07-28 09:40:16 +02:00
function DocumentActions ( ) {
2021-06-25 17:52:22 +02:00
const {
template ,
2023-06-27 16:24:19 +02:00
isEditing
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
2021-06-25 17:52:22 +02:00
const {
isEditingTemplate ,
getEditedPostTemplate
2022-04-11 14:04:30 +02:00
} = select ( store _store ) ;
2021-06-25 17:52:22 +02:00
const _isEditing = isEditingTemplate ( ) ;
return {
template : _isEditing ? getEditedPostTemplate ( ) : null ,
2023-06-27 16:24:19 +02:00
isEditing : _isEditing
2021-06-25 17:52:22 +02:00
} ;
} , [ ] ) ;
const {
clearSelectedBlock
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _blockEditor _namespaceObject . store ) ;
2021-06-25 17:52:22 +02:00
const {
setIsEditingTemplate
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
2023-06-27 16:24:19 +02:00
const {
open : openCommandCenter
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _commands _namespaceObject . store ) ;
2021-06-25 17:52:22 +02:00
if ( ! isEditing || ! template ) {
return null ;
2021-05-19 17:09:27 +02:00
}
2022-04-11 14:04:30 +02:00
let templateTitle = ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Default' ) ;
2023-06-27 16:24:19 +02:00
if ( template ? . title ) {
2021-06-25 17:52:22 +02:00
templateTitle = template . title ;
} else if ( ! ! template ) {
templateTitle = template . slug ;
}
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
2023-07-28 09:40:16 +02:00
className : "edit-post-document-actions"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
2023-07-28 09:40:16 +02:00
className : "edit-post-document-actions__back" ,
2021-06-25 17:52:22 +02:00
onClick : ( ) => {
clearSelectedBlock ( ) ;
setIsEditingTemplate ( false ) ;
2021-11-15 13:50:17 +01:00
} ,
2023-06-27 16:24:19 +02:00
icon : ( 0 , external _wp _i18n _namespaceObject . isRTL ) ( ) ? chevron _right _small : chevron _left _small
2023-07-28 09:40:16 +02:00
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Back' ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
className : "edit-post-document-actions__command" ,
2023-06-27 16:24:19 +02:00
onClick : ( ) => openCommandCenter ( )
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _experimentalHStack , {
2023-07-28 09:40:16 +02:00
className : "edit-post-document-actions__title" ,
2023-06-27 16:24:19 +02:00
spacing : 1 ,
justify : "center"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . BlockIcon , {
icon : library _layout
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _experimentalText , {
2021-12-21 08:02:34 +01:00
size : "body" ,
2023-06-27 16:24:19 +02:00
as : "h1"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . VisuallyHidden , {
as : "span"
2023-07-28 09:40:16 +02:00
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Editing template: ' ) ) , templateTitle ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "span" , {
className : "edit-post-document-actions__shortcut"
} , external _wp _keycodes _namespaceObject . displayShortcut . primary ( 'k' ) ) ) ) ;
2021-06-25 17:52:22 +02:00
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var document _actions = ( DocumentActions ) ;
2020-06-26 15:33:47 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/index.js
2020-06-26 15:33:47 +02:00
2018-12-18 04:14:52 +01:00
/ * *
2021-05-07 13:48:27 +02:00
* WordPress dependencies
2018-12-18 04:14:52 +01:00
* /
2018-12-14 05:41:57 +01:00
2021-05-19 17:09:27 +02:00
2023-09-26 16:23:26 +02:00
2021-01-28 03:04:13 +01:00
/ * *
2021-05-07 13:48:27 +02:00
* Internal dependencies
2021-01-28 03:04:13 +01:00
* /
2018-12-14 05:41:57 +01:00
2020-01-08 12:57:23 +01:00
2021-05-07 13:48:27 +02:00
2020-01-08 12:57:23 +01:00
2021-05-07 13:48:27 +02:00
2023-06-27 16:24:19 +02:00
const slideY = {
hidden : {
y : '-50px'
} ,
2023-09-26 16:23:26 +02:00
distractionFreeInactive : {
y : 0
} ,
hover : {
2023-06-27 16:24:19 +02:00
y : 0 ,
transition : {
type : 'tween' ,
delay : 0.2
}
}
} ;
const slideX = {
hidden : {
x : '-100%'
} ,
2023-09-26 16:23:26 +02:00
distractionFreeInactive : {
x : 0
} ,
2023-06-27 16:24:19 +02:00
hover : {
x : 0 ,
transition : {
type : 'tween' ,
delay : 0.2
}
}
} ;
function Header ( {
2023-09-26 16:23:26 +02:00
setEntitiesSavedStatesCallback ,
setListViewToggleElement
2023-06-27 16:24:19 +02:00
} ) {
2023-02-07 08:04:52 +01:00
const isLargeViewport = ( 0 , external _wp _compose _namespaceObject . useViewportMatch ) ( 'large' ) ;
2021-05-19 17:09:27 +02:00
const {
hasActiveMetaboxes ,
isPublishSidebarOpened ,
2023-06-27 16:24:19 +02:00
showIconLabels
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => ( {
hasActiveMetaboxes : select ( store _store ) . hasMetaBoxes ( ) ,
isPublishSidebarOpened : select ( store _store ) . isPublishSidebarOpened ( ) ,
2023-06-27 16:24:19 +02:00
showIconLabels : select ( store _store ) . isFeatureActive ( 'showIconLabels' )
2021-05-19 17:09:27 +02:00
} ) , [ ] ) ;
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
2023-06-27 16:24:19 +02:00
className : "edit-post-header"
2023-02-07 08:04:52 +01:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( main _dashboard _button . Slot , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _unstableMotion . div , {
variants : slideX ,
transition : {
type : 'tween' ,
delay : 0.8
}
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( fullscreen _mode _close , {
2022-04-12 17:12:47 +02:00
showTooltip : true
2023-02-07 08:04:52 +01:00
} ) ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _unstableMotion . div , {
variants : slideY ,
transition : {
type : 'tween' ,
delay : 0.8
} ,
2021-05-19 17:09:27 +02:00
className : "edit-post-header__toolbar"
2023-09-26 16:23:26 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( header _toolbar , {
setListViewToggleElement : setListViewToggleElement
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
2023-07-28 09:40:16 +02:00
className : "edit-post-header__center"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( document _actions , null ) ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _unstableMotion . div , {
2023-02-07 08:04:52 +01:00
variants : slideY ,
transition : {
type : 'tween' ,
delay : 0.8
} ,
2021-05-19 17:09:27 +02:00
className : "edit-post-header__settings"
2023-09-26 16:23:26 +02:00
} , ! isPublishSidebarOpened &&
// This button isn't completely hidden by the publish sidebar.
2021-05-19 17:09:27 +02:00
// We can't hide the whole toolbar when the publish sidebar is open because
// we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.
// We track that DOM node to return focus to the PostPublishButtonOrToggle
// when the publish sidebar has been closed.
2022-04-11 14:04:30 +02:00
( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostSavedState , {
2021-05-19 17:09:27 +02:00
forceIsDirty : hasActiveMetaboxes ,
showIconLabels : showIconLabels
2022-04-11 14:04:30 +02:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( DevicePreview , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostPreviewButton , {
2023-09-26 16:23:26 +02:00
forceIsAutosaveable : hasActiveMetaboxes
2023-06-27 16:24:19 +02:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( ViewLink , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( post _publish _button _or _toggle , {
2021-05-19 17:09:27 +02:00
forceIsDirty : hasActiveMetaboxes ,
setEntitiesSavedStatesCallback : setEntitiesSavedStatesCallback
2022-04-11 14:04:30 +02:00
} ) , ( isLargeViewport || ! showIconLabels ) && ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( pinned _items . Slot , {
2021-05-19 17:09:27 +02:00
scope : "core/edit-post"
2022-04-11 14:04:30 +02:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( more _menu , {
2021-05-19 17:09:27 +02:00
showIconLabels : showIconLabels
2022-04-11 14:04:30 +02:00
} ) ) , showIconLabels && ! isLargeViewport && ( 0 , external _wp _element _namespaceObject . createElement ) ( more _menu , {
2021-05-19 17:09:27 +02:00
showIconLabels : showIconLabels
} ) ) ) ;
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var header = ( Header ) ;
2021-01-28 03:04:13 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close.js
/ * *
* WordPress dependencies
* /
const close _close = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
d : "M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"
} ) ) ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var library _close = ( close _close ) ;
2021-05-21 12:14:23 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/secondary-sidebar/inserter-sidebar.js
2021-05-21 12:14:23 +02:00
/ * *
* WordPress dependencies
* /
2022-04-12 17:12:47 +02:00
2023-09-26 16:23:26 +02:00
2021-05-21 12:14:23 +02:00
/ * *
* Internal dependencies
* /
function InserterSidebar ( ) {
const {
insertionPoint ,
showMostUsedBlocks
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
2021-05-21 12:14:23 +02:00
const {
isFeatureActive ,
_ _experimentalGetInsertionPoint
2022-04-11 14:04:30 +02:00
} = select ( store _store ) ;
2021-05-21 12:14:23 +02:00
return {
insertionPoint : _ _experimentalGetInsertionPoint ( ) ,
showMostUsedBlocks : isFeatureActive ( 'mostUsedBlocks' )
} ;
} , [ ] ) ;
const {
setIsInserterOpened
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
const isMobileViewport = ( 0 , external _wp _compose _namespaceObject . useViewportMatch ) ( 'medium' , '<' ) ;
2022-04-12 17:12:47 +02:00
const TagName = ! isMobileViewport ? external _wp _components _namespaceObject . VisuallyHidden : 'div' ;
2022-04-11 14:04:30 +02:00
const [ inserterDialogRef , inserterDialogProps ] = ( 0 , external _wp _compose _namespaceObject . _ _experimentalUseDialog ) ( {
2022-04-12 17:12:47 +02:00
onClose : ( ) => setIsInserterOpened ( false ) ,
focusOnMount : null
2021-05-21 12:14:23 +02:00
} ) ;
2022-04-12 17:12:47 +02:00
const libraryRef = ( 0 , external _wp _element _namespaceObject . useRef ) ( ) ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
libraryRef . current . focusSearch ( ) ;
} , [ ] ) ;
2023-06-27 16:24:19 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
ref : inserterDialogRef ,
... inserterDialogProps ,
2021-05-21 12:14:23 +02:00
className : "edit-post-editor__inserter-panel"
2023-06-27 16:24:19 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( TagName , {
2021-05-21 12:14:23 +02:00
className : "edit-post-editor__inserter-panel-header"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
icon : library _close ,
2022-04-12 17:12:47 +02:00
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Close block inserter' ) ,
2021-05-21 12:14:23 +02:00
onClick : ( ) => setIsInserterOpened ( false )
2022-04-11 14:04:30 +02:00
} ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
2021-05-21 12:14:23 +02:00
className : "edit-post-editor__inserter-panel-content"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . _ _experimentalLibrary , {
2021-05-21 12:14:23 +02:00
showMostUsedBlocks : showMostUsedBlocks ,
showInserterHelpPanel : true ,
shouldFocusBlock : isMobileViewport ,
rootClientId : insertionPoint . rootClientId ,
2021-11-08 15:29:21 +01:00
_ _experimentalInsertionIndex : insertionPoint . insertionIndex ,
2022-04-12 17:12:47 +02:00
_ _experimentalFilterValue : insertionPoint . filterValue ,
ref : libraryRef
2021-05-21 12:14:23 +02:00
} ) ) ) ;
}
2023-06-27 16:24:19 +02:00
; // CONCATENATED MODULE: external ["wp","dom"]
2023-09-21 15:26:32 +02:00
var external _wp _dom _namespaceObject = window [ "wp" ] [ "dom" ] ;
2023-02-07 08:04:52 +01:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/secondary-sidebar/list-view-outline.js
/ * *
* WordPress dependencies
* /
function EmptyOutlineIllustration ( ) {
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . SVG , {
width : "138" ,
height : "148" ,
viewBox : "0 0 138 148" ,
fill : "none" ,
xmlns : "http://www.w3.org/2000/svg"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Rect , {
width : "138" ,
height : "148" ,
rx : "4" ,
fill : "#F0F6FC"
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Line , {
x1 : "44" ,
y1 : "28" ,
x2 : "24" ,
y2 : "28" ,
stroke : "#DDDDDD"
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Rect , {
x : "48" ,
y : "16" ,
width : "27" ,
height : "23" ,
rx : "4" ,
fill : "#DDDDDD"
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Path , {
d : "M54.7585 32V23.2727H56.6037V26.8736H60.3494V23.2727H62.1903V32H60.3494V28.3949H56.6037V32H54.7585ZM67.4574 23.2727V32H65.6122V25.0241H65.5611L63.5625 26.277V24.6406L65.723 23.2727H67.4574Z" ,
fill : "black"
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Line , {
x1 : "55" ,
y1 : "59" ,
x2 : "24" ,
y2 : "59" ,
stroke : "#DDDDDD"
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Rect , {
x : "59" ,
y : "47" ,
width : "29" ,
height : "23" ,
rx : "4" ,
fill : "#DDDDDD"
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Path , {
d : "M65.7585 63V54.2727H67.6037V57.8736H71.3494V54.2727H73.1903V63H71.3494V59.3949H67.6037V63H65.7585ZM74.6605 63V61.6705L77.767 58.794C78.0313 58.5384 78.2528 58.3082 78.4318 58.1037C78.6136 57.8991 78.7514 57.6989 78.8452 57.5028C78.9389 57.304 78.9858 57.0895 78.9858 56.8594C78.9858 56.6037 78.9276 56.3835 78.8111 56.1989C78.6946 56.0114 78.5355 55.8679 78.3338 55.7685C78.1321 55.6662 77.9034 55.6151 77.6477 55.6151C77.3807 55.6151 77.1477 55.669 76.9489 55.777C76.75 55.8849 76.5966 56.0398 76.4886 56.2415C76.3807 56.4432 76.3267 56.6832 76.3267 56.9616H74.5753C74.5753 56.3906 74.7045 55.8949 74.9631 55.4744C75.2216 55.054 75.5838 54.7287 76.0497 54.4986C76.5156 54.2685 77.0526 54.1534 77.6605 54.1534C78.2855 54.1534 78.8295 54.2642 79.2926 54.4858C79.7585 54.7045 80.1207 55.0085 80.3793 55.3977C80.6378 55.7869 80.767 56.233 80.767 56.7358C80.767 57.0653 80.7017 57.3906 80.571 57.7116C80.4432 58.0327 80.2145 58.3892 79.8849 58.7812C79.5554 59.1705 79.0909 59.6378 78.4915 60.1832L77.2173 61.4318V61.4915H80.8821V63H74.6605Z" ,
fill : "black"
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Line , {
x1 : "80" ,
y1 : "90" ,
x2 : "24" ,
y2 : "90" ,
stroke : "#DDDDDD"
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Rect , {
x : "84" ,
y : "78" ,
width : "30" ,
height : "23" ,
rx : "4" ,
fill : "#F0B849"
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Path , {
d : "M90.7585 94V85.2727H92.6037V88.8736H96.3494V85.2727H98.1903V94H96.3494V90.3949H92.6037V94H90.7585ZM99.5284 92.4659V91.0128L103.172 85.2727H104.425V87.2841H103.683L101.386 90.919V90.9872H106.564V92.4659H99.5284ZM103.717 94V92.0227L103.751 91.3793V85.2727H105.482V94H103.717Z" ,
fill : "black"
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Line , {
x1 : "66" ,
y1 : "121" ,
x2 : "24" ,
y2 : "121" ,
stroke : "#DDDDDD"
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Rect , {
x : "70" ,
y : "109" ,
width : "29" ,
height : "23" ,
rx : "4" ,
fill : "#DDDDDD"
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Path , {
d : "M76.7585 125V116.273H78.6037V119.874H82.3494V116.273H84.1903V125H82.3494V121.395H78.6037V125H76.7585ZM88.8864 125.119C88.25 125.119 87.6832 125.01 87.1861 124.791C86.6918 124.57 86.3011 124.266 86.0142 123.879C85.7301 123.49 85.5838 123.041 85.5753 122.533H87.4332C87.4446 122.746 87.5142 122.933 87.642 123.095C87.7727 123.254 87.946 123.378 88.1619 123.466C88.3778 123.554 88.6207 123.598 88.8906 123.598C89.1719 123.598 89.4205 123.548 89.6364 123.449C89.8523 123.349 90.0213 123.212 90.1435 123.036C90.2656 122.859 90.3267 122.656 90.3267 122.426C90.3267 122.193 90.2614 121.987 90.1307 121.808C90.0028 121.626 89.8182 121.484 89.5767 121.382C89.3381 121.28 89.054 121.229 88.7244 121.229H87.9105V119.874H88.7244C89.0028 119.874 89.2486 119.825 89.4616 119.729C89.6776 119.632 89.8452 119.499 89.9645 119.328C90.0838 119.155 90.1435 118.953 90.1435 118.723C90.1435 118.504 90.0909 118.312 89.9858 118.148C89.8835 117.98 89.7386 117.849 89.5511 117.756C89.3665 117.662 89.1506 117.615 88.9034 117.615C88.6534 117.615 88.4247 117.661 88.2173 117.751C88.0099 117.839 87.8438 117.966 87.7188 118.131C87.5938 118.295 87.527 118.489 87.5185 118.71H85.75C85.7585 118.207 85.902 117.764 86.1804 117.381C86.4588 116.997 86.8338 116.697 87.3054 116.482C87.7798 116.263 88.3153 116.153 88.9119 116.153C89.5142 116.153 90.0412 116.263 90.4929 116.482C90.9446 116.7 91.2955 116.996 91.5455 117.368C91.7983 117.737 91.9233 118.152 91.9205 118.612C91.9233 119.101 91.7713 119.509 91.4645 119.835C91.1605 120.162 90.7642 120.369 90.2756 120.457V120.526C90.9176 120.608 91.4063 120.831 91.7415 121.195C92.0795 121.555 92.2472 122.007 92.2443 122.55C92.2472 123.047 92.1037 123.489 91.8139 123.875C91.527 124.261 91.1307 124.565 90.625 124.787C90.1193 125.009 89.5398 125.119 88.8864 125.119Z" ,
fill : "black"
} ) ) ;
}
function ListViewOutline ( ) {
const {
headingCount
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
const {
getGlobalBlockCount
} = select ( external _wp _blockEditor _namespaceObject . store ) ;
return {
headingCount : getGlobalBlockCount ( 'core/heading' )
} ;
} , [ ] ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "edit-post-editor__list-view-overview"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _experimentalText , null , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Characters:' ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _experimentalText , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . CharacterCount , null ) ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _experimentalText , null , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Words:' ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . WordCount , null ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _experimentalText , null , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Time to read:' ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . TimeToRead , null ) ) ) , headingCount > 0 ? ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . DocumentOutline , null ) : ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "edit-post-editor__list-view-empty-headings"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( EmptyOutlineIllustration , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "p" , null , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Navigate the structure of your document and address issues like empty or incorrect heading levels.' ) ) ) ) ;
}
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/secondary-sidebar/list-view-sidebar.js
2021-05-21 12:14:23 +02:00
/ * *
* WordPress dependencies
* /
2023-02-07 08:04:52 +01:00
2023-06-27 16:24:19 +02:00
2023-09-26 16:23:26 +02:00
2021-05-21 12:14:23 +02:00
/ * *
* Internal dependencies
* /
2023-09-26 16:23:26 +02:00
function ListViewSidebar ( {
listViewToggleElement
} ) {
2021-05-21 12:14:23 +02:00
const {
setIsListViewOpened
2023-09-26 16:23:26 +02:00
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
2023-06-27 16:24:19 +02:00
2023-09-26 16:23:26 +02:00
// This hook handles focus when the sidebar first renders.
const focusOnMountRef = ( 0 , external _wp _compose _namespaceObject . useFocusOnMount ) ( 'firstElement' ) ;
2021-05-21 12:14:23 +02:00
2023-09-26 16:23:26 +02:00
// When closing the list view, focus should return to the toggle button.
const closeListView = ( 0 , external _wp _element _namespaceObject . useCallback ) ( ( ) => {
setIsListViewOpened ( false ) ;
listViewToggleElement ? . focus ( ) ;
} , [ listViewToggleElement , setIsListViewOpened ] ) ;
const closeOnEscape = ( 0 , external _wp _element _namespaceObject . useCallback ) ( event => {
2022-04-11 14:04:30 +02:00
if ( event . keyCode === external _wp _keycodes _namespaceObject . ESCAPE && ! event . defaultPrevented ) {
2021-11-08 15:29:21 +01:00
event . preventDefault ( ) ;
2023-09-26 16:23:26 +02:00
closeListView ( ) ;
2021-05-21 12:14:23 +02:00
}
2023-09-26 16:23:26 +02:00
} , [ closeListView ] ) ;
2023-06-27 16:24:19 +02:00
2023-09-26 16:23:26 +02:00
// Use internal state instead of a ref to make sure that the component
// re-renders when the dropZoneElement updates.
const [ dropZoneElement , setDropZoneElement ] = ( 0 , external _wp _element _namespaceObject . useState ) ( null ) ;
// Tracks our current tab.
const [ tab , setTab ] = ( 0 , external _wp _element _namespaceObject . useState ) ( 'list-view' ) ;
2023-06-27 16:24:19 +02:00
2023-09-26 16:23:26 +02:00
// This ref refers to the sidebar as a whole.
const sidebarRef = ( 0 , external _wp _element _namespaceObject . useRef ) ( ) ;
// This ref refers to the tab panel.
const tabPanelRef = ( 0 , external _wp _element _namespaceObject . useRef ) ( ) ;
// This ref refers to the list view application area.
const listViewRef = ( 0 , external _wp _element _namespaceObject . useRef ) ( ) ;
2023-06-27 16:24:19 +02:00
2023-09-26 16:23:26 +02:00
// Must merge the refs together so focus can be handled properly in the next function.
const listViewContainerRef = ( 0 , external _wp _compose _namespaceObject . useMergeRefs ) ( [ focusOnMountRef , listViewRef , setDropZoneElement ] ) ;
2023-06-27 16:24:19 +02:00
/ *
* Callback function to handle list view or outline focus .
*
* @ param { string } currentTab The current tab . Either list view or outline .
*
* @ return void
* /
function handleSidebarFocus ( currentTab ) {
// Tab panel focus.
2023-09-26 16:23:26 +02:00
const tabPanelFocus = external _wp _dom _namespaceObject . focus . tabbable . find ( tabPanelRef . current ) [ 0 ] ;
// List view tab is selected.
2023-06-27 16:24:19 +02:00
if ( currentTab === 'list-view' ) {
// Either focus the list view or the tab panel. Must have a fallback because the list view does not render when there are no blocks.
const listViewApplicationFocus = external _wp _dom _namespaceObject . focus . tabbable . find ( listViewRef . current ) [ 0 ] ;
const listViewFocusArea = sidebarRef . current . contains ( listViewApplicationFocus ) ? listViewApplicationFocus : tabPanelFocus ;
2023-09-26 16:23:26 +02:00
listViewFocusArea . focus ( ) ;
// Outline tab is selected.
2023-06-27 16:24:19 +02:00
} else {
tabPanelFocus . focus ( ) ;
}
2023-09-26 16:23:26 +02:00
}
const handleToggleListViewShortcut = ( 0 , external _wp _element _namespaceObject . useCallback ) ( ( ) => {
2023-06-27 16:24:19 +02:00
// If the sidebar has focus, it is safe to close.
if ( sidebarRef . current . contains ( sidebarRef . current . ownerDocument . activeElement ) ) {
2023-09-26 16:23:26 +02:00
closeListView ( ) ;
2023-06-27 16:24:19 +02:00
} else {
2023-09-26 16:23:26 +02:00
// If the list view or outline does not have focus, focus should be moved to it.
2023-06-27 16:24:19 +02:00
handleSidebarFocus ( tab ) ;
}
2023-09-26 16:23:26 +02:00
} , [ closeListView , tab ] ) ;
// This only fires when the sidebar is open because of the conditional rendering.
// It is the same shortcut to open but that is defined as a global shortcut and only fires when the sidebar is closed.
( 0 , external _wp _keyboardShortcuts _namespaceObject . useShortcut ) ( 'core/edit-post/toggle-list-view' , handleToggleListViewShortcut ) ;
2023-06-27 16:24:19 +02:00
/ * *
* Render tab content for a given tab name .
*
* @ param { string } tabName The name of the tab to render .
* /
function renderTabContent ( tabName ) {
if ( tabName === 'list-view' ) {
return ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "edit-post-editor__list-view-panel-content"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . _ _experimentalListView , {
dropZoneElement : dropZoneElement
} ) ) ;
}
return ( 0 , external _wp _element _namespaceObject . createElement ) ( ListViewOutline , null ) ;
2021-05-21 12:14:23 +02:00
}
2023-09-26 16:23:26 +02:00
return (
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
2022-04-11 14:04:30 +02:00
( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
2023-02-07 08:04:52 +01:00
className : "edit-post-editor__document-overview-panel" ,
2023-06-27 16:24:19 +02:00
onKeyDown : closeOnEscape ,
ref : sidebarRef
2023-02-07 08:04:52 +01:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
2023-06-27 16:24:19 +02:00
className : "edit-post-editor__document-overview-panel__close-button" ,
2022-04-11 14:04:30 +02:00
icon : close _small ,
2023-06-27 16:24:19 +02:00
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Close' ) ,
2023-09-26 16:23:26 +02:00
onClick : closeListView
2023-06-27 16:24:19 +02:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . TabPanel , {
className : "edit-post-editor__document-overview-panel__tab-panel" ,
ref : tabPanelRef ,
onSelect : tabName => setTab ( tabName ) ,
selectOnMove : false ,
tabs : [ {
name : 'list-view' ,
2023-07-28 09:40:16 +02:00
title : ( 0 , external _wp _i18n _namespaceObject . _x ) ( 'List View' , 'Post overview' ) ,
2023-06-27 16:24:19 +02:00
className : 'edit-post-sidebar__panel-tab'
} , {
name : 'outline' ,
2023-07-28 09:40:16 +02:00
title : ( 0 , external _wp _i18n _namespaceObject . _x ) ( 'Outline' , 'Post overview' ) ,
2023-06-27 16:24:19 +02:00
className : 'edit-post-sidebar__panel-tab'
} ]
} , currentTab => ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "edit-post-editor__list-view-container" ,
ref : listViewContainerRef
} , renderTabContent ( currentTab . name ) ) ) )
2021-05-21 12:14:23 +02:00
) ;
}
2023-02-07 08:04:52 +01:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/drawer-left.js
2018-12-18 04:14:52 +01:00
2019-10-15 17:37:08 +02:00
/ * *
* WordPress dependencies
* /
2019-03-07 10:09:59 +01:00
2023-02-07 08:04:52 +01:00
const drawerLeft = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
width : "24" ,
height : "24" ,
2022-04-11 14:04:30 +02:00
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
fillRule : "evenodd" ,
2023-02-07 08:04:52 +01:00
clipRule : "evenodd" ,
d : "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM8.5 18.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h2.5v13zm10-.5c0 .3-.2.5-.5.5h-8v-13h8c.3 0 .5.2.5.5v12z"
} ) ) ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var drawer _left = ( drawerLeft ) ;
2023-02-07 08:04:52 +01:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/drawer-right.js
/ * *
* WordPress dependencies
* /
const drawerRight = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
width : "24" ,
height : "24" ,
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
fillRule : "evenodd" ,
clipRule : "evenodd" ,
d : "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z"
2022-04-11 14:04:30 +02:00
} ) ) ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var drawer _right = ( drawerRight ) ;
2018-12-14 05:41:57 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/settings-header/index.js
2021-05-19 17:09:27 +02:00
2021-05-07 13:48:27 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* WordPress dependencies
* /
2023-09-26 16:23:26 +02:00
2022-04-11 14:04:30 +02:00
/ * *
* Internal dependencies
2021-05-07 13:48:27 +02:00
* /
2023-06-27 16:24:19 +02:00
const SettingsHeader = ( {
sidebarName
} ) => {
2021-05-19 17:09:27 +02:00
const {
openGeneralSidebar
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
2021-05-19 17:09:27 +02:00
const openDocumentSettings = ( ) => openGeneralSidebar ( 'edit-post/document' ) ;
const openBlockSettings = ( ) => openGeneralSidebar ( 'edit-post/block' ) ;
const {
documentLabel ,
isTemplateMode
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
const postTypeLabel = select ( external _wp _editor _namespaceObject . store ) . getPostTypeLabel ( ) ;
2021-05-19 17:09:27 +02:00
return {
2021-11-08 15:29:21 +01:00
// translators: Default label for the Document sidebar tab, not selected.
2022-04-11 14:04:30 +02:00
documentLabel : postTypeLabel || ( 0 , external _wp _i18n _namespaceObject . _x ) ( 'Document' , 'noun' ) ,
isTemplateMode : select ( store _store ) . isEditingTemplate ( )
2021-05-19 17:09:27 +02:00
} ;
} , [ ] ) ;
2023-09-26 16:23:26 +02:00
const [ documentAriaLabel , documentActiveClass ] = sidebarName === 'edit-post/document' ?
// translators: ARIA label for the Document sidebar tab, selected. %s: Document label.
2022-04-11 14:04:30 +02:00
[ ( 0 , external _wp _i18n _namespaceObject . sprintf ) ( ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( '%s (selected)' ) , documentLabel ) , 'is-active' ] : [ documentLabel , '' ] ;
2023-09-26 16:23:26 +02:00
const [ blockAriaLabel , blockActiveClass ] = sidebarName === 'edit-post/block' ?
// translators: ARIA label for the Block Settings Sidebar tab, selected.
[ ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Block (selected)' ) , 'is-active' ] :
// translators: ARIA label for the Block Settings Sidebar tab, not selected.
2022-04-11 14:04:30 +02:00
[ ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Block' ) , '' ] ;
const [ templateAriaLabel , templateActiveClass ] = sidebarName === 'edit-post/document' ? [ ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Template (selected)' ) , 'is-active' ] : [ ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Template' ) , '' ] ;
2021-05-19 17:09:27 +02:00
2023-09-26 16:23:26 +02:00
/* Use a list so screen readers will announce how many tabs there are. */
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( "ul" , null , ! isTemplateMode && ( 0 , external _wp _element _namespaceObject . createElement ) ( "li" , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
2021-05-19 17:09:27 +02:00
onClick : openDocumentSettings ,
className : ` edit-post-sidebar__panel-tab ${ documentActiveClass } ` ,
"aria-label" : documentAriaLabel ,
"data-label" : documentLabel
2022-04-11 14:04:30 +02:00
} , documentLabel ) ) , isTemplateMode && ( 0 , external _wp _element _namespaceObject . createElement ) ( "li" , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
2021-05-19 17:09:27 +02:00
onClick : openDocumentSettings ,
className : ` edit-post-sidebar__panel-tab ${ templateActiveClass } ` ,
"aria-label" : templateAriaLabel ,
2022-04-11 14:04:30 +02:00
"data-label" : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Template' )
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Template' ) ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "li" , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
2021-05-19 17:09:27 +02:00
onClick : openBlockSettings ,
className : ` edit-post-sidebar__panel-tab ${ blockActiveClass } ` ,
2023-09-26 16:23:26 +02:00
"aria-label" : blockAriaLabel
// translators: Data label for the Block Settings Sidebar tab.
2021-05-19 17:09:27 +02:00
,
2022-04-11 14:04:30 +02:00
"data-label" : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Block' )
2023-09-26 16:23:26 +02:00
} ,
// translators: Text label for the Block Settings Sidebar tab.
2022-04-11 14:04:30 +02:00
( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Block' ) ) ) ) ;
2021-05-19 17:09:27 +02:00
} ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var settings _header = ( SettingsHeader ) ;
2021-05-07 13:48:27 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-visibility/index.js
2021-05-07 13:48:27 +02:00
2021-05-19 17:09:27 +02:00
/ * *
* WordPress dependencies
* /
2021-05-07 13:48:27 +02:00
2018-12-14 05:41:57 +01:00
2022-09-20 17:43:29 +02:00
2021-05-19 17:09:27 +02:00
function PostVisibility ( ) {
2022-09-20 17:43:29 +02:00
// Use internal state instead of a ref to make sure that the component
// re-renders when the popover's anchor updates.
2023-09-26 16:23:26 +02:00
const [ popoverAnchor , setPopoverAnchor ] = ( 0 , external _wp _element _namespaceObject . useState ) ( null ) ;
// Memoize popoverProps to avoid returning a new object every time.
2022-09-20 17:43:29 +02:00
const popoverProps = ( 0 , external _wp _element _namespaceObject . useMemo ) ( ( ) => ( {
// Anchor the popover to the middle of the entire row so that it doesn't
// move around when the label changes.
2023-02-07 08:04:52 +01:00
anchor : popoverAnchor ,
placement : 'bottom-end'
2022-09-20 17:43:29 +02:00
} ) , [ popoverAnchor ] ) ;
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostVisibilityCheck , {
2023-06-27 16:24:19 +02:00
render : ( {
canEdit
} ) => ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . PanelRow , {
ref : setPopoverAnchor ,
className : "edit-post-post-visibility"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( "span" , null , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Visibility' ) ) , ! canEdit && ( 0 , external _wp _element _namespaceObject . createElement ) ( "span" , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostVisibilityLabel , null ) ) , canEdit && ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Dropdown , {
contentClassName : "edit-post-post-visibility__dialog" ,
popoverProps : popoverProps ,
focusOnMount : true ,
renderToggle : ( {
isOpen ,
onToggle
} ) => ( 0 , external _wp _element _namespaceObject . createElement ) ( PostVisibilityToggle , {
isOpen : isOpen ,
onClick : onToggle
} ) ,
renderContent : ( {
onClose
} ) => ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostVisibility , {
onClose : onClose
} )
} ) )
2021-05-19 17:09:27 +02:00
} ) ;
}
2023-06-27 16:24:19 +02:00
function PostVisibilityToggle ( {
isOpen ,
onClick
} ) {
2022-09-20 17:43:29 +02:00
const label = ( 0 , external _wp _editor _namespaceObject . usePostVisibilityLabel ) ( ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
className : "edit-post-post-visibility__toggle" ,
variant : "tertiary" ,
2023-09-26 16:23:26 +02:00
"aria-expanded" : isOpen
// translators: %s: Current post visibility.
2022-09-20 17:43:29 +02:00
,
"aria-label" : ( 0 , external _wp _i18n _namespaceObject . sprintf ) ( ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Select visibility: %s' ) , label ) ,
onClick : onClick
} , label ) ;
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var post _visibility = ( PostVisibility ) ;
2018-12-14 05:41:57 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-trash/index.js
2018-12-18 04:14:52 +01:00
2021-01-28 03:04:13 +01:00
/ * *
2021-05-07 13:48:27 +02:00
* WordPress dependencies
2021-01-28 03:04:13 +01:00
* /
2018-12-18 04:14:52 +01:00
2021-05-19 17:09:27 +02:00
function PostTrash ( ) {
2023-07-07 09:21:17 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostTrashCheck , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostTrash , null ) ) ;
2021-05-19 17:09:27 +02:00
}
2021-05-07 13:48:27 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-schedule/index.js
2020-10-13 15:10:30 +02:00
2021-05-07 13:48:27 +02:00
/ * *
2021-05-19 17:09:27 +02:00
* WordPress dependencies
2021-05-07 13:48:27 +02:00
* /
2018-12-18 04:14:52 +01:00
2018-12-14 05:41:57 +01:00
2020-06-26 15:33:47 +02:00
2021-05-19 17:09:27 +02:00
function PostSchedule ( ) {
2022-09-20 17:43:29 +02:00
// Use internal state instead of a ref to make sure that the component
// re-renders when the popover's anchor updates.
2023-09-26 16:23:26 +02:00
const [ popoverAnchor , setPopoverAnchor ] = ( 0 , external _wp _element _namespaceObject . useState ) ( null ) ;
// Memoize popoverProps to avoid returning a new object every time.
2022-09-20 17:43:29 +02:00
const popoverProps = ( 0 , external _wp _element _namespaceObject . useMemo ) ( ( ) => ( {
2023-02-07 08:04:52 +01:00
anchor : popoverAnchor ,
placement : 'bottom-end'
2022-09-20 17:43:29 +02:00
} ) , [ popoverAnchor ] ) ;
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostScheduleCheck , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . PanelRow , {
2021-05-19 17:09:27 +02:00
className : "edit-post-post-schedule" ,
2022-09-20 17:43:29 +02:00
ref : setPopoverAnchor
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( "span" , null , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Publish' ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Dropdown , {
2022-09-20 17:43:29 +02:00
popoverProps : popoverProps ,
2021-05-19 17:09:27 +02:00
contentClassName : "edit-post-post-schedule__dialog" ,
2022-09-20 17:43:29 +02:00
focusOnMount : true ,
2023-06-27 16:24:19 +02:00
renderToggle : ( {
isOpen ,
onToggle
} ) => ( 0 , external _wp _element _namespaceObject . createElement ) ( PostScheduleToggle , {
isOpen : isOpen ,
onClick : onToggle
} ) ,
renderContent : ( {
onClose
} ) => ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostSchedule , {
onClose : onClose
} )
2021-05-19 17:09:27 +02:00
} ) ) ) ;
}
2023-06-27 16:24:19 +02:00
function PostScheduleToggle ( {
isOpen ,
onClick
} ) {
2022-09-20 17:43:29 +02:00
const label = ( 0 , external _wp _editor _namespaceObject . usePostScheduleLabel ) ( ) ;
const fullLabel = ( 0 , external _wp _editor _namespaceObject . usePostScheduleLabel ) ( {
full : true
} ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
className : "edit-post-post-schedule__toggle" ,
variant : "tertiary" ,
label : fullLabel ,
showTooltip : true ,
2023-09-26 16:23:26 +02:00
"aria-expanded" : isOpen
// translators: %s: Current post date.
2022-09-20 17:43:29 +02:00
,
"aria-label" : ( 0 , external _wp _i18n _namespaceObject . sprintf ) ( ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Change date: %s' ) , label ) ,
onClick : onClick
} , label ) ;
}
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-sticky/index.js
/ * *
* WordPress dependencies
* /
2018-12-14 05:41:57 +01:00
2021-05-19 17:09:27 +02:00
function PostSticky ( ) {
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostStickyCheck , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . PanelRow , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostSticky , null ) ) ) ;
2021-05-19 17:09:27 +02:00
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var post _sticky = ( PostSticky ) ;
2021-05-19 17:09:27 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-author/index.js
2021-05-19 17:09:27 +02:00
2021-05-07 13:48:27 +02:00
/ * *
* WordPress dependencies
* /
2018-12-14 05:41:57 +01:00
2021-05-19 17:09:27 +02:00
function PostAuthor ( ) {
2022-04-12 17:12:47 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostAuthorCheck , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . PanelRow , {
className : "edit-post-post-author"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostAuthor , null ) ) ) ;
2021-05-19 17:09:27 +02:00
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var post _author = ( PostAuthor ) ;
2018-12-14 05:41:57 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-slug/index.js
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 16:37:00 +01:00
2018-12-18 04:14:52 +01:00
/ * *
2021-05-19 17:09:27 +02:00
* WordPress dependencies
2018-12-18 04:14:52 +01:00
* /
2021-05-19 17:09:27 +02:00
function PostSlug ( ) {
2022-09-20 17:43:29 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostSlugCheck , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . PanelRow , {
className : "edit-post-post-slug"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostSlug , null ) ) ) ;
2021-05-19 17:09:27 +02:00
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var post _slug = ( PostSlug ) ;
2018-12-18 04:14:52 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-format/index.js
2018-12-18 04:14:52 +01:00
2021-05-19 17:09:27 +02:00
/ * *
* WordPress dependencies
* /
2018-12-18 04:14:52 +01:00
2018-12-14 05:41:57 +01:00
2021-05-19 17:09:27 +02:00
function PostFormat ( ) {
2022-09-20 17:43:29 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostFormatCheck , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . PanelRow , {
className : "edit-post-post-format"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostFormat , null ) ) ) ;
2021-05-19 17:09:27 +02:00
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var post _format = ( PostFormat ) ;
2018-12-14 05:41:57 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-pending-status/index.js
2021-05-07 13:48:27 +02:00
2021-05-19 17:09:27 +02:00
/ * *
* WordPress dependencies
* /
2021-05-07 13:48:27 +02:00
2021-05-19 17:09:27 +02:00
function PostPendingStatus ( ) {
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostPendingStatusCheck , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . PanelRow , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostPendingStatus , null ) ) ) ;
2021-05-19 17:09:27 +02:00
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var post _pending _status = ( PostPendingStatus ) ;
2018-12-14 05:41:57 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/plugin-post-status-info/index.js
2018-12-18 04:14:52 +01:00
2021-05-19 17:09:27 +02:00
/ * *
2022-09-20 17:43:29 +02:00
* Defines as extensibility slot for the Summary panel .
2021-05-19 17:09:27 +02:00
* /
2021-05-07 13:48:27 +02:00
2021-05-19 17:09:27 +02:00
/ * *
* WordPress dependencies
* /
2021-05-07 13:48:27 +02:00
2021-05-19 17:09:27 +02:00
const {
Fill : plugin _post _status _info _Fill ,
Slot : plugin _post _status _info _Slot
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _components _namespaceObject . createSlotFill ) ( 'PluginPostStatusInfo' ) ;
2023-09-26 16:23:26 +02:00
2021-05-19 17:09:27 +02:00
/ * *
2022-09-20 17:43:29 +02:00
* Renders a row in the Summary panel of the Document sidebar .
2021-05-19 17:09:27 +02:00
* It should be noted that this is named and implemented around the function it serves
* and not its location , which may change in future iterations .
*
* @ param { Object } props Component properties .
* @ param { string } [ props . className ] An optional class name added to the row .
* @ param { WPElement } props . children Children to be rendered .
*
* @ example
* ` ` ` js
* // Using ES5 syntax
* var _ _ = wp . i18n . _ _ ;
* var PluginPostStatusInfo = wp . editPost . PluginPostStatusInfo ;
*
* function MyPluginPostStatusInfo ( ) {
* return wp . element . createElement (
* PluginPostStatusInfo ,
* {
* className : 'my-plugin-post-status-info' ,
* } ,
* _ _ ( 'My post status info' )
* )
* }
* ` ` `
*
* @ example
* ` ` ` jsx
* // Using ESNext syntax
* import { _ _ } from '@wordpress/i18n' ;
* import { PluginPostStatusInfo } from '@wordpress/edit-post' ;
*
* const MyPluginPostStatusInfo = ( ) => (
* < PluginPostStatusInfo
* className = "my-plugin-post-status-info"
* >
* { _ _ ( 'My post status info' ) }
* < / P l u g i n P o s t S t a t u s I n f o >
* ) ;
* ` ` `
*
* @ return { WPComponent } The component to be rendered .
* /
2023-06-27 16:24:19 +02:00
const PluginPostStatusInfo = ( {
children ,
className
} ) => ( 0 , external _wp _element _namespaceObject . createElement ) ( plugin _post _status _info _Fill , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . PanelRow , {
className : className
} , children ) ) ;
2021-05-19 17:09:27 +02:00
PluginPostStatusInfo . Slot = plugin _post _status _info _Slot ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var plugin _post _status _info = ( PluginPostStatusInfo ) ;
2018-12-14 05:41:57 +01:00
2022-09-20 17:43:29 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/add-template.js
/ * *
* WordPress dependencies
* /
const addTemplate = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
viewBox : "0 0 24 24" ,
xmlns : "http://www.w3.org/2000/svg"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
fillRule : "evenodd" ,
clipRule : "evenodd" ,
d : "M18.5 5.5V8H20V5.5H22.5V4H20V1.5H18.5V4H16V5.5H18.5ZM13.9624 4H6C4.89543 4 4 4.89543 4 6V18C4 19.1046 4.89543 20 6 20H18C19.1046 20 20 19.1046 20 18V10.0391H18.5V18C18.5 18.2761 18.2761 18.5 18 18.5H10L10 10.4917L16.4589 10.5139L16.4641 9.01389L5.5 8.97618V6C5.5 5.72386 5.72386 5.5 6 5.5H13.9624V4ZM5.5 10.4762V18C5.5 18.2761 5.72386 18.5 6 18.5H8.5L8.5 10.4865L5.5 10.4762Z"
} ) ) ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var add _template = ( addTemplate ) ;
2022-09-20 17:43:29 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-template/create-modal.js
/ * *
* WordPress dependencies
* /
2023-09-26 16:23:26 +02:00
2022-09-20 17:43:29 +02:00
/ * *
* Internal dependencies
* /
const DEFAULT _TITLE = ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Custom Template' ) ;
2023-06-27 16:24:19 +02:00
function PostTemplateCreateModal ( {
onClose
} ) {
2022-09-20 17:43:29 +02:00
const defaultBlockTemplate = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => select ( external _wp _editor _namespaceObject . store ) . getEditorSettings ( ) . defaultBlockTemplate , [ ] ) ;
const {
_ _unstableCreateTemplate ,
_ _unstableSwitchToTemplateMode
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
const [ title , setTitle ] = ( 0 , external _wp _element _namespaceObject . useState ) ( '' ) ;
const [ isBusy , setIsBusy ] = ( 0 , external _wp _element _namespaceObject . useState ) ( false ) ;
const cancel = ( ) => {
setTitle ( '' ) ;
onClose ( ) ;
} ;
const submit = async event => {
event . preventDefault ( ) ;
if ( isBusy ) {
return ;
}
setIsBusy ( true ) ;
const newTemplateContent = defaultBlockTemplate !== null && defaultBlockTemplate !== void 0 ? defaultBlockTemplate : ( 0 , external _wp _blocks _namespaceObject . serialize ) ( [ ( 0 , external _wp _blocks _namespaceObject . createBlock ) ( 'core/group' , {
tagName : 'header' ,
layout : {
inherit : true
}
} , [ ( 0 , external _wp _blocks _namespaceObject . createBlock ) ( 'core/site-title' ) , ( 0 , external _wp _blocks _namespaceObject . createBlock ) ( 'core/site-tagline' ) ] ) , ( 0 , external _wp _blocks _namespaceObject . createBlock ) ( 'core/separator' ) , ( 0 , external _wp _blocks _namespaceObject . createBlock ) ( 'core/group' , {
tagName : 'main'
} , [ ( 0 , external _wp _blocks _namespaceObject . createBlock ) ( 'core/group' , {
layout : {
inherit : true
}
} , [ ( 0 , external _wp _blocks _namespaceObject . createBlock ) ( 'core/post-title' ) ] ) , ( 0 , external _wp _blocks _namespaceObject . createBlock ) ( 'core/post-content' , {
layout : {
inherit : true
}
} ) ] ) ] ) ;
await _ _unstableCreateTemplate ( {
slug : ( 0 , external _wp _url _namespaceObject . cleanForSlug ) ( title || DEFAULT _TITLE ) ,
content : newTemplateContent ,
title : title || DEFAULT _TITLE
} ) ;
setIsBusy ( false ) ;
cancel ( ) ;
_ _unstableSwitchToTemplateMode ( true ) ;
} ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Modal , {
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Create custom template' ) ,
onRequestClose : cancel ,
className : "edit-post-post-template__create-modal"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( "form" , {
className : "edit-post-post-template__create-form" ,
onSubmit : submit
2023-02-07 08:04:52 +01:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _experimentalVStack , {
spacing : "3"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . TextControl , {
_ _nextHasNoMarginBottom : true ,
2022-09-20 17:43:29 +02:00
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Name' ) ,
value : title ,
onChange : setTitle ,
placeholder : DEFAULT _TITLE ,
disabled : isBusy ,
2023-03-09 14:55:07 +01:00
help : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Describe the template, e.g. "Post with sidebar". A custom template can be manually applied to any post or page.' )
2023-02-07 08:04:52 +01:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _experimentalHStack , {
justify : "right"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
2022-09-20 17:43:29 +02:00
variant : "tertiary" ,
onClick : cancel
2023-02-07 08:04:52 +01:00
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Cancel' ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
2022-09-20 17:43:29 +02:00
variant : "primary" ,
type : "submit" ,
isBusy : isBusy ,
"aria-disabled" : isBusy
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Create' ) ) ) ) ) ) ;
}
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-template/form.js
/ * *
* WordPress dependencies
* /
2023-09-26 16:23:26 +02:00
2022-09-20 17:43:29 +02:00
/ * *
* Internal dependencies
* /
2023-06-27 16:24:19 +02:00
function PostTemplateForm ( {
onClose
} ) {
2022-09-20 17:43:29 +02:00
var _options$find , _selectedOption$value ;
const {
isPostsPage ,
availableTemplates ,
fetchedTemplates ,
selectedTemplateSlug ,
canCreate ,
canEdit
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
const {
canUser ,
getEntityRecord ,
getEntityRecords
} = select ( external _wp _coreData _namespaceObject . store ) ;
const editorSettings = select ( external _wp _editor _namespaceObject . store ) . getEditorSettings ( ) ;
const siteSettings = canUser ( 'read' , 'settings' ) ? getEntityRecord ( 'root' , 'site' ) : undefined ;
2023-06-27 16:24:19 +02:00
const _isPostsPage = select ( external _wp _editor _namespaceObject . store ) . getCurrentPostId ( ) === siteSettings ? . page _for _posts ;
2022-09-20 17:43:29 +02:00
const canCreateTemplates = canUser ( 'create' , 'templates' ) ;
return {
isPostsPage : _isPostsPage ,
availableTemplates : editorSettings . availableTemplates ,
fetchedTemplates : canCreateTemplates ? getEntityRecords ( 'postType' , 'wp_template' , {
post _type : select ( external _wp _editor _namespaceObject . store ) . getCurrentPostType ( ) ,
per _page : - 1
} ) : undefined ,
selectedTemplateSlug : select ( external _wp _editor _namespaceObject . store ) . getEditedPostAttribute ( 'template' ) ,
canCreate : canCreateTemplates && ! _isPostsPage && editorSettings . supportsTemplateMode ,
canEdit : canCreateTemplates && editorSettings . supportsTemplateMode && ! ! select ( store _store ) . getEditedPostTemplate ( )
} ;
} , [ ] ) ;
2023-09-26 16:23:26 +02:00
const options = ( 0 , external _wp _element _namespaceObject . useMemo ) ( ( ) => Object . entries ( {
... availableTemplates ,
2023-06-27 16:24:19 +02:00
... Object . fromEntries ( ( fetchedTemplates !== null && fetchedTemplates !== void 0 ? fetchedTemplates : [ ] ) . map ( ( {
slug ,
title
} ) => [ slug , title . rendered ] ) )
} ) . map ( ( [ slug , title ] ) => ( {
value : slug ,
label : title
} ) ) , [ availableTemplates , fetchedTemplates ] ) ;
2022-09-20 17:43:29 +02:00
const selectedOption = ( _options$find = options . find ( option => option . value === selectedTemplateSlug ) ) !== null && _options$find !== void 0 ? _options$find : options . find ( option => ! option . value ) ; // The default option has '' value.
const {
editPost
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _editor _namespaceObject . store ) ;
const {
_ _unstableSwitchToTemplateMode
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
const [ isCreateModalOpen , setIsCreateModalOpen ] = ( 0 , external _wp _element _namespaceObject . useState ) ( false ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "edit-post-post-template__form"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . _ _experimentalInspectorPopoverHeader , {
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Template' ) ,
help : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Templates define the way content is displayed when viewing your site.' ) ,
actions : canCreate ? [ {
icon : add _template ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Add template' ) ,
onClick : ( ) => setIsCreateModalOpen ( true )
} ] : [ ] ,
onClose : onClose
} ) , isPostsPage ? ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Notice , {
className : "edit-post-post-template__notice" ,
status : "warning" ,
isDismissible : false
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'The posts page template cannot be changed.' ) ) : ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . SelectControl , {
2023-02-07 08:04:52 +01:00
_ _nextHasNoMarginBottom : true ,
2022-09-20 17:43:29 +02:00
hideLabelFromVision : true ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Template' ) ,
2023-06-27 16:24:19 +02:00
value : ( _selectedOption$value = selectedOption ? . value ) !== null && _selectedOption$value !== void 0 ? _selectedOption$value : '' ,
2022-09-20 17:43:29 +02:00
options : options ,
onChange : slug => editPost ( {
template : slug || ''
} )
} ) , canEdit && ( 0 , external _wp _element _namespaceObject . createElement ) ( "p" , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
variant : "link" ,
onClick : ( ) => _ _unstableSwitchToTemplateMode ( )
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Edit template' ) ) ) , isCreateModalOpen && ( 0 , external _wp _element _namespaceObject . createElement ) ( PostTemplateCreateModal , {
onClose : ( ) => setIsCreateModalOpen ( false )
} ) ) ;
}
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-template/index.js
/ * *
* WordPress dependencies
* /
2023-09-26 16:23:26 +02:00
2022-09-20 17:43:29 +02:00
/ * *
* Internal dependencies
* /
function PostTemplate ( ) {
// Use internal state instead of a ref to make sure that the component
// re-renders when the popover's anchor updates.
2023-09-26 16:23:26 +02:00
const [ popoverAnchor , setPopoverAnchor ] = ( 0 , external _wp _element _namespaceObject . useState ) ( null ) ;
// Memoize popoverProps to avoid returning a new object every time.
2022-09-20 17:43:29 +02:00
const popoverProps = ( 0 , external _wp _element _namespaceObject . useMemo ) ( ( ) => ( {
2023-02-07 08:04:52 +01:00
anchor : popoverAnchor ,
placement : 'bottom-end'
2022-09-20 17:43:29 +02:00
} ) , [ popoverAnchor ] ) ;
const isVisible = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
var _select$canUser ;
const postTypeSlug = select ( external _wp _editor _namespaceObject . store ) . getCurrentPostType ( ) ;
const postType = select ( external _wp _coreData _namespaceObject . store ) . getPostType ( postTypeSlug ) ;
2023-06-27 16:24:19 +02:00
if ( ! postType ? . viewable ) {
2022-09-20 17:43:29 +02:00
return false ;
}
const settings = select ( external _wp _editor _namespaceObject . store ) . getEditorSettings ( ) ;
const hasTemplates = ! ! settings . availableTemplates && Object . keys ( settings . availableTemplates ) . length > 0 ;
if ( hasTemplates ) {
return true ;
}
if ( ! settings . supportsTemplateMode ) {
return false ;
}
const canCreateTemplates = ( _select$canUser = select ( external _wp _coreData _namespaceObject . store ) . canUser ( 'create' , 'templates' ) ) !== null && _select$canUser !== void 0 ? _select$canUser : false ;
return canCreateTemplates ;
} , [ ] ) ;
if ( ! isVisible ) {
return null ;
}
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . PanelRow , {
className : "edit-post-post-template" ,
ref : setPopoverAnchor
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( "span" , null , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Template' ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Dropdown , {
popoverProps : popoverProps ,
className : "edit-post-post-template__dropdown" ,
contentClassName : "edit-post-post-template__dialog" ,
focusOnMount : true ,
2023-06-27 16:24:19 +02:00
renderToggle : ( {
isOpen ,
onToggle
} ) => ( 0 , external _wp _element _namespaceObject . createElement ) ( PostTemplateToggle , {
isOpen : isOpen ,
onClick : onToggle
} ) ,
renderContent : ( {
onClose
} ) => ( 0 , external _wp _element _namespaceObject . createElement ) ( PostTemplateForm , {
onClose : onClose
} )
2022-09-20 17:43:29 +02:00
} ) ) ;
}
2023-06-27 16:24:19 +02:00
function PostTemplateToggle ( {
isOpen ,
onClick
} ) {
2022-09-20 17:43:29 +02:00
const templateTitle = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
const templateSlug = select ( external _wp _editor _namespaceObject . store ) . getEditedPostAttribute ( 'template' ) ;
const {
supportsTemplateMode ,
availableTemplates
} = select ( external _wp _editor _namespaceObject . store ) . getEditorSettings ( ) ;
if ( ! supportsTemplateMode && availableTemplates [ templateSlug ] ) {
return availableTemplates [ templateSlug ] ;
}
2023-02-07 08:04:52 +01:00
const template = select ( external _wp _coreData _namespaceObject . store ) . canUser ( 'create' , 'templates' ) && select ( store _store ) . getEditedPostTemplate ( ) ;
2023-06-27 16:24:19 +02:00
return template ? . title || template ? . slug || availableTemplates ? . [ templateSlug ] ;
2022-09-20 17:43:29 +02:00
} , [ ] ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
className : "edit-post-post-template__toggle" ,
variant : "tertiary" ,
"aria-expanded" : isOpen ,
2023-09-26 16:23:26 +02:00
"aria-label" : templateTitle ? ( 0 , external _wp _i18n _namespaceObject . sprintf ) (
// translators: %s: Name of the currently selected template.
2022-09-20 17:43:29 +02:00
( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Select template: %s' ) , templateTitle ) : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Select template' ) ,
onClick : onClick
} , templateTitle !== null && templateTitle !== void 0 ? templateTitle : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Default template' ) ) ;
}
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-url/index.js
/ * *
* WordPress dependencies
* /
function PostURL ( ) {
// Use internal state instead of a ref to make sure that the component
// re-renders when the popover's anchor updates.
2023-09-26 16:23:26 +02:00
const [ popoverAnchor , setPopoverAnchor ] = ( 0 , external _wp _element _namespaceObject . useState ) ( null ) ;
// Memoize popoverProps to avoid returning a new object every time.
2022-09-20 17:43:29 +02:00
const popoverProps = ( 0 , external _wp _element _namespaceObject . useMemo ) ( ( ) => ( {
2023-02-07 08:04:52 +01:00
anchor : popoverAnchor ,
placement : 'bottom-end'
2022-09-20 17:43:29 +02:00
} ) , [ popoverAnchor ] ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostURLCheck , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . PanelRow , {
className : "edit-post-post-url" ,
ref : setPopoverAnchor
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( "span" , null , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'URL' ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Dropdown , {
popoverProps : popoverProps ,
className : "edit-post-post-url__dropdown" ,
contentClassName : "edit-post-post-url__dialog" ,
focusOnMount : true ,
2023-06-27 16:24:19 +02:00
renderToggle : ( {
isOpen ,
onToggle
} ) => ( 0 , external _wp _element _namespaceObject . createElement ) ( PostURLToggle , {
isOpen : isOpen ,
onClick : onToggle
} ) ,
renderContent : ( {
onClose
} ) => ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostURL , {
onClose : onClose
} )
2022-09-20 17:43:29 +02:00
} ) ) ) ;
}
2023-06-27 16:24:19 +02:00
function PostURLToggle ( {
isOpen ,
onClick
} ) {
2022-09-20 17:43:29 +02:00
const label = ( 0 , external _wp _editor _namespaceObject . usePostURLLabel ) ( ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
className : "edit-post-post-url__toggle" ,
variant : "tertiary" ,
2023-09-26 16:23:26 +02:00
"aria-expanded" : isOpen
// translators: %s: Current post URL.
2022-09-20 17:43:29 +02:00
,
"aria-label" : ( 0 , external _wp _i18n _namespaceObject . sprintf ) ( ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Change URL: %s' ) , label ) ,
onClick : onClick
} , label ) ;
}
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-status/index.js
2018-12-14 05:41:57 +01:00
2019-10-15 17:37:08 +02:00
/ * *
* WordPress dependencies
* /
2018-12-14 05:41:57 +01:00
2021-01-28 03:04:13 +01:00
2023-06-27 16:24:19 +02:00
2023-09-26 16:23:26 +02:00
2020-01-08 12:57:23 +01:00
/ * *
2021-01-28 03:04:13 +01:00
* Internal dependencies
2020-01-08 12:57:23 +01:00
* /
2021-05-07 13:48:27 +02:00
2021-01-28 03:04:13 +01:00
2021-05-07 13:48:27 +02:00
2022-09-20 17:43:29 +02:00
2021-05-19 17:09:27 +02:00
/ * *
* Module Constants
* /
const PANEL _NAME = 'post-status' ;
2023-06-27 16:24:19 +02:00
function PostStatus ( {
isOpened ,
onTogglePanel
} ) {
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . PanelBody , {
2021-05-19 17:09:27 +02:00
className : "edit-post-post-status" ,
2022-09-20 17:43:29 +02:00
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Summary' ) ,
2021-01-28 03:04:13 +01:00
opened : isOpened ,
onToggle : onTogglePanel
2023-06-27 16:24:19 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( plugin _post _status _info . Slot , null , fills => ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( post _visibility , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( PostSchedule , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( PostTemplate , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( PostURL , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( post _sticky , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( post _pending _status , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( post _format , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( post _slug , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( post _author , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostSyncStatus , null ) , fills , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _experimentalHStack , {
style : {
marginTop : '16px'
} ,
2023-07-07 09:21:17 +02:00
spacing : 4 ,
wrap : true
2023-06-27 16:24:19 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostSwitchToDraftButton , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( PostTrash , null ) ) ) ) ) ;
2020-01-08 12:57:23 +01:00
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var post _status = ( ( 0 , external _wp _compose _namespaceObject . compose ) ( [ ( 0 , external _wp _data _namespaceObject . withSelect ) ( select => {
2021-05-19 17:09:27 +02:00
// We use isEditorPanelRemoved to hide the panel if it was programatically removed. We do
// not use isEditorPanelEnabled since this panel should not be disabled through the UI.
const {
isEditorPanelRemoved ,
isEditorPanelOpened
2022-04-11 14:04:30 +02:00
} = select ( store _store ) ;
2021-05-19 17:09:27 +02:00
return {
isRemoved : isEditorPanelRemoved ( PANEL _NAME ) ,
isOpened : isEditorPanelOpened ( PANEL _NAME )
} ;
2023-06-27 16:24:19 +02:00
} ) , ( 0 , external _wp _compose _namespaceObject . ifCondition ) ( ( {
isRemoved
} ) => ! isRemoved ) , ( 0 , external _wp _data _namespaceObject . withDispatch ) ( dispatch => ( {
2021-05-19 17:09:27 +02:00
onTogglePanel ( ) {
2022-04-11 14:04:30 +02:00
return dispatch ( store _store ) . toggleEditorPanelOpened ( PANEL _NAME ) ;
2021-05-19 17:09:27 +02:00
}
} ) ) ] ) ( PostStatus ) ) ;
2018-12-18 04:14:52 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/last-revision/index.js
2018-12-18 04:14:52 +01:00
2021-05-07 13:48:27 +02:00
/ * *
* WordPress dependencies
* /
2018-12-18 04:14:52 +01:00
2021-05-19 17:09:27 +02:00
function LastRevision ( ) {
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostLastRevisionCheck , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . PanelBody , {
2021-05-19 17:09:27 +02:00
className : "edit-post-last-revision__panel"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostLastRevision , null ) ) ) ;
2021-05-07 13:48:27 +02:00
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var last _revision = ( LastRevision ) ;
2021-05-07 13:48:27 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js
2021-01-28 03:04:13 +01:00
2021-05-19 17:09:27 +02:00
/ * *
* WordPress dependencies
* /
2021-05-07 13:48:27 +02:00
2019-10-15 17:37:08 +02:00
/ * *
2021-05-07 13:48:27 +02:00
* Internal dependencies
2019-10-15 17:37:08 +02:00
* /
2018-12-14 05:41:57 +01:00
2023-06-27 16:24:19 +02:00
function TaxonomyPanel ( {
taxonomy ,
children
} ) {
2023-09-26 16:23:26 +02:00
const slug = taxonomy ? . slug ;
const panelName = slug ? ` taxonomy-panel- ${ slug } ` : '' ;
const {
isEnabled ,
isOpened
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
const {
isEditorPanelEnabled ,
isEditorPanelOpened
} = select ( store _store ) ;
return {
isEnabled : slug ? isEditorPanelEnabled ( panelName ) : false ,
isOpened : slug ? isEditorPanelOpened ( panelName ) : false
} ;
} , [ panelName , slug ] ) ;
const {
toggleEditorPanelOpened
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
2021-05-19 17:09:27 +02:00
if ( ! isEnabled ) {
return null ;
}
2023-06-27 16:24:19 +02:00
const taxonomyMenuName = taxonomy ? . labels ? . menu _name ;
2021-05-19 17:09:27 +02:00
if ( ! taxonomyMenuName ) {
return null ;
}
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . PanelBody , {
2021-05-19 17:09:27 +02:00
title : taxonomyMenuName ,
opened : isOpened ,
2023-09-26 16:23:26 +02:00
onToggle : ( ) => toggleEditorPanelOpened ( panelName )
2021-05-19 17:09:27 +02:00
} , children ) ;
}
2023-09-26 16:23:26 +02:00
/* harmony default export */ var taxonomy _panel = ( TaxonomyPanel ) ;
2021-01-28 03:04:13 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-taxonomies/index.js
2021-01-28 03:04:13 +01:00
2021-05-19 17:09:27 +02:00
/ * *
* WordPress dependencies
* /
2021-01-28 03:04:13 +01:00
2023-09-26 16:23:26 +02:00
2021-05-19 17:09:27 +02:00
/ * *
* Internal dependencies
* /
2021-01-28 03:04:13 +01:00
2021-05-19 17:09:27 +02:00
function PostTaxonomies ( ) {
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostTaxonomiesCheck , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostTaxonomies , {
2021-05-19 17:09:27 +02:00
taxonomyWrapper : ( content , taxonomy ) => {
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( taxonomy _panel , {
2021-05-19 17:09:27 +02:00
taxonomy : taxonomy
} , content ) ;
2021-01-28 03:04:13 +01:00
}
2021-05-19 17:09:27 +02:00
} ) ) ;
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var post _taxonomies = ( PostTaxonomies ) ;
2021-01-28 03:04:13 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/featured-image/index.js
2018-12-14 05:41:57 +01:00
/ * *
* WordPress dependencies
* /
2021-05-07 13:48:27 +02:00
2021-05-19 17:09:27 +02:00
2023-09-26 16:23:26 +02:00
2018-12-14 05:41:57 +01:00
/ * *
2018-12-18 04:14:52 +01:00
* Internal dependencies
2018-12-14 05:41:57 +01:00
* /
2021-05-19 17:09:27 +02:00
/ * *
* Module Constants
* /
const featured _image _PANEL _NAME = 'featured-image' ;
2023-06-27 16:24:19 +02:00
function FeaturedImage ( {
isEnabled ,
isOpened ,
postType ,
onTogglePanel
} ) {
var _postType$labels$feat ;
2021-05-19 17:09:27 +02:00
if ( ! isEnabled ) {
2021-05-07 13:48:27 +02:00
return null ;
2021-01-28 03:04:13 +01:00
}
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostFeaturedImageCheck , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . PanelBody , {
2023-06-27 16:24:19 +02:00
title : ( _postType$labels$feat = postType ? . labels ? . featured _image ) !== null && _postType$labels$feat !== void 0 ? _postType$labels$feat : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Featured image' ) ,
2021-05-19 17:09:27 +02:00
opened : isOpened ,
onToggle : onTogglePanel
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostFeaturedImage , null ) ) ) ;
2021-05-07 13:48:27 +02:00
}
2022-04-11 14:04:30 +02:00
const applyWithSelect = ( 0 , external _wp _data _namespaceObject . withSelect ) ( select => {
2021-05-19 17:09:27 +02:00
const {
getEditedPostAttribute
2022-04-11 14:04:30 +02:00
} = select ( external _wp _editor _namespaceObject . store ) ;
2021-05-19 17:09:27 +02:00
const {
getPostType
2022-04-11 14:04:30 +02:00
} = select ( external _wp _coreData _namespaceObject . store ) ;
2021-05-19 17:09:27 +02:00
const {
isEditorPanelEnabled ,
isEditorPanelOpened
2022-04-11 14:04:30 +02:00
} = select ( store _store ) ;
2021-05-19 17:09:27 +02:00
return {
postType : getPostType ( getEditedPostAttribute ( 'type' ) ) ,
isEnabled : isEditorPanelEnabled ( featured _image _PANEL _NAME ) ,
isOpened : isEditorPanelOpened ( featured _image _PANEL _NAME )
} ;
} ) ;
2022-04-11 14:04:30 +02:00
const applyWithDispatch = ( 0 , external _wp _data _namespaceObject . withDispatch ) ( dispatch => {
2021-05-19 17:09:27 +02:00
const {
toggleEditorPanelOpened
2022-04-11 14:04:30 +02:00
} = dispatch ( store _store ) ;
2021-05-19 17:09:27 +02:00
return {
2023-06-27 16:24:19 +02:00
onTogglePanel : ( ... args ) => toggleEditorPanelOpened ( featured _image _PANEL _NAME , ... args )
2021-05-19 17:09:27 +02:00
} ;
} ) ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var featured _image = ( ( 0 , external _wp _compose _namespaceObject . compose ) ( applyWithSelect , applyWithDispatch ) ( FeaturedImage ) ) ;
2021-05-19 17:09:27 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-excerpt/index.js
2018-12-14 05:41:57 +01:00
2019-10-15 17:37:08 +02:00
/ * *
* WordPress dependencies
* /
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
2023-09-26 16:23:26 +02:00
2021-05-07 13:48:27 +02:00
/ * *
2021-05-19 17:09:27 +02:00
* Internal dependencies
2021-05-07 13:48:27 +02:00
* /
2018-12-18 04:14:52 +01:00
2018-12-14 05:41:57 +01:00
/ * *
2021-05-19 17:09:27 +02:00
* Module Constants
2018-12-14 05:41:57 +01:00
* /
2021-05-19 17:09:27 +02:00
const post _excerpt _PANEL _NAME = 'post-excerpt' ;
2023-06-27 16:24:19 +02:00
function PostExcerpt ( {
isEnabled ,
isOpened ,
onTogglePanel
} ) {
2021-05-19 17:09:27 +02:00
if ( ! isEnabled ) {
return null ;
}
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostExcerptCheck , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . PanelBody , {
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Excerpt' ) ,
2021-05-19 17:09:27 +02:00
opened : isOpened ,
onToggle : onTogglePanel
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostExcerpt , null ) ) ) ;
2021-05-19 17:09:27 +02:00
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var post _excerpt = ( ( 0 , external _wp _compose _namespaceObject . compose ) ( [ ( 0 , external _wp _data _namespaceObject . withSelect ) ( select => {
2021-05-07 13:48:27 +02:00
return {
2022-04-11 14:04:30 +02:00
isEnabled : select ( store _store ) . isEditorPanelEnabled ( post _excerpt _PANEL _NAME ) ,
2022-09-20 17:43:29 +02:00
isOpened : select ( store _store ) . isEditorPanelOpened ( post _excerpt _PANEL _NAME )
2021-05-19 17:09:27 +02:00
} ;
2022-09-20 17:43:29 +02:00
} ) , ( 0 , external _wp _data _namespaceObject . withDispatch ) ( dispatch => ( {
onTogglePanel ( ) {
return dispatch ( store _store ) . toggleEditorPanelOpened ( post _excerpt _PANEL _NAME ) ;
}
} ) ) ] ) ( PostExcerpt ) ) ;
2019-10-15 17:37:08 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/discussion-panel/index.js
2018-12-14 05:41:57 +01:00
/ * *
2019-10-15 17:37:08 +02:00
* WordPress dependencies
2018-12-14 05:41:57 +01:00
* /
2019-10-15 17:37:08 +02:00
2018-12-14 05:41:57 +01:00
/ * *
2021-01-28 03:04:13 +01:00
* Internal dependencies
2018-12-14 05:41:57 +01:00
* /
2019-10-15 17:37:08 +02:00
2021-05-19 17:09:27 +02:00
/ * *
* Module Constants
* /
const discussion _panel _PANEL _NAME = 'discussion-panel' ;
2023-09-26 16:23:26 +02:00
function DiscussionPanel ( ) {
const {
isEnabled ,
isOpened
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
const {
isEditorPanelEnabled ,
isEditorPanelOpened
} = select ( store _store ) ;
return {
isEnabled : isEditorPanelEnabled ( discussion _panel _PANEL _NAME ) ,
isOpened : isEditorPanelOpened ( discussion _panel _PANEL _NAME )
} ;
} , [ ] ) ;
const {
toggleEditorPanelOpened
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
2021-05-19 17:09:27 +02:00
if ( ! isEnabled ) {
return null ;
}
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostTypeSupportCheck , {
2021-05-19 17:09:27 +02:00
supportKeys : [ 'comments' , 'trackbacks' ]
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . PanelBody , {
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Discussion' ) ,
2021-05-19 17:09:27 +02:00
opened : isOpened ,
2023-09-26 16:23:26 +02:00
onToggle : ( ) => toggleEditorPanelOpened ( discussion _panel _PANEL _NAME )
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostTypeSupportCheck , {
2021-05-19 17:09:27 +02:00
supportKeys : "comments"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . PanelRow , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostComments , null ) ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostTypeSupportCheck , {
2021-05-19 17:09:27 +02:00
supportKeys : "trackbacks"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . PanelRow , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostPingbacks , null ) ) ) ) ) ;
2019-09-19 17:19:18 +02:00
}
2023-09-26 16:23:26 +02:00
/* harmony default export */ var discussion _panel = ( DiscussionPanel ) ;
2018-12-18 04:14:52 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/page-attributes/index.js
2021-01-28 03:04:13 +01:00
/ * *
2021-05-19 17:09:27 +02:00
* WordPress dependencies
2021-01-28 03:04:13 +01:00
* /
2018-12-14 05:41:57 +01:00
2020-01-08 12:57:23 +01:00
2023-09-26 16:23:26 +02:00
2021-01-28 03:04:13 +01:00
/ * *
* Internal dependencies
* /
2021-05-19 17:09:27 +02:00
2021-01-28 03:04:13 +01:00
/ * *
2021-05-19 17:09:27 +02:00
* Module Constants
2021-01-28 03:04:13 +01:00
* /
2021-05-19 17:09:27 +02:00
const page _attributes _PANEL _NAME = 'page-attributes' ;
function PageAttributes ( ) {
2023-06-27 16:24:19 +02:00
var _postType$labels$attr ;
2021-05-19 17:09:27 +02:00
const {
isEnabled ,
isOpened ,
postType
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
2021-05-19 17:09:27 +02:00
const {
getEditedPostAttribute
2022-04-11 14:04:30 +02:00
} = select ( external _wp _editor _namespaceObject . store ) ;
2021-05-19 17:09:27 +02:00
const {
isEditorPanelEnabled ,
isEditorPanelOpened
2022-04-11 14:04:30 +02:00
} = select ( store _store ) ;
2021-05-19 17:09:27 +02:00
const {
getPostType
2022-04-11 14:04:30 +02:00
} = select ( external _wp _coreData _namespaceObject . store ) ;
2021-05-19 17:09:27 +02:00
return {
isEnabled : isEditorPanelEnabled ( page _attributes _PANEL _NAME ) ,
isOpened : isEditorPanelOpened ( page _attributes _PANEL _NAME ) ,
postType : getPostType ( getEditedPostAttribute ( 'type' ) )
} ;
} , [ ] ) ;
const {
toggleEditorPanelOpened
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
2021-05-19 17:09:27 +02:00
if ( ! isEnabled || ! postType ) {
return null ;
}
2023-06-27 16:24:19 +02:00
const onTogglePanel = ( ... args ) => toggleEditorPanelOpened ( page _attributes _PANEL _NAME , ... args ) ;
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PageAttributesCheck , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . PanelBody , {
2023-06-27 16:24:19 +02:00
title : ( _postType$labels$attr = postType ? . labels ? . attributes ) !== null && _postType$labels$attr !== void 0 ? _postType$labels$attr : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Page attributes' ) ,
2021-05-19 17:09:27 +02:00
opened : isOpened ,
onToggle : onTogglePanel
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PageAttributesParent , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . PanelRow , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PageAttributesOrder , null ) ) ) ) ;
2021-05-19 17:09:27 +02:00
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var page _attributes = ( PageAttributes ) ;
2020-01-08 12:57:23 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/meta-boxes/meta-boxes-area/index.js
2020-06-26 15:33:47 +02:00
2020-01-08 12:57:23 +01:00
/ * *
* External dependencies
* /
2023-09-26 16:23:26 +02:00
2020-01-08 12:57:23 +01:00
/ * *
* WordPress dependencies
* /
2021-01-28 03:04:13 +01:00
/ * *
* Internal dependencies
* /
2020-06-26 15:33:47 +02:00
2020-01-08 12:57:23 +01:00
2021-11-08 15:29:21 +01:00
/ * *
* Render metabox area .
*
* @ param { Object } props Component props .
* @ param { string } props . location metabox location .
* @ return { WPComponent } The component to be rendered .
* /
2023-06-27 16:24:19 +02:00
function MetaBoxesArea ( {
location
} ) {
2022-04-11 14:04:30 +02: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 ) ( ( ) => {
2021-11-08 15:29:21 +01:00
formRef . current = document . querySelector ( '.metabox-location-' + location ) ;
if ( formRef . current ) {
container . current . appendChild ( formRef . current ) ;
2021-01-28 03:04:13 +01:00
}
2021-11-08 15:29:21 +01:00
return ( ) => {
if ( formRef . current ) {
document . querySelector ( '#metaboxes' ) . appendChild ( formRef . current ) ;
}
} ;
} , [ location ] ) ;
2022-04-11 14:04:30 +02:00
const isSaving = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
return select ( store _store ) . isSavingMetaBoxes ( ) ;
2021-11-08 15:29:21 +01:00
} , [ ] ) ;
const classes = classnames _default ( ) ( 'edit-post-meta-boxes-area' , ` is- ${ location } ` , {
'is-loading' : isSaving
} ) ;
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
2021-11-08 15:29:21 +01:00
className : classes
2022-04-11 14:04:30 +02:00
} , isSaving && ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Spinner , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
2021-11-08 15:29:21 +01:00
className : "edit-post-meta-boxes-area__container" ,
ref : container
2022-04-11 14:04:30 +02:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
2021-11-08 15:29:21 +01:00
className : "edit-post-meta-boxes-area__clear"
} ) ) ;
2021-05-19 17:09:27 +02:00
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var meta _boxes _area = ( MetaBoxesArea ) ;
2020-06-26 15:33:47 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/meta-boxes/meta-box-visibility.js
2021-01-28 03:04:13 +01:00
/ * *
2021-05-19 17:09:27 +02:00
* WordPress dependencies
2021-01-28 03:04:13 +01:00
* /
2020-06-26 15:33:47 +02:00
2021-05-19 17:09:27 +02:00
2023-09-26 16:23:26 +02:00
2020-01-08 12:57:23 +01:00
/ * *
2021-05-19 17:09:27 +02:00
* Internal dependencies
2020-01-08 12:57:23 +01:00
* /
2022-04-11 14:04:30 +02:00
class MetaBoxVisibility extends external _wp _element _namespaceObject . Component {
2021-05-19 17:09:27 +02:00
componentDidMount ( ) {
this . updateDOM ( ) ;
}
componentDidUpdate ( prevProps ) {
if ( this . props . isVisible !== prevProps . isVisible ) {
this . updateDOM ( ) ;
}
}
updateDOM ( ) {
const {
id ,
isVisible
} = this . props ;
const element = document . getElementById ( id ) ;
if ( ! element ) {
return ;
}
if ( isVisible ) {
element . classList . remove ( 'is-hidden' ) ;
} else {
element . classList . add ( 'is-hidden' ) ;
}
}
render ( ) {
return null ;
}
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var meta _box _visibility = ( ( 0 , external _wp _data _namespaceObject . withSelect ) ( ( select , {
2023-06-27 16:24:19 +02:00
id
} ) => ( {
isVisible : select ( store _store ) . isEditorPanelEnabled ( ` meta-box- ${ id } ` )
} ) ) ( MetaBoxVisibility ) ) ;
2020-01-08 12:57:23 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/meta-boxes/index.js
2020-01-08 12:57:23 +01:00
/ * *
2021-05-19 17:09:27 +02:00
* WordPress dependencies
* /
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 21:08:24 +02:00
2023-09-26 16:23:26 +02:00
2021-05-19 17:09:27 +02:00
/ * *
* Internal dependencies
2020-01-08 12:57:23 +01:00
* /
2021-05-19 17:09:27 +02:00
2023-06-27 16:24:19 +02:00
function MetaBoxes ( {
location
} ) {
2022-04-11 14:04:30 +02:00
const registry = ( 0 , external _wp _data _namespaceObject . useRegistry ) ( ) ;
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 21:08:24 +02:00
const {
metaBoxes ,
areMetaBoxesInitialized ,
isEditorReady
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 21:08:24 +02:00
const {
_ _unstableIsEditorReady
2022-04-11 14:04:30 +02:00
} = select ( external _wp _editor _namespaceObject . store ) ;
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 21:08:24 +02:00
const {
getMetaBoxesPerLocation ,
areMetaBoxesInitialized : _areMetaBoxesInitialized
2022-04-11 14:04:30 +02:00
} = select ( store _store ) ;
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 21:08:24 +02:00
return {
metaBoxes : getMetaBoxesPerLocation ( location ) ,
areMetaBoxesInitialized : _areMetaBoxesInitialized ( ) ,
isEditorReady : _ _unstableIsEditorReady ( )
} ;
2023-09-26 16:23:26 +02:00
} , [ location ] ) ;
// When editor is ready, initialize postboxes (wp core script) and metabox
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 21:08:24 +02:00
// saving. This initializes all meta box locations, not just this specific
// one.
2022-04-11 14:04:30 +02:00
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 21:08:24 +02:00
if ( isEditorReady && ! areMetaBoxesInitialized ) {
2022-04-11 14:04:30 +02:00
registry . dispatch ( store _store ) . initializeMetaBoxes ( ) ;
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 21:08:24 +02:00
}
} , [ isEditorReady , areMetaBoxesInitialized ] ) ;
if ( ! areMetaBoxesInitialized ) {
return null ;
}
2023-06-27 16:24:19 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( metaBoxes !== null && metaBoxes !== void 0 ? metaBoxes : [ ] ) . map ( ( {
id
} ) => ( 0 , external _wp _element _namespaceObject . createElement ) ( meta _box _visibility , {
key : id ,
id : id
} ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( meta _boxes _area , {
2021-05-19 17:09:27 +02:00
location : location
} ) ) ;
}
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: external ["wp","warning"]
2023-09-21 15:26:32 +02:00
var external _wp _warning _namespaceObject = window [ "wp" ] [ "warning" ] ;
2023-09-26 16:23:26 +02:00
var external _wp _warning _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( external _wp _warning _namespaceObject ) ;
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/plugin-document-setting-panel/index.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
const {
Fill : plugin _document _setting _panel _Fill ,
Slot : plugin _document _setting _panel _Slot
} = ( 0 , external _wp _components _namespaceObject . createSlotFill ) ( 'PluginDocumentSettingPanel' ) ;
/ * *
* Renders items below the Status & Availability panel in the Document Sidebar .
*
* @ param { Object } props Component properties .
2023-09-26 16:23:26 +02:00
* @ param { string } props . name Required . A machine - friendly name for the panel .
2022-04-11 14:04:30 +02:00
* @ param { string } [ props . className ] An optional class name added to the row .
* @ param { string } [ props . title ] The title of the panel
* @ param { WPBlockTypeIconRender } [ props . icon = inherits from the plugin ] The [ Dashicon ] ( https : //developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.
2023-09-26 16:23:26 +02:00
* @ param { WPElement } props . children Children to be rendered
2022-04-11 14:04:30 +02:00
*
* @ example
* ` ` ` js
* // Using ES5 syntax
* var el = wp . element . createElement ;
* var _ _ = wp . i18n . _ _ ;
* var registerPlugin = wp . plugins . registerPlugin ;
* var PluginDocumentSettingPanel = wp . editPost . PluginDocumentSettingPanel ;
*
* function MyDocumentSettingPlugin ( ) {
* return el (
* PluginDocumentSettingPanel ,
* {
* className : 'my-document-setting-plugin' ,
* title : 'My Panel' ,
2023-09-26 16:23:26 +02:00
* name : 'my-panel' ,
2022-04-11 14:04:30 +02:00
* } ,
* _ _ ( 'My Document Setting Panel' )
* ) ;
* }
*
* registerPlugin ( 'my-document-setting-plugin' , {
* render : MyDocumentSettingPlugin
* } ) ;
* ` ` `
*
* @ example
* ` ` ` jsx
* // Using ESNext syntax
* import { registerPlugin } from '@wordpress/plugins' ;
* import { PluginDocumentSettingPanel } from '@wordpress/edit-post' ;
*
* const MyDocumentSettingTest = ( ) => (
2023-09-26 16:23:26 +02:00
* < PluginDocumentSettingPanel className = "my-document-setting-plugin" title = "My Panel" name = "my-panel" >
2022-04-11 14:04:30 +02:00
* < p > My Document Setting Panel < / p >
* < / P l u g i n D o c u m e n t S e t t i n g P a n e l >
* ) ;
*
* registerPlugin ( 'document-setting-test' , { render : MyDocumentSettingTest } ) ;
* ` ` `
*
* @ return { WPComponent } The component to be rendered .
* /
2023-09-26 16:23:26 +02:00
const PluginDocumentSettingPanel = ( {
name ,
className ,
title ,
icon ,
children
} ) => {
const {
name : pluginName
} = ( 0 , external _wp _plugins _namespaceObject . usePluginContext ) ( ) ;
const panelName = ` ${ pluginName } / ${ name } ` ;
const {
opened ,
isEnabled
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
const {
isEditorPanelOpened ,
isEditorPanelEnabled
} = select ( store _store ) ;
return {
opened : isEditorPanelOpened ( panelName ) ,
isEnabled : isEditorPanelEnabled ( panelName )
} ;
} , [ panelName ] ) ;
const {
toggleEditorPanelOpened
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
if ( undefined === name ) {
true ? external _wp _warning _default ( ) ( 'PluginDocumentSettingPanel requires a name property.' ) : 0 ;
2023-06-27 16:24:19 +02:00
}
2023-09-26 16:23:26 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( enable _plugin _document _setting _panel , {
label : title ,
panelName : panelName
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( plugin _document _setting _panel _Fill , null , isEnabled && ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . PanelBody , {
className : className ,
title : title ,
icon : icon ,
opened : opened ,
onToggle : ( ) => toggleEditorPanelOpened ( panelName )
} , children ) ) ) ;
} ;
2022-04-11 14:04:30 +02:00
PluginDocumentSettingPanel . Slot = plugin _document _setting _panel _Slot ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var plugin _document _setting _panel = ( PluginDocumentSettingPanel ) ;
2021-05-19 17:09:27 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/plugin-sidebar/index.js
2019-10-15 17:37:08 +02:00
2019-09-19 17:19:18 +02:00
/ * *
2020-06-26 15:33:47 +02:00
* WordPress dependencies
2019-09-19 17:19:18 +02:00
* /
2018-12-18 04:14:52 +01:00
2021-05-19 17:09:27 +02:00
2021-11-08 15:29:21 +01:00
2023-09-26 16:23:26 +02:00
2019-09-19 17:19:18 +02:00
/ * *
2021-05-19 17:09:27 +02:00
* Internal dependencies
* /
/ * *
* Renders a sidebar when activated . The contents within the ` PluginSidebar ` will appear as content within the sidebar .
* It also automatically renders a corresponding ` PluginSidebarMenuItem ` component when ` isPinnable ` flag is set to ` true ` .
* If you wish to display the sidebar , you can with use the ` PluginSidebarMoreMenuItem ` component or the ` wp.data.dispatch ` API :
2020-06-26 15:33:47 +02:00
*
2021-05-19 17:09:27 +02:00
* ` ` ` js
* wp . data . dispatch ( 'core/edit-post' ) . openGeneralSidebar ( 'plugin-name/sidebar-name' ) ;
* ` ` `
*
* @ see PluginSidebarMoreMenuItem
*
2021-11-08 15:29:21 +01:00
* @ param { Object } props Element props .
* @ param { string } props . name A string identifying the sidebar . Must be unique for every sidebar registered within the scope of your plugin .
* @ param { string } [ props . className ] An optional class name added to the sidebar body .
* @ param { string } props . title Title displayed at the top of the sidebar .
* @ param { boolean } [ props . isPinnable = true ] Whether to allow to pin sidebar to the toolbar . When set to ` true ` it also automatically renders a corresponding menu item .
2021-05-19 17:09:27 +02:00
* @ param { WPBlockTypeIconRender } [ props . icon = inherits from the plugin ] The [ Dashicon ] ( https : //developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.
2019-09-19 17:19:18 +02:00
*
2020-06-26 15:33:47 +02:00
* @ example
2019-10-15 17:37:08 +02:00
* ` ` ` js
* // Using ES5 syntax
* var _ _ = wp . i18n . _ _ ;
2021-05-19 17:09:27 +02:00
* var el = wp . element . createElement ;
* var PanelBody = wp . components . PanelBody ;
* var PluginSidebar = wp . editPost . PluginSidebar ;
2020-06-26 15:33:47 +02:00
* var moreIcon = wp . element . createElement ( 'svg' ) ; //... svg element.
2019-09-19 17:19:18 +02:00
*
2021-05-19 17:09:27 +02:00
* function MyPluginSidebar ( ) {
* return el (
* PluginSidebar ,
* {
* name : 'my-sidebar' ,
* title : 'My sidebar title' ,
* icon : moreIcon ,
* } ,
* el (
* PanelBody ,
* { } ,
* _ _ ( 'My sidebar content' )
* )
* ) ;
2019-10-15 17:37:08 +02:00
* }
* ` ` `
2019-09-19 17:19:18 +02:00
*
2020-06-26 15:33:47 +02:00
* @ example
2019-10-15 17:37:08 +02:00
* ` ` ` jsx
* // Using ESNext syntax
2020-06-26 15:33:47 +02:00
* import { _ _ } from '@wordpress/i18n' ;
2021-05-19 17:09:27 +02:00
* import { PanelBody } from '@wordpress/components' ;
* import { PluginSidebar } from '@wordpress/edit-post' ;
2020-06-26 15:33:47 +02:00
* import { more } from '@wordpress/icons' ;
2019-09-19 17:19:18 +02:00
*
2021-05-19 17:09:27 +02:00
* const MyPluginSidebar = ( ) => (
* < PluginSidebar
* name = "my-sidebar"
* title = "My sidebar title"
2020-06-26 15:33:47 +02:00
* icon = { more }
* >
2021-05-19 17:09:27 +02:00
* < PanelBody >
* { _ _ ( 'My sidebar content' ) }
* < / P a n e l B o d y >
* < / P l u g i n S i d e b a r >
2020-06-26 15:33:47 +02:00
* ) ;
2019-10-15 17:37:08 +02:00
* ` ` `
2021-01-28 03:04:13 +01:00
* /
2023-06-27 16:24:19 +02:00
function PluginSidebarEditPost ( {
className ,
... props
} ) {
2021-05-19 17:09:27 +02:00
const {
postTitle ,
shortcut ,
showIconLabels
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
2021-05-19 17:09:27 +02:00
return {
2022-04-11 14:04:30 +02:00
postTitle : select ( external _wp _editor _namespaceObject . store ) . getEditedPostAttribute ( 'title' ) ,
shortcut : select ( external _wp _keyboardShortcuts _namespaceObject . store ) . getShortcutRepresentation ( 'core/edit-post/toggle-sidebar' ) ,
showIconLabels : select ( store _store ) . isFeatureActive ( 'showIconLabels' )
2021-05-19 17:09:27 +02:00
} ;
2021-11-08 15:29:21 +01:00
} , [ ] ) ;
2023-06-27 16:24:19 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( complementary _area , {
2021-05-19 17:09:27 +02:00
panelClassName : className ,
className : "edit-post-sidebar" ,
2022-04-11 14:04:30 +02:00
smallScreenTitle : postTitle || ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( '(no title)' ) ,
2021-05-19 17:09:27 +02:00
scope : "core/edit-post" ,
toggleShortcut : shortcut ,
2023-06-27 16:24:19 +02:00
showIconLabels : showIconLabels ,
... props
} ) ;
2021-01-28 03:04:13 +01:00
}
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/template-summary/index.js
2019-10-15 17:37:08 +02:00
2021-05-19 17:09:27 +02:00
/ * *
* WordPress dependencies
* /
2021-02-02 06:17:13 +01:00
2023-09-26 16:23:26 +02:00
2021-05-19 17:09:27 +02:00
/ * *
* Internal dependencies
* /
2021-02-02 06:17:13 +01:00
2021-05-19 17:09:27 +02:00
function TemplateSummary ( ) {
2022-04-11 14:04:30 +02:00
const template = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
2021-05-19 17:09:27 +02:00
const {
getEditedPostTemplate
2022-04-11 14:04:30 +02:00
} = select ( store _store ) ;
2021-05-19 17:09:27 +02:00
return getEditedPostTemplate ( ) ;
} , [ ] ) ;
if ( ! template ) {
return null ;
2021-04-15 17:19:43 +02:00
}
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . PanelBody , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Flex , {
2021-11-08 15:29:21 +01:00
align : "flex-start" ,
gap : "3"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . FlexItem , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( icon , {
icon : library _layout
} ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . FlexBlock , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( "h2" , {
2021-05-19 17:09:27 +02:00
className : "edit-post-template-summary__title"
2023-06-27 16:24:19 +02:00
} , template ? . title || template ? . slug ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "p" , null , template ? . description ) ) ) ) ;
2021-04-15 17:19:43 +02:00
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var template _summary = ( TemplateSummary ) ;
2021-02-02 06:17:13 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/settings-sidebar/index.js
2021-02-02 06:17:13 +01:00
2021-05-19 17:09:27 +02:00
/ * *
* WordPress dependencies
* /
2021-02-02 06:17:13 +01:00
2020-06-26 15:33:47 +02:00
2023-02-07 08:04:52 +01:00
2023-09-26 16:23:26 +02:00
2021-05-19 17:09:27 +02:00
/ * *
* Internal dependencies
* /
2020-06-26 15:33:47 +02:00
2021-01-28 03:04:13 +01:00
2020-06-26 15:33:47 +02:00
2022-04-11 14:04:30 +02:00
const SIDEBAR _ACTIVE _BY _DEFAULT = external _wp _element _namespaceObject . Platform . select ( {
2021-05-19 17:09:27 +02:00
web : true ,
native : false
} ) ;
const SettingsSidebar = ( ) => {
const {
sidebarName ,
keyboardShortcut ,
isTemplateMode
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
2021-05-19 17:09:27 +02:00
// The settings sidebar is used by the edit-post/document and edit-post/block sidebars.
// sidebarName represents the sidebar that is active or that should be active when the SettingsSidebar toggle button is pressed.
// If one of the two sidebars is active the component will contain the content of that sidebar.
2022-09-20 17:43:29 +02:00
// When neither of the two sidebars is active we can not simply return null, because the PluginSidebarEditPost
2021-05-19 17:09:27 +02:00
// component, besides being used to render the sidebar, also renders the toggle button. In that case sidebarName
// should contain the sidebar that will be active when the toggle button is pressed. If a block
// is selected, that should be edit-post/block otherwise it's edit-post/document.
2022-04-11 14:04:30 +02:00
let sidebar = select ( store ) . getActiveComplementaryArea ( store _store . name ) ;
2021-05-19 17:09:27 +02:00
if ( ! [ 'edit-post/document' , 'edit-post/block' ] . includes ( sidebar ) ) {
2022-04-11 14:04:30 +02:00
if ( select ( external _wp _blockEditor _namespaceObject . store ) . getBlockSelectionStart ( ) ) {
2021-05-19 17:09:27 +02:00
sidebar = 'edit-post/block' ;
}
sidebar = 'edit-post/document' ;
}
2022-04-11 14:04:30 +02:00
const shortcut = select ( external _wp _keyboardShortcuts _namespaceObject . store ) . getShortcutRepresentation ( 'core/edit-post/toggle-sidebar' ) ;
2021-05-19 17:09:27 +02:00
return {
sidebarName : sidebar ,
keyboardShortcut : shortcut ,
2022-04-11 14:04:30 +02:00
isTemplateMode : select ( store _store ) . isEditingTemplate ( )
2021-05-19 17:09:27 +02:00
} ;
} , [ ] ) ;
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( PluginSidebarEditPost , {
2021-05-19 17:09:27 +02:00
identifier : sidebarName ,
2022-04-11 14:04:30 +02:00
header : ( 0 , external _wp _element _namespaceObject . createElement ) ( settings _header , {
2021-05-19 17:09:27 +02:00
sidebarName : sidebarName
} ) ,
2023-06-27 16:24:19 +02:00
closeLabel : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Close Settings' ) ,
2021-05-19 17:09:27 +02:00
headerClassName : "edit-post-sidebar__panel-tabs"
2023-09-26 16:23:26 +02:00
/* translators: button label text should, if possible, be under 16 characters. */ ,
2022-04-11 14:04:30 +02:00
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Settings' ) ,
2021-05-19 17:09:27 +02:00
toggleShortcut : keyboardShortcut ,
2023-02-07 08:04:52 +01:00
icon : ( 0 , external _wp _i18n _namespaceObject . isRTL ) ( ) ? drawer _left : drawer _right ,
2021-05-19 17:09:27 +02:00
isActiveByDefault : SIDEBAR _ACTIVE _BY _DEFAULT
2022-09-20 17:43:29 +02:00
} , ! isTemplateMode && sidebarName === 'edit-post/document' && ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( post _status , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( plugin _document _setting _panel . Slot , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( last _revision , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( post _taxonomies , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( featured _image , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( post _excerpt , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( discussion _panel , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( page _attributes , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( MetaBoxes , {
2021-05-19 17:09:27 +02:00
location : "side"
2022-04-11 14:04:30 +02:00
} ) ) , isTemplateMode && sidebarName === 'edit-post/document' && ( 0 , external _wp _element _namespaceObject . createElement ) ( template _summary , null ) , sidebarName === 'edit-post/block' && ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . BlockInspector , null ) ) ;
2021-05-19 17:09:27 +02:00
} ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var settings _sidebar = ( SettingsSidebar ) ;
2021-05-19 17:09:27 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/image.js
2021-01-28 03:04:13 +01:00
2023-06-27 16:24:19 +02:00
function WelcomeGuideImage ( {
nonAnimatedSrc ,
animatedSrc
} ) {
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( "picture" , {
2021-06-01 10:10:04 +02:00
className : "edit-post-welcome-guide__image"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( "source" , {
2021-06-01 10:10:04 +02:00
srcSet : nonAnimatedSrc ,
media : "(prefers-reduced-motion: reduce)"
2022-04-11 14:04:30 +02:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "img" , {
2021-06-01 10:10:04 +02:00
src : animatedSrc ,
width : "312" ,
height : "240" ,
alt : ""
} ) ) ;
}
2019-10-15 17:37:08 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/default.js
2019-10-15 17:37:08 +02:00
2021-01-28 03:04:13 +01:00
/ * *
2021-05-19 17:09:27 +02:00
* WordPress dependencies
2021-01-28 03:04:13 +01:00
* /
2019-10-15 17:37:08 +02:00
2021-01-28 03:04:13 +01:00
2023-09-26 16:23:26 +02:00
2021-05-21 12:14:23 +02:00
/ * *
* Internal dependencies
* /
2018-12-18 04:14:52 +01:00
2019-10-15 17:37:08 +02:00
2021-05-21 12:14:23 +02:00
function WelcomeGuideDefault ( ) {
2021-05-19 17:09:27 +02:00
const {
toggleFeature
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Guide , {
2021-05-19 17:09:27 +02:00
className : "edit-post-welcome-guide" ,
2022-04-11 14:04:30 +02:00
contentLabel : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Welcome to the block editor' ) ,
finishButtonText : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Get started' ) ,
2021-05-19 17:09:27 +02:00
onFinish : ( ) => toggleFeature ( 'welcomeGuide' ) ,
pages : [ {
2022-04-11 14:04:30 +02:00
image : ( 0 , external _wp _element _namespaceObject . createElement ) ( WelcomeGuideImage , {
2021-06-01 10:10:04 +02:00
nonAnimatedSrc : "https://s.w.org/images/block-editor/welcome-canvas.svg" ,
animatedSrc : "https://s.w.org/images/block-editor/welcome-canvas.gif"
} ) ,
2022-04-11 14:04:30 +02:00
content : ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( "h1" , {
2021-05-19 17:09:27 +02:00
className : "edit-post-welcome-guide__heading"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Welcome to the block editor' ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "p" , {
2021-05-19 17:09:27 +02:00
className : "edit-post-welcome-guide__text"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'In the WordPress editor, each paragraph, image, or video is presented as a distinct “block” of content.' ) ) )
2021-05-19 17:09:27 +02:00
} , {
2022-04-11 14:04:30 +02:00
image : ( 0 , external _wp _element _namespaceObject . createElement ) ( WelcomeGuideImage , {
2021-06-01 10:10:04 +02:00
nonAnimatedSrc : "https://s.w.org/images/block-editor/welcome-editor.svg" ,
animatedSrc : "https://s.w.org/images/block-editor/welcome-editor.gif"
} ) ,
2022-04-11 14:04:30 +02:00
content : ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( "h1" , {
2021-05-19 17:09:27 +02:00
className : "edit-post-welcome-guide__heading"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Make each block your own' ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "p" , {
2021-05-19 17:09:27 +02:00
className : "edit-post-welcome-guide__text"
2022-04-11 14:04:30 +02:00
} , ( 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.' ) ) )
2021-05-19 17:09:27 +02:00
} , {
2022-04-11 14:04:30 +02:00
image : ( 0 , external _wp _element _namespaceObject . createElement ) ( WelcomeGuideImage , {
2021-06-01 10:10:04 +02:00
nonAnimatedSrc : "https://s.w.org/images/block-editor/welcome-library.svg" ,
animatedSrc : "https://s.w.org/images/block-editor/welcome-library.gif"
} ) ,
2022-04-11 14:04:30 +02:00
content : ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( "h1" , {
2021-05-19 17:09:27 +02:00
className : "edit-post-welcome-guide__heading"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Get to know the block library' ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "p" , {
2021-05-19 17:09:27 +02:00
className : "edit-post-welcome-guide__text"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createInterpolateElement ) ( ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'All of the blocks available to you live in the block library. You’ ll find it wherever you see the <InserterIconImage /> icon.' ) , {
InserterIconImage : ( 0 , external _wp _element _namespaceObject . createElement ) ( "img" , {
alt : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'inserter' ) ,
2021-06-01 10:10:04 +02:00
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"
2021-05-19 17:09:27 +02:00
} )
} ) ) )
} , {
2022-04-11 14:04:30 +02:00
image : ( 0 , external _wp _element _namespaceObject . createElement ) ( WelcomeGuideImage , {
2021-06-01 10:10:04 +02:00
nonAnimatedSrc : "https://s.w.org/images/block-editor/welcome-documentation.svg" ,
animatedSrc : "https://s.w.org/images/block-editor/welcome-documentation.gif"
} ) ,
2022-04-11 14:04:30 +02:00
content : ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( "h1" , {
2021-05-19 17:09:27 +02:00
className : "edit-post-welcome-guide__heading"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Learn how to use the block editor' ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "p" , {
2021-05-19 17:09:27 +02:00
className : "edit-post-welcome-guide__text"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'New to the block editor? Want to learn more about using it? ' ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . ExternalLink , {
2023-06-27 16:24:19 +02:00
href : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'https://wordpress.org/documentation/article/wordpress-block-editor/' )
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Here's a detailed guide." ) ) ) )
2021-05-19 17:09:27 +02:00
} ]
} ) ;
2021-01-28 03:04:13 +01:00
}
2019-10-15 17:37:08 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/template.js
2021-05-21 12:14:23 +02:00
/ * *
* WordPress dependencies
* /
2023-09-26 16:23:26 +02:00
2021-05-21 12:14:23 +02:00
/ * *
* Internal dependencies
* /
function WelcomeGuideTemplate ( ) {
const {
toggleFeature
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Guide , {
2022-04-12 17:12:47 +02:00
className : "edit-template-welcome-guide" ,
2022-04-11 14:04:30 +02:00
contentLabel : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Welcome to the template editor' ) ,
finishButtonText : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Get started' ) ,
2021-05-21 12:14:23 +02:00
onFinish : ( ) => toggleFeature ( 'welcomeGuideTemplate' ) ,
pages : [ {
2022-04-11 14:04:30 +02:00
image : ( 0 , external _wp _element _namespaceObject . createElement ) ( WelcomeGuideImage , {
2021-06-01 10:10:04 +02:00
nonAnimatedSrc : "https://s.w.org/images/block-editor/welcome-template-editor.svg" ,
animatedSrc : "https://s.w.org/images/block-editor/welcome-template-editor.gif"
} ) ,
2022-04-11 14:04:30 +02:00
content : ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( "h1" , {
2021-05-21 12:14:23 +02:00
className : "edit-post-welcome-guide__heading"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Welcome to the template editor' ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "p" , {
2021-05-21 12:14:23 +02:00
className : "edit-post-welcome-guide__text"
2022-04-11 14:04:30 +02:00
} , ( 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-05-21 12:14:23 +02:00
} ]
} ) ;
}
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/index.js
2021-05-21 12:14:23 +02:00
/ * *
* WordPress dependencies
* /
2023-09-26 16:23:26 +02:00
2021-05-21 12:14:23 +02:00
/ * *
* Internal dependencies
* /
function WelcomeGuide ( ) {
const {
isActive ,
isTemplateMode
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
2021-05-21 12:14:23 +02:00
const {
isFeatureActive ,
isEditingTemplate
2022-04-11 14:04:30 +02:00
} = select ( store _store ) ;
2021-05-21 12:14:23 +02:00
const _isTemplateMode = isEditingTemplate ( ) ;
const feature = _isTemplateMode ? 'welcomeGuideTemplate' : 'welcomeGuide' ;
return {
isActive : isFeatureActive ( feature ) ,
isTemplateMode : _isTemplateMode
} ;
} , [ ] ) ;
if ( ! isActive ) {
return null ;
}
2022-04-11 14:04:30 +02:00
return isTemplateMode ? ( 0 , external _wp _element _namespaceObject . createElement ) ( WelcomeGuideTemplate , null ) : ( 0 , external _wp _element _namespaceObject . createElement ) ( WelcomeGuideDefault , null ) ;
2021-05-21 12:14:23 +02:00
}
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/plugin-post-publish-panel/index.js
2020-01-08 12:57:23 +01:00
2019-09-19 17:19:18 +02:00
/ * *
2021-05-19 17:09:27 +02:00
* WordPress dependencies
2019-09-19 17:19:18 +02:00
* /
2019-10-15 17:37:08 +02:00
2021-05-19 17:09:27 +02:00
const {
Fill : plugin _post _publish _panel _Fill ,
Slot : plugin _post _publish _panel _Slot
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _components _namespaceObject . createSlotFill ) ( 'PluginPostPublishPanel' ) ;
2019-10-15 17:37:08 +02:00
2021-01-28 03:04:13 +01:00
/ * *
2021-05-19 17:09:27 +02:00
* Renders provided content to the post - publish panel in the publish flow
* ( side panel that opens after a user publishes the post ) .
2021-01-28 03:04:13 +01:00
*
2021-11-08 15:29:21 +01:00
* @ param { Object } props Component properties .
* @ param { string } [ props . className ] An optional class name added to the panel .
* @ param { string } [ props . title ] Title displayed at the top of the panel .
* @ param { boolean } [ props . initialOpen = false ] Whether to have the panel initially opened . When no title is provided it is always opened .
2021-05-19 17:09:27 +02:00
* @ param { WPBlockTypeIconRender } [ props . icon = inherits from the plugin ] The [ Dashicon ] ( https : //developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.
2023-09-26 16:23:26 +02:00
* @ param { WPElement } props . children Children to be rendered
2021-01-28 03:04:13 +01:00
*
2021-05-19 17:09:27 +02:00
* @ example
* ` ` ` js
* // Using ES5 syntax
* var _ _ = wp . i18n . _ _ ;
* var PluginPostPublishPanel = wp . editPost . PluginPostPublishPanel ;
*
* function MyPluginPostPublishPanel ( ) {
* return wp . element . createElement (
* PluginPostPublishPanel ,
* {
* className : 'my-plugin-post-publish-panel' ,
* title : _ _ ( 'My panel title' ) ,
* initialOpen : true ,
* } ,
* _ _ ( 'My panel content' )
* ) ;
* }
* ` ` `
*
* @ example
* ` ` ` jsx
* // Using ESNext syntax
* import { _ _ } from '@wordpress/i18n' ;
* import { PluginPostPublishPanel } from '@wordpress/edit-post' ;
*
* const MyPluginPostPublishPanel = ( ) => (
* < PluginPostPublishPanel
* className = "my-plugin-post-publish-panel"
* title = { _ _ ( 'My panel title' ) }
* initialOpen = { true }
* >
* { _ _ ( 'My panel content' ) }
* < / P l u g i n P o s t P u b l i s h P a n e l >
* ) ;
* ` ` `
*
* @ return { WPComponent } The component to be rendered .
2021-01-28 03:04:13 +01:00
* /
2023-09-26 16:23:26 +02:00
const PluginPostPublishPanel = ( {
children ,
className ,
title ,
initialOpen = false ,
icon
} ) => {
const {
icon : pluginIcon
} = ( 0 , external _wp _plugins _namespaceObject . usePluginContext ) ( ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( plugin _post _publish _panel _Fill , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . PanelBody , {
className : className ,
initialOpen : initialOpen || ! title ,
title : title ,
icon : icon !== null && icon !== void 0 ? icon : pluginIcon
} , children ) ) ;
} ;
2021-05-19 17:09:27 +02:00
PluginPostPublishPanel . Slot = plugin _post _publish _panel _Slot ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var plugin _post _publish _panel = ( PluginPostPublishPanel ) ;
2020-08-10 16:18:33 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/plugin-pre-publish-panel/index.js
2020-08-10 16:18:33 +02:00
2021-05-19 17:09:27 +02:00
/ * *
* WordPress dependencies
* /
2020-08-10 16:18:33 +02:00
2021-05-19 17:09:27 +02:00
const {
Fill : plugin _pre _publish _panel _Fill ,
Slot : plugin _pre _publish _panel _Slot
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _components _namespaceObject . createSlotFill ) ( 'PluginPrePublishPanel' ) ;
2020-08-10 16:18:33 +02:00
/ * *
2021-05-19 17:09:27 +02:00
* Renders provided content to the pre - publish side panel in the publish flow
* ( side panel that opens when a user first pushes "Publish" from the main editor ) .
*
* @ param { Object } props Component props .
* @ param { string } [ props . className ] An optional class name added to the panel .
* @ param { string } [ props . title ] Title displayed at the top of the panel .
* @ param { boolean } [ props . initialOpen = false ] Whether to have the panel initially opened .
* When no title is provided it is always opened .
* @ param { WPBlockTypeIconRender } [ props . icon = inherits from the plugin ] The [ Dashicon ] ( https : //developer.wordpress.org/resource/dashicons/)
* icon slug string , or an SVG WP element , to be rendered when
* the sidebar is pinned to toolbar .
2023-09-26 16:23:26 +02:00
* @ param { WPElement } props . children Children to be rendered
2021-05-19 17:09:27 +02:00
*
* @ example
* ` ` ` js
* // Using ES5 syntax
* var _ _ = wp . i18n . _ _ ;
* var PluginPrePublishPanel = wp . editPost . PluginPrePublishPanel ;
*
* function MyPluginPrePublishPanel ( ) {
* return wp . element . createElement (
* PluginPrePublishPanel ,
* {
* className : 'my-plugin-pre-publish-panel' ,
* title : _ _ ( 'My panel title' ) ,
* initialOpen : true ,
* } ,
* _ _ ( 'My panel content' )
* ) ;
* }
* ` ` `
*
* @ example
* ` ` ` jsx
* // Using ESNext syntax
* import { _ _ } from '@wordpress/i18n' ;
* import { PluginPrePublishPanel } from '@wordpress/edit-post' ;
*
* const MyPluginPrePublishPanel = ( ) => (
* < PluginPrePublishPanel
* className = "my-plugin-pre-publish-panel"
* title = { _ _ ( 'My panel title' ) }
* initialOpen = { true }
* >
* { _ _ ( 'My panel content' ) }
* < / P l u g i n P r e P u b l i s h P a n e l >
* ) ;
* ` ` `
*
* @ return { WPComponent } The component to be rendered .
2020-08-10 16:18:33 +02:00
* /
2023-09-26 16:23:26 +02:00
const PluginPrePublishPanel = ( {
children ,
className ,
title ,
initialOpen = false ,
icon
} ) => {
const {
icon : pluginIcon
} = ( 0 , external _wp _plugins _namespaceObject . usePluginContext ) ( ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( plugin _pre _publish _panel _Fill , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . PanelBody , {
className : className ,
initialOpen : initialOpen || ! title ,
title : title ,
icon : icon !== null && icon !== void 0 ? icon : pluginIcon
} , children ) ) ;
} ;
2021-05-19 17:09:27 +02:00
PluginPrePublishPanel . Slot = plugin _pre _publish _panel _Slot ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var plugin _pre _publish _panel = ( PluginPrePublishPanel ) ;
2018-12-14 05:41:57 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/layout/actions-panel.js
2020-06-26 15:33:47 +02:00
2018-12-14 05:41:57 +01:00
/ * *
2018-12-18 04:14:52 +01:00
* WordPress dependencies
2018-12-14 05:41:57 +01:00
* /
2021-05-19 17:09:27 +02:00
2020-06-26 15:33:47 +02:00
/ * *
* Internal dependencies
* /
2018-12-14 05:41:57 +01:00
2021-05-19 17:09:27 +02:00
const {
Fill : actions _panel _Fill ,
Slot : actions _panel _Slot
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _components _namespaceObject . createSlotFill ) ( 'ActionsPanel' ) ;
const ActionsPanelFill = ( /* unused pure expression or super */ null && ( actions _panel _Fill ) ) ;
2023-06-27 16:24:19 +02:00
function ActionsPanel ( {
setEntitiesSavedStatesCallback ,
closeEntitiesSavedStates ,
isEntitiesSavedStatesOpen
} ) {
2021-05-19 17:09:27 +02:00
const {
closePublishSidebar ,
togglePublishSidebar
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
2021-05-19 17:09:27 +02:00
const {
publishSidebarOpened ,
hasActiveMetaboxes ,
hasNonPostEntityChanges
2023-09-26 16:23:26 +02:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => ( {
publishSidebarOpened : select ( store _store ) . isPublishSidebarOpened ( ) ,
hasActiveMetaboxes : select ( store _store ) . hasMetaBoxes ( ) ,
hasNonPostEntityChanges : select ( external _wp _editor _namespaceObject . store ) . hasNonPostEntityChanges ( )
} ) , [ ] ) ;
const openEntitiesSavedStates = ( 0 , external _wp _element _namespaceObject . useCallback ) ( ( ) => setEntitiesSavedStatesCallback ( true ) , [ ] ) ;
2018-12-14 05:41:57 +01:00
2023-09-26 16:23:26 +02:00
// It is ok for these components to be unmounted when not in visual use.
// We don't want more than one present at a time, decide which to render.
2021-05-19 17:09:27 +02:00
let unmountableContent ;
if ( publishSidebarOpened ) {
2022-04-11 14:04:30 +02:00
unmountableContent = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostPublishPanel , {
2021-05-19 17:09:27 +02:00
onClose : closePublishSidebar ,
forceIsDirty : hasActiveMetaboxes ,
PrePublishExtension : plugin _pre _publish _panel . Slot ,
PostPublishExtension : plugin _post _publish _panel . Slot
} ) ;
} else if ( hasNonPostEntityChanges ) {
2022-04-11 14:04:30 +02:00
unmountableContent = ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
2021-05-19 17:09:27 +02:00
className : "edit-post-layout__toggle-entities-saved-states-panel"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
2021-11-08 15:29:21 +01:00
variant : "secondary" ,
2021-05-19 17:09:27 +02:00
className : "edit-post-layout__toggle-entities-saved-states-panel-button" ,
onClick : openEntitiesSavedStates ,
"aria-expanded" : false
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Open save panel' ) ) ) ;
2021-05-19 17:09:27 +02:00
} else {
2022-04-11 14:04:30 +02:00
unmountableContent = ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
2021-05-19 17:09:27 +02:00
className : "edit-post-layout__toggle-publish-panel"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
2021-11-08 15:29:21 +01:00
variant : "secondary" ,
2021-05-19 17:09:27 +02:00
className : "edit-post-layout__toggle-publish-panel-button" ,
onClick : togglePublishSidebar ,
"aria-expanded" : false
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Open publish panel' ) ) ) ;
2023-09-26 16:23:26 +02:00
}
2018-12-14 05:41:57 +01:00
2023-09-26 16:23:26 +02:00
// Since EntitiesSavedStates controls its own panel, we can keep it
// always mounted to retain its own component state (such as checkboxes).
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , isEntitiesSavedStatesOpen && ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . EntitiesSavedStates , {
2021-05-19 17:09:27 +02:00
close : closeEntitiesSavedStates
2022-04-11 14:04:30 +02:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( actions _panel _Slot , {
2021-05-19 17:09:27 +02:00
bubblesVirtually : true
} ) , ! isEntitiesSavedStatesOpen && unmountableContent ) ;
2021-01-28 03:04:13 +01:00
}
2020-06-26 15:33:47 +02:00
2022-04-12 17:12:47 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/start-page-options/index.js
/ * *
* WordPress dependencies
* /
2023-09-26 16:23:26 +02:00
2022-04-12 17:12:47 +02:00
/ * *
* Internal dependencies
* /
2022-09-20 17:43:29 +02:00
function useStartPatterns ( ) {
// A pattern is a start pattern if it includes 'core/post-content' in its blockTypes,
2023-09-26 16:23:26 +02:00
// and it has no postTypes declared and the current post type is page or if
2022-09-20 17:43:29 +02:00
// the current post type is part of the postTypes declared.
2022-04-12 17:12:47 +02:00
const {
2022-09-20 17:43:29 +02:00
blockPatternsWithPostContentBlockType ,
postType
2022-04-12 17:12:47 +02:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
const {
2023-02-07 08:04:52 +01:00
getPatternsByBlockTypes
2022-04-12 17:12:47 +02:00
} = select ( external _wp _blockEditor _namespaceObject . store ) ;
2022-09-20 17:43:29 +02:00
const {
getCurrentPostType
} = select ( external _wp _editor _namespaceObject . store ) ;
2022-04-12 17:12:47 +02:00
return {
2023-02-07 08:04:52 +01:00
blockPatternsWithPostContentBlockType : getPatternsByBlockTypes ( 'core/post-content' ) ,
2022-09-20 17:43:29 +02:00
postType : getCurrentPostType ( )
2022-04-12 17:12:47 +02:00
} ;
} , [ ] ) ;
2022-09-20 17:43:29 +02:00
return ( 0 , external _wp _element _namespaceObject . useMemo ) ( ( ) => {
// filter patterns without postTypes declared if the current postType is page
// or patterns that declare the current postType in its post type array.
return blockPatternsWithPostContentBlockType . filter ( pattern => {
return postType === 'page' && ! pattern . postTypes || Array . isArray ( pattern . postTypes ) && pattern . postTypes . includes ( postType ) ;
} ) ;
} , [ postType , blockPatternsWithPostContentBlockType ] ) ;
}
2023-06-27 16:24:19 +02:00
function PatternSelection ( {
2023-09-26 16:23:26 +02:00
blockPatterns ,
2023-06-27 16:24:19 +02:00
onChoosePattern
} ) {
2022-04-12 17:12:47 +02:00
const shownBlockPatterns = ( 0 , external _wp _compose _namespaceObject . useAsyncList ) ( blockPatterns ) ;
const {
resetEditorBlocks
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _editor _namespaceObject . store ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . _ _experimentalBlockPatternsList , {
blockPatterns : blockPatterns ,
shownPatterns : shownBlockPatterns ,
onClickPattern : ( _pattern , blocks ) => {
resetEditorBlocks ( blocks ) ;
onChoosePattern ( ) ;
}
} ) ;
}
2023-09-26 16:23:26 +02:00
function StartPageOptionsModal ( ) {
const [ modalState , setModalState ] = ( 0 , external _wp _element _namespaceObject . useState ) ( 'initial' ) ;
const startPatterns = useStartPatterns ( ) ;
const hasStartPattern = startPatterns . length > 0 ;
const shouldOpenModal = hasStartPattern && modalState === 'initial' ;
2022-04-12 17:12:47 +02:00
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
2023-09-26 16:23:26 +02:00
if ( shouldOpenModal ) {
setModalState ( 'open' ) ;
2022-04-12 17:12:47 +02:00
}
2023-09-26 16:23:26 +02:00
} , [ shouldOpenModal ] ) ;
if ( modalState !== 'open' ) {
2022-04-12 17:12:47 +02:00
return null ;
}
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Modal , {
className : "edit-post-start-page-options__modal" ,
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Choose a pattern' ) ,
2023-06-27 16:24:19 +02:00
isFullScreen : true ,
2023-09-26 16:23:26 +02:00
onRequestClose : ( ) => setModalState ( 'closed' )
2022-04-12 17:12:47 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "edit-post-start-page-options__modal-content"
2023-09-26 16:23:26 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( PatternSelection , {
blockPatterns : startPatterns ,
onChoosePattern : ( ) => setModalState ( 'closed' )
2022-04-12 17:12:47 +02:00
} ) ) ) ;
}
2023-09-26 16:23:26 +02:00
function StartPageOptions ( ) {
const shouldEnableModal = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
const {
isCleanNewPost
} = select ( external _wp _editor _namespaceObject . store ) ;
const {
isEditingTemplate ,
isFeatureActive
} = select ( store _store ) ;
return ! isEditingTemplate ( ) && ! isFeatureActive ( 'welcomeGuide' ) && isCleanNewPost ( ) ;
} , [ ] ) ;
if ( ! shouldEnableModal ) {
return null ;
}
return ( 0 , external _wp _element _namespaceObject . createElement ) ( StartPageOptionsModal , null ) ;
}
2022-04-12 17:12:47 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/layout/index.js
2020-02-10 23:33:27 +01:00
2019-09-19 17:19:18 +02:00
/ * *
2021-01-28 03:04:13 +01:00
* External dependencies
2019-09-19 17:19:18 +02:00
* /
2018-12-14 05:41:57 +01:00
2023-09-26 16:23:26 +02:00
2019-09-19 17:19:18 +02:00
/ * *
2021-01-28 03:04:13 +01:00
* WordPress dependencies
2019-09-19 17:19:18 +02:00
* /
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
2019-03-21 13:48:00 +01:00
2021-01-28 03:04:13 +01:00
2021-04-15 17:19:43 +02:00
2022-04-12 17:12:47 +02:00
2021-04-15 17:19:43 +02:00
/ * *
2021-05-19 17:09:27 +02:00
* Internal dependencies
2021-04-15 17:19:43 +02:00
* /
2021-05-21 12:14:23 +02:00
2022-04-12 17:12:47 +02:00
2023-07-25 10:40:23 +02:00
const {
getLayoutStyles
} = unlock ( external _wp _blockEditor _namespaceObject . privateApis ) ;
2021-05-19 17:09:27 +02:00
const interfaceLabels = {
/* translators: accessibility text for the editor top bar landmark region. */
2022-04-11 14:04:30 +02:00
header : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Editor top bar' ) ,
2021-05-19 17:09:27 +02:00
/* translators: accessibility text for the editor content landmark region. */
2022-04-11 14:04:30 +02:00
body : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Editor content' ) ,
2021-05-19 17:09:27 +02:00
/* translators: accessibility text for the editor settings landmark region. */
2022-04-11 14:04:30 +02:00
sidebar : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Editor settings' ) ,
2021-05-19 17:09:27 +02:00
/* translators: accessibility text for the editor publish landmark region. */
2022-04-11 14:04:30 +02:00
actions : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Editor publish' ) ,
2021-05-19 17:09:27 +02:00
/* translators: accessibility text for the editor footer landmark region. */
2022-04-11 14:04:30 +02:00
footer : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Editor footer' )
2021-05-19 17:09:27 +02:00
} ;
2023-08-20 01:22:38 +02:00
function useEditorStyles ( ) {
const {
hasThemeStyleSupport ,
editorSettings
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => ( {
hasThemeStyleSupport : select ( store _store ) . isFeatureActive ( 'themeStyles' ) ,
editorSettings : select ( external _wp _editor _namespaceObject . store ) . getEditorSettings ( )
2023-09-26 16:23:26 +02:00
} ) , [ ] ) ;
2023-08-20 01:22:38 +02:00
2023-09-26 16:23:26 +02:00
// Compute the default styles.
2023-08-20 01:22:38 +02:00
return ( 0 , external _wp _element _namespaceObject . useMemo ) ( ( ) => {
var _editorSettings$style , _editorSettings$style2 ;
const presetStyles = ( _editorSettings$style = editorSettings . styles ? . filter ( style => style . _ _unstableType && style . _ _unstableType !== 'theme' ) ) !== null && _editorSettings$style !== void 0 ? _editorSettings$style : [ ] ;
2023-09-26 16:23:26 +02:00
const defaultEditorStyles = [ ... editorSettings . defaultEditorStyles , ... presetStyles ] ;
2023-08-20 01:22:38 +02:00
2023-09-26 16:23:26 +02:00
// Has theme styles if the theme supports them and if some styles were not preset styles (in which case they're theme styles).
const hasThemeStyles = hasThemeStyleSupport && presetStyles . length !== ( ( _editorSettings$style2 = editorSettings . styles ? . length ) !== null && _editorSettings$style2 !== void 0 ? _editorSettings$style2 : 0 ) ;
2023-08-20 01:22:38 +02:00
2023-09-26 16:23:26 +02:00
// If theme styles are not present or displayed, ensure that
// base layout styles are still present in the editor.
2023-08-20 01:22:38 +02:00
if ( ! editorSettings . disableLayoutStyles && ! hasThemeStyles ) {
defaultEditorStyles . push ( {
css : getLayoutStyles ( {
style : { } ,
selector : 'body' ,
hasBlockGapSupport : false ,
hasFallbackGapSupport : true ,
fallbackGapValue : '0.5em'
} )
} ) ;
}
return hasThemeStyles ? editorSettings . styles : defaultEditorStyles ;
} , [ editorSettings . defaultEditorStyles , editorSettings . disableLayoutStyles , editorSettings . styles , hasThemeStyleSupport ] ) ;
}
2023-07-25 10:40:23 +02:00
function Layout ( ) {
2023-09-26 16:23:26 +02:00
( 0 , external _wp _blockEditor _namespaceObject . useBlockCommands ) ( ) ;
2022-04-11 14:04:30 +02:00
const isMobileViewport = ( 0 , external _wp _compose _namespaceObject . useViewportMatch ) ( 'medium' , '<' ) ;
const isHugeViewport = ( 0 , external _wp _compose _namespaceObject . useViewportMatch ) ( 'huge' , '>=' ) ;
2023-02-07 08:04:52 +01:00
const isLargeViewport = ( 0 , external _wp _compose _namespaceObject . useViewportMatch ) ( 'large' ) ;
2021-05-19 17:09:27 +02:00
const {
openGeneralSidebar ,
closeGeneralSidebar ,
setIsInserterOpened
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
2022-04-12 17:12:47 +02:00
const {
createErrorNotice
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _notices _namespaceObject . store ) ;
2021-05-19 17:09:27 +02:00
const {
mode ,
isFullscreenActive ,
isRichEditingEnabled ,
sidebarIsOpened ,
hasActiveMetaboxes ,
hasFixedToolbar ,
previousShortcut ,
nextShortcut ,
hasBlockSelected ,
isInserterOpened ,
2021-05-21 12:14:23 +02:00
isListViewOpened ,
2021-05-19 17:09:27 +02:00
showIconLabels ,
2023-03-09 14:55:07 +01:00
isDistractionFree ,
2021-06-01 10:10:04 +02:00
showBlockBreadcrumbs ,
2021-11-08 15:29:21 +01:00
isTemplateMode ,
2023-08-20 01:22:38 +02:00
documentLabel
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
2021-11-08 15:29:21 +01:00
const {
getEditorSettings ,
getPostTypeLabel
2022-04-11 14:04:30 +02:00
} = select ( external _wp _editor _namespaceObject . store ) ;
2021-11-08 15:29:21 +01:00
const editorSettings = getEditorSettings ( ) ;
const postTypeLabel = getPostTypeLabel ( ) ;
2021-05-19 17:09:27 +02:00
return {
2022-04-11 14:04:30 +02:00
isTemplateMode : select ( store _store ) . isEditingTemplate ( ) ,
hasFixedToolbar : select ( store _store ) . isFeatureActive ( 'fixedToolbar' ) ,
sidebarIsOpened : ! ! ( select ( store ) . getActiveComplementaryArea ( store _store . name ) || select ( store _store ) . isPublishSidebarOpened ( ) ) ,
isFullscreenActive : select ( store _store ) . isFeatureActive ( 'fullscreenMode' ) ,
isInserterOpened : select ( store _store ) . isInserterOpened ( ) ,
isListViewOpened : select ( store _store ) . isListViewOpened ( ) ,
mode : select ( store _store ) . getEditorMode ( ) ,
2021-05-19 17:09:27 +02:00
isRichEditingEnabled : editorSettings . richEditingEnabled ,
2022-04-11 14:04:30 +02:00
hasActiveMetaboxes : select ( store _store ) . hasMetaBoxes ( ) ,
previousShortcut : select ( external _wp _keyboardShortcuts _namespaceObject . store ) . getAllShortcutKeyCombinations ( 'core/edit-post/previous-region' ) ,
nextShortcut : select ( external _wp _keyboardShortcuts _namespaceObject . store ) . getAllShortcutKeyCombinations ( 'core/edit-post/next-region' ) ,
showIconLabels : select ( store _store ) . isFeatureActive ( 'showIconLabels' ) ,
2023-03-09 14:55:07 +01:00
isDistractionFree : select ( store _store ) . isFeatureActive ( 'distractionFree' ) ,
2022-04-11 14:04:30 +02:00
showBlockBreadcrumbs : select ( store _store ) . isFeatureActive ( 'showBlockBreadcrumbs' ) ,
2021-11-08 15:29:21 +01:00
// translators: Default label for the Document in the Block Breadcrumb.
2023-08-20 01:22:38 +02:00
documentLabel : postTypeLabel || ( 0 , external _wp _i18n _namespaceObject . _x ) ( 'Document' , 'noun' )
2021-05-19 17:09:27 +02:00
} ;
} , [ ] ) ;
2023-08-20 01:22:38 +02:00
const styles = useEditorStyles ( ) ;
2023-09-26 16:23:26 +02:00
const openSidebarPanel = ( ) => openGeneralSidebar ( hasBlockSelected ? 'edit-post/block' : 'edit-post/document' ) ;
2021-04-15 17:19:43 +02:00
2023-09-26 16:23:26 +02:00
// Inserter and Sidebars are mutually exclusive
2022-04-11 14:04:30 +02:00
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
2021-05-19 17:09:27 +02:00
if ( sidebarIsOpened && ! isHugeViewport ) {
setIsInserterOpened ( false ) ;
}
} , [ sidebarIsOpened , isHugeViewport ] ) ;
2022-04-11 14:04:30 +02:00
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
2021-05-19 17:09:27 +02:00
if ( isInserterOpened && ! isHugeViewport ) {
closeGeneralSidebar ( ) ;
}
2023-09-26 16:23:26 +02:00
} , [ isInserterOpened , isHugeViewport ] ) ;
2021-04-15 17:19:43 +02:00
2023-09-26 16:23:26 +02:00
// Local state for save panel.
// Note 'truthy' callback implies an open panel.
2022-04-11 14:04:30 +02:00
const [ entitiesSavedStatesCallback , setEntitiesSavedStatesCallback ] = ( 0 , external _wp _element _namespaceObject . useState ) ( false ) ;
2023-09-26 16:23:26 +02:00
const [ listViewToggleElement , setListViewToggleElement ] = ( 0 , external _wp _element _namespaceObject . useState ) ( null ) ;
2022-04-11 14:04:30 +02:00
const closeEntitiesSavedStates = ( 0 , external _wp _element _namespaceObject . useCallback ) ( arg => {
2021-05-19 17:09:27 +02:00
if ( typeof entitiesSavedStatesCallback === 'function' ) {
entitiesSavedStatesCallback ( arg ) ;
}
setEntitiesSavedStatesCallback ( false ) ;
} , [ entitiesSavedStatesCallback ] ) ;
2023-09-26 16:23:26 +02:00
// We need to add the show-icon-labels class to the body element so it is applied to modals.
if ( showIconLabels ) {
document . body . classList . add ( 'show-icon-labels' ) ;
} else {
document . body . classList . remove ( 'show-icon-labels' ) ;
}
2023-02-21 14:09:42 +01:00
const className = classnames _default ( ) ( 'edit-post-layout' , 'is-mode-' + mode , {
'is-sidebar-opened' : sidebarIsOpened ,
'has-fixed-toolbar' : hasFixedToolbar ,
'has-metaboxes' : hasActiveMetaboxes ,
2023-03-09 14:55:07 +01:00
'is-distraction-free' : isDistractionFree && isLargeViewport ,
2023-02-21 14:09:42 +01:00
'is-entity-save-view-open' : ! ! entitiesSavedStatesCallback
} ) ;
2023-02-07 08:04:52 +01:00
const secondarySidebarLabel = isListViewOpened ? ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Document Overview' ) : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Block Library' ) ;
2021-05-21 12:14:23 +02:00
const secondarySidebar = ( ) => {
if ( mode === 'visual' && isInserterOpened ) {
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( InserterSidebar , null ) ;
2021-05-21 12:14:23 +02:00
}
if ( mode === 'visual' && isListViewOpened ) {
2023-09-26 16:23:26 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( ListViewSidebar , {
listViewToggleElement : listViewToggleElement
} ) ;
2021-05-21 12:14:23 +02:00
}
return null ;
} ;
2022-04-12 17:12:47 +02:00
function onPluginAreaError ( name ) {
2023-09-26 16:23:26 +02:00
createErrorNotice ( ( 0 , external _wp _i18n _namespaceObject . sprintf ) ( /* translators: %s: plugin name */
2022-04-12 17:12:47 +02:00
( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'The "%s" plugin has encountered an error and cannot be rendered.' ) , name ) ) ;
}
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( fullscreen _mode , {
2021-05-19 17:09:27 +02:00
isActive : isFullscreenActive
2023-09-26 16:23:26 +02:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( browser _url , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . UnsavedChangesWarning , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . AutosaveMonitor , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . LocalAutosaveMonitor , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( keyboard _shortcuts , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . EditorKeyboardShortcutsRegister , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . EditorKeyboardShortcuts , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( interface _skeleton , {
2023-03-09 14:55:07 +01:00
isDistractionFree : isDistractionFree && isLargeViewport ,
2021-05-19 17:09:27 +02:00
className : className ,
2023-09-26 16:23:26 +02:00
labels : {
... interfaceLabels ,
2022-04-19 17:11:17 +02:00
secondarySidebar : secondarySidebarLabel
} ,
2022-04-11 14:04:30 +02:00
header : ( 0 , external _wp _element _namespaceObject . createElement ) ( header , {
2023-09-26 16:23:26 +02:00
setEntitiesSavedStatesCallback : setEntitiesSavedStatesCallback ,
setListViewToggleElement : setListViewToggleElement
2021-05-19 17:09:27 +02:00
} ) ,
2023-02-07 08:04:52 +01:00
editorNotices : ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . EditorNotices , null ) ,
2021-05-21 12:14:23 +02:00
secondarySidebar : secondarySidebar ( ) ,
2022-04-11 14:04:30 +02:00
sidebar : ( ! isMobileViewport || sidebarIsOpened ) && ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ! isMobileViewport && ! sidebarIsOpened && ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
2021-05-19 17:09:27 +02:00
className : "edit-post-layout__toggle-sidebar-panel"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
2021-11-08 15:29:21 +01:00
variant : "secondary" ,
2021-05-19 17:09:27 +02:00
className : "edit-post-layout__toggle-sidebar-panel-button" ,
onClick : openSidebarPanel ,
"aria-expanded" : false
2022-04-11 14:04:30 +02:00
} , hasBlockSelected ? ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Open block settings' ) : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Open document settings' ) ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( complementary _area . Slot , {
2021-05-19 17:09:27 +02:00
scope : "core/edit-post"
} ) ) ,
2022-04-11 14:04:30 +02:00
notices : ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . EditorSnackbars , null ) ,
2023-02-07 08:04:52 +01:00
content : ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ! isDistractionFree && ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . EditorNotices , null ) , ( mode === 'text' || ! isRichEditingEnabled ) && ( 0 , external _wp _element _namespaceObject . createElement ) ( TextEditor , null ) , isRichEditingEnabled && mode === 'visual' && ( 0 , external _wp _element _namespaceObject . createElement ) ( VisualEditor , {
2021-05-19 17:09:27 +02:00
styles : styles
2023-03-09 14:55:07 +01:00
} ) , ! isDistractionFree && ! isTemplateMode && ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
2021-05-19 17:09:27 +02:00
className : "edit-post-layout__metaboxes"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( MetaBoxes , {
2021-05-19 17:09:27 +02:00
location : "normal"
2022-04-11 14:04:30 +02:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( MetaBoxes , {
2021-05-19 17:09:27 +02:00
location : "advanced"
2023-02-07 08:04:52 +01:00
} ) ) , isMobileViewport && sidebarIsOpened && ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . ScrollLock , null ) ) ,
2023-03-09 14:55:07 +01:00
footer : ! isDistractionFree && ! isMobileViewport && showBlockBreadcrumbs && isRichEditingEnabled && mode === 'visual' && ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
2021-05-19 17:09:27 +02:00
className : "edit-post-layout__footer"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . BlockBreadcrumb , {
2021-11-08 15:29:21 +01:00
rootLabelText : documentLabel
} ) ) ,
2022-04-11 14:04:30 +02:00
actions : ( 0 , external _wp _element _namespaceObject . createElement ) ( ActionsPanel , {
2021-05-19 17:09:27 +02:00
closeEntitiesSavedStates : closeEntitiesSavedStates ,
isEntitiesSavedStatesOpen : entitiesSavedStatesCallback ,
setEntitiesSavedStatesCallback : setEntitiesSavedStatesCallback
} ) ,
shortcuts : {
previous : previousShortcut ,
next : nextShortcut
}
2023-09-26 16:23:26 +02:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( EditPostPreferencesModal , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( keyboard _shortcut _help _modal , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( WelcomeGuide , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostSyncStatusModal , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( StartPageOptions , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _plugins _namespaceObject . PluginArea , {
2022-04-12 17:12:47 +02:00
onError : onPluginAreaError
2023-09-26 16:23:26 +02:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( settings _sidebar , null ) ) ;
2021-04-15 17:19:43 +02:00
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var components _layout = ( Layout ) ;
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 16:37:00 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/editor-initialization/listener-hooks.js
2021-05-19 17:09:27 +02:00
/ * *
* WordPress dependencies
* /
2018-12-14 05:41:57 +01:00
2019-03-21 13:48:00 +01:00
2021-11-08 15:29:21 +01:00
2023-09-26 16:23:26 +02:00
2019-10-15 17:37:08 +02:00
/ * *
2021-05-19 17:09:27 +02:00
* Internal dependencies
2019-10-15 17:37:08 +02:00
* /
2018-12-14 05:41:57 +01:00
2021-01-28 03:04:13 +01:00
/ * *
2021-05-19 17:09:27 +02:00
* This listener hook monitors for block selection and triggers the appropriate
* sidebar state .
*
2021-11-08 15:29:21 +01:00
* @ param { number } postId The current post id .
2021-01-28 03:04:13 +01:00
* /
2021-05-19 17:09:27 +02:00
const useBlockSelectionListener = postId => {
const {
hasBlockSelection ,
isEditorSidebarOpened
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => ( {
hasBlockSelection : ! ! select ( external _wp _blockEditor _namespaceObject . store ) . getBlockSelectionStart ( ) ,
isEditorSidebarOpened : select ( constants _STORE _NAME ) . isEditorSidebarOpened ( )
2021-05-19 17:09:27 +02:00
} ) , [ postId ] ) ;
const {
openGeneralSidebar
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( constants _STORE _NAME ) ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
2021-05-19 17:09:27 +02:00
if ( ! isEditorSidebarOpened ) {
return ;
}
if ( hasBlockSelection ) {
openGeneralSidebar ( 'edit-post/block' ) ;
} else {
openGeneralSidebar ( 'edit-post/document' ) ;
}
} , [ hasBlockSelection , isEditorSidebarOpened ] ) ;
} ;
2023-09-26 16:23:26 +02:00
2021-05-19 17:09:27 +02:00
/ * *
* This listener hook monitors any change in permalink and updates the view
* post link in the admin bar .
*
* @ param { number } postId
* /
const useUpdatePostLinkListener = postId => {
const {
newPermalink
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => ( {
newPermalink : select ( external _wp _editor _namespaceObject . store ) . getCurrentPost ( ) . link
2021-05-19 17:09:27 +02:00
} ) , [ postId ] ) ;
2022-04-11 14:04:30 +02:00
const nodeToUpdate = ( 0 , external _wp _element _namespaceObject . useRef ) ( ) ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
nodeToUpdate . current = document . querySelector ( VIEW _AS _PREVIEW _LINK _SELECTOR ) || document . querySelector ( VIEW _AS _LINK _SELECTOR ) ;
2021-05-19 17:09:27 +02:00
} , [ postId ] ) ;
2022-04-11 14:04:30 +02:00
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
2021-05-19 17:09:27 +02:00
if ( ! newPermalink || ! nodeToUpdate . current ) {
return ;
}
nodeToUpdate . current . setAttribute ( 'href' , newPermalink ) ;
} , [ newPermalink ] ) ;
} ;
2018-12-14 05:41:57 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/editor-initialization/index.js
2021-05-19 17:09:27 +02:00
/ * *
* Internal dependencies
* /
2018-12-14 05:41:57 +01:00
2023-09-26 16:23:26 +02:00
2021-05-19 17:09:27 +02:00
/ * *
* Data component used for initializing the editor and re - initializes
* when postId changes or on unmount .
*
2021-11-08 15:29:21 +01:00
* @ param { number } postId The id of the post .
2021-05-19 17:09:27 +02:00
* @ return { null } This is a data component so does not render any ui .
* /
2023-06-27 16:24:19 +02:00
function EditorInitialization ( {
postId
} ) {
2021-05-19 17:09:27 +02:00
useBlockSelectionListener ( postId ) ;
useUpdatePostLinkListener ( postId ) ;
return null ;
}
2020-02-06 22:03:31 +01:00
2023-06-27 16:24:19 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/block-default.js
2023-02-07 08:04:52 +01:00
/ * *
* WordPress dependencies
* /
2020-02-06 22:03:31 +01:00
2023-06-27 16:24:19 +02:00
const blockDefault = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
d : "M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"
} ) ) ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var block _default = ( blockDefault ) ;
2023-02-07 08:04:52 +01:00
2023-07-07 09:21:17 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/desktop.js
/ * *
* WordPress dependencies
* /
const desktop = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
d : "M20.5 16h-.7V8c0-1.1-.9-2-2-2H6.2c-1.1 0-2 .9-2 2v8h-.7c-.8 0-1.5.7-1.5 1.5h20c0-.8-.7-1.5-1.5-1.5zM5.7 8c0-.3.2-.5.5-.5h11.6c.3 0 .5.2.5.5v7.6H5.7V8z"
} ) ) ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var library _desktop = ( desktop ) ;
2023-07-07 09:21:17 +02:00
2023-06-27 16:24:19 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/code.js
/ * *
* WordPress dependencies
* /
const code = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
viewBox : "0 0 24 24" ,
xmlns : "http://www.w3.org/2000/svg"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
d : "M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z"
} ) ) ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var library _code = ( code ) ;
2023-06-27 16:24:19 +02:00
2023-09-26 16:23:26 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/keyboard.js
/ * *
* WordPress dependencies
* /
const keyboard = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
d : "m16 15.5h-8v-1.5h8zm-7.5-2.5h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm-9-3h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2z"
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
d : "m18.5 6.5h-13a.5.5 0 0 0 -.5.5v9.5a.5.5 0 0 0 .5.5h13a.5.5 0 0 0 .5-.5v-9.5a.5.5 0 0 0 -.5-.5zm-13-1.5h13a2 2 0 0 1 2 2v9.5a2 2 0 0 1 -2 2h-13a2 2 0 0 1 -2-2v-9.5a2 2 0 0 1 2-2z"
} ) ) ;
/* harmony default export */ var library _keyboard = ( keyboard ) ;
2023-06-28 09:04:13 +02:00
2023-09-26 16:23:26 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-list-bullets.js
2023-06-28 09:04:13 +02:00
/ * *
* WordPress dependencies
* /
2023-09-26 16:23:26 +02:00
const formatListBullets = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
2023-06-28 09:04:13 +02:00
xmlns : "http://www.w3.org/2000/svg" ,
2023-09-26 16:23:26 +02:00
viewBox : "0 0 24 24"
2023-06-28 09:04:13 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
2023-09-26 16:23:26 +02:00
d : "M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"
2023-06-28 09:04:13 +02:00
} ) ) ;
2023-09-26 16:23:26 +02:00
/* harmony default export */ var format _list _bullets = ( formatListBullets ) ;
2023-06-28 09:04:13 +02:00
2023-06-27 16:24:19 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/hooks/commands/use-common-commands.js
/ * *
* WordPress dependencies
* /
2023-09-26 16:23:26 +02:00
2023-06-27 16:24:19 +02:00
/ * *
* Internal dependencies
* /
2023-06-28 09:04:13 +02:00
2023-06-27 16:24:19 +02:00
function useCommonCommands ( ) {
const {
openGeneralSidebar ,
closeGeneralSidebar ,
2023-07-07 09:21:17 +02:00
switchEditorMode ,
2023-09-26 16:23:26 +02:00
setIsListViewOpened ,
toggleDistractionFree
2023-06-27 16:24:19 +02:00
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
2023-06-28 09:04:13 +02:00
const {
openModal
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store ) ;
2023-06-27 16:24:19 +02:00
const {
editorMode ,
2023-07-07 09:21:17 +02:00
activeSidebar ,
2023-09-26 16:23:26 +02:00
isListViewOpen ,
isPublishSidebarEnabled ,
showBlockBreadcrumbs ,
isDistractionFree
2023-07-07 09:21:17 +02:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
const {
getEditorMode ,
2023-09-26 16:23:26 +02:00
isListViewOpened ,
isFeatureActive
2023-07-07 09:21:17 +02:00
} = select ( store _store ) ;
return {
activeSidebar : select ( store ) . getActiveComplementaryArea ( store _store . name ) ,
editorMode : getEditorMode ( ) ,
2023-09-26 16:23:26 +02:00
isListViewOpen : isListViewOpened ( ) ,
isPublishSidebarEnabled : select ( external _wp _editor _namespaceObject . store ) . isPublishSidebarEnabled ( ) ,
showBlockBreadcrumbs : isFeatureActive ( 'showBlockBreadcrumbs' ) ,
isDistractionFree : select ( external _wp _preferences _namespaceObject . store ) . get ( store _store . name , 'distractionFree' )
2023-07-07 09:21:17 +02:00
} ;
} , [ ] ) ;
2023-06-27 16:24:19 +02:00
const {
toggle
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _preferences _namespaceObject . store ) ;
2023-09-26 16:23:26 +02:00
const {
createInfoNotice
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _notices _namespaceObject . store ) ;
const {
_ _unstableSaveForPreview
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _editor _namespaceObject . store ) ;
const {
getCurrentPostId
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( external _wp _editor _namespaceObject . store ) ;
2023-06-27 16:24:19 +02:00
( 0 , external _wp _commands _namespaceObject . useCommand ) ( {
name : 'core/open-settings-sidebar' ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Toggle settings sidebar' ) ,
icon : ( 0 , external _wp _i18n _namespaceObject . isRTL ) ( ) ? drawer _left : drawer _right ,
callback : ( {
close
} ) => {
close ( ) ;
if ( activeSidebar === 'edit-post/document' ) {
closeGeneralSidebar ( ) ;
} else {
openGeneralSidebar ( 'edit-post/document' ) ;
}
}
} ) ;
( 0 , external _wp _commands _namespaceObject . useCommand ) ( {
name : 'core/open-block-inspector' ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Toggle block inspector' ) ,
icon : block _default ,
callback : ( {
close
} ) => {
close ( ) ;
if ( activeSidebar === 'edit-post/block' ) {
closeGeneralSidebar ( ) ;
} else {
openGeneralSidebar ( 'edit-post/block' ) ;
}
}
} ) ;
( 0 , external _wp _commands _namespaceObject . useCommand ) ( {
name : 'core/toggle-distraction-free' ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Toggle distraction free' ) ,
callback : ( {
close
} ) => {
2023-09-26 16:23:26 +02:00
toggleDistractionFree ( ) ;
2023-06-27 16:24:19 +02:00
close ( ) ;
}
} ) ;
( 0 , external _wp _commands _namespaceObject . useCommand ) ( {
name : 'core/toggle-spotlight-mode' ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Toggle spotlight mode' ) ,
callback : ( {
close
} ) => {
toggle ( 'core/edit-post' , 'focusMode' ) ;
close ( ) ;
}
} ) ;
2023-07-07 09:21:17 +02:00
( 0 , external _wp _commands _namespaceObject . useCommand ) ( {
name : 'core/toggle-fullscreen-mode' ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Toggle fullscreen mode' ) ,
icon : library _desktop ,
callback : ( {
close
} ) => {
toggle ( 'core/edit-post' , 'fullscreenMode' ) ;
close ( ) ;
}
} ) ;
( 0 , external _wp _commands _namespaceObject . useCommand ) ( {
name : 'core/toggle-list-view' ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Toggle list view' ) ,
icon : list _view ,
callback : ( {
close
} ) => {
setIsListViewOpened ( ! isListViewOpen ) ;
close ( ) ;
}
} ) ;
2023-06-27 16:24:19 +02:00
( 0 , external _wp _commands _namespaceObject . useCommand ) ( {
name : 'core/toggle-top-toolbar' ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Toggle top toolbar' ) ,
callback : ( {
close
} ) => {
toggle ( 'core/edit-post' , 'fixedToolbar' ) ;
2023-09-26 16:23:26 +02:00
if ( isDistractionFree ) {
toggleDistractionFree ( ) ;
}
2023-06-27 16:24:19 +02:00
close ( ) ;
}
} ) ;
( 0 , external _wp _commands _namespaceObject . useCommand ) ( {
name : 'core/toggle-code-editor' ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Toggle code editor' ) ,
icon : library _code ,
callback : ( {
close
} ) => {
switchEditorMode ( editorMode === 'visual' ? 'text' : 'visual' ) ;
close ( ) ;
}
} ) ;
2023-06-28 09:04:13 +02:00
( 0 , external _wp _commands _namespaceObject . useCommand ) ( {
name : 'core/open-preferences' ,
2023-09-26 16:23:26 +02:00
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Editor preferences' ) ,
2023-06-28 09:04:13 +02:00
callback : ( ) => {
openModal ( PREFERENCES _MODAL _NAME ) ;
}
} ) ;
( 0 , external _wp _commands _namespaceObject . useCommand ) ( {
name : 'core/open-shortcut-help' ,
2023-09-26 16:23:26 +02:00
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Keyboard shortcuts' ) ,
icon : library _keyboard ,
2023-06-28 09:04:13 +02:00
callback : ( ) => {
openModal ( KEYBOARD _SHORTCUT _HELP _MODAL _NAME ) ;
}
} ) ;
2023-09-26 16:23:26 +02:00
( 0 , external _wp _commands _namespaceObject . useCommand ) ( {
name : 'core/toggle-breadcrumbs' ,
label : showBlockBreadcrumbs ? ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Hide block breadcrumbs' ) : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Show block breadcrumbs' ) ,
callback : ( {
close
} ) => {
toggle ( 'core/edit-post' , 'showBlockBreadcrumbs' ) ;
close ( ) ;
createInfoNotice ( showBlockBreadcrumbs ? ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Breadcrumbs hidden.' ) : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Breadcrumbs visible.' ) , {
id : 'core/edit-post/toggle-breadcrumbs/notice' ,
type : 'snackbar'
} ) ;
}
} ) ;
( 0 , external _wp _commands _namespaceObject . useCommand ) ( {
name : 'core/toggle-publish-sidebar' ,
label : isPublishSidebarEnabled ? ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Disable pre-publish checklist' ) : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Enable pre-publish checklist' ) ,
icon : format _list _bullets ,
callback : ( {
close
} ) => {
close ( ) ;
toggle ( 'core/edit-post' , 'isPublishSidebarEnabled' ) ;
createInfoNotice ( isPublishSidebarEnabled ? ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Pre-publish checklist off.' ) : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Pre-publish checklist on.' ) , {
id : 'core/edit-post/publish-sidebar/notice' ,
type : 'snackbar'
} ) ;
}
} ) ;
( 0 , external _wp _commands _namespaceObject . useCommand ) ( {
name : 'core/preview-link' ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Preview in a new tab' ) ,
icon : library _external ,
callback : async ( {
close
} ) => {
close ( ) ;
const postId = getCurrentPostId ( ) ;
const link = await _ _unstableSaveForPreview ( ) ;
window . open ( link , ` wp-preview- ${ postId } ` ) ;
}
} ) ;
2023-06-27 16:24:19 +02:00
}
2020-06-26 15:33:47 +02:00
2023-06-27 16:24:19 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/editor.js
2020-06-26 15:33:47 +02:00
2019-10-15 17:37:08 +02:00
/ * *
* WordPress dependencies
* /
2019-09-19 17:19:18 +02:00
2018-12-14 05:41:57 +01:00
2018-12-14 05:53:54 +01:00
2018-12-14 05:41:57 +01:00
2021-11-08 15:29:21 +01:00
2023-06-27 16:24:19 +02:00
2018-12-14 05:41:57 +01:00
/ * *
2019-10-15 17:37:08 +02:00
* Internal dependencies
2018-12-14 05:41:57 +01:00
* /
2023-02-07 08:04:52 +01:00
const {
ExperimentalEditorProvider
2023-02-14 16:44:36 +01:00
} = unlock ( external _wp _editor _namespaceObject . privateApis ) ;
2023-06-27 16:24:19 +02:00
const {
useCommands
} = unlock ( external _wp _coreCommands _namespaceObject . privateApis ) ;
function Editor ( {
postId ,
postType ,
settings ,
initialEdits ,
... props
} ) {
useCommands ( ) ;
useCommonCommands ( ) ;
2021-05-19 17:09:27 +02:00
const {
hasFixedToolbar ,
focusMode ,
2023-02-07 08:04:52 +01:00
isDistractionFree ,
2022-09-20 17:43:29 +02:00
hasInlineToolbar ,
2021-05-19 17:09:27 +02:00
post ,
preferredStyleVariations ,
hiddenBlockTypes ,
blockTypes ,
keepCaretInsideBlock ,
isTemplateMode ,
template
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
2023-06-27 16:24:19 +02:00
var _getPostType$viewable ;
2021-05-19 17:09:27 +02:00
const {
isFeatureActive ,
isEditingTemplate ,
2022-04-12 17:12:47 +02:00
getEditedPostTemplate ,
getHiddenBlockTypes
2022-04-11 14:04:30 +02:00
} = select ( store _store ) ;
2021-05-19 17:09:27 +02:00
const {
getEntityRecord ,
getPostType ,
2022-09-20 17:43:29 +02:00
getEntityRecords ,
canUser
2022-04-11 14:04:30 +02:00
} = select ( external _wp _coreData _namespaceObject . store ) ;
2021-05-19 17:09:27 +02:00
const {
getEditorSettings
2022-04-11 14:04:30 +02:00
} = select ( external _wp _editor _namespaceObject . store ) ;
2021-05-19 17:09:27 +02:00
const {
getBlockTypes
2022-04-11 14:04:30 +02:00
} = select ( external _wp _blocks _namespaceObject . store ) ;
2023-09-26 16:23:26 +02:00
const isTemplate = [ 'wp_template' , 'wp_template_part' ] . includes ( postType ) ;
// Ideally the initializeEditor function should be called using the ID of the REST endpoint.
2021-05-19 17:09:27 +02:00
// to avoid the special case.
let postObject ;
if ( isTemplate ) {
const posts = getEntityRecords ( 'postType' , postType , {
wp _id : postId
} ) ;
2023-06-27 16:24:19 +02:00
postObject = posts ? . [ 0 ] ;
2021-05-19 17:09:27 +02:00
} else {
postObject = getEntityRecord ( 'postType' , postType , postId ) ;
2019-10-15 17:37:08 +02:00
}
2021-05-19 17:09:27 +02:00
const supportsTemplateMode = getEditorSettings ( ) . supportsTemplateMode ;
2023-06-27 16:24:19 +02:00
const isViewable = ( _getPostType$viewable = getPostType ( postType ) ? . viewable ) !== null && _getPostType$viewable !== void 0 ? _getPostType$viewable : false ;
2022-09-20 17:43:29 +02:00
const canEditTemplate = canUser ( 'create' , 'templates' ) ;
2021-01-28 03:04:13 +01:00
return {
2023-07-25 10:40:23 +02:00
hasFixedToolbar : isFeatureActive ( 'fixedToolbar' ) ,
2021-05-19 17:09:27 +02:00
focusMode : isFeatureActive ( 'focusMode' ) ,
2023-02-07 08:04:52 +01:00
isDistractionFree : isFeatureActive ( 'distractionFree' ) ,
2022-09-20 17:43:29 +02:00
hasInlineToolbar : isFeatureActive ( 'inlineToolbar' ) ,
2022-04-12 17:12:47 +02:00
preferredStyleVariations : select ( external _wp _preferences _namespaceObject . store ) . get ( 'core/edit-post' , 'preferredStyleVariations' ) ,
hiddenBlockTypes : getHiddenBlockTypes ( ) ,
2021-05-19 17:09:27 +02:00
blockTypes : getBlockTypes ( ) ,
keepCaretInsideBlock : isFeatureActive ( 'keepCaretInsideBlock' ) ,
isTemplateMode : isEditingTemplate ( ) ,
2022-09-20 17:43:29 +02:00
template : supportsTemplateMode && isViewable && canEditTemplate ? getEditedPostTemplate ( ) : null ,
2021-05-19 17:09:27 +02:00
post : postObject
2021-01-28 03:04:13 +01:00
} ;
2021-11-08 15:29:21 +01:00
} , [ postType , postId ] ) ;
2021-05-19 17:09:27 +02:00
const {
updatePreferredStyleVariations ,
setIsInserterOpened
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
const editorSettings = ( 0 , external _wp _element _namespaceObject . useMemo ) ( ( ) => {
2023-09-26 16:23:26 +02:00
const result = {
... settings ,
2021-05-19 17:09:27 +02:00
_ _experimentalPreferredStyleVariations : {
value : preferredStyleVariations ,
onChange : updatePreferredStyleVariations
} ,
hasFixedToolbar ,
focusMode ,
2023-02-07 08:04:52 +01:00
isDistractionFree ,
2022-09-20 17:43:29 +02:00
hasInlineToolbar ,
2021-05-19 17:09:27 +02:00
// This is marked as experimental to give time for the quick inserter to mature.
_ _experimentalSetIsInserterOpened : setIsInserterOpened ,
2022-04-12 17:12:47 +02:00
keepCaretInsideBlock ,
// Keep a reference of the `allowedBlockTypes` from the server to handle use cases
// where we need to differentiate if a block is disabled by the user or some plugin.
defaultAllowedBlockTypes : settings . allowedBlockTypes
2023-09-26 16:23:26 +02:00
} ;
2018-12-18 04:14:52 +01:00
2023-09-26 16:23:26 +02:00
// Omit hidden block types if exists and non-empty.
2022-09-20 17:43:29 +02:00
if ( hiddenBlockTypes . length > 0 ) {
2021-05-19 17:09:27 +02:00
// Defer to passed setting for `allowedBlockTypes` if provided as
// anything other than `true` (where `true` is equivalent to allow
// all block types).
2023-06-27 16:24:19 +02:00
const defaultAllowedBlockTypes = true === settings . allowedBlockTypes ? blockTypes . map ( ( {
name
} ) => name ) : settings . allowedBlockTypes || [ ] ;
2023-02-07 08:04:52 +01:00
result . allowedBlockTypes = defaultAllowedBlockTypes . filter ( type => ! hiddenBlockTypes . includes ( type ) ) ;
2021-01-28 03:04:13 +01:00
}
2021-05-19 17:09:27 +02:00
return result ;
2023-06-27 16:24:19 +02:00
} , [ settings , hasFixedToolbar , hasInlineToolbar , focusMode , isDistractionFree , hiddenBlockTypes , blockTypes , preferredStyleVariations , setIsInserterOpened , updatePreferredStyleVariations , keepCaretInsideBlock ] ) ;
2021-05-19 17:09:27 +02:00
if ( ! post ) {
return null ;
2021-01-28 03:04:13 +01:00
}
2023-09-26 16:23:26 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . SlotFillProvider , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( ExperimentalEditorProvider , {
2021-05-19 17:09:27 +02:00
settings : editorSettings ,
post : post ,
initialEdits : initialEdits ,
useSubRegistry : false ,
2023-06-27 16:24:19 +02:00
_ _unstableTemplate : isTemplateMode ? template : undefined ,
... props
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . ErrorBoundary , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _commands _namespaceObject . CommandMenu , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( EditorInitialization , {
2021-05-19 17:09:27 +02:00
postId : postId
2023-09-26 16:23:26 +02:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( components _layout , null ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostLockedModal , null ) ) ) ;
2021-05-19 17:09:27 +02:00
}
2023-09-21 15:26:32 +02:00
/* harmony default export */ var editor = ( Editor ) ;
2018-12-14 05:53:54 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js
2018-12-14 05:53:54 +01:00
2020-01-22 23:06:21 +01:00
/ * *
2021-01-28 03:04:13 +01:00
* WordPress dependencies
2020-01-22 23:06:21 +01:00
* /
2018-12-14 05:53:54 +01:00
2022-09-20 17:43:29 +02:00
const isEverySelectedBlockAllowed = ( selected , allowed ) => selected . filter ( id => ! allowed . includes ( id ) ) . length === 0 ;
2023-09-26 16:23:26 +02:00
2021-05-19 17:09:27 +02:00
/ * *
* Plugins may want to add an item to the menu either for every block
* or only for the specific ones provided in the ` allowedBlocks ` component property .
*
* If there are multiple blocks selected the item will be rendered if every block
* is of one allowed type ( not necessarily the same ) .
*
* @ param { string [ ] } selectedBlocks Array containing the names of the blocks selected
2021-11-08 15:29:21 +01:00
* @ param { string [ ] } allowedBlocks Array containing the names of the blocks allowed
2021-05-19 17:09:27 +02:00
* @ return { boolean } Whether the item will be rendered or not .
* /
const shouldRenderItem = ( selectedBlocks , allowedBlocks ) => ! Array . isArray ( allowedBlocks ) || isEverySelectedBlockAllowed ( selectedBlocks , allowedBlocks ) ;
2023-09-26 16:23:26 +02:00
2021-05-19 17:09:27 +02:00
/ * *
* Renders a new item in the block settings menu .
*
* @ param { Object } props Component props .
* @ param { Array } [ props . allowedBlocks ] An array containing a list of block names for which the item should be shown . If not present , it 'll be rendered for any block. If multiple blocks are selected, it' ll be shown if and only if all of them are in the allowed list .
* @ param { WPBlockTypeIconRender } [ props . icon ] The [ Dashicon ] ( https : //developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element.
* @ param { string } props . label The menu item text .
* @ param { Function } props . onClick Callback function to be executed when the user click the menu item .
* @ param { boolean } [ props . small ] Whether to render the label or not .
* @ param { string } [ props . role ] The ARIA role for the menu item .
*
* @ example
* ` ` ` js
* // Using ES5 syntax
* var _ _ = wp . i18n . _ _ ;
* var PluginBlockSettingsMenuItem = wp . editPost . PluginBlockSettingsMenuItem ;
*
* function doOnClick ( ) {
* // To be called when the user clicks the menu item.
* }
*
* function MyPluginBlockSettingsMenuItem ( ) {
* return wp . element . createElement (
* PluginBlockSettingsMenuItem ,
* {
* allowedBlocks : [ 'core/paragraph' ] ,
* icon : 'dashicon-name' ,
* label : _ _ ( 'Menu item text' ) ,
* onClick : doOnClick ,
* }
* ) ;
* }
* ` ` `
*
* @ example
* ` ` ` jsx
* // Using ESNext syntax
* import { _ _ } from '@wordpress/i18n' ;
* import { PluginBlockSettingsMenuItem } from '@wordpress/edit-post' ;
*
* const doOnClick = ( ) => {
* // To be called when the user clicks the menu item.
* } ;
*
* const MyPluginBlockSettingsMenuItem = ( ) => (
* < PluginBlockSettingsMenuItem
* allowedBlocks = { [ 'core/paragraph' ] }
* icon = 'dashicon-name'
* label = { _ _ ( 'Menu item text' ) }
* onClick = { doOnClick } / >
* ) ;
* ` ` `
*
* @ return { WPComponent } The component to be rendered .
* /
2023-06-27 16:24:19 +02:00
const PluginBlockSettingsMenuItem = ( {
allowedBlocks ,
icon ,
label ,
onClick ,
small ,
role
} ) => ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . BlockSettingsMenuControls , null , ( {
selectedBlocks ,
onClose
} ) => {
if ( ! shouldRenderItem ( selectedBlocks , allowedBlocks ) ) {
return null ;
}
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . MenuItem , {
onClick : ( 0 , external _wp _compose _namespaceObject . compose ) ( onClick , onClose ) ,
icon : icon ,
label : small ? label : undefined ,
role : role
} , ! small && label ) ;
} ) ;
2023-09-21 15:26:32 +02:00
/* harmony default export */ var plugin _block _settings _menu _item = ( PluginBlockSettingsMenuItem ) ;
2020-01-22 23:06:21 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/plugin-more-menu-item/index.js
2021-05-19 17:09:27 +02:00
/ * *
* WordPress dependencies
* /
2021-01-28 03:04:13 +01:00
2022-04-12 17:12:47 +02:00
2023-09-26 16:23:26 +02:00
2021-05-19 17:09:27 +02:00
/ * *
* Renders a menu item in ` Plugins ` group in ` More Menu ` drop down , and can be used to as a button or link depending on the props provided .
* The text within the component appears as the menu item label .
*
2021-11-08 15:29:21 +01:00
* @ param { Object } props Component properties .
* @ param { string } [ props . href ] When ` href ` is provided then the menu item is represented as an anchor rather than button . It corresponds to the ` href ` attribute of the anchor .
2021-05-19 17:09:27 +02:00
* @ param { WPBlockTypeIconRender } [ props . icon = inherits from the plugin ] The [ Dashicon ] ( https : //developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered to the left of the menu item label.
2021-11-08 15:29:21 +01:00
* @ param { Function } [ props . onClick = noop ] The callback function to be executed when the user clicks the menu item .
2022-04-12 17:12:47 +02:00
* @ param { ... * } [ props . other ] Any additional props are passed through to the underlying [ MenuItem ] ( https : //github.com/WordPress/gutenberg/tree/HEAD/packages/components/src/menu-item/README.md) component.
2021-05-19 17:09:27 +02:00
*
* @ example
* ` ` ` js
* // Using ES5 syntax
* var _ _ = wp . i18n . _ _ ;
* var PluginMoreMenuItem = wp . editPost . PluginMoreMenuItem ;
* var moreIcon = wp . element . createElement ( 'svg' ) ; //... svg element.
*
* function onButtonClick ( ) {
* alert ( 'Button clicked.' ) ;
* }
*
* function MyButtonMoreMenuItem ( ) {
* return wp . element . createElement (
* PluginMoreMenuItem ,
* {
* icon : moreIcon ,
* onClick : onButtonClick ,
* } ,
* _ _ ( 'My button title' )
* ) ;
* }
* ` ` `
*
* @ example
* ` ` ` jsx
* // Using ESNext syntax
* import { _ _ } from '@wordpress/i18n' ;
* import { PluginMoreMenuItem } from '@wordpress/edit-post' ;
* import { more } from '@wordpress/icons' ;
*
* function onButtonClick ( ) {
* alert ( 'Button clicked.' ) ;
* }
*
* const MyButtonMoreMenuItem = ( ) => (
* < PluginMoreMenuItem
* icon = { more }
* onClick = { onButtonClick }
* >
* { _ _ ( 'My button title' ) }
* < / P l u g i n M o r e M e n u I t e m >
* ) ;
* ` ` `
*
* @ return { WPComponent } The component to be rendered .
* /
2023-09-21 15:26:32 +02:00
/* harmony default export */ var plugin _more _menu _item = ( ( 0 , external _wp _compose _namespaceObject . compose ) ( ( 0 , external _wp _plugins _namespaceObject . withPluginContext ) ( ( context , ownProps ) => {
2022-04-12 17:12:47 +02:00
var _ownProps$as ;
2021-05-19 17:09:27 +02:00
return {
2022-04-12 17:12:47 +02:00
as : ( _ownProps$as = ownProps . as ) !== null && _ownProps$as !== void 0 ? _ownProps$as : external _wp _components _namespaceObject . MenuItem ,
2021-05-19 17:09:27 +02:00
icon : ownProps . icon || context . icon ,
name : 'core/edit-post/plugin-more-menu'
} ;
2022-04-11 14:04:30 +02:00
} ) ) ( action _item ) ) ;
2020-01-22 23:06:21 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/plugin-sidebar-more-menu-item/index.js
2021-01-28 03:04:13 +01:00
2021-05-19 17:09:27 +02:00
/ * *
* WordPress dependencies
* /
2021-01-28 03:04:13 +01:00
2023-09-26 16:23:26 +02:00
2021-05-19 17:09:27 +02:00
/ * *
* Renders a menu item in ` Plugins ` group in ` More Menu ` drop down ,
* and can be used to activate the corresponding ` PluginSidebar ` component .
* The text within the component appears as the menu item label .
*
2021-11-08 15:29:21 +01:00
* @ param { Object } props Component props .
* @ param { string } props . target A string identifying the target sidebar you wish to be activated by this menu item . Must be the same as the ` name ` prop you have given to that sidebar .
2021-05-19 17:09:27 +02:00
* @ param { WPBlockTypeIconRender } [ props . icon = inherits from the plugin ] The [ Dashicon ] ( https : //developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered to the left of the menu item label.
*
* @ example
* ` ` ` js
* // Using ES5 syntax
* var _ _ = wp . i18n . _ _ ;
* var PluginSidebarMoreMenuItem = wp . editPost . PluginSidebarMoreMenuItem ;
* var moreIcon = wp . element . createElement ( 'svg' ) ; //... svg element.
*
* function MySidebarMoreMenuItem ( ) {
* return wp . element . createElement (
* PluginSidebarMoreMenuItem ,
* {
* target : 'my-sidebar' ,
2022-04-11 14:04:30 +02:00
* icon : moreIcon ,
* } ,
* _ _ ( 'My sidebar title' )
* )
* }
* ` ` `
*
* @ example
* ` ` ` jsx
* // Using ESNext syntax
* import { _ _ } from '@wordpress/i18n' ;
* import { PluginSidebarMoreMenuItem } from '@wordpress/edit-post' ;
* import { more } from '@wordpress/icons' ;
*
* const MySidebarMoreMenuItem = ( ) => (
* < PluginSidebarMoreMenuItem
* target = "my-sidebar"
* icon = { more }
* >
* { _ _ ( 'My sidebar title' ) }
* < / P l u g i n S i d e b a r M o r e M e n u I t e m >
* ) ;
* ` ` `
*
* @ return { WPComponent } The component to be rendered .
* /
2021-05-20 14:20:04 +02:00
2022-04-11 14:04:30 +02:00
function PluginSidebarMoreMenuItem ( props ) {
2023-09-26 16:23:26 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( ComplementaryAreaMoreMenuItem
// Menu item is marked with unstable prop for backward compatibility.
2022-04-11 14:04:30 +02:00
// @see https://github.com/WordPress/gutenberg/issues/14457
2023-06-27 16:24:19 +02:00
, {
2022-04-11 14:04:30 +02:00
_ _unstableExplicitMenuItem : true ,
2023-06-27 16:24:19 +02:00
scope : "core/edit-post" ,
... props
} ) ;
2022-04-11 14:04:30 +02:00
}
2019-03-07 10:09:59 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/index.js
2019-03-07 10:09:59 +01:00
2022-04-11 14:04:30 +02:00
/ * *
* WordPress dependencies
* /
2019-03-07 10:09:59 +01:00
2023-02-07 08:04:52 +01:00
2023-09-26 16:23:26 +02:00
2021-05-20 14:20:04 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* Internal dependencies
2021-05-20 14:20:04 +02:00
* /
2019-03-07 10:09:59 +01:00
2018-12-14 05:41:57 +01:00
2019-10-15 17:37:08 +02:00
2020-03-10 15:53:18 +01:00
2022-04-11 14:04:30 +02:00
/ * *
* Initializes and returns an instance of Editor .
*
* @ param { string } id Unique identifier for editor instance .
* @ param { string } postType Post type of the post to edit .
* @ param { Object } postId ID of the post to edit .
* @ param { ? Object } settings Editor settings object .
* @ param { Object } initialEdits Programmatic edits to apply initially , to be
* considered as non - user - initiated ( bypass for
* unsaved changes prompt ) .
* /
function initializeEditor ( id , postType , postId , settings , initialEdits ) {
const target = document . getElementById ( id ) ;
2023-02-07 08:04:52 +01:00
const root = ( 0 , external _wp _element _namespaceObject . createRoot ) ( target ) ;
2022-04-12 17:12:47 +02:00
( 0 , external _wp _data _namespaceObject . dispatch ) ( external _wp _preferences _namespaceObject . store ) . setDefaults ( 'core/edit-post' , {
editorMode : 'visual' ,
2022-04-11 14:04:30 +02:00
fixedToolbar : false ,
fullscreenMode : true ,
2022-04-12 17:12:47 +02:00
hiddenBlockTypes : [ ] ,
inactivePanels : [ ] ,
isPublishSidebarEnabled : true ,
openPanels : [ 'post-status' ] ,
preferredStyleVariations : { } ,
showBlockBreadcrumbs : true ,
2022-04-11 14:04:30 +02:00
showIconLabels : false ,
2022-09-20 17:43:29 +02:00
showListViewByDefault : false ,
2022-04-11 14:04:30 +02:00
themeStyles : true ,
2022-04-12 17:12:47 +02:00
welcomeGuide : true ,
2022-04-11 14:04:30 +02:00
welcomeGuideTemplate : true
} ) ;
2023-09-26 16:23:26 +02:00
( 0 , external _wp _data _namespaceObject . dispatch ) ( external _wp _blocks _namespaceObject . store ) . reapplyBlockTypeFilters ( ) ;
2019-09-19 17:19:18 +02:00
2023-09-26 16:23:26 +02:00
// Check if the block list view should be open by default.
2023-07-25 10:40:23 +02:00
// If `distractionFree` mode is enabled, the block list view should not be open.
if ( ( 0 , external _wp _data _namespaceObject . select ) ( store _store ) . isFeatureActive ( 'showListViewByDefault' ) && ! ( 0 , external _wp _data _namespaceObject . select ) ( store _store ) . isFeatureActive ( 'distractionFree' ) ) {
2022-09-20 17:43:29 +02:00
( 0 , external _wp _data _namespaceObject . dispatch ) ( store _store ) . setIsListViewOpened ( true ) ;
}
2022-04-11 14:04:30 +02:00
( 0 , external _wp _blockLibrary _namespaceObject . registerCoreBlocks ) ( ) ;
2023-02-07 08:04:52 +01:00
( 0 , external _wp _widgets _namespaceObject . registerLegacyWidgetBlock ) ( {
inserter : false
} ) ;
2023-03-07 16:31:49 +01:00
( 0 , external _wp _widgets _namespaceObject . registerWidgetGroupBlock ) ( {
inserter : false
} ) ;
2022-10-04 17:06:52 +02:00
if ( false ) { }
2023-09-26 16:23:26 +02:00
2022-10-04 17:06:52 +02:00
/ *
* Prevent adding template part in the post editor .
* Only add the filter when the post editor is initialized , not imported .
* Also only add the filter ( s ) after registerCoreBlocks ( )
* so that common filters in the block library are not overwritten .
* /
( 0 , external _wp _hooks _namespaceObject . addFilter ) ( 'blockEditor.__unstableCanInsertBlockType' , 'removeTemplatePartsFromInserter' , ( canInsert , blockType ) => {
if ( ! ( 0 , external _wp _data _namespaceObject . select ) ( store _store ) . isEditingTemplate ( ) && blockType . name === 'core/template-part' ) {
return false ;
}
2023-06-27 16:24:19 +02:00
return canInsert ;
} ) ;
2023-09-26 16:23:26 +02:00
2023-06-27 16:24:19 +02:00
/ *
* Prevent adding post content block ( except in query block ) in the post editor .
* Only add the filter when the post editor is initialized , not imported .
* Also only add the filter ( s ) after registerCoreBlocks ( )
* so that common filters in the block library are not overwritten .
* /
( 0 , external _wp _hooks _namespaceObject . addFilter ) ( 'blockEditor.__unstableCanInsertBlockType' , 'removePostContentFromInserter' , ( canInsert , blockType , rootClientId , {
getBlockParentsByBlockName
} ) => {
if ( ! ( 0 , external _wp _data _namespaceObject . select ) ( store _store ) . isEditingTemplate ( ) && blockType . name === 'core/post-content' ) {
return getBlockParentsByBlockName ( rootClientId , 'core/query' ) . length > 0 ;
}
2022-10-04 17:06:52 +02:00
return canInsert ;
2023-09-26 16:23:26 +02:00
} ) ;
2020-01-22 23:06:21 +01:00
2023-09-26 16:23:26 +02:00
// Show a console log warning if the browser is not in Standards rendering mode.
2022-04-11 14:04:30 +02:00
const documentMode = document . compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks' ;
if ( documentMode !== 'Standards' ) {
// eslint-disable-next-line no-console
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-09-26 16:23:26 +02:00
}
// This is a temporary fix for a couple of issues specific to Webkit on iOS.
2022-04-11 14:04:30 +02:00
// Without this hack the browser scrolls the mobile toolbar off-screen.
// Once supported in Safari we can replace this in favor of preventScroll.
// For details see issue #18632 and PR #18686
// Specifically, we scroll `interface-interface-skeleton__body` to enable a fixed top toolbar.
// But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar.
2021-05-20 14:20:04 +02:00
2022-04-11 14:04:30 +02:00
const isIphone = window . navigator . userAgent . indexOf ( 'iPhone' ) !== - 1 ;
if ( isIphone ) {
window . addEventListener ( 'scroll' , event => {
const editorScrollContainer = document . getElementsByClassName ( 'interface-interface-skeleton__body' ) [ 0 ] ;
if ( event . target === document ) {
// Scroll element into view by scrolling the editor container by the same amount
// that Mobile Safari tried to scroll the html element upwards.
if ( window . scrollY > 100 ) {
editorScrollContainer . scrollTop = editorScrollContainer . scrollTop + window . scrollY ;
2023-09-26 16:23:26 +02:00
}
// Undo unwanted scroll on html element, but only in the visual editor.
2022-04-11 14:04:30 +02:00
if ( document . getElementsByClassName ( 'is-mode-visual' ) [ 0 ] ) {
window . scrollTo ( 0 , 0 ) ;
}
}
} ) ;
2023-09-26 16:23:26 +02:00
}
2021-05-20 14:20:04 +02:00
2023-09-26 16:23:26 +02:00
// Prevent the default browser action for files dropped outside of dropzones.
2022-09-20 17:43:29 +02:00
window . addEventListener ( 'dragover' , e => e . preventDefault ( ) , false ) ;
window . addEventListener ( 'drop' , e => e . preventDefault ( ) , false ) ;
2023-02-07 08:04:52 +01:00
root . render ( ( 0 , external _wp _element _namespaceObject . createElement ) ( editor , {
2022-04-11 14:04:30 +02:00
settings : settings ,
postId : postId ,
postType : postType ,
initialEdits : initialEdits
2023-02-07 08:04:52 +01:00
} ) ) ;
return root ;
}
2023-09-26 16:23:26 +02:00
2023-02-07 08:04:52 +01:00
/ * *
* Used to reinitialize the editor after an error . Now it ' s a deprecated noop function .
* /
function reinitializeEditor ( ) {
external _wp _deprecated _default ( ) ( 'wp.editPost.reinitializeEditor' , {
since : '6.2' ,
version : '6.3'
} ) ;
2022-04-11 14:04:30 +02:00
}
2020-02-06 22:03:31 +01:00
2021-05-20 14:20:04 +02:00
2020-02-06 22:03:31 +01:00
2021-05-20 14:20:04 +02:00
2020-07-07 16:43:35 +02:00
2018-12-14 05:41:57 +01:00
2023-09-21 15:26:32 +02:00
} ( ) ;
2022-04-11 14:04:30 +02:00
( window . wp = window . wp || { } ) . editPost = _ _webpack _exports _ _ ;
/******/ } ) ( )
;