2022-04-11 14:04:30 +02:00
/******/ ( function ( ) { // webpackBootstrap
/******/ var _ _webpack _modules _ _ = ( {
/***/ 4403 :
/***/ ( function ( module , exports ) {
var _ _WEBPACK _AMD _DEFINE _ARRAY _ _ , _ _WEBPACK _AMD _DEFINE _RESULT _ _ ; / * !
Copyright ( c ) 2018 Jed Watson .
Licensed under the MIT License ( MIT ) , see
http : //jedwatson.github.io/classnames
* /
/* global define */
( function ( ) {
'use strict' ;
var hasOwn = { } . hasOwnProperty ;
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' ) {
if ( arg . toString === Object . prototype . toString ) {
for ( var key in arg ) {
if ( hasOwn . call ( arg , key ) && arg [ key ] ) {
classes . push ( key ) ;
}
}
} else {
classes . push ( arg . toString ( ) ) ;
}
}
}
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 */
/******/ ! function ( ) {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ _ _webpack _require _ _ . n = function ( module ) {
/******/ var getter = module && module . _ _esModule ?
/******/ function ( ) { return module [ 'default' ] ; } :
/******/ function ( ) { return module ; } ;
/******/ _ _webpack _require _ _ . d ( getter , { a : getter } ) ;
/******/ return getter ;
/******/ } ;
/******/ } ( ) ;
/******/
/******/ /* webpack/runtime/define property getters */
/******/ ! function ( ) {
/******/ // define getter functions for harmony exports
/******/ _ _webpack _require _ _ . d = function ( exports , definition ) {
/******/ 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 ] } ) ;
/******/ }
/******/ }
/******/ } ;
/******/ } ( ) ;
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ ! function ( ) {
/******/ _ _webpack _require _ _ . o = function ( obj , prop ) { return Object . prototype . hasOwnProperty . call ( obj , prop ) ; }
/******/ } ( ) ;
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ ! function ( ) {
/******/ // define __esModule on exports
/******/ _ _webpack _require _ _ . r = function ( exports ) {
/******/ if ( typeof Symbol !== 'undefined' && Symbol . toStringTag ) {
/******/ Object . defineProperty ( exports , Symbol . toStringTag , { value : 'Module' } ) ;
/******/ }
/******/ Object . defineProperty ( exports , '__esModule' , { value : true } ) ;
/******/ } ;
/******/ } ( ) ;
/******/
/************************************************************************/
var _ _webpack _exports _ _ = { } ;
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
! 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 _ _ , {
"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 ; }
} ) ;
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 , {
"disableComplementaryArea" : function ( ) { return disableComplementaryArea ; } ,
"enableComplementaryArea" : function ( ) { return enableComplementaryArea ; } ,
"pinItem" : function ( ) { return pinItem ; } ,
"setFeatureDefaults" : function ( ) { return setFeatureDefaults ; } ,
"setFeatureValue" : function ( ) { return setFeatureValue ; } ,
"toggleFeature" : function ( ) { return toggleFeature ; } ,
"unpinItem" : function ( ) { return unpinItem ; }
} ) ;
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 , {
"getActiveComplementaryArea" : function ( ) { return getActiveComplementaryArea ; } ,
"isFeatureActive" : function ( ) { return isFeatureActive ; } ,
"isItemPinned" : function ( ) { return isItemPinned ; }
} ) ;
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 , {
"__experimentalSetPreviewDeviceType" : function ( ) { return _ _experimentalSetPreviewDeviceType ; } ,
"__unstableCreateTemplate" : function ( ) { return _ _unstableCreateTemplate ; } ,
"__unstableSwitchToTemplateMode" : function ( ) { return _ _unstableSwitchToTemplateMode ; } ,
"closeGeneralSidebar" : function ( ) { return closeGeneralSidebar ; } ,
"closeModal" : function ( ) { return 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 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 ; } ,
"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 ; }
} ) ;
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 , {
"__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 ; } ,
2022-04-12 17:12:47 +02:00
"getHiddenBlockTypes" : function ( ) { return getHiddenBlockTypes ; } ,
2022-04-11 14:04:30 +02:00
"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 isModalActive ; } ,
"isPluginItemPinned" : function ( ) { return isPluginItemPinned ; } ,
"isPluginSidebarOpened" : function ( ) { return isPluginSidebarOpened ; } ,
"isPublishSidebarOpened" : function ( ) { return isPublishSidebarOpened ; } ,
"isSavingMetaBoxes" : function ( ) { return selectors _isSavingMetaBoxes ; }
} ) ;
2021-05-20 14:20:04 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: external ["wp","element"]
var external _wp _element _namespaceObject = window [ "wp" ] [ "element" ] ;
; // CONCATENATED MODULE: external ["wp","blocks"]
var external _wp _blocks _namespaceObject = window [ "wp" ] [ "blocks" ] ;
; // CONCATENATED MODULE: external ["wp","blockLibrary"]
var external _wp _blockLibrary _namespaceObject = window [ "wp" ] [ "blockLibrary" ] ;
; // CONCATENATED MODULE: external ["wp","data"]
var external _wp _data _namespaceObject = window [ "wp" ] [ "data" ] ;
; // CONCATENATED MODULE: external ["wp","hooks"]
var external _wp _hooks _namespaceObject = window [ "wp" ] [ "hooks" ] ;
2022-04-12 17:12:47 +02:00
; // CONCATENATED MODULE: external ["wp","preferences"]
var external _wp _preferences _namespaceObject = window [ "wp" ] [ "preferences" ] ;
; // CONCATENATED MODULE: external ["wp","mediaUtils"]
var external _wp _mediaUtils _namespaceObject = window [ "wp" ] [ "mediaUtils" ] ;
; // 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: ./node_modules/@babel/runtime/helpers/esm/extends.js
function _extends ( ) {
_extends = Object . assign || function ( target ) {
for ( var i = 1 ; i < arguments . length ; i ++ ) {
var source = arguments [ i ] ;
2021-05-20 14:20:04 +02:00
2022-04-11 14:04:30 +02:00
for ( var key in source ) {
if ( Object . prototype . hasOwnProperty . call ( source , key ) ) {
target [ key ] = source [ key ] ;
}
}
}
2021-05-20 14:20:04 +02:00
2022-04-11 14:04:30 +02:00
return target ;
} ;
2021-05-19 17:09:27 +02:00
2022-04-11 14:04:30 +02:00
return _extends . apply ( this , arguments ) ;
}
2022-04-12 17:12:47 +02:00
; // CONCATENATED MODULE: external "lodash"
var external _lodash _namespaceObject = window [ "lodash" ] ;
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: external ["wp","components"]
var external _wp _components _namespaceObject = window [ "wp" ] [ "components" ] ;
2022-04-12 17:12:47 +02:00
; // CONCATENATED MODULE: external ["wp","blockEditor"]
var external _wp _blockEditor _namespaceObject = window [ "wp" ] [ "blockEditor" ] ;
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: external ["wp","i18n"]
var external _wp _i18n _namespaceObject = window [ "wp" ] [ "i18n" ] ;
2022-04-12 17:12:47 +02:00
; // CONCATENATED MODULE: external ["wp","compose"]
var external _wp _compose _namespaceObject = window [ "wp" ] [ "compose" ] ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/hooks/validate-multiple-use/index.js
2021-11-08 15:29:21 +01:00
2022-04-12 17:12:47 +02:00
/ * *
* External dependencies
* /
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 ) => {
const multiple = ( 0 , external _wp _blocks _namespaceObject . hasBlockSupport ) ( block . name , 'multiple' , true ) ; // For block types with `multiple` support, there is no "original
// block" to be found in the content, as the block itself is valid.
2021-05-19 17:09:27 +02:00
2022-04-12 17:12:47 +02:00
if ( multiple ) {
return { } ;
} // Otherwise, only pass `originalBlockClientId` if it refers to a different
// block from the current one.
const blocks = select ( external _wp _blockEditor _namespaceObject . store ) . getBlocks ( ) ;
const firstOfSameType = ( 0 , external _lodash _namespaceObject . find ) ( blocks , _ref => {
let {
name
} = _ref ;
return block . name === name ;
} ) ;
const isInvalid = firstOfSameType && firstOfSameType . clientId !== block . clientId ;
return {
originalBlockClientId : isInvalid && firstOfSameType . clientId
} ;
} ) , ( 0 , external _wp _data _namespaceObject . withDispatch ) ( ( dispatch , _ref2 ) => {
let {
originalBlockClientId
} = _ref2 ;
return {
selectFirst : ( ) => dispatch ( external _wp _blockEditor _namespaceObject . store ) . selectBlock ( originalBlockClientId )
} ;
2021-11-08 15:29:21 +01:00
} ) ) ;
2022-04-12 17:12:47 +02:00
const withMultipleValidation = ( 0 , external _wp _compose _namespaceObject . createHigherOrderComponent ) ( BlockEdit => {
return enhance ( _ref3 => {
let {
originalBlockClientId ,
selectFirst ,
... props
} = _ref3 ;
if ( ! originalBlockClientId ) {
return ( 0 , external _wp _element _namespaceObject . createElement ) ( BlockEdit , props ) ;
}
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'
}
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( BlockEdit , _extends ( {
key : "block-edit"
} , props ) ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . Warning , {
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 ) ]
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( "strong" , null , blockType === null || blockType === void 0 ? void 0 : blockType . title , ": " ) , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'This block can only be used once.' ) ) ] ;
} ) ;
} , 'withMultipleValidation' ) ;
/ * *
* 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.
const transform = ( 0 , external _wp _blocks _namespaceObject . findTransform ) ( ( 0 , external _wp _blocks _namespaceObject . getBlockTransforms ) ( 'to' , blockName ) , _ref4 => {
let {
type ,
blocks
} = _ref4 ;
return type === 'block' && blocks . length === 1 ;
} // What about when .length > 1?
) ;
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
; // CONCATENATED MODULE: external ["wp","primitives"]
var external _wp _primitives _namespaceObject = window [ "wp" ] [ "primitives" ] ;
; // 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 , {
2022-04-12 17:12:47 +02:00
d : "M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"
2021-05-25 10:40:25 +02:00
} ) ) ;
2022-04-12 17:12:47 +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"]
var external _wp _plugins _namespaceObject = window [ "wp" ] [ "plugins" ] ;
; // CONCATENATED MODULE: external ["wp","url"]
var external _wp _url _namespaceObject = window [ "wp" ] [ "url" ] ;
; // CONCATENATED MODULE: external ["wp","notices"]
var external _wp _notices _namespaceObject = window [ "wp" ] [ "notices" ] ;
; // CONCATENATED MODULE: external ["wp","editor"]
var external _wp _editor _namespaceObject = window [ "wp" ] [ "editor" ] ;
; // 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 ) ;
const getText = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => ( ) => select ( external _wp _editor _namespaceObject . store ) . getEditedPostAttribute ( 'content' ) , [ ] ) ;
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
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Copy all content' ) ) ;
}
; // CONCATENATED MODULE: external ["wp","keycodes"]
var external _wp _keycodes _namespaceObject = window [ "wp" ] [ "keycodes" ] ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/store/reducer.js
2021-05-20 14:20:04 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* External dependencies
2021-05-20 14:20:04 +02:00
* /
2021-06-01 10:10:04 +02:00
/ * *
* WordPress dependencies
* /
/ * *
2022-04-12 17:12:47 +02:00
* Reducer storing the list of all programmatically removed panels .
2022-04-11 14:04:30 +02:00
*
2022-04-12 17:12:47 +02:00
* @ param { Array } state Current state .
* @ param { Object } action Action object .
2022-04-11 14:04:30 +02:00
*
2022-04-12 17:12:47 +02:00
* @ return { Array } Updated state .
2021-06-01 10:10:04 +02:00
* /
2022-04-12 17:12:47 +02:00
function removedPanels ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : [ ] ;
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
switch ( action . type ) {
case 'REMOVE_PANEL' :
if ( ! ( 0 , external _lodash _namespaceObject . includes ) ( state , action . panelName ) ) {
return [ ... state , action . panelName ] ;
}
2021-05-19 17:09:27 +02:00
2022-04-11 14:04:30 +02:00
}
2021-05-07 13:48:27 +02:00
2022-04-12 17:12:47 +02:00
return state ;
2022-04-11 14:04:30 +02:00
}
2021-05-07 13:48:27 +02:00
/ * *
2022-04-12 17:12:47 +02:00
* Reducer for storing the name of the open modal , or null if no modal is open .
2022-04-11 14:04:30 +02:00
*
2022-04-12 17:12:47 +02:00
* @ param { Object } state Previous state .
* @ param { Object } action Action object containing the ` name ` of the modal
2022-04-11 14:04:30 +02:00
*
2022-04-12 17:12:47 +02:00
* @ return { Object } Updated state
2021-05-07 13:48:27 +02:00
* /
2022-04-12 17:12:47 +02:00
function activeModal ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : null ;
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
switch ( action . type ) {
case 'OPEN_MODAL' :
return action . name ;
2021-05-20 14:20:04 +02:00
2022-04-12 17:12:47 +02:00
case 'CLOSE_MODAL' :
return null ;
2022-04-11 14:04:30 +02:00
}
2021-05-20 14:20:04 +02:00
2022-04-12 17:12:47 +02:00
return state ;
2022-04-11 14:04:30 +02:00
}
2022-04-12 17:12:47 +02:00
function publishSidebarActive ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : false ;
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2021-05-20 14:20:04 +02:00
2022-04-12 17:12:47 +02:00
switch ( action . type ) {
case 'OPEN_PUBLISH_SIDEBAR' :
return true ;
2021-05-20 14:20:04 +02:00
2022-04-12 17:12:47 +02:00
case 'CLOSE_PUBLISH_SIDEBAR' :
return false ;
2020-03-24 00:40:19 +01:00
2022-04-12 17:12:47 +02:00
case 'TOGGLE_PUBLISH_SIDEBAR' :
return ! state ;
2022-04-11 14:04:30 +02:00
}
2020-07-07 18:08:28 +02:00
2022-04-12 17:12:47 +02:00
return state ;
}
2022-04-11 14:04:30 +02:00
/ * *
2022-04-12 17:12:47 +02:00
* Reducer keeping track of the meta boxes isSaving state .
* A "true" value means the meta boxes saving request is in - flight .
2022-04-11 14:04:30 +02:00
*
2022-04-12 17:12:47 +02:00
*
* @ param { boolean } state Previous state .
* @ param { Object } action Action Object .
2022-04-11 14:04:30 +02:00
*
* @ return { Object } Updated state .
* /
2020-07-07 18:08:28 +02:00
2022-04-12 17:12:47 +02:00
function isSavingMetaBoxes ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : false ;
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2020-07-07 18:08:28 +02:00
2022-04-12 17:12:47 +02:00
switch ( action . type ) {
case 'REQUEST_META_BOX_UPDATES' :
return true ;
2020-03-24 00:40:19 +01:00
2022-04-12 17:12:47 +02:00
case 'META_BOX_UPDATES_SUCCESS' :
case 'META_BOX_UPDATES_FAILURE' :
return false ;
2020-07-07 18:08:28 +02:00
2022-04-12 17:12:47 +02:00
default :
return state ;
}
2022-04-11 14:04:30 +02:00
}
2021-05-19 17:09:27 +02:00
/ * *
2022-04-12 17:12:47 +02:00
* Reducer keeping track of the meta boxes per location .
2022-04-11 14:04:30 +02:00
*
2022-04-12 17:12:47 +02:00
* @ param { boolean } state Previous state .
* @ param { Object } action Action Object .
2022-04-11 14:04:30 +02:00
*
2022-04-12 17:12:47 +02:00
* @ return { Object } Updated state .
2021-05-19 17:09:27 +02:00
* /
2020-07-07 18:08:28 +02:00
2022-04-12 17:12:47 +02:00
function metaBoxLocations ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2020-07-07 18:08:28 +02:00
2022-04-12 17:12:47 +02:00
switch ( action . type ) {
case 'SET_META_BOXES_PER_LOCATIONS' :
return action . metaBoxesPerLocation ;
}
2020-07-07 18:08:28 +02:00
2022-04-12 17:12:47 +02:00
return state ;
2022-04-11 14:04:30 +02:00
}
2021-05-19 17:09:27 +02:00
/ * *
2022-04-12 17:12:47 +02:00
* Reducer returning the editing canvas device type .
2021-05-19 17:09:27 +02:00
*
2022-04-12 17:12:47 +02:00
* @ param { Object } state Current state .
* @ param { Object } action Dispatched action .
2021-05-19 17:09:27 +02:00
*
2022-04-12 17:12:47 +02:00
* @ return { Object } Updated state .
2021-05-19 17:09:27 +02:00
* /
2020-07-07 18:08:28 +02:00
2022-04-12 17:12:47 +02:00
function deviceType ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : 'Desktop' ;
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2020-07-07 18:08:28 +02:00
2022-04-12 17:12:47 +02:00
switch ( action . type ) {
case 'SET_PREVIEW_DEVICE_TYPE' :
return action . deviceType ;
}
2020-02-10 23:33:27 +01:00
2022-04-12 17:12:47 +02:00
return state ;
2022-04-11 14:04:30 +02:00
}
2021-05-07 13:48:27 +02:00
/ * *
2022-04-12 17:12:47 +02:00
* Reducer to set the block inserter panel open or closed .
2021-05-19 17:09:27 +02:00
*
2022-04-12 17:12:47 +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 .
2021-05-19 17:09:27 +02:00
*
2022-04-12 17:12:47 +02:00
* @ param { Object } state Current state .
* @ param { Object } action Dispatched action .
2021-05-07 13:48:27 +02:00
* /
2022-04-12 17:12:47 +02:00
function blockInserterPanel ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : false ;
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2021-05-07 13:48:27 +02:00
2022-04-12 17:12:47 +02:00
switch ( action . type ) {
case 'SET_IS_LIST_VIEW_OPENED' :
return action . isOpen ? false : state ;
2021-05-07 13:48:27 +02:00
2022-04-12 17:12:47 +02:00
case 'SET_IS_INSERTER_OPENED' :
return action . value ;
}
return state ;
2021-05-19 17:09:27 +02:00
}
2022-04-11 14:04:30 +02:00
/ * *
2022-04-12 17:12:47 +02:00
* Reducer to set the list view panel open or closed .
2022-04-11 14:04:30 +02:00
*
2022-04-12 17:12:47 +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 .
2022-04-11 14:04:30 +02:00
*
2022-04-12 17:12:47 +02:00
* @ param { Object } state Current state .
* @ param { Object } action Dispatched action .
2022-04-11 14:04:30 +02:00
* /
2021-11-15 13:50:17 +01:00
2022-04-12 17:12:47 +02:00
function listViewPanel ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : false ;
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2020-10-13 15:10:30 +02:00
2022-04-12 17:12:47 +02:00
switch ( action . type ) {
case 'SET_IS_INSERTER_OPENED' :
return action . value ? false : state ;
2020-10-13 15:10:30 +02:00
2022-04-12 17:12:47 +02:00
case 'SET_IS_LIST_VIEW_OPENED' :
return action . isOpen ;
}
2020-10-13 15:10:30 +02:00
2022-04-12 17:12:47 +02:00
return state ;
2019-09-19 17:19:18 +02:00
}
2021-05-19 17:09:27 +02:00
/ * *
2022-04-12 17:12:47 +02:00
* Reducer tracking whether the inserter is open .
2021-05-19 17:09:27 +02:00
*
2022-04-12 17:12:47 +02:00
* @ param { boolean } state
* @ param { Object } action
2021-05-19 17:09:27 +02:00
* /
2019-03-07 10:09:59 +01:00
2022-04-12 17:12:47 +02:00
function isEditingTemplate ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : false ;
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2020-03-24 00:40:19 +01:00
2022-04-12 17:12:47 +02:00
switch ( action . type ) {
case 'SET_IS_EDITING_TEMPLATE' :
return action . value ;
}
2020-03-24 00:40:19 +01:00
2022-04-12 17:12:47 +02:00
return state ;
2021-05-19 17:09:27 +02:00
}
/ * *
2022-04-12 17:12:47 +02:00
* Reducer tracking whether meta boxes are initialized .
2021-05-19 17:09:27 +02:00
*
2022-04-12 17:12:47 +02:00
* @ param { boolean } state
* @ param { Object } action
2021-05-19 17:09:27 +02:00
*
2022-04-12 17:12:47 +02:00
* @ return { boolean } Updated state .
2021-05-19 17:09:27 +02:00
* /
2020-07-07 16:43:35 +02:00
2022-04-12 17:12:47 +02:00
function metaBoxesInitialized ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : false ;
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2020-07-07 16:43:35 +02:00
2022-04-12 17:12:47 +02:00
switch ( action . type ) {
case 'META_BOXES_INITIALIZED' :
return true ;
}
2021-11-15 13:50:17 +01:00
2022-04-12 17:12:47 +02:00
return state ;
2022-04-11 14:04:30 +02:00
}
2021-05-21 12:14:23 +02:00
2022-04-12 17:12:47 +02:00
const metaBoxes = ( 0 , external _wp _data _namespaceObject . combineReducers ) ( {
isSaving : isSavingMetaBoxes ,
locations : metaBoxLocations ,
initialized : metaBoxesInitialized
} ) ;
/* harmony default export */ var reducer = ( ( 0 , external _wp _data _namespaceObject . combineReducers ) ( {
activeModal ,
metaBoxes ,
publishSidebarActive ,
removedPanels ,
deviceType ,
blockInserterPanel ,
listViewPanel ,
isEditingTemplate
} ) ) ;
; // CONCATENATED MODULE: external ["wp","apiFetch"]
var external _wp _apiFetch _namespaceObject = window [ "wp" ] [ "apiFetch" ] ;
var external _wp _apiFetch _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( external _wp _apiFetch _namespaceObject ) ;
// 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"
} ) ) ;
/* harmony default export */ var library _check = ( check ) ;
; // 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"
} ) ) ;
/* harmony default export */ var star _filled = ( starFilled ) ;
; // 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"
} ) ) ;
/* harmony default export */ var star _empty = ( starEmpty ) ;
; // CONCATENATED MODULE: external ["wp","viewport"]
var external _wp _viewport _namespaceObject = window [ "wp" ] [ "viewport" ] ;
; // 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"
} ) ) ;
/* harmony default export */ var close _small = ( closeSmall ) ;
; // CONCATENATED MODULE: external ["wp","deprecated"]
var external _wp _deprecated _namespaceObject = window [ "wp" ] [ "deprecated" ] ;
var external _wp _deprecated _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( external _wp _deprecated _namespaceObject ) ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/actions.js
/ * *
* WordPress dependencies
* /
/ * *
* Enable the complementary area .
*
* @ param { string } scope Complementary area scope .
* @ param { string } area Area identifier .
* /
const enableComplementaryArea = ( scope , area ) => _ref => {
let {
registry
} = _ref ;
// Return early if there's no area.
if ( ! area ) {
return ;
}
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . set ( scope , 'complementaryArea' , area ) ;
} ;
/ * *
* Disable the complementary area .
*
* @ param { string } scope Complementary area scope .
* /
const disableComplementaryArea = scope => _ref2 => {
let {
registry
} = _ref2 ;
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . set ( scope , 'complementaryArea' , null ) ;
} ;
/ * *
* Pins an item .
*
* @ param { string } scope Item scope .
* @ param { string } item Item identifier .
*
* @ return { Object } Action object .
* /
const pinItem = ( scope , item ) => _ref3 => {
let {
registry
} = _ref3 ;
// Return early if there's no item.
if ( ! item ) {
return ;
}
const pinnedItems = registry . select ( external _wp _preferences _namespaceObject . store ) . get ( scope , 'pinnedItems' ) ; // The item is already pinned, there's nothing to do.
if ( ( pinnedItems === null || pinnedItems === void 0 ? void 0 : pinnedItems [ item ] ) === true ) {
return ;
}
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . set ( scope , 'pinnedItems' , { ... pinnedItems ,
[ item ] : true
} ) ;
} ;
/ * *
* Unpins an item .
*
* @ param { string } scope Item scope .
* @ param { string } item Item identifier .
* /
const unpinItem = ( scope , item ) => _ref4 => {
let {
registry
} = _ref4 ;
// Return early if there's no item.
if ( ! item ) {
return ;
}
const pinnedItems = registry . select ( external _wp _preferences _namespaceObject . store ) . get ( scope , 'pinnedItems' ) ;
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . set ( scope , 'pinnedItems' , { ... pinnedItems ,
[ item ] : false
} ) ;
} ;
/ * *
* 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 ) {
return function ( _ref5 ) {
let {
registry
} = _ref5 ;
external _wp _deprecated _default ( ) ( ` wp.dispatch( 'core/interface' ).toggleFeature ` , {
since : '6.0' ,
alternative : ` wp.dispatch( 'core/preferences' ).toggle `
} ) ;
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . toggle ( scope , featureName ) ;
} ;
}
/ * *
* 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 ) {
return function ( _ref6 ) {
let {
registry
} = _ref6 ;
external _wp _deprecated _default ( ) ( ` wp.dispatch( 'core/interface' ).setFeatureValue ` , {
since : '6.0' ,
alternative : ` wp.dispatch( 'core/preferences' ).set `
} ) ;
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . set ( scope , featureName , ! ! value ) ;
} ;
}
/ * *
* 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 ) {
return function ( _ref7 ) {
let {
registry
} = _ref7 ;
external _wp _deprecated _default ( ) ( ` wp.dispatch( 'core/interface' ).setFeatureDefaults ` , {
since : '6.0' ,
alternative : ` wp.dispatch( 'core/preferences' ).setDefaults `
} ) ;
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . setDefaults ( scope , defaults ) ;
} ;
}
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/selectors.js
/ * *
* WordPress dependencies
* /
/ * *
* Returns the complementary area that is active in a given scope .
*
* @ param { Object } state Global application state .
* @ param { string } scope Item scope .
*
* @ return { string } The complementary area that is active in the given scope .
* /
const getActiveComplementaryArea = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( select => ( state , scope ) => {
return select ( external _wp _preferences _namespaceObject . store ) . get ( scope , 'complementaryArea' ) ;
} ) ;
/ * *
* 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' ) ;
return ( _pinnedItems$item = pinnedItems === null || pinnedItems === void 0 ? void 0 : pinnedItems [ item ] ) !== null && _pinnedItems$item !== void 0 ? _pinnedItems$item : true ;
} ) ;
/ * *
* 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 ) => {
external _wp _deprecated _default ( ) ( ` wp.select( 'core/interface' ).isFeatureActive( scope, featureName ) ` , {
since : '6.0' ,
alternative : ` !! wp.select( 'core/preferences' ).isFeatureActive( scope, featureName ) `
} ) ;
return ! ! select ( external _wp _preferences _namespaceObject . store ) . get ( scope , featureName ) ;
} ) ;
; // 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
* /
/ * *
* Internal dependencies
* /
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 , {
2022-04-12 17:12:47 +02:00
reducer : ( ) => { } ,
2022-04-11 14:04:30 +02:00
actions : actions _namespaceObject ,
2022-04-12 17:12:47 +02:00
selectors : selectors _namespaceObject
2022-04-11 14:04:30 +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
* /
/* harmony default export */ var complementary _area _context = ( ( 0 , external _wp _plugins _namespaceObject . withPluginContext ) ( ( context , ownProps ) => {
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
2021-05-21 12:14:23 +02:00
2021-05-19 17:09:27 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* External dependencies
* /
/ * *
* 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
2020-07-07 16:43:35 +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
* /
2021-11-15 13:50:17 +01: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
function ComplementaryAreaToggle ( _ref ) {
let {
as = external _wp _components _namespaceObject . Button ,
scope ,
identifier ,
icon ,
selectedIcon ,
... props
} = _ref ;
const ComponentToUse = as ;
const isSelected = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => select ( store ) . getActiveComplementaryArea ( scope ) === identifier , [ identifier ] ) ;
const {
enableComplementaryArea ,
disableComplementaryArea
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( ComponentToUse , _extends ( {
icon : selectedIcon && isSelected ? selectedIcon : icon ,
onClick : ( ) => {
if ( isSelected ) {
disableComplementaryArea ( scope ) ;
} else {
enableComplementaryArea ( scope , identifier ) ;
}
}
} , ( 0 , external _lodash _namespaceObject . omit ) ( props , [ 'name' ] ) ) ) ;
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
}
2018-12-18 04:14:52 +01:00
2022-04-11 14:04:30 +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
2021-05-07 13:48:27 +02:00
2022-04-11 14:04:30 +02:00
/ * *
* External dependencies
* /
2021-05-07 13:48:27 +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
2018-12-18 04:14:52 +01:00
2022-04-11 14:04:30 +02:00
const ComplementaryAreaHeader = _ref => {
let {
smallScreenTitle ,
children ,
className ,
toggleButtonProps
} = _ref ;
const toggleButton = ( 0 , external _wp _element _namespaceObject . createElement ) ( complementary _area _toggle , _extends ( {
icon : close _small
} , toggleButtonProps ) ) ;
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
} ;
2020-06-26 15:33:47 +02:00
2022-04-11 14:04:30 +02:00
/* harmony default export */ var complementary _area _header = ( ComplementaryAreaHeader ) ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/action-item/index.js
2021-05-19 17:09:27 +02:00
/ * *
* External dependencies
* /
2018-12-18 04:14:52 +01:00
2021-01-28 03:04:13 +01:00
/ * *
* WordPress dependencies
* /
2018-12-18 04:14:52 +01:00
2022-04-11 14:04:30 +02:00
function ActionItemSlot ( _ref ) {
let {
name ,
as : Component = external _wp _components _namespaceObject . ButtonGroup ,
fillProps = { } ,
bubblesVirtually ,
... props
} = _ref ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Slot , {
name : name ,
bubblesVirtually : bubblesVirtually ,
fillProps : fillProps
} , fills => {
if ( ( 0 , external _lodash _namespaceObject . isEmpty ) ( external _wp _element _namespaceObject . Children . toArray ( fills ) ) ) {
return null ;
} // Special handling exists for backward compatibility.
// 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
2019-03-21 13:48:00 +01:00
2022-04-11 14:04:30 +02:00
const initializedByPlugins = [ ] ;
external _wp _element _namespaceObject . Children . forEach ( fills , _ref2 => {
let {
props : {
_ _unstableExplicitMenuItem ,
_ _unstableTarget
}
} = _ref2 ;
2021-05-19 17:09:27 +02:00
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 ;
}
2019-03-07 10:09:59 +01:00
2022-04-11 14:04:30 +02:00
return child ;
} ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( Component , props , children ) ;
} ) ;
}
2020-06-29 13:50:29 +02:00
2022-04-11 14:04:30 +02:00
function ActionItem ( _ref3 ) {
let {
name ,
as : Component = external _wp _components _namespaceObject . Button ,
onClick ,
... props
} = _ref3 ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Fill , {
name : name
} , _ref4 => {
let {
onClick : fpOnClick
} = _ref4 ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( Component , _extends ( {
onClick : onClick || fpOnClick ? function ( ) {
( onClick || external _lodash _namespaceObject . noop ) ( ... arguments ) ;
( fpOnClick || external _lodash _namespaceObject . noop ) ( ... arguments ) ;
} : undefined
} , props ) ) ;
} ) ;
}
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
ActionItem . Slot = ActionItemSlot ;
/* 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
2020-06-26 15:33:47 +02:00
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
* /
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
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
2021-01-28 03:04:13 +01:00
2022-04-11 14:04:30 +02:00
const PluginsMenuItem = props => // 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
( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . MenuItem , ( 0 , external _lodash _namespaceObject . omit ) ( props , [ '__unstableExplicitMenuItem' , '__unstableTarget' ] ) ) ;
2021-05-07 13:48:27 +02:00
2022-04-11 14:04:30 +02:00
function ComplementaryAreaMoreMenuItem ( _ref ) {
let {
scope ,
target ,
_ _unstableExplicitMenuItem ,
... props
} = _ref ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( complementary _area _toggle , _extends ( {
as : toggleProps => {
return ( 0 , external _wp _element _namespaceObject . createElement ) ( action _item , _extends ( {
_ _unstableExplicitMenuItem : _ _unstableExplicitMenuItem ,
_ _unstableTarget : ` ${ scope } / ${ target } ` ,
as : PluginsMenuItem ,
name : ` ${ scope } /plugin-more-menu `
} , toggleProps ) ) ;
} ,
role : "menuitemcheckbox" ,
selectedIcon : library _check ,
name : target ,
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-07 13:48:27 +02:00
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
2022-04-11 14:04:30 +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
2022-04-11 14:04:30 +02:00
function PinnedItems ( _ref ) {
let {
scope ,
... props
} = _ref ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Fill , _extends ( {
name : ` PinnedItems/ ${ 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
function PinnedItemsSlot ( _ref2 ) {
let {
scope ,
className ,
... props
} = _ref2 ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Slot , _extends ( {
name : ` PinnedItems/ ${ scope } `
} , props ) , fills => ! ( 0 , external _lodash _namespaceObject . isEmpty ) ( fills ) && ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : classnames _default ( ) ( className , 'interface-pinned-items' )
} , fills ) ) ;
2021-05-19 17:09:27 +02:00
}
2020-06-26 15:33:47 +02:00
2022-04-11 14:04:30 +02:00
PinnedItems . Slot = PinnedItemsSlot ;
/* harmony default export */ var pinned _items = ( PinnedItems ) ;
; // 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
* /
/ * *
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
2020-10-13 15:10:30 +02:00
2021-06-01 10:10:04 +02:00
2022-04-11 14:04:30 +02:00
function ComplementaryAreaSlot ( _ref ) {
let {
scope ,
... props
} = _ref ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Slot , _extends ( {
name : ` ComplementaryArea/ ${ scope } `
} , props ) ) ;
2021-04-15 17:19:43 +02:00
}
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
function ComplementaryAreaFill ( _ref2 ) {
let {
scope ,
children ,
className
} = _ref2 ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Fill , {
name : ` ComplementaryArea/ ${ scope } `
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : className
} , children ) ) ;
2021-11-08 15:29:21 +01: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
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 ) ( ( ) => {
// If the complementary area is active and the editor is switching from a big to a small window size.
if ( isActive && isSmall && ! previousIsSmall . current ) {
// Disable the complementary area.
disableComplementaryArea ( scope ) ; // Flag the complementary area to be reopened when the window size goes from small to big.
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
shouldOpenWhenNotSmall . current = true ;
} else if ( // If there is a flag indicating the complementary area should be enabled when we go from small to big window size
// and we are going from a small to big window size.
shouldOpenWhenNotSmall . current && ! isSmall && previousIsSmall . current ) {
// Remove the flag indicating the complementary area should be enabled.
shouldOpenWhenNotSmall . current = false ; // Enable the complementary area.
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
enableComplementaryArea ( scope , identifier ) ;
} else if ( // If the flag is indicating the current complementary should be reopened but another complementary area becomes active,
// remove the flag.
shouldOpenWhenNotSmall . current && activeArea && activeArea !== identifier ) {
shouldOpenWhenNotSmall . current = false ;
}
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
if ( isSmall !== previousIsSmall . current ) {
previousIsSmall . current = isSmall ;
}
} , [ isActive , isSmall , scope , identifier , activeArea ] ) ;
}
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
function ComplementaryArea ( _ref3 ) {
let {
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
} = _ref3 ;
const {
isActive ,
isPinned ,
activeArea ,
isSmall ,
isLarge
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
const {
getActiveComplementaryArea ,
isItemPinned
} = select ( 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
2022-04-11 14:04:30 +02:00
const _activeArea = getActiveComplementaryArea ( scope ) ;
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
return {
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 ) ( ( ) => {
if ( isActiveByDefault && activeArea === undefined && ! isSmall ) {
enableComplementaryArea ( 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
}
2022-04-11 14:04:30 +02:00
} , [ activeArea , isActiveByDefault , scope , identifier , isSmall ] ) ;
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 ,
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 ) ,
scope : scope
} , ( 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
}
2021-04-15 17:19:43 +02:00
2022-04-11 14:04:30 +02:00
const ComplementaryAreaWrapped = complementary _area _context ( ComplementaryArea ) ;
ComplementaryAreaWrapped . Slot = ComplementaryAreaSlot ;
/* 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
* /
2019-10-15 17:37:08 +02:00
2022-04-11 14:04:30 +02:00
const FullscreenMode = _ref => {
let {
isActive
} = _ref ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
let isSticky = false ; // `is-fullscreen-mode` is set in PHP as a body class by Gutenberg, and this causes
// `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.
2020-03-24 00:40:19 +01:00
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 ;
} ;
/* harmony default export */ var fullscreen _mode = ( FullscreenMode ) ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/interface-skeleton/index.js
2019-10-15 17:37:08 +02:00
2019-03-07 10:09:59 +01: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
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
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-10-20 15:36:16 +02:00
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
}
2020-06-26 15:33:47 +02:00
2022-04-11 14:04:30 +02:00
function InterfaceSkeleton ( _ref , ref ) {
let {
footer ,
header ,
sidebar ,
secondarySidebar ,
notices ,
content ,
drawer ,
actions ,
labels ,
className ,
shortcuts
} = _ref ;
const navigateRegionsProps = ( 0 , external _wp _components _namespaceObject . _ _unstableUseNavigateRegions ) ( shortcuts ) ;
useHTMLClass ( 'interface-interface-skeleton__html-container' ) ;
const defaultLabels = {
/* translators: accessibility text for the nav bar landmark region. */
drawer : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Drawer' ) ,
/* 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' )
} ;
const mergedLabels = { ... defaultLabels ,
... labels
} ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , _extends ( { } , navigateRegionsProps , {
ref : ( 0 , external _wp _compose _namespaceObject . useMergeRefs ) ( [ ref , navigateRegionsProps . ref ] ) ,
className : classnames _default ( ) ( className , 'interface-interface-skeleton' , navigateRegionsProps . className , ! ! footer && 'has-footer' )
} ) , ! ! drawer && ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "interface-interface-skeleton__drawer" ,
role : "region" ,
"aria-label" : mergedLabels . drawer ,
tabIndex : "-1"
} , drawer ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "interface-interface-skeleton__editor"
} , ! ! header && ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "interface-interface-skeleton__header" ,
role : "region" ,
"aria-label" : mergedLabels . header ,
tabIndex : "-1"
} , header ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "interface-interface-skeleton__body"
} , ! ! secondarySidebar && ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "interface-interface-skeleton__secondary-sidebar" ,
role : "region" ,
"aria-label" : mergedLabels . secondarySidebar ,
tabIndex : "-1"
} , secondarySidebar ) , ! ! notices && ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "interface-interface-skeleton__notices"
} , notices ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "interface-interface-skeleton__content" ,
role : "region" ,
"aria-label" : mergedLabels . body ,
tabIndex : "-1"
} , content ) , ! ! sidebar && ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "interface-interface-skeleton__sidebar" ,
role : "region" ,
"aria-label" : mergedLabels . sidebar ,
tabIndex : "-1"
} , sidebar ) , ! ! actions && ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "interface-interface-skeleton__actions" ,
role : "region" ,
"aria-label" : mergedLabels . actions ,
tabIndex : "-1"
} , actions ) ) ) , ! ! footer && ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "interface-interface-skeleton__footer" ,
role : "region" ,
"aria-label" : mergedLabels . footer ,
tabIndex : "-1"
} , footer ) ) ;
2021-01-28 03:04:13 +01:00
}
2022-04-11 14:04:30 +02:00
/* harmony default export */ var interface _skeleton = ( ( 0 , external _wp _element _namespaceObject . forwardRef ) ( InterfaceSkeleton ) ) ;
; // 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"
} ) ) ;
/* harmony default export */ var more _vertical = ( moreVertical ) ;
; // 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
* /
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
function MoreMenuDropdown ( _ref ) {
let {
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
} = _ref ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( DropdownComponent , {
className : classnames _default ( ) ( 'interface-more-menu-dropdown' , className ) ,
icon : more _vertical ,
label : label ,
popoverProps : {
position : 'bottom left' ,
... popoverProps ,
className : classnames _default ( ) ( 'interface-more-menu-dropdown__content' , popoverProps === null || popoverProps === void 0 ? void 0 : popoverProps . className )
} ,
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
2022-04-12 17:12:47 +02:00
function PreferencesModal ( _ref ) {
2022-04-11 14:04:30 +02:00
let {
2022-04-12 17:12:47 +02:00
closeModal ,
children
2022-04-11 14:04:30 +02:00
} = _ref ;
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' ) ,
closeLabel : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Close' ) ,
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
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
*
2022-04-12 17:12:47 +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
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
* /
2020-12-01 13:19:43 +01:00
2022-04-12 17:12:47 +02:00
function Icon ( _ref ) {
2022-04-11 14:04:30 +02:00
let {
2022-04-12 17:12:47 +02:00
icon ,
size = 24 ,
... props
} = _ref ;
return ( 0 , external _wp _element _namespaceObject . cloneElement ) ( icon , {
width : size ,
height : size ,
... props
2022-04-11 14:04:30 +02:00
} ) ;
}
2020-07-21 14:14:37 +02:00
2022-04-12 17:12:47 +02:00
/* harmony default export */ var icon = ( 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
2020-07-21 14:14:37 +02: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
} ) ) ;
2022-04-12 17:12:47 +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"
} ) ) ;
/* 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-11-08 15:29:21 +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' ;
function PreferencesModalTabs ( _ref ) {
let {
sections
} = _ref ;
const isLargeViewport = ( 0 , external _wp _compose _namespaceObject . useViewportMatch ) ( 'medium' ) ; // This is also used to sync the two different rendered components
// between small and large viewports.
2022-04-11 14:04:30 +02:00
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 .
* /
2022-04-11 14:04:30 +02:00
2022-04-12 17:12:47 +02:00
const {
tabs ,
sectionsContentMap
} = ( 0 , external _wp _element _namespaceObject . useMemo ) ( ( ) => {
let mappedTabs = {
tabs : [ ] ,
sectionsContentMap : { }
} ;
2022-04-11 14:04:30 +02:00
2022-04-12 17:12:47 +02:00
if ( sections . length ) {
mappedTabs = sections . reduce ( ( accumulator , _ref2 ) => {
let {
name ,
tabLabel : title ,
content
} = _ref2 ;
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 ] ) ;
let modalContent ; // We render different components based on the viewport size.
2021-05-07 13:48:27 +02:00
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
2022-04-12 17:12:47 +02:00
const Section = _ref => {
let {
description ,
title ,
children
} = _ref ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( "fieldset" , {
className : "interface-preferences-modal__section"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( "legend" , null , ( 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 ) ;
} ;
2021-01-28 03:04:13 +01:00
2022-04-12 17:12:47 +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
2022-04-12 17:12:47 +02:00
function BaseOption ( _ref ) {
let {
help ,
label ,
isChecked ,
onChange ,
children
} = _ref ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "interface-preferences-modal__option"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . ToggleControl , {
help : help ,
label : label ,
checked : isChecked ,
onChange : onChange
} ) , children ) ;
2021-05-20 14:20:04 +02:00
}
2022-04-11 14:04:30 +02:00
2022-04-12 17:12:47 +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
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
2022-04-12 17:12:47 +02:00
; // CONCATENATED MODULE: external ["wp","a11y"]
var external _wp _a11y _namespaceObject = window [ "wp" ] [ "a11y" ] ;
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: external ["wp","coreData"]
var external _wp _coreData _namespaceObject = window [ "wp" ] [ "coreData" ] ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/utils/meta-boxes.js
2021-11-08 15:29:21 +01:00
/ * *
2022-04-11 14:04:30 +02:00
* 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 .
2021-11-08 15:29:21 +01:00
*
2022-04-11 14:04:30 +02:00
* @ param { string } location Meta Box location .
2021-11-08 15:29:21 +01:00
*
2022-04-11 14:04:30 +02:00
* @ return { string } HTML content .
2021-11-08 15:29:21 +01:00
* /
2022-04-11 14:04:30 +02:00
const getMetaBoxContainer = location => {
const area = document . querySelector ( ` .edit-post-meta-boxes-area.is- ${ location } .metabox-location- ${ location } ` ) ;
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
if ( area ) {
return area ;
}
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
return document . querySelector ( '#metaboxes .metabox-location-' + location ) ;
} ;
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/store/actions.js
2021-05-20 14:20:04 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* External dependencies
2021-05-20 14:20:04 +02:00
* /
2021-05-19 17:09:27 +02:00
2021-05-20 14:20:04 +02:00
/ * *
* WordPress dependencies
* /
2021-05-19 17:09:27 +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
2021-05-20 14:20:04 +02:00
2021-05-19 17:09:27 +02:00
2021-01-28 03:04:13 +01:00
/ * *
2022-04-11 14:04:30 +02:00
* Returns an action object used in signalling that the user opened an editor sidebar .
*
* @ param { ? string } name Sidebar name to be opened .
2021-01-28 03:04:13 +01:00
* /
2021-05-19 17:09:27 +02:00
2022-04-12 17:12:47 +02:00
const openGeneralSidebar = name => _ref => {
let {
registry
} = _ref ;
return registry . dispatch ( store ) . enableComplementaryArea ( store _store . name , name ) ;
} ;
2021-01-28 03:04:13 +01:00
/ * *
2022-04-11 14:04:30 +02:00
* Returns an action object signalling that the user closed the sidebar .
2021-01-28 03:04:13 +01:00
* /
2020-01-22 23:06:21 +01:00
2022-04-12 17:12:47 +02:00
const closeGeneralSidebar = ( ) => _ref2 => {
let {
registry
} = _ref2 ;
return registry . dispatch ( store ) . disableComplementaryArea ( store _store . name ) ;
} ;
2020-01-22 23:06:21 +01:00
/ * *
2022-04-11 14:04:30 +02:00
* Returns an action object used in signalling that the user opened a modal .
*
* @ param { string } name A string that uniquely identifies the modal .
*
* @ return { Object } Action object .
2021-05-19 17:09:27 +02:00
* /
2018-12-14 05:41:57 +01:00
2022-04-11 14:04:30 +02:00
function openModal ( name ) {
return {
type : 'OPEN_MODAL' ,
name
} ;
}
/ * *
* Returns an action object signalling that the user closed a modal .
*
* @ return { Object } Action object .
* /
2020-06-26 15:33:47 +02:00
2022-04-11 14:04:30 +02:00
function closeModal ( ) {
return {
type : 'CLOSE_MODAL'
} ;
}
/ * *
* Returns an action object used in signalling that the user opened the publish
* sidebar .
*
* @ return { Object } Action object
* /
2020-06-26 15:33:47 +02:00
2022-04-11 14:04:30 +02:00
function openPublishSidebar ( ) {
return {
type : 'OPEN_PUBLISH_SIDEBAR'
} ;
}
/ * *
* Returns an action object used in signalling that the user closed the
* publish sidebar .
*
* @ return { Object } Action object .
* /
2020-06-26 15:33:47 +02:00
2022-04-11 14:04:30 +02:00
function closePublishSidebar ( ) {
return {
type : 'CLOSE_PUBLISH_SIDEBAR'
} ;
2021-05-19 17:09:27 +02:00
}
/ * *
2022-04-11 14:04:30 +02:00
* Returns an action object used in signalling that the user toggles the publish sidebar .
*
* @ return { Object } Action object
2021-05-19 17:09:27 +02:00
* /
2020-06-26 15:33:47 +02:00
2022-04-11 14:04:30 +02:00
function togglePublishSidebar ( ) {
return {
type : 'TOGGLE_PUBLISH_SIDEBAR'
} ;
}
2019-09-19 17:19:18 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* Returns an action object used to enable or disable a panel in the editor .
*
* @ param { string } panelName A string that identifies the panel to enable or disable .
*
* @ return { Object } Action object .
2019-09-19 17:19:18 +02:00
* /
2018-12-14 05:41:57 +01:00
2022-04-12 17:12:47 +02:00
const toggleEditorPanelEnabled = panelName => _ref3 => {
var _registry$select$get ;
let {
registry
} = _ref3 ;
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 : [ ] ;
const isPanelInactive = ! ! ( inactivePanels !== null && inactivePanels !== void 0 && inactivePanels . includes ( panelName ) ) ; // If the panel is inactive, remove it to enable it, else add it to
// make it inactive.
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 ) ;
} ;
2021-05-19 17:09:27 +02:00
/ * *
2022-04-12 17:12:47 +02:00
* Opens a closed panel and closes an open panel .
2022-04-11 14:04:30 +02:00
*
* @ param { string } panelName A string that identifies the panel to open or close .
2021-05-19 17:09:27 +02:00
* /
2019-10-15 17:37:08 +02:00
2022-04-12 17:12:47 +02:00
const toggleEditorPanelOpened = panelName => _ref4 => {
var _registry$select$get2 ;
let {
registry
} = _ref4 ;
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 : [ ] ;
const isPanelOpen = ! ! ( openPanels !== null && openPanels !== void 0 && openPanels . includes ( panelName ) ) ; // If the panel is open, remove it to close it, else add it to
// make it open.
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 ) ;
} ;
2019-10-15 17:37:08 +02:00
/ * *
2022-04-11 14:04:30 +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 .
2019-10-15 17:37:08 +02:00
* /
2018-12-14 05:41:57 +01:00
2022-04-11 14:04:30 +02:00
function removeEditorPanel ( panelName ) {
return {
type : 'REMOVE_PANEL' ,
panelName
} ;
}
2019-10-15 17:37:08 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* Triggers an action used to toggle a feature flag .
*
* @ param { string } feature Feature name .
2019-10-15 17:37:08 +02:00
* /
2018-12-18 04:14:52 +01:00
2022-04-12 17:12:47 +02:00
const actions _toggleFeature = feature => _ref5 => {
let {
registry
} = _ref5 ;
return registry . dispatch ( external _wp _preferences _namespaceObject . store ) . toggle ( 'core/edit-post' , feature ) ;
} ;
/ * *
* Triggers an action used to switch editor mode .
*
* @ param { string } mode The editor mode .
* /
const switchEditorMode = mode => _ref6 => {
let {
registry
} = _ref6 ;
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . set ( 'core/edit-post' , 'editorMode' , mode ) ; // Unselect blocks when we switch to the code editor.
2021-01-28 03:04:13 +01:00
2022-04-11 14:04:30 +02:00
if ( mode !== 'visual' ) {
2022-04-12 17:12:47 +02:00
registry . dispatch ( external _wp _blockEditor _namespaceObject . store ) . clearSelectedBlock ( ) ;
2022-04-11 14:04:30 +02:00
}
2021-01-28 03:04:13 +01:00
2022-04-11 14:04:30 +02:00
const message = mode === 'visual' ? ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Visual editor selected' ) : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Code editor selected' ) ;
2022-04-12 17:12:47 +02:00
( 0 , external _wp _a11y _namespaceObject . speak ) ( message , 'assertive' ) ;
} ;
2022-04-11 14:04:30 +02:00
/ * *
2022-04-12 17:12:47 +02:00
* Triggers an action object used to toggle a plugin name flag .
2022-04-11 14:04:30 +02:00
*
2022-04-12 17:12:47 +02:00
* @ param { string } pluginName Plugin name .
2022-04-11 14:04:30 +02:00
* /
2018-12-14 05:41:57 +01:00
2022-04-12 17:12:47 +02:00
const togglePinnedPluginItem = pluginName => _ref7 => {
let {
registry
} = _ref7 ;
const isPinned = registry . select ( store ) . isItemPinned ( 'core/edit-post' , pluginName ) ;
registry . dispatch ( store ) [ isPinned ? 'unpinItem' : 'pinItem' ] ( 'core/edit-post' , pluginName ) ;
} ;
2020-06-26 15:33:47 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* Returns an action object used in signaling that a style should be auto - applied when a block is created .
*
* @ 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 .
2020-06-26 15:33:47 +02:00
* /
2022-04-12 17:12:47 +02:00
const updatePreferredStyleVariations = ( blockName , blockStyle ) => _ref8 => {
var _registry$select$get3 ;
let {
registry
} = _ref8 ;
if ( ! blockName ) {
return ;
}
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 : { } ; // When the blockStyle is omitted, remove the block's preferred variation.
if ( ! blockStyle ) {
const updatedVariations = { ... existingVariations
} ;
delete updatedVariations [ blockName ] ;
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . set ( 'core/edit-post' , 'preferredStyleVariations' , updatedVariations ) ;
} else {
// Else add the variation.
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . set ( 'core/edit-post' , 'preferredStyleVariations' , { ... existingVariations ,
[ blockName ] : blockStyle
} ) ;
}
} ;
2018-12-18 04:14:52 +01:00
/ * *
2022-04-12 17:12:47 +02:00
* Update the provided block types to be visible .
2022-04-11 14:04:30 +02:00
*
2022-04-12 17:12:47 +02:00
* @ param { string [ ] } blockNames Names of block types to show .
2018-12-18 04:14:52 +01:00
* /
2018-12-14 05:41:57 +01:00
2022-04-12 17:12:47 +02:00
const showBlockTypes = blockNames => _ref9 => {
var _registry$select$get4 ;
let {
registry
} = _ref9 ;
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 = ( 0 , external _lodash _namespaceObject . without ) ( existingBlockNames , ... ( 0 , external _lodash _namespaceObject . castArray ) ( blockNames ) ) ;
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . set ( 'core/edit-post' , 'hiddenBlockTypes' , newBlockNames ) ;
} ;
2022-04-11 14:04:30 +02:00
/ * *
2022-04-12 17:12:47 +02:00
* Update the provided block types to be hidden .
2022-04-11 14:04:30 +02:00
*
2022-04-12 17:12:47 +02:00
* @ param { string [ ] } blockNames Names of block types to hide .
2022-04-11 14:04:30 +02:00
* /
2021-01-28 03:04:13 +01:00
2022-04-12 17:12:47 +02:00
const hideBlockTypes = blockNames => _ref10 => {
var _registry$select$get5 ;
let {
registry
} = _ref10 ;
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 , ... ( 0 , external _lodash _namespaceObject . castArray ) ( blockNames ) ] ) ;
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . set ( 'core/edit-post' , 'hiddenBlockTypes' , [ ... mergedBlockNames ] ) ;
} ;
2022-04-11 14:04:30 +02:00
/ * *
* Returns an action object used in signaling
* what Meta boxes are available in which location .
*
* @ param { Object } metaBoxesPerLocation Meta boxes per location .
* /
2021-01-28 03:04:13 +01:00
2022-04-12 17:12:47 +02:00
const setAvailableMetaBoxesPerLocation = metaBoxesPerLocation => _ref11 => {
let {
dispatch
} = _ref11 ;
return dispatch ( {
2022-04-11 14:04:30 +02:00
type : 'SET_META_BOXES_PER_LOCATIONS' ,
metaBoxesPerLocation
2022-04-12 17:12:47 +02:00
} ) ;
} ;
2018-12-14 05:41:57 +01:00
/ * *
2022-04-12 17:12:47 +02:00
* Update a metabox .
2018-12-14 05:41:57 +01:00
* /
2022-04-12 17:12:47 +02:00
const requestMetaBoxUpdates = ( ) => async _ref12 => {
let {
registry ,
select ,
dispatch
} = _ref12 ;
dispatch ( {
2022-04-11 14:04:30 +02:00
type : 'REQUEST_META_BOX_UPDATES'
2022-04-12 17:12:47 +02:00
} ) ; // Saves the wp_editor fields.
2021-01-28 03:04:13 +01:00
2022-04-11 14:04:30 +02:00
if ( window . tinyMCE ) {
window . tinyMCE . triggerSave ( ) ;
} // Additional data needed for backward compatibility.
// If we do not provide this data, the post will be overridden with the default values.
2021-01-28 03:04:13 +01:00
2018-12-17 05:52:00 +01:00
2022-04-12 17:12:47 +02:00
const post = registry . select ( external _wp _editor _namespaceObject . store ) . getCurrentPost ( ) ;
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 ) ; // We gather all the metaboxes locations data and the base form data.
2021-01-28 03:04:13 +01:00
2022-04-11 14:04:30 +02:00
const baseFormData = new window . FormData ( document . querySelector ( '.metabox-base-form' ) ) ;
2022-04-12 17:12:47 +02:00
const activeMetaBoxLocations = select . getActiveMetaBoxLocations ( ) ;
2022-04-11 14:04:30 +02:00
const formDataToMerge = [ baseFormData , ... activeMetaBoxLocations . map ( location => new window . FormData ( getMetaBoxContainer ( location ) ) ) ] ; // Merge all form data objects into a single one.
2021-01-28 03:04:13 +01:00
2022-04-11 14:04:30 +02:00
const formData = ( 0 , external _lodash _namespaceObject . reduce ) ( formDataToMerge , ( memo , currentFormData ) => {
for ( const [ key , value ] of currentFormData ) {
memo . append ( key , value ) ;
}
2021-01-28 03:04:13 +01:00
2022-04-11 14:04:30 +02:00
return memo ;
} , new window . FormData ( ) ) ;
2022-04-12 17:12:47 +02:00
additionalData . forEach ( _ref13 => {
let [ key , value ] = _ref13 ;
2022-04-11 14:04:30 +02:00
return formData . append ( key , value ) ;
} ) ;
2021-01-28 03:04:13 +01:00
2022-04-11 14:04:30 +02:00
try {
2022-04-12 17:12:47 +02:00
// Save the metaboxes.
await external _wp _apiFetch _default ( ) ( {
2022-04-11 14:04:30 +02:00
url : window . _wpMetaBoxUrl ,
method : 'POST' ,
body : formData ,
parse : false
} ) ;
2022-04-12 17:12:47 +02:00
dispatch . metaBoxUpdatesSuccess ( ) ;
2022-04-11 14:04:30 +02:00
} catch {
2022-04-12 17:12:47 +02:00
dispatch . metaBoxUpdatesFailure ( ) ;
2022-04-11 14:04:30 +02:00
}
2022-04-12 17:12:47 +02:00
} ;
2019-09-19 17:19:18 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* Returns an action object used to signal a successful meta box update .
*
* @ return { Object } Action object .
2019-09-19 17:19:18 +02:00
* /
2022-04-11 14:04:30 +02:00
function metaBoxUpdatesSuccess ( ) {
return {
type : 'META_BOX_UPDATES_SUCCESS'
} ;
}
2019-09-19 17:19:18 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* Returns an action object used to signal a failed meta box update .
*
* @ return { Object } Action object .
2019-09-19 17:19:18 +02:00
* /
2022-04-11 14:04:30 +02:00
function metaBoxUpdatesFailure ( ) {
return {
type : 'META_BOX_UPDATES_FAILURE'
} ;
2021-05-19 17:09:27 +02:00
}
2022-04-11 14:04:30 +02:00
/ * *
* Returns an action object used to toggle the width of the editing canvas .
*
* @ param { string } deviceType
*
* @ return { Object } Action object .
* /
2021-01-28 03:04:13 +01:00
2022-04-11 14:04:30 +02:00
function _ _experimentalSetPreviewDeviceType ( deviceType ) {
return {
type : 'SET_PREVIEW_DEVICE_TYPE' ,
deviceType
} ;
2021-05-19 17:09:27 +02:00
}
2022-04-11 14:04:30 +02:00
/ * *
* Returns an action object used to open / close the inserter .
*
* @ 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 .
*
* @ return { Object } Action object .
* /
2021-01-28 03:04:13 +01:00
2022-04-11 14:04:30 +02:00
function setIsInserterOpened ( value ) {
return {
type : 'SET_IS_INSERTER_OPENED' ,
value
} ;
}
/ * *
* Returns an action object used to open / close the list view .
*
* @ param { boolean } isOpen A boolean representing whether the list view should be opened or closed .
* @ return { Object } Action object .
* /
2021-01-28 03:04:13 +01:00
2022-04-11 14:04:30 +02:00
function setIsListViewOpened ( isOpen ) {
return {
type : 'SET_IS_LIST_VIEW_OPENED' ,
isOpen
} ;
}
/ * *
* Returns an action object used to switch to template editing .
*
* @ param { boolean } value Is editing template .
* @ return { Object } Action object .
* /
2021-01-28 03:04:13 +01:00
2022-04-11 14:04:30 +02:00
function setIsEditingTemplate ( value ) {
return {
type : 'SET_IS_EDITING_TEMPLATE' ,
value
} ;
}
/ * *
* Switches to the template mode .
*
* @ param { boolean } newTemplate Is new template .
* /
2019-09-19 17:19:18 +02:00
2022-04-12 17:12:47 +02:00
const _ _unstableSwitchToTemplateMode = function ( ) {
2022-04-11 14:04:30 +02:00
let newTemplate = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : false ;
2022-04-12 17:12:47 +02:00
return _ref14 => {
let {
registry ,
select ,
dispatch
} = _ref14 ;
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'
} ) ;
}
} ;
} ;
2019-10-15 17:37:08 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* Create a block based template .
*
* @ param { Object ? } template Template to create and assign .
2019-10-15 17:37:08 +02:00
* /
2019-09-19 17:19:18 +02:00
2022-04-12 17:12:47 +02:00
const _ _unstableCreateTemplate = template => async _ref15 => {
let {
registry
} = _ref15 ;
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 , {
2022-04-11 14:04:30 +02:00
template : savedTemplate . slug
} ) ;
2022-04-12 17:12:47 +02:00
} ;
2022-04-11 14:04:30 +02:00
let actions _metaBoxesInitialized = false ;
2019-10-15 17:37:08 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* Initializes WordPress ` postboxes ` script and the logic for saving meta boxes .
2019-10-15 17:37:08 +02:00
* /
2019-09-19 17:19:18 +02:00
2022-04-12 17:12:47 +02:00
const initializeMetaBoxes = ( ) => _ref16 => {
let {
registry ,
select ,
dispatch
} = _ref16 ;
const isEditorReady = registry . select ( external _wp _editor _namespaceObject . store ) . _ _unstableIsEditorReady ( ) ;
2022-04-11 14:04:30 +02:00
if ( ! isEditorReady ) {
return ;
2022-04-12 17:12:47 +02:00
} // Only initialize once.
2021-01-28 03:04:13 +01:00
2019-09-19 17:19:18 +02:00
2022-04-11 14:04:30 +02:00
if ( actions _metaBoxesInitialized ) {
return ;
}
2021-01-28 03:04:13 +01:00
2022-04-12 17:12:47 +02:00
const postType = registry . select ( external _wp _editor _namespaceObject . store ) . getCurrentPostType ( ) ;
2022-04-11 14:04:30 +02:00
if ( window . postboxes . page !== postType ) {
window . postboxes . add _postbox _toggles ( postType ) ;
}
2021-01-28 03:04:13 +01:00
2022-04-11 14:04:30 +02:00
actions _metaBoxesInitialized = true ;
2022-04-12 17:12:47 +02:00
let wasSavingPost = registry . select ( external _wp _editor _namespaceObject . store ) . isSavingPost ( ) ;
let wasAutosavingPost = registry . select ( external _wp _editor _namespaceObject . store ) . isAutosavingPost ( ) ;
const hasMetaBoxes = select . hasMetaBoxes ( ) ; // Save metaboxes when performing a full save on the post.
2021-01-28 03:04:13 +01:00
2022-04-12 17:12:47 +02:00
registry . subscribe ( async ( ) => {
const isSavingPost = registry . select ( external _wp _editor _namespaceObject . store ) . isSavingPost ( ) ;
const isAutosavingPost = registry . select ( external _wp _editor _namespaceObject . store ) . isAutosavingPost ( ) ; // Save metaboxes on save completion, except for autosaves that are not a post preview.
2022-04-11 14:04:30 +02:00
//
// Meta boxes are initialized once at page load. It is not necessary to
// account for updates on each state change.
//
2022-04-12 17:12:47 +02:00
// See: https://github.com/WordPress/WordPress/blob/5.1.1/wp-admin/includes/post.php#L2307-L2309.
2021-01-28 03:04:13 +01:00
2022-04-11 14:04:30 +02:00
const shouldTriggerMetaboxesSave = hasMetaBoxes && wasSavingPost && ! isSavingPost && ! wasAutosavingPost ; // Save current state for next inspection.
2020-06-26 15:33:47 +02:00
2022-04-11 14:04:30 +02:00
wasSavingPost = isSavingPost ;
wasAutosavingPost = isAutosavingPost ;
2021-01-28 03:04:13 +01:00
2022-04-11 14:04:30 +02:00
if ( shouldTriggerMetaboxesSave ) {
2022-04-12 17:12:47 +02:00
await dispatch . requestMetaBoxUpdates ( ) ;
2022-04-11 14:04:30 +02:00
}
} ) ;
2022-04-12 17:12:47 +02:00
dispatch ( {
2022-04-11 14:04:30 +02:00
type : 'META_BOXES_INITIALIZED'
2022-04-12 17:12:47 +02:00
} ) ;
} ;
2021-01-28 03:04:13 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/rememo/es/rememo.js
2021-01-28 03:04:13 +01:00
2022-04-11 14:04:30 +02:00
var LEAF _KEY , hasWeakMap ;
2021-01-28 03:04:13 +01:00
2022-04-11 14:04:30 +02:00
/ * *
* Arbitrary value used as key for referencing cache object in WeakMap tree .
*
* @ type { Object }
* /
LEAF _KEY = { } ;
2021-01-28 03:04:13 +01:00
2022-04-11 14:04:30 +02:00
/ * *
* Whether environment supports WeakMap .
*
* @ type { boolean }
* /
hasWeakMap = typeof WeakMap !== 'undefined' ;
2021-01-28 03:04:13 +01:00
2022-04-11 14:04:30 +02:00
/ * *
* Returns the first argument as the sole entry in an array .
*
* @ param { * } value Value to return .
*
* @ return { Array } Value returned as entry in array .
* /
function arrayOf ( value ) {
return [ value ] ;
2021-05-19 17:09:27 +02:00
}
2021-01-28 03:04:13 +01:00
2022-04-11 14:04:30 +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 .
*
* @ param { * } value Value to test .
*
* @ return { boolean } Whether value is object - like .
* /
function isObjectLike ( value ) {
return ! ! value && 'object' === typeof value ;
2021-05-19 17:09:27 +02:00
}
2021-01-28 03:04:13 +01:00
2022-04-11 14:04:30 +02:00
/ * *
* Creates and returns a new cache object .
*
* @ return { Object } Cache object .
* /
function createCache ( ) {
var cache = {
clear : function ( ) {
cache . head = null ;
} ,
} ;
2021-01-28 03:04:13 +01:00
2022-04-11 14:04:30 +02:00
return cache ;
2021-05-19 17:09:27 +02:00
}
/ * *
2022-04-11 14:04:30 +02:00
* Returns true if entries within the two arrays are strictly equal by
* reference from a starting index .
*
* @ param { Array } a First array .
* @ param { Array } b Second array .
* @ param { number } fromIndex Index from which to start comparison .
*
* @ return { boolean } Whether arrays are shallowly equal .
2021-05-19 17:09:27 +02:00
* /
2022-04-11 14:04:30 +02:00
function isShallowEqual ( a , b , fromIndex ) {
var i ;
2021-05-19 17:09:27 +02:00
2022-04-11 14:04:30 +02:00
if ( a . length !== b . length ) {
return false ;
}
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
for ( i = fromIndex ; i < a . length ; i ++ ) {
if ( a [ i ] !== b [ i ] ) {
return false ;
}
}
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
return true ;
}
2019-09-19 17:19:18 +02:00
2021-05-19 17:09:27 +02:00
/ * *
2022-04-11 14:04:30 +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 .
*
* @ param { Function } selector Selector function .
* @ param { Function } getDependants Dependant getter returning an immutable
* reference or array of reference used in
* cache bust consideration .
*
* @ return { Function } Memoized selector .
2021-05-19 17:09:27 +02:00
* /
2022-04-11 14:04:30 +02:00
/* harmony default export */ function rememo ( selector , getDependants ) {
var rootCache , getCache ;
2019-09-19 17:19:18 +02:00
2022-04-11 14:04:30 +02:00
// Use object source as dependant if getter not provided
if ( ! getDependants ) {
getDependants = arrayOf ;
}
2021-07-15 20:55:29 +02:00
2022-04-11 14:04:30 +02:00
/ * *
* Returns the root cache . If WeakMap is supported , this is assigned to the
* root WeakMap cache set , otherwise it is a shared instance of the default
* cache object .
*
* @ return { ( WeakMap | Object ) } Root cache object .
* /
function getRootCache ( ) {
return rootCache ;
}
2019-09-19 17:19:18 +02:00
2022-04-11 14:04:30 +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 { Array } dependants Selector dependants .
*
* @ return { Object } Cache object .
* /
function getWeakMapCache ( dependants ) {
var caches = rootCache ,
isUniqueByDependants = true ,
i , dependant , map , cache ;
2021-05-19 17:09:27 +02:00
2022-04-11 14:04:30 +02:00
for ( i = 0 ; i < dependants . length ; i ++ ) {
dependant = dependants [ i ] ;
2021-05-19 17:09:27 +02:00
2022-04-11 14:04:30 +02:00
// Can only compose WeakMap from object-like key.
if ( ! isObjectLike ( dependant ) ) {
isUniqueByDependants = false ;
break ;
}
2021-05-19 17:09:27 +02:00
2022-04-11 14:04:30 +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-19 17:09:27 +02:00
2022-04-11 14:04:30 +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-19 17:09:27 +02:00
2022-04-11 14:04:30 +02:00
return caches . get ( LEAF _KEY ) ;
}
2021-05-19 17:09:27 +02:00
2022-04-11 14:04:30 +02:00
// Assign cache handler by availability of WeakMap
getCache = hasWeakMap ? getWeakMapCache : getRootCache ;
2019-09-19 17:19:18 +02:00
2022-04-11 14:04:30 +02:00
/ * *
* Resets root memoization cache .
* /
function clear ( ) {
rootCache = hasWeakMap ? new WeakMap ( ) : createCache ( ) ;
}
2021-05-19 17:09:27 +02:00
2022-04-11 14:04:30 +02:00
// eslint-disable-next-line jsdoc/check-param-names
/ * *
* The augmented selector call , considering first whether dependants have
* changed before passing it to underlying memoize function .
*
* @ param { Object } source Source object for derivation .
* @ param { ... * } extraArgs Additional arguments to pass to selector .
*
* @ return { * } Selector result .
* /
function callSelector ( /* source, ...extraArgs */ ) {
var len = arguments . length ,
cache , node , i , args , dependants ;
2021-05-19 17:09:27 +02:00
2022-04-11 14:04:30 +02:00
// Create copy of arguments (avoid leaking deoptimization).
args = new Array ( len ) ;
for ( i = 0 ; i < len ; i ++ ) {
args [ i ] = arguments [ i ] ;
}
2021-05-19 17:09:27 +02:00
2022-04-11 14:04:30 +02:00
dependants = getDependants . apply ( null , args ) ;
cache = getCache ( dependants ) ;
2021-05-19 17:09:27 +02:00
2022-04-11 14:04:30 +02:00
// If not guaranteed uniqueness by dependants (primitive type or lack
// of WeakMap support), 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-19 17:09:27 +02:00
2022-04-11 14:04:30 +02:00
cache . lastDependants = dependants ;
}
2021-05-19 17:09:27 +02:00
2022-04-11 14:04:30 +02:00
node = cache . head ;
while ( node ) {
// Check whether node arguments match arguments
if ( ! isShallowEqual ( node . args , args , 1 ) ) {
node = node . next ;
continue ;
}
2019-09-19 17:19:18 +02:00
2022-04-11 14:04:30 +02:00
// At this point we can assume we've found a match
2021-05-07 13:48:27 +02:00
2022-04-11 14:04:30 +02:00
// Surface matched node to head if not already
if ( node !== cache . head ) {
// Adjust siblings to point to each other.
node . prev . next = node . next ;
if ( node . next ) {
node . next . prev = node . prev ;
}
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
node . next = cache . head ;
node . prev = null ;
cache . head . prev = node ;
cache . head = node ;
}
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
// Return immediately
return node . val ;
}
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
// No cached value found. Continue to insertion phase:
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
node = {
// Generate the result from original function
val : selector . apply ( null , args ) ,
} ;
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
// Avoid including the source object in the cache.
args [ 0 ] = null ;
node . args = args ;
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
// Don't need to check whether node is already head, since it would
// have been returned above already if it was
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
// Shift existing head down list
if ( cache . head ) {
cache . head . prev = node ;
node . next = cache . head ;
}
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
cache . head = node ;
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
return node . val ;
}
callSelector . getDependants = getDependants ;
callSelector . clear = clear ;
clear ( ) ;
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
return callSelector ;
}
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/store/selectors.js
/ * *
* External dependencies
* /
2021-11-08 15:29:21 +01:00
/ * *
* WordPress dependencies
* /
2022-04-12 17:12:47 +02:00
const EMPTY _ARRAY = [ ] ;
const EMPTY _OBJECT = { } ;
2021-11-08 15:29:21 +01:00
/ * *
2022-04-11 14:04:30 +02:00
* Returns the current editing mode .
*
* @ param { Object } state Global application state .
*
* @ return { string } Editing mode .
2021-11-08 15:29:21 +01:00
* /
2022-04-12 17:12:47 +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' ;
} ) ;
2021-05-20 14:20:04 +02:00
/ * *
2022-04-11 14:04:30 +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-20 14:20:04 +02:00
* /
2022-04-11 14:04:30 +02:00
const isEditorSidebarOpened = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( select => ( ) => {
const activeGeneralSidebar = select ( store ) . getActiveComplementaryArea ( 'core/edit-post' ) ;
return ( 0 , external _lodash _namespaceObject . includes ) ( [ 'edit-post/document' , 'edit-post/block' ] , activeGeneralSidebar ) ;
} ) ;
2021-05-20 14:20:04 +02:00
/ * *
2022-04-11 14:04:30 +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-20 14:20:04 +02:00
* /
2022-04-11 14:04:30 +02:00
const isPluginSidebarOpened = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( select => ( ) => {
const activeGeneralSidebar = select ( store ) . getActiveComplementaryArea ( 'core/edit-post' ) ;
return ! ! activeGeneralSidebar && ! ( 0 , external _lodash _namespaceObject . includes ) ( [ 'edit-post/document' , 'edit-post/block' ] , activeGeneralSidebar ) ;
} ) ;
2021-05-20 14:20:04 +02:00
/ * *
2022-04-11 14:04:30 +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-20 14:20:04 +02:00
* /
2022-04-11 14:04:30 +02:00
const getActiveGeneralSidebarName = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( select => ( ) => {
return select ( store ) . getActiveComplementaryArea ( 'core/edit-post' ) ;
} ) ;
2022-04-12 17:12:47 +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 .
* /
function convertPanelsToOldFormat ( inactivePanels , openPanels ) {
var _ref ;
// First reduce the inactive panels.
const panelsWithEnabledState = inactivePanels === null || inactivePanels === void 0 ? void 0 : inactivePanels . reduce ( ( accumulatedPanels , panelName ) => ( { ... accumulatedPanels ,
[ panelName ] : {
enabled : false
}
} ) , { } ) ; // Then reduce the open panels, passing in the result of the previous
// reduction as the initial value so that both open and inactive
// panel state is combined.
const panels = openPanels === null || openPanels === void 0 ? void 0 : openPanels . reduce ( ( accumulatedPanels , panelName ) => {
const currentPanelState = accumulatedPanels === null || accumulatedPanels === void 0 ? void 0 : accumulatedPanels [ panelName ] ;
return { ... accumulatedPanels ,
[ panelName ] : { ... currentPanelState ,
opened : true
}
} ;
} , panelsWithEnabledState !== null && panelsWithEnabledState !== void 0 ? panelsWithEnabledState : { } ) ; // The panels variable will only be set if openPanels wasn't `undefined`.
// 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 ;
}
2019-09-19 17:19:18 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* Returns the preferences ( these preferences are persisted locally ) .
*
* @ param { Object } state Global application state .
*
* @ return { Object } Preferences Object .
2019-09-19 17:19:18 +02:00
* /
2021-05-07 13:48:27 +02:00
2022-04-12 17:12:47 +02:00
const getPreferences = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( select => ( ) => {
external _wp _deprecated _default ( ) ( ` wp.data.select( 'core/edit-post' ).getPreferences ` , {
since : '6.0' ,
alternative : ` wp.data.select( 'core/preferences' ).get `
} ) ; // These preferences now exist in the preferences store.
// 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 ) ;
return { ... accumulatedPrefs ,
[ preferenceKey ] : value
} ;
} , { } ) ; // Panels were a preference, but the data structure changed when the state
// 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 ) ;
return { ... preferences ,
panels
} ;
} ) ;
2021-05-19 17:09:27 +02:00
/ * *
2022-04-11 14:04:30 +02:00
*
* @ param { Object } state Global application state .
* @ param { string } preferenceKey Preference Key .
* @ param { * } defaultValue Default Value .
*
* @ return { * } Preference Value .
2021-05-19 17:09:27 +02:00
* /
2019-09-19 17:19:18 +02:00
2022-04-11 14:04:30 +02:00
function getPreference ( state , preferenceKey , defaultValue ) {
2022-04-12 17:12:47 +02:00
external _wp _deprecated _default ( ) ( ` wp.data.select( 'core/edit-post' ).getPreference ` , {
since : '6.0' ,
alternative : ` wp.data.select( 'core/preferences' ).get `
} ) ; // Avoid using the `getPreferences` registry selector where possible.
2022-04-11 14:04:30 +02:00
const preferences = getPreferences ( state ) ;
const value = preferences [ preferenceKey ] ;
return value === undefined ? defaultValue : value ;
}
2022-04-12 17:12:47 +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 ;
} ) ;
2019-09-19 17:19:18 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* Returns true if the publish sidebar is opened .
*
* @ param { Object } state Global application state
*
* @ return { boolean } Whether the publish sidebar is open .
2019-09-19 17:19:18 +02:00
* /
2022-04-11 14:04:30 +02:00
function isPublishSidebarOpened ( state ) {
return state . publishSidebarActive ;
2021-05-19 17:09:27 +02:00
}
2021-05-07 13:48:27 +02:00
/ * *
2022-04-11 14:04:30 +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
* /
2019-09-19 17:19:18 +02:00
2022-04-11 14:04:30 +02:00
function isEditorPanelRemoved ( state , panelName ) {
return ( 0 , external _lodash _namespaceObject . includes ) ( state . removedPanels , panelName ) ;
}
2021-05-19 17:09:27 +02:00
/ * *
2022-04-11 14:04:30 +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 .
2021-05-19 17:09:27 +02:00
* /
2022-04-12 17:12:47 +02:00
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 !== null && inactivePanels !== void 0 && inactivePanels . includes ( panelName ) ) ;
} ) ;
2021-01-28 03:04:13 +01:00
/ * *
2022-04-11 14:04:30 +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
* /
2021-05-19 17:09:27 +02:00
2022-04-12 17:12:47 +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 !== null && openPanels !== void 0 && openPanels . includes ( panelName ) ) ;
} ) ;
2021-05-07 13:48:27 +02:00
/ * *
2022-04-11 14:04:30 +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 .
2021-01-28 03:04:13 +01:00
* /
2019-09-19 17:19:18 +02:00
2022-04-11 14:04:30 +02:00
function isModalActive ( state , modalName ) {
return state . activeModal === modalName ;
}
2021-01-28 03:04:13 +01:00
/ * *
2022-04-11 14:04:30 +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 .
2021-01-28 03:04:13 +01:00
* /
2019-09-19 17:19:18 +02:00
2022-04-11 14:04:30 +02:00
const selectors _isFeatureActive = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( select => ( state , feature ) => {
2022-04-12 17:12:47 +02:00
return ! ! select ( external _wp _preferences _namespaceObject . store ) . get ( 'core/edit-post' , feature ) ;
2022-04-11 14:04:30 +02:00
} ) ;
2021-05-19 17:09:27 +02:00
/ * *
2022-04-11 14:04:30 +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 .
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 isPluginItemPinned = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( select => ( state , pluginName ) => {
return select ( store ) . isItemPinned ( 'core/edit-post' , pluginName ) ;
} ) ;
2021-05-19 17:09:27 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* Returns an array of active meta box locations .
*
* @ param { Object } state Post editor state .
*
* @ return { string [ ] } Active meta box locations .
2021-05-19 17:09:27 +02:00
* /
2021-04-15 17:19:43 +02:00
2022-04-11 14:04:30 +02:00
const getActiveMetaBoxLocations = rememo ( state => {
return Object . keys ( state . metaBoxes . locations ) . filter ( location => isMetaBoxLocationActive ( state , location ) ) ;
} , state => [ state . metaBoxes . locations ] ) ;
2021-05-19 17:09:27 +02:00
/ * *
2022-04-11 14:04:30 +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 .
* /
2021-05-07 13:48:27 +02:00
2022-04-11 14:04:30 +02:00
function isMetaBoxLocationVisible ( state , location ) {
2022-04-12 17:12:47 +02:00
return isMetaBoxLocationActive ( state , location ) && ( 0 , external _lodash _namespaceObject . some ) ( getMetaBoxesPerLocation ( state , location ) , _ref2 => {
2022-04-11 14:04:30 +02:00
let {
id
2022-04-12 17:12:47 +02:00
} = _ref2 ;
2022-04-11 14:04:30 +02:00
return isEditorPanelEnabled ( state , ` meta-box- ${ id } ` ) ;
} ) ;
}
/ * *
* Returns true if there is an active meta box in the given location , or false
* otherwise .
*
* @ param { Object } state Post editor state .
* @ param { string } location Meta box location to test .
*
* @ return { boolean } Whether the meta box location is active .
* /
2021-05-07 13:48:27 +02:00
2022-04-11 14:04:30 +02:00
function isMetaBoxLocationActive ( state , location ) {
const metaBoxes = getMetaBoxesPerLocation ( state , location ) ;
return ! ! metaBoxes && metaBoxes . length !== 0 ;
}
/ * *
* 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 .
* /
2021-05-07 13:48:27 +02:00
2022-04-11 14:04:30 +02:00
function getMetaBoxesPerLocation ( state , location ) {
return state . metaBoxes . locations [ location ] ;
}
/ * *
* Returns the list of all the available meta boxes .
*
* @ param { Object } state Global application state .
*
* @ return { Array } List of meta boxes .
* /
2021-05-07 13:48:27 +02:00
2022-04-11 14:04:30 +02:00
const getAllMetaBoxes = rememo ( state => {
return ( 0 , external _lodash _namespaceObject . flatten ) ( ( 0 , external _lodash _namespaceObject . values ) ( state . metaBoxes . locations ) ) ;
} , state => [ state . metaBoxes . locations ] ) ;
/ * *
* Returns true if the post is using Meta Boxes
*
* @ param { Object } state Global application state
*
* @ return { boolean } Whether there are metaboxes or not .
* /
2021-05-07 13:48:27 +02:00
2022-04-11 14:04:30 +02:00
function hasMetaBoxes ( state ) {
return getActiveMetaBoxLocations ( state ) . length > 0 ;
}
/ * *
* Returns true if the Meta Boxes are being saved .
*
* @ param { Object } state Global application state .
*
* @ return { boolean } Whether the metaboxes are being saved .
* /
2021-05-07 13:48:27 +02:00
2022-04-11 14:04:30 +02:00
function selectors _isSavingMetaBoxes ( state ) {
return state . metaBoxes . isSaving ;
}
/ * *
* Returns the current editing canvas device type .
*
* @ param { Object } state Global application state .
*
* @ return { string } Device type .
* /
2021-05-07 13:48:27 +02:00
2022-04-11 14:04:30 +02:00
function _ _experimentalGetPreviewDeviceType ( state ) {
return state . deviceType ;
}
/ * *
* Returns true if the inserter is opened .
*
* @ param { Object } state Global application state .
*
* @ return { boolean } Whether the inserter is opened .
* /
2021-05-07 13:48:27 +02:00
2022-04-11 14:04:30 +02:00
function isInserterOpened ( state ) {
return ! ! state . blockInserterPanel ;
}
/ * *
* 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 .
* /
2021-05-07 13:48:27 +02:00
2022-04-11 14:04:30 +02:00
function _ _experimentalGetInsertionPoint ( state ) {
const {
rootClientId ,
insertionIndex ,
filterValue
} = state . blockInserterPanel ;
return {
rootClientId ,
insertionIndex ,
filterValue
} ;
}
/ * *
* Returns true if the list view is opened .
*
* @ param { Object } state Global application state .
*
* @ return { boolean } Whether the list view is opened .
* /
2021-05-20 14:20:04 +02:00
2022-04-11 14:04:30 +02:00
function isListViewOpened ( state ) {
return state . listViewPanel ;
}
/ * *
* Returns true if the template editing mode is enabled .
*
* @ param { Object } state Global application state .
*
* @ return { boolean } Whether we ' re editing the template .
* /
2021-05-20 14:20:04 +02:00
2022-04-11 14:04:30 +02:00
function selectors _isEditingTemplate ( state ) {
return state . isEditingTemplate ;
}
/ * *
* Returns true if meta boxes are initialized .
*
* @ param { Object } state Global application state .
*
* @ return { boolean } Whether meta boxes are initialized .
* /
2021-05-20 14:20:04 +02:00
2022-04-11 14:04:30 +02:00
function areMetaBoxesInitialized ( state ) {
return state . metaBoxes . initialized ;
}
/ * *
* Retrieves the template of the currently edited post .
*
* @ return { Object ? } Post Template .
* /
2021-05-20 14:20:04 +02:00
2022-04-11 14:04:30 +02:00
const getEditedPostTemplate = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( select => ( ) => {
const currentTemplate = select ( external _wp _editor _namespaceObject . store ) . getEditedPostAttribute ( 'template' ) ;
2021-05-20 14:20:04 +02:00
2022-04-11 14:04:30 +02:00
if ( currentTemplate ) {
var _select$getEntityReco ;
2021-05-20 14:20:04 +02:00
2022-04-11 14:04:30 +02:00
const templateWithSameSlug = ( _select$getEntityReco = select ( external _wp _coreData _namespaceObject . store ) . getEntityRecords ( 'postType' , 'wp_template' , {
per _page : - 1
} ) ) === null || _select$getEntityReco === void 0 ? void 0 : _select$getEntityReco . find ( template => template . slug === currentTemplate ) ;
2021-05-20 14:20:04 +02:00
2022-04-11 14:04:30 +02:00
if ( ! templateWithSameSlug ) {
return templateWithSameSlug ;
}
2021-05-20 14:20:04 +02:00
2022-04-11 14:04:30 +02:00
return select ( external _wp _coreData _namespaceObject . store ) . getEditedEntityRecord ( 'postType' , 'wp_template' , templateWithSameSlug . id ) ;
}
2021-05-20 14:20:04 +02:00
2022-04-11 14:04:30 +02:00
const post = select ( external _wp _editor _namespaceObject . store ) . getCurrentPost ( ) ;
2021-05-20 14:20:04 +02:00
2022-04-11 14:04:30 +02:00
if ( post . link ) {
return select ( external _wp _coreData _namespaceObject . store ) . _ _experimentalGetTemplateForLink ( post . link ) ;
}
2021-05-20 14:20:04 +02:00
2022-04-11 14:04:30 +02:00
return null ;
} ) ;
2021-05-20 14:20:04 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/store/constants.js
2021-05-20 14:20:04 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* The identifier for the data store .
*
* @ type { string }
* /
const constants _STORE _NAME = 'core/edit-post' ;
/ * *
* CSS selector string for the admin bar view post link anchor tag .
*
* @ type { string }
2021-05-20 14:20:04 +02:00
* /
2022-04-11 14:04:30 +02:00
const VIEW _AS _LINK _SELECTOR = '#wp-admin-bar-view a' ;
/ * *
* CSS selector string for the admin bar preview post link anchor tag .
*
* @ type { string }
* /
2021-06-01 10:10:04 +02:00
2022-04-11 14:04:30 +02:00
const VIEW _AS _PREVIEW _LINK _SELECTOR = '#wp-admin-bar-preview a' ;
2021-06-01 10:10:04 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/store/index.js
2021-06-01 10:10:04 +02:00
/ * *
* WordPress dependencies
* /
2022-04-11 14:04:30 +02:00
/ * *
* Internal dependencies
* /
2021-05-07 13:48:27 +02:00
2020-06-26 15:33:47 +02:00
2022-04-11 14:04:30 +02:00
/ * *
* Store definition for the edit post namespace .
*
* @ see https : //github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
*
* @ type { Object }
* /
2020-06-26 15:33:47 +02:00
2022-04-12 17:12:47 +02:00
const store _store = ( 0 , external _wp _data _namespaceObject . createReduxStore ) ( constants _STORE _NAME , {
reducer : reducer ,
actions : store _actions _namespaceObject ,
selectors : store _selectors _namespaceObject
} ) ;
( 0 , external _wp _data _namespaceObject . register ) ( store _store ) ;
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/plugins/keyboard-shortcuts-help-menu-item/index.js
2022-01-04 06:39:28 +01:00
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
2020-06-26 15:33:47 +02:00
* /
2022-04-11 14:04:30 +02:00
/ * *
* Internal dependencies
* /
2020-06-26 15:33:47 +02:00
2022-04-11 14:04:30 +02:00
function KeyboardShortcutsHelpMenuItem ( _ref ) {
let {
openModal
} = _ref ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . MenuItem , {
onClick : ( ) => {
openModal ( 'edit-post/keyboard-shortcut-help' ) ;
} ,
shortcut : external _wp _keycodes _namespaceObject . displayShortcut . access ( 'h' )
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Keyboard shortcuts' ) ) ;
}
/* harmony default export */ var keyboard _shortcuts _help _menu _item = ( ( 0 , external _wp _data _namespaceObject . withDispatch ) ( dispatch => {
const {
openModal
} = dispatch ( store _store ) ;
return {
openModal
} ;
} ) ( KeyboardShortcutsHelpMenuItem ) ) ;
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/tools-more-menu-group/index.js
2020-06-26 15:33:47 +02:00
2021-05-19 17:09:27 +02:00
/ * *
* External dependencies
* /
2020-06-26 15:33:47 +02:00
2021-05-19 17:09:27 +02:00
/ * *
* WordPress dependencies
* /
2020-06-26 15:33:47 +02:00
2022-04-11 14:04:30 +02:00
const {
Fill : ToolsMoreMenuGroup ,
Slot
} = ( 0 , external _wp _components _namespaceObject . createSlotFill ) ( 'ToolsMoreMenuGroup' ) ;
2020-06-26 15:33:47 +02:00
2022-04-11 14:04:30 +02:00
ToolsMoreMenuGroup . Slot = _ref => {
let {
fillProps
} = _ref ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( Slot , {
fillProps : fillProps
} , fills => ! ( 0 , external _lodash _namespaceObject . isEmpty ) ( fills ) && ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . MenuGroup , {
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Tools' )
} , fills ) ) ;
} ;
2020-06-26 15:33:47 +02:00
2022-04-11 14:04:30 +02:00
/* harmony default export */ var tools _more _menu _group = ( ToolsMoreMenuGroup ) ;
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/plugins/welcome-guide-menu-item/index.js
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
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
* /
2021-05-19 17:09:27 +02:00
function WelcomeGuideMenuItem ( ) {
2022-04-11 14:04:30 +02:00
const isTemplateMode = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => select ( store _store ) . isEditingTemplate ( ) , [ ] ) ;
2022-04-12 17:12:47 +02:00
return ( 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 : isTemplateMode ? 'welcomeGuideTemplate' : 'welcomeGuide' ,
2022-04-11 14:04:30 +02:00
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Welcome Guide' )
2021-11-08 15:29:21 +01:00
} ) ;
2021-05-07 13:48:27 +02:00
}
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/plugins/index.js
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
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
* /
2021-01-28 03:04:13 +01:00
2022-04-11 14:04:30 +02:00
( 0 , external _wp _plugins _namespaceObject . registerPlugin ) ( 'edit-post' , {
2021-05-19 17:09:27 +02:00
render ( ) {
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 ) ( tools _more _menu _group , null , _ref => {
2021-11-15 13:50:17 +01:00
let {
onClose
} = _ref ;
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 ) ( external _wp _components _namespaceObject . MenuItem , {
2021-11-15 13:50:17 +01:00
role : "menuitem" ,
2022-04-11 14:04:30 +02:00
href : ( 0 , external _wp _url _namespaceObject . addQueryArgs ) ( 'edit.php' , {
2021-11-15 13:50:17 +01:00
post _type : 'wp_block'
} )
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Manage Reusable blocks' ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( keyboard _shortcuts _help _menu _item , {
2021-11-15 13:50:17 +01:00
onSelect : onClose
2022-04-11 14:04:30 +02:00
} ) , ( 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 , {
2021-11-15 13:50:17 +01:00
role : "menuitem" ,
2022-04-11 14:04:30 +02:00
icon : library _external ,
href : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'https://wordpress.org/support/article/wordpress-editor/' ) ,
2021-11-15 13:50:17 +01:00
target : "_blank" ,
rel : "noopener noreferrer"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Help' ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . VisuallyHidden , {
2021-11-15 13:50:17 +01:00
as : "span"
} ,
/* translators: accessibility text */
2022-04-11 14:04:30 +02:00
( 0 , external _wp _i18n _namespaceObject . _ _ ) ( '(opens in a new tab)' ) ) ) ) ;
2021-11-15 13:50:17 +01:00
} ) ) ;
2021-05-19 17:09:27 +02:00
}
2021-01-28 03:04:13 +01:00
2021-05-19 17:09:27 +02:00
} ) ;
2020-06-26 15:33:47 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: external ["wp","keyboardShortcuts"]
var external _wp _keyboardShortcuts _namespaceObject = window [ "wp" ] [ "keyboardShortcuts" ] ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/text-editor/index.js
2020-06-26 15:33:47 +02:00
/ * *
2021-05-19 17:09:27 +02:00
* WordPress dependencies
2021-05-07 13:48:27 +02:00
* /
2021-01-28 03:04:13 +01:00
2021-05-07 13:48:27 +02:00
2021-01-28 03:04:13 +01:00
2020-06-26 15:33:47 +02:00
/ * *
2021-05-19 17:09:27 +02:00
* Internal dependencies
2020-06-26 15:33:47 +02:00
* /
2021-11-15 13:50:17 +01:00
function TextEditor ( _ref ) {
let {
onExit ,
isRichEditingEnabled
} = _ref ;
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
2021-05-19 17:09:27 +02:00
className : "edit-post-text-editor"
2022-04-11 14:04:30 +02:00
} , isRichEditingEnabled && ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
2021-05-19 17:09:27 +02:00
className : "edit-post-text-editor__toolbar"
2022-04-11 14:04:30 +02:00
} , ( 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 , {
2021-11-08 15:29:21 +01:00
variant : "tertiary" ,
2021-05-19 17:09:27 +02:00
onClick : onExit ,
2022-04-11 14:04:30 +02:00
shortcut : external _wp _keycodes _namespaceObject . displayShortcut . secondary ( 'm' )
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Exit code editor' ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . TextEditorGlobalKeyboardShortcuts , null ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
2021-05-19 17:09:27 +02:00
className : "edit-post-text-editor__body"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostTitle , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostTextEditor , null ) ) ) ;
2021-05-07 13:48:27 +02:00
}
2020-06-26 15:33:47 +02:00
2022-04-11 14:04:30 +02:00
/* harmony default export */ var text _editor = ( ( 0 , external _wp _compose _namespaceObject . compose ) ( ( 0 , external _wp _data _namespaceObject . withSelect ) ( select => ( {
isRichEditingEnabled : select ( external _wp _editor _namespaceObject . store ) . getEditorSettings ( ) . richEditingEnabled
} ) ) , ( 0 , external _wp _data _namespaceObject . withDispatch ) ( dispatch => {
2021-05-19 17:09:27 +02:00
return {
onExit ( ) {
2022-04-11 14:04:30 +02:00
dispatch ( store _store ) . switchEditorMode ( 'visual' ) ;
2021-05-19 17:09:27 +02:00
}
2020-06-26 15:33:47 +02:00
2021-05-19 17:09:27 +02:00
} ;
} ) ) ( TextEditor ) ) ;
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/arrow-left.js
/ * *
* WordPress dependencies
* /
2021-05-07 13:48:27 +02:00
2022-04-11 14:04:30 +02:00
const arrowLeft = ( 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 10.8H6.7l4.1-4.5-1.1-1.1-5.8 6.3 5.8 5.8 1.1-1.1-4-3.9H20z"
} ) ) ;
/* harmony default export */ var arrow _left = ( arrowLeft ) ;
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/visual-editor/block-inspector-button.js
2021-05-07 13:48:27 +02:00
2021-11-08 15:29:21 +01:00
/ * *
* External dependencies
* /
2021-05-07 13:48:27 +02:00
2021-11-08 15:29:21 +01:00
/ * *
* WordPress dependencies
* /
2021-05-07 13:48:27 +02:00
2021-05-19 17:09:27 +02:00
/ * *
2021-11-08 15:29:21 +01:00
* Internal dependencies
2021-05-07 13:48:27 +02:00
* /
2021-11-15 13:50:17 +01:00
function BlockInspectorButton ( _ref ) {
let {
2022-04-11 14:04:30 +02:00
onClick = external _lodash _namespaceObject . noop ,
2021-11-15 13:50:17 +01:00
small = false
} = _ref ;
2021-05-19 17:09:27 +02:00
const {
shortcut ,
areAdvancedSettingsOpened
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-sidebar' ) ,
areAdvancedSettingsOpened : select ( store _store ) . getActiveGeneralSidebarName ( ) === 'edit-post/block'
2021-05-19 17:09:27 +02:00
} ) , [ ] ) ;
const {
openGeneralSidebar ,
closeGeneralSidebar
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
const label = areAdvancedSettingsOpened ? ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Hide more settings' ) : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Show more settings' ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . MenuItem , {
2021-05-19 17:09:27 +02:00
onClick : ( ) => {
if ( areAdvancedSettingsOpened ) {
closeGeneralSidebar ( ) ;
2022-04-11 14:04:30 +02:00
( 0 , external _wp _a11y _namespaceObject . speak ) ( ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Block settings closed' ) ) ;
2021-05-19 17:09:27 +02:00
} else {
openGeneralSidebar ( 'edit-post/block' ) ;
2022-04-11 14:04:30 +02:00
( 0 , external _wp _a11y _namespaceObject . speak ) ( ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Additional settings are now available in the Editor block settings sidebar' ) ) ;
2021-05-19 17:09:27 +02:00
}
2021-11-08 15:29:21 +01:00
onClick ( ) ;
2021-05-19 17:09:27 +02:00
} ,
shortcut : shortcut
} , ! small && label ) ;
2021-05-07 13:48:27 +02:00
}
2021-05-19 17:09:27 +02:00
/* harmony default export */ var block _inspector _button = ( BlockInspectorButton ) ;
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/visual-editor/index.js
2021-05-07 13:48:27 +02:00
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2021-11-15 13:50:17 +01:00
function MaybeIframe ( _ref ) {
let {
children ,
contentRef ,
shouldIframe ,
styles ,
2022-04-12 17:12:47 +02:00
assets ,
2021-11-15 13:50:17 +01:00
style
} = _ref ;
2022-04-11 14:04:30 +02:00
const ref = ( 0 , external _wp _blockEditor _namespaceObject . _ _unstableUseMouseMoveTypingReset ) ( ) ;
2021-05-07 13:48:27 +02:00
2021-11-08 15:29:21 +01:00
if ( ! shouldIframe ) {
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 ) ( external _wp _blockEditor _namespaceObject . _ _unstableEditorStyles , {
2021-05-19 17:09:27 +02:00
styles : styles
2022-04-11 14:04:30 +02:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . WritingFlow , {
2021-05-19 17:09:27 +02:00
ref : contentRef ,
className : "editor-styles-wrapper" ,
style : {
2021-05-21 12:14:23 +02:00
flex : '1' ,
2021-05-19 17:09:27 +02:00
... style
2021-07-15 20:55:29 +02:00
} ,
tabIndex : - 1
2021-05-19 17:09:27 +02:00
} , children ) ) ;
}
2021-05-07 13:48:27 +02:00
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . _ _unstableIframe , {
head : ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . _ _unstableEditorStyles , {
2021-05-19 17:09:27 +02:00
styles : styles
} ) ,
2022-04-12 17:12:47 +02:00
assets : assets ,
2021-05-19 17:09:27 +02:00
ref : ref ,
contentRef : contentRef ,
style : {
width : '100%' ,
height : '100%' ,
display : 'block'
2021-11-08 15:29:21 +01:00
} ,
name : "editor-canvas"
} , children ) ;
2021-05-19 17:09:27 +02:00
}
2021-05-07 13:48:27 +02:00
2021-11-15 13:50:17 +01:00
function VisualEditor ( _ref2 ) {
let {
styles
} = _ref2 ;
2021-05-19 17:09:27 +02:00
const {
deviceType ,
2021-05-21 12:14:23 +02:00
isTemplateMode ,
wrapperBlockName ,
wrapperUniqueId
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
2021-05-19 17:09:27 +02:00
const {
isEditingTemplate ,
_ _experimentalGetPreviewDeviceType
2022-04-11 14:04:30 +02:00
} = select ( store _store ) ;
2021-05-21 12:14:23 +02:00
const {
getCurrentPostId ,
getCurrentPostType
2022-04-11 14:04:30 +02:00
} = select ( external _wp _editor _namespaceObject . store ) ;
2021-05-21 12:14:23 +02:00
const _isTemplateMode = isEditingTemplate ( ) ;
let _wrapperBlockName ;
if ( getCurrentPostType ( ) === 'wp_block' ) {
_wrapperBlockName = 'core/block' ;
} else if ( ! _isTemplateMode ) {
_wrapperBlockName = 'core/post-content' ;
}
2021-05-07 13:48:27 +02:00
return {
2021-05-19 17:09:27 +02:00
deviceType : _ _experimentalGetPreviewDeviceType ( ) ,
2021-05-21 12:14:23 +02:00
isTemplateMode : _isTemplateMode ,
wrapperBlockName : _wrapperBlockName ,
wrapperUniqueId : getCurrentPostId ( )
2021-05-07 13:48:27 +02:00
} ;
2021-05-19 17:09:27 +02:00
} , [ ] ) ;
2022-04-11 14:04:30 +02:00
const hasMetaBoxes = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => select ( store _store ) . hasMetaBoxes ( ) , [ ] ) ;
2022-04-12 17:12:47 +02:00
const {
themeSupportsLayout ,
assets
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
const _settings = select ( external _wp _blockEditor _namespaceObject . store ) . getSettings ( ) ;
return {
themeSupportsLayout : _settings . supportsLayout ,
assets : _settings . _ _unstableResolvedAssets
} ;
2021-05-19 17:09:27 +02:00
} , [ ] ) ;
const {
clearSelectedBlock
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _blockEditor _namespaceObject . store ) ;
2021-05-19 17:09:27 +02:00
const {
setIsEditingTemplate
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 desktopCanvasStyles = {
2022-04-12 17:12:47 +02:00
height : '100%' ,
2021-05-19 17:09:27 +02:00
width : '100%' ,
2021-05-21 12:14:23 +02:00
margin : 0 ,
display : 'flex' ,
flexFlow : 'column' ,
// Default background color so that grey
// .edit-post-editor-regions__content color doesn't show through.
background : 'white'
2021-05-07 13:48:27 +02:00
} ;
2021-05-19 17:09:27 +02:00
const templateModeStyles = { ... desktopCanvasStyles ,
borderRadius : '2px 2px 0 0' ,
border : '1px solid #ddd' ,
borderBottom : 0
} ;
2022-04-11 14:04:30 +02:00
const resizedCanvasStyles = ( 0 , external _wp _blockEditor _namespaceObject . _ _experimentalUseResizeCanvas ) ( deviceType , isTemplateMode ) ;
const defaultLayout = ( 0 , external _wp _blockEditor _namespaceObject . useSetting ) ( 'layout' ) ;
2021-11-08 15:29:21 +01:00
const previewMode = 'is-' + deviceType . toLowerCase ( ) + '-preview' ;
2021-05-19 17:09:27 +02:00
let animatedStyles = isTemplateMode ? templateModeStyles : desktopCanvasStyles ;
2021-05-07 13:48:27 +02:00
2021-05-19 17:09:27 +02:00
if ( resizedCanvasStyles ) {
animatedStyles = resizedCanvasStyles ;
}
2021-05-07 13:48:27 +02:00
2021-05-19 17:09:27 +02:00
let paddingBottom ; // Add a constant padding for the typewritter effect. When typing at the
// bottom, there needs to be room to scroll up.
2021-05-07 13:48:27 +02:00
2021-05-19 17:09:27 +02:00
if ( ! hasMetaBoxes && ! resizedCanvasStyles && ! isTemplateMode ) {
paddingBottom = '40vh' ;
}
2021-05-07 13:48:27 +02:00
2022-04-11 14:04:30 +02:00
const ref = ( 0 , external _wp _element _namespaceObject . useRef ) ( ) ;
2022-04-12 17:12:47 +02:00
const contentRef = ( 0 , external _wp _compose _namespaceObject . useMergeRefs ) ( [ ref , ( 0 , external _wp _blockEditor _namespaceObject . _ _unstableUseClipboardHandler ) ( ) , ( 0 , external _wp _blockEditor _namespaceObject . _ _unstableUseTypewriter ) ( ) , ( 0 , external _wp _blockEditor _namespaceObject . _ _unstableUseTypingObserver ) ( ) , ( 0 , external _wp _blockEditor _namespaceObject . _ _unstableUseBlockSelectionClearer ) ( ) ] ) ;
2022-04-11 14:04:30 +02:00
const blockSelectionClearerRef = ( 0 , external _wp _blockEditor _namespaceObject . _ _unstableUseBlockSelectionClearer ) ( ) ;
const [ , RecursionProvider ] = ( 0 , external _wp _blockEditor _namespaceObject . _ _experimentalUseNoRecursiveRenders ) ( wrapperUniqueId , wrapperBlockName ) ;
const layout = ( 0 , external _wp _element _namespaceObject . useMemo ) ( ( ) => {
2021-06-08 10:09:53 +02:00
if ( isTemplateMode ) {
return {
type : 'default'
} ;
}
if ( themeSupportsLayout ) {
2021-11-08 15:29:21 +01:00
return defaultLayout ;
2021-06-08 10:09:53 +02:00
}
return undefined ;
2021-11-08 15:29:21 +01:00
} , [ isTemplateMode , themeSupportsLayout , defaultLayout ] ) ;
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . BlockTools , {
2021-11-08 15:29:21 +01:00
_ _unstableContentRef : ref ,
2021-05-19 17:09:27 +02:00
className : classnames _default ( ) ( 'edit-post-visual-editor' , {
'is-template-mode' : isTemplateMode
2021-05-21 12:14:23 +02:00
} )
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . VisualEditorGlobalKeyboardShortcuts , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _unstableMotion . div , {
2021-05-21 12:14:23 +02:00
className : "edit-post-visual-editor__content-area" ,
animate : {
padding : isTemplateMode ? '48px 48px 0' : '0'
2021-05-19 17:09:27 +02:00
} ,
ref : blockSelectionClearerRef
2022-04-11 14:04:30 +02:00
} , isTemplateMode && ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
2021-05-19 17:09:27 +02:00
className : "edit-post-visual-editor__exit-template-mode" ,
2022-04-11 14:04:30 +02:00
icon : arrow _left ,
2021-05-19 17:09:27 +02:00
onClick : ( ) => {
clearSelectedBlock ( ) ;
setIsEditingTemplate ( false ) ;
}
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Back' ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _unstableMotion . div , {
2021-05-19 17:09:27 +02:00
animate : animatedStyles ,
2021-11-08 15:29:21 +01:00
initial : desktopCanvasStyles ,
className : previewMode
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( MaybeIframe , {
2021-11-08 15:29:21 +01:00
shouldIframe : isTemplateMode || deviceType === 'Tablet' || deviceType === 'Mobile' ,
2021-05-19 17:09:27 +02:00
contentRef : contentRef ,
styles : styles ,
2022-04-12 17:12:47 +02:00
assets : assets ,
2021-05-19 17:09:27 +02:00
style : {
paddingBottom
}
2022-04-11 14:04:30 +02:00
} , themeSupportsLayout && ! isTemplateMode && ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . _ _experimentalLayoutStyle , {
2021-05-21 12:14:23 +02:00
selector : ".edit-post-visual-editor__post-title-wrapper, .block-editor-block-list__layout.is-root-container" ,
layout : defaultLayout
2022-04-11 14:04:30 +02:00
} ) , ! isTemplateMode && ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
2022-04-12 17:12:47 +02:00
className : "edit-post-visual-editor__post-title-wrapper" ,
contentEditable : false
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostTitle , null ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( RecursionProvider , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . BlockList , {
2021-11-08 15:29:21 +01:00
className : isTemplateMode ? 'wp-site-blocks' : undefined ,
2021-06-08 10:09:53 +02:00
_ _experimentalLayout : layout
2022-04-11 14:04:30 +02:00
} ) ) ) ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . _ _unstableBlockSettingsMenuFirstItem , null , _ref3 => {
2021-11-15 13:50:17 +01:00
let {
onClose
} = _ref3 ;
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( block _inspector _button , {
2021-11-15 13:50:17 +01:00
onClick : onClose
} ) ;
} ) ) ;
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/keyboard-shortcuts/index.js
2021-05-07 13:48:27 +02:00
/ * *
* WordPress dependencies
* /
2021-05-21 12:14:23 +02:00
2021-05-07 13:48:27 +02:00
/ * *
* Internal dependencies
* /
2021-05-19 17:09:27 +02:00
function KeyboardShortcuts ( ) {
const {
getBlockSelectionStart
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( external _wp _blockEditor _namespaceObject . store ) ;
2021-05-19 17:09:27 +02:00
const {
getEditorMode ,
2021-05-21 12:14:23 +02:00
isEditorSidebarOpened ,
isListViewOpened
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( store _store ) ;
const isModeToggleDisabled = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
2021-05-19 17:09:27 +02:00
const {
richEditingEnabled ,
codeEditingEnabled
2022-04-11 14:04:30 +02:00
} = select ( external _wp _editor _namespaceObject . store ) . getEditorSettings ( ) ;
2021-05-19 17:09:27 +02:00
return ! richEditingEnabled || ! codeEditingEnabled ;
} , [ ] ) ;
const {
switchEditorMode ,
openGeneralSidebar ,
closeGeneralSidebar ,
2021-05-21 12:14:23 +02:00
toggleFeature ,
setIsListViewOpened
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 {
registerShortcut
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _keyboardShortcuts _namespaceObject . store ) ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
2021-05-19 17:09:27 +02:00
registerShortcut ( {
name : 'core/edit-post/toggle-mode' ,
category : 'global' ,
2022-04-11 14:04:30 +02:00
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Switch between visual editor and code editor.' ) ,
2021-05-19 17:09:27 +02:00
keyCombination : {
modifier : 'secondary' ,
character : 'm'
}
} ) ;
registerShortcut ( {
name : 'core/edit-post/toggle-fullscreen' ,
category : 'global' ,
2022-04-11 14:04:30 +02:00
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Toggle fullscreen mode.' ) ,
2021-05-19 17:09:27 +02:00
keyCombination : {
modifier : 'secondary' ,
character : 'f'
}
} ) ;
registerShortcut ( {
2021-11-08 15:29:21 +01:00
name : 'core/edit-post/toggle-list-view' ,
2021-05-19 17:09:27 +02:00
category : 'global' ,
2022-04-11 14:04:30 +02:00
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Open the block list view.' ) ,
2021-05-19 17:09:27 +02:00
keyCombination : {
modifier : 'access' ,
character : 'o'
}
} ) ;
registerShortcut ( {
name : 'core/edit-post/toggle-sidebar' ,
category : 'global' ,
2022-04-11 14:04:30 +02:00
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Show or hide the settings sidebar.' ) ,
2021-05-19 17:09:27 +02:00
keyCombination : {
modifier : 'primaryShift' ,
character : ','
}
} ) ;
registerShortcut ( {
name : 'core/edit-post/next-region' ,
category : 'global' ,
2022-04-11 14:04:30 +02:00
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Navigate to the next part of the editor.' ) ,
2021-05-19 17:09:27 +02:00
keyCombination : {
modifier : 'ctrl' ,
character : '`'
} ,
aliases : [ {
modifier : 'access' ,
character : 'n'
} ]
} ) ;
registerShortcut ( {
name : 'core/edit-post/previous-region' ,
category : 'global' ,
2022-04-11 14:04:30 +02:00
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Navigate to the previous part of the editor.' ) ,
2021-05-19 17:09:27 +02:00
keyCombination : {
modifier : 'ctrlShift' ,
character : '`'
} ,
aliases : [ {
modifier : 'access' ,
character : 'p'
} ]
} ) ;
registerShortcut ( {
name : 'core/edit-post/keyboard-shortcuts' ,
category : 'main' ,
2022-04-11 14:04:30 +02:00
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Display these keyboard shortcuts.' ) ,
2021-05-19 17:09:27 +02:00
keyCombination : {
modifier : 'access' ,
character : 'h'
}
} ) ;
} , [ ] ) ;
2022-04-11 14:04:30 +02:00
( 0 , external _wp _keyboardShortcuts _namespaceObject . useShortcut ) ( 'core/edit-post/toggle-mode' , ( ) => {
2021-05-19 17:09:27 +02:00
switchEditorMode ( getEditorMode ( ) === 'visual' ? 'text' : 'visual' ) ;
} , {
isDisabled : isModeToggleDisabled
} ) ;
2022-04-11 14:04:30 +02:00
( 0 , external _wp _keyboardShortcuts _namespaceObject . useShortcut ) ( 'core/edit-post/toggle-fullscreen' , ( ) => {
2021-05-19 17:09:27 +02:00
toggleFeature ( 'fullscreenMode' ) ;
} ) ;
2022-04-11 14:04:30 +02:00
( 0 , external _wp _keyboardShortcuts _namespaceObject . useShortcut ) ( 'core/edit-post/toggle-sidebar' , event => {
2021-05-19 17:09:27 +02:00
// This shortcut has no known clashes, but use preventDefault to prevent any
// obscure shortcuts from triggering.
event . preventDefault ( ) ;
2021-05-07 13:48:27 +02:00
2021-05-19 17:09:27 +02:00
if ( isEditorSidebarOpened ( ) ) {
closeGeneralSidebar ( ) ;
} else {
const sidebarToOpen = getBlockSelectionStart ( ) ? 'edit-post/block' : 'edit-post/document' ;
openGeneralSidebar ( sidebarToOpen ) ;
2021-05-07 13:48:27 +02:00
}
2021-05-21 12:14:23 +02:00
} ) ;
2022-04-11 14:04:30 +02:00
( 0 , external _wp _keyboardShortcuts _namespaceObject . useShortcut ) ( 'core/edit-post/toggle-list-view' , ( ) => setIsListViewOpened ( ! isListViewOpened ( ) ) ) ;
2021-05-19 17:09:27 +02:00
return null ;
2021-05-07 13:48:27 +02:00
}
2021-05-19 17:09:27 +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/keyboard-shortcut-help-modal/config.js
2021-05-07 13:48:27 +02:00
/ * *
* WordPress dependencies
* /
2021-05-19 17:09:27 +02:00
const textFormattingShortcuts = [ {
keyCombination : {
modifier : 'primary' ,
character : 'b'
} ,
2022-04-11 14:04:30 +02:00
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Make the selected text bold.' )
2021-05-19 17:09:27 +02:00
} , {
keyCombination : {
modifier : 'primary' ,
character : 'i'
} ,
2022-04-11 14:04:30 +02:00
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Make the selected text italic.' )
2021-05-19 17:09:27 +02:00
} , {
keyCombination : {
modifier : 'primary' ,
character : 'k'
} ,
2022-04-11 14:04:30 +02:00
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Convert the selected text into a link.' )
2021-05-19 17:09:27 +02:00
} , {
keyCombination : {
modifier : 'primaryShift' ,
character : 'k'
} ,
2022-04-11 14:04:30 +02:00
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Remove a link.' )
2022-04-12 17:12:47 +02:00
} , {
keyCombination : {
character : '[['
} ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Insert a link to a post or page' )
2021-05-19 17:09:27 +02:00
} , {
keyCombination : {
modifier : 'primary' ,
character : 'u'
} ,
2022-04-11 14:04:30 +02:00
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Underline the selected text.' )
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/keyboard-shortcut-help-modal/shortcut.js
2021-05-07 13:48:27 +02:00
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
2021-11-15 13:50:17 +01:00
function KeyCombination ( _ref ) {
let {
keyCombination ,
forceAriaLabel
} = _ref ;
2022-04-11 14:04:30 +02:00
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" , {
2021-05-19 17:09:27 +02:00
className : "edit-post-keyboard-shortcut-help-modal__shortcut-key-combination" ,
"aria-label" : forceAriaLabel || ariaLabel
2022-04-11 14:04:30 +02:00
} , ( 0 , external _lodash _namespaceObject . castArray ) ( shortcut ) . map ( ( character , index ) => {
2021-05-19 17:09:27 +02:00
if ( character === '+' ) {
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , {
2021-05-19 17:09:27 +02:00
key : index
} , character ) ;
2021-05-07 13:48:27 +02:00
}
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( "kbd" , {
2021-05-19 17:09:27 +02:00
key : index ,
className : "edit-post-keyboard-shortcut-help-modal__shortcut-key"
} , character ) ;
} ) ) ;
2021-05-07 13:48:27 +02:00
}
2021-11-15 13:50:17 +01:00
function Shortcut ( _ref2 ) {
let {
description ,
keyCombination ,
aliases = [ ] ,
ariaLabel
} = _ref2 ;
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" , {
2021-05-19 17:09:27 +02:00
className : "edit-post-keyboard-shortcut-help-modal__shortcut-description"
2022-04-11 14:04:30 +02:00
} , description ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
2021-05-19 17:09:27 +02:00
className : "edit-post-keyboard-shortcut-help-modal__shortcut-term"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( KeyCombination , {
2021-05-19 17:09:27 +02:00
keyCombination : keyCombination ,
forceAriaLabel : ariaLabel
2022-04-11 14:04:30 +02:00
} ) , aliases . map ( ( alias , index ) => ( 0 , external _wp _element _namespaceObject . createElement ) ( KeyCombination , {
2021-05-19 17:09:27 +02:00
keyCombination : alias ,
forceAriaLabel : ariaLabel ,
key : index
} ) ) ) ) ;
}
2021-05-07 13:48:27 +02:00
2021-05-19 17:09:27 +02:00
/* harmony default export */ var keyboard _shortcut _help _modal _shortcut = ( Shortcut ) ;
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js
2021-05-07 13:48:27 +02:00
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2021-11-15 13:50:17 +01:00
function DynamicShortcut ( _ref ) {
let {
name
} = _ref ;
2021-05-19 17:09:27 +02:00
const {
keyCombination ,
description ,
aliases
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
2021-05-19 17:09:27 +02:00
const {
getShortcutKeyCombination ,
getShortcutDescription ,
getShortcutAliases
2022-04-11 14:04:30 +02:00
} = select ( external _wp _keyboardShortcuts _namespaceObject . store ) ;
2021-05-19 17:09:27 +02:00
return {
keyCombination : getShortcutKeyCombination ( name ) ,
aliases : getShortcutAliases ( name ) ,
description : getShortcutDescription ( name )
} ;
2021-11-08 15:29:21 +01:00
} , [ name ] ) ;
2021-05-07 13:48:27 +02:00
2021-05-19 17:09:27 +02:00
if ( ! keyCombination ) {
2021-05-07 13:48:27 +02:00
return null ;
}
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( keyboard _shortcut _help _modal _shortcut , {
2021-05-19 17:09:27 +02:00
keyCombination : keyCombination ,
description : description ,
aliases : aliases
} ) ;
2021-05-07 13:48:27 +02:00
}
2021-05-19 17:09:27 +02:00
/* harmony default export */ var dynamic _shortcut = ( DynamicShortcut ) ;
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/keyboard-shortcut-help-modal/index.js
2021-05-07 13:48:27 +02:00
/ * *
2021-05-19 17:09:27 +02:00
* External dependencies
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
* Internal dependencies
2021-05-07 13:48:27 +02:00
* /
2021-05-19 17:09:27 +02:00
const MODAL _NAME = 'edit-post/keyboard-shortcut-help' ;
2021-11-15 13:50:17 +01:00
const ShortcutList = _ref => {
let {
shortcuts
} = _ref ;
return (
/ *
* Disable reason : The ` list ` ARIA role is redundant but
* Safari + VoiceOver won ' t announce the list otherwise .
* /
/* eslint-disable jsx-a11y/no-redundant-roles */
2022-04-11 14:04:30 +02:00
( 0 , external _wp _element _namespaceObject . createElement ) ( "ul" , {
2021-11-15 13:50:17 +01:00
className : "edit-post-keyboard-shortcut-help-modal__shortcut-list" ,
role : "list"
2022-04-11 14:04:30 +02:00
} , shortcuts . map ( ( shortcut , index ) => ( 0 , external _wp _element _namespaceObject . createElement ) ( "li" , {
2021-11-15 13:50:17 +01:00
className : "edit-post-keyboard-shortcut-help-modal__shortcut" ,
key : index
2022-04-11 14:04:30 +02:00
} , ( 0 , external _lodash _namespaceObject . isString ) ( shortcut ) ? ( 0 , external _wp _element _namespaceObject . createElement ) ( dynamic _shortcut , {
2021-11-15 13:50:17 +01:00
name : shortcut
2022-04-11 14:04:30 +02:00
} ) : ( 0 , external _wp _element _namespaceObject . createElement ) ( keyboard _shortcut _help _modal _shortcut , shortcut ) ) ) )
2021-11-15 13:50:17 +01:00
/* eslint-enable jsx-a11y/no-redundant-roles */
2021-05-07 13:48:27 +02:00
2021-11-15 13:50:17 +01:00
) ;
} ;
const ShortcutSection = _ref2 => {
let {
title ,
shortcuts ,
className
} = _ref2 ;
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( "section" , {
2021-11-15 13:50:17 +01:00
className : classnames _default ( ) ( 'edit-post-keyboard-shortcut-help-modal__section' , className )
2022-04-11 14:04:30 +02:00
} , ! ! title && ( 0 , external _wp _element _namespaceObject . createElement ) ( "h2" , {
2021-11-15 13:50:17 +01:00
className : "edit-post-keyboard-shortcut-help-modal__section-title"
2022-04-11 14:04:30 +02:00
} , title ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( ShortcutList , {
2021-11-15 13:50:17 +01:00
shortcuts : shortcuts
} ) ) ;
} ;
const ShortcutCategorySection = _ref3 => {
let {
title ,
categoryName ,
additionalShortcuts = [ ]
} = _ref3 ;
2022-04-11 14:04:30 +02:00
const categoryShortcuts = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
return select ( external _wp _keyboardShortcuts _namespaceObject . store ) . getCategoryShortcuts ( categoryName ) ;
2021-05-19 17:09:27 +02:00
} , [ categoryName ] ) ;
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( ShortcutSection , {
2021-05-19 17:09:27 +02:00
title : title ,
shortcuts : categoryShortcuts . concat ( additionalShortcuts )
} ) ;
} ;
2021-05-07 13:48:27 +02:00
2021-11-15 13:50:17 +01:00
function KeyboardShortcutHelpModal ( _ref4 ) {
let {
isModalActive ,
toggleModal
} = _ref4 ;
2022-04-11 14:04:30 +02:00
( 0 , external _wp _keyboardShortcuts _namespaceObject . useShortcut ) ( 'core/edit-post/keyboard-shortcuts' , toggleModal ) ;
2021-05-07 13:48:27 +02:00
2021-05-19 17:09:27 +02:00
if ( ! isModalActive ) {
return null ;
}
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Modal , {
2021-05-19 17:09:27 +02:00
className : "edit-post-keyboard-shortcut-help-modal" ,
2022-04-11 14:04:30 +02:00
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Keyboard shortcuts' ) ,
closeLabel : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Close' ) ,
2021-05-19 17:09:27 +02:00
onRequestClose : toggleModal
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( ShortcutSection , {
2021-05-19 17:09:27 +02:00
className : "edit-post-keyboard-shortcut-help-modal__main-shortcuts" ,
shortcuts : [ 'core/edit-post/keyboard-shortcuts' ]
2022-04-11 14:04:30 +02:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( ShortcutCategorySection , {
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Global shortcuts' ) ,
2021-05-19 17:09:27 +02:00
categoryName : "global"
2022-04-11 14:04:30 +02:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( ShortcutCategorySection , {
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Selection shortcuts' ) ,
2021-05-19 17:09:27 +02:00
categoryName : "selection"
2022-04-11 14:04:30 +02:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( ShortcutCategorySection , {
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Block shortcuts' ) ,
2021-05-19 17:09:27 +02:00
categoryName : "block" ,
additionalShortcuts : [ {
keyCombination : {
character : '/'
} ,
2022-04-11 14:04:30 +02:00
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Change the block type after adding a new paragraph.' ) ,
2021-05-19 17:09:27 +02:00
/* translators: The forward-slash character. e.g. '/'. */
2022-04-11 14:04:30 +02:00
ariaLabel : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Forward-slash' )
2021-05-19 17:09:27 +02:00
} ]
2022-04-11 14:04:30 +02:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( ShortcutSection , {
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Text formatting' ) ,
2021-05-19 17:09:27 +02:00
shortcuts : textFormattingShortcuts
} ) ) ;
}
2022-04-11 14:04:30 +02:00
/* harmony default export */ var keyboard _shortcut _help _modal = ( ( 0 , external _wp _compose _namespaceObject . compose ) ( [ ( 0 , external _wp _data _namespaceObject . withSelect ) ( select => ( {
isModalActive : select ( store _store ) . isModalActive ( MODAL _NAME )
} ) ) , ( 0 , external _wp _data _namespaceObject . withDispatch ) ( ( dispatch , _ref5 ) => {
2021-11-15 13:50:17 +01:00
let {
isModalActive
} = _ref5 ;
2021-05-19 17:09:27 +02:00
const {
openModal ,
closeModal
2022-04-11 14:04:30 +02:00
} = dispatch ( store _store ) ;
2021-05-07 13:48:27 +02:00
return {
2021-05-19 17:09:27 +02:00
toggleModal : ( ) => isModalActive ? closeModal ( ) : openModal ( MODAL _NAME )
2021-05-07 13:48:27 +02:00
} ;
2021-05-19 17:09:27 +02:00
} ) ] ) ( KeyboardShortcutHelpModal ) ) ;
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
* /
function CustomFieldsConfirmation ( _ref ) {
let {
willEnable
} = _ref ;
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 ) ;
document . getElementById ( 'toggle-custom-fields-form' ) . submit ( ) ;
}
} , willEnable ? ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Enable & Reload' ) : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Disable & Reload' ) ) ) ;
}
function EnableCustomFieldsOption ( _ref2 ) {
let {
label ,
areCustomFieldsEnabled
} = _ref2 ;
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
} ) ) ;
}
/* harmony default export */ var enable _custom _fields = ( ( 0 , external _wp _data _namespaceObject . withSelect ) ( select => ( {
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
2022-04-11 14:04:30 +02:00
/ * *
* Internal dependencies
* /
/* harmony default export */ var enable _panel = ( ( 0 , external _wp _compose _namespaceObject . compose ) ( ( 0 , external _wp _data _namespaceObject . withSelect ) ( ( select , _ref ) => {
let {
panelName
} = _ref ;
const {
isEditorPanelEnabled ,
isEditorPanelRemoved
} = select ( store _store ) ;
return {
isRemoved : isEditorPanelRemoved ( panelName ) ,
isChecked : isEditorPanelEnabled ( panelName )
} ;
} ) , ( 0 , external _wp _compose _namespaceObject . ifCondition ) ( _ref2 => {
let {
isRemoved
} = _ref2 ;
return ! isRemoved ;
} ) , ( 0 , external _wp _data _namespaceObject . withDispatch ) ( ( dispatch , _ref3 ) => {
let {
panelName
} = _ref3 ;
return {
onChange : ( ) => dispatch ( store _store ) . toggleEditorPanelEnabled ( panelName )
} ;
2022-04-12 17:12:47 +02:00
} ) ) ( 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
* /
/ * *
* Internal dependencies
* /
const {
Fill ,
Slot : enable _plugin _document _setting _panel _Slot
} = ( 0 , external _wp _components _namespaceObject . createSlotFill ) ( 'EnablePluginDocumentSettingPanelOption' ) ;
const EnablePluginDocumentSettingPanelOption = _ref => {
let {
label ,
panelName
} = _ref ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( Fill , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( enable _panel , {
label : label ,
panelName : panelName
} ) ) ;
} ;
EnablePluginDocumentSettingPanelOption . Slot = enable _plugin _document _setting _panel _Slot ;
/* harmony default export */ var enable _plugin _document _setting _panel = ( EnablePluginDocumentSettingPanelOption ) ;
; // 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
2022-04-11 14:04:30 +02:00
/* harmony default export */ var enable _publish _sidebar = ( ( 0 , external _wp _compose _namespaceObject . compose ) ( ( 0 , external _wp _data _namespaceObject . withSelect ) ( select => ( {
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 ( )
} ;
} ) , // In < medium viewports we override this option and always show the publish sidebar.
// 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
2022-04-11 14:04:30 +02:00
/ * *
* Internal dependencies
* /
/* harmony default export */ var enable _feature = ( ( 0 , external _wp _compose _namespaceObject . compose ) ( ( 0 , external _wp _data _namespaceObject . withSelect ) ( ( select , _ref ) => {
let {
featureName
} = _ref ;
const {
isFeatureActive
} = select ( store _store ) ;
return {
isChecked : isFeatureActive ( featureName )
} ;
} ) , ( 0 , external _wp _data _namespaceObject . withDispatch ) ( ( dispatch , _ref2 ) => {
let {
featureName
} = _ref2 ;
return {
onChange : ( ) => dispatch ( store _store ) . toggleFeature ( featureName )
} ;
2022-04-12 17:12:47 +02:00
} ) ) ( 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
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
2022-04-12 17:12:47 +02:00
2022-04-11 14:04:30 +02:00
/ * *
* Internal dependencies
* /
function MetaBoxesSection ( _ref ) {
let {
areCustomFieldsRegistered ,
metaBoxes ,
... sectionProps
} = _ref ;
2021-11-08 15:29:21 +01:00
// The 'Custom Fields' meta box is a special case that we handle separately.
2022-04-11 14:04:30 +02:00
const thirdPartyMetaBoxes = ( 0 , external _lodash _namespaceObject . filter ) ( metaBoxes , _ref2 => {
2021-11-15 13:50:17 +01:00
let {
id
} = _ref2 ;
return id !== 'postcustom' ;
} ) ;
2021-11-08 15:29:21 +01:00
if ( ! areCustomFieldsRegistered && thirdPartyMetaBoxes . length === 0 ) {
return null ;
}
2022-04-12 17:12:47 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( preferences _modal _section , sectionProps , 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' )
} ) , ( 0 , external _lodash _namespaceObject . map ) ( thirdPartyMetaBoxes , _ref3 => {
2021-11-15 13:50:17 +01:00
let {
id ,
title
} = _ref3 ;
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( enable _panel , {
2021-11-15 13:50:17 +01:00
key : id ,
label : title ,
panelName : ` meta-box- ${ id } `
} ) ;
} ) ) ;
2021-11-08 15:29:21 +01:00
}
2022-04-11 14:04:30 +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
* External dependencies
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-11-15 13:50:17 +01:00
function BlockTypesChecklist ( _ref ) {
let {
blockTypes ,
value ,
onItemChange
} = _ref ;
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 , {
label : ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , blockType . title , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . BlockIcon , {
2021-05-19 17:09:27 +02:00
icon : blockType . icon
} ) ) ,
checked : value . includes ( blockType . name ) ,
2022-04-11 14:04:30 +02:00
onChange : ( 0 , external _lodash _namespaceObject . partial ) ( onItemChange , blockType . name )
2021-05-07 13:48:27 +02:00
} ) ) ) ) ;
}
2021-05-19 17:09:27 +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
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
2022-04-12 17:12:47 +02:00
2021-05-07 13:48:27 +02:00
/ * *
* Internal dependencies
* /
2021-11-15 13:50:17 +01:00
function BlockManagerCategory ( _ref ) {
let {
title ,
2022-04-12 17:12:47 +02:00
blockTypes
2021-11-15 13:50:17 +01:00
} = _ref ;
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 ;
}
2021-05-07 13:48:27 +02:00
2021-11-15 13:50:17 +01:00
return blockTypes . filter ( _ref2 => {
let {
name
} = _ref2 ;
2022-04-12 17:12:47 +02:00
return ( 0 , external _lodash _namespaceObject . includes ) ( defaultAllowedBlockTypes || [ ] , 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 => {
const blockNames = ( 0 , external _lodash _namespaceObject . map ) ( blockTypes , 'name' ) ;
if ( nextIsChecked ) {
showBlockTypes ( blockNames ) ;
} else {
hideBlockTypes ( blockNames ) ;
}
} , [ blockTypes ] ) ;
2021-05-07 13:48:27 +02:00
2021-05-19 17:09:27 +02:00
if ( ! filteredBlockTypes . length ) {
return null ;
}
2021-05-07 13:48:27 +02:00
2022-04-11 14:04:30 +02:00
const checkedBlockNames = ( 0 , external _lodash _namespaceObject . without ) ( ( 0 , external _lodash _namespaceObject . map ) ( filteredBlockTypes , 'name' ) , ... hiddenBlockTypes ) ;
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 ;
let ariaChecked ;
2021-05-07 13:48:27 +02:00
2021-05-19 17:09:27 +02:00
if ( isAllChecked ) {
ariaChecked = 'true' ;
} else if ( checkedBlockNames . length > 0 ) {
ariaChecked = 'mixed' ;
} else {
ariaChecked = 'false' ;
}
2021-05-07 13:48:27 +02:00
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 , {
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" ,
2021-05-19 17:09:27 +02:00
"aria-checked" : ariaChecked ,
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
}
2022-04-12 17:12:47 +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
* External dependencies
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
2021-05-19 17:09:27 +02:00
/ * *
* Internal dependencies
* /
2021-05-07 13:48:27 +02:00
2021-11-15 13:50:17 +01:00
function BlockManager ( _ref ) {
let {
blockTypes ,
categories ,
hasBlockSupport ,
isMatchingSearchTerm ,
numberOfHiddenBlocks
} = _ref ;
2022-04-12 17:12:47 +02:00
const debouncedSpeak = ( 0 , external _wp _compose _namespaceObject . useDebounce ) ( external _wp _a11y _namespaceObject . speak , 500 ) ;
2022-04-11 14:04:30 +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.
2021-11-08 15:29:21 +01:00
2022-04-12 17:12:47 +02:00
blockTypes = blockTypes . filter ( blockType => hasBlockSupport ( blockType , 'inserter' , true ) && ( ! search || isMatchingSearchTerm ( blockType , search ) ) && ( ! blockType . parent || ( 0 , external _lodash _namespaceObject . includes ) ( blockType . parent , 'core/post-content' ) ) ) ; // Announce search results on change
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
if ( ! search ) {
return ;
}
const count = blockTypes . length ;
const resultsFoundMessage = ( 0 , external _wp _i18n _namespaceObject . sprintf ) (
/* translators: %d: number of results. */
( 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"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _i18n _namespaceObject . sprintf ) (
2021-05-19 17:09:27 +02:00
/* translators: %d: number of blocks. */
2022-04-11 14:04:30 +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 . SearchControl , {
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 ,
2022-04-11 14:04:30 +02:00
blockTypes : ( 0 , external _lodash _namespaceObject . filter ) ( blockTypes , {
2021-05-19 17:09:27 +02:00
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' ) ,
blockTypes : ( 0 , external _lodash _namespaceObject . filter ) ( blockTypes , _ref2 => {
2021-11-15 13:50:17 +01:00
let {
category
} = _ref2 ;
return ! category ;
} )
2021-05-19 17:09:27 +02:00
} ) ) ) ;
}
2021-05-07 13:48:27 +02:00
2022-04-11 14:04:30 +02:00
/* harmony default export */ var block _manager = ( ( 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
2022-04-11 14:04:30 +02:00
} = select ( store _store ) ;
2022-04-12 17:12:47 +02:00
const hiddenBlockTypes = getHiddenBlockTypes ( ) ;
2022-04-11 14:04:30 +02:00
const numberOfHiddenBlocks = ( 0 , external _lodash _namespaceObject . isArray ) ( hiddenBlockTypes ) && hiddenBlockTypes . length ;
2021-05-19 17:09:27 +02:00
return {
2021-11-08 15:29:21 +01:00
blockTypes : getBlockTypes ( ) ,
categories : getCategories ( ) ,
hasBlockSupport ,
isMatchingSearchTerm ,
numberOfHiddenBlocks
2021-05-19 17:09:27 +02:00
} ;
2021-11-08 15:29:21 +01:00
} ) ( 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
2020-01-08 12:57:23 +01:00
/ * *
2021-05-19 17:09:27 +02:00
* External dependencies
2020-01-08 12:57:23 +01:00
* /
2019-09-19 17:19:18 +02: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
/ * *
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
2021-05-19 17:09:27 +02:00
const preferences _modal _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
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 {
isModalActive ,
isViewable
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 {
getPostType
2022-04-11 14:04:30 +02:00
} = select ( external _wp _coreData _namespaceObject . store ) ;
2021-05-19 17:09:27 +02:00
const postType = getPostType ( getEditedPostAttribute ( 'type' ) ) ;
return {
2022-04-11 14:04:30 +02:00
isModalActive : select ( store _store ) . isModalActive ( preferences _modal _MODAL _NAME ) ,
isViewable : ( 0 , external _lodash _namespaceObject . get ) ( postType , [ 'viewable' ] , false )
2021-05-19 17:09:27 +02:00
} ;
} , [ ] ) ;
2022-04-11 14:04:30 +02:00
const 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 ) ;
2021-05-19 17:09:27 +02:00
const mode = getEditorMode ( ) ;
const isRichEditingEnabled = getEditorSettings ( ) . richEditingEnabled ;
const hasReducedUI = isFeatureActive ( 'reducedUI' ) ;
return ! hasReducedUI && isLargeViewport && isRichEditingEnabled && mode === 'visual' ;
} , [ isLargeViewport ] ) ;
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 , {
2021-05-19 17:09:27 +02:00
featureName : "reducedUI" ,
2022-04-11 14:04:30 +02:00
help : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Compacts options and outlines in the toolbar.' ) ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Reduce the interface' )
} ) , ( 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-04-11 14:04:30 +02:00
help : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Shows text instead of icons.' ) ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Display button labels' )
} ) , ( 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.' )
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( enable _plugin _document _setting _panel . Slot , null ) , isViewable && ( 0 , external _wp _element _namespaceObject . createElement ) ( enable _panel , {
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Permalink' ) ,
2021-05-19 17:09:27 +02:00
panelName : "post-link"
2022-04-11 14:04:30 +02:00
} ) , isViewable && ( 0 , external _wp _element _namespaceObject . createElement ) ( enable _panel , {
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Template' ) ,
2021-05-19 17:09:27 +02:00
panelName : "template"
2022-04-11 14:04:30 +02:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostTaxonomies , {
taxonomyWrapper : ( content , taxonomy ) => ( 0 , external _wp _element _namespaceObject . createElement ) ( enable _panel , {
label : ( 0 , external _lodash _namespaceObject . get ) ( 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-04-12 17:12:47 +02:00
} ] , [ isViewable , isLargeViewport , showBlockBreadcrumbsOption ] ) ;
2020-06-26 15:33:47 +02:00
2021-05-19 17:09:27 +02:00
if ( ! isModalActive ) {
return null ;
}
2020-06-26 15:33:47 +02:00
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
2021-05-19 17:09:27 +02:00
/ * *
* Returns the Post ' s Edit URL .
*
* @ param { number } postId Post ID .
*
* @ return { string } Post edit URL .
* /
2020-07-07 16:43:35 +02:00
2021-05-19 17:09:27 +02:00
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'
} ) ;
}
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
* /
2020-06-26 15:33:47 +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
} ;
}
2018-12-14 05:41:57 +01:00
2021-05-19 17:09:27 +02:00
componentDidUpdate ( prevProps ) {
const {
postId ,
postStatus ,
postType ,
isSavingPost
} = this . props ;
const {
historyId
} = this . state ; // Posts are still dirty while saving so wait for saving to finish
// to avoid the unsaved changes warning when trashing posts.
if ( postStatus === 'trash' && ! isSavingPost ) {
this . setTrashURL ( postId , postType ) ;
return ;
}
2018-12-14 05:41:57 +01:00
2021-05-19 17:09:27 +02:00
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
}
/ * *
* 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
* /
2021-04-15 17:19:43 +02:00
2020-01-08 12:57:23 +01:00
2021-05-19 17:09:27 +02:00
setTrashURL ( postId , postType ) {
window . location . href = getPostTrashedURL ( postId , postType ) ;
}
/ * *
* 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 .
* /
2020-01-08 12:57:23 +01:00
2018-12-14 05:41:57 +01:00
2021-05-19 17:09:27 +02:00
setBrowserURL ( postId ) {
window . history . replaceState ( {
id : postId
} , 'Post ' + postId , getPostEditURL ( postId ) ) ;
this . setState ( ( ) => ( {
historyId : postId
} ) ) ;
}
2018-12-14 05:41:57 +01:00
2021-05-19 17:09:27 +02:00
render ( ) {
return null ;
}
2018-12-14 05:41:57 +01:00
2021-05-07 13:48:27 +02:00
}
2022-04-11 14:04:30 +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 ) ;
2018-12-14 05:41:57 +01:00
2021-05-19 17:09:27 +02:00
if ( isTemplate ) {
id = post . wp _id ;
}
2018-12-14 05:41:57 +01:00
2021-05-19 17:09:27 +02:00
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"
} ) ) ;
/* 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
2020-01-08 12:57:23 +01: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
2022-04-12 17:12:47 +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
2018-12-14 05:41:57 +01:00
2021-11-15 13:50:17 +01:00
function FullscreenModeClose ( _ref ) {
let {
showTooltip ,
icon ,
href
} = _ref ;
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 ) ( ) ;
2018-12-14 05:41:57 +01:00
2021-05-19 17:09:27 +02:00
if ( ! isActive || ! postType ) {
2021-05-07 13:48:27 +02:00
return null ;
}
2018-12-14 05:41:57 +01:00
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
}
}
} ;
2018-12-14 05:41:57 +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
}
2018-12-14 05:41:57 +01:00
2021-05-19 17:09:27 +02:00
if ( isRequestingSiteIcon ) {
buttonIcon = null ;
} // Override default icon if custom icon is provided via props.
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
} ) ,
2022-04-11 14:04:30 +02:00
label : ( 0 , external _lodash _namespaceObject . get ) ( postType , [ 'labels' , 'view_items' ] , ( 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
}
2018-12-14 05:41:57 +01:00
2021-05-19 17:09:27 +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 , {
d : "M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"
} ) ) ;
/* harmony default export */ var list _view = ( listView ) ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/plus.js
2021-05-21 12:14:23 +02:00
2021-05-19 17:09:27 +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"
} ) ) ;
/* harmony default export */ var library _plus = ( plus ) ;
; // 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
2021-05-21 12:14:23 +02:00
/ * *
* Internal dependencies
* /
2021-06-25 17:52:22 +02:00
2021-11-08 15:29:21 +01:00
const preventDefault = event => {
event . preventDefault ( ) ;
} ;
2021-06-25 17:52:22 +02:00
function HeaderToolbar ( ) {
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 ,
listViewShortcut
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 ) ;
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 ( ) ,
2021-11-08 15:29:21 +01:00
listViewShortcut : getShortcutRepresentation ( 'core/edit-post/toggle-list-view' )
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' ) ;
2021-06-25 17:52:22 +02:00
/* translators: accessibility text for the editor toolbar */
2021-05-21 12:14:23 +02:00
2022-04-11 14:04:30 +02:00
const toolbarAriaLabel = ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Document tools' ) ;
2021-05-21 12:14:23 +02:00
2022-04-11 14:04:30 +02:00
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 _editor _namespaceObject . TableOfContents ,
2021-06-25 17:52:22 +02:00
hasOutlineItemsDisabled : isTextModeEnabled ,
repositionDropdown : showIconLabels && ! isWideViewport ,
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 _components _namespaceObject . Button ,
2021-06-25 17:52:22 +02:00
className : "edit-post-header-toolbar__list-view-toggle" ,
2022-04-11 14:04:30 +02:00
icon : list _view ,
2021-06-25 17:52:22 +02:00
disabled : isTextModeEnabled ,
isPressed : isListViewOpen
/* translators: button label text should, if possible, be under 16 characters. */
,
2022-04-11 14:04:30 +02:00
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'List View' ) ,
2021-11-08 15:29:21 +01:00
onClick : toggleListView ,
2021-06-25 17:52:22 +02:00
shortcut : listViewShortcut ,
showTooltip : ! showIconLabels
} ) ) ;
2022-04-11 14:04:30 +02:00
const openInserter = ( 0 , external _wp _element _namespaceObject . useCallback ) ( ( ) => {
2021-11-08 15:29:21 +01:00
if ( isInserterOpened ) {
2022-04-12 17:12:47 +02:00
// Focusing the inserter button closes the inserter popover.
2021-11-08 15:29:21 +01:00
inserterButton . current . focus ( ) ;
} else {
setIsInserterOpened ( true ) ;
}
} , [ isInserterOpened , setIsInserterOpened ] ) ;
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" ,
"aria-label" : toolbarAriaLabel
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 ,
onClick : openInserter ,
2021-06-25 17:52:22 +02:00
disabled : ! isInserterEnabled ,
2022-04-11 14:04:30 +02:00
icon : library _plus
2021-06-25 17:52:22 +02:00
/ * t r a n s l a t o r s : b u t t o n l a b e l t e x t s h o u l d , i f p o s s i b l e , b e u n d e r 1 6
characters . * /
,
2022-04-11 14:04:30 +02:00
label : ( 0 , external _wp _i18n _namespaceObject . _x ) ( 'Toggle block inserter' , 'Generic label for block inserter button' ) ,
2021-06-25 17:52:22 +02:00
showTooltip : ! showIconLabels
2022-04-11 14:04:30 +02:00
} , showIconLabels && ( ! isInserterOpened ? ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Add' ) : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Close' ) ) ) , ( isWideViewport || ! showIconLabels ) && ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , isLargeViewport && ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . ToolbarItem , {
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
}
2021-06-25 17:52:22 +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
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
} ] ;
2021-05-21 12:14:23 +02:00
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 ) ;
2021-05-21 12:14:23 +02:00
2022-01-04 06:39:28 +01:00
if ( isEditingTemplate ) {
return null ;
}
2021-06-25 17:52:22 +02:00
if ( ! isRichEditingEnabled || ! isCodeEditingEnabled ) {
return null ;
2021-05-21 12:14:23 +02:00
}
2021-06-25 17:52:22 +02:00
const choices = MODES . map ( choice => {
if ( choice . value !== mode ) {
return { ... choice ,
shortcut
} ;
2021-05-21 12:14:23 +02:00
}
2021-06-15 17:30:24 +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 ,
value : mode ,
onSelect : switchEditorMode
} ) ) ;
}
/* harmony default export */ var mode _switcher = ( ModeSwitcher ) ;
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
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
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 . MenuItem , {
2021-06-25 17:52:22 +02:00
onClick : ( ) => {
openModal ( 'edit-post/preferences' ) ;
}
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-05-19 17:09:27 +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
function WritingMenu ( ) {
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" ,
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' ) ,
info : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Work without distraction' ) ,
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' )
2021-06-25 17:52:22 +02:00
} ) ) ;
2020-01-08 12:57:23 +01:00
}
2018-12-14 05:41:57 +01:00
2021-06-25 17:52:22 +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-03-21 13:48:00 +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
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
2021-05-21 12:14:23 +02:00
2021-11-15 13:50:17 +01:00
const MoreMenu = _ref => {
let {
showIconLabels
} = _ref ;
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
}
2021-11-15 13:50:17 +01:00
} , _ref2 => {
let {
2021-06-25 17:52:22 +02:00
onClose
2021-11-15 13:50:17 +01:00
} = _ref2 ;
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , showIconLabels && ! isLargeViewport && ( 0 , external _wp _element _namespaceObject . createElement ) ( pinned _items . Slot , {
2021-11-15 13:50:17 +01:00
className : showIconLabels && 'show-icon-labels' ,
scope : "core/edit-post"
2022-04-11 14:04:30 +02:00
} ) , ( 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 , {
2021-11-15 13:50:17 +01:00
name : "core/edit-post/plugin-more-menu" ,
2022-04-11 14:04:30 +02:00
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Plugins' ) ,
as : external _wp _components _namespaceObject . MenuGroup ,
2021-11-15 13:50:17 +01:00
fillProps : {
onClick : onClose
}
2022-04-11 14:04:30 +02:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( tools _more _menu _group . Slot , {
2021-11-15 13:50:17 +01:00
fillProps : {
onClose
}
2022-04-11 14:04:30 +02:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . MenuGroup , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( PreferencesMenuItem , null ) ) ) ;
2021-11-15 13:50:17 +01:00
} ) ;
2021-06-25 17:52:22 +02:00
} ;
2021-01-28 03:04:13 +01:00
2021-06-25 17:52:22 +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
2020-06-26 15:33:47 +02:00
2021-06-25 17:52:22 +02:00
/ * *
* External dependencies
* /
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
2019-03-21 13:48:00 +01: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
* /
2021-11-15 13:50:17 +01:00
function PostPublishButtonOrToggle ( _ref ) {
let {
forceIsDirty ,
forceIsSaving ,
hasPublishAction ,
isBeingScheduled ,
isPending ,
isPublished ,
isPublishSidebarEnabled ,
isPublishSidebarOpened ,
isScheduled ,
togglePublishSidebar ,
setEntitiesSavedStatesCallback
} = _ref ;
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 ;
/ * *
* 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 _
* for a particular role ( see https : //wordpress.org/support/article/post-status/):
*
* - 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 ,
forceIsSaving : forceIsSaving ,
isOpen : isPublishSidebarOpened ,
isToggle : component === IS _TOGGLE ,
onToggle : togglePublishSidebar ,
setEntitiesSavedStatesCallback : setEntitiesSavedStatesCallback
} ) ;
}
2022-04-11 14:04:30 +02:00
/* harmony default export */ var post _publish _button _or _toggle = ( ( 0 , external _wp _compose _namespaceObject . compose ) ( ( 0 , external _wp _data _namespaceObject . withSelect ) ( select => ( {
hasPublishAction : ( 0 , external _lodash _namespaceObject . get ) ( select ( external _wp _editor _namespaceObject . store ) . getCurrentPost ( ) , [ '_links' , 'wp:action-publish' ] , 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
/ * *
* Internal dependencies
* /
function DevicePreview ( ) {
const {
hasActiveMetaboxes ,
isPostSaveable ,
isSaving ,
deviceType
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => ( {
hasActiveMetaboxes : select ( store _store ) . hasMetaBoxes ( ) ,
isSaving : select ( store _store ) . isSavingMetaBoxes ( ) ,
isPostSaveable : select ( external _wp _editor _namespaceObject . store ) . isEditedPostSaveable ( ) ,
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 ,
setDeviceType : setPreviewDeviceType
2022-04-11 14:04:30 +02:00
} , ( 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 , {
2021-06-25 17:52:22 +02:00
className : 'edit-post-header-preview__button-external' ,
role : "menuitem" ,
forceIsAutosaveable : hasActiveMetaboxes ,
forcePreviewLink : isSaving ? null : undefined ,
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
2021-06-25 17:52:22 +02:00
} ) )
} ) ) ) ) ;
2021-05-19 17:09:27 +02:00
}
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/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 ;
2019-03-21 13:48:00 +01:00
2021-11-15 13:50:17 +01:00
const main _dashboard _button _Slot = _ref => {
let {
children
} = _ref ;
2022-04-11 14:04:30 +02:00
const slot = ( 0 , external _wp _components _namespaceObject . _ _experimentalUseSlot ) ( slotName ) ;
2021-06-25 17:52:22 +02:00
const hasFills = Boolean ( slot . fills && slot . fills . length ) ;
2019-03-21 13:48:00 +01:00
2021-06-25 17:52:22 +02:00
if ( ! hasFills ) {
return children ;
}
2019-03-21 13:48:00 +01:00
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
} ) ;
} ;
2020-02-10 23:33:27 +01:00
2021-06-25 17:52:22 +02:00
MainDashboardButton . Slot = main _dashboard _button _Slot ;
/* harmony default export */ var main _dashboard _button = ( MainDashboardButton ) ;
2019-10-15 17:37:08 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-down.js
/ * *
* WordPress dependencies
* /
const chevronDown = ( 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 : "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"
} ) ) ;
/* harmony default export */ var chevron _down = ( chevronDown ) ;
2019-03-21 13:48:00 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/template-title/delete-template.js
2020-06-26 15:33:47 +02:00
2021-05-19 17:09:27 +02:00
/ * *
* External dependencies
* /
2020-08-10 16:18:33 +02:00
2021-05-07 13:48:27 +02:00
/ * *
* WordPress dependencies
* /
2019-10-15 17:37:08 +02:00
2020-02-06 22:03:31 +01:00
2019-10-15 17:37:08 +02:00
2020-01-08 12:57:23 +01:00
2022-04-12 17:12:47 +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
* /
2021-06-25 17:52:22 +02:00
function DeleteTemplate ( ) {
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 ) ;
2021-06-25 17:52:22 +02:00
const {
getEditorSettings
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( external _wp _editor _namespaceObject . store ) ;
2021-06-25 17:52:22 +02:00
const {
updateEditorSettings ,
editPost
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _editor _namespaceObject . store ) ;
2021-06-25 17:52:22 +02:00
const {
deleteEntityRecord
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _coreData _namespaceObject . store ) ;
2021-06-25 17:52:22 +02:00
const {
template
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-05-07 13:48:27 +02:00
2021-06-25 17:52:22 +02:00
const _isEditing = isEditingTemplate ( ) ;
2021-05-07 13:48:27 +02:00
2021-06-25 17:52:22 +02:00
return {
template : _isEditing ? getEditedPostTemplate ( ) : null
} ;
} , [ ] ) ;
2022-04-12 17:12:47 +02:00
const [ showConfirmDialog , setShowConfirmDialog ] = ( 0 , external _wp _element _namespaceObject . useState ) ( false ) ;
2020-01-08 12:57:23 +01:00
2021-06-25 17:52:22 +02:00
if ( ! template || ! template . wp _id ) {
return null ;
2021-05-19 17:09:27 +02:00
}
2021-01-28 03:04:13 +01:00
2021-06-25 17:52:22 +02:00
let templateTitle = template . slug ;
2021-05-19 17:09:27 +02:00
2021-06-25 17:52:22 +02:00
if ( template !== null && template !== void 0 && template . title ) {
templateTitle = template . title ;
2021-05-19 17:09:27 +02:00
}
2022-04-12 17:12:47 +02:00
const onDelete = ( ) => {
clearSelectedBlock ( ) ;
setIsEditingTemplate ( false ) ;
setShowConfirmDialog ( false ) ;
editPost ( {
template : ''
} ) ;
const settings = getEditorSettings ( ) ;
const newAvailableTemplates = ( 0 , external _lodash _namespaceObject . pickBy ) ( settings . availableTemplates , ( _title , id ) => {
return id !== template . slug ;
} ) ;
updateEditorSettings ( { ... settings ,
availableTemplates : newAvailableTemplates
} ) ;
deleteEntityRecord ( 'postType' , 'wp_template' , template . id , {
throwOnError : true
} ) ;
} ;
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . MenuGroup , {
2021-06-25 17:52:22 +02:00
className : "edit-post-template-top-area__second-menu-group"
2022-04-12 17:12:47 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . MenuItem , {
2021-06-25 17:52:22 +02:00
className : "edit-post-template-top-area__delete-template-button" ,
isDestructive : true ,
2021-11-08 15:29:21 +01:00
variant : "secondary" ,
2022-04-11 14:04:30 +02:00
"aria-label" : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Delete template' ) ,
2021-06-25 17:52:22 +02:00
onClick : ( ) => {
2022-04-12 17:12:47 +02:00
setShowConfirmDialog ( true ) ;
2021-06-25 17:52:22 +02:00
}
2022-04-12 17:12:47 +02:00
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Delete template' ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _experimentalConfirmDialog , {
isOpen : showConfirmDialog ,
onConfirm : onDelete ,
onCancel : ( ) => {
setShowConfirmDialog ( false ) ;
}
} , ( 0 , external _wp _i18n _namespaceObject . sprintf ) (
/* translators: %s: template name */
( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Are you sure you want to delete the %s template? It may be used by other pages or posts.' ) , templateTitle ) ) ) ) ;
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/template-title/edit-template-title.js
2019-10-15 17:37:08 +02:00
2020-02-06 22:03:31 +01:00
2021-06-25 17:52:22 +02:00
/ * *
* External dependencies
* /
2020-10-20 15:36:16 +02:00
2021-05-19 17:09:27 +02:00
/ * *
* WordPress dependencies
* /
2019-10-15 17:37:08 +02:00
2021-01-28 03:04:13 +01:00
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
2021-06-25 17:52:22 +02:00
2021-05-19 17:09:27 +02:00
/ * *
* Internal dependencies
* /
2018-12-14 05:41:57 +01:00
2021-06-25 17:52:22 +02:00
function EditTemplateTitle ( ) {
const {
template
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
2021-06-25 17:52:22 +02:00
const {
getEditedPostTemplate
2022-04-11 14:04:30 +02:00
} = select ( store _store ) ;
2021-06-25 17:52:22 +02:00
return {
template : getEditedPostTemplate ( )
} ;
} , [ ] ) ;
const {
editEntityRecord
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _coreData _namespaceObject . store ) ;
2021-06-25 17:52:22 +02:00
const {
getEditorSettings
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( external _wp _editor _namespaceObject . store ) ;
2021-06-25 17:52:22 +02:00
const {
updateEditorSettings
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _editor _namespaceObject . store ) ;
2018-12-14 05:41:57 +01:00
2021-12-21 08:02:34 +01:00
if ( template . has _theme _file ) {
return null ;
}
2022-04-11 14:04:30 +02:00
let templateTitle = ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Default' ) ;
2018-12-14 05:41:57 +01:00
2021-06-25 17:52:22 +02:00
if ( template !== null && template !== void 0 && template . title ) {
templateTitle = template . title ;
} else if ( ! ! template ) {
templateTitle = template . slug ;
}
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . TextControl , {
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Title' ) ,
2021-06-25 17:52:22 +02:00
value : templateTitle ,
2022-04-11 14:04:30 +02:00
help : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Give the template a title that indicates its purpose, e.g. "Full Width".' ) ,
2021-06-25 17:52:22 +02:00
onChange : newTitle => {
const settings = getEditorSettings ( ) ;
2022-04-11 14:04:30 +02:00
const newAvailableTemplates = ( 0 , external _lodash _namespaceObject . mapValues ) ( settings . availableTemplates , ( existingTitle , id ) => {
2021-06-25 17:52:22 +02:00
if ( id !== template . slug ) {
return existingTitle ;
}
2019-09-19 17:19:18 +02:00
2021-06-25 17:52:22 +02:00
return newTitle ;
} ) ;
updateEditorSettings ( { ... settings ,
availableTemplates : newAvailableTemplates
} ) ;
editEntityRecord ( 'postType' , 'wp_template' , template . id , {
title : newTitle
} ) ;
}
} ) ;
}
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/template-title/template-description.js
2020-10-13 15:10:30 +02:00
2018-12-14 05:41:57 +01: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
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
* /
2019-10-15 17:37:08 +02:00
2021-01-28 03:04:13 +01:00
2021-06-25 17:52:22 +02:00
function TemplateDescription ( ) {
const {
2021-12-21 08:02:34 +01:00
description ,
title
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
2021-06-25 17:52:22 +02:00
const {
getEditedPostTemplate
2022-04-11 14:04:30 +02:00
} = select ( store _store ) ;
2021-06-25 17:52:22 +02:00
return {
2021-12-21 08:02:34 +01:00
title : getEditedPostTemplate ( ) . title ,
2021-06-25 17:52:22 +02:00
description : getEditedPostTemplate ( ) . description
} ;
} , [ ] ) ;
2019-10-15 17:37:08 +02:00
2021-06-25 17:52:22 +02:00
if ( ! description ) {
return null ;
2021-05-19 17:09:27 +02:00
}
2019-10-15 17:37:08 +02:00
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 ) ( external _wp _components _namespaceObject . _ _experimentalHeading , {
2021-12-21 08:02:34 +01:00
level : 4 ,
weight : 600
2022-04-11 14:04:30 +02:00
} , title ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _experimentalText , {
2021-12-21 08:02:34 +01:00
className : "edit-post-template-details__description" ,
size : "body" ,
as : "p" ,
style : {
marginTop : '12px'
}
} , description ) ) ;
2021-05-19 17:09:27 +02: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/header/template-title/index.js
2021-05-07 13:48:27 +02:00
2021-05-19 17:09:27 +02:00
/ * *
* WordPress dependencies
* /
2019-10-15 17:37:08 +02:00
2018-12-14 05:41:57 +01:00
2020-01-08 12:57:23 +01:00
2021-05-19 17:09:27 +02:00
/ * *
* Internal dependencies
* /
2021-05-07 13:48:27 +02:00
2021-01-28 03:04:13 +01:00
2021-05-07 13:48:27 +02:00
2021-05-19 17:09:27 +02:00
2021-01-28 03:04:13 +01:00
2020-06-26 15:33:47 +02:00
2021-06-25 17:52:22 +02:00
function TemplateTitle ( ) {
const {
template ,
isEditing ,
title
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 {
getEditedPostAttribute
2022-04-11 14:04:30 +02:00
} = select ( external _wp _editor _namespaceObject . store ) ;
2021-06-25 17:52:22 +02:00
const _isEditing = isEditingTemplate ( ) ;
return {
template : _isEditing ? getEditedPostTemplate ( ) : null ,
isEditing : _isEditing ,
2022-04-11 14:04:30 +02:00
title : getEditedPostAttribute ( 'title' ) ? getEditedPostAttribute ( 'title' ) : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Untitled' )
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 ) ;
2021-06-25 17:52:22 +02:00
if ( ! isEditing || ! template ) {
return null ;
2021-05-19 17:09:27 +02:00
}
2020-06-26 15:33:47 +02:00
2022-04-11 14:04:30 +02:00
let templateTitle = ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Default' ) ;
2020-06-26 15:33:47 +02:00
2021-06-25 17:52:22 +02:00
if ( template !== null && template !== void 0 && template . title ) {
templateTitle = template . title ;
} else if ( ! ! template ) {
templateTitle = template . slug ;
}
2021-12-21 08:02:34 +01:00
const hasOptions = ! ! ( template . custom || template . wp _id || template . description ) ;
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
2021-06-25 17:52:22 +02:00
className : "edit-post-template-top-area"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
2021-06-25 17:52:22 +02:00
className : "edit-post-template-post-title" ,
isLink : true ,
showTooltip : true ,
2022-04-11 14:04:30 +02:00
label : ( 0 , external _wp _i18n _namespaceObject . sprintf ) (
2021-06-25 17:52:22 +02:00
/* translators: %s: Title of the referring post, e.g: "Hello World!" */
2022-04-11 14:04:30 +02:00
( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Edit %s' ) , title ) ,
2021-06-25 17:52:22 +02:00
onClick : ( ) => {
clearSelectedBlock ( ) ;
setIsEditingTemplate ( false ) ;
}
2022-04-11 14:04:30 +02:00
} , title ) , hasOptions ? ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Dropdown , {
2021-06-25 17:52:22 +02:00
position : "bottom center" ,
contentClassName : "edit-post-template-top-area__popover" ,
2021-11-15 13:50:17 +01:00
renderToggle : _ref => {
let {
onToggle
} = _ref ;
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
2021-11-15 13:50:17 +01:00
className : "edit-post-template-title" ,
isLink : true ,
2022-04-11 14:04:30 +02:00
icon : chevron _down ,
2021-11-15 13:50:17 +01:00
showTooltip : true ,
onClick : onToggle ,
2022-04-11 14:04:30 +02:00
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Template Options' )
2021-11-15 13:50:17 +01:00
} , templateTitle ) ;
} ,
2022-04-11 14:04:30 +02:00
renderContent : ( ) => ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( EditTemplateTitle , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( TemplateDescription , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( DeleteTemplate , null ) )
} ) : ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _experimentalText , {
2021-12-21 08:02:34 +01:00
className : "edit-post-template-title" ,
size : "body" ,
style : {
lineHeight : '24px'
}
} , templateTitle ) ) ;
2021-06-25 17:52:22 +02:00
}
/* harmony default export */ var template _title = ( TemplateTitle ) ;
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
2020-10-13 15:10:30 +02:00
2021-05-19 17:09:27 +02:00
/ * *
* External dependencies
* /
2021-01-28 03:04:13 +01: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
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
2021-06-25 17:52:22 +02:00
2021-11-15 13:50:17 +01:00
function Header ( _ref ) {
let {
setEntitiesSavedStatesCallback
} = _ref ;
2021-05-19 17:09:27 +02:00
const {
hasActiveMetaboxes ,
isPublishSidebarOpened ,
isSaving ,
showIconLabels ,
hasReducedUI
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 ( ) ,
isSaving : select ( store _store ) . isSavingMetaBoxes ( ) ,
showIconLabels : select ( store _store ) . isFeatureActive ( 'showIconLabels' ) ,
hasReducedUI : select ( store _store ) . isFeatureActive ( 'reducedUI' )
2021-05-19 17:09:27 +02:00
} ) , [ ] ) ;
2022-04-11 14:04:30 +02:00
const isLargeViewport = ( 0 , external _wp _compose _namespaceObject . useViewportMatch ) ( 'large' ) ;
2021-05-19 17:09:27 +02:00
const classes = classnames _default ( ) ( 'edit-post-header' , {
'has-reduced-ui' : hasReducedUI
} ) ;
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
2021-05-19 17:09:27 +02:00
className : classes
2022-04-12 17:12:47 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( main _dashboard _button . Slot , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( fullscreen _mode _close , {
showTooltip : true
} ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
2021-05-19 17:09:27 +02:00
className : "edit-post-header__toolbar"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( header _toolbar , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( template _title , null ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
2021-05-19 17:09:27 +02:00
className : "edit-post-header__settings"
} , ! isPublishSidebarOpened && // This button isn't completely hidden by the publish sidebar.
// 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 ,
forceIsSaving : isSaving ,
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 , {
2021-05-19 17:09:27 +02:00
forceIsAutosaveable : hasActiveMetaboxes ,
forcePreviewLink : isSaving ? null : undefined
2022-04-11 14:04:30 +02:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( post _publish _button _or _toggle , {
2021-05-19 17:09:27 +02:00
forceIsDirty : hasActiveMetaboxes ,
forceIsSaving : isSaving ,
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
} ) ) ) ;
}
2021-05-07 13:48:27 +02:00
2021-05-19 17:09:27 +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"
} ) ) ;
/* 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
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 ( ) ;
} , [ ] ) ;
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , _extends ( {
2021-05-21 12:14:23 +02:00
ref : inserterDialogRef
} , inserterDialogProps , {
className : "edit-post-editor__inserter-panel"
2022-04-12 17:12:47 +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
} ) ) ) ;
}
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
* /
/ * *
* Internal dependencies
* /
function ListViewSidebar ( ) {
const {
setIsListViewOpened
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
const focusOnMountRef = ( 0 , external _wp _compose _namespaceObject . useFocusOnMount ) ( 'firstElement' ) ;
2022-04-12 17:12:47 +02:00
const headerFocusReturnRef = ( 0 , external _wp _compose _namespaceObject . useFocusReturn ) ( ) ;
const contentFocusReturnRef = ( 0 , external _wp _compose _namespaceObject . useFocusReturn ) ( ) ;
2021-05-21 12:14:23 +02:00
function closeOnEscape ( 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 ( ) ;
2021-05-21 12:14:23 +02:00
setIsListViewOpened ( false ) ;
}
}
2022-04-11 14:04:30 +02:00
const instanceId = ( 0 , external _wp _compose _namespaceObject . useInstanceId ) ( ListViewSidebar ) ;
2021-05-21 12:14:23 +02:00
const labelId = ` edit-post-editor__list-view-panel-label- ${ instanceId } ` ;
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" , {
2021-05-21 12:14:23 +02:00
"aria-labelledby" : labelId ,
className : "edit-post-editor__list-view-panel" ,
onKeyDown : closeOnEscape
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
2022-04-12 17:12:47 +02:00
className : "edit-post-editor__list-view-panel-header" ,
ref : headerFocusReturnRef
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( "strong" , {
2021-05-21 12:14:23 +02:00
id : labelId
2022-04-12 17:12:47 +02:00
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'List View' ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
2022-04-11 14:04:30 +02:00
icon : close _small ,
2022-04-12 17:12:47 +02:00
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Close List View Sidebar' ) ,
2021-05-21 12:14:23 +02:00
onClick : ( ) => setIsListViewOpened ( 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__list-view-panel-content" ,
2022-04-12 17:12:47 +02:00
ref : ( 0 , external _wp _compose _namespaceObject . useMergeRefs ) ( [ contentFocusReturnRef , focusOnMountRef ] )
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . _ _experimentalListView , {
2021-05-21 12:14:23 +02:00
showNestedBlocks : true ,
2021-11-08 15:29:21 +01:00
_ _experimentalFeatures : true ,
2021-05-21 12:14:23 +02:00
_ _experimentalPersistentListViewFeatures : true
} ) ) )
) ;
}
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/cog.js
2018-12-18 04:14:52 +01:00
2019-03-07 10:09:59 +01:00
2019-10-15 17:37:08 +02:00
/ * *
* WordPress dependencies
* /
2019-03-07 10:09:59 +01:00
2022-04-11 14:04:30 +02:00
const cog = ( 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 : "M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z" ,
clipRule : "evenodd"
} ) ) ;
/* harmony default export */ var library _cog = ( cog ) ;
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-11-08 15:29:21 +01:00
2021-05-07 13:48:27 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* WordPress dependencies
* /
/ * *
* Internal dependencies
2021-05-07 13:48:27 +02:00
* /
2021-11-15 13:50:17 +01:00
const SettingsHeader = _ref => {
let {
sidebarName
} = _ref ;
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-07 13:48:27 +02:00
2021-05-19 17:09:27 +02:00
const openDocumentSettings = ( ) => openGeneralSidebar ( 'edit-post/document' ) ;
2021-05-07 13:48:27 +02:00
2021-05-19 17:09:27 +02:00
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
} ;
} , [ ] ) ;
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 , '' ] ;
2021-05-19 17:09:27 +02:00
const [ blockAriaLabel , blockActiveClass ] = sidebarName === 'edit-post/block' ? // translators: ARIA label for the Block Settings Sidebar tab, selected.
2022-04-11 14:04:30 +02:00
[ ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Block (selected)' ) , 'is-active' ] : // translators: ARIA label for the Block Settings Sidebar tab, not selected.
[ ( 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
/* 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 } ` ,
"aria-label" : blockAriaLabel // translators: Data label for the Block Settings Sidebar tab.
,
2022-04-11 14:04:30 +02:00
"data-label" : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Block' )
2021-05-19 17:09:27 +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
} ;
/* 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
2021-05-19 17:09:27 +02:00
function PostVisibility ( ) {
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostVisibilityCheck , {
2021-11-15 13:50:17 +01:00
render : _ref => {
let {
canEdit
} = _ref ;
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . PanelRow , {
2021-11-15 13:50:17 +01:00
className : "edit-post-post-visibility"
2022-04-11 14:04:30 +02:00
} , ( 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 , {
2021-11-15 13:50:17 +01:00
position : "bottom left" ,
contentClassName : "edit-post-post-visibility__dialog" ,
renderToggle : _ref2 => {
let {
isOpen ,
onToggle
} = _ref2 ;
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
2021-11-15 13:50:17 +01:00
"aria-expanded" : isOpen ,
className : "edit-post-post-visibility__toggle" ,
onClick : onToggle ,
variant : "tertiary"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostVisibilityLabel , null ) ) ;
2021-11-15 13:50:17 +01:00
} ,
2022-04-11 14:04:30 +02:00
renderContent : ( ) => ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostVisibility , null )
2021-11-15 13:50:17 +01:00
} ) ) ;
}
2021-05-19 17:09:27 +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
2020-01-08 12:57:23 +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
2020-10-13 15:10:30 +02:00
2021-05-19 17:09:27 +02:00
function PostTrash ( ) {
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostTrashCheck , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . PanelRow , 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-04-11 14:04:30 +02:00
const anchorRef = ( 0 , external _wp _element _namespaceObject . useRef ) ( ) ;
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" ,
ref : anchorRef
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 , {
2021-05-19 17:09:27 +02:00
popoverProps : {
anchorRef : anchorRef . current
} ,
position : "bottom left" ,
contentClassName : "edit-post-post-schedule__dialog" ,
2021-11-15 13:50:17 +01:00
renderToggle : _ref => {
let {
onToggle ,
isOpen
} = _ref ;
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 ) ( external _wp _components _namespaceObject . Button , {
2021-11-15 13:50:17 +01:00
className : "edit-post-post-schedule__toggle" ,
onClick : onToggle ,
"aria-expanded" : isOpen ,
variant : "tertiary"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostScheduleLabel , null ) ) ) ;
2021-11-15 13:50:17 +01:00
} ,
2022-04-11 14:04:30 +02:00
renderContent : ( ) => ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostSchedule , null )
2021-05-19 17:09:27 +02:00
} ) ) ) ;
}
/* harmony default export */ var post _schedule = ( PostSchedule ) ;
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-sticky/index.js
2018-12-18 04:14:52 +01:00
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
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
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
}
/* harmony default export */ var post _sticky = ( PostSticky ) ;
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
}
/* 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-04-11 14:04:30 +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 , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostSlug , null ) ) ) ;
2021-05-19 17:09:27 +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
2018-12-14 05:41:57 +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-04-11 14:04:30 +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 , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostFormat , null ) ) ) ;
2021-05-19 17:09:27 +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
}
/* 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-07 13:48:27 +02:00
2021-05-19 17:09:27 +02:00
/ * *
* Defines as extensibility slot for the Status & visibility panel .
* /
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' ) ;
2021-05-19 17:09:27 +02:00
/ * *
* Renders a row in the Status & visibility panel of the Document sidebar .
* 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 .
* /
2018-12-18 04:14:52 +01:00
2021-11-15 13:50:17 +01:00
const PluginPostStatusInfo = _ref => {
let {
children ,
className
} = _ref ;
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( plugin _post _status _info _Fill , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . PanelRow , {
2021-11-15 13:50:17 +01:00
className : className
} , children ) ) ;
} ;
2021-05-07 13:48:27 +02:00
2021-05-19 17:09:27 +02:00
PluginPostStatusInfo . Slot = plugin _post _status _info _Slot ;
/* harmony default export */ var plugin _post _status _info = ( PluginPostStatusInfo ) ;
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-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
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
2021-05-19 17:09:27 +02:00
/ * *
* Module Constants
* /
2021-05-07 13:48:27 +02:00
2021-05-19 17:09:27 +02:00
const PANEL _NAME = 'post-status' ;
2021-05-07 13:48:27 +02:00
2021-11-15 13:50:17 +01:00
function PostStatus ( _ref ) {
let {
isOpened ,
onTogglePanel
} = _ref ;
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-04-11 14:04:30 +02:00
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Status & visibility' ) ,
2021-01-28 03:04:13 +01:00
opened : isOpened ,
onToggle : onTogglePanel
2022-04-11 14:04:30 +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 ) ( post _schedule , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( post _format , 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 _slug , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( post _author , null ) , fills , ( 0 , external _wp _element _namespaceObject . createElement ) ( PostTrash , null ) ) ) ) ;
2020-01-08 12:57:23 +01:00
}
2022-04-11 14:04:30 +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 )
} ;
2022-04-11 14:04:30 +02:00
} ) , ( 0 , external _wp _compose _namespaceObject . ifCondition ) ( _ref2 => {
2021-11-15 13:50:17 +01:00
let {
isRemoved
} = _ref2 ;
return ! isRemoved ;
2022-04-11 14:04:30 +02:00
} ) , ( 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
}
2018-12-18 04:14:52 +01:00
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
2019-03-07 10:09:59 +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
}
2021-05-19 17:09:27 +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
2019-10-15 17:37:08 +02:00
/ * *
2021-05-19 17:09:27 +02:00
* External dependencies
2019-10-15 17:37:08 +02:00
* /
2018-12-14 05:41:57 +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
2019-03-21 13:48:00 +01:00
2021-01-28 03:04:13 +01:00
2021-11-15 13:50:17 +01:00
function TaxonomyPanel ( _ref ) {
let {
isEnabled ,
taxonomy ,
isOpened ,
onTogglePanel ,
children
} = _ref ;
2021-05-19 17:09:27 +02:00
if ( ! isEnabled ) {
return null ;
}
2021-01-28 03:04:13 +01:00
2022-04-11 14:04:30 +02:00
const taxonomyMenuName = ( 0 , external _lodash _namespaceObject . get ) ( taxonomy , [ 'labels' , 'menu_name' ] ) ;
2019-03-21 13:48:00 +01:00
2021-05-19 17:09:27 +02:00
if ( ! taxonomyMenuName ) {
return null ;
}
2019-03-21 13:48:00 +01:00
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 ,
onToggle : onTogglePanel
} , children ) ;
}
2018-12-14 05:41:57 +01:00
2022-04-11 14:04:30 +02:00
/* harmony default export */ var taxonomy _panel = ( ( 0 , external _wp _compose _namespaceObject . compose ) ( ( 0 , external _wp _data _namespaceObject . withSelect ) ( ( select , ownProps ) => {
const slug = ( 0 , external _lodash _namespaceObject . get ) ( ownProps . taxonomy , [ 'slug' ] ) ;
2021-05-19 17:09:27 +02:00
const panelName = slug ? ` taxonomy-panel- ${ slug } ` : '' ;
return {
panelName ,
2022-04-11 14:04:30 +02:00
isEnabled : slug ? select ( store _store ) . isEditorPanelEnabled ( panelName ) : false ,
isOpened : slug ? select ( store _store ) . isEditorPanelOpened ( panelName ) : false
2021-05-19 17:09:27 +02:00
} ;
2022-04-11 14:04:30 +02:00
} ) , ( 0 , external _wp _data _namespaceObject . withDispatch ) ( ( dispatch , ownProps ) => ( {
2021-05-19 17:09:27 +02:00
onTogglePanel : ( ) => {
2022-04-11 14:04:30 +02:00
dispatch ( store _store ) . toggleEditorPanelOpened ( ownProps . panelName ) ;
2021-05-19 17:09:27 +02:00
}
} ) ) ) ( 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
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
} ) ) ;
}
2021-01-28 03:04:13 +01:00
2021-05-19 17:09:27 +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
2019-09-19 17:19:18 +02:00
2021-05-07 13:48:27 +02:00
/ * *
2021-05-19 17:09:27 +02:00
* External dependencies
2021-05-07 13:48:27 +02:00
* /
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
2021-11-08 15:29:21 +01: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
* /
2018-12-14 05:41:57 +01:00
2021-05-19 17:09:27 +02:00
const featured _image _PANEL _NAME = 'featured-image' ;
2018-12-18 04:14:52 +01:00
2021-11-15 13:50:17 +01:00
function FeaturedImage ( _ref ) {
let {
isEnabled ,
isOpened ,
postType ,
onTogglePanel
} = _ref ;
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
}
2018-12-14 05:41:57 +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 , {
title : ( 0 , external _lodash _namespaceObject . get ) ( postType , [ 'labels' , 'featured_image' ] , ( 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
}
2018-12-14 05:41:57 +01: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 {
2022-04-11 14:04:30 +02:00
onTogglePanel : ( 0 , external _lodash _namespaceObject . partial ) ( toggleEditorPanelOpened , featured _image _PANEL _NAME )
2021-05-19 17:09:27 +02:00
} ;
} ) ;
2022-04-11 14:04:30 +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
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
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
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' ;
2018-12-14 05:41:57 +01:00
2021-11-15 13:50:17 +01:00
function PostExcerpt ( _ref ) {
let {
isEnabled ,
isOpened ,
onTogglePanel
} = _ref ;
2021-05-19 17:09:27 +02:00
if ( ! isEnabled ) {
return null ;
}
2018-12-14 05:41:57 +01:00
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
}
2019-09-19 17:19:18 +02:00
2022-04-11 14:04:30 +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 ) ,
isOpened : select ( store _store ) . isEditorPanelOpened ( post _excerpt _PANEL _NAME )
2021-05-07 13:48:27 +02:00
} ;
2022-04-11 14:04:30 +02:00
} ) , ( 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 ( post _excerpt _PANEL _NAME ) ;
2021-05-19 17:09:27 +02:00
}
2018-12-14 05:41:57 +01:00
2021-05-19 17:09:27 +02:00
} ) ) ] ) ( PostExcerpt ) ) ;
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-link/index.js
2021-05-19 17:09:27 +02:00
/ * *
* External dependencies
* /
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
/ * *
2019-10-15 17:37:08 +02:00
* WordPress dependencies
2018-12-18 04:14:52 +01:00
* /
2018-12-14 05:41:57 +01:00
2019-10-15 17:37:08 +02:00
2021-05-19 17:09:27 +02:00
2021-11-08 15:29:21 +01: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
* /
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 _link _PANEL _NAME = 'post-link' ;
2018-12-14 05:41:57 +01:00
2021-11-15 13:50:17 +01:00
function PostLink ( _ref ) {
let {
isOpened ,
onTogglePanel ,
isEditable ,
postLink ,
permalinkPrefix ,
permalinkSuffix ,
editPermalink ,
postSlug ,
postTypeLabel
} = _ref ;
2022-04-11 14:04:30 +02:00
const [ forceEmptyField , setForceEmptyField ] = ( 0 , external _wp _element _namespaceObject . useState ) ( false ) ;
2021-05-19 17:09:27 +02:00
let prefixElement , postNameElement , suffixElement ;
2018-12-14 05:41:57 +01:00
2021-05-19 17:09:27 +02:00
if ( isEditable ) {
2022-04-11 14:04:30 +02:00
prefixElement = permalinkPrefix && ( 0 , external _wp _element _namespaceObject . createElement ) ( "span" , {
2021-05-19 17:09:27 +02:00
className : "edit-post-post-link__link-prefix"
} , permalinkPrefix ) ;
2022-04-11 14:04:30 +02:00
postNameElement = postSlug && ( 0 , external _wp _element _namespaceObject . createElement ) ( "span" , {
2021-05-19 17:09:27 +02:00
className : "edit-post-post-link__link-post-name"
} , postSlug ) ;
2022-04-11 14:04:30 +02:00
suffixElement = permalinkSuffix && ( 0 , external _wp _element _namespaceObject . createElement ) ( "span" , {
2021-05-19 17:09:27 +02:00
className : "edit-post-post-link__link-suffix"
} , permalinkSuffix ) ;
}
2018-12-14 05:41:57 +01:00
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . PanelBody , {
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Permalink' ) ,
2021-05-19 17:09:27 +02:00
opened : isOpened ,
onToggle : onTogglePanel
2022-04-11 14:04:30 +02:00
} , isEditable && ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
2021-05-19 17:09:27 +02:00
className : "editor-post-link"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . TextControl , {
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'URL Slug' ) ,
2021-05-19 17:09:27 +02:00
value : forceEmptyField ? '' : postSlug ,
2021-11-08 15:29:21 +01:00
autoComplete : "off" ,
spellCheck : "false" ,
2021-05-19 17:09:27 +02:00
onChange : newValue => {
editPermalink ( newValue ) ; // When we delete the field the permalink gets
// reverted to the original value.
// The forceEmptyField logic allows the user to have
// the field temporarily empty while typing.
2019-10-15 17:37:08 +02:00
2021-05-19 17:09:27 +02:00
if ( ! newValue ) {
if ( ! forceEmptyField ) {
2021-11-08 15:29:21 +01:00
setForceEmptyField ( true ) ;
2021-05-19 17:09:27 +02:00
}
2021-01-28 03:04:13 +01:00
2021-05-19 17:09:27 +02:00
return ;
}
2021-01-28 03:04:13 +01:00
2021-05-19 17:09:27 +02:00
if ( forceEmptyField ) {
2021-11-08 15:29:21 +01:00
setForceEmptyField ( false ) ;
2021-05-19 17:09:27 +02:00
}
} ,
onBlur : event => {
2022-04-12 17:12:47 +02:00
editPermalink ( ( 0 , external _wp _url _namespaceObject . cleanForSlug ) ( event . target . value ) ) ;
2019-10-15 17:37:08 +02:00
2021-05-19 17:09:27 +02:00
if ( forceEmptyField ) {
2021-11-08 15:29:21 +01:00
setForceEmptyField ( false ) ;
2021-05-19 17:09:27 +02:00
}
}
2022-04-11 14:04:30 +02:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "p" , null , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'The last part of the URL.' ) , ' ' , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . ExternalLink , {
2022-04-12 17:12:47 +02:00
href : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'https://wordpress.org/support/article/settings-sidebar/#permalink' )
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Read about permalinks' ) ) ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "h3" , {
2021-05-19 17:09:27 +02:00
className : "edit-post-post-link__preview-label"
2022-04-11 14:04:30 +02:00
} , postTypeLabel || ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'View post' ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
2021-05-19 17:09:27 +02:00
className : "edit-post-post-link__preview-link-container"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . ExternalLink , {
2021-05-19 17:09:27 +02:00
className : "edit-post-post-link__link" ,
href : postLink ,
target : "_blank"
2022-04-11 14:04:30 +02:00
} , isEditable ? ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , prefixElement , postNameElement , suffixElement ) : postLink ) ) ) ;
2018-12-18 04:14:52 +01:00
}
2022-04-11 14:04:30 +02:00
/* harmony default export */ var post _link = ( ( 0 , external _wp _compose _namespaceObject . compose ) ( [ ( 0 , external _wp _data _namespaceObject . withSelect ) ( select => {
2021-05-19 17:09:27 +02:00
const {
isPermalinkEditable ,
getCurrentPost ,
isCurrentPostPublished ,
getPermalinkParts ,
getEditedPostAttribute ,
getEditedPostSlug
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
const {
link
} = getCurrentPost ( ) ;
const postTypeName = getEditedPostAttribute ( 'type' ) ;
const postType = getPostType ( postTypeName ) ;
const permalinkParts = getPermalinkParts ( ) ;
return {
postLink : link ,
isEditable : isPermalinkEditable ( ) ,
isPublished : isCurrentPostPublished ( ) ,
isOpened : isEditorPanelOpened ( post _link _PANEL _NAME ) ,
isEnabled : isEditorPanelEnabled ( post _link _PANEL _NAME ) ,
2022-04-11 14:04:30 +02:00
isViewable : ( 0 , external _lodash _namespaceObject . get ) ( postType , [ 'viewable' ] , false ) ,
postSlug : ( 0 , external _wp _url _namespaceObject . safeDecodeURIComponent ) ( getEditedPostSlug ( ) ) ,
postTypeLabel : ( 0 , external _lodash _namespaceObject . get ) ( postType , [ 'labels' , 'view_item' ] ) ,
2021-05-19 17:09:27 +02:00
hasPermalinkParts : ! ! permalinkParts ,
permalinkPrefix : permalinkParts === null || permalinkParts === void 0 ? void 0 : permalinkParts . prefix ,
permalinkSuffix : permalinkParts === null || permalinkParts === void 0 ? void 0 : permalinkParts . suffix
} ;
2022-04-11 14:04:30 +02:00
} ) , ( 0 , external _wp _compose _namespaceObject . ifCondition ) ( _ref2 => {
2021-11-15 13:50:17 +01:00
let {
isEnabled ,
postLink ,
isViewable ,
hasPermalinkParts
} = _ref2 ;
2021-05-19 17:09:27 +02:00
return isEnabled && postLink && isViewable && hasPermalinkParts ;
2022-04-11 14:04:30 +02:00
} ) , ( 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
const {
editPost
2022-04-11 14:04:30 +02:00
} = dispatch ( external _wp _editor _namespaceObject . store ) ;
2021-05-19 17:09:27 +02:00
return {
onTogglePanel : ( ) => toggleEditorPanelOpened ( post _link _PANEL _NAME ) ,
editPermalink : newSlug => {
editPost ( {
slug : newSlug
} ) ;
}
} ;
} ) ] ) ( PostLink ) ) ;
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
* /
2019-10-15 17:37:08 +02:00
2021-05-19 17:09:27 +02:00
const discussion _panel _PANEL _NAME = 'discussion-panel' ;
2021-01-28 03:04:13 +01:00
2021-11-15 13:50:17 +01:00
function DiscussionPanel ( _ref ) {
let {
isEnabled ,
isOpened ,
onTogglePanel
} = _ref ;
2021-05-19 17:09:27 +02:00
if ( ! isEnabled ) {
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 . 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 ,
onToggle : onTogglePanel
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
}
2019-10-15 17:37:08 +02:00
2022-04-11 14:04:30 +02:00
/* harmony default export */ var discussion _panel = ( ( 0 , external _wp _compose _namespaceObject . compose ) ( [ ( 0 , external _wp _data _namespaceObject . withSelect ) ( select => {
2021-05-19 17:09:27 +02:00
return {
2022-04-11 14:04:30 +02:00
isEnabled : select ( store _store ) . isEditorPanelEnabled ( discussion _panel _PANEL _NAME ) ,
isOpened : select ( store _store ) . isEditorPanelOpened ( discussion _panel _PANEL _NAME )
2021-05-19 17:09:27 +02:00
} ;
2022-04-11 14:04:30 +02:00
} ) , ( 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 ( discussion _panel _PANEL _NAME ) ;
2021-05-19 17:09:27 +02:00
}
2019-10-15 17:37:08 +02:00
2021-05-19 17:09:27 +02:00
} ) ) ] ) ( 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
* External dependencies
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
2020-01-22 23:06:21 +01: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
* /
2020-01-08 12:57:23 +01:00
2021-05-19 17:09:27 +02:00
const page _attributes _PANEL _NAME = 'page-attributes' ;
function PageAttributes ( ) {
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 ) ;
2020-01-08 12:57:23 +01:00
2021-05-19 17:09:27 +02:00
if ( ! isEnabled || ! postType ) {
return null ;
}
2020-01-08 12:57:23 +01:00
2022-04-11 14:04:30 +02:00
const onTogglePanel = ( 0 , external _lodash _namespaceObject . partial ) ( toggleEditorPanelOpened , page _attributes _PANEL _NAME ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PageAttributesCheck , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . PanelBody , {
title : ( 0 , external _lodash _namespaceObject . get ) ( postType , [ 'labels' , 'attributes' ] , ( 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
}
/* 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
* /
/ * *
* 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 .
* /
2020-01-08 12:57:23 +01:00
2021-11-15 13:50:17 +01:00
function MetaBoxesArea ( _ref ) {
let {
location
} = _ref ;
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 ) ;
2021-01-28 03:04:13 +01:00
2021-11-08 15:29:21 +01:00
if ( formRef . current ) {
container . current . appendChild ( formRef . current ) ;
2021-01-28 03:04:13 +01:00
}
2020-01-08 12:57:23 +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
}
2020-01-08 12:57:23 +01:00
2021-11-08 15:29:21 +01: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
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 ( ) ;
}
2020-01-08 12:57:23 +01:00
2021-05-19 17:09:27 +02:00
componentDidUpdate ( prevProps ) {
if ( this . props . isVisible !== prevProps . isVisible ) {
this . updateDOM ( ) ;
}
}
2020-06-26 15:33:47 +02:00
2021-05-19 17:09:27 +02:00
updateDOM ( ) {
const {
id ,
isVisible
} = this . props ;
const element = document . getElementById ( id ) ;
2020-01-08 12:57:23 +01:00
2021-05-19 17:09:27 +02:00
if ( ! element ) {
return ;
}
2020-01-08 12:57:23 +01:00
2021-05-19 17:09:27 +02:00
if ( isVisible ) {
element . classList . remove ( 'is-hidden' ) ;
} else {
element . classList . add ( 'is-hidden' ) ;
}
}
2020-01-08 12:57:23 +01:00
2021-05-19 17:09:27 +02:00
render ( ) {
return null ;
}
2020-01-08 12:57:23 +01:00
2021-05-19 17:09:27 +02:00
}
2021-01-28 03:04:13 +01:00
2022-04-11 14:04:30 +02:00
/* harmony default export */ var meta _box _visibility = ( ( 0 , external _wp _data _namespaceObject . withSelect ) ( ( select , _ref ) => {
2021-11-15 13:50:17 +01:00
let {
id
} = _ref ;
return {
2022-04-11 14:04:30 +02:00
isVisible : select ( store _store ) . isEditorPanelEnabled ( ` meta-box- ${ id } ` )
2021-11-15 13:50:17 +01:00
} ;
2022-04-11 14:04:30 +02:00
} ) ( 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
* External dependencies
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
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
2021-11-15 13:50:17 +01:00
function MetaBoxes ( _ref ) {
let {
location
} = _ref ;
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 ( )
} ;
} , [ location ] ) ; // When editor is ready, initialize postboxes (wp core script) and metabox
// 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 ;
}
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _lodash _namespaceObject . map ) ( metaBoxes , _ref2 => {
2021-11-15 13:50:17 +01:00
let {
id
} = _ref2 ;
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( meta _box _visibility , {
2021-11-15 13:50:17 +01:00
key : id ,
id : id
} ) ;
2022-04-11 14:04:30 +02:00
} ) , ( 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"]
var external _wp _warning _namespaceObject = window [ "wp" ] [ "warning" ] ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/plugin-document-setting-panel/index.js
/ * *
* Defines as extensibility slot for the Settings sidebar
* /
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
const {
Fill : plugin _document _setting _panel _Fill ,
Slot : plugin _document _setting _panel _Slot
} = ( 0 , external _wp _components _namespaceObject . createSlotFill ) ( 'PluginDocumentSettingPanel' ) ;
const PluginDocumentSettingFill = _ref => {
let {
isEnabled ,
panelName ,
opened ,
onToggle ,
className ,
title ,
icon ,
children
} = _ref ;
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 : onToggle
} , children ) ) ) ;
} ;
/ * *
* Renders items below the Status & Availability panel in the Document Sidebar .
*
* @ param { Object } props Component properties .
* @ param { string } [ props . name ] The machine - friendly name for the panel .
* @ 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.
*
* @ 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' ,
* } ,
* _ _ ( '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 = ( ) => (
* < PluginDocumentSettingPanel className = "my-document-setting-plugin" title = "My Panel" >
* < 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 .
* /
const PluginDocumentSettingPanel = ( 0 , external _wp _compose _namespaceObject . compose ) ( ( 0 , external _wp _plugins _namespaceObject . withPluginContext ) ( ( context , ownProps ) => {
if ( undefined === ownProps . name ) {
typeof process !== "undefined" && process . env && "production" !== "production" ? 0 : void 0 ;
}
return {
icon : ownProps . icon || context . icon ,
panelName : ` ${ context . name } / ${ ownProps . name } `
} ;
} ) , ( 0 , external _wp _data _namespaceObject . withSelect ) ( ( select , _ref2 ) => {
let {
panelName
} = _ref2 ;
return {
opened : select ( store _store ) . isEditorPanelOpened ( panelName ) ,
isEnabled : select ( store _store ) . isEditorPanelEnabled ( panelName )
} ;
} ) , ( 0 , external _wp _data _namespaceObject . withDispatch ) ( ( dispatch , _ref3 ) => {
let {
panelName
} = _ref3 ;
return {
onToggle ( ) {
return dispatch ( store _store ) . toggleEditorPanelOpened ( panelName ) ;
}
} ;
} ) ) ( PluginDocumentSettingFill ) ;
PluginDocumentSettingPanel . Slot = plugin _document _setting _panel _Slot ;
/* 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
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
* /
2021-11-15 13:50:17 +01:00
function PluginSidebarEditPost ( _ref ) {
let {
className ,
... props
} = _ref ;
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
} , [ ] ) ;
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( complementary _area , _extends ( {
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 ,
showIconLabels : showIconLabels
2021-01-28 03:04:13 +01:00
} , props ) ) ;
}
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/template/actions.js
2021-01-28 03:04:13 +01:00
/ * *
2021-05-19 17:09:27 +02:00
* External dependencies
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
* /
2021-05-19 17:09:27 +02:00
2021-01-28 03:04:13 +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
2022-04-12 17:12:47 +02:00
function PostTemplateActions ( _ref ) {
let {
isPostsPage
} = _ref ;
2022-04-11 14:04:30 +02:00
const [ isModalOpen , setIsModalOpen ] = ( 0 , external _wp _element _namespaceObject . useState ) ( false ) ;
const [ isBusy , setIsBusy ] = ( 0 , external _wp _element _namespaceObject . useState ) ( false ) ;
const [ title , setTitle ] = ( 0 , external _wp _element _namespaceObject . useState ) ( '' ) ;
2021-05-19 17:09:27 +02:00
const {
template ,
2021-06-22 12:00:50 +02:00
supportsTemplateMode ,
defaultTemplate
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
2021-05-19 17:09:27 +02:00
var _getPostType$viewable , _getPostType ;
2021-01-28 03:04:13 +01:00
2021-05-19 17:09:27 +02:00
const {
2021-06-22 12:00:50 +02:00
getCurrentPostType ,
getEditorSettings
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 {
getEditedPostTemplate
2022-04-11 14:04:30 +02:00
} = select ( store _store ) ;
2021-05-19 17:09:27 +02:00
const isViewable = ( _getPostType$viewable = ( _getPostType = getPostType ( getCurrentPostType ( ) ) ) === null || _getPostType === void 0 ? void 0 : _getPostType . viewable ) !== null && _getPostType$viewable !== void 0 ? _getPostType$viewable : false ;
2021-01-28 03:04:13 +01:00
2021-06-22 12:00:50 +02:00
const _supportsTemplateMode = getEditorSettings ( ) . supportsTemplateMode && isViewable ;
2019-10-15 17:37:08 +02:00
2021-05-19 17:09:27 +02:00
return {
template : _supportsTemplateMode && getEditedPostTemplate ( ) ,
2021-06-22 12:00:50 +02:00
supportsTemplateMode : _supportsTemplateMode ,
defaultTemplate : getEditorSettings ( ) . defaultBlockTemplate
2021-05-19 17:09:27 +02:00
} ;
} , [ ] ) ;
const {
2021-11-08 15:29:21 +01:00
_ _unstableCreateTemplate ,
2021-05-19 17:09:27 +02:00
_ _unstableSwitchToTemplateMode
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
2020-06-26 15:33:47 +02:00
2021-05-19 17:09:27 +02:00
if ( ! supportsTemplateMode ) {
return null ;
}
2021-01-28 03:04:13 +01:00
2022-04-11 14:04:30 +02:00
const defaultTitle = ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Custom Template' ) ;
2021-06-22 12:00:50 +02:00
2021-11-08 15:29:21 +01:00
async function onCreateTemplate ( event ) {
event . preventDefault ( ) ;
if ( isBusy ) {
return ;
}
setIsBusy ( true ) ;
2022-04-11 14:04:30 +02:00
const newTemplateContent = defaultTemplate !== null && defaultTemplate !== void 0 ? defaultTemplate : ( 0 , external _wp _blocks _namespaceObject . serialize ) ( [ ( 0 , external _wp _blocks _namespaceObject . createBlock ) ( 'core/group' , {
2021-11-08 15:29:21 +01:00
tagName : 'header' ,
layout : {
inherit : true
}
2022-04-11 14:04:30 +02:00
} , [ ( 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' , {
2021-11-08 15:29:21 +01:00
tagName : 'main'
2022-04-11 14:04:30 +02:00
} , [ ( 0 , external _wp _blocks _namespaceObject . createBlock ) ( 'core/group' , {
2021-11-08 15:29:21 +01:00
layout : {
inherit : true
}
2022-04-11 14:04:30 +02:00
} , [ ( 0 , external _wp _blocks _namespaceObject . createBlock ) ( 'core/post-title' ) ] ) , ( 0 , external _wp _blocks _namespaceObject . createBlock ) ( 'core/post-content' , {
2021-11-08 15:29:21 +01:00
layout : {
inherit : true
}
} ) ] ) ] ) ;
await _ _unstableCreateTemplate ( {
2022-04-11 14:04:30 +02:00
slug : 'wp-custom-template-' + ( 0 , external _lodash _namespaceObject . kebabCase ) ( title || defaultTitle ) ,
2021-11-08 15:29:21 +01:00
content : newTemplateContent ,
title : title || defaultTitle
} ) ;
setIsBusy ( false ) ;
setIsModalOpen ( false ) ;
_ _unstableSwitchToTemplateMode ( true ) ;
}
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" , {
2021-05-19 17:09:27 +02:00
className : "edit-post-template__actions"
2022-04-11 14:04:30 +02:00
} , ! ! template && ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
2021-11-08 15:29:21 +01:00
variant : "link" ,
2021-05-19 17:09:27 +02:00
onClick : ( ) => _ _unstableSwitchToTemplateMode ( )
2022-04-12 17:12:47 +02:00
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Edit' ) ) , ! isPostsPage && ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
2021-11-08 15:29:21 +01:00
variant : "link" ,
2021-05-19 17:09:27 +02:00
onClick : ( ) => setIsModalOpen ( true )
2021-11-23 06:40:38 +01:00
} ,
/* translators: button to create a new template */
2022-04-11 14:04:30 +02:00
( 0 , external _wp _i18n _namespaceObject . _x ) ( 'New' , 'action' ) ) ) , isModalOpen && ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Modal , {
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Create custom template' ) ,
closeLabel : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Close' ) ,
2021-05-19 17:09:27 +02:00
onRequestClose : ( ) => {
setIsModalOpen ( false ) ;
setTitle ( '' ) ;
} ,
overlayClassName : "edit-post-template__modal"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( "form" , {
2021-11-08 15:29:21 +01:00
onSubmit : onCreateTemplate
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Flex , {
2021-06-15 10:52:30 +02:00
align : "flex-start" ,
gap : 8
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 ) ( external _wp _components _namespaceObject . TextControl , {
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Name' ) ,
2021-05-19 17:09:27 +02:00
value : title ,
2021-06-15 10:52:30 +02:00
onChange : setTitle ,
2021-06-22 12:00:50 +02:00
placeholder : defaultTitle ,
2021-11-08 15:29:21 +01:00
disabled : isBusy ,
2022-04-11 14:04:30 +02:00
help : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Describe the purpose of the template, e.g. "Full Width". Custom templates can be applied to any post or page.' )
} ) ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Flex , {
2021-06-15 10:52:30 +02:00
className : "edit-post-template__modal-actions" ,
justify : "flex-end" ,
expanded : false
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 ) ( external _wp _components _namespaceObject . Button , {
2021-11-08 15:29:21 +01:00
variant : "tertiary" ,
2021-05-19 17:09:27 +02:00
onClick : ( ) => {
setIsModalOpen ( false ) ;
setTitle ( '' ) ;
}
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Cancel' ) ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . FlexItem , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
2021-11-08 15:29:21 +01:00
variant : "primary" ,
type : "submit" ,
isBusy : isBusy ,
"aria-disabled" : isBusy
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Create' ) ) ) ) ) ) ) ;
2020-06-26 15:33:47 +02:00
}
2019-10-15 17:37:08 +02:00
2021-05-19 17:09:27 +02:00
/* harmony default export */ var actions = ( PostTemplateActions ) ;
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/template/index.js
2018-12-14 05:41:57 +01:00
2021-05-19 17:09:27 +02:00
/ * *
* External dependencies
* /
2018-12-14 05:41:57 +01:00
2021-05-19 17:09:27 +02:00
/ * *
* WordPress dependencies
* /
2019-09-19 17:19:18 +02:00
2018-12-14 05:41:57 +01:00
2018-12-17 05:52:00 +01:00
2021-06-25 17:52:22 +02:00
2021-05-19 17:09:27 +02:00
/ * *
* Internal dependencies
* /
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
2021-05-19 17:09:27 +02:00
/ * *
* Module Constants
* /
2018-12-18 04:14:52 +01:00
2021-05-19 17:09:27 +02:00
const template _PANEL _NAME = 'template' ;
function TemplatePanel ( ) {
const {
isEnabled ,
isOpened ,
2022-04-12 17:12:47 +02:00
isPostsPage ,
2021-05-19 17:09:27 +02:00
selectedTemplate ,
availableTemplates ,
2021-06-25 17:52:22 +02:00
fetchedTemplates ,
2021-05-19 17:09:27 +02:00
isViewable ,
template ,
2021-11-08 15:29:21 +01:00
supportsTemplateMode ,
canUserCreate
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
2021-05-19 17:09:27 +02:00
var _getPostType$viewable , _getPostType ;
2018-12-14 05:41:57 +01:00
2021-05-19 17:09:27 +02:00
const {
isEditorPanelEnabled ,
isEditorPanelOpened ,
getEditedPostTemplate
2022-04-11 14:04:30 +02:00
} = select ( store _store ) ;
2021-05-19 17:09:27 +02:00
const {
getEditedPostAttribute ,
getEditorSettings ,
2022-04-12 17:12:47 +02:00
getCurrentPostId ,
2021-05-19 17:09:27 +02:00
getCurrentPostType
2022-04-11 14:04:30 +02:00
} = select ( external _wp _editor _namespaceObject . store ) ;
2021-05-19 17:09:27 +02:00
const {
2021-06-25 17:52:22 +02:00
getPostType ,
2022-04-12 17:12:47 +02:00
getEntityRecord ,
2021-11-08 15:29:21 +01:00
getEntityRecords ,
canUser
2022-04-11 14:04:30 +02:00
} = select ( external _wp _coreData _namespaceObject . store ) ;
2022-04-12 17:12:47 +02:00
const currentPostId = getCurrentPostId ( ) ;
2021-11-08 15:29:21 +01:00
const currentPostType = getCurrentPostType ( ) ;
2022-04-12 17:12:47 +02:00
const settings = getEntityRecord ( 'root' , 'site' ) ;
2018-12-14 05:41:57 +01:00
2021-11-08 15:29:21 +01:00
const _isViewable = ( _getPostType$viewable = ( _getPostType = getPostType ( currentPostType ) ) === null || _getPostType === void 0 ? void 0 : _getPostType . viewable ) !== null && _getPostType$viewable !== void 0 ? _getPostType$viewable : false ;
2018-12-14 05:41:57 +01:00
2022-04-11 14:04:30 +02:00
const _supportsTemplateMode = select ( external _wp _editor _namespaceObject . store ) . getEditorSettings ( ) . supportsTemplateMode && _isViewable ;
2019-10-15 17:37:08 +02:00
2022-04-12 17:12:47 +02:00
const templateRecords = getEntityRecords ( 'postType' , 'wp_template' , {
2022-02-17 20:18:25 +01:00
post _type : currentPostType ,
per _page : - 1
2021-06-25 17:52:22 +02:00
} ) ;
2021-05-19 17:09:27 +02:00
return {
isEnabled : isEditorPanelEnabled ( template _PANEL _NAME ) ,
isOpened : isEditorPanelOpened ( template _PANEL _NAME ) ,
2022-04-12 17:12:47 +02:00
isPostsPage : currentPostId === ( settings === null || settings === void 0 ? void 0 : settings . page _for _posts ) ,
2021-05-19 17:09:27 +02:00
selectedTemplate : getEditedPostAttribute ( 'template' ) ,
availableTemplates : getEditorSettings ( ) . availableTemplates ,
2022-04-12 17:12:47 +02:00
fetchedTemplates : templateRecords ,
2021-05-19 17:09:27 +02:00
template : _supportsTemplateMode && getEditedPostTemplate ( ) ,
isViewable : _isViewable ,
2021-11-08 15:29:21 +01:00
supportsTemplateMode : _supportsTemplateMode ,
canUserCreate : canUser ( 'create' , 'templates' )
2021-05-19 17:09:27 +02:00
} ;
} , [ ] ) ;
2022-04-11 14:04:30 +02:00
const templates = ( 0 , external _wp _element _namespaceObject . useMemo ) ( ( ) => {
2021-06-25 17:52:22 +02:00
return { ... availableTemplates ,
2022-04-12 17:12:47 +02:00
... ( 0 , external _lodash _namespaceObject . fromPairs ) ( ( fetchedTemplates !== null && fetchedTemplates !== void 0 ? fetchedTemplates : [ ] ) . map ( _ref => {
let {
slug ,
title
} = _ref ;
return [ slug , title . rendered ] ;
} ) )
2021-06-25 17:52:22 +02:00
} ;
} , [ availableTemplates , fetchedTemplates ] ) ;
2021-05-19 17:09:27 +02:00
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
const {
editPost
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _editor _namespaceObject . store ) ;
2019-10-15 17:37:08 +02:00
2022-04-11 14:04:30 +02:00
if ( ! isEnabled || ! isViewable || ( 0 , external _lodash _namespaceObject . isEmpty ) ( availableTemplates ) && ( ! supportsTemplateMode || ! canUserCreate ) ) {
2021-05-19 17:09:27 +02:00
return null ;
}
2019-10-15 17:37:08 +02:00
2022-04-11 14:04:30 +02:00
const onTogglePanel = ( 0 , external _lodash _namespaceObject . partial ) ( toggleEditorPanelOpened , template _PANEL _NAME ) ;
2020-06-26 15:33:47 +02:00
2022-04-11 14:04:30 +02:00
let panelTitle = ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Template' ) ;
2020-06-26 15:33:47 +02:00
2021-05-19 17:09:27 +02:00
if ( ! ! template ) {
2021-05-21 12:14:23 +02:00
var _template$title ;
2020-06-26 15:33:47 +02:00
2022-04-11 14:04:30 +02:00
panelTitle = ( 0 , external _wp _i18n _namespaceObject . sprintf ) (
2021-05-19 17:09:27 +02:00
/* translators: %s: template title */
2022-04-11 14:04:30 +02:00
( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Template: %s' ) , ( _template$title = template === null || template === void 0 ? void 0 : template . title ) !== null && _template$title !== void 0 ? _template$title : template . slug ) ;
2021-01-28 03:04:13 +01:00
}
2020-06-26 15:33:47 +02:00
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 : panelTitle ,
opened : isOpened ,
onToggle : onTogglePanel
2022-04-12 17:12:47 +02:00
} , isPostsPage ? ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Notice , {
className : "edit-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 , {
2021-05-19 17:09:27 +02:00
hideLabelFromVision : true ,
2022-04-11 14:04:30 +02:00
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Template:' ) ,
2021-06-25 17:52:22 +02:00
value : Object . keys ( templates ) . includes ( selectedTemplate ) ? selectedTemplate : '' ,
2021-05-19 17:09:27 +02:00
onChange : templateSlug => {
editPost ( {
template : templateSlug || ''
} ) ;
} ,
2022-04-11 14:04:30 +02:00
options : ( 0 , external _lodash _namespaceObject . map ) ( templates , ( templateName , templateSlug ) => ( {
2021-05-19 17:09:27 +02:00
value : templateSlug ,
label : templateName
} ) )
2022-04-12 17:12:47 +02:00
} ) , canUserCreate && ( 0 , external _wp _element _namespaceObject . createElement ) ( actions , {
isPostsPage : isPostsPage
} ) ) ;
2021-01-28 03:04:13 +01:00
}
2022-04-11 14:04:30 +02:00
/* harmony default export */ var template = ( TemplatePanel ) ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/layout.js
/ * *
* WordPress dependencies
* /
2020-06-26 15:33:47 +02:00
2022-04-11 14:04:30 +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"
} ) ) ;
/* harmony default export */ var library _layout = ( layout ) ;
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/template-summary/index.js
2019-10-15 17:37:08 +02:00
2020-06-26 15:33:47 +02:00
2021-05-19 17:09:27 +02:00
/ * *
* WordPress dependencies
* /
2021-02-02 06:17:13 +01:00
2021-05-19 17:09:27 +02:00
/ * *
* Internal dependencies
* /
2021-02-02 06:17:13 +01:00
2021-04-15 17:19:43 +02: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 ( ) ;
} , [ ] ) ;
2021-04-15 17:19:43 +02:00
2021-05-19 17:09:27 +02:00
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"
2022-04-11 14:04:30 +02:00
} , ( template === null || template === void 0 ? void 0 : template . title ) || ( template === null || template === void 0 ? void 0 : template . slug ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "p" , null , template === null || template === void 0 ? void 0 : template . description ) ) ) ) ;
2021-04-15 17:19:43 +02:00
}
2021-05-19 17:09:27 +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
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
2019-10-15 17:37:08 +02:00
2018-12-14 05:41:57 +01:00
2019-10-15 17:37:08 +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
} ) ;
2019-10-15 17:37:08 +02:00
2021-05-19 17:09:27 +02:00
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.
// When neither of the the two sidebars is active we can not simply return null, because the PluginSidebarEditPost
// 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 ) ;
2019-10-15 17:37:08 +02:00
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' ;
}
2019-10-15 17:37:08 +02:00
2021-05-19 17:09:27 +02:00
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
} ) ,
2022-04-11 14:04:30 +02:00
closeLabel : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Close settings' ) ,
2021-05-19 17:09:27 +02:00
headerClassName : "edit-post-sidebar__panel-tabs"
/* 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 ,
2022-04-11 14:04:30 +02:00
icon : library _cog ,
2021-05-19 17:09:27 +02:00
isActiveByDefault : SIDEBAR _ACTIVE _BY _DEFAULT
2022-04-11 14:04:30 +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 ) ( template , 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 _link , 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
} ;
2021-01-28 03:04:13 +01:00
2021-05-19 17:09:27 +02:00
/* harmony default export */ var settings _sidebar = ( SettingsSidebar ) ;
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
2021-11-15 13:50:17 +01:00
function WelcomeGuideImage ( _ref ) {
let {
nonAnimatedSrc ,
animatedSrc
} = _ref ;
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
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 , {
href : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'https://wordpress.org/support/article/wordpress-editor/' )
} , ( 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
* /
/ * *
* 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
* /
/ * *
* 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-10-15 17:37:08 +02: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-11-15 13:50:17 +01:00
const PluginPostPublishPanelFill = _ref => {
let {
children ,
className ,
title ,
initialOpen = false ,
icon
} = _ref ;
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( plugin _post _publish _panel _Fill , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . PanelBody , {
2021-11-15 13:50:17 +01:00
className : className ,
initialOpen : initialOpen || ! title ,
title : title ,
icon : icon
} , children ) ) ;
} ;
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.
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
* /
2019-10-15 17:37:08 +02:00
2020-08-10 16:18:33 +02:00
2022-04-11 14:04:30 +02:00
const PluginPostPublishPanel = ( 0 , external _wp _compose _namespaceObject . compose ) ( ( 0 , external _wp _plugins _namespaceObject . withPluginContext ) ( ( context , ownProps ) => {
2021-05-19 17:09:27 +02:00
return {
icon : ownProps . icon || context . icon
} ;
} ) ) ( PluginPostPublishPanelFill ) ;
PluginPostPublishPanel . Slot = plugin _post _publish _panel _Slot ;
/* 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-11-15 13:50:17 +01:00
const PluginPrePublishPanelFill = _ref => {
let {
children ,
className ,
title ,
initialOpen = false ,
icon
} = _ref ;
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( plugin _pre _publish _panel _Fill , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . PanelBody , {
2021-11-15 13:50:17 +01:00
className : className ,
initialOpen : initialOpen || ! title ,
title : title ,
icon : icon
} , children ) ) ;
} ;
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 .
*
* @ 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
* /
2021-05-19 17:09:27 +02:00
2022-04-11 14:04:30 +02:00
const PluginPrePublishPanel = ( 0 , external _wp _compose _namespaceObject . compose ) ( ( 0 , external _wp _plugins _namespaceObject . withPluginContext ) ( ( context , ownProps ) => {
2021-01-28 03:04:13 +01:00
return {
2021-05-19 17:09:27 +02:00
icon : ownProps . icon || context . icon
2021-01-28 03:04:13 +01:00
} ;
2021-05-19 17:09:27 +02:00
} ) ) ( PluginPrePublishPanelFill ) ;
PluginPrePublishPanel . Slot = plugin _pre _publish _panel _Slot ;
/* 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 ) ) ;
2021-11-15 13:50:17 +01:00
function ActionsPanel ( _ref ) {
let {
setEntitiesSavedStatesCallback ,
closeEntitiesSavedStates ,
isEntitiesSavedStatesOpen
} = _ref ;
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 ,
isSavingMetaBoxes ,
hasNonPostEntityChanges
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
publishSidebarOpened : select ( store _store ) . isPublishSidebarOpened ( ) ,
hasActiveMetaboxes : select ( store _store ) . hasMetaBoxes ( ) ,
isSavingMetaBoxes : select ( store _store ) . isSavingMetaBoxes ( ) ,
hasNonPostEntityChanges : select ( external _wp _editor _namespaceObject . store ) . hasNonPostEntityChanges ( )
2021-05-19 17:09:27 +02:00
} ;
} , [ ] ) ;
2022-04-11 14:04:30 +02:00
const openEntitiesSavedStates = ( 0 , external _wp _element _namespaceObject . useCallback ) ( ( ) => setEntitiesSavedStatesCallback ( true ) , [ ] ) ; // It is ok for these components to be unmounted when not in visual use.
2021-05-19 17:09:27 +02:00
// We don't want more than one present at a time, decide which to render.
2018-12-14 05:41:57 +01:00
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 ,
forceIsSaving : isSavingMetaBoxes ,
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' ) ) ) ;
2021-05-19 17:09:27 +02:00
} // Since EntitiesSavedStates controls its own panel, we can keep it
// always mounted to retain its own component state (such as checkboxes).
2018-12-14 05:41:57 +01:00
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
* /
/ * *
* Internal dependencies
* /
function PatternSelection ( _ref ) {
let {
onChoosePattern
} = _ref ;
const {
blockPatterns
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
const {
_ _experimentalGetPatternsByBlockTypes
} = select ( external _wp _blockEditor _namespaceObject . store ) ;
return {
blockPatterns : _ _experimentalGetPatternsByBlockTypes ( 'core/post-content' )
} ;
} , [ ] ) ;
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 ( ) ;
}
} ) ;
}
const START _PAGE _MODAL _STATES = {
INITIAL : 'INITIAL' ,
PATTERN : 'PATTERN' ,
CLOSED : 'CLOSED'
} ;
function StartPageOptions ( ) {
const [ modalState , setModalState ] = ( 0 , external _wp _element _namespaceObject . useState ) ( START _PAGE _MODAL _STATES . INITIAL ) ;
const shouldOpenModel = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
if ( modalState !== START _PAGE _MODAL _STATES . INITIAL ) {
return false ;
}
const {
_ _experimentalGetPatternsByBlockTypes
} = select ( external _wp _blockEditor _namespaceObject . store ) ;
const {
getCurrentPostType ,
getEditedPostContent ,
isEditedPostSaveable
} = select ( external _wp _editor _namespaceObject . store ) ;
const {
isEditingTemplate ,
isFeatureActive
} = select ( store _store ) ;
return getCurrentPostType ( ) === 'page' && ! isEditedPostSaveable ( ) && '' === getEditedPostContent ( ) && ! isEditingTemplate ( ) && ! isFeatureActive ( 'welcomeGuide' ) && _ _experimentalGetPatternsByBlockTypes ( 'core/post-content' ) . length >= 1 ;
} , [ modalState ] ) ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
if ( shouldOpenModel ) {
setModalState ( START _PAGE _MODAL _STATES . PATTERN ) ;
}
} , [ shouldOpenModel ] ) ;
if ( modalState === START _PAGE _MODAL _STATES . INITIAL || modalState === START _PAGE _MODAL _STATES . CLOSED ) {
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' ) ,
closeLabel : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Cancel' ) ,
onRequestClose : ( ) => {
setModalState ( START _PAGE _MODAL _STATES . CLOSED ) ;
}
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "edit-post-start-page-options__modal-content"
} , modalState === START _PAGE _MODAL _STATES . PATTERN && ( 0 , external _wp _element _namespaceObject . createElement ) ( PatternSelection , {
onChoosePattern : ( ) => {
setModalState ( START _PAGE _MODAL _STATES . CLOSED ) ;
}
} ) ) ) ;
}
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
2018-12-14 05:41:57 +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
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
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-04-15 17:19:43 +02:00
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-04-15 17:19:43 +02:00
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-04-15 17:19:43 +02:00
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-04-15 17:19:43 +02:00
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
} ;
2021-04-15 17:19:43 +02:00
2021-11-15 13:50:17 +01:00
function Layout ( _ref ) {
let {
styles
} = _ref ;
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' , '>=' ) ;
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 ,
hasReducedUI ,
2021-06-01 10:10:04 +02:00
showBlockBreadcrumbs ,
2021-11-08 15:29:21 +01:00
isTemplateMode ,
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' ) ,
hasReducedUI : select ( store _store ) . isFeatureActive ( 'reducedUI' ) ,
showBlockBreadcrumbs : select ( store _store ) . isFeatureActive ( 'showBlockBreadcrumbs' ) ,
2021-11-08 15:29:21 +01:00
// translators: Default label for the Document in the Block Breadcrumb.
2022-04-11 14:04:30 +02:00
documentLabel : postTypeLabel || ( 0 , external _wp _i18n _namespaceObject . _x ) ( 'Document' , 'noun' )
2021-05-19 17:09:27 +02:00
} ;
} , [ ] ) ;
const className = classnames _default ( ) ( 'edit-post-layout' , 'is-mode-' + mode , {
'is-sidebar-opened' : sidebarIsOpened ,
'has-fixed-toolbar' : hasFixedToolbar ,
'has-metaboxes' : hasActiveMetaboxes ,
'show-icon-labels' : showIconLabels
} ) ;
2021-04-15 17:19:43 +02:00
2021-05-19 17:09:27 +02:00
const openSidebarPanel = ( ) => openGeneralSidebar ( hasBlockSelected ? 'edit-post/block' : 'edit-post/document' ) ; // Inserter and Sidebars are mutually exclusive
2021-04-15 17:19:43 +02:00
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 ( ) ;
}
} , [ isInserterOpened , isHugeViewport ] ) ; // Local state for save panel.
// Note 'truthy' callback implies an open panel.
2021-04-15 17:19:43 +02:00
2022-04-11 14:04:30 +02:00
const [ entitiesSavedStatesCallback , setEntitiesSavedStatesCallback ] = ( 0 , external _wp _element _namespaceObject . useState ) ( false ) ;
const closeEntitiesSavedStates = ( 0 , external _wp _element _namespaceObject . useCallback ) ( arg => {
2021-05-19 17:09:27 +02:00
if ( typeof entitiesSavedStatesCallback === 'function' ) {
entitiesSavedStatesCallback ( arg ) ;
}
2021-04-15 17:19:43 +02:00
2021-05-19 17:09:27 +02:00
setEntitiesSavedStatesCallback ( false ) ;
} , [ entitiesSavedStatesCallback ] ) ;
2022-04-19 17:11:17 +02:00
const secondarySidebarLabel = isListViewOpened ? ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'List View' ) : ( 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 ) {
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( ListViewSidebar , null ) ;
2021-05-21 12:14:23 +02:00
}
return null ;
} ;
2022-04-12 17:12:47 +02:00
function onPluginAreaError ( name ) {
createErrorNotice ( ( 0 , external _wp _i18n _namespaceObject . sprintf ) (
/* translators: %s: plugin name */
( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'The "%s" plugin has encountered an error and cannot be rendered.' ) , name ) ) ;
}
2022-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
2022-04-11 14:04:30 +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 ) ( settings _sidebar , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( interface _skeleton , {
2021-05-19 17:09:27 +02:00
className : className ,
2022-04-19 17:11:17 +02:00
labels : { ... interfaceLabels ,
secondarySidebar : secondarySidebarLabel
} ,
2022-04-11 14:04:30 +02:00
header : ( 0 , external _wp _element _namespaceObject . createElement ) ( header , {
2021-05-19 17:09:27 +02:00
setEntitiesSavedStatesCallback : setEntitiesSavedStatesCallback
} ) ,
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 ) ,
content : ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . EditorNotices , null ) , ( mode === 'text' || ! isRichEditingEnabled ) && ( 0 , external _wp _element _namespaceObject . createElement ) ( text _editor , null ) , isRichEditingEnabled && mode === 'visual' && ( 0 , external _wp _element _namespaceObject . createElement ) ( VisualEditor , {
2021-05-19 17:09:27 +02:00
styles : styles
2022-04-11 14:04:30 +02:00
} ) , ! 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"
2022-04-12 17:12:47 +02:00
} ) ) , isMobileViewport && sidebarIsOpened && ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . ScrollLock , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . BlockStyles . Slot , {
scope : "core/block-inspector"
} ) ) ,
2022-04-11 14:04:30 +02:00
footer : ! hasReducedUI && showBlockBreadcrumbs && ! isMobileViewport && 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
}
2022-04-12 17:12:47 +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 ) ( StartPageOptions , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Popover . Slot , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _plugins _namespaceObject . PluginArea , {
onError : onPluginAreaError
} ) ) ;
2021-04-15 17:19:43 +02:00
}
2021-05-19 17:09:27 +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
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
* /
2018-12-14 05:41:57 +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 ;
}
2018-12-14 05:41:57 +01:00
2021-05-19 17:09:27 +02:00
if ( hasBlockSelection ) {
openGeneralSidebar ( 'edit-post/block' ) ;
} else {
openGeneralSidebar ( 'edit-post/document' ) ;
}
} , [ hasBlockSelection , isEditorSidebarOpened ] ) ;
} ;
/ * *
* This listener hook monitors any change in permalink and updates the view
* post link in the admin bar .
*
* @ param { number } postId
* /
2018-12-14 05:41:57 +01:00
2021-05-19 17:09:27 +02:00
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 ;
}
2018-12-18 04:14:52 +01:00
2021-05-19 17:09:27 +02:00
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
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 .
* /
2018-12-14 05:41:57 +01:00
2021-11-15 13:50:17 +01:00
function EditorInitialization ( _ref ) {
let {
postId
} = _ref ;
2021-05-19 17:09:27 +02:00
useBlockSelectionListener ( postId ) ;
useUpdatePostLinkListener ( postId ) ;
return null ;
}
2020-02-06 22:03:31 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/editor.js
2020-02-06 22:03:31 +01:00
2020-06-26 15:33:47 +02:00
2019-10-15 17:37:08 +02:00
/ * *
* External dependencies
* /
2018-12-14 05:41:57 +01: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
2022-04-12 17:12:47 +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
* /
2021-11-15 13:50:17 +01:00
function Editor ( _ref ) {
let {
postId ,
postType ,
settings ,
initialEdits ,
onError ,
... props
} = _ref ;
2021-05-19 17:09:27 +02:00
const {
hasFixedToolbar ,
focusMode ,
hasReducedUI ,
hasThemeStyles ,
post ,
preferredStyleVariations ,
hiddenBlockTypes ,
blockTypes ,
keepCaretInsideBlock ,
isTemplateMode ,
template
2022-04-11 14:04:30 +02:00
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
2021-05-19 17:09:27 +02:00
var _getPostType$viewable , _getPostType ;
2021-04-15 17:19:43 +02:00
2021-05-19 17:09:27 +02:00
const {
isFeatureActive ,
_ _experimentalGetPreviewDeviceType ,
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 ,
getEntityRecords
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 ) ;
2021-05-19 17:09:27 +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.
// to avoid the special case.
2018-12-18 04:14:52 +01:00
2021-05-19 17:09:27 +02:00
let postObject ;
2018-12-18 04:14:52 +01:00
2021-05-19 17:09:27 +02:00
if ( isTemplate ) {
const posts = getEntityRecords ( 'postType' , postType , {
wp _id : postId
} ) ;
postObject = posts === null || posts === void 0 ? void 0 : posts [ 0 ] ;
} else {
postObject = getEntityRecord ( 'postType' , postType , postId ) ;
2019-10-15 17:37:08 +02:00
}
2018-12-18 04:14:52 +01:00
2021-05-19 17:09:27 +02:00
const supportsTemplateMode = getEditorSettings ( ) . supportsTemplateMode ;
const isViewable = ( _getPostType$viewable = ( _getPostType = getPostType ( postType ) ) === null || _getPostType === void 0 ? void 0 : _getPostType . viewable ) !== null && _getPostType$viewable !== void 0 ? _getPostType$viewable : false ;
2021-01-28 03:04:13 +01:00
return {
2021-05-19 17:09:27 +02:00
hasFixedToolbar : isFeatureActive ( 'fixedToolbar' ) || _ _experimentalGetPreviewDeviceType ( ) !== 'Desktop' ,
focusMode : isFeatureActive ( 'focusMode' ) ,
hasReducedUI : isFeatureActive ( 'reducedUI' ) ,
hasThemeStyles : isFeatureActive ( 'themeStyles' ) ,
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 ( ) ,
template : supportsTemplateMode && isViewable ? getEditedPostTemplate ( ) : null ,
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 ) ( ( ) => {
2021-11-08 15:29:21 +01:00
const result = { ... settings ,
2021-05-19 17:09:27 +02:00
_ _experimentalPreferredStyleVariations : {
value : preferredStyleVariations ,
onChange : updatePreferredStyleVariations
} ,
hasFixedToolbar ,
focusMode ,
hasReducedUI ,
// 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
2021-05-19 17:09:27 +02:00
} ; // Omit hidden block types if exists and non-empty.
2018-12-18 04:14:52 +01:00
2022-04-11 14:04:30 +02:00
if ( ( 0 , external _lodash _namespaceObject . size ) ( hiddenBlockTypes ) > 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).
2022-04-11 14:04:30 +02:00
const defaultAllowedBlockTypes = true === settings . allowedBlockTypes ? ( 0 , external _lodash _namespaceObject . map ) ( blockTypes , 'name' ) : settings . allowedBlockTypes || [ ] ;
result . allowedBlockTypes = ( 0 , external _lodash _namespaceObject . without ) ( defaultAllowedBlockTypes , ... hiddenBlockTypes ) ;
2021-01-28 03:04:13 +01:00
}
2021-05-19 17:09:27 +02:00
return result ;
2022-04-12 17:12:47 +02:00
} , [ settings , hasFixedToolbar , focusMode , hasReducedUI , hiddenBlockTypes , blockTypes , preferredStyleVariations , setIsInserterOpened , updatePreferredStyleVariations , keepCaretInsideBlock ] ) ;
2022-04-11 14:04:30 +02:00
const styles = ( 0 , external _wp _element _namespaceObject . useMemo ) ( ( ) => {
2021-11-08 15:29:21 +01:00
const themeStyles = [ ] ;
const presetStyles = [ ] ;
2022-04-12 17:12:47 +02:00
( 0 , external _lodash _namespaceObject . forEach ) ( settings . styles , style => {
2021-11-08 15:29:21 +01:00
if ( ! style . _ _unstableType || style . _ _unstableType === 'theme' ) {
themeStyles . push ( style ) ;
} else {
presetStyles . push ( style ) ;
}
} ) ;
const defaultEditorStyles = [ ... settings . defaultEditorStyles , ... presetStyles ] ;
return hasThemeStyles && themeStyles . length ? settings . styles : defaultEditorStyles ;
2021-05-19 17:09:27 +02:00
} , [ settings , hasThemeStyles ] ) ;
2018-12-14 05:53:54 +01:00
2021-05-19 17:09:27 +02:00
if ( ! post ) {
return null ;
2021-01-28 03:04:13 +01:00
}
2018-12-14 05:53:54 +01:00
2022-04-12 17:12:47 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . StrictMode , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _keyboardShortcuts _namespaceObject . ShortcutProvider , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . SlotFillProvider , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . EditorProvider , _extends ( {
2021-05-19 17:09:27 +02:00
settings : editorSettings ,
post : post ,
initialEdits : initialEdits ,
useSubRegistry : false ,
_ _unstableTemplate : isTemplateMode ? template : undefined
2022-04-11 14:04:30 +02:00
} , props ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . ErrorBoundary , {
2021-05-19 17:09:27 +02:00
onError : onError
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( EditorInitialization , {
2021-05-19 17:09:27 +02:00
postId : postId
2022-04-11 14:04:30 +02:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( components _layout , {
2021-05-19 17:09:27 +02:00
styles : styles
2022-04-12 17:12:47 +02:00
} ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _editor _namespaceObject . PostLockedModal , null ) ) ) ) ) ;
2021-05-19 17:09:27 +02:00
}
2018-12-14 05:53:54 +01:00
2021-05-19 17:09:27 +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
* External dependencies
2020-01-22 23:06:21 +01:00
* /
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
2019-03-07 10:09:59 +01:00
2022-04-11 14:04:30 +02:00
const isEverySelectedBlockAllowed = ( selected , allowed ) => ( 0 , external _lodash _namespaceObject . difference ) ( selected , allowed ) . length === 0 ;
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 .
* /
2021-04-15 17:19:43 +02:00
2018-12-14 05:41:57 +01:00
2021-05-19 17:09:27 +02:00
const shouldRenderItem = ( selectedBlocks , allowedBlocks ) => ! Array . isArray ( allowedBlocks ) || isEverySelectedBlockAllowed ( selectedBlocks , allowedBlocks ) ;
/ * *
* 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 .
* /
2018-12-14 05:41:57 +01:00
2021-11-15 13:50:17 +01:00
const PluginBlockSettingsMenuItem = _ref => {
let {
allowedBlocks ,
icon ,
label ,
onClick ,
small ,
role
} = _ref ;
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . BlockSettingsMenuControls , null , _ref2 => {
2021-11-15 13:50:17 +01:00
let {
selectedBlocks ,
onClose
} = _ref2 ;
2018-12-14 05:41:57 +01:00
2021-11-15 13:50:17 +01:00
if ( ! shouldRenderItem ( selectedBlocks , allowedBlocks ) ) {
return null ;
}
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . MenuItem , {
onClick : ( 0 , external _wp _compose _namespaceObject . compose ) ( onClick , onClose ) ,
2021-11-15 13:50:17 +01:00
icon : icon ,
label : small ? label : undefined ,
role : role
} , ! small && label ) ;
} ) ;
} ;
2018-12-14 05:41:57 +01:00
2021-05-19 17:09:27 +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
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 .
* /
2021-01-28 03:04:13 +01:00
2022-04-11 14:04:30 +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
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 ) {
return ( 0 , external _wp _element _namespaceObject . createElement ) ( ComplementaryAreaMoreMenuItem // Menu item is marked with unstable prop for backward compatibility.
// @see https://github.com/WordPress/gutenberg/issues/14457
, _extends ( {
_ _unstableExplicitMenuItem : true ,
scope : "core/edit-post"
} , props ) ) ;
}
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
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
2021-05-20 14:20:04 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* Reinitializes the editor after the user chooses to reboot the editor after
* an unhandled error occurs , replacing previously mounted editor element using
* an initial state from prior to the crash .
*
* @ param { Object } postType Post type of the post to edit .
* @ param { Object } postId ID of the post to edit .
* @ param { Element } target DOM node in which editor is rendered .
* @ 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 ) .
2021-05-20 14:20:04 +02:00
* /
2020-03-10 15:53:18 +01:00
2022-04-11 14:04:30 +02:00
function reinitializeEditor ( postType , postId , target , settings , initialEdits ) {
( 0 , external _wp _element _namespaceObject . unmountComponentAtNode ) ( target ) ;
const reboot = reinitializeEditor . bind ( null , postType , postId , target , settings , initialEdits ) ;
( 0 , external _wp _element _namespaceObject . render ) ( ( 0 , external _wp _element _namespaceObject . createElement ) ( editor , {
settings : settings ,
onError : reboot ,
postId : postId ,
postType : postType ,
initialEdits : initialEdits ,
recovery : true
} ) , target ) ;
}
/ * *
* 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 ) .
* /
2019-09-19 17:19:18 +02:00
2022-04-11 14:04:30 +02:00
function initializeEditor ( id , postType , postId , settings , initialEdits ) {
// Prevent adding template part in the post editor.
// Only add the filter when the post editor is initialized, not imported.
( 0 , external _wp _hooks _namespaceObject . addFilter ) ( 'blockEditor.__unstableCanInsertBlockType' , 'removeTemplatePartsFromInserter' , ( can , blockType ) => {
if ( ! ( 0 , external _wp _data _namespaceObject . select ) ( store _store ) . isEditingTemplate ( ) && blockType . name === 'core/template-part' ) {
return false ;
}
2019-09-19 17:19:18 +02:00
2022-04-11 14:04:30 +02:00
return can ;
} ) ;
const target = document . getElementById ( id ) ;
const reboot = reinitializeEditor . bind ( null , postType , postId , target , settings , initialEdits ) ;
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 ,
themeStyles : true ,
2022-04-12 17:12:47 +02:00
welcomeGuide : true ,
2022-04-11 14:04:30 +02:00
welcomeGuideTemplate : true
} ) ;
2019-09-19 17:19:18 +02:00
2022-04-11 14:04:30 +02:00
( 0 , external _wp _data _namespaceObject . dispatch ) ( external _wp _blocks _namespaceObject . store ) . _ _experimentalReapplyBlockTypeFilters ( ) ;
2021-02-02 06:17:13 +01:00
2022-04-11 14:04:30 +02:00
( 0 , external _wp _blockLibrary _namespaceObject . registerCoreBlocks ) ( ) ;
2020-01-22 23:06:21 +01:00
2022-04-11 14:04:30 +02:00
if ( false ) { } // Show a console log warning if the browser is not in Standards rendering mode.
2020-01-22 23:06:21 +01:00
2022-04-11 14:04:30 +02:00
const documentMode = document . compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks' ;
2020-01-22 23:06:21 +01:00
2022-04-11 14:04:30 +02:00
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." ) ;
} // This is a temporary fix for a couple of issues specific to Webkit on iOS.
// 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 ;
2021-05-20 14:20:04 +02:00
2022-04-11 14:04:30 +02:00
if ( isIphone ) {
window . addEventListener ( 'scroll' , event => {
const editorScrollContainer = document . getElementsByClassName ( 'interface-interface-skeleton__body' ) [ 0 ] ;
2020-02-06 22:03:31 +01:00
2022-04-11 14:04:30 +02:00
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 ;
} // Undo unwanted scroll on html element, but only in the visual editor.
2021-05-20 14:20:04 +02:00
2022-04-11 14:04:30 +02:00
if ( document . getElementsByClassName ( 'is-mode-visual' ) [ 0 ] ) {
window . scrollTo ( 0 , 0 ) ;
}
}
} ) ;
}
2021-05-20 14:20:04 +02:00
2022-04-11 14:04:30 +02:00
( 0 , external _wp _element _namespaceObject . render ) ( ( 0 , external _wp _element _namespaceObject . createElement ) ( editor , {
settings : settings ,
onError : reboot ,
postId : postId ,
postType : postType ,
initialEdits : initialEdits
} ) , target ) ;
}
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
2022-04-11 14:04:30 +02:00
} ( ) ;
( window . wp = window . wp || { } ) . editPost = _ _webpack _exports _ _ ;
/******/ } ) ( )
;