2021-11-09 03:17:17 +01:00
this [ "wp" ] = this [ "wp" ] || { } ; this [ "wp" ] [ "editSite" ] =
/******/ ( function ( modules ) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = { } ;
/******/
/******/ // The require function
/******/ function _ _webpack _require _ _ ( moduleId ) {
/******/
/******/ // Check if module is in cache
/******/ if ( installedModules [ moduleId ] ) {
/******/ return installedModules [ moduleId ] . exports ;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules [ moduleId ] = {
/******/ i : moduleId ,
/******/ l : false ,
/******/ exports : { }
/******/ } ;
/******/
/******/ // Execute the module function
/******/ modules [ moduleId ] . call ( module . exports , module , module . exports , _ _webpack _require _ _ ) ;
/******/
/******/ // Flag the module as loaded
/******/ module . l = true ;
/******/
/******/ // Return the exports of the module
/******/ return module . exports ;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ _ _webpack _require _ _ . m = modules ;
/******/
/******/ // expose the module cache
/******/ _ _webpack _require _ _ . c = installedModules ;
/******/
/******/ // define getter function for harmony exports
/******/ _ _webpack _require _ _ . d = function ( exports , name , getter ) {
/******/ if ( ! _ _webpack _require _ _ . o ( exports , name ) ) {
/******/ Object . defineProperty ( exports , name , { enumerable : true , get : getter } ) ;
/******/ }
/******/ } ;
/******/
/******/ // 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 } ) ;
/******/ } ;
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ _ _webpack _require _ _ . t = function ( value , mode ) {
/******/ if ( mode & 1 ) value = _ _webpack _require _ _ ( value ) ;
/******/ if ( mode & 8 ) return value ;
/******/ if ( ( mode & 4 ) && typeof value === 'object' && value && value . _ _esModule ) return value ;
/******/ var ns = Object . create ( null ) ;
/******/ _ _webpack _require _ _ . r ( ns ) ;
/******/ Object . defineProperty ( ns , 'default' , { enumerable : true , value : value } ) ;
/******/ if ( mode & 2 && typeof value != 'string' ) for ( var key in value ) _ _webpack _require _ _ . d ( ns , key , function ( key ) { return value [ key ] ; } . bind ( null , key ) ) ;
/******/ return ns ;
/******/ } ;
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ _ _webpack _require _ _ . n = function ( module ) {
/******/ var getter = module && module . _ _esModule ?
/******/ function getDefault ( ) { return module [ 'default' ] ; } :
/******/ function getModuleExports ( ) { return module ; } ;
/******/ _ _webpack _require _ _ . d ( getter , 'a' , getter ) ;
/******/ return getter ;
/******/ } ;
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ _ _webpack _require _ _ . o = function ( object , property ) { return Object . prototype . hasOwnProperty . call ( object , property ) ; } ;
/******/
/******/ // __webpack_public_path__
/******/ _ _webpack _require _ _ . p = "" ;
/******/
/******/
/******/ // Load entry module and return exports
/******/ return _ _webpack _require _ _ ( _ _webpack _require _ _ . s = "IqXm" ) ;
/******/ } )
/************************************************************************/
/******/ ( {
2021-11-30 01:24:27 +01:00
/***/ "0Ene" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( "GRId" ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( "Tqx9" ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
/ * *
* WordPress dependencies
* /
const plugins = Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "SVG" ] , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "Path" ] , {
d : "M10.5 4v4h3V4H15v4h1.5a1 1 0 011 1v4l-3 4v2a1 1 0 01-1 1h-3a1 1 0 01-1-1v-2l-3-4V9a1 1 0 011-1H9V4h1.5zm.5 12.5v2h2v-2l3-4v-3H8v3l3 4z"
} ) ) ;
/* harmony default export */ _ _webpack _exports _ _ [ "a" ] = ( plugins ) ;
/***/ } ) ,
2021-11-09 03:17:17 +01:00
/***/ "1ZqX" :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = window [ "wp" ] [ "data" ] ; } ( ) ) ;
/***/ } ) ,
/***/ "1iEr" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( "GRId" ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( "Tqx9" ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
/ * *
* WordPress dependencies
* /
const chevronRight = Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "SVG" ] , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "Path" ] , {
d : "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"
} ) ) ;
/* harmony default export */ _ _webpack _exports _ _ [ "a" ] = ( chevronRight ) ;
/***/ } ) ,
/***/ "2gm7" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( "GRId" ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( "Tqx9" ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
/ * *
* WordPress dependencies
* /
const chevronLeft = Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "SVG" ] , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "Path" ] , {
d : "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"
} ) ) ;
/* harmony default export */ _ _webpack _exports _ _ [ "a" ] = ( chevronLeft ) ;
/***/ } ) ,
/***/ "51Zz" :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = window [ "wp" ] [ "dataControls" ] ; } ( ) ) ;
/***/ } ) ,
/***/ "6aBm" :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = window [ "wp" ] [ "mediaUtils" ] ; } ( ) ) ;
/***/ } ) ,
/***/ "B9Az" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
// EXTERNAL MODULE: external ["wp","element"]
var external _wp _element _ = _ _webpack _require _ _ ( "GRId" ) ;
// EXTERNAL MODULE: external ["wp","primitives"]
var external _wp _primitives _ = _ _webpack _require _ _ ( "Tqx9" ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pencil.js
/ * *
* WordPress dependencies
* /
const pencil = Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _primitives _ [ "SVG" ] , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _primitives _ [ "Path" ] , {
d : "M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"
} ) ) ;
/* harmony default export */ var library _pencil = ( pencil ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/edit.js
/ * *
* Internal dependencies
* /
/* harmony default export */ var edit = _ _webpack _exports _ _ [ "a" ] = ( library _pencil ) ;
/***/ } ) ,
/***/ "Cg8A" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( "GRId" ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( "Tqx9" ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
/ * *
* WordPress dependencies
* /
const cog = Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "SVG" ] , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "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 */ _ _webpack _exports _ _ [ "a" ] = ( cog ) ;
/***/ } ) ,
/***/ "Civd" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( "GRId" ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( "Tqx9" ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
/ * *
* WordPress dependencies
* /
const layout = Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "SVG" ] , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "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 */ _ _webpack _exports _ _ [ "a" ] = ( layout ) ;
/***/ } ) ,
/***/ "GRId" :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = window [ "wp" ] [ "element" ] ; } ( ) ) ;
/***/ } ) ,
/***/ "HSyU" :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = window [ "wp" ] [ "blocks" ] ; } ( ) ) ;
/***/ } ) ,
/***/ "IqXm" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
// ESM COMPAT FLAG
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
// EXPORTS
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "reinitializeEditor" , function ( ) { return /* binding */ reinitializeEditor ; } ) ;
2021-11-23 06:40:38 +01:00
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "initializeEditor" , function ( ) { return /* binding */ initializeEditor ; } ) ;
2021-11-09 03:17:17 +01:00
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "__experimentalMainDashboardButton" , function ( ) { return /* reexport */ main _dashboard _button ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "__experimentalNavigationToggle" , function ( ) { return /* reexport */ navigation _toggle ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "PluginSidebar" , function ( ) { return /* reexport */ PluginSidebarEditSite ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "PluginSidebarMoreMenuItem" , function ( ) { return /* reexport */ PluginSidebarMoreMenuItem ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "PluginMoreMenuItem" , function ( ) { return /* reexport */ plugin _more _menu _item ; } ) ;
// NAMESPACE OBJECT: ./node_modules/@wordpress/edit-site/build-module/store/actions.js
var actions _namespaceObject = { } ;
_ _webpack _require _ _ . r ( actions _namespaceObject ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "toggleFeature" , function ( ) { return actions _toggleFeature ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "__experimentalSetPreviewDeviceType" , function ( ) { return _ _experimentalSetPreviewDeviceType ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "setTemplate" , function ( ) { return actions _setTemplate ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "addTemplate" , function ( ) { return addTemplate ; } ) ;
2021-11-23 06:40:38 +01:00
_ _webpack _require _ _ . d ( actions _namespaceObject , "removeTemplate" , function ( ) { return actions _removeTemplate ; } ) ;
2021-11-09 03:17:17 +01:00
_ _webpack _require _ _ . d ( actions _namespaceObject , "setTemplatePart" , function ( ) { return actions _setTemplatePart ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "setHomeTemplateId" , function ( ) { return setHomeTemplateId ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "setPage" , function ( ) { return actions _setPage ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "setNavigationPanelActiveMenu" , function ( ) { return setNavigationPanelActiveMenu ; } ) ;
2021-11-23 06:40:38 +01:00
_ _webpack _require _ _ . d ( actions _namespaceObject , "openNavigationPanelToMenu" , function ( ) { return openNavigationPanelToMenu ; } ) ;
2021-11-30 01:24:27 +01:00
_ _webpack _require _ _ . d ( actions _namespaceObject , "setIsNavigationPanelOpened" , function ( ) { return actions _setIsNavigationPanelOpened ; } ) ;
2021-11-09 03:17:17 +01:00
_ _webpack _require _ _ . d ( actions _namespaceObject , "setIsInserterOpened" , function ( ) { return actions _setIsInserterOpened ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "updateSettings" , function ( ) { return actions _updateSettings ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "setIsListViewOpened" , function ( ) { return actions _setIsListViewOpened ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "revertTemplate" , function ( ) { return actions _revertTemplate ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "openGeneralSidebar" , function ( ) { return openGeneralSidebar ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "closeGeneralSidebar" , function ( ) { return closeGeneralSidebar ; } ) ;
// NAMESPACE OBJECT: ./node_modules/@wordpress/edit-site/build-module/store/selectors.js
var selectors _namespaceObject = { } ;
_ _webpack _require _ _ . r ( selectors _namespaceObject ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "isFeatureActive" , function ( ) { return isFeatureActive ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "__experimentalGetPreviewDeviceType" , function ( ) { return selectors _experimentalGetPreviewDeviceType ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "getCanUserCreateMedia" , function ( ) { return getCanUserCreateMedia ; } ) ;
2021-11-30 01:24:27 +01:00
_ _webpack _require _ _ . d ( selectors _namespaceObject , "getReusableBlocks" , function ( ) { return getReusableBlocks ; } ) ;
2021-11-09 03:17:17 +01:00
_ _webpack _require _ _ . d ( selectors _namespaceObject , "getSettings" , function ( ) { return selectors _getSettings ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "getHomeTemplateId" , function ( ) { return getHomeTemplateId ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "getEditedPostType" , function ( ) { return selectors _getEditedPostType ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "getEditedPostId" , function ( ) { return selectors _getEditedPostId ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "getPage" , function ( ) { return selectors _getPage ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "getNavigationPanelActiveMenu" , function ( ) { return getNavigationPanelActiveMenu ; } ) ;
2021-11-23 06:40:38 +01:00
_ _webpack _require _ _ . d ( selectors _namespaceObject , "getCurrentTemplateNavigationPanelSubMenu" , function ( ) { return getCurrentTemplateNavigationPanelSubMenu ; } ) ;
2021-11-09 03:17:17 +01:00
_ _webpack _require _ _ . d ( selectors _namespaceObject , "isNavigationOpened" , function ( ) { return selectors _isNavigationOpened ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "isInserterOpened" , function ( ) { return selectors _isInserterOpened ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "__experimentalGetInsertionPoint" , function ( ) { return _ _experimentalGetInsertionPoint ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "isListViewOpened" , function ( ) { return selectors _isListViewOpened ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "getCurrentTemplateTemplateParts" , function ( ) { return getCurrentTemplateTemplateParts ; } ) ;
// EXTERNAL MODULE: external ["wp","element"]
var external _wp _element _ = _ _webpack _require _ _ ( "GRId" ) ;
// EXTERNAL MODULE: external ["wp","blocks"]
var external _wp _blocks _ = _ _webpack _require _ _ ( "HSyU" ) ;
// EXTERNAL MODULE: external ["wp","blockLibrary"]
var external _wp _blockLibrary _ = _ _webpack _require _ _ ( "QyPg" ) ;
// EXTERNAL MODULE: external ["wp","data"]
var external _wp _data _ = _ _webpack _require _ _ ( "1ZqX" ) ;
// EXTERNAL MODULE: external ["wp","coreData"]
var external _wp _coreData _ = _ _webpack _require _ _ ( "jZUy" ) ;
2021-11-23 06:40:38 +01:00
// EXTERNAL MODULE: external ["wp","editor"]
var external _wp _editor _ = _ _webpack _require _ _ ( "jSdM" ) ;
2022-02-17 20:18:25 +01:00
// EXTERNAL MODULE: external ["wp","i18n"]
var external _wp _i18n _ = _ _webpack _require _ _ ( "l3Sj" ) ;
2021-11-30 01:24:27 +01:00
// EXTERNAL MODULE: external ["wp","viewport"]
var external _wp _viewport _ = _ _webpack _require _ _ ( "KEfo" ) ;
2021-12-14 02:57:26 +01:00
// EXTERNAL MODULE: external ["wp","url"]
var external _wp _url _ = _ _webpack _require _ _ ( "Mmq9" ) ;
2022-02-17 20:18:25 +01:00
// EXTERNAL MODULE: external ["wp","hooks"]
var external _wp _hooks _ = _ _webpack _require _ _ ( "g56x" ) ;
2021-11-09 03:17:17 +01:00
2022-02-17 20:18:25 +01:00
// EXTERNAL MODULE: external ["wp","mediaUtils"]
var external _wp _mediaUtils _ = _ _webpack _require _ _ ( "6aBm" ) ;
2021-11-09 03:17:17 +01:00
2022-02-17 20:18:25 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/hooks/components.js
2021-11-09 03:17:17 +01:00
/ * *
* WordPress dependencies
* /
2022-02-17 20:18:25 +01:00
Object ( external _wp _hooks _ [ "addFilter" ] ) ( 'editor.MediaUpload' , 'core/edit-site/components/media-upload' , ( ) => external _wp _mediaUtils _ [ "MediaUpload" ] ) ;
2021-11-09 03:17:17 +01:00
2022-02-17 20:18:25 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/hooks/index.js
2021-11-09 03:17:17 +01:00
/ * *
2022-02-17 20:18:25 +01:00
* Internal dependencies
2021-11-09 03:17:17 +01:00
* /
// EXTERNAL MODULE: external ["wp","dataControls"]
var external _wp _dataControls _ = _ _webpack _require _ _ ( "51Zz" ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/store/defaults.js
const PREFERENCES _DEFAULTS = {
2021-11-23 06:40:38 +01:00
features : {
welcomeGuide : true ,
welcomeGuideStyles : true
}
2021-11-09 03:17:17 +01:00
} ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/store/constants.js
/ * *
* The identifier for the data store .
*
* @ type { string }
* /
const STORE _NAME = 'core/edit-site' ;
const TEMPLATE _PART _AREA _HEADER = 'header' ;
const TEMPLATE _PART _AREA _FOOTER = 'footer' ;
const TEMPLATE _PART _AREA _SIDEBAR = 'sidebar' ;
const TEMPLATE _PART _AREA _GENERAL = 'uncategorized' ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/navigation-sidebar/navigation-panel/constants.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
const TEMPLATES _PRIMARY = [ 'index' , 'singular' , 'archive' , 'single' , 'page' , 'home' , '404' , 'search' ] ;
const TEMPLATES _SECONDARY = [ 'author' , 'category' , 'taxonomy' , 'date' , 'tag' , 'attachment' , 'single-post' , 'front-page' ] ;
const TEMPLATES _TOP _LEVEL = [ ... TEMPLATES _PRIMARY , ... TEMPLATES _SECONDARY ] ;
const TEMPLATES _GENERAL = [ 'page-home' ] ;
const TEMPLATES _POSTS _PREFIXES = [ 'post-' , 'author-' , 'single-post-' , 'tag-' ] ;
const TEMPLATES _PAGES _PREFIXES = [ 'page-' ] ;
const TEMPLATE _OVERRIDES = {
singular : [ 'single' , 'page' ] ,
index : [ 'archive' , '404' , 'search' , 'singular' , 'home' ] ,
home : [ 'front-page' ]
} ;
const MENU _ROOT = 'root' ;
const MENU _TEMPLATE _PARTS = 'template-parts' ;
const MENU _TEMPLATES = 'templates' ;
const MENU _TEMPLATES _GENERAL = 'templates-general' ;
const MENU _TEMPLATES _PAGES = 'templates-pages' ;
const MENU _TEMPLATES _POSTS = 'templates-posts' ;
const MENU _TEMPLATES _UNUSED = 'templates-unused' ;
const MENU _TEMPLATE _PARTS _HEADERS = 'template-parts-headers' ;
const MENU _TEMPLATE _PARTS _FOOTERS = 'template-parts-footers' ;
const MENU _TEMPLATE _PARTS _SIDEBARS = 'template-parts-sidebars' ;
const MENU _TEMPLATE _PARTS _GENERAL = 'template-parts-general' ;
const TEMPLATE _PARTS _SUB _MENUS = [ {
area : TEMPLATE _PART _AREA _HEADER ,
menu : MENU _TEMPLATE _PARTS _HEADERS ,
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'headers' )
} , {
area : TEMPLATE _PART _AREA _FOOTER ,
menu : MENU _TEMPLATE _PARTS _FOOTERS ,
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'footers' )
} , {
area : TEMPLATE _PART _AREA _SIDEBAR ,
menu : MENU _TEMPLATE _PARTS _SIDEBARS ,
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'sidebars' )
} , {
area : TEMPLATE _PART _AREA _GENERAL ,
menu : MENU _TEMPLATE _PARTS _GENERAL ,
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'general' )
} ] ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/store/reducer.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
/ * *
* Reducer returning the user preferences .
*
* @ param { Object } state Current state .
* @ param { Object } action Dispatched action .
* @ return { Object } Updated state .
* /
const preferences = Object ( external _wp _data _ [ "combineReducers" ] ) ( {
2021-11-15 13:50:17 +01:00
features ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : PREFERENCES _DEFAULTS . features ;
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2021-11-09 03:17:17 +01:00
switch ( action . type ) {
case 'TOGGLE_FEATURE' :
{
return { ... state ,
[ action . feature ] : ! state [ action . feature ]
} ;
}
default :
return state ;
}
}
} ) ;
/ * *
* Reducer returning the editing canvas device type .
*
* @ param { Object } state Current state .
* @ param { Object } action Dispatched action .
*
* @ return { Object } Updated state .
* /
2021-11-15 13:50:17 +01:00
function reducer _deviceType ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : 'Desktop' ;
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2021-11-09 03:17:17 +01:00
switch ( action . type ) {
case 'SET_PREVIEW_DEVICE_TYPE' :
return action . deviceType ;
}
return state ;
}
/ * *
* Reducer returning the settings .
*
* @ param { Object } state Current state .
* @ param { Object } action Dispatched action .
*
* @ return { Object } Updated state .
* /
2021-11-15 13:50:17 +01:00
function reducer _settings ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2021-11-09 03:17:17 +01:00
switch ( action . type ) {
case 'UPDATE_SETTINGS' :
return { ... state ,
... action . settings
} ;
}
return state ;
}
/ * *
* Reducer keeping track of the currently edited Post Type ,
* Post Id and the context provided to fill the content of the block editor .
*
2021-12-14 02:57:26 +01:00
* @ param { Object } state Current edited post .
2021-11-09 03:17:17 +01:00
* @ param { Object } action Dispatched action .
*
2021-12-14 02:57:26 +01:00
* @ return { Object } Updated state .
2021-11-09 03:17:17 +01:00
* /
2021-11-15 13:50:17 +01:00
function editedPost ( ) {
2021-12-14 02:57:26 +01:00
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
2021-11-15 13:50:17 +01:00
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2021-11-09 03:17:17 +01:00
switch ( action . type ) {
case 'SET_TEMPLATE' :
case 'SET_PAGE' :
2021-12-14 02:57:26 +01:00
return {
2021-11-09 03:17:17 +01:00
type : 'wp_template' ,
id : action . templateId ,
page : action . page
2021-12-14 02:57:26 +01:00
} ;
2021-11-09 03:17:17 +01:00
case 'SET_TEMPLATE_PART' :
2021-12-14 02:57:26 +01:00
return {
2021-11-09 03:17:17 +01:00
type : 'wp_template_part' ,
id : action . templatePartId
2021-12-14 02:57:26 +01:00
} ;
2021-11-09 03:17:17 +01:00
}
return state ;
}
/ * *
* Reducer for information about the site ' s homepage .
*
* @ param { Object } state Current state .
* @ param { Object } action Dispatched action .
*
* @ return { Object } Updated state .
* /
function homeTemplateId ( state , action ) {
switch ( action . type ) {
case 'SET_HOME_TEMPLATE' :
return action . homeTemplateId ;
}
return state ;
}
/ * *
* Reducer for information about the navigation panel , such as its active menu
* and whether it should be opened or closed .
*
* Note : this reducer interacts with the inserter and list view panels reducers
* to make sure that only one of the three panels is open at the same time .
*
* @ param { Object } state Current state .
* @ param { Object } action Dispatched action .
* /
2021-11-15 13:50:17 +01:00
function navigationPanel ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : {
menu : MENU _ROOT ,
isOpen : false
} ;
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2021-11-09 03:17:17 +01:00
switch ( action . type ) {
case 'SET_NAVIGATION_PANEL_ACTIVE_MENU' :
return { ... state ,
menu : action . menu
} ;
case 'OPEN_NAVIGATION_PANEL_TO_MENU' :
return { ... state ,
isOpen : true ,
menu : action . menu
} ;
case 'SET_IS_NAVIGATION_PANEL_OPENED' :
return { ... state ,
menu : ! action . isOpen ? MENU _ROOT : state . menu ,
// Set menu to root when closing panel.
isOpen : action . isOpen
} ;
case 'SET_IS_LIST_VIEW_OPENED' :
return { ... state ,
menu : state . isOpen && action . isOpen ? MENU _ROOT : state . menu ,
// Set menu to root when closing panel.
isOpen : action . isOpen ? false : state . isOpen
} ;
case 'SET_IS_INSERTER_OPENED' :
return { ... state ,
menu : state . isOpen && action . value ? MENU _ROOT : state . menu ,
// Set menu to root when closing panel.
isOpen : action . value ? false : state . isOpen
} ;
}
return state ;
}
/ * *
* Reducer to set the block inserter panel open or closed .
*
* Note : this reducer interacts with the navigation and list view panels reducers
* to make sure that only one of the three panels is open at the same time .
*
* @ param { boolean | Object } state Current state .
* @ param { Object } action Dispatched action .
* /
2021-11-15 13:50:17 +01:00
function blockInserterPanel ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : false ;
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2021-11-09 03:17:17 +01:00
switch ( action . type ) {
case 'OPEN_NAVIGATION_PANEL_TO_MENU' :
return false ;
case 'SET_IS_NAVIGATION_PANEL_OPENED' :
case 'SET_IS_LIST_VIEW_OPENED' :
return action . isOpen ? false : state ;
case 'SET_IS_INSERTER_OPENED' :
return action . value ;
}
return state ;
}
/ * *
* Reducer to set the list view panel open or closed .
*
* Note : this reducer interacts with the navigation and inserter panels reducers
* to make sure that only one of the three panels is open at the same time .
*
* @ param { Object } state Current state .
* @ param { Object } action Dispatched action .
* /
2021-11-15 13:50:17 +01:00
function listViewPanel ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : false ;
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2021-11-09 03:17:17 +01:00
switch ( action . type ) {
case 'OPEN_NAVIGATION_PANEL_TO_MENU' :
return false ;
case 'SET_IS_NAVIGATION_PANEL_OPENED' :
return action . isOpen ? false : state ;
case 'SET_IS_INSERTER_OPENED' :
return action . value ? false : state ;
case 'SET_IS_LIST_VIEW_OPENED' :
return action . isOpen ;
}
return state ;
}
/* harmony default export */ var reducer = ( Object ( external _wp _data _ [ "combineReducers" ] ) ( {
preferences ,
deviceType : reducer _deviceType ,
settings : reducer _settings ,
editedPost ,
homeTemplateId ,
navigationPanel ,
blockInserterPanel ,
listViewPanel
} ) ) ;
2022-02-17 20:18:25 +01:00
// EXTERNAL MODULE: external ["wp","notices"]
var external _wp _notices _ = _ _webpack _require _ _ ( "onLe" ) ;
2021-12-14 02:57:26 +01:00
// EXTERNAL MODULE: ./node_modules/@wordpress/interface/build-module/index.js + 17 modules
var build _module = _ _webpack _require _ _ ( "U60i" ) ;
2021-11-09 03:17:17 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/utils/is-template-revertable.js
/ * *
* Check if a template is revertable to its original theme - provided template file .
*
* @ param { Object } template The template entity to check .
* @ return { boolean } Whether the template is revertable .
* /
function isTemplateRevertable ( template ) {
if ( ! template ) {
return false ;
}
/* eslint-disable camelcase */
return ( template === null || template === void 0 ? void 0 : template . source ) === 'custom' && ( template === null || template === void 0 ? void 0 : template . has _theme _file ) ;
/* eslint-enable camelcase */
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/store/actions.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
/ * *
* Returns an action object used to toggle a feature flag .
*
* @ param { string } feature Feature name .
*
* @ return { Object } Action object .
* /
function actions _toggleFeature ( feature ) {
return {
type : 'TOGGLE_FEATURE' ,
feature
} ;
}
/ * *
* Returns an action object used to toggle the width of the editing canvas .
*
* @ param { string } deviceType
*
* @ return { Object } Action object .
* /
function _ _experimentalSetPreviewDeviceType ( deviceType ) {
return {
type : 'SET_PREVIEW_DEVICE_TYPE' ,
deviceType
} ;
}
/ * *
* Returns an action object used to set a template .
*
* @ param { number } templateId The template ID .
* @ param { string } templateSlug The template slug .
* @ return { Object } Action object .
* /
function * actions _setTemplate ( templateId , templateSlug ) {
const pageContext = {
templateSlug
} ;
if ( ! templateSlug ) {
const template = yield external _wp _data _ [ "controls" ] . resolveSelect ( external _wp _coreData _ [ "store" ] , 'getEntityRecord' , 'postType' , 'wp_template' , templateId ) ;
pageContext . templateSlug = template === null || template === void 0 ? void 0 : template . slug ;
}
return {
type : 'SET_TEMPLATE' ,
templateId ,
page : {
context : pageContext
}
} ;
}
/ * *
* Adds a new template , and sets it as the current template .
*
* @ param { Object } template The template .
*
* @ return { Object } Action object used to set the current template .
* /
function * addTemplate ( template ) {
const newTemplate = yield external _wp _data _ [ "controls" ] . dispatch ( external _wp _coreData _ [ "store" ] , 'saveEntityRecord' , 'postType' , 'wp_template' , template ) ;
if ( template . content ) {
yield external _wp _data _ [ "controls" ] . dispatch ( external _wp _coreData _ [ "store" ] , 'editEntityRecord' , 'postType' , 'wp_template' , newTemplate . id , {
blocks : Object ( external _wp _blocks _ [ "parse" ] ) ( template . content )
} , {
undoIgnore : true
} ) ;
}
return {
type : 'SET_TEMPLATE' ,
templateId : newTemplate . id ,
page : {
context : {
templateSlug : newTemplate . slug
}
}
} ;
}
/ * *
2021-11-23 06:40:38 +01:00
* Removes a template .
2021-11-09 03:17:17 +01:00
*
2021-11-23 06:40:38 +01:00
* @ param { Object } template The template object .
2021-11-09 03:17:17 +01:00
* /
2021-11-23 06:40:38 +01:00
function * actions _removeTemplate ( template ) {
2021-11-30 01:24:27 +01:00
try {
yield external _wp _data _ [ "controls" ] . dispatch ( external _wp _coreData _ [ "store" ] , 'deleteEntityRecord' , 'postType' , template . type , template . id , {
force : true
} ) ;
const lastError = yield external _wp _data _ [ "controls" ] . select ( external _wp _coreData _ [ "store" ] , 'getLastEntityDeleteError' , 'postType' , template . type , template . id ) ;
if ( lastError ) {
throw lastError ;
}
yield external _wp _data _ [ "controls" ] . dispatch ( external _wp _notices _ [ "store" ] , 'createSuccessNotice' , Object ( external _wp _i18n _ [ "sprintf" ] ) (
/* translators: The template/part's name. */
Object ( external _wp _i18n _ [ "__" ] ) ( '"%s" removed.' ) , template . title . rendered ) , {
type : 'snackbar'
} ) ;
} catch ( error ) {
const errorMessage = error . message && error . code !== 'unknown_error' ? error . message : Object ( external _wp _i18n _ [ "__" ] ) ( 'An error occurred while deleting the template.' ) ;
yield external _wp _data _ [ "controls" ] . dispatch ( external _wp _notices _ [ "store" ] , 'createErrorNotice' , errorMessage , {
type : 'snackbar'
} ) ;
}
2021-11-09 03:17:17 +01:00
}
/ * *
* Returns an action object used to set a template part .
*
* @ param { string } templatePartId The template part ID .
*
* @ return { Object } Action object .
* /
function actions _setTemplatePart ( templatePartId ) {
return {
type : 'SET_TEMPLATE_PART' ,
templatePartId
} ;
}
/ * *
* Updates the homeTemplateId state with the templateId of the page resolved
* from the given path .
*
* @ param { number } homeTemplateId The template ID for the homepage .
* /
function setHomeTemplateId ( homeTemplateId ) {
return {
type : 'SET_HOME_TEMPLATE' ,
homeTemplateId
} ;
}
/ * *
* Resolves the template for a page and displays both . If no path is given , attempts
* to use the postId to generate a path like ` ?p= ${ postId } ` .
*
* @ param { Object } page The page object .
* @ param { string } page . type The page type .
* @ param { string } page . slug The page slug .
* @ param { string } page . path The page path .
* @ param { Object } page . context The page context .
*
* @ return { number } The resolved template ID for the page route .
* /
function * actions _setPage ( page ) {
var _page$context ;
if ( ! page . path && ( _page$context = page . context ) !== null && _page$context !== void 0 && _page$context . postId ) {
const entity = yield external _wp _data _ [ "controls" ] . resolveSelect ( external _wp _coreData _ [ "store" ] , 'getEntityRecord' , 'postType' , page . context . postType || 'post' , page . context . postId ) ;
page . path = Object ( external _wp _url _ [ "getPathAndQueryString" ] ) ( entity . link ) ;
}
2022-02-17 20:18:25 +01:00
const template = yield external _wp _data _ [ "controls" ] . resolveSelect ( external _wp _coreData _ [ "store" ] , '__experimentalGetTemplateForLink' , page . path ) ;
if ( ! template ) {
return ;
}
2021-11-09 03:17:17 +01:00
const {
id : templateId ,
slug : templateSlug
2022-02-17 20:18:25 +01:00
} = template ;
2021-11-09 03:17:17 +01:00
yield {
type : 'SET_PAGE' ,
page : ! templateSlug ? page : { ... page ,
context : { ... page . context ,
templateSlug
}
} ,
templateId
} ;
return templateId ;
}
/ * *
* Returns an action object used to set the active navigation panel menu .
*
* @ param { string } menu Menu prop of active menu .
*
* @ return { Object } Action object .
* /
function setNavigationPanelActiveMenu ( menu ) {
return {
type : 'SET_NAVIGATION_PANEL_ACTIVE_MENU' ,
menu
} ;
}
/ * *
* Opens the navigation panel and sets its active menu at the same time .
*
* @ param { string } menu Identifies the menu to open .
* /
2021-11-23 06:40:38 +01:00
function openNavigationPanelToMenu ( menu ) {
2021-11-09 03:17:17 +01:00
return {
type : 'OPEN_NAVIGATION_PANEL_TO_MENU' ,
menu
} ;
}
/ * *
* Sets whether the navigation panel should be open .
*
* @ param { boolean } isOpen If true , opens the nav panel . If false , closes it . It
* does not toggle the state , but sets it directly .
* /
2021-11-30 01:24:27 +01:00
function actions _setIsNavigationPanelOpened ( isOpen ) {
2021-11-09 03:17:17 +01:00
return {
type : 'SET_IS_NAVIGATION_PANEL_OPENED' ,
isOpen
} ;
}
/ * *
* 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 .
* /
function actions _setIsInserterOpened ( value ) {
return {
type : 'SET_IS_INSERTER_OPENED' ,
value
} ;
}
/ * *
* Returns an action object used to update the settings .
*
* @ param { Object } settings New settings .
*
* @ return { Object } Action object .
* /
function actions _updateSettings ( settings ) {
return {
type : 'UPDATE_SETTINGS' ,
settings
} ;
}
/ * *
* Sets whether the list view panel should be open .
*
* @ param { boolean } isOpen If true , opens the list view . If false , closes it .
* It does not toggle the state , but sets it directly .
* /
function actions _setIsListViewOpened ( isOpen ) {
return {
type : 'SET_IS_LIST_VIEW_OPENED' ,
isOpen
} ;
}
/ * *
* Reverts a template to its original theme - provided file .
*
2021-11-30 01:24:27 +01:00
* @ param { Object } template The template to revert .
* @ param { Object } [ options ]
* @ param { boolean } [ options . allowUndo ] Whether to allow the user to undo
* reverting the template . Default true .
2021-11-09 03:17:17 +01:00
* /
function * actions _revertTemplate ( template ) {
2021-11-30 01:24:27 +01:00
let {
allowUndo = true
} = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : { } ;
2021-11-09 03:17:17 +01:00
if ( ! isTemplateRevertable ( template ) ) {
yield external _wp _data _ [ "controls" ] . dispatch ( external _wp _notices _ [ "store" ] , 'createErrorNotice' , Object ( external _wp _i18n _ [ "__" ] ) ( 'This template is not revertable.' ) , {
type : 'snackbar'
} ) ;
return ;
}
try {
var _fileTemplate$content ;
const templateEntity = yield external _wp _data _ [ "controls" ] . select ( external _wp _coreData _ [ "store" ] , 'getEntity' , 'postType' , template . type ) ;
if ( ! templateEntity ) {
yield external _wp _data _ [ "controls" ] . dispatch ( external _wp _notices _ [ "store" ] , 'createErrorNotice' , Object ( external _wp _i18n _ [ "__" ] ) ( 'The editor has encountered an unexpected error. Please reload.' ) , {
type : 'snackbar'
} ) ;
return ;
}
const fileTemplatePath = Object ( external _wp _url _ [ "addQueryArgs" ] ) ( ` ${ templateEntity . baseURL } / ${ template . id } ` , {
context : 'edit' ,
source : 'theme'
} ) ;
const fileTemplate = yield Object ( external _wp _dataControls _ [ "apiFetch" ] ) ( {
path : fileTemplatePath
} ) ;
if ( ! fileTemplate ) {
yield external _wp _data _ [ "controls" ] . dispatch ( external _wp _notices _ [ "store" ] , 'createErrorNotice' , Object ( external _wp _i18n _ [ "__" ] ) ( 'The editor has encountered an unexpected error. Please reload.' ) , {
type : 'snackbar'
} ) ;
return ;
}
2021-11-15 13:50:17 +01:00
const serializeBlocks = _ref => {
let {
blocks : blocksForSerialization = [ ]
} = _ref ;
return Object ( external _wp _blocks _ [ "__unstableSerializeAndClean" ] ) ( blocksForSerialization ) ;
} ;
2021-11-09 03:17:17 +01:00
const edited = yield external _wp _data _ [ "controls" ] . select ( external _wp _coreData _ [ "store" ] , 'getEditedEntityRecord' , 'postType' , template . type , template . id ) ; // We are fixing up the undo level here to make sure we can undo
// the revert in the header toolbar correctly.
yield external _wp _data _ [ "controls" ] . dispatch ( external _wp _coreData _ [ "store" ] , 'editEntityRecord' , 'postType' , template . type , template . id , {
content : serializeBlocks ,
// required to make the `undo` behave correctly
blocks : edited . blocks ,
// required to revert the blocks in the editor
source : 'custom' // required to avoid turning the editor into a dirty state
} , {
undoIgnore : true // required to merge this edit with the last undo level
} ) ;
const blocks = Object ( external _wp _blocks _ [ "parse" ] ) ( fileTemplate === null || fileTemplate === void 0 ? void 0 : ( _fileTemplate$content = fileTemplate . content ) === null || _fileTemplate$content === void 0 ? void 0 : _fileTemplate$content . raw ) ;
yield external _wp _data _ [ "controls" ] . dispatch ( external _wp _coreData _ [ "store" ] , 'editEntityRecord' , 'postType' , template . type , fileTemplate . id , {
content : serializeBlocks ,
blocks ,
source : 'theme'
} ) ;
2021-11-30 01:24:27 +01:00
if ( allowUndo ) {
const undoRevert = async ( ) => {
await Object ( external _wp _data _ [ "dispatch" ] ) ( external _wp _coreData _ [ "store" ] ) . editEntityRecord ( 'postType' , template . type , edited . id , {
content : serializeBlocks ,
blocks : edited . blocks ,
source : 'custom'
} ) ;
} ;
2021-11-09 03:17:17 +01:00
2021-11-30 01:24:27 +01:00
yield external _wp _data _ [ "controls" ] . dispatch ( external _wp _notices _ [ "store" ] , 'createSuccessNotice' , Object ( external _wp _i18n _ [ "__" ] ) ( 'Template reverted.' ) , {
type : 'snackbar' ,
actions : [ {
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Undo' ) ,
onClick : undoRevert
} ]
} ) ;
} else {
yield external _wp _data _ [ "controls" ] . dispatch ( external _wp _notices _ [ "store" ] , 'createSuccessNotice' , Object ( external _wp _i18n _ [ "__" ] ) ( 'Template reverted.' ) ) ;
}
2021-11-09 03:17:17 +01:00
} catch ( error ) {
const errorMessage = error . message && error . code !== 'unknown_error' ? error . message : Object ( external _wp _i18n _ [ "__" ] ) ( 'Template revert failed. Please reload.' ) ;
yield external _wp _data _ [ "controls" ] . dispatch ( external _wp _notices _ [ "store" ] , 'createErrorNotice' , errorMessage , {
type : 'snackbar'
} ) ;
}
}
/ * *
* Returns an action object used in signalling that the user opened an editor sidebar .
*
* @ param { ? string } name Sidebar name to be opened .
*
* @ yield { Object } Action object .
* /
function * openGeneralSidebar ( name ) {
yield external _wp _data _ [ "controls" ] . dispatch ( build _module [ "i" /* store */ ] , 'enableComplementaryArea' , STORE _NAME , name ) ;
}
/ * *
* Returns an action object signalling that the user closed the sidebar .
*
* @ yield { Object } Action object .
* /
function * closeGeneralSidebar ( ) {
yield external _wp _data _ [ "controls" ] . dispatch ( build _module [ "i" /* store */ ] , 'disableComplementaryArea' , STORE _NAME ) ;
}
2022-02-17 20:18:25 +01:00
// EXTERNAL MODULE: external "lodash"
var external _lodash _ = _ _webpack _require _ _ ( "YLtl" ) ;
2021-11-09 03:17:17 +01:00
// EXTERNAL MODULE: ./node_modules/rememo/es/rememo.js
var rememo = _ _webpack _require _ _ ( "pPDe" ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/navigation-sidebar/navigation-panel/template-hierarchy.js
/ * *
* External dependencies
* /
/ * *
* Internal dependencies
* /
function isTemplateSuperseded ( slug , existingSlugs , showOnFront ) {
if ( ! TEMPLATE _OVERRIDES [ slug ] ) {
return false ;
} // `home` template is unused if it is superseded by `front-page`
// or "show on front" is set to show a page rather than blog posts.
if ( slug === 'home' && showOnFront !== 'posts' ) {
return true ;
}
return TEMPLATE _OVERRIDES [ slug ] . every ( overrideSlug => existingSlugs . includes ( overrideSlug ) || isTemplateSuperseded ( overrideSlug , existingSlugs , showOnFront ) ) ;
}
function getTemplateLocation ( slug ) {
const isTopLevelTemplate = TEMPLATES _TOP _LEVEL . includes ( slug ) ;
if ( isTopLevelTemplate ) {
return MENU _TEMPLATES ;
}
const isGeneralTemplate = TEMPLATES _GENERAL . includes ( slug ) ;
if ( isGeneralTemplate ) {
return MENU _TEMPLATES _GENERAL ;
}
const isPostsTemplate = TEMPLATES _POSTS _PREFIXES . some ( prefix => slug . startsWith ( prefix ) ) ;
if ( isPostsTemplate ) {
return MENU _TEMPLATES _POSTS ;
}
const isPagesTemplate = TEMPLATES _PAGES _PREFIXES . some ( prefix => slug . startsWith ( prefix ) ) ;
if ( isPagesTemplate ) {
return MENU _TEMPLATES _PAGES ;
}
return MENU _TEMPLATES _GENERAL ;
}
function getUnusedTemplates ( templates , showOnFront ) {
const templateSlugs = Object ( external _lodash _ [ "map" ] ) ( templates , 'slug' ) ;
2021-11-15 13:50:17 +01:00
const supersededTemplates = templates . filter ( _ref => {
let {
slug
} = _ref ;
return isTemplateSuperseded ( slug , templateSlugs , showOnFront ) ;
} ) ;
2021-11-09 03:17:17 +01:00
return supersededTemplates ;
}
function getTemplatesLocationMap ( templates ) {
return templates . reduce ( ( obj , template ) => {
obj [ template . slug ] = getTemplateLocation ( template . slug ) ;
return obj ;
} , { } ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/store/selectors.js
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
2021-11-30 01:24:27 +01:00
2021-11-09 03:17:17 +01:00
/ * *
* Internal dependencies
* /
/ * *
* @ typedef { 'template' | 'template_type' } TemplateType Template type .
* /
/ * *
* Returns whether the given feature is enabled or not .
*
* @ param { Object } state Global application state .
* @ param { string } feature Feature slug .
*
* @ return { boolean } Is active .
* /
function isFeatureActive ( state , feature ) {
return Object ( external _lodash _ [ "get" ] ) ( state . preferences . features , [ feature ] , false ) ;
}
/ * *
* Returns the current editing canvas device type .
*
* @ param { Object } state Global application state .
*
* @ return { string } Device type .
* /
function selectors _experimentalGetPreviewDeviceType ( state ) {
return state . deviceType ;
}
/ * *
* Returns whether the current user can create media or not .
*
* @ param { Object } state Global application state .
*
* @ return { Object } Whether the current user can create media or not .
* /
const getCanUserCreateMedia = Object ( external _wp _data _ [ "createRegistrySelector" ] ) ( select => ( ) => select ( external _wp _coreData _ [ "store" ] ) . canUser ( 'create' , 'media' ) ) ;
2021-11-30 01:24:27 +01:00
/ * *
* Returns any available Reusable blocks .
*
* @ param { Object } state Global application state .
*
* @ return { Array } The available reusable blocks .
* /
const getReusableBlocks = Object ( external _wp _data _ [ "createRegistrySelector" ] ) ( select => ( ) => {
const isWeb = external _wp _element _ [ "Platform" ] . OS === 'web' ;
return isWeb ? select ( external _wp _coreData _ [ "store" ] ) . getEntityRecords ( 'postType' , 'wp_block' , {
per _page : - 1
} ) : [ ] ;
} ) ;
2021-11-09 03:17:17 +01:00
/ * *
* Returns the settings , taking into account active features and permissions .
*
* @ param { Object } state Global application state .
* @ param { Function } setIsInserterOpen Setter for the open state of the global inserter .
*
* @ return { Object } Settings .
* /
const selectors _getSettings = Object ( rememo [ "a" /* default */ ] ) ( ( state , setIsInserterOpen ) => {
const settings = { ... state . settings ,
outlineMode : true ,
focusMode : isFeatureActive ( state , 'focusMode' ) ,
hasFixedToolbar : isFeatureActive ( state , 'fixedToolbar' ) ,
2021-11-30 01:24:27 +01:00
_ _experimentalSetIsInserterOpened : setIsInserterOpen ,
_ _experimentalReusableBlocks : getReusableBlocks ( state )
2021-11-09 03:17:17 +01:00
} ;
const canUserCreateMedia = getCanUserCreateMedia ( state ) ;
if ( ! canUserCreateMedia ) {
return settings ;
}
2021-11-15 13:50:17 +01:00
settings . mediaUpload = _ref => {
let {
onError ,
... rest
} = _ref ;
2021-11-09 03:17:17 +01:00
Object ( external _wp _mediaUtils _ [ "uploadMedia" ] ) ( {
wpAllowedMimeTypes : state . settings . allowedMimeTypes ,
2021-11-15 13:50:17 +01:00
onError : _ref2 => {
let {
message
} = _ref2 ;
return onError ( message ) ;
} ,
2021-11-09 03:17:17 +01:00
... rest
} ) ;
} ;
return settings ;
2021-11-30 01:24:27 +01:00
} , state => [ getCanUserCreateMedia ( state ) , state . settings , isFeatureActive ( state , 'focusMode' ) , isFeatureActive ( state , 'fixedToolbar' ) , getReusableBlocks ( state ) ] ) ;
2021-11-09 03:17:17 +01:00
/ * *
* Returns the current home template ID .
*
* @ param { Object } state Global application state .
*
* @ return { number ? } Home template ID .
* /
function getHomeTemplateId ( state ) {
return state . homeTemplateId ;
}
function getCurrentEditedPost ( state ) {
2021-12-14 02:57:26 +01:00
return state . editedPost ;
2021-11-09 03:17:17 +01:00
}
/ * *
* Returns the current edited post type ( wp _template or wp _template _part ) .
*
* @ param { Object } state Global application state .
*
* @ return { TemplateType ? } Template type .
* /
function selectors _getEditedPostType ( state ) {
return getCurrentEditedPost ( state ) . type ;
}
/ * *
* Returns the ID of the currently edited template or template part .
*
* @ param { Object } state Global application state .
*
* @ return { string ? } Post ID .
* /
function selectors _getEditedPostId ( state ) {
return getCurrentEditedPost ( state ) . id ;
}
/ * *
* Returns the current page object .
*
* @ param { Object } state Global application state .
*
* @ return { Object } Page .
* /
function selectors _getPage ( state ) {
return getCurrentEditedPost ( state ) . page ;
}
/ * *
* Returns the active menu in the navigation panel .
*
* @ param { Object } state Global application state .
*
* @ return { string } Active menu .
* /
function getNavigationPanelActiveMenu ( state ) {
return state . navigationPanel . menu ;
}
/ * *
* Returns the current template or template part ' s corresponding
* navigation panel ' s sub menu , to be used with ` openNavigationPanelToMenu ` .
*
* @ param { Object } state Global application state .
*
* @ return { string } The current template or template part ' s sub menu .
* /
2021-11-23 06:40:38 +01:00
const getCurrentTemplateNavigationPanelSubMenu = Object ( external _wp _data _ [ "createRegistrySelector" ] ) ( select => state => {
2021-11-09 03:17:17 +01:00
const templateType = selectors _getEditedPostType ( state ) ;
const templateId = selectors _getEditedPostId ( state ) ;
const template = templateId ? select ( external _wp _coreData _ [ "store" ] ) . getEntityRecord ( 'postType' , templateType , templateId ) : null ;
if ( ! template ) {
return MENU _ROOT ;
}
if ( 'wp_template_part' === templateType ) {
var _TEMPLATE _PARTS _SUB _M ;
return ( ( _TEMPLATE _PARTS _SUB _M = TEMPLATE _PARTS _SUB _MENUS . find ( submenu => submenu . area === ( template === null || template === void 0 ? void 0 : template . area ) ) ) === null || _TEMPLATE _PARTS _SUB _M === void 0 ? void 0 : _TEMPLATE _PARTS _SUB _M . menu ) || MENU _TEMPLATE _PARTS ;
}
const templates = select ( external _wp _coreData _ [ "store" ] ) . getEntityRecords ( 'postType' , 'wp_template' ) ;
const showOnFront = select ( external _wp _coreData _ [ "store" ] ) . getEditedEntityRecord ( 'root' , 'site' ) . show _on _front ;
if ( isTemplateSuperseded ( template . slug , Object ( external _lodash _ [ "map" ] ) ( templates , 'slug' ) , showOnFront ) ) {
return MENU _TEMPLATES _UNUSED ;
}
return getTemplateLocation ( template . slug ) ;
} ) ;
/ * *
* Returns the current opened / closed state of the navigation panel .
*
* @ param { Object } state Global application state .
*
* @ return { boolean } True if the navigation panel should be open ; false if closed .
* /
function selectors _isNavigationOpened ( state ) {
return state . navigationPanel . isOpen ;
}
/ * *
* Returns the current opened / closed state of the inserter panel .
*
* @ param { Object } state Global application state .
*
* @ return { boolean } True if the inserter panel should be open ; false if closed .
* /
function selectors _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 .
* /
function _ _experimentalGetInsertionPoint ( state ) {
const {
rootClientId ,
insertionIndex ,
filterValue
} = state . blockInserterPanel ;
return {
rootClientId ,
insertionIndex ,
filterValue
} ;
}
/ * *
* Returns the current opened / closed state of the list view panel .
*
* @ param { Object } state Global application state .
*
* @ return { boolean } True if the list view panel should be open ; false if closed .
* /
function selectors _isListViewOpened ( state ) {
return state . listViewPanel ;
}
/ * *
* Returns the template parts and their blocks for the current edited template .
*
* @ param { Object } state Global application state .
* @ return { Array } Template parts and their blocks in an array .
* /
const getCurrentTemplateTemplateParts = Object ( external _wp _data _ [ "createRegistrySelector" ] ) ( select => state => {
var _template$blocks ;
const templateType = selectors _getEditedPostType ( state ) ;
const templateId = selectors _getEditedPostId ( state ) ;
const template = select ( external _wp _coreData _ [ "store" ] ) . getEditedEntityRecord ( 'postType' , templateType , templateId ) ;
2021-11-30 01:24:27 +01:00
const templateParts = select ( external _wp _coreData _ [ "store" ] ) . getEntityRecords ( 'postType' , 'wp_template_part' , {
per _page : - 1
} ) ;
2021-11-09 03:17:17 +01:00
const templatePartsById = Object ( external _lodash _ [ "keyBy" ] ) ( templateParts , templatePart => templatePart . id ) ;
return ( ( _template$blocks = template . blocks ) !== null && _template$blocks !== void 0 ? _template$blocks : [ ] ) . filter ( block => Object ( external _wp _blocks _ [ "isTemplatePart" ] ) ( block ) ) . map ( block => {
const {
attributes : {
theme ,
slug
}
} = block ;
const templatePartId = ` ${ theme } // ${ slug } ` ;
const templatePart = templatePartsById [ templatePartId ] ;
return {
templatePart ,
block
} ;
2021-11-15 13:50:17 +01:00
} ) . filter ( _ref3 => {
let {
templatePart
} = _ref3 ;
return ! ! templatePart ;
} ) ;
2021-11-09 03:17:17 +01:00
} ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/store/index.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
const storeConfig = {
reducer : reducer ,
actions : actions _namespaceObject ,
selectors : selectors _namespaceObject ,
controls : external _wp _dataControls _ [ "controls" ] ,
persist : [ 'preferences' ]
} ;
const store = Object ( external _wp _data _ [ "createReduxStore" ] ) ( STORE _NAME , storeConfig ) ; // 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.
Object ( external _wp _data _ [ "registerStore" ] ) ( STORE _NAME , storeConfig ) ;
2022-02-17 20:18:25 +01:00
// EXTERNAL MODULE: external ["wp","components"]
var external _wp _components _ = _ _webpack _require _ _ ( "tI+e" ) ;
2021-11-23 06:40:38 +01:00
2021-12-14 02:57:26 +01:00
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
var esm _extends = _ _webpack _require _ _ ( "wx14" ) ;
// CONCATENATED MODULE: ./node_modules/history/index.js
2021-12-21 08:02:34 +01:00
var r , B = r || ( r = { } ) ; B . Pop = "POP" ; B . Push = "PUSH" ; B . Replace = "REPLACE" ; var C = false ? undefined : function ( b ) { return b } ; function D ( b , h ) { if ( ! b ) { "undefined" !== typeof console && console . warn ( h ) ; try { throw Error ( h ) ; } catch ( e ) { } } } function E ( b ) { b . preventDefault ( ) ; b . returnValue = "" }
function F ( ) { var b = [ ] ; return { get length ( ) { return b . length } , push : function ( h ) { b . push ( h ) ; return function ( ) { b = b . filter ( function ( e ) { return e !== h } ) } } , call : function ( h ) { b . forEach ( function ( e ) { return e && e ( h ) } ) } } } function H ( ) { return Math . random ( ) . toString ( 36 ) . substr ( 2 , 8 ) } function I ( b ) { var h = b . pathname ; h = void 0 === h ? "/" : h ; var e = b . search ; e = void 0 === e ? "" : e ; b = b . hash ; b = void 0 === b ? "" : b ; e && "?" !== e && ( h += "?" === e . charAt ( 0 ) ? e : "?" + e ) ; b && "#" !== b && ( h += "#" === b . charAt ( 0 ) ? b : "#" + b ) ; return h }
function J ( b ) { var h = { } ; if ( b ) { var e = b . indexOf ( "#" ) ; 0 <= e && ( h . hash = b . substr ( e ) , b = b . substr ( 0 , e ) ) ; e = b . indexOf ( "?" ) ; 0 <= e && ( h . search = b . substr ( e ) , b = b . substr ( 0 , e ) ) ; b && ( h . pathname = b ) } return h }
function createBrowserHistory ( b ) { function h ( ) { var c = p . location , a = m . state || { } ; return [ a . idx , C ( { pathname : c . pathname , search : c . search , hash : c . hash , state : a . usr || null , key : a . key || "default" } ) ] } function e ( c ) { return "string" === typeof c ? c : I ( c ) } function x ( c , a ) { void 0 === a && ( a = null ) ; return C ( Object ( esm _extends [ "a" /* default */ ] ) ( { pathname : q . pathname , hash : "" , search : "" } , "string" === typeof c ? J ( c ) : c , { state : a , key : H ( ) } ) ) } function z ( c ) { t = c ; c = h ( ) ; v = c [ 0 ] ; q = c [ 1 ] ; d . call ( { action : t , location : q } ) } function A ( c , a ) { function f ( ) { A ( c , a ) } var l = r . Push , k = x ( c ,
a ) ; if ( ! g . length || ( g . call ( { action : l , location : k , retry : f } ) , ! 1 ) ) { var n = [ { usr : k . state , key : k . key , idx : v + 1 } , e ( k ) ] ; k = n [ 0 ] ; n = n [ 1 ] ; try { m . pushState ( k , "" , n ) } catch ( G ) { p . location . assign ( n ) } z ( l ) } } function y ( c , a ) { function f ( ) { y ( c , a ) } var l = r . Replace , k = x ( c , a ) ; g . length && ( g . call ( { action : l , location : k , retry : f } ) , 1 ) || ( k = [ { usr : k . state , key : k . key , idx : v } , e ( k ) ] , m . replaceState ( k [ 0 ] , "" , k [ 1 ] ) , z ( l ) ) } function w ( c ) { m . go ( c ) } void 0 === b && ( b = { } ) ; b = b . window ; var p = void 0 === b ? document . defaultView : b , m = p . history , u = null ; p . addEventListener ( "popstate" ,
function ( ) { if ( u ) g . call ( u ) , u = null ; else { var c = r . Pop , a = h ( ) , f = a [ 0 ] ; a = a [ 1 ] ; if ( g . length ) if ( null != f ) { var l = v - f ; l && ( u = { action : c , location : a , retry : function ( ) { w ( - 1 * l ) } } , w ( l ) ) } else false ? undefined :
void 0 ; else z ( c ) } } ) ; var t = r . Pop ; b = h ( ) ; var v = b [ 0 ] , q = b [ 1 ] , d = F ( ) , g = F ( ) ; null == v && ( v = 0 , m . replaceState ( Object ( esm _extends [ "a" /* default */ ] ) ( { } , m . state , { idx : v } ) , "" ) ) ; return { get action ( ) { return t } , get location ( ) { return q } , createHref : e , push : A , replace : y , go : w , back : function ( ) { w ( - 1 ) } , forward : function ( ) { w ( 1 ) } , listen : function ( c ) { return d . push ( c ) } , block : function ( c ) { var a = g . push ( c ) ; 1 === g . length && p . addEventListener ( "beforeunload" , E ) ; return function ( ) { a ( ) ; g . length || p . removeEventListener ( "beforeunload" , E ) } } } } ;
function createHashHistory ( b ) { function h ( ) { var a = J ( m . location . hash . substr ( 1 ) ) , f = a . pathname , l = a . search ; a = a . hash ; var k = u . state || { } ; return [ k . idx , C ( { pathname : void 0 === f ? "/" : f , search : void 0 === l ? "" : l , hash : void 0 === a ? "" : a , state : k . usr || null , key : k . key || "default" } ) ] } function e ( ) { if ( t ) c . call ( t ) , t = null ; else { var a = r . Pop , f = h ( ) , l = f [ 0 ] ; f = f [ 1 ] ; if ( c . length ) if ( null != l ) { var k = q - l ; k && ( t = { action : a , location : f , retry : function ( ) { p ( - 1 * k ) } } , p ( k ) ) } else false ? undefined :
void 0 ; else A ( a ) } } function x ( a ) { var f = document . querySelector ( "base" ) , l = "" ; f && f . getAttribute ( "href" ) && ( f = m . location . href , l = f . indexOf ( "#" ) , l = - 1 === l ? f : f . slice ( 0 , l ) ) ; return l + "#" + ( "string" === typeof a ? a : I ( a ) ) } function z ( a , f ) { void 0 === f && ( f = null ) ; return C ( Object ( esm _extends [ "a" /* default */ ] ) ( { pathname : d . pathname , hash : "" , search : "" } , "string" === typeof a ? J ( a ) : a , { state : f , key : H ( ) } ) ) } function A ( a ) { v = a ; a = h ( ) ; q = a [ 0 ] ; d = a [ 1 ] ; g . call ( { action : v , location : d } ) } function y ( a , f ) { function l ( ) { y ( a , f ) } var k = r . Push , n = z ( a , f ) ; false ?
undefined : void 0 ; if ( ! c . length || ( c . call ( { action : k , location : n , retry : l } ) , ! 1 ) ) { var G = [ { usr : n . state , key : n . key , idx : q + 1 } , x ( n ) ] ; n = G [ 0 ] ; G = G [ 1 ] ; try { u . pushState ( n , "" , G ) } catch ( K ) { m . location . assign ( G ) } A ( k ) } } function w ( a , f ) { function l ( ) { w ( a , f ) } var k = r . Replace , n = z ( a , f ) ; false ? undefined : void 0 ; c . length && ( c . call ( { action : k , location : n , retry : l } ) , 1 ) || ( n = [ { usr : n . state , key : n . key , idx : q } , x ( n ) ] , u . replaceState ( n [ 0 ] , "" , n [ 1 ] ) , A ( k ) ) } function p ( a ) { u . go ( a ) } void 0 === b && ( b = { } ) ; b = b . window ; var m = void 0 === b ? document . defaultView : b , u = m . history , t = null ; m . addEventListener ( "popstate" , e ) ; m . addEventListener ( "hashchange" , function ( ) { var a = h ( ) [ 1 ] ; I ( a ) !== I ( d ) && e ( ) } ) ; var v = r . Pop ; b = h ( ) ; var q = b [ 0 ] , d = b [ 1 ] , g = F ( ) , c = F ( ) ; null == q && ( q = 0 , u . replaceState ( Object ( esm _extends [ "a" /* default */ ] ) ( { } , u . state , { idx : q } ) , "" ) ) ; return { get action ( ) { return v } , get location ( ) { return d } ,
createHref : x , push : y , replace : w , go : p , back : function ( ) { p ( - 1 ) } , forward : function ( ) { p ( 1 ) } , listen : function ( a ) { return g . push ( a ) } , block : function ( a ) { var f = c . push ( a ) ; 1 === c . length && m . addEventListener ( "beforeunload" , E ) ; return function ( ) { f ( ) ; c . length || m . removeEventListener ( "beforeunload" , E ) } } } } ;
function createMemoryHistory ( b ) { function h ( d , g ) { void 0 === g && ( g = null ) ; return C ( Object ( esm _extends [ "a" /* default */ ] ) ( { pathname : t . pathname , search : "" , hash : "" } , "string" === typeof d ? J ( d ) : d , { state : g , key : H ( ) } ) ) } function e ( d , g , c ) { return ! q . length || ( q . call ( { action : d , location : g , retry : c } ) , ! 1 ) } function x ( d , g ) { u = d ; t = g ; v . call ( { action : u , location : t } ) } function z ( d , g ) { var c = r . Push , a = h ( d , g ) ; false ? undefined :
void 0 ; e ( c , a , function ( ) { z ( d , g ) } ) && ( m += 1 , p . splice ( m , p . length , a ) , x ( c , a ) ) } function A ( d , g ) { var c = r . Replace , a = h ( d , g ) ; false ? undefined : void 0 ; e ( c , a , function ( ) { A ( d , g ) } ) && ( p [ m ] = a , x ( c , a ) ) } function y ( d ) { var g = Math . min ( Math . max ( m + d , 0 ) , p . length - 1 ) , c = r . Pop , a = p [ g ] ; e ( c , a , function ( ) { y ( d ) } ) && ( m = g , x ( c , a ) ) } void 0 === b && ( b = { } ) ; var w = b ; b = w . initialEntries ; w = w . initialIndex ; var p = ( void 0 ===
b ? [ "/" ] : b ) . map ( function ( d ) { var g = C ( Object ( esm _extends [ "a" /* default */ ] ) ( { pathname : "/" , search : "" , hash : "" , state : null , key : H ( ) } , "string" === typeof d ? J ( d ) : d ) ) ; false ? undefined : void 0 ; return g } ) , m = Math . min ( Math . max ( null == w ? p . length - 1 : w , 0 ) , p . length - 1 ) , u = r . Pop , t = p [ m ] , v = F ( ) , q = F ( ) ; return { get index ( ) { return m } , get action ( ) { return u } , get location ( ) { return t } , createHref : function ( d ) { return "string" ===
2021-12-14 02:57:26 +01:00
typeof d ? d : I ( d ) } , push : z , replace : A , go : y , back : function ( ) { y ( - 1 ) } , forward : function ( ) { y ( 1 ) } , listen : function ( d ) { return v . push ( d ) } , block : function ( d ) { return q . push ( d ) } } } ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/utils/history.js
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
const history _history = createBrowserHistory ( ) ;
const originalHistoryPush = history _history . push ;
const originalHistoryReplace = history _history . replace ;
function push ( params , state ) {
return originalHistoryPush . call ( history _history , Object ( external _wp _url _ [ "addQueryArgs" ] ) ( window . location . href , params ) , state ) ;
}
function history _replace ( params , state ) {
return originalHistoryReplace . call ( history _history , Object ( external _wp _url _ [ "addQueryArgs" ] ) ( window . location . href , params ) , state ) ;
}
history _history . push = push ;
history _history . replace = history _replace ;
/* harmony default export */ var utils _history = ( history _history ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/routes/index.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
const RoutesContext = Object ( external _wp _element _ [ "createContext" ] ) ( ) ;
const HistoryContext = Object ( external _wp _element _ [ "createContext" ] ) ( ) ;
function useLocation ( ) {
return Object ( external _wp _element _ [ "useContext" ] ) ( RoutesContext ) ;
}
function useHistory ( ) {
return Object ( external _wp _element _ [ "useContext" ] ) ( HistoryContext ) ;
}
function getLocationWithParams ( location ) {
const searchParams = new URLSearchParams ( location . search ) ;
return { ... location ,
params : Object . fromEntries ( searchParams . entries ( ) )
} ;
}
function Routes ( _ref ) {
let {
children
} = _ref ;
const [ location , setLocation ] = Object ( external _wp _element _ [ "useState" ] ) ( ( ) => getLocationWithParams ( utils _history . location ) ) ;
Object ( external _wp _element _ [ "useEffect" ] ) ( ( ) => {
return utils _history . listen ( _ref2 => {
let {
location : updatedLocation
} = _ref2 ;
setLocation ( getLocationWithParams ( updatedLocation ) ) ;
} ) ;
} , [ ] ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( HistoryContext . Provider , {
value : utils _history
} , Object ( external _wp _element _ [ "createElement" ] ) ( RoutesContext . Provider , {
value : location
} , children ( location ) ) ) ;
}
2021-11-23 06:40:38 +01:00
// EXTERNAL MODULE: external ["wp","blockEditor"]
var external _wp _blockEditor _ = _ _webpack _require _ _ ( "axFQ" ) ;
2022-02-17 20:18:25 +01:00
// EXTERNAL MODULE: external ["wp","plugins"]
var external _wp _plugins _ = _ _webpack _require _ _ ( "TvNi" ) ;
2021-11-23 06:40:38 +01:00
// EXTERNAL MODULE: external ["wp","keyboardShortcuts"]
var external _wp _keyboardShortcuts _ = _ _webpack _require _ _ ( "hF7m" ) ;
// EXTERNAL MODULE: external ["wp","compose"]
var external _wp _compose _ = _ _webpack _require _ _ ( "K9lf" ) ;
2021-11-09 03:17:17 +01:00
2021-11-23 06:40:38 +01:00
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/plus.js
var plus = _ _webpack _require _ _ ( "Q4Sy" ) ;
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/list-view.js
var list _view = _ _webpack _require _ _ ( "OzlF" ) ;
2021-11-09 03:17:17 +01:00
2022-02-17 20:18:25 +01:00
// EXTERNAL MODULE: external ["wp","keycodes"]
var external _wp _keycodes _ = _ _webpack _require _ _ ( "RxS6" ) ;
2021-11-09 03:17:17 +01:00
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/more-vertical.js
var more _vertical = _ _webpack _require _ _ ( "VKE3" ) ;
2022-02-17 20:18:25 +01:00
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/external.js
var external = _ _webpack _require _ _ ( "K+tz" ) ;
// EXTERNAL MODULE: ./node_modules/classnames/index.js
var classnames = _ _webpack _require _ _ ( "TSYQ" ) ;
var classnames _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( classnames ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/keyboard-shortcut-help-modal/config.js
/ * *
* WordPress dependencies
* /
const textFormattingShortcuts = [ {
keyCombination : {
modifier : 'primary' ,
character : 'b'
} ,
description : Object ( external _wp _i18n _ [ "__" ] ) ( 'Make the selected text bold.' )
} , {
keyCombination : {
modifier : 'primary' ,
character : 'i'
} ,
description : Object ( external _wp _i18n _ [ "__" ] ) ( 'Make the selected text italic.' )
} , {
keyCombination : {
modifier : 'primary' ,
character : 'k'
} ,
description : Object ( external _wp _i18n _ [ "__" ] ) ( 'Convert the selected text into a link.' )
} , {
keyCombination : {
modifier : 'primaryShift' ,
character : 'k'
} ,
description : Object ( external _wp _i18n _ [ "__" ] ) ( 'Remove a link.' )
} , {
keyCombination : {
modifier : 'primary' ,
character : 'u'
} ,
description : Object ( external _wp _i18n _ [ "__" ] ) ( 'Underline the selected text.' )
} ] ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/keyboard-shortcut-help-modal/shortcut.js
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
function KeyCombination ( _ref ) {
let {
keyCombination ,
forceAriaLabel
} = _ref ;
const shortcut = keyCombination . modifier ? external _wp _keycodes _ [ "displayShortcutList" ] [ keyCombination . modifier ] ( keyCombination . character ) : keyCombination . character ;
const ariaLabel = keyCombination . modifier ? external _wp _keycodes _ [ "shortcutAriaLabel" ] [ keyCombination . modifier ] ( keyCombination . character ) : keyCombination . character ;
return Object ( external _wp _element _ [ "createElement" ] ) ( "kbd" , {
className : "edit-site-keyboard-shortcut-help-modal__shortcut-key-combination" ,
"aria-label" : forceAriaLabel || ariaLabel
} , Object ( external _lodash _ [ "castArray" ] ) ( shortcut ) . map ( ( character , index ) => {
if ( character === '+' ) {
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , {
key : index
} , character ) ;
}
return Object ( external _wp _element _ [ "createElement" ] ) ( "kbd" , {
key : index ,
className : "edit-site-keyboard-shortcut-help-modal__shortcut-key"
} , character ) ;
} ) ) ;
}
function Shortcut ( _ref2 ) {
let {
description ,
keyCombination ,
aliases = [ ] ,
ariaLabel
} = _ref2 ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-site-keyboard-shortcut-help-modal__shortcut-description"
} , description ) , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-site-keyboard-shortcut-help-modal__shortcut-term"
} , Object ( external _wp _element _ [ "createElement" ] ) ( KeyCombination , {
keyCombination : keyCombination ,
forceAriaLabel : ariaLabel
} ) , aliases . map ( ( alias , index ) => Object ( external _wp _element _ [ "createElement" ] ) ( KeyCombination , {
keyCombination : alias ,
forceAriaLabel : ariaLabel ,
key : index
} ) ) ) ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
function DynamicShortcut ( _ref ) {
let {
name
} = _ref ;
const {
keyCombination ,
description ,
aliases
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
const {
getShortcutKeyCombination ,
getShortcutDescription ,
getShortcutAliases
} = select ( external _wp _keyboardShortcuts _ [ "store" ] ) ;
return {
keyCombination : getShortcutKeyCombination ( name ) ,
aliases : getShortcutAliases ( name ) ,
description : getShortcutDescription ( name )
} ;
} , [ name ] ) ;
if ( ! keyCombination ) {
return null ;
}
return Object ( external _wp _element _ [ "createElement" ] ) ( Shortcut , {
keyCombination : keyCombination ,
description : description ,
aliases : aliases
} ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/keyboard-shortcut-help-modal/index.js
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
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 */
Object ( external _wp _element _ [ "createElement" ] ) ( "ul" , {
className : "edit-site-keyboard-shortcut-help-modal__shortcut-list" ,
role : "list"
} , shortcuts . map ( ( shortcut , index ) => Object ( external _wp _element _ [ "createElement" ] ) ( "li" , {
className : "edit-site-keyboard-shortcut-help-modal__shortcut" ,
key : index
} , Object ( external _lodash _ [ "isString" ] ) ( shortcut ) ? Object ( external _wp _element _ [ "createElement" ] ) ( DynamicShortcut , {
name : shortcut
} ) : Object ( external _wp _element _ [ "createElement" ] ) ( Shortcut , shortcut ) ) ) )
/* eslint-enable jsx-a11y/no-redundant-roles */
) ;
} ;
const ShortcutSection = _ref2 => {
let {
title ,
shortcuts ,
className
} = _ref2 ;
return Object ( external _wp _element _ [ "createElement" ] ) ( "section" , {
className : classnames _default ( ) ( 'edit-site-keyboard-shortcut-help-modal__section' , className )
} , ! ! title && Object ( external _wp _element _ [ "createElement" ] ) ( "h2" , {
className : "edit-site-keyboard-shortcut-help-modal__section-title"
} , title ) , Object ( external _wp _element _ [ "createElement" ] ) ( ShortcutList , {
shortcuts : shortcuts
} ) ) ;
} ;
const ShortcutCategorySection = _ref3 => {
let {
title ,
categoryName ,
additionalShortcuts = [ ]
} = _ref3 ;
const categoryShortcuts = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
return select ( external _wp _keyboardShortcuts _ [ "store" ] ) . getCategoryShortcuts ( categoryName ) ;
} , [ categoryName ] ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( ShortcutSection , {
title : title ,
shortcuts : categoryShortcuts . concat ( additionalShortcuts )
} ) ;
} ;
function KeyboardShortcutHelpModal ( _ref4 ) {
let {
isModalActive ,
toggleModal
} = _ref4 ;
if ( ! isModalActive ) {
return null ;
}
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Modal" ] , {
className : "edit-site-keyboard-shortcut-help-modal" ,
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Keyboard shortcuts' ) ,
closeLabel : Object ( external _wp _i18n _ [ "__" ] ) ( 'Close' ) ,
onRequestClose : toggleModal
} , Object ( external _wp _element _ [ "createElement" ] ) ( ShortcutSection , {
className : "edit-site-keyboard-shortcut-help-modal__main-shortcuts" ,
shortcuts : [ 'core/edit-site/keyboard-shortcuts' ]
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( ShortcutCategorySection , {
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Global shortcuts' ) ,
categoryName : "global"
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( ShortcutCategorySection , {
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Selection shortcuts' ) ,
categoryName : "selection"
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( ShortcutCategorySection , {
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Block shortcuts' ) ,
categoryName : "block" ,
additionalShortcuts : [ {
keyCombination : {
character : '/'
} ,
description : Object ( external _wp _i18n _ [ "__" ] ) ( 'Change the block type after adding a new paragraph.' ) ,
/* translators: The forward-slash character. e.g. '/'. */
ariaLabel : Object ( external _wp _i18n _ [ "__" ] ) ( 'Forward-slash' )
} ]
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( ShortcutSection , {
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Text formatting' ) ,
shortcuts : textFormattingShortcuts
} ) ) ;
}
2021-11-09 03:17:17 +01:00
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/check.js
var check = _ _webpack _require _ _ ( "RMJe" ) ;
// EXTERNAL MODULE: external ["wp","a11y"]
var external _wp _a11y _ = _ _webpack _require _ _ ( "gdqT" ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/header/feature-toggle/index.js
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2021-11-15 13:50:17 +01:00
function FeatureToggle ( _ref ) {
let {
feature ,
label ,
info ,
messageActivated ,
messageDeactivated
} = _ref ;
2021-11-09 03:17:17 +01:00
const speakMessage = ( ) => {
if ( isActive ) {
Object ( external _wp _a11y _ [ "speak" ] ) ( messageDeactivated || Object ( external _wp _i18n _ [ "__" ] ) ( 'Feature deactivated' ) ) ;
} else {
Object ( external _wp _a11y _ [ "speak" ] ) ( messageActivated || Object ( external _wp _i18n _ [ "__" ] ) ( 'Feature activated' ) ) ;
}
} ;
const isActive = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
return select ( store ) . isFeatureActive ( feature ) ;
} , [ ] ) ;
const {
toggleFeature
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuItem" ] , {
icon : isActive && check [ "a" /* default */ ] ,
isSelected : isActive ,
onClick : Object ( external _lodash _ [ "flow" ] ) ( toggleFeature . bind ( null , feature ) , speakMessage ) ,
role : "menuitemcheckbox" ,
info : info
} , label ) ;
}
2022-02-17 20:18:25 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/header/tools-more-menu-group/index.js
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
const {
Fill : ToolsMoreMenuGroup ,
Slot
} = Object ( external _wp _components _ [ "createSlotFill" ] ) ( 'EditSiteToolsMoreMenuGroup' ) ;
ToolsMoreMenuGroup . Slot = _ref => {
let {
fillProps
} = _ref ;
return Object ( external _wp _element _ [ "createElement" ] ) ( Slot , {
fillProps : fillProps
} , fills => ! Object ( external _lodash _ [ "isEmpty" ] ) ( fills ) && fills ) ;
} ;
/* harmony default export */ var tools _more _menu _group = ( ToolsMoreMenuGroup ) ;
// EXTERNAL MODULE: ./node_modules/downloadjs/download.js
var download = _ _webpack _require _ _ ( "rrFr" ) ;
var download _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( download ) ;
// EXTERNAL MODULE: external ["wp","apiFetch"]
var external _wp _apiFetch _ = _ _webpack _require _ _ ( "ywyh" ) ;
var external _wp _apiFetch _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( external _wp _apiFetch _ ) ;
// EXTERNAL MODULE: external ["wp","primitives"]
var external _wp _primitives _ = _ _webpack _require _ _ ( "Tqx9" ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/download.js
/ * *
* WordPress dependencies
* /
const download _download = Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _primitives _ [ "SVG" ] , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _primitives _ [ "Path" ] , {
d : "M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z"
} ) ) ;
/* harmony default export */ var library _download = ( download _download ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/header/more-menu/site-export.js
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
function SiteExport ( ) {
const {
createErrorNotice
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( external _wp _notices _ [ "store" ] ) ;
async function handleExport ( ) {
try {
const response = await external _wp _apiFetch _default ( ) ( {
path : '/wp-block-editor/v1/export' ,
parse : false
} ) ;
const blob = await response . blob ( ) ;
download _default ( ) ( blob , 'edit-site-export.zip' , 'application/zip' ) ;
} catch ( errorResponse ) {
let error = { } ;
try {
error = await errorResponse . json ( ) ;
} catch ( e ) { }
const errorMessage = error . message && error . code !== 'unknown_error' ? error . message : Object ( external _wp _i18n _ [ "__" ] ) ( 'An error occurred while creating the site export.' ) ;
createErrorNotice ( errorMessage , {
type : 'snackbar'
} ) ;
}
}
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuItem" ] , {
role : "menuitem" ,
icon : library _download ,
onClick : handleExport ,
info : Object ( external _wp _i18n _ [ "__" ] ) ( 'Download your templates and template parts.' )
} , Object ( external _wp _i18n _ [ "_x" ] ) ( 'Export' , 'site exporter menu item' ) ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/header/more-menu/welcome-guide-menu-item.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
function WelcomeGuideMenuItem ( ) {
const {
toggleFeature
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuItem" ] , {
onClick : ( ) => toggleFeature ( 'welcomeGuide' )
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Welcome Guide' ) ) ;
}
2021-11-09 03:17:17 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/header/more-menu/index.js
/ * *
* WordPress dependencies
* /
2022-02-17 20:18:25 +01:00
2021-11-09 03:17:17 +01:00
/ * *
* Internal dependencies
* /
2022-02-17 20:18:25 +01:00
2021-11-09 03:17:17 +01:00
const POPOVER _PROPS = {
className : 'edit-site-more-menu__content' ,
position : 'bottom left'
} ;
const TOGGLE _PROPS = {
tooltipPosition : 'bottom'
} ;
2022-02-17 20:18:25 +01:00
function MoreMenu ( ) {
const [ isModalActive , toggleModal ] = Object ( external _wp _element _ [ "useReducer" ] ) ( isActive => ! isActive , false ) ;
Object ( external _wp _keyboardShortcuts _ [ "useShortcut" ] ) ( 'core/edit-site/keyboard-shortcuts' , toggleModal ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "DropdownMenu" ] , {
className : "edit-site-more-menu" ,
icon : more _vertical [ "a" /* default */ ] ,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'More tools & options' ) ,
popoverProps : POPOVER _PROPS ,
toggleProps : TOGGLE _PROPS
} , _ref => {
let {
2021-11-15 13:50:17 +01:00
onClose
2022-02-17 20:18:25 +01:00
} = _ref ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuGroup" ] , {
label : Object ( external _wp _i18n _ [ "_x" ] ) ( 'View' , 'noun' )
} , Object ( external _wp _element _ [ "createElement" ] ) ( FeatureToggle , {
feature : "fixedToolbar" ,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Top toolbar' ) ,
info : Object ( external _wp _i18n _ [ "__" ] ) ( 'Access all block and document tools in a single place' ) ,
messageActivated : Object ( external _wp _i18n _ [ "__" ] ) ( 'Top toolbar activated' ) ,
messageDeactivated : Object ( external _wp _i18n _ [ "__" ] ) ( 'Top toolbar deactivated' )
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( FeatureToggle , {
feature : "focusMode" ,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Spotlight mode' ) ,
info : Object ( external _wp _i18n _ [ "__" ] ) ( 'Focus on one block at a time' ) ,
messageActivated : Object ( external _wp _i18n _ [ "__" ] ) ( 'Spotlight mode activated' ) ,
messageDeactivated : Object ( external _wp _i18n _ [ "__" ] ) ( 'Spotlight mode deactivated' )
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( build _module [ "a" /* ActionItem */ ] . Slot , {
name : "core/edit-site/plugin-more-menu" ,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Plugins' ) ,
as : external _wp _components _ [ "MenuGroup" ] ,
fillProps : {
onClick : onClose
}
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuGroup" ] , {
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Tools' )
} , Object ( external _wp _element _ [ "createElement" ] ) ( SiteExport , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuItem" ] , {
onClick : toggleModal ,
shortcut : external _wp _keycodes _ [ "displayShortcut" ] . access ( 'h' )
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Keyboard shortcuts' ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( WelcomeGuideMenuItem , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuItem" ] , {
icon : external [ "a" /* default */ ] ,
role : "menuitem" ,
href : Object ( external _wp _i18n _ [ "__" ] ) ( 'https://wordpress.org/support/article/site-editor/' ) ,
target : "_blank" ,
rel : "noopener noreferrer"
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Help' ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "VisuallyHidden" ] , {
as : "span"
} ,
/* translators: accessibility text */
Object ( external _wp _i18n _ [ "__" ] ) ( '(opens in a new tab)' ) ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( tools _more _menu _group . Slot , {
fillProps : {
onClose
}
} ) ) ) ;
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( KeyboardShortcutHelpModal , {
isModalActive : isModalActive ,
toggleModal : toggleModal
2021-11-15 13:50:17 +01:00
} ) ) ;
2022-02-17 20:18:25 +01:00
}
2021-11-09 03:17:17 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/save-button/index.js
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
2021-11-15 13:50:17 +01:00
function SaveButton ( _ref ) {
let {
openEntitiesSavedStates ,
isEntitiesSavedStatesOpen
} = _ref ;
2021-11-09 03:17:17 +01:00
const {
isDirty ,
isSaving
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
const {
_ _experimentalGetDirtyEntityRecords ,
isSavingEntityRecord
} = select ( external _wp _coreData _ [ "store" ] ) ;
const dirtyEntityRecords = _ _experimentalGetDirtyEntityRecords ( ) ;
return {
isDirty : dirtyEntityRecords . length > 0 ,
isSaving : Object ( external _lodash _ [ "some" ] ) ( dirtyEntityRecords , record => isSavingEntityRecord ( record . kind , record . name , record . key ) )
} ;
} , [ ] ) ;
const disabled = ! isDirty || isSaving ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
variant : "primary" ,
className : "edit-site-save-button__button" ,
"aria-disabled" : disabled ,
"aria-expanded" : isEntitiesSavedStatesOpen ,
disabled : disabled ,
isBusy : isSaving ,
onClick : disabled ? undefined : openEntitiesSavedStates
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Save' ) ) ) ;
}
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/undo.js
var library _undo = _ _webpack _require _ _ ( "Ntru" ) ;
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/redo.js
var library _redo = _ _webpack _require _ _ ( "K2cm" ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/header/undo-redo/undo.js
/ * *
* WordPress dependencies
* /
function UndoButton ( ) {
const hasUndo = Object ( external _wp _data _ [ "useSelect" ] ) ( select => select ( external _wp _coreData _ [ "store" ] ) . hasUndo ( ) , [ ] ) ;
const {
undo
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( external _wp _coreData _ [ "store" ] ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
icon : ! Object ( external _wp _i18n _ [ "isRTL" ] ) ( ) ? library _undo [ "a" /* default */ ] : library _redo [ "a" /* default */ ] ,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Undo' ) ,
shortcut : external _wp _keycodes _ [ "displayShortcut" ] . primary ( 'z' ) // If there are no undo levels we don't want to actually disable this
// button, because it will remove focus for keyboard users.
// See: https://github.com/WordPress/gutenberg/issues/3486
,
"aria-disabled" : ! hasUndo ,
onClick : hasUndo ? undo : undefined
} ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/header/undo-redo/redo.js
/ * *
* WordPress dependencies
* /
function RedoButton ( ) {
const hasRedo = Object ( external _wp _data _ [ "useSelect" ] ) ( select => select ( external _wp _coreData _ [ "store" ] ) . hasRedo ( ) , [ ] ) ;
const {
redo
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( external _wp _coreData _ [ "store" ] ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
icon : ! Object ( external _wp _i18n _ [ "isRTL" ] ) ( ) ? library _redo [ "a" /* default */ ] : library _undo [ "a" /* default */ ] ,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Redo' ) ,
shortcut : external _wp _keycodes _ [ "displayShortcut" ] . primaryShift ( 'z' ) // If there are no undo levels we don't want to actually disable this
// button, because it will remove focus for keyboard users.
// See: https://github.com/WordPress/gutenberg/issues/3486
,
"aria-disabled" : ! hasRedo ,
onClick : hasRedo ? redo : undefined
} ) ;
}
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-down.js
var chevron _down = _ _webpack _require _ _ ( "NWDH" ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/header/document-actions/index.js
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
function getBlockDisplayText ( block ) {
if ( block ) {
const blockType = Object ( external _wp _blocks _ [ "getBlockType" ] ) ( block . name ) ;
return blockType ? Object ( external _wp _blocks _ [ "__experimentalGetBlockLabel" ] ) ( blockType , block . attributes ) : null ;
}
return null ;
}
function useSecondaryText ( ) {
const {
getBlock
} = Object ( external _wp _data _ [ "useSelect" ] ) ( external _wp _blockEditor _ [ "store" ] ) ;
const activeEntityBlockId = Object ( external _wp _data _ [ "useSelect" ] ) ( select => select ( external _wp _blockEditor _ [ "store" ] ) . _ _experimentalGetActiveBlockIdByBlockNames ( [ 'core/template-part' ] ) , [ ] ) ;
if ( activeEntityBlockId ) {
return {
label : getBlockDisplayText ( getBlock ( activeEntityBlockId ) ) ,
isActive : true
} ;
}
return { } ;
}
/ * *
* @ param { Object } props Props for the DocumentActions component .
* @ param { string } props . entityTitle The title to display .
* @ param { string } props . entityLabel A label to use for entity - related options .
* E . g . "template" would be used for " edit
* template " and " show template details " .
* @ param { boolean } props . isLoaded Whether the data is available .
* @ param { Function } props . children React component to use for the
* information dropdown area . Should be a
* function which accepts dropdown props .
* /
2021-11-15 13:50:17 +01:00
function DocumentActions ( _ref ) {
let {
entityTitle ,
entityLabel ,
isLoaded ,
children : dropdownContent
} = _ref ;
2021-11-09 03:17:17 +01:00
const {
label
} = useSecondaryText ( ) ; // The title ref is passed to the popover as the anchorRef so that the
// dropdown is centered over the whole title area rather than just one
// part of it.
const titleRef = Object ( external _wp _element _ [ "useRef" ] ) ( ) ; // Return a simple loading indicator until we have information to show.
if ( ! isLoaded ) {
return Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-site-document-actions"
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Loading…' ) ) ;
} // Return feedback that the template does not seem to exist.
if ( ! entityTitle ) {
return Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-site-document-actions"
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Template not found' ) ) ;
}
return Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : classnames _default ( ) ( 'edit-site-document-actions' , {
'has-secondary-label' : ! ! label
} )
} , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
ref : titleRef ,
className : "edit-site-document-actions__title-wrapper"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalText" ] , {
size : "body" ,
2021-12-14 02:57:26 +01:00
className : "edit-site-document-actions__title" ,
as : "h1"
2021-11-09 03:17:17 +01:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "VisuallyHidden" ] , {
as : "span"
} , Object ( external _wp _i18n _ [ "sprintf" ] ) (
/* translators: %s: the entity being edited, like "template"*/
2021-12-14 02:57:26 +01:00
Object ( external _wp _i18n _ [ "__" ] ) ( 'Editing %s: ' ) , entityLabel ) ) , entityTitle ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalText" ] , {
2021-11-09 03:17:17 +01:00
size : "body" ,
className : "edit-site-document-actions__secondary-item"
} , label !== null && label !== void 0 ? label : '' ) , dropdownContent && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Dropdown" ] , {
popoverProps : {
anchorRef : titleRef . current
} ,
position : "bottom center" ,
2021-11-15 13:50:17 +01:00
renderToggle : _ref2 => {
let {
isOpen ,
onToggle
} = _ref2 ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
className : "edit-site-document-actions__get-info" ,
icon : chevron _down [ "a" /* default */ ] ,
"aria-expanded" : isOpen ,
"aria-haspopup" : "true" ,
onClick : onToggle ,
label : Object ( external _wp _i18n _ [ "sprintf" ] ) (
/* translators: %s: the entity to see details about, like "template"*/
Object ( external _wp _i18n _ [ "__" ] ) ( 'Show %s details' ) , entityLabel )
} ) ;
} ,
2021-11-09 03:17:17 +01:00
contentClassName : "edit-site-document-actions__info-dropdown" ,
renderContent : dropdownContent
} ) ) ) ;
}
2021-12-14 02:57:26 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/routes/link.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
function useLink ( ) {
let params = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
let state = arguments . length > 1 ? arguments [ 1 ] : undefined ;
let shouldReplace = arguments . length > 2 && arguments [ 2 ] !== undefined ? arguments [ 2 ] : false ;
const history = useHistory ( ) ;
function onClick ( event ) {
event . preventDefault ( ) ;
if ( shouldReplace ) {
history . replace ( params , state ) ;
} else {
history . push ( params , state ) ;
}
}
return {
href : Object ( external _wp _url _ [ "addQueryArgs" ] ) ( window . location . href , params ) ,
onClick
} ;
}
function Link ( _ref ) {
let {
params = { } ,
state ,
replace : shouldReplace = false ,
children ,
... props
} = _ref ;
const {
href ,
onClick
} = useLink ( params , state , shouldReplace ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( "a" , Object ( esm _extends [ "a" /* default */ ] ) ( {
href : href ,
onClick : onClick
} , props ) , children ) ;
}
2021-11-09 03:17:17 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/template-details/template-areas.js
2021-12-14 02:57:26 +01:00
2021-11-09 03:17:17 +01:00
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2021-12-14 02:57:26 +01:00
2021-11-15 13:50:17 +01:00
function TemplatePartItemMore ( _ref ) {
2021-11-09 03:17:17 +01:00
var _templatePart$title ;
2021-11-15 13:50:17 +01:00
let {
onClose ,
templatePart ,
closeTemplateDetailsDropdown
} = _ref ;
2021-11-09 03:17:17 +01:00
const {
revertTemplate
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store ) ;
2021-12-14 02:57:26 +01:00
const {
params
} = useLocation ( ) ;
const editLinkProps = useLink ( {
postId : templatePart . id ,
postType : templatePart . type
} , {
fromTemplateId : params . postId
} ) ;
2021-11-09 03:17:17 +01:00
2021-12-14 02:57:26 +01:00
function editTemplatePart ( event ) {
editLinkProps . onClick ( event ) ;
2021-11-09 03:17:17 +01:00
onClose ( ) ;
closeTemplateDetailsDropdown ( ) ;
}
function clearCustomizations ( ) {
revertTemplate ( templatePart ) ;
onClose ( ) ;
closeTemplateDetailsDropdown ( ) ;
}
2021-12-14 02:57:26 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuGroup" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuItem" ] , Object ( esm _extends [ "a" /* default */ ] ) ( { } , editLinkProps , {
2021-11-09 03:17:17 +01:00
onClick : editTemplatePart
2021-12-14 02:57:26 +01:00
} ) , Object ( external _wp _i18n _ [ "sprintf" ] ) (
2021-11-09 03:17:17 +01:00
/* translators: %s: template part title */
Object ( external _wp _i18n _ [ "__" ] ) ( 'Edit %s' ) , ( _templatePart$title = templatePart . title ) === null || _templatePart$title === void 0 ? void 0 : _templatePart$title . rendered ) ) ) , isTemplateRevertable ( templatePart ) && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuGroup" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuItem" ] , {
2021-12-06 07:20:27 +01:00
info : Object ( external _wp _i18n _ [ "__" ] ) ( 'Restore template to default state' ) ,
2021-11-09 03:17:17 +01:00
onClick : clearCustomizations
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Clear customizations' ) ) ) ) ;
}
2021-11-15 13:50:17 +01:00
function TemplatePartItem ( _ref2 ) {
let {
templatePart ,
clientId ,
closeTemplateDetailsDropdown
} = _ref2 ;
2021-11-09 03:17:17 +01:00
const {
selectBlock ,
toggleBlockHighlight
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( external _wp _blockEditor _ [ "store" ] ) ;
2021-12-14 02:57:26 +01:00
const templatePartArea = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
const defaultAreas = select ( external _wp _editor _ [ "store" ] ) . _ _experimentalGetDefaultTemplatePartAreas ( ) ;
return defaultAreas . find ( defaultArea => defaultArea . area === templatePart . area ) ;
} , [ templatePart . area ] ) ;
2021-11-09 03:17:17 +01:00
const highlightBlock = ( ) => toggleBlockHighlight ( clientId , true ) ;
const cancelHighlightBlock = ( ) => toggleBlockHighlight ( clientId , false ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
role : "menuitem" ,
className : "edit-site-template-details__template-areas-item"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuItem" ] , {
role : "button" ,
2021-12-14 02:57:26 +01:00
icon : templatePartArea === null || templatePartArea === void 0 ? void 0 : templatePartArea . icon ,
2021-11-09 03:17:17 +01:00
iconPosition : "left" ,
onClick : ( ) => {
selectBlock ( clientId ) ;
} ,
onMouseOver : highlightBlock ,
onMouseLeave : cancelHighlightBlock ,
onFocus : highlightBlock ,
onBlur : cancelHighlightBlock
2021-12-14 02:57:26 +01:00
} , templatePartArea === null || templatePartArea === void 0 ? void 0 : templatePartArea . label ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "DropdownMenu" ] , {
2021-11-09 03:17:17 +01:00
icon : more _vertical [ "a" /* default */ ] ,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'More options' ) ,
className : "edit-site-template-details__template-areas-item-more"
2021-11-15 13:50:17 +01:00
} , _ref3 => {
let {
onClose
} = _ref3 ;
return Object ( external _wp _element _ [ "createElement" ] ) ( TemplatePartItemMore , {
onClose : onClose ,
templatePart : templatePart ,
closeTemplateDetailsDropdown : closeTemplateDetailsDropdown
} ) ;
} ) ) ;
2021-11-09 03:17:17 +01:00
}
2021-11-15 13:50:17 +01:00
function TemplateAreas ( _ref4 ) {
let {
closeTemplateDetailsDropdown
} = _ref4 ;
2021-11-09 03:17:17 +01:00
const templateParts = Object ( external _wp _data _ [ "useSelect" ] ) ( select => select ( store ) . getCurrentTemplateTemplateParts ( ) , [ ] ) ;
if ( ! templateParts . length ) {
return null ;
}
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuGroup" ] , {
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Areas' ) ,
className : "edit-site-template-details__group edit-site-template-details__template-areas"
2021-11-15 13:50:17 +01:00
} , templateParts . map ( _ref5 => {
let {
templatePart ,
block
} = _ref5 ;
return Object ( external _wp _element _ [ "createElement" ] ) ( TemplatePartItem , {
key : templatePart . slug ,
clientId : block . clientId ,
templatePart : templatePart ,
closeTemplateDetailsDropdown : closeTemplateDetailsDropdown
} ) ;
} ) ) ;
2021-11-09 03:17:17 +01:00
}
2021-11-30 06:48:28 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/template-details/edit-template-title.js
/ * *
* WordPress dependencies
* /
function EditTemplateTitle ( _ref ) {
let {
template
} = _ref ;
const [ title , setTitle ] = Object ( external _wp _coreData _ [ "useEntityProp" ] ) ( 'postType' , template . type , 'title' , template . id ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "TextControl" ] , {
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Title' ) ,
value : title ,
help : Object ( external _wp _i18n _ [ "__" ] ) ( 'Give the template a title that indicates its purpose, e.g. "Full Width".' ) ,
onChange : newTitle => {
setTitle ( newTitle || template . slug ) ;
}
} ) ;
}
2021-11-09 03:17:17 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/template-details/index.js
2021-12-14 02:57:26 +01:00
2021-11-09 03:17:17 +01:00
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2021-11-30 06:48:28 +01:00
2021-12-14 02:57:26 +01:00
2021-11-15 13:50:17 +01:00
function TemplateDetails ( _ref ) {
let {
template ,
onClose
} = _ref ;
2021-11-09 03:17:17 +01:00
const {
title ,
description
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => select ( external _wp _editor _ [ "store" ] ) . _ _experimentalGetTemplateInfo ( template ) , [ ] ) ;
const {
revertTemplate
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store ) ;
const templateSubMenu = Object ( external _wp _element _ [ "useMemo" ] ) ( ( ) => {
if ( ( template === null || template === void 0 ? void 0 : template . type ) === 'wp_template' ) {
return {
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'templates' ) ,
menu : MENU _TEMPLATES
} ;
}
2021-11-15 13:50:17 +01:00
return TEMPLATE _PARTS _SUB _MENUS . find ( _ref2 => {
let {
area
} = _ref2 ;
return area === ( template === null || template === void 0 ? void 0 : template . area ) ;
} ) ;
2021-11-09 03:17:17 +01:00
} , [ template ] ) ;
2021-12-14 02:57:26 +01:00
const browseAllLinkProps = useLink ( {
// TODO: We should update this to filter by template part's areas as well.
postType : template . type ,
postId : undefined
} ) ;
2021-11-09 03:17:17 +01:00
if ( ! template ) {
return null ;
}
const revert = ( ) => {
revertTemplate ( template ) ;
onClose ( ) ;
} ;
return Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-site-template-details"
} , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-site-template-details__group"
2021-11-30 06:48:28 +01:00
} , template . is _custom ? Object ( external _wp _element _ [ "createElement" ] ) ( EditTemplateTitle , {
template : template
} ) : Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalHeading" ] , {
2021-11-09 03:17:17 +01:00
level : 4 ,
weight : 600 ,
className : "edit-site-template-details__title"
} , title ) , description && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalText" ] , {
size : "body" ,
className : "edit-site-template-details__description" ,
as : "p"
} , description ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( TemplateAreas , {
closeTemplateDetailsDropdown : onClose
} ) , isTemplateRevertable ( template ) && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuGroup" ] , {
className : "edit-site-template-details__group edit-site-template-details__revert"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuItem" ] , {
className : "edit-site-template-details__revert-button" ,
2021-12-06 07:20:27 +01:00
info : Object ( external _wp _i18n _ [ "__" ] ) ( 'Restore template to default state' ) ,
2021-11-09 03:17:17 +01:00
onClick : revert
2021-12-14 02:57:26 +01:00
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Clear customizations' ) ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , Object ( esm _extends [ "a" /* default */ ] ) ( {
className : "edit-site-template-details__show-all-button"
} , browseAllLinkProps ) , Object ( external _wp _i18n _ [ "sprintf" ] ) (
2021-11-09 03:17:17 +01:00
/* translators: the template part's area name ("Headers", "Sidebars") or "templates". */
Object ( external _wp _i18n _ [ "__" ] ) ( 'Browse all %s' ) , templateSubMenu . title ) ) ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/header/index.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
const preventDefault = event => {
event . preventDefault ( ) ;
} ;
2021-11-15 13:50:17 +01:00
function Header ( _ref ) {
let {
openEntitiesSavedStates ,
isEntitiesSavedStatesOpen
} = _ref ;
2021-11-09 03:17:17 +01:00
const inserterButton = Object ( external _wp _element _ [ "useRef" ] ) ( ) ;
const {
deviceType ,
entityTitle ,
template ,
templateType ,
isInserterOpen ,
isListViewOpen ,
listViewShortcut ,
isLoaded
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
const {
_ _experimentalGetPreviewDeviceType ,
getEditedPostType ,
getEditedPostId ,
isInserterOpened ,
isListViewOpened
} = select ( store ) ;
const {
getEditedEntityRecord
} = select ( external _wp _coreData _ [ "store" ] ) ;
const {
_ _experimentalGetTemplateInfo : getTemplateInfo
} = select ( external _wp _editor _ [ "store" ] ) ;
const {
getShortcutRepresentation
} = select ( external _wp _keyboardShortcuts _ [ "store" ] ) ;
const postType = getEditedPostType ( ) ;
const postId = getEditedPostId ( ) ;
const record = getEditedEntityRecord ( 'postType' , postType , postId ) ;
const _isLoaded = ! ! postId ;
return {
deviceType : _ _experimentalGetPreviewDeviceType ( ) ,
entityTitle : getTemplateInfo ( record ) . title ,
isLoaded : _isLoaded ,
template : record ,
templateType : postType ,
isInserterOpen : isInserterOpened ( ) ,
isListViewOpen : isListViewOpened ( ) ,
listViewShortcut : getShortcutRepresentation ( 'core/edit-site/toggle-list-view' )
} ;
} , [ ] ) ;
const {
_ _experimentalSetPreviewDeviceType : setPreviewDeviceType ,
setIsInserterOpened ,
setIsListViewOpened
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store ) ;
const isLargeViewport = Object ( external _wp _compose _ [ "useViewportMatch" ] ) ( 'medium' ) ;
const openInserter = Object ( external _wp _element _ [ "useCallback" ] ) ( ( ) => {
if ( isInserterOpen ) {
// Focusing the inserter button closes the inserter popover
inserterButton . current . focus ( ) ;
} else {
setIsInserterOpened ( true ) ;
}
} , [ isInserterOpen , setIsInserterOpened ] ) ;
const toggleListView = Object ( external _wp _element _ [ "useCallback" ] ) ( ( ) => setIsListViewOpened ( ! isListViewOpen ) , [ setIsListViewOpened , isListViewOpen ] ) ;
const isFocusMode = templateType === 'wp_template_part' ;
return Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-site-header"
} , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-site-header_start"
2021-11-23 06:40:38 +01:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
2021-11-09 03:17:17 +01:00
className : "edit-site-header__toolbar"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
ref : inserterButton ,
variant : "primary" ,
isPressed : isInserterOpen ,
className : "edit-site-header-toolbar__inserter-toggle" ,
onMouseDown : preventDefault ,
onClick : openInserter ,
icon : plus [ "a" /* default */ ] ,
label : Object ( external _wp _i18n _ [ "_x" ] ) ( 'Toggle block inserter' , 'Generic label for block inserter button' )
} ) , isLargeViewport && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "ToolSelector" ] , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( UndoButton , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( RedoButton , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
className : "edit-site-header-toolbar__list-view-toggle" ,
icon : list _view [ "a" /* default */ ] ,
isPressed : isListViewOpen
/* translators: button label text should, if possible, be under 16 characters. */
,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'List View' ) ,
onClick : toggleListView ,
shortcut : listViewShortcut
} ) ) ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-site-header_center"
} , Object ( external _wp _element _ [ "createElement" ] ) ( DocumentActions , {
entityTitle : entityTitle ,
entityLabel : templateType === 'wp_template_part' ? 'template part' : 'template' ,
isLoaded : isLoaded
2021-11-15 13:50:17 +01:00
} , _ref2 => {
let {
onClose
} = _ref2 ;
return Object ( external _wp _element _ [ "createElement" ] ) ( TemplateDetails , {
template : template ,
onClose : onClose
} ) ;
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
2021-11-09 03:17:17 +01:00
className : "edit-site-header_end"
} , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-site-header__actions"
} , ! isFocusMode && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "__experimentalPreviewOptions" ] , {
deviceType : deviceType ,
setDeviceType : setPreviewDeviceType
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( SaveButton , {
openEntitiesSavedStates : openEntitiesSavedStates ,
isEntitiesSavedStatesOpen : isEntitiesSavedStatesOpen
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( build _module [ "h" /* PinnedItems */ ] . Slot , {
scope : "core/edit-site"
2022-02-17 20:18:25 +01:00
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( MoreMenu , null ) ) ) ) ;
2021-11-09 03:17:17 +01:00
}
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/cog.js
var cog = _ _webpack _require _ _ ( "Cg8A" ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar/default-sidebar.js
/ * *
* WordPress dependencies
* /
2021-11-15 13:50:17 +01:00
function DefaultSidebar ( _ref ) {
let {
className ,
identifier ,
title ,
icon ,
children ,
closeLabel ,
header ,
headerClassName
} = _ref ;
2021-11-09 03:17:17 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( build _module [ "b" /* ComplementaryArea */ ] , {
className : className ,
scope : "core/edit-site" ,
identifier : identifier ,
title : title ,
icon : icon ,
closeLabel : closeLabel ,
header : header ,
headerClassName : headerClassName
} , children ) , Object ( external _wp _element _ [ "createElement" ] ) ( build _module [ "c" /* ComplementaryAreaMoreMenuItem */ ] , {
scope : "core/edit-site" ,
identifier : identifier ,
icon : icon
} , title ) ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/styles.js
/ * *
* WordPress dependencies
* /
const styles _styles = Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _primitives _ [ "SVG" ] , {
viewBox : "0 0 24 24" ,
xmlns : "http://www.w3.org/2000/svg"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _primitives _ [ "Path" ] , {
d : "M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z"
} ) ) ;
/* harmony default export */ var library _styles = ( styles _styles ) ;
2021-12-14 02:57:26 +01:00
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js
var build _module _icon = _ _webpack _require _ _ ( "iClF" ) ;
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-left.js
var chevron _left = _ _webpack _require _ _ ( "2gm7" ) ;
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-right.js
var chevron _right = _ _webpack _require _ _ ( "1iEr" ) ;
2021-11-09 03:17:17 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/utils.js
/ * *
* External dependencies
* /
/* Supporting data */
const ROOT _BLOCK _NAME = 'root' ;
const ROOT _BLOCK _SELECTOR = 'body' ;
const ROOT _BLOCK _SUPPORTS = [ 'background' , 'backgroundColor' , 'color' , 'linkColor' , 'fontFamily' , 'fontSize' , 'fontStyle' , 'fontWeight' , 'lineHeight' , 'textDecoration' , 'textTransform' , 'padding' ] ;
const PRESET _METADATA = [ {
path : [ 'color' , 'palette' ] ,
valueKey : 'color' ,
cssVarInfix : 'color' ,
classes : [ {
classSuffix : 'color' ,
propertyName : 'color'
} , {
classSuffix : 'background-color' ,
propertyName : 'background-color'
} , {
classSuffix : 'border-color' ,
propertyName : 'border-color'
} ]
} , {
path : [ 'color' , 'gradients' ] ,
valueKey : 'gradient' ,
cssVarInfix : 'gradient' ,
classes : [ {
classSuffix : 'gradient-background' ,
propertyName : 'background'
} ]
} , {
path : [ 'typography' , 'fontSizes' ] ,
valueKey : 'size' ,
cssVarInfix : 'font-size' ,
classes : [ {
classSuffix : 'font-size' ,
propertyName : 'font-size'
} ]
} , {
path : [ 'typography' , 'fontFamilies' ] ,
valueKey : 'fontFamily' ,
cssVarInfix : 'font-family' ,
classes : [ {
classSuffix : 'font-family' ,
propertyName : 'font-family'
} ]
} ] ;
const STYLE _PATH _TO _CSS _VAR _INFIX = {
'color.background' : 'color' ,
'color.text' : 'color' ,
'elements.link.color.text' : 'color' ,
'color.gradient' : 'gradient' ,
'typography.fontSize' : 'font-size' ,
'typography.fontFamily' : 'font-family'
} ;
function findInPresetsBy ( features , blockName , presetPath , presetProperty , presetValueValue ) {
// Block presets take priority above root level presets.
const orderedPresetsByOrigin = [ Object ( external _lodash _ [ "get" ] ) ( features , [ 'blocks' , blockName , ... presetPath ] ) , Object ( external _lodash _ [ "get" ] ) ( features , presetPath ) ] ;
for ( const presetByOrigin of orderedPresetsByOrigin ) {
if ( presetByOrigin ) {
// Preset origins ordered by priority.
2021-11-30 01:24:27 +01:00
const origins = [ 'custom' , 'theme' , 'default' ] ;
2021-11-09 03:17:17 +01:00
for ( const origin of origins ) {
const presets = presetByOrigin [ origin ] ;
if ( presets ) {
const presetObject = Object ( external _lodash _ [ "find" ] ) ( presets , preset => preset [ presetProperty ] === presetValueValue ) ;
if ( presetObject ) {
if ( presetProperty === 'slug' ) {
return presetObject ;
} // if there is a highest priority preset with the same slug but different value the preset we found was overwritten and should be ignored.
const highestPresetObjectWithSameSlug = findInPresetsBy ( features , blockName , presetPath , 'slug' , presetObject . slug ) ;
if ( highestPresetObjectWithSameSlug [ presetProperty ] === presetObject [ presetProperty ] ) {
return presetObject ;
}
return undefined ;
}
}
}
}
}
}
function getPresetVariableFromValue ( features , blockName , variableStylePath , presetPropertyValue ) {
if ( ! presetPropertyValue ) {
return presetPropertyValue ;
}
const cssVarInfix = STYLE _PATH _TO _CSS _VAR _INFIX [ variableStylePath ] ;
const metadata = Object ( external _lodash _ [ "find" ] ) ( PRESET _METADATA , [ 'cssVarInfix' , cssVarInfix ] ) ;
if ( ! metadata ) {
// The property doesn't have preset data
// so the value should be returned as it is.
return presetPropertyValue ;
}
const {
valueKey ,
path
} = metadata ;
const presetObject = findInPresetsBy ( features , blockName , path , valueKey , presetPropertyValue ) ;
if ( ! presetObject ) {
// Value wasn't found in the presets,
// so it must be a custom value.
return presetPropertyValue ;
}
return ` var:preset| ${ cssVarInfix } | ${ presetObject . slug } ` ;
}
2021-11-15 13:50:17 +01:00
function getValueFromPresetVariable ( features , blockName , variable , _ref ) {
let [ presetType , slug ] = _ref ;
2021-11-09 03:17:17 +01:00
const metadata = Object ( external _lodash _ [ "find" ] ) ( PRESET _METADATA , [ 'cssVarInfix' , presetType ] ) ;
if ( ! metadata ) {
return variable ;
}
const presetObject = findInPresetsBy ( features , blockName , metadata . path , 'slug' , slug ) ;
if ( presetObject ) {
const {
valueKey
} = metadata ;
const result = presetObject [ valueKey ] ;
return getValueFromVariable ( features , blockName , result ) ;
}
return variable ;
}
function getValueFromCustomVariable ( features , blockName , variable , path ) {
var _get ;
const result = ( _get = Object ( external _lodash _ [ "get" ] ) ( features , [ 'blocks' , blockName , 'custom' , ... path ] ) ) !== null && _get !== void 0 ? _get : Object ( external _lodash _ [ "get" ] ) ( features , [ 'custom' , ... path ] ) ;
if ( ! result ) {
return variable ;
} // A variable may reference another variable so we need recursion until we find the value.
return getValueFromVariable ( features , blockName , result ) ;
}
function getValueFromVariable ( features , blockName , variable ) {
if ( ! variable || ! Object ( external _lodash _ [ "isString" ] ) ( variable ) ) {
return variable ;
}
const USER _VALUE _PREFIX = 'var:' ;
const THEME _VALUE _PREFIX = 'var(--wp--' ;
const THEME _VALUE _SUFFIX = ')' ;
let parsedVar ;
if ( variable . startsWith ( USER _VALUE _PREFIX ) ) {
parsedVar = variable . slice ( USER _VALUE _PREFIX . length ) . split ( '|' ) ;
} else if ( variable . startsWith ( THEME _VALUE _PREFIX ) && variable . endsWith ( THEME _VALUE _SUFFIX ) ) {
parsedVar = variable . slice ( THEME _VALUE _PREFIX . length , - THEME _VALUE _SUFFIX . length ) . split ( '--' ) ;
} else {
// We don't know how to parse the value: either is raw of uses complex CSS such as `calc(1px * var(--wp--variable) )`
return variable ;
}
const [ type , ... path ] = parsedVar ;
if ( type === 'preset' ) {
return getValueFromPresetVariable ( features , blockName , variable , path ) ;
}
if ( type === 'custom' ) {
return getValueFromCustomVariable ( features , blockName , variable , path ) ;
}
return variable ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/context.js
/ * *
* WordPress dependencies
* /
const DEFAULT _GLOBAL _STYLES _CONTEXT = {
user : { } ,
base : { } ,
merged : { } ,
setUserConfig : ( ) => { }
} ;
const GlobalStylesContext = Object ( external _wp _element _ [ "createContext" ] ) ( DEFAULT _GLOBAL _STYLES _CONTEXT ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/hooks.js
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
const EMPTY _CONFIG = {
isGlobalStylesUserThemeJSON : true ,
version : 1
} ;
const useGlobalStylesReset = ( ) => {
const {
user : config ,
setUserConfig
} = Object ( external _wp _element _ [ "useContext" ] ) ( GlobalStylesContext ) ;
const canReset = ! ! config && ! Object ( external _lodash _ [ "isEqual" ] ) ( config , EMPTY _CONFIG ) ;
return [ canReset , Object ( external _wp _element _ [ "useCallback" ] ) ( ( ) => setUserConfig ( ( ) => EMPTY _CONFIG ) , [ setUserConfig ] ) ] ;
} ;
2021-11-15 13:50:17 +01:00
function useSetting ( path , blockName ) {
2021-11-09 03:17:17 +01:00
var _getSettingValueForCo ;
2021-11-15 13:50:17 +01:00
let source = arguments . length > 2 && arguments [ 2 ] !== undefined ? arguments [ 2 ] : 'all' ;
2021-11-09 03:17:17 +01:00
const {
merged : mergedConfig ,
base : baseConfig ,
user : userConfig ,
setUserConfig
} = Object ( external _wp _element _ [ "useContext" ] ) ( GlobalStylesContext ) ;
const fullPath = ! blockName ? ` settings. ${ path } ` : ` settings.blocks. ${ blockName } . ${ path } ` ;
const setSetting = newValue => {
setUserConfig ( currentConfig => {
const newUserConfig = Object ( external _lodash _ [ "cloneDeep" ] ) ( currentConfig ) ;
2021-11-30 01:24:27 +01:00
const pathToSet = external _wp _blocks _ [ "__EXPERIMENTAL_PATHS_WITH_MERGE" ] [ path ] ? fullPath + '.custom' : fullPath ;
2021-11-09 03:17:17 +01:00
Object ( external _lodash _ [ "set" ] ) ( newUserConfig , pathToSet , newValue ) ;
return newUserConfig ;
} ) ;
} ;
const getSettingValueForContext = name => {
const currentPath = ! name ? ` settings. ${ path } ` : ` settings.blocks. ${ name } . ${ path } ` ;
const getSettingValue = configToUse => {
const result = Object ( external _lodash _ [ "get" ] ) ( configToUse , currentPath ) ;
if ( external _wp _blocks _ [ "__EXPERIMENTAL_PATHS_WITH_MERGE" ] [ path ] ) {
2021-11-30 01:24:27 +01:00
var _ref , _result$custom ;
2021-11-09 03:17:17 +01:00
2021-11-30 01:24:27 +01:00
return ( _ref = ( _result$custom = result === null || result === void 0 ? void 0 : result . custom ) !== null && _result$custom !== void 0 ? _result$custom : result === null || result === void 0 ? void 0 : result . theme ) !== null && _ref !== void 0 ? _ref : result === null || result === void 0 ? void 0 : result . default ;
2021-11-09 03:17:17 +01:00
}
return result ;
} ;
let result ;
switch ( source ) {
case 'all' :
result = getSettingValue ( mergedConfig ) ;
break ;
case 'user' :
result = getSettingValue ( userConfig ) ;
break ;
case 'base' :
result = getSettingValue ( baseConfig ) ;
break ;
default :
throw 'Unsupported source' ;
}
return result ;
} ; // Unlike styles settings get inherited from top level settings.
const resultWithFallback = ( _getSettingValueForCo = getSettingValueForContext ( blockName ) ) !== null && _getSettingValueForCo !== void 0 ? _getSettingValueForCo : getSettingValueForContext ( ) ;
return [ resultWithFallback , setSetting ] ;
}
2021-11-15 13:50:17 +01:00
function useStyle ( path , blockName ) {
2021-11-09 03:17:17 +01:00
var _get ;
2021-11-15 13:50:17 +01:00
let source = arguments . length > 2 && arguments [ 2 ] !== undefined ? arguments [ 2 ] : 'all' ;
2021-11-09 03:17:17 +01:00
const {
merged : mergedConfig ,
base : baseConfig ,
user : userConfig ,
setUserConfig
} = Object ( external _wp _element _ [ "useContext" ] ) ( GlobalStylesContext ) ;
const finalPath = ! blockName ? ` styles. ${ path } ` : ` styles.blocks. ${ blockName } . ${ path } ` ;
const setStyle = newValue => {
setUserConfig ( currentConfig => {
const newUserConfig = Object ( external _lodash _ [ "cloneDeep" ] ) ( currentConfig ) ;
Object ( external _lodash _ [ "set" ] ) ( newUserConfig , finalPath , getPresetVariableFromValue ( mergedConfig . settings , blockName , path , newValue ) ) ;
return newUserConfig ;
} ) ;
} ;
let result ;
switch ( source ) {
case 'all' :
result = getValueFromVariable ( mergedConfig . settings , blockName , ( _get = Object ( external _lodash _ [ "get" ] ) ( userConfig , finalPath ) ) !== null && _get !== void 0 ? _get : Object ( external _lodash _ [ "get" ] ) ( baseConfig , finalPath ) ) ;
break ;
case 'user' :
result = getValueFromVariable ( mergedConfig . settings , blockName , Object ( external _lodash _ [ "get" ] ) ( userConfig , finalPath ) ) ;
break ;
case 'base' :
result = getValueFromVariable ( baseConfig . settings , blockName , Object ( external _lodash _ [ "get" ] ) ( baseConfig , finalPath ) ) ;
break ;
default :
throw 'Unsupported source' ;
}
return [ result , setStyle ] ;
}
const hooks _ROOT _BLOCK _SUPPORTS = [ 'background' , 'backgroundColor' , 'color' , 'linkColor' , 'fontFamily' , 'fontSize' , 'fontStyle' , 'fontWeight' , 'lineHeight' , 'textDecoration' , 'textTransform' , 'padding' ] ;
function getSupportedGlobalStylesPanels ( name ) {
if ( ! name ) {
return hooks _ROOT _BLOCK _SUPPORTS ;
}
const blockType = Object ( external _wp _blocks _ [ "getBlockType" ] ) ( name ) ;
if ( ! blockType ) {
return [ ] ;
}
const supportKeys = [ ] ;
Object . keys ( external _wp _blocks _ [ "__EXPERIMENTAL_STYLE_PROPERTY" ] ) . forEach ( styleName => {
if ( ! external _wp _blocks _ [ "__EXPERIMENTAL_STYLE_PROPERTY" ] [ styleName ] . support ) {
return ;
} // Opting out means that, for certain support keys like background color,
// blocks have to explicitly set the support value false. If the key is
// unset, we still enable it.
if ( external _wp _blocks _ [ "__EXPERIMENTAL_STYLE_PROPERTY" ] [ styleName ] . requiresOptOut ) {
if ( Object ( external _lodash _ [ "has" ] ) ( blockType . supports , external _wp _blocks _ [ "__EXPERIMENTAL_STYLE_PROPERTY" ] [ styleName ] . support [ 0 ] ) && Object ( external _lodash _ [ "get" ] ) ( blockType . supports , external _wp _blocks _ [ "__EXPERIMENTAL_STYLE_PROPERTY" ] [ styleName ] . support ) !== false ) {
return supportKeys . push ( styleName ) ;
}
}
if ( Object ( external _lodash _ [ "get" ] ) ( blockType . supports , external _wp _blocks _ [ "__EXPERIMENTAL_STYLE_PROPERTY" ] [ styleName ] . support , false ) ) {
return supportKeys . push ( styleName ) ;
}
} ) ;
return supportKeys ;
}
function useColorsPerOrigin ( name ) {
2021-11-30 01:24:27 +01:00
const [ customColors ] = useSetting ( 'color.palette.custom' , name ) ;
2021-11-09 03:17:17 +01:00
const [ themeColors ] = useSetting ( 'color.palette.theme' , name ) ;
2021-11-23 06:40:38 +01:00
const [ defaultColors ] = useSetting ( 'color.palette.default' , name ) ;
const [ shouldDisplayDefaultColors ] = useSetting ( 'color.defaultPalette' ) ;
2021-11-09 03:17:17 +01:00
return Object ( external _wp _element _ [ "useMemo" ] ) ( ( ) => {
const result = [ ] ;
2021-11-23 06:40:38 +01:00
if ( themeColors && themeColors . length ) {
2021-11-09 03:17:17 +01:00
result . push ( {
2021-11-23 06:40:38 +01:00
name : Object ( external _wp _i18n _ [ "_x" ] ) ( 'Theme' , 'Indicates this palette comes from the theme.' ) ,
colors : themeColors
2021-11-09 03:17:17 +01:00
} ) ;
}
2021-11-23 06:40:38 +01:00
if ( shouldDisplayDefaultColors && defaultColors && defaultColors . length ) {
2021-11-09 03:17:17 +01:00
result . push ( {
2021-11-23 06:40:38 +01:00
name : Object ( external _wp _i18n _ [ "_x" ] ) ( 'Default' , 'Indicates this palette comes from WordPress.' ) ,
colors : defaultColors
2021-11-09 03:17:17 +01:00
} ) ;
}
2021-11-23 06:40:38 +01:00
if ( customColors && customColors . length ) {
2021-11-09 03:17:17 +01:00
result . push ( {
2021-11-23 06:40:38 +01:00
name : Object ( external _wp _i18n _ [ "_x" ] ) ( 'Custom' , 'Indicates this palette is created by the user.' ) ,
colors : customColors
2021-11-09 03:17:17 +01:00
} ) ;
}
return result ;
2021-11-23 06:40:38 +01:00
} , [ customColors , themeColors , defaultColors ] ) ;
2021-11-09 03:17:17 +01:00
}
function useGradientsPerOrigin ( name ) {
2021-11-30 01:24:27 +01:00
const [ customGradients ] = useSetting ( 'color.gradients.custom' , name ) ;
2021-11-09 03:17:17 +01:00
const [ themeGradients ] = useSetting ( 'color.gradients.theme' , name ) ;
2021-11-23 06:40:38 +01:00
const [ defaultGradients ] = useSetting ( 'color.gradients.default' , name ) ;
const [ shouldDisplayDefaultGradients ] = useSetting ( 'color.defaultGradients' ) ;
2021-11-09 03:17:17 +01:00
return Object ( external _wp _element _ [ "useMemo" ] ) ( ( ) => {
const result = [ ] ;
2021-11-23 06:40:38 +01:00
if ( themeGradients && themeGradients . length ) {
2021-11-09 03:17:17 +01:00
result . push ( {
2021-11-23 06:40:38 +01:00
name : Object ( external _wp _i18n _ [ "_x" ] ) ( 'Theme' , 'Indicates this palette comes from the theme.' ) ,
gradients : themeGradients
2021-11-09 03:17:17 +01:00
} ) ;
}
2021-11-23 06:40:38 +01:00
if ( shouldDisplayDefaultGradients && defaultGradients && defaultGradients . length ) {
2021-11-09 03:17:17 +01:00
result . push ( {
2021-11-23 06:40:38 +01:00
name : Object ( external _wp _i18n _ [ "_x" ] ) ( 'Default' , 'Indicates this palette comes from WordPress.' ) ,
gradients : defaultGradients
2021-11-09 03:17:17 +01:00
} ) ;
}
2021-11-23 06:40:38 +01:00
if ( customGradients && customGradients . length ) {
2021-11-09 03:17:17 +01:00
result . push ( {
2021-11-23 06:40:38 +01:00
name : Object ( external _wp _i18n _ [ "_x" ] ) ( 'Custom' , 'Indicates this palette is created by the user.' ) ,
gradients : customGradients
2021-11-09 03:17:17 +01:00
} ) ;
}
return result ;
2021-11-23 06:40:38 +01:00
} , [ customGradients , themeGradients , defaultGradients ] ) ;
2021-11-09 03:17:17 +01:00
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/preview.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
const StylesPreview = ( ) => {
const [ fontFamily = 'serif' ] = useStyle ( 'typography.fontFamily' ) ;
const [ textColor = 'black' ] = useStyle ( 'color.text' ) ;
const [ linkColor = 'blue' ] = useStyle ( 'elements.link.color.text' ) ;
const [ backgroundColor = 'white' ] = useStyle ( 'color.background' ) ;
const [ gradientValue ] = useStyle ( 'color.gradient' ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Card" ] , {
className : "edit-site-global-styles-preview" ,
style : {
background : gradientValue !== null && gradientValue !== void 0 ? gradientValue : backgroundColor
}
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalHStack" ] , {
spacing : 5
} , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
style : {
fontFamily ,
fontSize : '80px' ,
color : textColor
}
} , "Aa" ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalVStack" ] , {
spacing : 2
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "ColorIndicator" ] , {
colorValue : textColor
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "ColorIndicator" ] , {
colorValue : linkColor
} ) ) ) ) ;
} ;
/* harmony default export */ var preview = ( StylesPreview ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/navigation-button.js
/ * *
* WordPress dependencies
* /
2021-11-15 13:50:17 +01:00
function NavigationButton ( _ref ) {
let {
path ,
icon ,
children ,
isBack = false ,
... props
} = _ref ;
2021-11-09 03:17:17 +01:00
const navigator = Object ( external _wp _components _ [ "__experimentalUseNavigator" ] ) ( ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalItem" ] , Object ( esm _extends [ "a" /* default */ ] ) ( {
onClick : ( ) => navigator . push ( path , {
isBack
} )
} , props ) , icon && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalHStack" ] , {
justify : "flex-start"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "FlexItem" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( build _module _icon [ "a" /* default */ ] , {
icon : icon ,
size : 24
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "FlexItem" ] , null , children ) ) , ! icon && children ) ;
}
/* harmony default export */ var navigation _button = ( NavigationButton ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/typography.js
/ * *
* WordPress dependencies
* /
const typography = Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _primitives _ [ "SVG" ] , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _primitives _ [ "Path" ] , {
d : "M6.9 7L3 17.8h1.7l1-2.8h4.1l1 2.8h1.7L8.6 7H6.9zm-.7 6.6l1.5-4.3 1.5 4.3h-3zM21.6 17c-.1.1-.2.2-.3.2-.1.1-.2.1-.4.1s-.3-.1-.4-.2c-.1-.1-.1-.3-.1-.6V12c0-.5 0-1-.1-1.4-.1-.4-.3-.7-.5-1-.2-.2-.5-.4-.9-.5-.4 0-.8-.1-1.3-.1s-1 .1-1.4.2c-.4.1-.7.3-1 .4-.2.2-.4.3-.6.5-.1.2-.2.4-.2.7 0 .3.1.5.2.8.2.2.4.3.8.3.3 0 .6-.1.8-.3.2-.2.3-.4.3-.7 0-.3-.1-.5-.2-.7-.2-.2-.4-.3-.6-.4.2-.2.4-.3.7-.4.3-.1.6-.1.8-.1.3 0 .6 0 .8.1.2.1.4.3.5.5.1.2.2.5.2.9v1.1c0 .3-.1.5-.3.6-.2.2-.5.3-.9.4-.3.1-.7.3-1.1.4-.4.1-.8.3-1.1.5-.3.2-.6.4-.8.7-.2.3-.3.7-.3 1.2 0 .6.2 1.1.5 1.4.3.4.9.5 1.6.5.5 0 1-.1 1.4-.3.4-.2.8-.6 1.1-1.1 0 .4.1.7.3 1 .2.3.6.4 1.2.4.4 0 .7-.1.9-.2.2-.1.5-.3.7-.4h-.3zm-3-.9c-.2.4-.5.7-.8.8-.3.2-.6.2-.8.2-.4 0-.6-.1-.9-.3-.2-.2-.3-.6-.3-1.1 0-.5.1-.9.3-1.2s.5-.5.8-.7c.3-.2.7-.3 1-.5.3-.1.6-.3.7-.6v3.4z"
} ) ) ;
/* harmony default export */ var library _typography = ( typography ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/color.js
/ * *
* WordPress dependencies
* /
const color _color = Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _primitives _ [ "SVG" ] , {
viewBox : "0 0 24 24" ,
xmlns : "http://www.w3.org/2000/svg"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _primitives _ [ "Path" ] , {
d : "M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z"
} ) ) ;
/* harmony default export */ var library _color = ( color _color ) ;
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/layout.js
var layout = _ _webpack _require _ _ ( "Civd" ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/border-panel.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
const MIN _BORDER _WIDTH = 0 ; // Defining empty array here instead of inline avoids unnecessary re-renders of
// color control.
const EMPTY _ARRAY = [ ] ;
function useHasBorderPanel ( name ) {
const controls = [ useHasBorderColorControl ( name ) , useHasBorderRadiusControl ( name ) , useHasBorderStyleControl ( name ) , useHasBorderWidthControl ( name ) ] ;
return controls . some ( Boolean ) ;
}
function useHasBorderColorControl ( name ) {
const supports = getSupportedGlobalStylesPanels ( name ) ;
return useSetting ( 'border.color' , name ) [ 0 ] && supports . includes ( 'borderColor' ) ;
}
function useHasBorderRadiusControl ( name ) {
const supports = getSupportedGlobalStylesPanels ( name ) ;
return useSetting ( 'border.radius' , name ) [ 0 ] && supports . includes ( 'borderRadius' ) ;
}
function useHasBorderStyleControl ( name ) {
const supports = getSupportedGlobalStylesPanels ( name ) ;
return useSetting ( 'border.style' , name ) [ 0 ] && supports . includes ( 'borderStyle' ) ;
}
function useHasBorderWidthControl ( name ) {
const supports = getSupportedGlobalStylesPanels ( name ) ;
return useSetting ( 'border.width' , name ) [ 0 ] && supports . includes ( 'borderWidth' ) ;
}
2021-11-15 13:50:17 +01:00
function BorderPanel ( _ref ) {
let {
name
} = _ref ;
2021-11-09 03:17:17 +01:00
const units = Object ( external _wp _components _ [ "__experimentalUseCustomUnits" ] ) ( {
availableUnits : useSetting ( 'spacing.units' ) [ 0 ] || [ 'px' , 'em' , 'rem' ]
} ) ; // Border width.
const hasBorderWidth = useHasBorderWidthControl ( name ) ;
const [ borderWidthValue , setBorderWidth ] = useStyle ( 'border.width' , name ) ; // Border style.
const hasBorderStyle = useHasBorderStyleControl ( name ) ;
const [ borderStyle , setBorderStyle ] = useStyle ( 'border.style' , name ) ; // Border color.
const [ colors = EMPTY _ARRAY ] = useSetting ( 'color.palette' ) ;
const disableCustomColors = ! useSetting ( 'color.custom' ) [ 0 ] ;
const disableCustomGradients = ! useSetting ( 'color.customGradient' ) [ 0 ] ;
const hasBorderColor = useHasBorderColorControl ( name ) ;
const [ borderColor , setBorderColor ] = useStyle ( 'border.color' , name ) ; // Border radius.
const hasBorderRadius = useHasBorderRadiusControl ( name ) ;
const [ borderRadiusValues , setBorderRadius ] = useStyle ( 'border.radius' , name ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "PanelBody" ] , {
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Border' ) ,
initialOpen : true
} , ( hasBorderWidth || hasBorderStyle ) && Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-site-global-styles-sidebar__border-controls-row"
} , hasBorderWidth && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalUnitControl" ] , {
value : borderWidthValue ,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Width' ) ,
min : MIN _BORDER _WIDTH ,
onChange : value => {
setBorderWidth ( value || undefined ) ;
} ,
units : units
} ) , hasBorderStyle && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "__experimentalBorderStyleControl" ] , {
value : borderStyle ,
onChange : setBorderStyle
} ) ) , hasBorderColor && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "__experimentalColorGradientControl" ] , {
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Color' ) ,
colorValue : borderColor ,
colors : colors ,
gradients : undefined ,
disableCustomColors : disableCustomColors ,
disableCustomGradients : disableCustomGradients ,
onColorChange : setBorderColor
} ) , hasBorderRadius && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "__experimentalBorderRadiusControl" ] , {
values : borderRadiusValues ,
onChange : setBorderRadius
} ) ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/color-utils.js
/ * *
* Internal dependencies
* /
function useHasColorPanel ( name ) {
const supports = getSupportedGlobalStylesPanels ( name ) ;
return supports . includes ( 'color' ) || supports . includes ( 'backgroundColor' ) || supports . includes ( 'background' ) || supports . includes ( 'linkColor' ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/dimensions-panel.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
const AXIAL _SIDES = [ 'horizontal' , 'vertical' ] ;
function useHasDimensionsPanel ( name ) {
const hasPadding = useHasPadding ( name ) ;
const hasMargin = useHasMargin ( name ) ;
const hasGap = useHasGap ( name ) ;
return hasPadding || hasMargin || hasGap ;
}
function useHasPadding ( name ) {
const supports = getSupportedGlobalStylesPanels ( name ) ;
const [ settings ] = useSetting ( 'spacing.padding' , name ) ;
return settings && supports . includes ( 'padding' ) ;
}
function useHasMargin ( name ) {
const supports = getSupportedGlobalStylesPanels ( name ) ;
const [ settings ] = useSetting ( 'spacing.margin' , name ) ;
return settings && supports . includes ( 'margin' ) ;
}
function useHasGap ( name ) {
const supports = getSupportedGlobalStylesPanels ( name ) ;
const [ settings ] = useSetting ( 'spacing.blockGap' , name ) ;
return settings && supports . includes ( '--wp--style--block-gap' ) ;
}
function filterValuesBySides ( values , sides ) {
if ( ! sides ) {
// If no custom side configuration all sides are opted into by default.
return values ;
} // Only include sides opted into within filtered values.
const filteredValues = { } ;
sides . forEach ( side => {
if ( side === 'vertical' ) {
filteredValues . top = values . top ;
filteredValues . bottom = values . bottom ;
}
if ( side === 'horizontal' ) {
filteredValues . left = values . left ;
filteredValues . right = values . right ;
}
filteredValues [ side ] = values [ side ] ;
} ) ;
return filteredValues ;
}
function splitStyleValue ( value ) {
// Check for shorthand value ( a string value ).
if ( value && typeof value === 'string' ) {
// Convert to value for individual sides for BoxControl.
return {
top : value ,
right : value ,
bottom : value ,
left : value
} ;
}
return value ;
}
2021-11-15 13:50:17 +01:00
function DimensionsPanel ( _ref ) {
let {
name
} = _ref ;
2021-11-09 03:17:17 +01:00
const showPaddingControl = useHasPadding ( name ) ;
const showMarginControl = useHasMargin ( name ) ;
const showGapControl = useHasGap ( name ) ;
const units = Object ( external _wp _components _ [ "__experimentalUseCustomUnits" ] ) ( {
availableUnits : useSetting ( 'spacing.units' , name ) [ 0 ] || [ '%' , 'px' , 'em' , 'rem' , 'vw' ]
} ) ;
const [ rawPadding , setRawPadding ] = useStyle ( 'spacing.padding' , name ) ;
const paddingValues = splitStyleValue ( rawPadding ) ;
const paddingSides = Object ( external _wp _blockEditor _ [ "__experimentalUseCustomSides" ] ) ( name , 'padding' ) ;
const isAxialPadding = paddingSides && paddingSides . some ( side => AXIAL _SIDES . includes ( side ) ) ;
const setPaddingValues = newPaddingValues => {
const padding = filterValuesBySides ( newPaddingValues , paddingSides ) ;
setRawPadding ( padding ) ;
} ;
const resetPaddingValue = ( ) => setPaddingValues ( { } ) ;
const hasPaddingValue = ( ) => ! ! paddingValues && Object . keys ( paddingValues ) . length ;
const [ rawMargin , setRawMargin ] = useStyle ( 'spacing.margin' , name ) ;
const marginValues = splitStyleValue ( rawMargin ) ;
const marginSides = Object ( external _wp _blockEditor _ [ "__experimentalUseCustomSides" ] ) ( name , 'margin' ) ;
const isAxialMargin = marginSides && marginSides . some ( side => AXIAL _SIDES . includes ( side ) ) ;
const setMarginValues = newMarginValues => {
const margin = filterValuesBySides ( newMarginValues , marginSides ) ;
setRawMargin ( margin ) ;
} ;
const resetMarginValue = ( ) => setMarginValues ( { } ) ;
const hasMarginValue = ( ) => ! ! marginValues && Object . keys ( marginValues ) . length ;
const [ gapValue , setGapValue ] = useStyle ( 'spacing.blockGap' , name ) ;
const resetGapValue = ( ) => setGapValue ( undefined ) ;
const hasGapValue = ( ) => ! ! gapValue ;
const resetAll = ( ) => {
resetPaddingValue ( ) ;
resetMarginValue ( ) ;
resetGapValue ( ) ;
} ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalToolsPanel" ] , {
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Dimensions' ) ,
resetAll : resetAll
} , showPaddingControl && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalToolsPanelItem" ] , {
hasValue : hasPaddingValue ,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Padding' ) ,
onDeselect : resetPaddingValue ,
isShownByDefault : true
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalBoxControl" ] , {
values : paddingValues ,
onChange : setPaddingValues ,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Padding' ) ,
sides : paddingSides ,
units : units ,
allowReset : false ,
splitOnAxis : isAxialPadding
} ) ) , showMarginControl && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalToolsPanelItem" ] , {
hasValue : hasMarginValue ,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Margin' ) ,
onDeselect : resetMarginValue ,
isShownByDefault : true
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalBoxControl" ] , {
values : marginValues ,
onChange : setMarginValues ,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Margin' ) ,
sides : marginSides ,
units : units ,
allowReset : false ,
splitOnAxis : isAxialMargin
} ) ) , showGapControl && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalToolsPanelItem" ] , {
hasValue : hasGapValue ,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Block spacing' ) ,
onDeselect : resetGapValue ,
isShownByDefault : true
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalUnitControl" ] , {
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Block spacing' ) ,
_ _unstableInputWidth : "80px" ,
min : 0 ,
onChange : setGapValue ,
units : units ,
value : gapValue
} ) ) ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/typography-panel.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
function useHasTypographyPanel ( name ) {
const hasLineHeight = useHasLineHeightControl ( name ) ;
const hasFontAppearance = useHasAppearanceControl ( name ) ;
const hasLetterSpacing = useHasLetterSpacingControl ( name ) ;
const supports = getSupportedGlobalStylesPanels ( name ) ;
return hasLineHeight || hasFontAppearance || hasLetterSpacing || supports . includes ( 'fontSize' ) ;
}
function useHasLineHeightControl ( name ) {
const supports = getSupportedGlobalStylesPanels ( name ) ;
return useSetting ( 'typography.lineHeight' , name ) [ 0 ] && supports . includes ( 'lineHeight' ) ;
}
function useHasAppearanceControl ( name ) {
const supports = getSupportedGlobalStylesPanels ( name ) ;
const hasFontStyles = useSetting ( 'typography.fontStyle' , name ) [ 0 ] && supports . includes ( 'fontStyle' ) ;
const hasFontWeights = useSetting ( 'typography.fontWeight' , name ) [ 0 ] && supports . includes ( 'fontWeight' ) ;
return hasFontStyles || hasFontWeights ;
}
function useHasLetterSpacingControl ( name ) {
const supports = getSupportedGlobalStylesPanels ( name ) ;
return useSetting ( 'typography.letterSpacing' , name ) [ 0 ] && supports . includes ( 'letterSpacing' ) ;
}
2021-11-15 13:50:17 +01:00
function TypographyPanel ( _ref ) {
let {
2021-11-30 01:24:27 +01:00
name ,
element
2021-11-15 13:50:17 +01:00
} = _ref ;
2021-11-09 03:17:17 +01:00
const supports = getSupportedGlobalStylesPanels ( name ) ;
2021-11-30 01:24:27 +01:00
const prefix = element === 'text' || ! element ? '' : ` elements. ${ element } . ` ;
2021-11-09 03:17:17 +01:00
const [ fontSizes ] = useSetting ( 'typography.fontSizes' , name ) ;
const disableCustomFontSizes = ! useSetting ( 'typography.customFontSize' , name ) [ 0 ] ;
const [ fontFamilies ] = useSetting ( 'typography.fontFamilies' , name ) ;
const hasFontStyles = useSetting ( 'typography.fontStyle' , name ) [ 0 ] && supports . includes ( 'fontStyle' ) ;
const hasFontWeights = useSetting ( 'typography.fontWeight' , name ) [ 0 ] && supports . includes ( 'fontWeight' ) ;
const hasLineHeightEnabled = useHasLineHeightControl ( name ) ;
const hasAppearanceControl = useHasAppearanceControl ( name ) ;
const hasLetterSpacingControl = useHasLetterSpacingControl ( name ) ;
2021-11-30 01:24:27 +01:00
const [ fontFamily , setFontFamily ] = useStyle ( prefix + 'typography.fontFamily' , name ) ;
const [ fontSize , setFontSize ] = useStyle ( prefix + 'typography.fontSize' , name ) ;
const [ fontStyle , setFontStyle ] = useStyle ( prefix + 'typography.fontStyle' , name ) ;
const [ fontWeight , setFontWeight ] = useStyle ( prefix + 'typography.fontWeight' , name ) ;
const [ lineHeight , setLineHeight ] = useStyle ( prefix + 'typography.lineHeight' , name ) ;
const [ letterSpacing , setLetterSpacing ] = useStyle ( prefix + 'typography.letterSpacing' , name ) ;
const [ backgroundColor ] = useStyle ( prefix + 'color.background' , name ) ;
const [ gradientValue ] = useStyle ( prefix + 'color.gradient' , name ) ;
const [ color ] = useStyle ( prefix + 'color.text' , name ) ;
const extraStyles = element === 'link' ? {
textDecoration : 'underline'
} : { } ;
2021-11-09 03:17:17 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "PanelBody" ] , {
className : "edit-site-typography-panel" ,
initialOpen : true
2021-11-30 01:24:27 +01:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-site-typography-panel__preview" ,
style : {
fontFamily : fontFamily !== null && fontFamily !== void 0 ? fontFamily : 'serif' ,
background : gradientValue !== null && gradientValue !== void 0 ? gradientValue : backgroundColor ,
color ,
fontSize ,
fontStyle ,
fontWeight ,
letterSpacing ,
... extraStyles
}
} , "Aa" ) , supports . includes ( 'fontFamily' ) && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "__experimentalFontFamilyControl" ] , {
2021-11-09 03:17:17 +01:00
fontFamilies : fontFamilies ,
value : fontFamily ,
onChange : setFontFamily
} ) , supports . includes ( 'fontSize' ) && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "FontSizePicker" ] , {
value : fontSize ,
onChange : setFontSize ,
fontSizes : fontSizes ,
disableCustomFontSizes : disableCustomFontSizes
} ) , hasLineHeightEnabled && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "LineHeightControl" ] , {
value : lineHeight ,
onChange : setLineHeight
} ) , hasAppearanceControl && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "__experimentalFontAppearanceControl" ] , {
value : {
fontStyle ,
fontWeight
} ,
2021-11-15 13:50:17 +01:00
onChange : _ref2 => {
let {
fontStyle : newFontStyle ,
fontWeight : newFontWeight
} = _ref2 ;
2021-11-09 03:17:17 +01:00
setFontStyle ( newFontStyle ) ;
setFontWeight ( newFontWeight ) ;
} ,
hasFontStyles : hasFontStyles ,
hasFontWeights : hasFontWeights
} ) , hasLetterSpacingControl && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "__experimentalLetterSpacingControl" ] , {
value : letterSpacing ,
onChange : setLetterSpacing
} ) ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/context-menu.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2021-11-15 13:50:17 +01:00
function ContextMenu ( _ref ) {
let {
name ,
parentMenu = ''
} = _ref ;
2021-11-09 03:17:17 +01:00
const hasTypographyPanel = useHasTypographyPanel ( name ) ;
const hasColorPanel = useHasColorPanel ( name ) ;
const hasBorderPanel = useHasBorderPanel ( name ) ;
const hasDimensionsPanel = useHasDimensionsPanel ( name ) ;
const hasLayoutPanel = hasBorderPanel || hasDimensionsPanel ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalItemGroup" ] , null , hasTypographyPanel && Object ( external _wp _element _ [ "createElement" ] ) ( navigation _button , {
icon : library _typography ,
path : parentMenu + '/typography'
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Typography' ) ) , hasColorPanel && Object ( external _wp _element _ [ "createElement" ] ) ( navigation _button , {
icon : library _color ,
path : parentMenu + '/colors'
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Colors' ) ) , hasLayoutPanel && Object ( external _wp _element _ [ "createElement" ] ) ( navigation _button , {
icon : layout [ "a" /* default */ ] ,
path : parentMenu + '/layout'
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Layout' ) ) ) ;
}
/* harmony default export */ var context _menu = ( ContextMenu ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-root.js
/ * *
* WordPress dependencies
* /
2021-12-14 02:57:26 +01:00
2021-11-09 03:17:17 +01:00
/ * *
* Internal dependencies
* /
function ScreenRoot ( ) {
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Card" ] , {
size : "small"
2021-12-14 02:57:26 +01:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "CardBody" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( preview , null ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "CardBody" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( context _menu , null ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "CardDivider" ] , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "CardBody" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalItemGroup" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalItem" ] , null , Object ( external _wp _i18n _ [ "__" ] ) ( 'Customize the appearance of specific blocks for the whole site.' ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( navigation _button , {
2021-11-09 03:17:17 +01:00
path : "/blocks"
2021-12-14 02:57:26 +01:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalHStack" ] , {
justify : "space-between"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "FlexItem" ] , null , Object ( external _wp _i18n _ [ "__" ] ) ( 'Blocks' ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "FlexItem" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( build _module _icon [ "a" /* default */ ] , {
icon : Object ( external _wp _i18n _ [ "isRTL" ] ) ( ) ? chevron _left [ "a" /* default */ ] : chevron _right [ "a" /* default */ ]
} ) ) ) ) ) ) ) ;
2021-11-09 03:17:17 +01:00
}
/* harmony default export */ var screen _root = ( ScreenRoot ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/header.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2021-11-15 13:50:17 +01:00
function ScreenHeader ( _ref ) {
let {
back ,
title ,
description
} = _ref ;
2021-11-09 03:17:17 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalVStack" ] , {
spacing : 2
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalHStack" ] , {
spacing : 2
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalView" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( navigation _button , {
path : back ,
icon : Object ( external _wp _element _ [ "createElement" ] ) ( build _module _icon [ "a" /* default */ ] , {
icon : Object ( external _wp _i18n _ [ "isRTL" ] ) ( ) ? chevron _right [ "a" /* default */ ] : chevron _left [ "a" /* default */ ] ,
variant : "muted"
} ) ,
size : "small" ,
isBack : true ,
"aria-label" : Object ( external _wp _i18n _ [ "__" ] ) ( 'Navigate to the previous view' )
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalSpacer" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalHeading" ] , {
level : 5
} , title ) ) ) , description && Object ( external _wp _element _ [ "createElement" ] ) ( "p" , {
className : "edit-site-global-styles-header__description"
} , description ) ) ;
}
/* harmony default export */ var global _styles _header = ( ScreenHeader ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-block-list.js
/ * *
* WordPress dependencies
* /
2021-11-23 06:40:38 +01:00
2021-11-09 03:17:17 +01:00
/ * *
* Internal dependencies
* /
2021-11-15 13:50:17 +01:00
function BlockMenuItem ( _ref ) {
let {
block
} = _ref ;
2021-11-09 03:17:17 +01:00
const hasTypographyPanel = useHasTypographyPanel ( block . name ) ;
const hasColorPanel = useHasColorPanel ( block . name ) ;
const hasBorderPanel = useHasBorderPanel ( block . name ) ;
const hasDimensionsPanel = useHasDimensionsPanel ( block . name ) ;
const hasLayoutPanel = hasBorderPanel || hasDimensionsPanel ;
const hasBlockMenuItem = hasTypographyPanel || hasColorPanel || hasLayoutPanel ;
if ( ! hasBlockMenuItem ) {
return null ;
}
return Object ( external _wp _element _ [ "createElement" ] ) ( navigation _button , {
path : '/blocks/' + block . name
2021-11-23 06:40:38 +01:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalHStack" ] , {
justify : "flex-start"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "FlexItem" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "BlockIcon" ] , {
icon : block . icon
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "FlexItem" ] , null , block . title ) ) ) ;
2021-11-09 03:17:17 +01:00
}
function ScreenBlockList ( ) {
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( global _styles _header , {
back : "/" ,
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Blocks' ) ,
description : Object ( external _wp _i18n _ [ "__" ] ) ( 'Customize the appearance of specific blocks and for the whole site.' )
} ) , Object ( external _wp _blocks _ [ "getBlockTypes" ] ) ( ) . map ( block => Object ( external _wp _element _ [ "createElement" ] ) ( BlockMenuItem , {
block : block ,
key : 'menu-itemblock-' + block . name
} ) ) ) ;
}
/* harmony default export */ var screen _block _list = ( ScreenBlockList ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-block.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2021-11-15 13:50:17 +01:00
function ScreenBlock ( _ref ) {
let {
name
} = _ref ;
2021-11-09 03:17:17 +01:00
const blockType = Object ( external _wp _blocks _ [ "getBlockType" ] ) ( name ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( global _styles _header , {
back : "/blocks" ,
title : blockType . title
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( context _menu , {
parentMenu : '/blocks/' + name ,
name : name
} ) ) ;
}
/* harmony default export */ var screen _block = ( ScreenBlock ) ;
2021-11-30 01:24:27 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/subtitle.js
/ * *
* WordPress dependencies
* /
function Subtitle ( _ref ) {
let {
children
} = _ref ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalHeading" ] , {
className : "edit-site-global-styles-subtitle" ,
level : 2
} , children ) ;
}
/* harmony default export */ var subtitle = ( Subtitle ) ;
2021-11-09 03:17:17 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-typography.js
/ * *
* WordPress dependencies
* /
2021-11-30 01:24:27 +01:00
2021-11-09 03:17:17 +01:00
/ * *
* Internal dependencies
* /
2021-11-30 01:24:27 +01:00
function Item ( _ref ) {
2021-11-15 13:50:17 +01:00
let {
2021-11-30 01:24:27 +01:00
name ,
parentMenu ,
element ,
label
2021-11-15 13:50:17 +01:00
} = _ref ;
2021-11-30 01:24:27 +01:00
const hasSupport = ! name ;
const prefix = element === 'text' || ! element ? '' : ` elements. ${ element } . ` ;
const extraStyles = element === 'link' ? {
textDecoration : 'underline'
} : { } ;
const [ fontFamily ] = useStyle ( prefix + 'typography.fontFamily' , name ) ;
const [ fontStyle ] = useStyle ( prefix + 'typography.fontStyle' , name ) ;
const [ fontWeight ] = useStyle ( prefix + 'typography.fontWeight' , name ) ;
const [ letterSpacing ] = useStyle ( prefix + 'typography.letterSpacing' , name ) ;
const [ backgroundColor ] = useStyle ( prefix + 'color.background' , name ) ;
const [ gradientValue ] = useStyle ( prefix + 'color.gradient' , name ) ;
const [ color ] = useStyle ( prefix + 'color.text' , name ) ;
if ( ! hasSupport ) {
return null ;
}
return Object ( external _wp _element _ [ "createElement" ] ) ( navigation _button , {
path : parentMenu + '/typography/' + element
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalHStack" ] , {
justify : "flex-start"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "FlexItem" ] , {
className : "edit-site-global-styles-screen-typography__indicator" ,
style : {
fontFamily : fontFamily !== null && fontFamily !== void 0 ? fontFamily : 'serif' ,
background : gradientValue !== null && gradientValue !== void 0 ? gradientValue : backgroundColor ,
color ,
fontStyle ,
fontWeight ,
letterSpacing ,
... extraStyles
}
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Aa' ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "FlexItem" ] , null , label ) ) ) ;
}
function ScreenTypography ( _ref2 ) {
let {
name
} = _ref2 ;
2021-11-09 03:17:17 +01:00
const parentMenu = name === undefined ? '' : '/blocks/' + name ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( global _styles _header , {
back : parentMenu ? parentMenu : '/' ,
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Typography' ) ,
2021-11-30 01:24:27 +01:00
description : Object ( external _wp _i18n _ [ "__" ] ) ( 'Manage the typography settings for different elements.' )
} ) , ! name && Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-site-global-styles-screen-typography"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalVStack" ] , {
spacing : 3
} , Object ( external _wp _element _ [ "createElement" ] ) ( subtitle , null , Object ( external _wp _i18n _ [ "__" ] ) ( 'Elements' ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalItemGroup" ] , {
isBordered : true ,
isSeparated : true
} , Object ( external _wp _element _ [ "createElement" ] ) ( Item , {
name : name ,
parentMenu : parentMenu ,
element : "text" ,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Text' )
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( Item , {
name : name ,
parentMenu : parentMenu ,
element : "link" ,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Links' )
} ) ) ) ) , ! ! name && Object ( external _wp _element _ [ "createElement" ] ) ( TypographyPanel , {
name : name ,
element : "text"
2021-11-09 03:17:17 +01:00
} ) ) ;
}
/* harmony default export */ var screen _typography = ( ScreenTypography ) ;
2021-11-30 01:24:27 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-typography-element.js
2021-11-09 03:17:17 +01:00
/ * *
* WordPress dependencies
* /
2021-11-30 01:24:27 +01:00
/ * *
* Internal dependencies
* /
2021-11-09 03:17:17 +01:00
2021-11-30 01:24:27 +01:00
const screen _typography _element _elements = {
text : {
description : Object ( external _wp _i18n _ [ "__" ] ) ( 'Manage the fonts used on the site.' ) ,
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Text' )
} ,
link : {
description : Object ( external _wp _i18n _ [ "__" ] ) ( 'Manage the fonts and typography used on the links.' ) ,
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Links' )
}
} ;
function ScreenTypographyElement ( _ref ) {
2021-11-15 13:50:17 +01:00
let {
2021-11-30 01:24:27 +01:00
name ,
element
2021-11-15 13:50:17 +01:00
} = _ref ;
2021-11-30 01:24:27 +01:00
const parentMenu = name === undefined ? '/typography' : '/blocks/' + name + '/typography' ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( global _styles _header , {
back : parentMenu ,
title : screen _typography _element _elements [ element ] . title ,
description : screen _typography _element _elements [ element ] . description
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( TypographyPanel , {
name : name ,
element : element
} ) ) ;
2021-11-09 03:17:17 +01:00
}
2021-11-30 01:24:27 +01:00
/* harmony default export */ var screen _typography _element = ( ScreenTypographyElement ) ;
2021-11-09 03:17:17 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/palette.js
/ * *
* WordPress dependencies
* /
2021-11-30 01:24:27 +01:00
2021-11-09 03:17:17 +01:00
/ * *
* Internal dependencies
* /
const EMPTY _COLORS = [ ] ;
2021-11-15 13:50:17 +01:00
function Palette ( _ref ) {
let {
name
} = _ref ;
2021-11-30 01:24:27 +01:00
const [ customColors ] = useSetting ( 'color.palette.custom' ) ;
const [ themeColors ] = useSetting ( 'color.palette.theme' ) ;
const [ defaultColors ] = useSetting ( 'color.palette.default' ) ;
const [ defaultPaletteEnabled ] = useSetting ( 'color.defaultPalette' , name ) ;
const colors = Object ( external _wp _element _ [ "useMemo" ] ) ( ( ) => [ ... ( customColors || EMPTY _COLORS ) , ... ( themeColors || EMPTY _COLORS ) , ... ( defaultColors && defaultPaletteEnabled ? defaultColors : EMPTY _COLORS ) ] , [ customColors , themeColors , defaultColors , defaultPaletteEnabled ] ) ;
2021-11-09 03:17:17 +01:00
const screenPath = ! name ? '/colors/palette' : '/blocks/' + name + '/colors/palette' ;
2021-11-30 01:24:27 +01:00
const paletteButtonText = colors . length > 0 ? Object ( external _wp _i18n _ [ "sprintf" ] ) ( // Translators: %d: Number of palette colors.
Object ( external _wp _i18n _ [ "_n" ] ) ( '%d color' , '%d colors' , colors . length ) , colors . length ) : Object ( external _wp _i18n _ [ "__" ] ) ( 'Add custom colors' ) ;
2021-11-09 03:17:17 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalVStack" ] , {
spacing : 3
} , Object ( external _wp _element _ [ "createElement" ] ) ( subtitle , null , Object ( external _wp _i18n _ [ "__" ] ) ( 'Palette' ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalItemGroup" ] , {
isBordered : true ,
isSeparated : true
} , Object ( external _wp _element _ [ "createElement" ] ) ( navigation _button , {
path : screenPath
2021-11-30 01:24:27 +01:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalHStack" ] , {
isReversed : colors . length === 0
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "FlexBlock" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalZStack" ] , {
2021-11-09 03:17:17 +01:00
isLayered : false ,
offset : - 8
2021-11-15 13:50:17 +01:00
} , colors . slice ( 0 , 5 ) . map ( _ref2 => {
let {
color
} = _ref2 ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "ColorIndicator" ] , {
key : color ,
colorValue : color
} ) ;
2021-11-30 01:24:27 +01:00
} ) ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "FlexItem" ] , null , paletteButtonText ) ) ) ) ) ;
2021-11-09 03:17:17 +01:00
}
/* harmony default export */ var palette = ( Palette ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-colors.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2021-11-15 13:50:17 +01:00
function BackgroundColorItem ( _ref ) {
let {
name ,
parentMenu
} = _ref ;
2021-11-09 03:17:17 +01:00
const supports = getSupportedGlobalStylesPanels ( name ) ;
const hasSupport = supports . includes ( 'backgroundColor' ) || supports . includes ( 'background' ) ;
const [ backgroundColor ] = useStyle ( 'color.background' , name ) ;
const [ gradientValue ] = useStyle ( 'color.gradient' , name ) ;
if ( ! hasSupport ) {
return null ;
}
return Object ( external _wp _element _ [ "createElement" ] ) ( navigation _button , {
path : parentMenu + '/colors/background'
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalHStack" ] , {
justify : "flex-start"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "FlexItem" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "ColorIndicator" ] , {
colorValue : gradientValue !== null && gradientValue !== void 0 ? gradientValue : backgroundColor
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "FlexItem" ] , null , Object ( external _wp _i18n _ [ "__" ] ) ( 'Background' ) ) ) ) ;
}
2021-11-15 13:50:17 +01:00
function TextColorItem ( _ref2 ) {
let {
name ,
parentMenu
} = _ref2 ;
2021-11-09 03:17:17 +01:00
const supports = getSupportedGlobalStylesPanels ( name ) ;
const hasSupport = supports . includes ( 'color' ) ;
const [ color ] = useStyle ( 'color.text' , name ) ;
if ( ! hasSupport ) {
return null ;
}
return Object ( external _wp _element _ [ "createElement" ] ) ( navigation _button , {
path : parentMenu + '/colors/text'
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalHStack" ] , {
justify : "flex-start"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "FlexItem" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "ColorIndicator" ] , {
colorValue : color
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "FlexItem" ] , null , Object ( external _wp _i18n _ [ "__" ] ) ( 'Text' ) ) ) ) ;
}
2021-11-15 13:50:17 +01:00
function LinkColorItem ( _ref3 ) {
let {
name ,
parentMenu
} = _ref3 ;
2021-11-09 03:17:17 +01:00
const supports = getSupportedGlobalStylesPanels ( name ) ;
const hasSupport = supports . includes ( 'linkColor' ) ;
const [ color ] = useStyle ( 'elements.link.color.text' , name ) ;
if ( ! hasSupport ) {
return null ;
}
return Object ( external _wp _element _ [ "createElement" ] ) ( navigation _button , {
path : parentMenu + '/colors/link'
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalHStack" ] , {
justify : "flex-start"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "FlexItem" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "ColorIndicator" ] , {
colorValue : color
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "FlexItem" ] , null , Object ( external _wp _i18n _ [ "__" ] ) ( 'Links' ) ) ) ) ;
}
2021-11-15 13:50:17 +01:00
function ScreenColors ( _ref4 ) {
let {
name
} = _ref4 ;
2021-11-09 03:17:17 +01:00
const parentMenu = name === undefined ? '' : '/blocks/' + name ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( global _styles _header , {
back : parentMenu ? parentMenu : '/' ,
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Colors' ) ,
description : Object ( external _wp _i18n _ [ "__" ] ) ( 'Manage palettes and the default color of different global elements on the website.' )
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-site-global-styles-screen-colors"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalVStack" ] , {
spacing : 10
} , Object ( external _wp _element _ [ "createElement" ] ) ( palette , {
name : name
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalVStack" ] , {
spacing : 3
} , Object ( external _wp _element _ [ "createElement" ] ) ( subtitle , null , Object ( external _wp _i18n _ [ "__" ] ) ( 'Elements' ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalItemGroup" ] , {
isBordered : true ,
isSeparated : true
} , Object ( external _wp _element _ [ "createElement" ] ) ( BackgroundColorItem , {
name : name ,
parentMenu : parentMenu
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( TextColorItem , {
name : name ,
parentMenu : parentMenu
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( LinkColorItem , {
name : name ,
parentMenu : parentMenu
} ) ) ) ) ) ) ;
}
/* harmony default export */ var screen _colors = ( ScreenColors ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/color-palette-panel.js
/ * *
* WordPress dependencies
* /
2021-11-23 06:40:38 +01:00
2021-11-09 03:17:17 +01:00
/ * *
* Internal dependencies
* /
2021-11-15 13:50:17 +01:00
function ColorPalettePanel ( _ref ) {
let {
name
} = _ref ;
2021-11-23 06:40:38 +01:00
const [ themeColors , setThemeColors ] = useSetting ( 'color.palette.theme' , name ) ;
const [ baseThemeColors ] = useSetting ( 'color.palette.theme' , name , 'base' ) ;
const [ defaultColors , setDefaultColors ] = useSetting ( 'color.palette.default' , name ) ;
const [ baseDefaultColors ] = useSetting ( 'color.palette.default' , name , 'base' ) ;
2021-11-30 01:24:27 +01:00
const [ customColors , setCustomColors ] = useSetting ( 'color.palette.custom' , name ) ;
2021-11-23 06:40:38 +01:00
const [ defaultPaletteEnabled ] = useSetting ( 'color.defaultPalette' , name ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalVStack" ] , {
className : "edit-site-global-styles-color-palette-panel" ,
spacing : 10
2021-11-30 01:24:27 +01:00
} , ! ! themeColors && ! ! themeColors . length && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalPaletteEdit" ] , {
2021-11-23 06:40:38 +01:00
canReset : themeColors !== baseThemeColors ,
canOnlyChangeValues : true ,
colors : themeColors ,
onChange : setThemeColors ,
paletteLabel : Object ( external _wp _i18n _ [ "__" ] ) ( 'Theme' )
2021-11-30 01:24:27 +01:00
} ) , ! ! defaultColors && ! ! defaultColors . length && ! ! defaultPaletteEnabled && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalPaletteEdit" ] , {
2021-11-23 06:40:38 +01:00
canReset : defaultColors !== baseDefaultColors ,
canOnlyChangeValues : true ,
colors : defaultColors ,
onChange : setDefaultColors ,
paletteLabel : Object ( external _wp _i18n _ [ "__" ] ) ( 'Default' )
2021-11-30 01:24:27 +01:00
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalPaletteEdit" ] , {
2021-11-23 06:40:38 +01:00
colors : customColors ,
onChange : setCustomColors ,
paletteLabel : Object ( external _wp _i18n _ [ "__" ] ) ( 'Custom' ) ,
emptyMessage : Object ( external _wp _i18n _ [ "__" ] ) ( 'Custom colors are empty! Add some colors to create your own color palette.' ) ,
slugPrefix : "custom-"
2021-11-09 03:17:17 +01:00
} ) ) ;
}
2021-11-30 01:24:27 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/gradients-palette-panel.js
2021-11-30 06:48:28 +01:00
/ * *
* External dependencies
* /
2021-11-30 01:24:27 +01:00
/ * *
* WordPress dependencies
* /
2021-11-30 06:48:28 +01:00
2021-11-30 01:24:27 +01:00
/ * *
* Internal dependencies
* /
2021-12-21 08:02:34 +01:00
2021-11-30 01:24:27 +01:00
function GradientPalettePanel ( _ref ) {
let {
name
} = _ref ;
const [ themeGradients , setThemeGradients ] = useSetting ( 'color.gradients.theme' , name ) ;
const [ baseThemeGradients ] = useSetting ( 'color.gradients.theme' , name , 'base' ) ;
const [ defaultGradients , setDefaultGradients ] = useSetting ( 'color.gradients.default' , name ) ;
const [ baseDefaultGradients ] = useSetting ( 'color.gradients.default' , name , 'base' ) ;
const [ customGradients , setCustomGradients ] = useSetting ( 'color.gradients.custom' , name ) ;
const [ defaultPaletteEnabled ] = useSetting ( 'color.defaultGradients' , name ) ;
2021-11-30 06:48:28 +01:00
const [ duotonePalette ] = useSetting ( 'color.duotone' ) || [ ] ;
2021-11-30 01:24:27 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalVStack" ] , {
className : "edit-site-global-styles-gradient-palette-panel" ,
spacing : 10
2021-12-14 02:57:26 +01:00
} , ! ! themeGradients && ! ! themeGradients . length && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalPaletteEdit" ] , {
2021-11-30 01:24:27 +01:00
canReset : themeGradients !== baseThemeGradients ,
canOnlyChangeValues : true ,
gradients : themeGradients ,
onChange : setThemeGradients ,
paletteLabel : Object ( external _wp _i18n _ [ "__" ] ) ( 'Theme' )
} ) , ! ! defaultGradients && ! ! defaultGradients . length && ! ! defaultPaletteEnabled && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalPaletteEdit" ] , {
canReset : defaultGradients !== baseDefaultGradients ,
canOnlyChangeValues : true ,
gradients : defaultGradients ,
onChange : setDefaultGradients ,
paletteLabel : Object ( external _wp _i18n _ [ "__" ] ) ( 'Default' )
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalPaletteEdit" ] , {
gradients : customGradients ,
onChange : setCustomGradients ,
paletteLabel : Object ( external _wp _i18n _ [ "__" ] ) ( 'Custom' ) ,
emptyMessage : Object ( external _wp _i18n _ [ "__" ] ) ( 'Custom gradients are empty! Add some gradients to create your own palette.' ) ,
slugPrefix : "custom-"
2021-12-21 08:02:34 +01:00
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , null , Object ( external _wp _element _ [ "createElement" ] ) ( subtitle , null , Object ( external _wp _i18n _ [ "__" ] ) ( 'Duotone' ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalSpacer" ] , {
margin : 3
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "DuotonePicker" ] , {
2021-12-14 02:57:26 +01:00
duotonePalette : duotonePalette ,
disableCustomDuotone : true ,
disableCustomColors : true ,
clearable : false ,
onChange : external _lodash _ [ "noop" ]
} ) ) ) ;
2021-11-30 01:24:27 +01:00
}
2021-11-09 03:17:17 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-color-palette.js
/ * *
* WordPress dependencies
* /
2021-11-30 01:24:27 +01:00
2021-11-09 03:17:17 +01:00
/ * *
* Internal dependencies
* /
2021-11-30 01:24:27 +01:00
2021-11-15 13:50:17 +01:00
function ScreenColorPalette ( _ref ) {
let {
name
} = _ref ;
2021-11-30 01:24:27 +01:00
const [ currentTab , setCurrentTab ] = Object ( external _wp _element _ [ "useState" ] ) ( 'solid' ) ;
2021-11-09 03:17:17 +01:00
const parentMenu = name === undefined ? '' : '/blocks/' + name ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( global _styles _header , {
back : parentMenu + '/colors' ,
2021-11-30 01:24:27 +01:00
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Palette' ) ,
description : Object ( external _wp _i18n _ [ "__" ] ) ( 'Palettes are used to provide default color options for blocks and various design tools. Here you can edit the colors with their labels.' )
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalToggleGroupControl" ] , {
className : "edit-site-screen-color-palette-toggle" ,
value : currentTab ,
onChange : setCurrentTab ,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Select palette type' ) ,
hideLabelFromVision : true ,
isBlock : true
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalToggleGroupControlOption" ] , {
value : "solid" ,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Solid' )
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalToggleGroupControlOption" ] , {
value : "gradient" ,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Gradient' )
} ) ) , currentTab === 'solid' && Object ( external _wp _element _ [ "createElement" ] ) ( ColorPalettePanel , {
name : name
} ) , currentTab === 'gradient' && Object ( external _wp _element _ [ "createElement" ] ) ( GradientPalettePanel , {
2021-11-09 03:17:17 +01:00
name : name
} ) ) ;
}
/* harmony default export */ var screen _color _palette = ( ScreenColorPalette ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-background-color.js
2022-02-17 20:18:25 +01:00
2021-11-09 03:17:17 +01:00
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2021-11-15 13:50:17 +01:00
function ScreenBackgroundColor ( _ref ) {
let {
name
} = _ref ;
2021-11-09 03:17:17 +01:00
const parentMenu = name === undefined ? '' : '/blocks/' + name ;
const supports = getSupportedGlobalStylesPanels ( name ) ;
const [ solids ] = useSetting ( 'color.palette' , name ) ;
const [ gradients ] = useSetting ( 'color.gradients' , name ) ;
const [ areCustomSolidsEnabled ] = useSetting ( 'color.custom' , name ) ;
const [ areCustomGradientsEnabled ] = useSetting ( 'color.customGradient' , name ) ;
const colorsPerOrigin = useColorsPerOrigin ( name ) ;
const gradientsPerOrigin = useGradientsPerOrigin ( name ) ;
const [ isBackgroundEnabled ] = useSetting ( 'color.background' , name ) ;
const hasBackgroundColor = supports . includes ( 'backgroundColor' ) && isBackgroundEnabled && ( solids . length > 0 || areCustomSolidsEnabled ) ;
const hasGradientColor = supports . includes ( 'background' ) && ( gradients . length > 0 || areCustomGradientsEnabled ) ;
const [ backgroundColor , setBackgroundColor ] = useStyle ( 'color.background' , name ) ;
const [ userBackgroundColor ] = useStyle ( 'color.background' , name , 'user' ) ;
const [ gradient , setGradient ] = useStyle ( 'color.gradient' , name ) ;
const [ userGradient ] = useStyle ( 'color.gradient' , name , 'user' ) ;
if ( ! hasBackgroundColor && ! hasGradientColor ) {
return null ;
}
let backgroundSettings = { } ;
if ( hasBackgroundColor ) {
backgroundSettings = {
colorValue : backgroundColor ,
onColorChange : setBackgroundColor
} ;
if ( backgroundColor ) {
backgroundSettings . clearable = backgroundColor === userBackgroundColor ;
}
}
let gradientSettings = { } ;
if ( hasGradientColor ) {
gradientSettings = {
gradientValue : gradient ,
onGradientChange : setGradient
} ;
if ( gradient ) {
gradientSettings . clearable = gradient === userGradient ;
}
}
2022-02-17 20:18:25 +01:00
const controlProps = { ... backgroundSettings ,
... gradientSettings
} ;
2021-11-09 03:17:17 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( global _styles _header , {
back : parentMenu + '/colors' ,
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Background' ) ,
description : Object ( external _wp _i18n _ [ "__" ] ) ( 'Set a background color or gradient for the whole website.' )
2022-02-17 20:18:25 +01:00
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "__experimentalColorGradientControl" ] , Object ( esm _extends [ "a" /* default */ ] ) ( {
className : "edit-site-screen-background-color__control" ,
2021-11-09 03:17:17 +01:00
colors : colorsPerOrigin ,
gradients : gradientsPerOrigin ,
disableCustomColors : ! areCustomSolidsEnabled ,
disableCustomGradients : ! areCustomGradientsEnabled ,
_ _experimentalHasMultipleOrigins : true ,
2021-11-30 01:24:27 +01:00
showTitle : false ,
2021-12-06 07:20:27 +01:00
enableAlpha : true ,
_ _experimentalIsRenderedInSidebar : true
2022-02-17 20:18:25 +01:00
} , controlProps ) ) ) ;
2021-11-09 03:17:17 +01:00
}
/* harmony default export */ var screen _background _color = ( ScreenBackgroundColor ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-text-color.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2021-11-15 13:50:17 +01:00
function ScreenTextColor ( _ref ) {
let {
name
} = _ref ;
2021-11-09 03:17:17 +01:00
const parentMenu = name === undefined ? '' : '/blocks/' + name ;
const supports = getSupportedGlobalStylesPanels ( name ) ;
const [ solids ] = useSetting ( 'color.palette' , name ) ;
const [ areCustomSolidsEnabled ] = useSetting ( 'color.custom' , name ) ;
const [ isTextEnabled ] = useSetting ( 'color.text' , name ) ;
const colorsPerOrigin = useColorsPerOrigin ( name ) ;
const hasTextColor = supports . includes ( 'color' ) && isTextEnabled && ( solids . length > 0 || areCustomSolidsEnabled ) ;
const [ color , setColor ] = useStyle ( 'color.text' , name ) ;
const [ userColor ] = useStyle ( 'color.text' , name , 'user' ) ;
if ( ! hasTextColor ) {
return null ;
}
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( global _styles _header , {
back : parentMenu + '/colors' ,
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Text' ) ,
description : Object ( external _wp _i18n _ [ "__" ] ) ( 'Set the default color used for text across the site.' )
2022-02-17 20:18:25 +01:00
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "__experimentalColorGradientControl" ] , {
className : "edit-site-screen-text-color__control" ,
2021-11-09 03:17:17 +01:00
colors : colorsPerOrigin ,
disableCustomColors : ! areCustomSolidsEnabled ,
_ _experimentalHasMultipleOrigins : true ,
2021-11-30 01:24:27 +01:00
showTitle : false ,
2021-12-06 07:20:27 +01:00
enableAlpha : true ,
2022-02-17 20:18:25 +01:00
_ _experimentalIsRenderedInSidebar : true ,
colorValue : color ,
onColorChange : setColor ,
clearable : color === userColor
2021-11-09 03:17:17 +01:00
} ) ) ;
}
/* harmony default export */ var screen _text _color = ( ScreenTextColor ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-link-color.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2021-11-15 13:50:17 +01:00
function ScreenLinkColor ( _ref ) {
let {
name
} = _ref ;
2021-11-09 03:17:17 +01:00
const parentMenu = name === undefined ? '' : '/blocks/' + name ;
const supports = getSupportedGlobalStylesPanels ( name ) ;
const [ solids ] = useSetting ( 'color.palette' , name ) ;
const [ areCustomSolidsEnabled ] = useSetting ( 'color.custom' , name ) ;
const colorsPerOrigin = useColorsPerOrigin ( name ) ;
const [ isLinkEnabled ] = useSetting ( 'color.link' , name ) ;
const hasLinkColor = supports . includes ( 'linkColor' ) && isLinkEnabled && ( solids . length > 0 || areCustomSolidsEnabled ) ;
const [ linkColor , setLinkColor ] = useStyle ( 'elements.link.color.text' , name ) ;
const [ userLinkColor ] = useStyle ( 'elements.link.color.text' , name , 'user' ) ;
if ( ! hasLinkColor ) {
return null ;
}
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( global _styles _header , {
back : parentMenu + '/colors' ,
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Links' ) ,
description : Object ( external _wp _i18n _ [ "__" ] ) ( 'Set the default color used for links across the site.' )
2022-02-17 20:18:25 +01:00
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "__experimentalColorGradientControl" ] , {
className : "edit-site-screen-link-color__control" ,
2021-11-09 03:17:17 +01:00
colors : colorsPerOrigin ,
disableCustomColors : ! areCustomSolidsEnabled ,
_ _experimentalHasMultipleOrigins : true ,
2021-11-30 01:24:27 +01:00
showTitle : false ,
2021-12-06 07:20:27 +01:00
enableAlpha : true ,
2022-02-17 20:18:25 +01:00
_ _experimentalIsRenderedInSidebar : true ,
colorValue : linkColor ,
onColorChange : setLinkColor ,
clearable : linkColor === userLinkColor
2021-11-09 03:17:17 +01:00
} ) ) ;
}
/* harmony default export */ var screen _link _color = ( ScreenLinkColor ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-layout.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2021-11-15 13:50:17 +01:00
function ScreenLayout ( _ref ) {
let {
name
} = _ref ;
2021-11-09 03:17:17 +01:00
const parentMenu = name === undefined ? '' : '/blocks/' + name ;
const hasBorderPanel = useHasBorderPanel ( name ) ;
const hasDimensionsPanel = useHasDimensionsPanel ( name ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( global _styles _header , {
back : parentMenu ? parentMenu : '/' ,
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Layout' )
} ) , hasDimensionsPanel && Object ( external _wp _element _ [ "createElement" ] ) ( DimensionsPanel , {
name : name
} ) , hasBorderPanel && Object ( external _wp _element _ [ "createElement" ] ) ( BorderPanel , {
name : name
} ) ) ;
}
/* harmony default export */ var screen _layout = ( ScreenLayout ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/ui.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2021-11-30 01:24:27 +01:00
2021-11-15 13:50:17 +01:00
function ContextScreens ( _ref ) {
let {
name
} = _ref ;
2021-11-09 03:17:17 +01:00
const parentMenu = name === undefined ? '' : '/blocks/' + name ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalNavigatorScreen" ] , {
path : parentMenu + '/typography'
} , Object ( external _wp _element _ [ "createElement" ] ) ( screen _typography , {
name : name
2021-11-30 01:24:27 +01:00
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalNavigatorScreen" ] , {
path : parentMenu + '/typography/text'
} , Object ( external _wp _element _ [ "createElement" ] ) ( screen _typography _element , {
name : name ,
element : "text"
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalNavigatorScreen" ] , {
path : parentMenu + '/typography/link'
} , Object ( external _wp _element _ [ "createElement" ] ) ( screen _typography _element , {
name : name ,
element : "link"
2021-11-09 03:17:17 +01:00
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalNavigatorScreen" ] , {
path : parentMenu + '/colors'
} , Object ( external _wp _element _ [ "createElement" ] ) ( screen _colors , {
name : name
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalNavigatorScreen" ] , {
path : parentMenu + '/colors/palette'
} , Object ( external _wp _element _ [ "createElement" ] ) ( screen _color _palette , {
name : name
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalNavigatorScreen" ] , {
path : parentMenu + '/colors/background'
} , Object ( external _wp _element _ [ "createElement" ] ) ( screen _background _color , {
name : name
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalNavigatorScreen" ] , {
path : parentMenu + '/colors/text'
} , Object ( external _wp _element _ [ "createElement" ] ) ( screen _text _color , {
name : name
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalNavigatorScreen" ] , {
path : parentMenu + '/colors/link'
} , Object ( external _wp _element _ [ "createElement" ] ) ( screen _link _color , {
name : name
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalNavigatorScreen" ] , {
path : parentMenu + '/layout'
} , Object ( external _wp _element _ [ "createElement" ] ) ( screen _layout , {
name : name
} ) ) ) ;
}
function GlobalStylesUI ( ) {
const blocks = Object ( external _wp _blocks _ [ "getBlockTypes" ] ) ( ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalNavigatorProvider" ] , {
initialPath : "/"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalNavigatorScreen" ] , {
path : "/"
} , Object ( external _wp _element _ [ "createElement" ] ) ( screen _root , null ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalNavigatorScreen" ] , {
path : "/blocks"
} , Object ( external _wp _element _ [ "createElement" ] ) ( screen _block _list , null ) ) , blocks . map ( block => Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalNavigatorScreen" ] , {
key : 'menu-block-' + block . name ,
path : '/blocks/' + block . name
} , Object ( external _wp _element _ [ "createElement" ] ) ( screen _block , {
name : block . name
} ) ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( ContextScreens , null ) , blocks . map ( block => Object ( external _wp _element _ [ "createElement" ] ) ( ContextScreens , {
key : 'screens-block-' + block . name ,
name : block . name
} ) ) ) ;
}
/* harmony default export */ var ui = ( GlobalStylesUI ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/use-global-styles-output.js
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
/ * *
* Internal dependencies
* /
function compileStyleValue ( uncompiledValue ) {
const VARIABLE _REFERENCE _PREFIX = 'var:' ;
const VARIABLE _PATH _SEPARATOR _TOKEN _ATTRIBUTE = '|' ;
const VARIABLE _PATH _SEPARATOR _TOKEN _STYLE = '--' ;
if ( Object ( external _lodash _ [ "startsWith" ] ) ( uncompiledValue , VARIABLE _REFERENCE _PREFIX ) ) {
const variable = uncompiledValue . slice ( VARIABLE _REFERENCE _PREFIX . length ) . split ( VARIABLE _PATH _SEPARATOR _TOKEN _ATTRIBUTE ) . join ( VARIABLE _PATH _SEPARATOR _TOKEN _STYLE ) ;
return ` var(--wp-- ${ variable } ) ` ;
}
return uncompiledValue ;
}
/ * *
* Transform given preset tree into a set of style declarations .
*
* @ param { Object } blockPresets
*
* @ return { Array } An array of style declarations .
* /
2021-11-15 13:50:17 +01:00
function getPresetsDeclarations ( ) {
let blockPresets = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
return Object ( external _lodash _ [ "reduce" ] ) ( PRESET _METADATA , ( declarations , _ref ) => {
let {
path ,
valueKey ,
cssVarInfix
} = _ref ;
2021-11-09 03:17:17 +01:00
const presetByOrigin = Object ( external _lodash _ [ "get" ] ) ( blockPresets , path , [ ] ) ;
2021-11-30 01:24:27 +01:00
[ 'default' , 'theme' , 'custom' ] . forEach ( origin => {
2021-11-09 03:17:17 +01:00
if ( presetByOrigin [ origin ] ) {
presetByOrigin [ origin ] . forEach ( value => {
declarations . push ( ` --wp--preset-- ${ cssVarInfix } -- ${ Object ( external _lodash _ [ "kebabCase" ] ) ( value . slug ) } : ${ value [ valueKey ] } ` ) ;
} ) ;
}
} ) ;
return declarations ;
} , [ ] ) ;
}
/ * *
* Transform given preset tree into a set of preset class declarations .
*
* @ param { string } blockSelector
* @ param { Object } blockPresets
* @ return { string } CSS declarations for the preset classes .
* /
2021-11-15 13:50:17 +01:00
function getPresetsClasses ( blockSelector ) {
let blockPresets = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : { } ;
return Object ( external _lodash _ [ "reduce" ] ) ( PRESET _METADATA , ( declarations , _ref2 ) => {
let {
path ,
cssVarInfix ,
classes
} = _ref2 ;
2021-11-09 03:17:17 +01:00
if ( ! classes ) {
return declarations ;
}
const presetByOrigin = Object ( external _lodash _ [ "get" ] ) ( blockPresets , path , [ ] ) ;
2021-11-30 01:24:27 +01:00
[ 'default' , 'theme' , 'custom' ] . forEach ( origin => {
2021-11-09 03:17:17 +01:00
if ( presetByOrigin [ origin ] ) {
2021-11-15 13:50:17 +01:00
presetByOrigin [ origin ] . forEach ( _ref3 => {
let {
slug
} = _ref3 ;
classes . forEach ( _ref4 => {
let {
classSuffix ,
propertyName
} = _ref4 ;
2021-11-09 03:17:17 +01:00
const classSelectorToUse = ` .has- ${ Object ( external _lodash _ [ "kebabCase" ] ) ( slug ) } - ${ classSuffix } ` ;
const selectorToUse = blockSelector . split ( ',' ) // Selector can be "h1, h2, h3"
. map ( selector => ` ${ selector } ${ classSelectorToUse } ` ) . join ( ',' ) ;
const value = ` var(--wp--preset-- ${ cssVarInfix } -- ${ Object ( external _lodash _ [ "kebabCase" ] ) ( slug ) } ) ` ;
declarations += ` ${ selectorToUse } { ${ propertyName } : ${ value } !important;} ` ;
} ) ;
} ) ;
}
} ) ;
return declarations ;
} , '' ) ;
}
2021-11-15 13:50:17 +01:00
function flattenTree ( ) {
let input = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
let prefix = arguments . length > 1 ? arguments [ 1 ] : undefined ;
let token = arguments . length > 2 ? arguments [ 2 ] : undefined ;
2021-11-09 03:17:17 +01:00
let result = [ ] ;
Object . keys ( input ) . forEach ( key => {
const newKey = prefix + Object ( external _lodash _ [ "kebabCase" ] ) ( key . replace ( '/' , '-' ) ) ;
const newLeaf = input [ key ] ;
if ( newLeaf instanceof Object ) {
const newPrefix = newKey + token ;
result = [ ... result , ... flattenTree ( newLeaf , newPrefix , token ) ] ;
} else {
result . push ( ` ${ newKey } : ${ newLeaf } ` ) ;
}
} ) ;
return result ;
}
/ * *
* Transform given style tree into a set of style declarations .
*
* @ param { Object } blockStyles Block styles .
*
* @ return { Array } An array of style declarations .
* /
2021-11-15 13:50:17 +01:00
function getStylesDeclarations ( ) {
let blockStyles = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
return Object ( external _lodash _ [ "reduce" ] ) ( external _wp _blocks _ [ "__EXPERIMENTAL_STYLE_PROPERTY" ] , ( declarations , _ref5 , key ) => {
let {
value ,
properties
} = _ref5 ;
2021-11-09 03:17:17 +01:00
const pathToValue = value ;
if ( Object ( external _lodash _ [ "first" ] ) ( pathToValue ) === 'elements' ) {
return declarations ;
}
const styleValue = Object ( external _lodash _ [ "get" ] ) ( blockStyles , pathToValue ) ;
if ( ! ! properties && ! Object ( external _lodash _ [ "isString" ] ) ( styleValue ) ) {
Object . entries ( properties ) . forEach ( entry => {
const [ name , prop ] = entry ;
if ( ! Object ( external _lodash _ [ "get" ] ) ( styleValue , [ prop ] , false ) ) {
// Do not create a declaration
// for sub-properties that don't have any value.
return ;
}
const cssProperty = Object ( external _lodash _ [ "kebabCase" ] ) ( name ) ;
declarations . push ( ` ${ cssProperty } : ${ compileStyleValue ( Object ( external _lodash _ [ "get" ] ) ( styleValue , [ prop ] ) ) } ` ) ;
} ) ;
} else if ( Object ( external _lodash _ [ "get" ] ) ( blockStyles , pathToValue , false ) ) {
const cssProperty = key . startsWith ( '--' ) ? key : Object ( external _lodash _ [ "kebabCase" ] ) ( key ) ;
declarations . push ( ` ${ cssProperty } : ${ compileStyleValue ( Object ( external _lodash _ [ "get" ] ) ( blockStyles , pathToValue ) ) } ` ) ;
}
return declarations ;
} , [ ] ) ;
}
const getNodesWithStyles = ( tree , blockSelectors ) => {
var _tree$styles , _tree$styles2 ;
const nodes = [ ] ;
if ( ! ( tree !== null && tree !== void 0 && tree . styles ) ) {
return nodes ;
}
const pickStyleKeys = treeToPickFrom => Object ( external _lodash _ [ "pickBy" ] ) ( treeToPickFrom , ( value , key ) => [ 'border' , 'color' , 'spacing' , 'typography' ] . includes ( key ) ) ; // Top-level.
const styles = pickStyleKeys ( tree . styles ) ;
if ( ! ! styles ) {
nodes . push ( {
styles ,
selector : ROOT _BLOCK _SELECTOR
} ) ;
}
Object ( external _lodash _ [ "forEach" ] ) ( ( _tree$styles = tree . styles ) === null || _tree$styles === void 0 ? void 0 : _tree$styles . elements , ( value , key ) => {
if ( ! ! value && ! ! external _wp _blocks _ [ "__EXPERIMENTAL_ELEMENTS" ] [ key ] ) {
nodes . push ( {
styles : value ,
selector : external _wp _blocks _ [ "__EXPERIMENTAL_ELEMENTS" ] [ key ]
} ) ;
}
} ) ; // Iterate over blocks: they can have styles & elements.
Object ( external _lodash _ [ "forEach" ] ) ( ( _tree$styles2 = tree . styles ) === null || _tree$styles2 === void 0 ? void 0 : _tree$styles2 . blocks , ( node , blockName ) => {
var _blockSelectors$block ;
const blockStyles = pickStyleKeys ( node ) ;
if ( ! ! blockStyles && ! ! ( blockSelectors !== null && blockSelectors !== void 0 && ( _blockSelectors$block = blockSelectors [ blockName ] ) !== null && _blockSelectors$block !== void 0 && _blockSelectors$block . selector ) ) {
nodes . push ( {
styles : blockStyles ,
selector : blockSelectors [ blockName ] . selector
} ) ;
}
Object ( external _lodash _ [ "forEach" ] ) ( node === null || node === void 0 ? void 0 : node . elements , ( value , elementName ) => {
if ( ! ! value && ! ! ( blockSelectors !== null && blockSelectors !== void 0 && blockSelectors [ blockName ] ) && ! ! ( external _wp _blocks _ [ "__EXPERIMENTAL_ELEMENTS" ] !== null && external _wp _blocks _ [ "__EXPERIMENTAL_ELEMENTS" ] !== void 0 && external _wp _blocks _ [ "__EXPERIMENTAL_ELEMENTS" ] [ elementName ] ) ) {
nodes . push ( {
styles : value ,
selector : blockSelectors [ blockName ] . selector . split ( ',' ) . map ( sel => sel + ' ' + external _wp _blocks _ [ "__EXPERIMENTAL_ELEMENTS" ] [ elementName ] ) . join ( ',' )
} ) ;
}
} ) ;
} ) ;
return nodes ;
} ;
const getNodesWithSettings = ( tree , blockSelectors ) => {
var _tree$settings , _tree$settings2 ;
const nodes = [ ] ;
if ( ! ( tree !== null && tree !== void 0 && tree . settings ) ) {
return nodes ;
}
const pickPresets = treeToPickFrom => {
const presets = { } ;
2021-11-15 13:50:17 +01:00
PRESET _METADATA . forEach ( _ref6 => {
let {
path
} = _ref6 ;
2021-11-09 03:17:17 +01:00
const value = Object ( external _lodash _ [ "get" ] ) ( treeToPickFrom , path , false ) ;
if ( value !== false ) {
Object ( external _lodash _ [ "set" ] ) ( presets , path , value ) ;
}
} ) ;
return presets ;
} ; // Top-level.
const presets = pickPresets ( tree . settings ) ;
const custom = ( _tree$settings = tree . settings ) === null || _tree$settings === void 0 ? void 0 : _tree$settings . custom ;
if ( ! Object ( external _lodash _ [ "isEmpty" ] ) ( presets ) || ! ! custom ) {
nodes . push ( {
presets ,
custom ,
selector : ROOT _BLOCK _SELECTOR
} ) ;
} // Blocks.
Object ( external _lodash _ [ "forEach" ] ) ( ( _tree$settings2 = tree . settings ) === null || _tree$settings2 === void 0 ? void 0 : _tree$settings2 . blocks , ( node , blockName ) => {
const blockPresets = pickPresets ( node ) ;
const blockCustom = node . custom ;
if ( ! Object ( external _lodash _ [ "isEmpty" ] ) ( blockPresets ) || ! ! blockCustom ) {
nodes . push ( {
presets : blockPresets ,
custom : blockCustom ,
selector : blockSelectors [ blockName ] . selector
} ) ;
}
} ) ;
return nodes ;
} ;
const toCustomProperties = ( tree , blockSelectors ) => {
const settings = getNodesWithSettings ( tree , blockSelectors ) ;
let ruleset = '' ;
2021-11-15 13:50:17 +01:00
settings . forEach ( _ref7 => {
let {
presets ,
custom ,
selector
} = _ref7 ;
2021-11-09 03:17:17 +01:00
const declarations = getPresetsDeclarations ( presets ) ;
const customProps = flattenTree ( custom , '--wp--custom--' , '--' ) ;
if ( customProps . length > 0 ) {
declarations . push ( ... customProps ) ;
}
if ( declarations . length > 0 ) {
ruleset = ruleset + ` ${ selector } { ${ declarations . join ( ';' ) } ;} ` ;
}
} ) ;
return ruleset ;
} ;
const toStyles = ( tree , blockSelectors ) => {
const nodesWithStyles = getNodesWithStyles ( tree , blockSelectors ) ;
const nodesWithSettings = getNodesWithSettings ( tree , blockSelectors ) ;
let ruleset = '.wp-site-blocks > * { margin-top: 0; margin-bottom: 0; }.wp-site-blocks > * + * { margin-top: var( --wp--style--block-gap ); }' ;
2021-11-15 13:50:17 +01:00
nodesWithStyles . forEach ( _ref8 => {
let {
selector ,
styles
} = _ref8 ;
2021-11-09 03:17:17 +01:00
const declarations = getStylesDeclarations ( styles ) ;
if ( declarations . length === 0 ) {
return ;
}
ruleset = ruleset + ` ${ selector } { ${ declarations . join ( ';' ) } ;} ` ;
} ) ;
2021-11-15 13:50:17 +01:00
nodesWithSettings . forEach ( _ref9 => {
let {
selector ,
presets
} = _ref9 ;
2021-11-09 03:17:17 +01:00
if ( ROOT _BLOCK _SELECTOR === selector ) {
// Do not add extra specificity for top-level classes.
selector = '' ;
}
const classes = getPresetsClasses ( selector , presets ) ;
if ( ! Object ( external _lodash _ [ "isEmpty" ] ) ( classes ) ) {
ruleset = ruleset + classes ;
}
} ) ;
return ruleset ;
} ;
const getBlockSelectors = blockTypes => {
const result = { } ;
blockTypes . forEach ( blockType => {
var _blockType$supports$ _ , _blockType$supports ;
const name = blockType . name ;
const selector = ( _blockType$supports$ _ = blockType === null || blockType === void 0 ? void 0 : ( _blockType$supports = blockType . supports ) === null || _blockType$supports === void 0 ? void 0 : _blockType$supports . _ _experimentalSelector ) !== null && _blockType$supports$ _ !== void 0 ? _blockType$supports$ _ : '.wp-block-' + name . replace ( 'core/' , '' ) . replace ( '/' , '-' ) ;
result [ name ] = {
name ,
selector
} ;
} ) ;
return result ;
} ;
function useGlobalStylesOutput ( ) {
const [ stylesheets , setStylesheets ] = Object ( external _wp _element _ [ "useState" ] ) ( [ ] ) ;
const [ settings , setSettings ] = Object ( external _wp _element _ [ "useState" ] ) ( { } ) ;
const {
merged : mergedConfig
} = Object ( external _wp _element _ [ "useContext" ] ) ( GlobalStylesContext ) ;
Object ( external _wp _element _ [ "useEffect" ] ) ( ( ) => {
if ( ! ( mergedConfig !== null && mergedConfig !== void 0 && mergedConfig . styles ) || ! ( mergedConfig !== null && mergedConfig !== void 0 && mergedConfig . settings ) ) {
return ;
}
const blockSelectors = getBlockSelectors ( Object ( external _wp _blocks _ [ "getBlockTypes" ] ) ( ) ) ;
const customProperties = toCustomProperties ( mergedConfig , blockSelectors ) ;
const globalStyles = toStyles ( mergedConfig , blockSelectors ) ;
setStylesheets ( [ {
css : customProperties ,
2021-12-14 02:57:26 +01:00
isGlobalStyles : true
2021-11-09 03:17:17 +01:00
} , {
css : globalStyles ,
isGlobalStyles : true
} ] ) ;
setSettings ( mergedConfig . settings ) ;
} , [ mergedConfig ] ) ;
return [ stylesheets , settings ] ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/index.js
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar/global-styles-sidebar.js
/ * *
* WordPress dependencies
* /
2021-12-14 02:57:26 +01:00
2021-11-09 03:17:17 +01:00
/ * *
* Internal dependencies
* /
2021-12-14 02:57:26 +01:00
2021-11-09 03:17:17 +01:00
function GlobalStylesSidebar ( ) {
const [ canReset , onReset ] = useGlobalStylesReset ( ) ;
2021-12-14 02:57:26 +01:00
const {
toggleFeature
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store ) ;
2021-11-09 03:17:17 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( DefaultSidebar , {
className : "edit-site-global-styles-sidebar" ,
identifier : "edit-site/global-styles" ,
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Styles' ) ,
icon : library _styles ,
closeLabel : Object ( external _wp _i18n _ [ "__" ] ) ( 'Close global styles sidebar' ) ,
header : Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Flex" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "FlexBlock" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( "strong" , null , Object ( external _wp _i18n _ [ "__" ] ) ( 'Styles' ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "span" , {
className : "edit-site-global-styles-sidebar__beta"
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Beta' ) ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "FlexItem" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "DropdownMenu" ] , {
icon : more _vertical [ "a" /* default */ ] ,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'More Global Styles Actions' ) ,
toggleProps : {
disabled : ! canReset
} ,
controls : [ {
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Reset to defaults' ) ,
onClick : onReset
2021-12-14 02:57:26 +01:00
} , {
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Welcome Guide' ) ,
onClick : ( ) => toggleFeature ( 'welcomeGuideStyles' )
2021-11-09 03:17:17 +01:00
} ]
} ) ) )
} , Object ( external _wp _element _ [ "createElement" ] ) ( ui , null ) ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar/constants.js
const SIDEBAR _TEMPLATE = 'edit-site/template' ;
const SIDEBAR _BLOCK = 'edit-site/block-inspector' ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar/settings-header/index.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2021-11-15 13:50:17 +01:00
const SettingsHeader = _ref => {
let {
sidebarName
} = _ref ;
2021-11-09 03:17:17 +01:00
const {
enableComplementaryArea
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( build _module [ "i" /* store */ ] ) ;
const openTemplateSettings = ( ) => enableComplementaryArea ( STORE _NAME , SIDEBAR _TEMPLATE ) ;
const openBlockSettings = ( ) => enableComplementaryArea ( STORE _NAME , SIDEBAR _BLOCK ) ;
const [ templateAriaLabel , templateActiveClass ] = sidebarName === SIDEBAR _TEMPLATE ? // translators: ARIA label for the Template sidebar tab, selected.
[ Object ( external _wp _i18n _ [ "__" ] ) ( 'Template (selected)' ) , 'is-active' ] : // translators: ARIA label for the Template Settings Sidebar tab, not selected.
[ Object ( external _wp _i18n _ [ "__" ] ) ( 'Template' ) , '' ] ;
const [ blockAriaLabel , blockActiveClass ] = sidebarName === SIDEBAR _BLOCK ? // translators: ARIA label for the Block Settings Sidebar tab, selected.
[ Object ( external _wp _i18n _ [ "__" ] ) ( 'Block (selected)' ) , 'is-active' ] : // translators: ARIA label for the Block Settings Sidebar tab, not selected.
[ Object ( external _wp _i18n _ [ "__" ] ) ( 'Block' ) , '' ] ;
/* Use a list so screen readers will announce how many tabs there are. */
return Object ( external _wp _element _ [ "createElement" ] ) ( "ul" , null , Object ( external _wp _element _ [ "createElement" ] ) ( "li" , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
onClick : openTemplateSettings ,
className : ` edit-site-sidebar__panel-tab ${ templateActiveClass } ` ,
"aria-label" : templateAriaLabel // translators: Data label for the Template Settings Sidebar tab.
,
"data-label" : Object ( external _wp _i18n _ [ "__" ] ) ( 'Template' )
} , // translators: Text label for the Template Settings Sidebar tab.
Object ( external _wp _i18n _ [ "__" ] ) ( 'Template' ) ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "li" , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
onClick : openBlockSettings ,
className : ` edit-site-sidebar__panel-tab ${ blockActiveClass } ` ,
"aria-label" : blockAriaLabel // translators: Data label for the Block Settings Sidebar tab.
,
"data-label" : Object ( external _wp _i18n _ [ "__" ] ) ( 'Block' )
} , // translators: Text label for the Block Settings Sidebar tab.
Object ( external _wp _i18n _ [ "__" ] ) ( 'Block' ) ) ) ) ;
} ;
/* harmony default export */ var settings _header = ( SettingsHeader ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar/template-card/template-areas.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2021-11-15 13:50:17 +01:00
function TemplateAreaItem ( _ref ) {
let {
area ,
clientId
} = _ref ;
2021-11-09 03:17:17 +01:00
const {
selectBlock ,
toggleBlockHighlight
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( external _wp _blockEditor _ [ "store" ] ) ;
2021-12-14 02:57:26 +01:00
const templatePartArea = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
const defaultAreas = select ( external _wp _editor _ [ "store" ] ) . _ _experimentalGetDefaultTemplatePartAreas ( ) ;
return defaultAreas . find ( defaultArea => defaultArea . area === area ) ;
} , [ area ] ) ;
2021-11-09 03:17:17 +01:00
const highlightBlock = ( ) => toggleBlockHighlight ( clientId , true ) ;
const cancelHighlightBlock = ( ) => toggleBlockHighlight ( clientId , false ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
className : "edit-site-template-card__template-areas-item" ,
2021-12-14 02:57:26 +01:00
icon : templatePartArea === null || templatePartArea === void 0 ? void 0 : templatePartArea . icon ,
2021-11-09 03:17:17 +01:00
onMouseOver : highlightBlock ,
onMouseLeave : cancelHighlightBlock ,
onFocus : highlightBlock ,
onBlur : cancelHighlightBlock ,
onClick : ( ) => {
selectBlock ( clientId ) ;
}
2021-12-14 02:57:26 +01:00
} , templatePartArea === null || templatePartArea === void 0 ? void 0 : templatePartArea . label ) ;
2021-11-09 03:17:17 +01:00
}
function template _areas _TemplateAreas ( ) {
const templateParts = Object ( external _wp _data _ [ "useSelect" ] ) ( select => select ( store ) . getCurrentTemplateTemplateParts ( ) , [ ] ) ;
if ( ! templateParts . length ) {
return null ;
}
return Object ( external _wp _element _ [ "createElement" ] ) ( "section" , {
className : "edit-site-template-card__template-areas"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalHeading" ] , {
level : 3 ,
className : "edit-site-template-card__template-areas-title"
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Areas' ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "ul" , {
className : "edit-site-template-card__template-areas-list"
2021-11-15 13:50:17 +01:00
} , templateParts . map ( _ref2 => {
let {
templatePart ,
block
} = _ref2 ;
return Object ( external _wp _element _ [ "createElement" ] ) ( "li" , {
key : templatePart . slug
} , Object ( external _wp _element _ [ "createElement" ] ) ( TemplateAreaItem , {
area : templatePart . area ,
clientId : block . clientId
} ) ) ;
} ) ) ) ;
2021-11-09 03:17:17 +01:00
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar/template-card/index.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
function TemplateCard ( ) {
const {
title ,
description ,
icon
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
const {
getEditedPostType ,
getEditedPostId
} = select ( store ) ;
const {
getEntityRecord
} = select ( external _wp _coreData _ [ "store" ] ) ;
const {
_ _experimentalGetTemplateInfo : getTemplateInfo
} = select ( external _wp _editor _ [ "store" ] ) ;
const postType = getEditedPostType ( ) ;
const postId = getEditedPostId ( ) ;
const record = getEntityRecord ( 'postType' , postType , postId ) ;
const info = record ? getTemplateInfo ( record ) : { } ;
return info ;
} , [ ] ) ;
if ( ! title && ! description ) {
return null ;
}
return Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-site-template-card"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Icon" ] , {
className : "edit-site-template-card__icon" ,
icon : icon
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-site-template-card__content"
} , Object ( external _wp _element _ [ "createElement" ] ) ( "h2" , {
className : "edit-site-template-card__title"
} , title ) , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-site-template-card__description"
} , description ) , Object ( external _wp _element _ [ "createElement" ] ) ( template _areas _TemplateAreas , null ) ) ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar/index.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
const {
Slot : InspectorSlot ,
Fill : InspectorFill
} = Object ( external _wp _components _ [ "createSlotFill" ] ) ( 'EditSiteSidebarInspector' ) ;
const SidebarInspectorFill = InspectorFill ;
function SidebarComplementaryAreaFills ( ) {
const {
sidebar ,
isEditorSidebarOpened ,
hasBlockSelection
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
const _sidebar = select ( build _module [ "i" /* store */ ] ) . getActiveComplementaryArea ( STORE _NAME ) ;
const _isEditorSidebarOpened = [ SIDEBAR _BLOCK , SIDEBAR _TEMPLATE ] . includes ( _sidebar ) ;
return {
sidebar : _sidebar ,
isEditorSidebarOpened : _isEditorSidebarOpened ,
hasBlockSelection : ! ! select ( external _wp _blockEditor _ [ "store" ] ) . getBlockSelectionStart ( )
} ;
} , [ ] ) ;
const {
enableComplementaryArea
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( build _module [ "i" /* store */ ] ) ;
Object ( external _wp _element _ [ "useEffect" ] ) ( ( ) => {
if ( ! isEditorSidebarOpened ) return ;
if ( hasBlockSelection ) {
enableComplementaryArea ( STORE _NAME , SIDEBAR _BLOCK ) ;
} else {
enableComplementaryArea ( STORE _NAME , SIDEBAR _TEMPLATE ) ;
}
} , [ hasBlockSelection , isEditorSidebarOpened ] ) ;
let sidebarName = sidebar ;
if ( ! isEditorSidebarOpened ) {
sidebarName = hasBlockSelection ? SIDEBAR _BLOCK : SIDEBAR _TEMPLATE ;
}
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( DefaultSidebar , {
identifier : sidebarName ,
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Settings' ) ,
icon : cog [ "a" /* default */ ] ,
closeLabel : Object ( external _wp _i18n _ [ "__" ] ) ( 'Close settings sidebar' ) ,
header : Object ( external _wp _element _ [ "createElement" ] ) ( settings _header , {
sidebarName : sidebarName
} ) ,
headerClassName : "edit-site-sidebar__panel-tabs"
} , sidebarName === SIDEBAR _TEMPLATE && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "PanelBody" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( TemplateCard , null ) ) , sidebarName === SIDEBAR _BLOCK && Object ( external _wp _element _ [ "createElement" ] ) ( InspectorSlot , {
bubblesVirtually : true
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( GlobalStylesSidebar , null ) ) ;
}
2021-11-23 06:40:38 +01:00
// EXTERNAL MODULE: external ["wp","htmlEntities"]
var external _wp _htmlEntities _ = _ _webpack _require _ _ ( "rmEH" ) ;
2021-11-30 01:24:27 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/home.js
/ * *
* WordPress dependencies
* /
const home = Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _primitives _ [ "SVG" ] , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _primitives _ [ "Path" ] , {
d : "M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"
} ) ) ;
/* harmony default export */ var library _home = ( home ) ;
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/symbol-filled.js
var symbol _filled = _ _webpack _require _ _ ( "OE6V" ) ;
2021-11-23 06:40:38 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/main-dashboard-button/index.js
2021-11-09 03:17:17 +01:00
/ * *
* WordPress dependencies
* /
2021-11-23 06:40:38 +01:00
const slotName = '__experimentalMainDashboardButton' ;
const {
Fill ,
Slot : MainDashboardButtonSlot
} = Object ( external _wp _components _ [ "createSlotFill" ] ) ( slotName ) ;
const MainDashboardButton = Fill ;
const main _dashboard _button _Slot = _ref => {
let {
children
} = _ref ;
const slot = Object ( external _wp _components _ [ "__experimentalUseSlot" ] ) ( slotName ) ;
const hasFills = Boolean ( slot . fills && slot . fills . length ) ;
if ( ! hasFills ) {
return children ;
}
return Object ( external _wp _element _ [ "createElement" ] ) ( MainDashboardButtonSlot , {
bubblesVirtually : true
} ) ;
} ;
MainDashboardButton . Slot = main _dashboard _button _Slot ;
/* harmony default export */ var main _dashboard _button = ( MainDashboardButton ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/navigation-sidebar/navigation-panel/index.js
2021-12-14 02:57:26 +01:00
2021-11-23 06:40:38 +01:00
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2021-12-14 02:57:26 +01:00
2021-11-30 01:24:27 +01:00
const SITE _EDITOR _KEY = 'site-editor' ;
2021-12-14 02:57:26 +01:00
function NavLink ( _ref ) {
2021-11-23 06:40:38 +01:00
let {
2021-12-14 02:57:26 +01:00
params ,
replace ,
... props
2021-11-23 06:40:38 +01:00
} = _ref ;
2021-12-14 02:57:26 +01:00
const linkProps = useLink ( params , replace ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalNavigationItem" ] , Object ( esm _extends [ "a" /* default */ ] ) ( { } , linkProps , props ) ) ;
}
const NavigationPanel = _ref2 => {
let {
activeItem = SITE _EDITOR _KEY
} = _ref2 ;
2021-11-30 01:24:27 +01:00
const {
isNavigationOpen ,
siteTitle
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
2021-11-23 06:40:38 +01:00
const {
getEntityRecord
} = select ( external _wp _coreData _ [ "store" ] ) ;
const siteData = getEntityRecord ( 'root' , '__unstableBase' , undefined ) || { } ;
2021-11-30 01:24:27 +01:00
return {
siteTitle : siteData . name ,
isNavigationOpen : select ( store ) . isNavigationOpened ( )
} ;
} , [ ] ) ;
const {
setIsNavigationPanelOpened
2021-12-14 02:57:26 +01:00
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store ) ;
2021-11-23 06:40:38 +01:00
const closeOnEscape = event => {
if ( event . keyCode === external _wp _keycodes _ [ "ESCAPE" ] && ! event . defaultPrevented ) {
event . preventDefault ( ) ;
2021-11-30 01:24:27 +01:00
setIsNavigationPanelOpened ( false ) ;
2021-11-23 06:40:38 +01:00
}
} ;
return ( // eslint-disable-next-line jsx-a11y/no-static-element-interactions
Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : classnames _default ( ) ( ` edit-site-navigation-panel ` , {
2021-11-30 01:24:27 +01:00
'is-open' : isNavigationOpen
2021-11-23 06:40:38 +01:00
} ) ,
onKeyDown : closeOnEscape
} , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-site-navigation-panel__inner"
} , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-site-navigation-panel__site-title-container"
} , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-site-navigation-panel__site-title"
} , Object ( external _wp _htmlEntities _ [ "decodeEntities" ] ) ( siteTitle ) ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-site-navigation-panel__scroll-container"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalNavigation" ] , {
2021-11-30 01:24:27 +01:00
activeItem : activeItem
2021-11-23 06:40:38 +01:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( main _dashboard _button . Slot , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalNavigationBackButton" ] , {
backButtonLabel : Object ( external _wp _i18n _ [ "__" ] ) ( 'Dashboard' ) ,
className : "edit-site-navigation-panel__back-to-dashboard" ,
href : "index.php"
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalNavigationMenu" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalNavigationGroup" ] , {
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Editor' )
2021-12-14 02:57:26 +01:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( NavLink , {
2021-11-30 01:24:27 +01:00
icon : library _home ,
2021-11-23 06:40:38 +01:00
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Site' ) ,
2021-11-30 01:24:27 +01:00
item : SITE _EDITOR _KEY ,
2021-12-14 02:57:26 +01:00
params : {
2021-11-23 06:40:38 +01:00
postId : undefined ,
postType : undefined
2021-12-14 02:57:26 +01:00
}
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( NavLink , {
2021-11-30 01:24:27 +01:00
icon : layout [ "a" /* default */ ] ,
2021-11-23 06:40:38 +01:00
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Templates' ) ,
item : "wp_template" ,
2021-12-14 02:57:26 +01:00
params : {
2021-11-23 06:40:38 +01:00
postId : undefined ,
postType : 'wp_template'
2021-12-14 02:57:26 +01:00
}
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( NavLink , {
2021-11-30 01:24:27 +01:00
icon : symbol _filled [ "a" /* default */ ] ,
2021-11-23 06:40:38 +01:00
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Template Parts' ) ,
item : "wp_template_part" ,
2021-12-14 02:57:26 +01:00
params : {
2021-11-23 06:40:38 +01:00
postId : undefined ,
postType : 'wp_template_part'
2021-12-14 02:57:26 +01:00
}
2021-11-23 06:40:38 +01:00
} ) ) ) ) ) ) )
) ;
} ;
/* harmony default export */ var navigation _panel = ( NavigationPanel ) ;
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/wordpress.js
var wordpress = _ _webpack _require _ _ ( "wduq" ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/navigation-sidebar/navigation-toggle/index.js
/ * *
* WordPress dependencies
* /
2021-12-21 08:02:34 +01:00
2021-11-30 01:24:27 +01:00
/ * *
* Internal dependencies
* /
2021-11-23 06:40:38 +01:00
function NavigationToggle ( _ref ) {
let {
2021-11-30 01:24:27 +01:00
icon
2021-11-23 06:40:38 +01:00
} = _ref ;
const {
2021-11-30 01:24:27 +01:00
isNavigationOpen ,
2021-11-23 06:40:38 +01:00
isRequestingSiteIcon ,
siteIconUrl
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
const {
getEntityRecord ,
isResolving
} = select ( external _wp _coreData _ [ "store" ] ) ;
const siteData = getEntityRecord ( 'root' , '__unstableBase' , undefined ) || { } ;
return {
2021-11-30 01:24:27 +01:00
isNavigationOpen : select ( store ) . isNavigationOpened ( ) ,
2021-11-23 06:40:38 +01:00
isRequestingSiteIcon : isResolving ( 'core' , 'getEntityRecord' , [ 'root' , '__unstableBase' , undefined ] ) ,
siteIconUrl : siteData . site _icon _url
} ;
} , [ ] ) ;
2021-11-30 01:24:27 +01:00
const {
setIsNavigationPanelOpened
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store ) ;
2021-11-23 06:40:38 +01:00
const disableMotion = Object ( external _wp _compose _ [ "useReducedMotion" ] ) ( ) ;
2021-12-21 08:02:34 +01:00
const navigationToggleRef = Object ( external _wp _element _ [ "useRef" ] ) ( ) ;
Object ( external _wp _element _ [ "useEffect" ] ) ( ( ) => {
// TODO: Remove this effect when alternative solution is merged.
// See: https://github.com/WordPress/gutenberg/pull/37314
if ( ! isNavigationOpen ) {
navigationToggleRef . current . focus ( ) ;
}
} , [ isNavigationOpen ] ) ;
2021-11-23 06:40:38 +01:00
2021-11-30 01:24:27 +01:00
const toggleNavigationPanel = ( ) => setIsNavigationPanelOpened ( ! isNavigationOpen ) ;
2021-11-23 06:40:38 +01:00
let buttonIcon = Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Icon" ] , {
size : "36px" ,
icon : wordpress [ "a" /* default */ ]
} ) ;
const effect = {
expand : {
scale : 1.7 ,
borderRadius : 0 ,
transition : {
type : 'tween' ,
duration : '0.2'
}
}
} ;
if ( siteIconUrl ) {
buttonIcon = Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__unstableMotion" ] . img , {
variants : ! disableMotion && effect ,
alt : Object ( external _wp _i18n _ [ "__" ] ) ( 'Site Icon' ) ,
className : "edit-site-navigation-toggle__site-icon" ,
src : siteIconUrl
} ) ;
} else if ( isRequestingSiteIcon ) {
buttonIcon = null ;
} else if ( icon ) {
buttonIcon = Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Icon" ] , {
size : "36px" ,
icon : icon
} ) ;
}
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__unstableMotion" ] . div , {
2021-11-30 01:24:27 +01:00
className : 'edit-site-navigation-toggle' + ( isNavigationOpen ? ' is-open' : '' ) ,
2021-11-23 06:40:38 +01:00
whileHover : "expand"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
className : "edit-site-navigation-toggle__button has-icon" ,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Toggle navigation' ) ,
2021-12-21 08:02:34 +01:00
ref : navigationToggleRef // isPressed will add unwanted styles.
,
"aria-pressed" : isNavigationOpen ,
2021-11-23 06:40:38 +01:00
onClick : toggleNavigationPanel ,
showTooltip : true
} , buttonIcon ) ) ;
}
/* harmony default export */ var navigation _toggle = ( NavigationToggle ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/navigation-sidebar/index.js
/ * *
* WordPress dependencies
* /
2021-11-30 01:24:27 +01:00
2021-11-23 06:40:38 +01:00
/ * *
* Internal dependencies
* /
2021-11-30 01:24:27 +01:00
2021-11-23 06:40:38 +01:00
const {
Fill : NavigationPanelPreviewFill ,
Slot : NavigationPanelPreviewSlot
} = Object ( external _wp _components _ [ "createSlotFill" ] ) ( 'EditSiteNavigationPanelPreview' ) ;
2021-12-14 02:57:26 +01:00
const {
Fill : NavigationSidebarFill ,
Slot : NavigationSidebarSlot
} = Object ( external _wp _components _ [ "createSlotFill" ] ) ( 'EditSiteNavigationSidebar' ) ;
2021-11-23 06:40:38 +01:00
function NavigationSidebar ( _ref ) {
let {
isDefaultOpen = false ,
activeTemplateType
} = _ref ;
const isDesktopViewport = Object ( external _wp _compose _ [ "useViewportMatch" ] ) ( 'medium' ) ;
2021-11-30 01:24:27 +01:00
const {
setIsNavigationPanelOpened
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store ) ;
2021-12-14 02:57:26 +01:00
Object ( external _wp _element _ [ "useEffect" ] ) ( function autoOpenNavigationPanelOnViewportChange ( ) {
setIsNavigationPanelOpened ( isDefaultOpen && isDesktopViewport ) ;
2021-11-30 01:24:27 +01:00
} , [ isDefaultOpen , isDesktopViewport , setIsNavigationPanelOpened ] ) ;
2021-12-14 02:57:26 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( NavigationSidebarFill , null , Object ( external _wp _element _ [ "createElement" ] ) ( navigation _toggle , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( navigation _panel , {
2021-11-30 01:24:27 +01:00
activeItem : activeTemplateType
2021-11-23 06:40:38 +01:00
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( NavigationPanelPreviewSlot , null ) ) ;
}
2021-12-14 02:57:26 +01:00
NavigationSidebar . Slot = NavigationSidebarSlot ;
/* harmony default export */ var navigation _sidebar = ( NavigationSidebar ) ;
2021-11-30 01:24:27 +01:00
// EXTERNAL MODULE: external ["wp","reusableBlocks"]
var external _wp _reusableBlocks _ = _ _webpack _require _ _ ( "diJD" ) ;
2021-11-23 06:40:38 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/template-part-converter/convert-to-regular.js
/ * *
* WordPress dependencies
* /
2021-11-09 03:17:17 +01:00
2021-11-15 13:50:17 +01:00
function ConvertToRegularBlocks ( _ref ) {
let {
clientId
} = _ref ;
2021-11-09 03:17:17 +01:00
const {
getBlocks
} = Object ( external _wp _data _ [ "useSelect" ] ) ( external _wp _blockEditor _ [ "store" ] ) ;
const {
replaceBlocks
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( external _wp _blockEditor _ [ "store" ] ) ;
2021-11-15 13:50:17 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "BlockSettingsMenuControls" ] , null , _ref2 => {
let {
onClose
} = _ref2 ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuItem" ] , {
onClick : ( ) => {
replaceBlocks ( clientId , getBlocks ( clientId ) ) ;
onClose ( ) ;
}
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Detach blocks from template part' ) ) ;
} ) ;
2021-11-09 03:17:17 +01:00
}
2021-11-23 06:40:38 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/create-template-part-modal/index.js
2021-11-09 03:17:17 +01:00
/ * *
2021-11-23 06:40:38 +01:00
* WordPress dependencies
2021-11-09 03:17:17 +01:00
* /
2021-11-23 06:40:38 +01:00
2021-11-09 03:17:17 +01:00
/ * *
2021-11-23 06:40:38 +01:00
* Internal dependencies
2021-11-09 03:17:17 +01:00
* /
2021-11-23 06:40:38 +01:00
function CreateTemplatePartModal ( _ref ) {
let {
closeModal ,
onCreate
} = _ref ;
const [ title , setTitle ] = Object ( external _wp _element _ [ "useState" ] ) ( '' ) ;
const [ area , setArea ] = Object ( external _wp _element _ [ "useState" ] ) ( TEMPLATE _PART _AREA _GENERAL ) ;
const [ isSubmitting , setIsSubmitting ] = Object ( external _wp _element _ [ "useState" ] ) ( false ) ;
const instanceId = Object ( external _wp _compose _ [ "useInstanceId" ] ) ( CreateTemplatePartModal ) ;
const templatePartAreas = Object ( external _wp _data _ [ "useSelect" ] ) ( select => select ( external _wp _editor _ [ "store" ] ) . _ _experimentalGetDefaultTemplatePartAreas ( ) , [ ] ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Modal" ] , {
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Create a template part' ) ,
closeLabel : Object ( external _wp _i18n _ [ "__" ] ) ( 'Close' ) ,
onRequestClose : closeModal ,
overlayClassName : "edit-site-create-template-part-modal"
} , Object ( external _wp _element _ [ "createElement" ] ) ( "form" , {
onSubmit : async event => {
event . preventDefault ( ) ;
if ( ! title ) {
return ;
}
setIsSubmitting ( true ) ;
await onCreate ( {
title ,
area
} ) ;
}
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "TextControl" ] , {
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Name' ) ,
value : title ,
onChange : setTitle ,
required : true
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "BaseControl" ] , {
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Area' ) ,
id : ` edit-site-create-template-part-modal__area-selection- ${ instanceId } ` ,
className : "edit-site-create-template-part-modal__area-base-control"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalRadioGroup" ] , {
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Area' ) ,
className : "edit-site-create-template-part-modal__area-radio-group" ,
id : ` edit-site-create-template-part-modal__area-selection- ${ instanceId } ` ,
onChange : setArea ,
checked : area
} , templatePartAreas . map ( _ref2 => {
let {
icon ,
label ,
area : value ,
description
} = _ref2 ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalRadio" ] , {
key : label ,
value : value ,
className : "edit-site-create-template-part-modal__area-radio"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Flex" ] , {
align : "start" ,
justify : "start"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "FlexItem" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Icon" ] , {
icon : icon
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "FlexBlock" ] , {
className : "edit-site-create-template-part-modal__option-label"
} , label , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , null , description ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "FlexItem" ] , {
className : "edit-site-create-template-part-modal__checkbox"
} , area === value && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Icon" ] , {
icon : check [ "a" /* default */ ]
} ) ) ) ) ;
} ) ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Flex" ] , {
className : "edit-site-create-template-part-modal__modal-actions" ,
justify : "flex-end"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "FlexItem" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
variant : "secondary" ,
onClick : ( ) => {
closeModal ( ) ;
}
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Cancel' ) ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "FlexItem" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
variant : "primary" ,
type : "submit" ,
disabled : ! title ,
isBusy : isSubmitting
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Create' ) ) ) ) ) ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/template-part-converter/convert-to-template-part.js
/ * *
* External dependencies
* /
2021-11-09 03:17:17 +01:00
2021-11-23 06:40:38 +01:00
/ * *
* WordPress dependencies
* /
2021-11-09 03:17:17 +01:00
/ * *
* Internal dependencies
* /
2021-11-15 13:50:17 +01:00
function ConvertToTemplatePart ( _ref ) {
let {
clientIds ,
blocks
} = _ref ;
2021-11-09 03:17:17 +01:00
const [ isModalOpen , setIsModalOpen ] = Object ( external _wp _element _ [ "useState" ] ) ( false ) ;
const {
replaceBlocks
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( external _wp _blockEditor _ [ "store" ] ) ;
const {
saveEntityRecord
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( external _wp _coreData _ [ "store" ] ) ;
const {
createSuccessNotice
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( external _wp _notices _ [ "store" ] ) ;
2021-11-23 06:40:38 +01:00
const onConvert = async _ref2 => {
let {
title ,
area
} = _ref2 ;
2022-02-17 20:18:25 +01:00
// Currently template parts only allow latin chars.
// Fallback slug will receive suffix by default.
const cleanSlug = Object ( external _lodash _ [ "kebabCase" ] ) ( title ) . replace ( /[^\w-]+/g , '' ) || 'wp-custom-part' ;
2021-11-09 03:17:17 +01:00
const templatePart = await saveEntityRecord ( 'postType' , 'wp_template_part' , {
2022-02-17 20:18:25 +01:00
slug : cleanSlug ,
2021-11-23 06:40:38 +01:00
title ,
2021-11-09 03:17:17 +01:00
content : Object ( external _wp _blocks _ [ "serialize" ] ) ( blocks ) ,
area
} ) ;
replaceBlocks ( clientIds , Object ( external _wp _blocks _ [ "createBlock" ] ) ( 'core/template-part' , {
slug : templatePart . slug ,
theme : templatePart . theme
} ) ) ;
createSuccessNotice ( Object ( external _wp _i18n _ [ "__" ] ) ( 'Template part created.' ) , {
type : 'snackbar'
2021-12-14 02:57:26 +01:00
} ) ; // The modal and this component will be unmounted because of `replaceBlocks` above,
// so no need to call `closeModal` or `onClose`.
2021-11-09 03:17:17 +01:00
} ;
2021-12-14 02:57:26 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "BlockSettingsMenuControls" ] , null , ( ) => Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuItem" ] , {
onClick : ( ) => {
setIsModalOpen ( true ) ;
}
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Make template part' ) ) ) , isModalOpen && Object ( external _wp _element _ [ "createElement" ] ) ( CreateTemplatePartModal , {
2021-11-23 06:40:38 +01:00
closeModal : ( ) => {
setIsModalOpen ( false ) ;
} ,
onCreate : onConvert
} ) ) ;
2021-11-09 03:17:17 +01:00
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/template-part-converter/index.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
function TemplatePartConverter ( ) {
var _blocks$ ;
const {
clientIds ,
blocks
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
const {
getSelectedBlockClientIds ,
getBlocksByClientId
} = select ( external _wp _blockEditor _ [ "store" ] ) ;
const selectedBlockClientIds = getSelectedBlockClientIds ( ) ;
return {
clientIds : selectedBlockClientIds ,
blocks : getBlocksByClientId ( selectedBlockClientIds )
} ;
} , [ ] ) ; // Allow converting a single template part to standard blocks.
if ( blocks . length === 1 && ( ( _blocks$ = blocks [ 0 ] ) === null || _blocks$ === void 0 ? void 0 : _blocks$ . name ) === 'core/template-part' ) {
return Object ( external _wp _element _ [ "createElement" ] ) ( ConvertToRegularBlocks , {
clientId : clientIds [ 0 ]
} ) ;
}
return Object ( external _wp _element _ [ "createElement" ] ) ( ConvertToTemplatePart , {
clientIds : clientIds ,
blocks : blocks
} ) ;
}
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/edit.js + 1 modules
var edit = _ _webpack _require _ _ ( "B9Az" ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/navigate-to-link/index.js
/ * *
* WordPress dependencies
* /
2021-11-15 13:50:17 +01:00
function NavigateToLink ( _ref ) {
let {
type ,
id ,
activePage ,
onActivePageChange
} = _ref ;
2021-11-09 03:17:17 +01:00
const post = Object ( external _wp _data _ [ "useSelect" ] ) ( select => type && id && type !== 'URL' && select ( external _wp _coreData _ [ "store" ] ) . getEntityRecord ( 'postType' , type , id ) , [ type , id ] ) ;
const onClick = Object ( external _wp _element _ [ "useMemo" ] ) ( ( ) => {
if ( ! ( post !== null && post !== void 0 && post . link ) ) return null ;
const path = Object ( external _wp _url _ [ "getPathAndQueryString" ] ) ( post . link ) ;
if ( path === ( activePage === null || activePage === void 0 ? void 0 : activePage . path ) ) return null ;
return ( ) => onActivePageChange ( {
type ,
slug : post . slug ,
path ,
context : {
postType : post . type ,
postId : post . id
}
} ) ;
} , [ post , activePage === null || activePage === void 0 ? void 0 : activePage . path , onActivePageChange ] ) ;
return onClick && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
icon : edit [ "a" /* default */ ] ,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Edit Page Template' ) ,
onClick : onClick
} ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/block-editor/block-inspector-button.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2021-11-15 13:50:17 +01:00
function BlockInspectorButton ( _ref ) {
let {
onClick = ( ) => { }
} = _ref ;
2021-11-09 03:17:17 +01:00
const {
shortcut ,
isBlockInspectorOpen
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => ( {
shortcut : select ( external _wp _keyboardShortcuts _ [ "store" ] ) . getShortcutRepresentation ( 'core/edit-site/toggle-block-settings-sidebar' ) ,
isBlockInspectorOpen : select ( build _module [ "i" /* store */ ] ) . getActiveComplementaryArea ( store . name ) === SIDEBAR _BLOCK
} ) , [ ] ) ;
const {
enableComplementaryArea ,
disableComplementaryArea
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( build _module [ "i" /* store */ ] ) ;
const label = isBlockInspectorOpen ? Object ( external _wp _i18n _ [ "__" ] ) ( 'Hide more settings' ) : Object ( external _wp _i18n _ [ "__" ] ) ( 'Show more settings' ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuItem" ] , {
onClick : ( ) => {
if ( isBlockInspectorOpen ) {
disableComplementaryArea ( STORE _NAME ) ;
Object ( external _wp _a11y _ [ "speak" ] ) ( Object ( external _wp _i18n _ [ "__" ] ) ( 'Block settings closed' ) ) ;
} else {
enableComplementaryArea ( STORE _NAME , SIDEBAR _BLOCK ) ;
Object ( external _wp _a11y _ [ "speak" ] ) ( Object ( external _wp _i18n _ [ "__" ] ) ( 'Additional settings are now available in the Editor block settings sidebar' ) ) ;
} // Close dropdown menu.
onClick ( ) ;
} ,
shortcut : shortcut
} , label ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/edit-template-part-menu-button/index.js
2021-12-14 02:57:26 +01:00
2021-11-09 03:17:17 +01:00
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2021-12-14 02:57:26 +01:00
2021-11-09 03:17:17 +01:00
function EditTemplatePartMenuButton ( ) {
2021-11-15 13:50:17 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "BlockSettingsMenuControls" ] , null , _ref => {
let {
selectedClientIds ,
onClose
} = _ref ;
return Object ( external _wp _element _ [ "createElement" ] ) ( EditTemplatePartMenuItem , {
selectedClientId : selectedClientIds [ 0 ] ,
onClose : onClose
} ) ;
} ) ;
2021-11-09 03:17:17 +01:00
}
2021-11-15 13:50:17 +01:00
function EditTemplatePartMenuItem ( _ref2 ) {
let {
selectedClientId ,
onClose
} = _ref2 ;
2021-12-14 02:57:26 +01:00
const {
params
} = useLocation ( ) ;
2021-11-09 03:17:17 +01:00
const selectedTemplatePart = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
const block = select ( external _wp _blockEditor _ [ "store" ] ) . getBlock ( selectedClientId ) ;
if ( block && Object ( external _wp _blocks _ [ "isTemplatePart" ] ) ( block ) ) {
const {
theme ,
slug
} = block . attributes ;
return select ( external _wp _coreData _ [ "store" ] ) . getEntityRecord ( 'postType' , 'wp_template_part' , // Ideally this should be an official public API.
` ${ theme } // ${ slug } ` ) ;
}
} , [ selectedClientId ] ) ;
2021-12-14 02:57:26 +01:00
const linkProps = useLink ( {
postId : selectedTemplatePart === null || selectedTemplatePart === void 0 ? void 0 : selectedTemplatePart . id ,
postType : selectedTemplatePart === null || selectedTemplatePart === void 0 ? void 0 : selectedTemplatePart . type
} , {
fromTemplateId : params . postId
} ) ;
2021-11-09 03:17:17 +01:00
if ( ! selectedTemplatePart ) {
return null ;
}
2021-12-14 02:57:26 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuItem" ] , Object ( esm _extends [ "a" /* default */ ] ) ( { } , linkProps , {
onClick : event => {
linkProps . onClick ( event ) ;
2021-11-09 03:17:17 +01:00
onClose ( ) ;
}
2021-12-14 02:57:26 +01:00
} ) ,
2021-11-09 03:17:17 +01:00
/* translators: %s: template part title */
Object ( external _wp _i18n _ [ "sprintf" ] ) ( Object ( external _wp _i18n _ [ "__" ] ) ( 'Edit %s' ) , selectedTemplatePart . slug ) ) ;
}
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/arrow-left.js
var arrow _left = _ _webpack _require _ _ ( "cjQ8" ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/block-editor/back-button.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
function BackButton ( ) {
2021-12-14 02:57:26 +01:00
var _location$state ;
const location = useLocation ( ) ;
const history = useHistory ( ) ;
const isTemplatePart = location . params . postType === 'wp_template_part' ;
const previousTemplateId = ( _location$state = location . state ) === null || _location$state === void 0 ? void 0 : _location$state . fromTemplateId ;
2021-11-09 03:17:17 +01:00
if ( ! isTemplatePart || ! previousTemplateId ) {
return null ;
}
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
className : "edit-site-visual-editor__back-button" ,
icon : arrow _left [ "a" /* default */ ] ,
onClick : ( ) => {
2021-12-14 02:57:26 +01:00
history . back ( ) ;
2021-11-09 03:17:17 +01:00
}
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Back' ) ) ;
}
/* harmony default export */ var back _button = ( BackButton ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/block-editor/resize-handle.js
/ * *
* WordPress dependencies
* /
const DELTA _DISTANCE = 20 ; // The distance to resize per keydown in pixels.
2021-11-15 13:50:17 +01:00
function ResizeHandle ( _ref ) {
let {
direction ,
resizeWidthBy
} = _ref ;
2021-11-09 03:17:17 +01:00
function handleKeyDown ( event ) {
const {
keyCode
} = event ;
if ( direction === 'left' && keyCode === external _wp _keycodes _ [ "LEFT" ] || direction === 'right' && keyCode === external _wp _keycodes _ [ "RIGHT" ] ) {
resizeWidthBy ( DELTA _DISTANCE ) ;
} else if ( direction === 'left' && keyCode === external _wp _keycodes _ [ "RIGHT" ] || direction === 'right' && keyCode === external _wp _keycodes _ [ "LEFT" ] ) {
resizeWidthBy ( - DELTA _DISTANCE ) ;
}
}
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( "button" , {
className : ` resizable-editor__drag-handle is- ${ direction } ` ,
"aria-label" : Object ( external _wp _i18n _ [ "__" ] ) ( 'Drag to resize' ) ,
"aria-describedby" : ` resizable-editor__resize-help- ${ direction } ` ,
onKeyDown : handleKeyDown
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "VisuallyHidden" ] , {
id : ` resizable-editor__resize-help- ${ direction } `
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Use left and right arrow keys to resize the canvas.' ) ) ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/block-editor/resizable-editor.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
const DEFAULT _STYLES = {
width : '100%' ,
height : '100%'
} ; // Removes the inline styles in the drag handles.
const HANDLE _STYLES _OVERRIDE = {
position : undefined ,
userSelect : undefined ,
cursor : undefined ,
width : undefined ,
height : undefined ,
top : undefined ,
right : undefined ,
bottom : undefined ,
left : undefined
} ;
2021-11-15 13:50:17 +01:00
function ResizableEditor ( _ref ) {
let {
enableResizing ,
settings ,
... props
} = _ref ;
2021-11-09 03:17:17 +01:00
const deviceType = Object ( external _wp _data _ [ "useSelect" ] ) ( select => select ( store ) . _ _experimentalGetPreviewDeviceType ( ) , [ ] ) ;
const deviceStyles = Object ( external _wp _blockEditor _ [ "__experimentalUseResizeCanvas" ] ) ( deviceType ) ;
const [ width , setWidth ] = Object ( external _wp _element _ [ "useState" ] ) ( DEFAULT _STYLES . width ) ;
const [ height , setHeight ] = Object ( external _wp _element _ [ "useState" ] ) ( DEFAULT _STYLES . height ) ;
const iframeRef = Object ( external _wp _element _ [ "useRef" ] ) ( ) ;
const mouseMoveTypingResetRef = Object ( external _wp _blockEditor _ [ "__unstableUseMouseMoveTypingReset" ] ) ( ) ;
const ref = Object ( external _wp _compose _ [ "useMergeRefs" ] ) ( [ iframeRef , mouseMoveTypingResetRef ] ) ;
Object ( external _wp _element _ [ "useEffect" ] ) ( function autoResizeIframeHeight ( ) {
const iframe = iframeRef . current ;
if ( ! iframe || ! enableResizing ) {
return ;
}
2022-01-04 06:39:28 +01:00
let animationFrame = null ;
2021-11-09 03:17:17 +01:00
2022-01-04 06:39:28 +01:00
function resizeHeight ( ) {
if ( ! animationFrame ) {
// Throttle the updates on animation frame.
animationFrame = iframe . contentWindow . requestAnimationFrame ( ( ) => {
setHeight ( iframe . contentDocument . documentElement . scrollHeight ) ;
animationFrame = null ;
} ) ;
}
}
let resizeObserver ;
function registerObserver ( ) {
var _resizeObserver ;
( _resizeObserver = resizeObserver ) === null || _resizeObserver === void 0 ? void 0 : _resizeObserver . disconnect ( ) ;
resizeObserver = new iframe . contentWindow . ResizeObserver ( resizeHeight ) ; // Observing the <html> rather than the <body> because the latter
// gets destroyed and remounted after initialization in <Iframe>.
resizeObserver . observe ( iframe . contentDocument . documentElement ) ;
resizeHeight ( ) ;
} // This is only required in Firefox for some unknown reasons.
iframe . addEventListener ( 'load' , registerObserver ) ; // This is required in Chrome and Safari.
registerObserver ( ) ;
2021-11-09 03:17:17 +01:00
return ( ) => {
2022-01-04 06:39:28 +01:00
var _iframe$contentWindow , _resizeObserver2 ;
( _iframe$contentWindow = iframe . contentWindow ) === null || _iframe$contentWindow === void 0 ? void 0 : _iframe$contentWindow . cancelAnimationFrame ( animationFrame ) ;
( _resizeObserver2 = resizeObserver ) === null || _resizeObserver2 === void 0 ? void 0 : _resizeObserver2 . disconnect ( ) ;
iframe . removeEventListener ( 'load' , registerObserver ) ;
2021-11-09 03:17:17 +01:00
} ;
} , [ enableResizing ] ) ;
const resizeWidthBy = Object ( external _wp _element _ [ "useCallback" ] ) ( deltaPixels => {
if ( iframeRef . current ) {
setWidth ( iframeRef . current . offsetWidth + deltaPixels ) ;
}
} , [ ] ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "ResizableBox" ] , {
size : {
width ,
height
} ,
onResizeStop : ( event , direction , element ) => {
setWidth ( element . style . width ) ;
} ,
minWidth : 300 ,
maxWidth : "100%" ,
maxHeight : "100%" ,
enable : {
right : enableResizing ,
left : enableResizing
} ,
showHandle : enableResizing // The editor is centered horizontally, resizing it only
// moves half the distance. Hence double the ratio to correctly
// align the cursor to the resizer handle.
,
resizeRatio : 2 ,
handleComponent : {
left : Object ( external _wp _element _ [ "createElement" ] ) ( ResizeHandle , {
direction : "left" ,
resizeWidthBy : resizeWidthBy
} ) ,
right : Object ( external _wp _element _ [ "createElement" ] ) ( ResizeHandle , {
direction : "right" ,
resizeWidthBy : resizeWidthBy
} )
} ,
handleClasses : undefined ,
handleStyles : {
left : HANDLE _STYLES _OVERRIDE ,
right : HANDLE _STYLES _OVERRIDE
}
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "__unstableIframe" ] , Object ( esm _extends [ "a" /* default */ ] ) ( {
style : enableResizing ? undefined : deviceStyles ,
head : Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "__unstableEditorStyles" ] , {
styles : settings . styles
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( "style" , null , // Forming a "block formatting context" to prevent margin collapsing.
// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context
2022-01-04 06:39:28 +01:00
` .is-root-container { display: flow-root; } ` ) , enableResizing && Object ( external _wp _element _ [ "createElement" ] ) ( "style" , null , // Force the <html> and <body>'s heights to fit the content.
` html, body { height: -moz-fit-content !important; height: fit-content !important; min-height: 0 !important; } ` , // Some themes will have `min-height: 100vh` for the root container,
// which isn't a requirement in auto resize mode.
` .is-root-container { min-height: 0 !important; } ` ) ) ,
2021-11-09 03:17:17 +01:00
ref : ref ,
name : "editor-canvas" ,
className : "edit-site-visual-editor__editor-canvas"
} , props ) ) ) ;
}
/* harmony default export */ var resizable _editor = ( ResizableEditor ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/block-editor/index.js
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
2021-11-30 01:24:27 +01:00
2021-11-09 03:17:17 +01:00
/ * *
* Internal dependencies
* /
const LAYOUT = {
type : 'default' ,
// At the root level of the site editor, no alignments should be allowed.
alignments : [ ]
} ;
2021-11-15 13:50:17 +01:00
function BlockEditor ( _ref ) {
let {
setIsInserterOpen
} = _ref ;
2021-11-09 03:17:17 +01:00
const {
settings ,
templateType ,
templateId ,
page
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
const {
getSettings ,
getEditedPostType ,
getEditedPostId ,
getPage
} = select ( store ) ;
return {
settings : getSettings ( setIsInserterOpen ) ,
templateType : getEditedPostType ( ) ,
templateId : getEditedPostId ( ) ,
page : getPage ( )
} ;
} , [ setIsInserterOpen ] ) ;
const [ blocks , onInput , onChange ] = Object ( external _wp _coreData _ [ "useEntityBlockEditor" ] ) ( 'postType' , templateType ) ;
const {
setPage
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store ) ;
const contentRef = Object ( external _wp _element _ [ "useRef" ] ) ( ) ;
const mergedRefs = Object ( external _wp _compose _ [ "useMergeRefs" ] ) ( [ contentRef , Object ( external _wp _blockEditor _ [ "__unstableUseTypingObserver" ] ) ( ) ] ) ;
const isMobileViewport = Object ( external _wp _compose _ [ "useViewportMatch" ] ) ( 'small' , '<' ) ;
const {
clearSelectedBlock
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( external _wp _blockEditor _ [ "store" ] ) ;
const isTemplatePart = templateType === 'wp_template_part' ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "BlockEditorProvider" ] , {
settings : settings ,
value : blocks ,
onInput : onInput ,
onChange : onChange ,
useSubRegistry : false
} , Object ( external _wp _element _ [ "createElement" ] ) ( EditTemplatePartMenuButton , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( TemplatePartConverter , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "__experimentalLinkControl" ] . ViewerFill , null , Object ( external _wp _element _ [ "useCallback" ] ) ( fillProps => Object ( external _wp _element _ [ "createElement" ] ) ( NavigateToLink , Object ( esm _extends [ "a" /* default */ ] ) ( { } , fillProps , {
activePage : page ,
onActivePageChange : setPage
} ) ) , [ page ] ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( SidebarInspectorFill , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "BlockInspector" ] , null ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "BlockTools" ] , {
className : classnames _default ( ) ( 'edit-site-visual-editor' , {
'is-focus-mode' : isTemplatePart
} ) ,
_ _unstableContentRef : contentRef ,
onClick : event => {
// Clear selected block when clicking on the gray background.
if ( event . target === event . currentTarget ) {
clearSelectedBlock ( ) ;
}
}
2022-01-04 06:39:28 +01:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "BlockEditorKeyboardShortcuts" ] . Register , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( back _button , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( resizable _editor // Reinitialize the editor and reset the states when the template changes.
2021-11-09 03:17:17 +01:00
, {
key : templateId ,
enableResizing : isTemplatePart && // Disable resizing in mobile viewport.
! isMobileViewport ,
settings : settings ,
contentRef : mergedRefs
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "BlockList" ] , {
className : "edit-site-block-editor__block-list wp-site-blocks" ,
2021-12-14 02:57:26 +01:00
_ _experimentalLayout : LAYOUT ,
renderAppender : isTemplatePart ? false : undefined
2021-11-15 13:50:17 +01:00
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "__unstableBlockSettingsMenuFirstItem" ] , null , _ref2 => {
let {
onClose
} = _ref2 ;
return Object ( external _wp _element _ [ "createElement" ] ) ( BlockInspectorButton , {
onClick : onClose
} ) ;
2021-11-30 01:24:27 +01:00
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _reusableBlocks _ [ "ReusableBlocksMenuItems" ] , null ) ) ;
2021-11-09 03:17:17 +01:00
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/keyboard-shortcuts/index.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2021-11-15 13:50:17 +01:00
function KeyboardShortcuts ( _ref ) {
let {
openEntitiesSavedStates
} = _ref ;
2021-11-09 03:17:17 +01:00
const {
_ _experimentalGetDirtyEntityRecords ,
isSavingEntityRecord
} = Object ( external _wp _data _ [ "useSelect" ] ) ( external _wp _coreData _ [ "store" ] ) ;
const isListViewOpen = Object ( external _wp _data _ [ "useSelect" ] ) ( select => select ( store ) . isListViewOpened ( ) , [ ] ) ;
const isBlockInspectorOpen = Object ( external _wp _data _ [ "useSelect" ] ) ( select => select ( build _module [ "i" /* store */ ] ) . getActiveComplementaryArea ( store . name ) === SIDEBAR _BLOCK , [ ] ) ;
const {
redo ,
undo
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( external _wp _coreData _ [ "store" ] ) ;
const {
setIsListViewOpened
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store ) ;
const {
enableComplementaryArea ,
disableComplementaryArea
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( build _module [ "i" /* store */ ] ) ;
Object ( external _wp _keyboardShortcuts _ [ "useShortcut" ] ) ( 'core/edit-site/save' , event => {
event . preventDefault ( ) ;
const dirtyEntityRecords = _ _experimentalGetDirtyEntityRecords ( ) ;
const isDirty = ! ! dirtyEntityRecords . length ;
const isSaving = dirtyEntityRecords . some ( record => isSavingEntityRecord ( record . kind , record . name , record . key ) ) ;
if ( ! isSaving && isDirty ) {
openEntitiesSavedStates ( ) ;
}
} ) ;
Object ( external _wp _keyboardShortcuts _ [ "useShortcut" ] ) ( 'core/edit-site/undo' , event => {
undo ( ) ;
event . preventDefault ( ) ;
} ) ;
Object ( external _wp _keyboardShortcuts _ [ "useShortcut" ] ) ( 'core/edit-site/redo' , event => {
redo ( ) ;
event . preventDefault ( ) ;
} ) ;
Object ( external _wp _keyboardShortcuts _ [ "useShortcut" ] ) ( 'core/edit-site/toggle-list-view' , ( ) => {
setIsListViewOpened ( ! isListViewOpen ) ;
} ) ;
Object ( external _wp _keyboardShortcuts _ [ "useShortcut" ] ) ( 'core/edit-site/toggle-block-settings-sidebar' , event => {
// This shortcut has no known clashes, but use preventDefault to prevent any
// obscure shortcuts from triggering.
event . preventDefault ( ) ;
if ( isBlockInspectorOpen ) {
disableComplementaryArea ( STORE _NAME ) ;
} else {
enableComplementaryArea ( STORE _NAME , SIDEBAR _BLOCK ) ;
}
} ) ;
return null ;
}
function KeyboardShortcutsRegister ( ) {
// Registering the shortcuts
const {
registerShortcut
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( external _wp _keyboardShortcuts _ [ "store" ] ) ;
Object ( external _wp _element _ [ "useEffect" ] ) ( ( ) => {
registerShortcut ( {
name : 'core/edit-site/save' ,
category : 'global' ,
description : Object ( external _wp _i18n _ [ "__" ] ) ( 'Save your changes.' ) ,
keyCombination : {
modifier : 'primary' ,
character : 's'
}
} ) ;
registerShortcut ( {
name : 'core/edit-site/undo' ,
category : 'global' ,
description : Object ( external _wp _i18n _ [ "__" ] ) ( 'Undo your last changes.' ) ,
keyCombination : {
modifier : 'primary' ,
character : 'z'
}
} ) ;
registerShortcut ( {
name : 'core/edit-site/redo' ,
category : 'global' ,
description : Object ( external _wp _i18n _ [ "__" ] ) ( 'Redo your last undo.' ) ,
keyCombination : {
modifier : 'primaryShift' ,
character : 'z'
}
} ) ;
registerShortcut ( {
name : 'core/edit-site/toggle-list-view' ,
category : 'global' ,
description : Object ( external _wp _i18n _ [ "__" ] ) ( 'Open the block list view.' ) ,
keyCombination : {
modifier : 'access' ,
character : 'o'
}
} ) ;
registerShortcut ( {
name : 'core/edit-site/toggle-block-settings-sidebar' ,
category : 'global' ,
description : Object ( external _wp _i18n _ [ "__" ] ) ( 'Show or hide the block settings sidebar.' ) ,
keyCombination : {
modifier : 'primaryShift' ,
character : ','
}
} ) ;
2022-02-17 20:18:25 +01:00
registerShortcut ( {
name : 'core/edit-site/keyboard-shortcuts' ,
category : 'main' ,
description : Object ( external _wp _i18n _ [ "__" ] ) ( 'Display these keyboard shortcuts.' ) ,
keyCombination : {
modifier : 'access' ,
character : 'h'
}
} ) ;
2021-11-23 06:40:38 +01:00
registerShortcut ( {
name : 'core/edit-site/next-region' ,
category : 'global' ,
description : Object ( external _wp _i18n _ [ "__" ] ) ( 'Navigate to the next part of the editor.' ) ,
keyCombination : {
modifier : 'ctrl' ,
character : '`'
} ,
aliases : [ {
modifier : 'access' ,
character : 'n'
} ]
} ) ;
registerShortcut ( {
name : 'core/edit-site/previous-region' ,
category : 'global' ,
description : Object ( external _wp _i18n _ [ "__" ] ) ( 'Navigate to the previous part of the editor.' ) ,
keyCombination : {
modifier : 'ctrlShift' ,
character : '`'
} ,
aliases : [ {
modifier : 'access' ,
character : 'p'
} ]
} ) ;
} , [ registerShortcut ] ) ;
return null ;
}
KeyboardShortcuts . Register = KeyboardShortcutsRegister ;
/* harmony default export */ var keyboard _shortcuts = ( KeyboardShortcuts ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/url-query-controller/index.js
/ * *
* WordPress dependencies
* /
2021-11-09 03:17:17 +01:00
/ * *
* Internal dependencies
* /
2021-12-14 02:57:26 +01:00
2021-11-09 03:17:17 +01:00
function URLQueryController ( ) {
const {
setTemplate ,
setTemplatePart ,
setPage
2021-12-14 02:57:26 +01:00
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store ) ;
const {
params : {
postId ,
postType
2021-11-09 03:17:17 +01:00
}
2022-02-17 20:18:25 +01:00
} = useLocation ( ) ; // Set correct entity on page navigation.
2021-11-09 03:17:17 +01:00
2021-12-14 02:57:26 +01:00
Object ( external _wp _element _ [ "useEffect" ] ) ( ( ) => {
2021-11-09 03:17:17 +01:00
if ( 'page' === postType || 'post' === postType ) {
setPage ( {
context : {
postType ,
postId
}
} ) ; // Resolves correct template based on ID.
} else if ( 'wp_template' === postType ) {
setTemplate ( postId ) ;
} else if ( 'wp_template_part' === postType ) {
setTemplatePart ( postId ) ;
}
2021-12-14 02:57:26 +01:00
} , [ postId , postType ] ) ;
return null ;
2021-11-09 03:17:17 +01:00
}
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/close.js
var library _close = _ _webpack _require _ _ ( "w95h" ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/secondary-sidebar/inserter-sidebar.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
function InserterSidebar ( ) {
const {
setIsInserterOpened
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store ) ;
const insertionPoint = Object ( external _wp _data _ [ "useSelect" ] ) ( select => select ( store ) . _ _experimentalGetInsertionPoint ( ) , [ ] ) ;
const isMobile = Object ( external _wp _compose _ [ "useViewportMatch" ] ) ( 'medium' , '<' ) ;
const [ inserterDialogRef , inserterDialogProps ] = Object ( external _wp _compose _ [ "__experimentalUseDialog" ] ) ( {
onClose : ( ) => setIsInserterOpened ( false )
} ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( "div" , Object ( esm _extends [ "a" /* default */ ] ) ( {
ref : inserterDialogRef
} , inserterDialogProps , {
className : "edit-site-editor__inserter-panel"
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-site-editor__inserter-panel-header"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
icon : library _close [ "a" /* default */ ] ,
onClick : ( ) => setIsInserterOpened ( false )
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-site-editor__inserter-panel-content"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "__experimentalLibrary" ] , {
showInserterHelpPanel : true ,
shouldFocusBlock : isMobile ,
rootClientId : insertionPoint . rootClientId ,
_ _experimentalInsertionIndex : insertionPoint . insertionIndex ,
_ _experimentalFilterValue : insertionPoint . filterValue
} ) ) ) ;
}
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/close-small.js
var close _small = _ _webpack _require _ _ ( "bWcr" ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/secondary-sidebar/list-view-sidebar.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
function ListViewSidebar ( ) {
const {
setIsListViewOpened
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store ) ;
const {
clearSelectedBlock ,
selectBlock
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( external _wp _blockEditor _ [ "store" ] ) ;
async function selectEditorBlock ( clientId ) {
await clearSelectedBlock ( ) ;
selectBlock ( clientId , - 1 ) ;
}
const focusOnMountRef = Object ( external _wp _compose _ [ "useFocusOnMount" ] ) ( 'firstElement' ) ;
const focusReturnRef = Object ( external _wp _compose _ [ "useFocusReturn" ] ) ( ) ;
function closeOnEscape ( event ) {
if ( event . keyCode === external _wp _keycodes _ [ "ESCAPE" ] && ! event . defaultPrevented ) {
setIsListViewOpened ( false ) ;
}
}
const instanceId = Object ( external _wp _compose _ [ "useInstanceId" ] ) ( ListViewSidebar ) ;
const labelId = ` edit-site-editor__list-view-panel-label- ${ instanceId } ` ;
return ( // eslint-disable-next-line jsx-a11y/no-static-element-interactions
Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
"aria-labelledby" : labelId ,
className : "edit-site-editor__list-view-panel" ,
onKeyDown : closeOnEscape
} , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-site-editor__list-view-panel-header"
} , Object ( external _wp _element _ [ "createElement" ] ) ( "strong" , {
id : labelId
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'List view' ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
icon : close _small [ "a" /* default */ ] ,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Close list view sidebar' ) ,
onClick : ( ) => setIsListViewOpened ( false )
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-site-editor__list-view-panel-content" ,
ref : Object ( external _wp _compose _ [ "useMergeRefs" ] ) ( [ focusReturnRef , focusOnMountRef ] )
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "__experimentalListView" ] , {
onSelect : selectEditorBlock ,
showNestedBlocks : true ,
_ _experimentalFeatures : true ,
_ _experimentalPersistentListViewFeatures : true
} ) ) )
) ;
}
2022-02-17 20:18:25 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/error-boundary/warning.js
2021-11-09 03:17:17 +01:00
/ * *
* WordPress dependencies
* /
2021-11-15 13:50:17 +01:00
function CopyButton ( _ref ) {
let {
text ,
children
} = _ref ;
2021-11-09 03:17:17 +01:00
const ref = Object ( external _wp _compose _ [ "useCopyToClipboard" ] ) ( text ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
variant : "secondary" ,
ref : ref
} , children ) ;
}
2022-02-17 20:18:25 +01:00
function ErrorBoundaryWarning ( _ref2 ) {
let {
message ,
error ,
reboot ,
dashboardLink
} = _ref2 ;
const actions = [ ] ;
if ( reboot ) {
actions . push ( Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
key : "recovery" ,
onClick : reboot ,
variant : "secondary"
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Attempt Recovery' ) ) ) ;
}
if ( error ) {
actions . push ( Object ( external _wp _element _ [ "createElement" ] ) ( CopyButton , {
key : "copy-error" ,
text : error . stack
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Copy Error' ) ) ) ;
}
if ( dashboardLink ) {
actions . push ( Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
key : "back-to-dashboard" ,
variant : "secondary" ,
href : dashboardLink
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Back to dashboard' ) ) ) ;
}
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "Warning" ] , {
className : "editor-error-boundary" ,
actions : actions
} , message ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/error-boundary/index.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2021-11-09 03:17:17 +01:00
class error _boundary _ErrorBoundary extends external _wp _element _ [ "Component" ] {
constructor ( ) {
super ( ... arguments ) ;
this . reboot = this . reboot . bind ( this ) ;
this . state = {
error : null
} ;
}
static getDerivedStateFromError ( error ) {
return {
error
} ;
}
reboot ( ) {
this . props . onError ( ) ;
}
render ( ) {
const {
error
} = this . state ;
if ( ! error ) {
return this . props . children ;
}
2022-02-17 20:18:25 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( ErrorBoundaryWarning , {
message : Object ( external _wp _i18n _ [ "__" ] ) ( 'The editor has encountered an unexpected error.' ) ,
error : error ,
reboot : this . reboot
} ) ;
2021-11-09 03:17:17 +01:00
}
}
2021-11-23 06:40:38 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/welcome-guide/image.js
function WelcomeGuideImage ( _ref ) {
let {
nonAnimatedSrc ,
animatedSrc
} = _ref ;
return Object ( external _wp _element _ [ "createElement" ] ) ( "picture" , {
className : "edit-site-welcome-guide__image"
} , Object ( external _wp _element _ [ "createElement" ] ) ( "source" , {
srcSet : nonAnimatedSrc ,
media : "(prefers-reduced-motion: reduce)"
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( "img" , {
src : animatedSrc ,
width : "312" ,
height : "240" ,
alt : ""
} ) ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/welcome-guide/editor.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
function WelcomeGuideEditor ( ) {
const {
toggleFeature
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store ) ;
2021-12-14 02:57:26 +01:00
const isActive = Object ( external _wp _data _ [ "useSelect" ] ) ( select => select ( store ) . isFeatureActive ( 'welcomeGuide' ) , [ ] ) ;
if ( ! isActive ) {
return null ;
}
2021-11-23 06:40:38 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Guide" ] , {
className : "edit-site-welcome-guide" ,
contentLabel : Object ( external _wp _i18n _ [ "__" ] ) ( 'Welcome to the site editor' ) ,
finishButtonText : Object ( external _wp _i18n _ [ "__" ] ) ( 'Get Started' ) ,
onFinish : ( ) => toggleFeature ( 'welcomeGuide' ) ,
pages : [ {
image : Object ( external _wp _element _ [ "createElement" ] ) ( WelcomeGuideImage , {
nonAnimatedSrc : "https://s.w.org/images/block-editor/edit-your-site.svg?1" ,
animatedSrc : "https://s.w.org/images/block-editor/edit-your-site.gif?1"
} ) ,
content : Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( "h1" , {
className : "edit-site-welcome-guide__heading"
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Edit your site' ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "p" , {
className : "edit-site-welcome-guide__text"
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Design everything on your site — from the header right down to the footer — using blocks.' ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "p" , {
className : "edit-site-welcome-guide__text"
} , Object ( external _wp _element _ [ "createInterpolateElement" ] ) ( Object ( external _wp _i18n _ [ "__" ] ) ( 'Click <StylesIconImage /> to start designing your blocks, and choose your typography, layout, and colors.' ) , {
StylesIconImage : Object ( external _wp _element _ [ "createElement" ] ) ( "img" , {
alt : Object ( external _wp _i18n _ [ "__" ] ) ( 'styles' ) ,
src : "data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z' fill='%231E1E1E'/%3E%3C/svg%3E%0A"
} )
} ) ) )
} ]
} ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/welcome-guide/styles.js
/ * *
* WordPress dependencies
* /
2021-12-14 02:57:26 +01:00
2021-11-23 06:40:38 +01:00
/ * *
* Internal dependencies
* /
function WelcomeGuideStyles ( ) {
const {
toggleFeature
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store ) ;
2021-12-14 02:57:26 +01:00
const {
isActive ,
isStylesOpen
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
const sidebar = select ( build _module [ "i" /* store */ ] ) . getActiveComplementaryArea ( store . name ) ;
return {
isActive : select ( store ) . isFeatureActive ( 'welcomeGuideStyles' ) ,
isStylesOpen : sidebar === 'edit-site/global-styles'
} ;
} , [ ] ) ;
if ( ! isActive || ! isStylesOpen ) {
return null ;
}
2021-11-23 06:40:38 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Guide" ] , {
className : "edit-site-welcome-guide" ,
contentLabel : Object ( external _wp _i18n _ [ "__" ] ) ( 'Welcome to styles' ) ,
finishButtonText : Object ( external _wp _i18n _ [ "__" ] ) ( 'Get Started' ) ,
onFinish : ( ) => toggleFeature ( 'welcomeGuideStyles' ) ,
pages : [ {
image : Object ( external _wp _element _ [ "createElement" ] ) ( WelcomeGuideImage , {
nonAnimatedSrc : "https://s.w.org/images/block-editor/welcome-to-styles.svg?1" ,
animatedSrc : "https://s.w.org/images/block-editor/welcome-to-styles.gif?1"
} ) ,
content : Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( "h1" , {
className : "edit-site-welcome-guide__heading"
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Welcome to Styles' ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "p" , {
className : "edit-site-welcome-guide__text"
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Tweak your site, or give it a whole new look! Get creative — how about a new color palette for your buttons, or choosing a new font? Take a look at what you can do here.' ) ) )
} , {
image : Object ( external _wp _element _ [ "createElement" ] ) ( WelcomeGuideImage , {
nonAnimatedSrc : "https://s.w.org/images/block-editor/set-the-design.svg?1" ,
animatedSrc : "https://s.w.org/images/block-editor/set-the-design.gif?1"
} ) ,
content : Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( "h1" , {
className : "edit-site-welcome-guide__heading"
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Set the design' ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "p" , {
className : "edit-site-welcome-guide__text"
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'You can customize your site as much as you like with different colors, typography, and layouts. Or if you prefer, just leave it up to your theme to handle! ' ) ) )
} , {
image : Object ( external _wp _element _ [ "createElement" ] ) ( WelcomeGuideImage , {
nonAnimatedSrc : "https://s.w.org/images/block-editor/personalize-blocks.svg?1" ,
animatedSrc : "https://s.w.org/images/block-editor/personalize-blocks.gif?1"
} ) ,
content : Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( "h1" , {
className : "edit-site-welcome-guide__heading"
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Personalize blocks' ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "p" , {
className : "edit-site-welcome-guide__text"
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'You can adjust your blocks to ensure a cohesive experience across your site — add your unique colors to a branded Button block, or adjust the Heading block to your preferred size.' ) ) )
} , {
image : Object ( external _wp _element _ [ "createElement" ] ) ( WelcomeGuideImage , {
nonAnimatedSrc : "https://s.w.org/images/block-editor/welcome-documentation.svg" ,
animatedSrc : "https://s.w.org/images/block-editor/welcome-documentation.gif"
} ) ,
content : Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( "h1" , {
className : "edit-site-welcome-guide__heading"
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Learn more' ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "p" , {
className : "edit-site-welcome-guide__text"
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'New to block themes and styling your site? ' ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "ExternalLink" ] , {
2021-12-14 02:57:26 +01:00
href : Object ( external _wp _i18n _ [ "__" ] ) ( 'https://wordpress.org/support/article/styles-overview/' )
2021-11-23 06:40:38 +01:00
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Here’ s a detailed guide to learn how to make the most of it.' ) ) ) )
} ]
} ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/welcome-guide/index.js
/ * *
* Internal dependencies
* /
function WelcomeGuide ( ) {
2021-12-14 02:57:26 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( WelcomeGuideEditor , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( WelcomeGuideStyles , null ) ) ;
2021-11-23 06:40:38 +01:00
}
2021-11-09 03:17:17 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/editor/global-styles-renderer.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
/ * *
* Internal dependencies
* /
function useGlobalStylesRenderer ( ) {
const [ styles , settings ] = useGlobalStylesOutput ( ) ;
const {
getSettings
} = Object ( external _wp _data _ [ "useSelect" ] ) ( store ) ;
const {
updateSettings
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store ) ;
Object ( external _wp _element _ [ "useEffect" ] ) ( ( ) => {
var _currentStoreSettings ;
if ( ! styles || ! settings ) {
return ;
}
const currentStoreSettings = getSettings ( ) ;
const nonGlobalStyles = currentStoreSettings === null || currentStoreSettings === void 0 ? void 0 : ( _currentStoreSettings = currentStoreSettings . styles ) === null || _currentStoreSettings === void 0 ? void 0 : _currentStoreSettings . filter ( style => ! style . isGlobalStyles ) ;
updateSettings ( { ... currentStoreSettings ,
styles : [ ... nonGlobalStyles , ... styles ] ,
_ _experimentalFeatures : settings
} ) ;
} , [ styles , settings ] ) ;
}
function GlobalStylesRenderer ( ) {
useGlobalStylesRenderer ( ) ;
return null ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/global-styles-provider.js
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
function mergeTreesCustomizer ( _ , srcValue ) {
// We only pass as arrays the presets,
// in which case we want the new array of values
// to override the old array (no merging).
if ( Array . isArray ( srcValue ) ) {
return srcValue ;
}
}
function mergeBaseAndUserConfigs ( base , user ) {
return Object ( external _lodash _ [ "mergeWith" ] ) ( { } , base , user , mergeTreesCustomizer ) ;
}
const cleanEmptyObject = object => {
if ( ! Object ( external _lodash _ [ "isObject" ] ) ( object ) || Array . isArray ( object ) ) {
return object ;
}
const cleanedNestedObjects = Object ( external _lodash _ [ "pickBy" ] ) ( Object ( external _lodash _ [ "mapValues" ] ) ( object , cleanEmptyObject ) , external _lodash _ [ "identity" ] ) ;
return Object ( external _lodash _ [ "isEmpty" ] ) ( cleanedNestedObjects ) ? undefined : cleanedNestedObjects ;
} ;
function useGlobalStylesUserConfig ( ) {
const {
globalStylesId ,
settings ,
styles
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
const _globalStylesId = select ( external _wp _coreData _ [ "store" ] ) . _ _experimentalGetCurrentGlobalStylesId ( ) ;
const record = _globalStylesId ? select ( external _wp _coreData _ [ "store" ] ) . getEditedEntityRecord ( 'root' , 'globalStyles' , _globalStylesId ) : undefined ;
return {
globalStylesId : _globalStylesId ,
settings : record === null || record === void 0 ? void 0 : record . settings ,
styles : record === null || record === void 0 ? void 0 : record . styles
} ;
} , [ ] ) ;
const {
getEditedEntityRecord
} = Object ( external _wp _data _ [ "useSelect" ] ) ( external _wp _coreData _ [ "store" ] ) ;
const {
editEntityRecord
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( external _wp _coreData _ [ "store" ] ) ;
const config = Object ( external _wp _element _ [ "useMemo" ] ) ( ( ) => {
return {
2021-11-23 06:40:38 +01:00
settings : settings !== null && settings !== void 0 ? settings : { } ,
2021-11-09 03:17:17 +01:00
styles : styles !== null && styles !== void 0 ? styles : { }
} ;
} , [ settings , styles ] ) ;
const setConfig = Object ( external _wp _element _ [ "useCallback" ] ) ( callback => {
var _record$styles , _record$settings ;
const record = getEditedEntityRecord ( 'root' , 'globalStyles' , globalStylesId ) ;
const currentConfig = {
styles : ( _record$styles = record === null || record === void 0 ? void 0 : record . styles ) !== null && _record$styles !== void 0 ? _record$styles : { } ,
2021-11-23 06:40:38 +01:00
settings : ( _record$settings = record === null || record === void 0 ? void 0 : record . settings ) !== null && _record$settings !== void 0 ? _record$settings : { }
2021-11-09 03:17:17 +01:00
} ;
const updatedConfig = callback ( currentConfig ) ;
editEntityRecord ( 'root' , 'globalStyles' , globalStylesId , {
styles : cleanEmptyObject ( updatedConfig . styles ) || { } ,
2021-11-23 06:40:38 +01:00
settings : cleanEmptyObject ( updatedConfig . settings ) || { }
2021-11-09 03:17:17 +01:00
} ) ;
} , [ globalStylesId ] ) ;
return [ ! ! settings || ! ! styles , config , setConfig ] ;
}
function useGlobalStylesBaseConfig ( ) {
const baseConfig = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
return select ( external _wp _coreData _ [ "store" ] ) . _ _experimentalGetCurrentThemeBaseGlobalStyles ( ) ;
} , [ ] ) ;
2021-11-23 06:40:38 +01:00
return [ ! ! baseConfig , baseConfig ] ;
2021-11-09 03:17:17 +01:00
}
function useGlobalStylesContext ( ) {
const [ isUserConfigReady , userConfig , setUserConfig ] = useGlobalStylesUserConfig ( ) ;
2021-11-23 06:40:38 +01:00
const [ isBaseConfigReady , baseConfig ] = useGlobalStylesBaseConfig ( ) ;
2021-11-09 03:17:17 +01:00
const mergedConfig = Object ( external _wp _element _ [ "useMemo" ] ) ( ( ) => {
if ( ! baseConfig || ! userConfig ) {
return { } ;
}
return mergeBaseAndUserConfigs ( baseConfig , userConfig ) ;
} , [ userConfig , baseConfig ] ) ;
const context = Object ( external _wp _element _ [ "useMemo" ] ) ( ( ) => {
return {
2021-11-23 06:40:38 +01:00
isReady : isUserConfigReady && isBaseConfigReady ,
2021-11-09 03:17:17 +01:00
user : userConfig ,
base : baseConfig ,
merged : mergedConfig ,
setUserConfig
} ;
2021-11-23 06:40:38 +01:00
} , [ mergedConfig , userConfig , baseConfig , setUserConfig , isUserConfigReady , isBaseConfigReady ] ) ;
2021-11-09 03:17:17 +01:00
return context ;
}
2021-11-23 06:40:38 +01:00
function GlobalStylesProvider ( _ref ) {
2021-11-15 13:50:17 +01:00
let {
children
2021-11-23 06:40:38 +01:00
} = _ref ;
2021-11-09 03:17:17 +01:00
const context = useGlobalStylesContext ( ) ;
if ( ! context . isReady ) {
return null ;
}
return Object ( external _wp _element _ [ "createElement" ] ) ( GlobalStylesContext . Provider , {
value : context
} , children ) ;
}
2021-12-14 02:57:26 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/routes/use-title.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
function useTitle ( title ) {
const location = useLocation ( ) ;
const siteTitle = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
var _select$getEntityReco ;
return ( _select$getEntityReco = select ( external _wp _coreData _ [ "store" ] ) . getEntityRecord ( 'root' , 'site' ) ) === null || _select$getEntityReco === void 0 ? void 0 : _select$getEntityReco . title ;
} , [ ] ) ;
const isInitialLocationRef = Object ( external _wp _element _ [ "useRef" ] ) ( true ) ;
Object ( external _wp _element _ [ "useEffect" ] ) ( ( ) => {
isInitialLocationRef . current = false ;
} , [ location ] ) ;
Object ( external _wp _element _ [ "useEffect" ] ) ( ( ) => {
// Don't update or announce the title for initial page load.
if ( isInitialLocationRef . current ) {
return ;
}
if ( title && siteTitle ) {
// @see https://github.com/WordPress/wordpress-develop/blob/94849898192d271d533e09756007e176feb80697/src/wp-admin/admin-header.php#L67-L68
const formattedTitle = Object ( external _wp _i18n _ [ "sprintf" ] ) (
/* translators: Admin screen title. 1: Admin screen name, 2: Network or site name. */
Object ( external _wp _i18n _ [ "__" ] ) ( '%1$s ‹ %2$s — WordPress' ) , title , siteTitle ) ;
document . title = formattedTitle ; // Announce title on route change for screen readers.
Object ( external _wp _a11y _ [ "speak" ] ) ( Object ( external _wp _i18n _ [ "sprintf" ] ) (
/* translators: The page title that is currently displaying. */
Object ( external _wp _i18n _ [ "__" ] ) ( 'Now displaying: %s' ) , document . title ) , 'assertive' ) ;
}
} , [ title , siteTitle , location ] ) ;
}
2021-11-09 03:17:17 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/editor/index.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2021-11-23 06:40:38 +01:00
2021-12-14 02:57:26 +01:00
2021-11-09 03:17:17 +01:00
const interfaceLabels = {
2021-11-23 06:40:38 +01:00
secondarySidebar : Object ( external _wp _i18n _ [ "__" ] ) ( 'Block Library' ) ,
drawer : Object ( external _wp _i18n _ [ "__" ] ) ( 'Navigation Sidebar' )
2021-11-09 03:17:17 +01:00
} ;
2021-11-15 13:50:17 +01:00
function Editor ( _ref ) {
let {
onError
} = _ref ;
2021-11-09 03:17:17 +01:00
const {
isInserterOpen ,
isListViewOpen ,
sidebarIsOpened ,
settings ,
entityId ,
templateType ,
page ,
template ,
templateResolved ,
2021-11-23 06:40:38 +01:00
isNavigationOpen ,
previousShortcut ,
nextShortcut
2021-11-09 03:17:17 +01:00
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
const {
isInserterOpened ,
isListViewOpened ,
getSettings ,
getEditedPostType ,
getEditedPostId ,
getPage ,
isNavigationOpened
} = select ( store ) ;
const {
hasFinishedResolution ,
getEntityRecord
} = select ( external _wp _coreData _ [ "store" ] ) ;
const postType = getEditedPostType ( ) ;
const postId = getEditedPostId ( ) ; // The currently selected entity to display. Typically template or template part.
return {
isInserterOpen : isInserterOpened ( ) ,
isListViewOpen : isListViewOpened ( ) ,
sidebarIsOpened : ! ! select ( build _module [ "i" /* store */ ] ) . getActiveComplementaryArea ( store . name ) ,
settings : getSettings ( ) ,
templateType : postType ,
page : getPage ( ) ,
template : postId ? getEntityRecord ( 'postType' , postType , postId ) : null ,
templateResolved : postId ? hasFinishedResolution ( 'getEntityRecord' , [ 'postType' , postType , postId ] ) : false ,
entityId : postId ,
2021-11-23 06:40:38 +01:00
isNavigationOpen : isNavigationOpened ( ) ,
previousShortcut : select ( external _wp _keyboardShortcuts _ [ "store" ] ) . getAllShortcutKeyCombinations ( 'core/edit-site/previous-region' ) ,
nextShortcut : select ( external _wp _keyboardShortcuts _ [ "store" ] ) . getAllShortcutKeyCombinations ( 'core/edit-site/next-region' )
2021-11-09 03:17:17 +01:00
} ;
} , [ ] ) ;
const {
setPage ,
2021-12-14 02:57:26 +01:00
setIsInserterOpened
2021-11-09 03:17:17 +01:00
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store ) ;
2022-01-24 08:46:21 +01:00
const {
enableComplementaryArea
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( build _module [ "i" /* store */ ] ) ;
2021-11-09 03:17:17 +01:00
const [ isEntitiesSavedStatesOpen , setIsEntitiesSavedStatesOpen ] = Object ( external _wp _element _ [ "useState" ] ) ( false ) ;
const openEntitiesSavedStates = Object ( external _wp _element _ [ "useCallback" ] ) ( ( ) => setIsEntitiesSavedStatesOpen ( true ) , [ ] ) ;
const closeEntitiesSavedStates = Object ( external _wp _element _ [ "useCallback" ] ) ( ( ) => {
setIsEntitiesSavedStatesOpen ( false ) ;
} , [ ] ) ;
const blockContext = Object ( external _wp _element _ [ "useMemo" ] ) ( ( ) => ( { ... ( page === null || page === void 0 ? void 0 : page . context ) ,
queryContext : [ ( page === null || page === void 0 ? void 0 : page . context . queryContext ) || {
page : 1
} , newQueryContext => setPage ( { ... page ,
context : { ... ( page === null || page === void 0 ? void 0 : page . context ) ,
queryContext : { ... ( page === null || page === void 0 ? void 0 : page . context . queryContext ) ,
... newQueryContext
}
}
} ) ]
} ) , [ page === null || page === void 0 ? void 0 : page . context ] ) ;
Object ( external _wp _element _ [ "useEffect" ] ) ( ( ) => {
if ( isNavigationOpen ) {
document . body . classList . add ( 'is-navigation-sidebar-open' ) ;
} else {
document . body . classList . remove ( 'is-navigation-sidebar-open' ) ;
}
2022-01-24 08:46:21 +01:00
} , [ isNavigationOpen ] ) ;
Object ( external _wp _element _ [ "useEffect" ] ) ( function openGlobalStylesOnLoad ( ) {
const searchParams = new URLSearchParams ( window . location . search ) ;
if ( searchParams . get ( 'styles' ) === 'open' ) {
enableComplementaryArea ( 'core/edit-site' , 'edit-site/global-styles' ) ;
}
} , [ enableComplementaryArea ] ) ; // Don't render the Editor until the settings are set and loaded
2021-11-23 06:40:38 +01:00
const isReady = ( settings === null || settings === void 0 ? void 0 : settings . siteUrl ) && templateType !== undefined && entityId !== undefined ;
const secondarySidebar = ( ) => {
if ( isInserterOpen ) {
return Object ( external _wp _element _ [ "createElement" ] ) ( InserterSidebar , null ) ;
}
if ( isListViewOpen ) {
return Object ( external _wp _element _ [ "createElement" ] ) ( ListViewSidebar , null ) ;
}
return null ;
2021-12-14 02:57:26 +01:00
} ; // Only announce the title once the editor is ready to prevent "Replace"
// action in <URlQueryController> from double-announcing.
2021-11-23 06:40:38 +01:00
2021-12-14 02:57:26 +01:00
useTitle ( isReady && Object ( external _wp _i18n _ [ "__" ] ) ( 'Editor (beta)' ) ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( URLQueryController , null ) , isReady && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _keyboardShortcuts _ [ "ShortcutProvider" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _coreData _ [ "EntityProvider" ] , {
2021-11-23 06:40:38 +01:00
kind : "root" ,
type : "site"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _coreData _ [ "EntityProvider" ] , {
kind : "postType" ,
type : templateType ,
id : entityId
} , Object ( external _wp _element _ [ "createElement" ] ) ( GlobalStylesProvider , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "BlockContextProvider" ] , {
value : blockContext
} , Object ( external _wp _element _ [ "createElement" ] ) ( GlobalStylesRenderer , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( error _boundary _ErrorBoundary , {
onError : onError
2021-12-14 02:57:26 +01:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( keyboard _shortcuts . Register , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( SidebarComplementaryAreaFills , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( build _module [ "e" /* InterfaceSkeleton */ ] , {
2021-11-23 06:40:38 +01:00
labels : interfaceLabels ,
secondarySidebar : secondarySidebar ( ) ,
sidebar : sidebarIsOpened && Object ( external _wp _element _ [ "createElement" ] ) ( build _module [ "b" /* ComplementaryArea */ ] . Slot , {
scope : "core/edit-site"
} ) ,
2021-12-14 02:57:26 +01:00
drawer : Object ( external _wp _element _ [ "createElement" ] ) ( navigation _sidebar . Slot , null ) ,
2021-11-23 06:40:38 +01:00
header : Object ( external _wp _element _ [ "createElement" ] ) ( Header , {
openEntitiesSavedStates : openEntitiesSavedStates
} ) ,
notices : Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "EditorSnackbars" ] , null ) ,
content : Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "EditorNotices" ] , null ) , template && Object ( external _wp _element _ [ "createElement" ] ) ( BlockEditor , {
setIsInserterOpen : setIsInserterOpened
} ) , templateResolved && ! template && ( settings === null || settings === void 0 ? void 0 : settings . siteUrl ) && entityId && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Notice" ] , {
status : "warning" ,
isDismissible : false
} , Object ( external _wp _i18n _ [ "__" ] ) ( "You attempted to edit an item that doesn't exist. Perhaps it was deleted?" ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( keyboard _shortcuts , {
openEntitiesSavedStates : openEntitiesSavedStates
} ) ) ,
actions : Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , isEntitiesSavedStatesOpen ? Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "EntitiesSavedStates" ] , {
close : closeEntitiesSavedStates
} ) : Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-site-editor__toggle-save-panel"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
variant : "secondary" ,
className : "edit-site-editor__toggle-save-panel-button" ,
onClick : openEntitiesSavedStates ,
"aria-expanded" : false
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Open save panel' ) ) ) ) ,
footer : Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "BlockBreadcrumb" ] , null ) ,
shortcuts : {
previous : previousShortcut ,
next : nextShortcut
}
2021-12-14 02:57:26 +01:00
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( WelcomeGuide , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Popover" ] . Slot , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _plugins _ [ "PluginArea" ] , null ) ) ) ) ) ) ) ) ;
2021-11-23 06:40:38 +01:00
}
/* harmony default export */ var editor = ( Editor ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/list/use-register-shortcuts.js
/ * *
* WordPress dependencies
* /
function useRegisterShortcuts ( ) {
const {
registerShortcut
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( external _wp _keyboardShortcuts _ [ "store" ] ) ;
Object ( external _wp _element _ [ "useEffect" ] ) ( ( ) => {
registerShortcut ( {
name : 'core/edit-site/next-region' ,
category : 'global' ,
description : Object ( external _wp _i18n _ [ "__" ] ) ( 'Navigate to the next part of the editor.' ) ,
keyCombination : {
modifier : 'ctrl' ,
character : '`'
} ,
aliases : [ {
modifier : 'access' ,
character : 'n'
} ]
} ) ;
registerShortcut ( {
name : 'core/edit-site/previous-region' ,
category : 'global' ,
description : Object ( external _wp _i18n _ [ "__" ] ) ( 'Navigate to the previous part of the editor.' ) ,
keyCombination : {
modifier : 'ctrlShift' ,
character : '`'
} ,
aliases : [ {
modifier : 'access' ,
character : 'p'
} ]
} ) ;
} , [ ] ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/add-new-template/new-template.js
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
2021-12-14 02:57:26 +01:00
/ * *
* Internal dependencies
* /
2021-11-30 01:24:27 +01:00
2021-11-23 06:40:38 +01:00
const DEFAULT _TEMPLATE _SLUGS = [ 'front-page' , 'single-post' , 'page' , 'archive' , 'search' , '404' , 'index' ] ;
function NewTemplate ( _ref ) {
let {
postType
} = _ref ;
2021-12-14 02:57:26 +01:00
const history = useHistory ( ) ;
2021-11-23 06:40:38 +01:00
const {
templates ,
defaultTemplateTypes
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => ( {
2021-11-30 01:24:27 +01:00
templates : select ( external _wp _coreData _ [ "store" ] ) . getEntityRecords ( 'postType' , 'wp_template' , {
per _page : - 1
} ) ,
2021-11-23 06:40:38 +01:00
defaultTemplateTypes : select ( external _wp _editor _ [ "store" ] ) . _ _experimentalGetDefaultTemplateTypes ( )
} ) , [ ] ) ;
2021-12-14 02:57:26 +01:00
const {
saveEntityRecord
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( external _wp _coreData _ [ "store" ] ) ;
2021-11-30 01:24:27 +01:00
const {
createErrorNotice
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( external _wp _notices _ [ "store" ] ) ;
2021-12-14 02:57:26 +01:00
const {
getLastEntitySaveError
} = Object ( external _wp _data _ [ "useSelect" ] ) ( external _wp _coreData _ [ "store" ] ) ;
2021-11-23 06:40:38 +01:00
async function createTemplate ( _ref2 ) {
let {
slug
} = _ref2 ;
2021-11-30 01:24:27 +01:00
try {
const {
title ,
description
} = Object ( external _lodash _ [ "find" ] ) ( defaultTemplateTypes , {
slug
} ) ;
2021-12-14 02:57:26 +01:00
const template = await saveEntityRecord ( 'postType' , 'wp_template' , {
excerpt : description ,
// Slugs need to be strings, so this is for template `404`
slug : slug . toString ( ) ,
status : 'publish' ,
title
} ) ;
const lastEntitySaveError = getLastEntitySaveError ( 'postType' , 'wp_template' , template . id ) ;
2021-11-30 01:24:27 +01:00
2021-12-14 02:57:26 +01:00
if ( lastEntitySaveError ) {
throw lastEntitySaveError ;
} // Navigate to the created template editor.
2021-11-30 01:24:27 +01:00
2021-12-14 02:57:26 +01:00
history . push ( {
postId : template . id ,
postType : template . type
} ) ; // TODO: Add a success notice?
2021-11-30 01:24:27 +01:00
} catch ( error ) {
const errorMessage = error . message && error . code !== 'unknown_error' ? error . message : Object ( external _wp _i18n _ [ "__" ] ) ( 'An error occurred while creating the template.' ) ;
createErrorNotice ( errorMessage , {
type : 'snackbar'
} ) ;
}
2021-11-23 06:40:38 +01:00
}
const existingTemplateSlugs = Object ( external _lodash _ [ "map" ] ) ( templates , 'slug' ) ;
const missingTemplates = Object ( external _lodash _ [ "filter" ] ) ( defaultTemplateTypes , template => Object ( external _lodash _ [ "includes" ] ) ( DEFAULT _TEMPLATE _SLUGS , template . slug ) && ! Object ( external _lodash _ [ "includes" ] ) ( existingTemplateSlugs , template . slug ) ) ;
if ( ! missingTemplates . length ) {
return null ;
}
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "DropdownMenu" ] , {
className : "edit-site-new-template-dropdown" ,
icon : null ,
text : postType . labels . add _new ,
label : postType . labels . add _new _item ,
popoverProps : {
noArrow : false
} ,
toggleProps : {
variant : 'primary'
}
} , ( ) => Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "NavigableMenu" ] , {
className : "edit-site-new-template-dropdown__popover"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuGroup" ] , {
label : postType . labels . add _new _item
} , Object ( external _lodash _ [ "map" ] ) ( missingTemplates , _ref3 => {
let {
title ,
description ,
slug
} = _ref3 ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuItem" ] , {
info : description ,
key : slug ,
onClick : ( ) => {
createTemplate ( {
slug
} ) ; // We will be navigated way so no need to close the dropdown.
}
} , title ) ;
} ) ) ) ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/add-new-template/new-template-part.js
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
2021-11-30 01:24:27 +01:00
2021-11-23 06:40:38 +01:00
/ * *
* Internal dependencies
* /
2021-12-14 02:57:26 +01:00
2021-11-23 06:40:38 +01:00
function NewTemplatePart ( _ref ) {
let {
postType
} = _ref ;
2021-12-14 02:57:26 +01:00
const history = useHistory ( ) ;
2021-11-23 06:40:38 +01:00
const [ isModalOpen , setIsModalOpen ] = Object ( external _wp _element _ [ "useState" ] ) ( false ) ;
2021-11-30 01:24:27 +01:00
const {
createErrorNotice
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( external _wp _notices _ [ "store" ] ) ;
2021-12-14 02:57:26 +01:00
const {
saveEntityRecord
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( external _wp _coreData _ [ "store" ] ) ;
const {
getLastEntitySaveError
} = Object ( external _wp _data _ [ "useSelect" ] ) ( external _wp _coreData _ [ "store" ] ) ;
2021-11-23 06:40:38 +01:00
async function createTemplatePart ( _ref2 ) {
let {
title ,
area
} = _ref2 ;
2021-11-09 03:17:17 +01:00
2021-11-23 06:40:38 +01:00
if ( ! title ) {
2021-11-30 01:24:27 +01:00
createErrorNotice ( Object ( external _wp _i18n _ [ "__" ] ) ( 'Title is not defined.' ) , {
type : 'snackbar'
} ) ;
2021-11-23 06:40:38 +01:00
return ;
2021-11-09 03:17:17 +01:00
}
2021-11-30 01:24:27 +01:00
try {
2022-02-17 20:18:25 +01:00
// Currently template parts only allow latin chars.
// Fallback slug will receive suffix by default.
const cleanSlug = Object ( external _lodash _ [ "kebabCase" ] ) ( title ) . replace ( /[^\w-]+/g , '' ) || 'wp-custom-part' ;
2021-12-14 02:57:26 +01:00
const templatePart = await saveEntityRecord ( 'postType' , 'wp_template_part' , {
2022-02-17 20:18:25 +01:00
slug : cleanSlug ,
2021-12-14 02:57:26 +01:00
title ,
content : '' ,
area
} ) ;
const lastEntitySaveError = getLastEntitySaveError ( 'postType' , 'wp_template_part' , templatePart . id ) ;
2021-11-23 06:40:38 +01:00
2021-12-14 02:57:26 +01:00
if ( lastEntitySaveError ) {
throw lastEntitySaveError ;
}
setIsModalOpen ( false ) ; // Navigate to the created template part editor.
history . push ( {
2021-11-30 01:24:27 +01:00
postId : templatePart . id ,
2021-12-14 02:57:26 +01:00
postType : templatePart . type
} ) ; // TODO: Add a success notice?
2021-11-30 01:24:27 +01:00
} catch ( error ) {
const errorMessage = error . message && error . code !== 'unknown_error' ? error . message : Object ( external _wp _i18n _ [ "__" ] ) ( 'An error occurred while creating the template part.' ) ;
createErrorNotice ( errorMessage , {
type : 'snackbar'
} ) ;
2021-12-14 02:57:26 +01:00
setIsModalOpen ( false ) ;
2021-11-30 01:24:27 +01:00
}
}
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
2021-11-23 06:40:38 +01:00
variant : "primary" ,
onClick : ( ) => {
setIsModalOpen ( true ) ;
2021-11-09 03:17:17 +01:00
}
2021-11-23 06:40:38 +01:00
} , postType . labels . add _new ) , isModalOpen && Object ( external _wp _element _ [ "createElement" ] ) ( CreateTemplatePartModal , {
closeModal : ( ) => setIsModalOpen ( false ) ,
onCreate : createTemplatePart
} ) ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/add-new-template/index.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2021-11-09 03:17:17 +01:00
2021-11-23 06:40:38 +01:00
function AddNewTemplate ( _ref ) {
let {
templateType = 'wp_template'
} = _ref ;
const postType = Object ( external _wp _data _ [ "useSelect" ] ) ( select => select ( external _wp _coreData _ [ "store" ] ) . getPostType ( templateType ) , [ templateType ] ) ;
if ( ! postType ) {
2021-11-09 03:17:17 +01:00
return null ;
2021-11-23 06:40:38 +01:00
}
2021-11-09 03:17:17 +01:00
2021-11-23 06:40:38 +01:00
if ( templateType === 'wp_template' ) {
return Object ( external _wp _element _ [ "createElement" ] ) ( NewTemplate , {
postType : postType
} ) ;
} else if ( templateType === 'wp_template_part' ) {
return Object ( external _wp _element _ [ "createElement" ] ) ( NewTemplatePart , {
postType : postType
} ) ;
}
return null ;
2021-11-09 03:17:17 +01:00
}
2021-11-23 06:40:38 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/list/header.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2021-11-09 03:17:17 +01:00
2021-11-23 06:40:38 +01:00
function header _Header ( _ref ) {
var _postType$labels ;
let {
templateType
} = _ref ;
const postType = Object ( external _wp _data _ [ "useSelect" ] ) ( select => select ( external _wp _coreData _ [ "store" ] ) . getPostType ( templateType ) , [ templateType ] ) ;
if ( ! postType ) {
return null ;
}
return Object ( external _wp _element _ [ "createElement" ] ) ( "header" , {
className : "edit-site-list-header"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalHeading" ] , {
level : 1 ,
className : "edit-site-list-header__title"
} , ( _postType$labels = postType . labels ) === null || _postType$labels === void 0 ? void 0 : _postType$labels . name ) , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-site-list-header__right"
} , Object ( external _wp _element _ [ "createElement" ] ) ( AddNewTemplate , {
templateType : templateType
} ) ) ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/utils/is-template-removable.js
/ * *
* Check if a template is removable .
*
* @ param { Object } template The template entity to check .
* @ return { boolean } Whether the template is revertable .
* /
function isTemplateRemovable ( template ) {
if ( ! template ) {
return false ;
}
return template . source === 'custom' && ! template . has _theme _file ;
}
2021-11-30 01:24:27 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/list/actions/rename-menu-item.js
/ * *
* WordPress dependencies
* /
function RenameMenuItem ( _ref ) {
let {
template ,
onClose
} = _ref ;
const [ title , setTitle ] = Object ( external _wp _element _ [ "useState" ] ) ( ( ) => template . title . rendered ) ;
const [ isModalOpen , setIsModalOpen ] = Object ( external _wp _element _ [ "useState" ] ) ( false ) ;
const {
getLastEntitySaveError
} = Object ( external _wp _data _ [ "useSelect" ] ) ( external _wp _coreData _ [ "store" ] ) ;
const {
editEntityRecord ,
saveEditedEntityRecord
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( external _wp _coreData _ [ "store" ] ) ;
const {
createSuccessNotice ,
createErrorNotice
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( external _wp _notices _ [ "store" ] ) ;
if ( ! template . is _custom ) {
return null ;
}
async function onTemplateRename ( event ) {
event . preventDefault ( ) ;
try {
await editEntityRecord ( 'postType' , template . type , template . id , {
title
} ) ; // Update state before saving rerenders the list.
setTitle ( '' ) ;
setIsModalOpen ( false ) ;
onClose ( ) ; // Persist edited entity.
await saveEditedEntityRecord ( 'postType' , template . type , template . id ) ;
const lastError = getLastEntitySaveError ( 'postType' , template . type , template . id ) ;
if ( lastError ) {
throw lastError ;
}
createSuccessNotice ( Object ( external _wp _i18n _ [ "__" ] ) ( 'Template has been renamed.' ) , {
type : 'snackbar'
} ) ;
} catch ( error ) {
const errorMessage = error . message && error . code !== 'unknown_error' ? error . message : Object ( external _wp _i18n _ [ "__" ] ) ( 'An error occurred while renaming the template.' ) ;
createErrorNotice ( errorMessage , {
type : 'snackbar'
} ) ;
}
}
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuItem" ] , {
onClick : ( ) => {
setIsModalOpen ( true ) ;
setTitle ( template . title . rendered ) ;
}
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Rename' ) ) , isModalOpen && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Modal" ] , {
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Rename template' ) ,
closeLabel : Object ( external _wp _i18n _ [ "__" ] ) ( 'Close' ) ,
onRequestClose : ( ) => {
setIsModalOpen ( false ) ;
} ,
overlayClassName : "edit-site-list__rename-modal"
} , Object ( external _wp _element _ [ "createElement" ] ) ( "form" , {
onSubmit : onTemplateRename
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Flex" ] , {
align : "flex-start" ,
gap : 8
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "FlexItem" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "TextControl" ] , {
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Name' ) ,
value : title ,
onChange : setTitle ,
required : true
} ) ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Flex" ] , {
className : "edit-site-list__rename-modal-actions" ,
justify : "flex-end" ,
expanded : false
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "FlexItem" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
variant : "tertiary" ,
onClick : ( ) => {
setIsModalOpen ( false ) ;
}
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Cancel' ) ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "FlexItem" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
variant : "primary" ,
type : "submit"
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Save' ) ) ) ) ) ) ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/list/actions/index.js
2021-11-09 03:17:17 +01:00
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2021-11-23 06:40:38 +01:00
2021-11-30 01:24:27 +01:00
2021-11-23 06:40:38 +01:00
function Actions ( _ref ) {
2021-11-15 13:50:17 +01:00
let {
2021-11-30 01:24:27 +01:00
template
2021-11-15 13:50:17 +01:00
} = _ref ;
2021-11-09 03:17:17 +01:00
const {
2021-11-30 01:24:27 +01:00
removeTemplate ,
revertTemplate
2021-11-23 06:40:38 +01:00
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store ) ;
2021-11-30 01:24:27 +01:00
const {
saveEditedEntityRecord
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( external _wp _coreData _ [ "store" ] ) ;
const {
createSuccessNotice ,
createErrorNotice
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( external _wp _notices _ [ "store" ] ) ;
const isRemovable = isTemplateRemovable ( template ) ;
const isRevertable = isTemplateRevertable ( template ) ;
if ( ! isRemovable && ! isRevertable ) {
return null ;
}
async function revertAndSaveTemplate ( ) {
try {
await revertTemplate ( template , {
allowUndo : false
} ) ;
await saveEditedEntityRecord ( 'postType' , template . type , template . id ) ;
createSuccessNotice ( Object ( external _wp _i18n _ [ "__" ] ) ( 'Template reverted.' ) , {
type : 'snackbar'
} ) ;
} catch ( error ) {
const errorMessage = error . message && error . code !== 'unknown_error' ? error . message : Object ( external _wp _i18n _ [ "__" ] ) ( 'An error occurred while reverting the template.' ) ;
createErrorNotice ( errorMessage , {
type : 'snackbar'
} ) ;
2021-11-23 06:40:38 +01:00
}
2021-11-30 01:24:27 +01:00
}
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "DropdownMenu" ] , {
icon : more _vertical [ "a" /* default */ ] ,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Actions' ) ,
className : "edit-site-list-table__actions"
} , _ref2 => {
let {
onClose
} = _ref2 ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuGroup" ] , null , isRemovable && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( RenameMenuItem , {
template : template ,
onClose : onClose
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuItem" ] , {
isDestructive : true ,
onClick : ( ) => {
removeTemplate ( template ) ;
onClose ( ) ;
}
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Delete template' ) ) ) , isRevertable && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuItem" ] , {
2021-12-06 07:20:27 +01:00
info : Object ( external _wp _i18n _ [ "__" ] ) ( 'Restore template to default state' ) ,
2021-11-30 01:24:27 +01:00
onClick : ( ) => {
revertAndSaveTemplate ( ) ;
onClose ( ) ;
}
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Clear customizations' ) ) ) ;
} ) ;
2021-11-23 06:40:38 +01:00
}
2021-11-30 01:24:27 +01:00
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/plugins.js
var plugins = _ _webpack _require _ _ ( "0Ene" ) ;
2021-12-21 08:02:34 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-author-avatar.js
/ * *
* WordPress dependencies
* /
const commentAuthorAvatar = Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _primitives _ [ "SVG" ] , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _primitives _ [ "Path" ] , {
d : "M7.25 16.4371C6.16445 15.2755 5.5 13.7153 5.5 12C5.5 8.41015 8.41015 5.5 12 5.5C15.5899 5.5 18.5 8.41015 18.5 12C18.5 13.7153 17.8356 15.2755 16.75 16.4371V16C16.75 14.4812 15.5188 13.25 14 13.25L10 13.25C8.48122 13.25 7.25 14.4812 7.25 16V16.4371ZM8.75 17.6304C9.70606 18.1835 10.8161 18.5 12 18.5C13.1839 18.5 14.2939 18.1835 15.25 17.6304V16C15.25 15.3096 14.6904 14.75 14 14.75L10 14.75C9.30964 14.75 8.75 15.3096 8.75 16V17.6304ZM4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12ZM14 10C14 11.1046 13.1046 12 12 12C10.8954 12 10 11.1046 10 10C10 8.89543 10.8954 8 12 8C13.1046 8 14 8.89543 14 10Z" ,
fillRule : "evenodd" ,
clipRule : "evenodd" ,
fill : "black"
} ) ) ;
/* harmony default export */ var comment _author _avatar = ( commentAuthorAvatar ) ;
2022-02-17 20:18:25 +01:00
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/globe.js
var globe = _ _webpack _require _ _ ( "K8zD" ) ;
2021-11-30 01:24:27 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/list/added-by.js
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
const TEMPLATE _POST _TYPE _NAMES = [ 'wp_template' , 'wp_template_part' ] ;
function CustomizedTooltip ( _ref ) {
2021-11-23 06:40:38 +01:00
let {
2021-11-30 01:24:27 +01:00
isCustomized ,
children
} = _ref ;
if ( ! isCustomized ) {
return children ;
}
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Tooltip" ] , {
text : Object ( external _wp _i18n _ [ "__" ] ) ( 'This template has been customized' )
} , children ) ;
}
2022-02-17 20:18:25 +01:00
function BaseAddedBy ( _ref2 ) {
2021-11-30 01:24:27 +01:00
let {
2022-02-17 20:18:25 +01:00
text ,
icon ,
imageUrl ,
2021-11-30 01:24:27 +01:00
isCustomized
2021-11-23 06:40:38 +01:00
} = _ref2 ;
2022-02-17 20:18:25 +01:00
const [ isImageLoaded , setIsImageLoaded ] = Object ( external _wp _element _ [ "useState" ] ) ( false ) ;
2021-11-30 01:24:27 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalHStack" ] , {
alignment : "left"
} , Object ( external _wp _element _ [ "createElement" ] ) ( CustomizedTooltip , {
isCustomized : isCustomized
2022-02-17 20:18:25 +01:00
} , imageUrl ? Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : classnames _default ( ) ( 'edit-site-list-added-by__avatar' , {
'is-loaded' : isImageLoaded
} )
} , Object ( external _wp _element _ [ "createElement" ] ) ( "img" , {
onLoad : ( ) => setIsImageLoaded ( true ) ,
alt : "" ,
src : imageUrl
} ) ) : Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
2021-11-30 01:24:27 +01:00
className : classnames _default ( ) ( 'edit-site-list-added-by__icon' , {
'is-customized' : isCustomized
} )
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Icon" ] , {
2022-02-17 20:18:25 +01:00
icon : icon
} ) ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "span" , null , text ) ) ;
2021-11-30 01:24:27 +01:00
}
2022-02-17 20:18:25 +01:00
function AddedByTheme ( _ref3 ) {
var _theme$name ;
2021-11-30 01:24:27 +01:00
let {
slug ,
isCustomized
} = _ref3 ;
2022-02-17 20:18:25 +01:00
const theme = Object ( external _wp _data _ [ "useSelect" ] ) ( select => select ( external _wp _coreData _ [ "store" ] ) . getTheme ( slug ) , [ slug ] ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( BaseAddedBy , {
icon : layout [ "a" /* default */ ] ,
text : ( theme === null || theme === void 0 ? void 0 : ( _theme$name = theme . name ) === null || _theme$name === void 0 ? void 0 : _theme$name . rendered ) || slug ,
isCustomized : isCustomized
} ) ;
}
function AddedByPlugin ( _ref4 ) {
let {
slug ,
isCustomized
} = _ref4 ;
2021-11-30 01:24:27 +01:00
const plugin = Object ( external _wp _data _ [ "useSelect" ] ) ( select => select ( external _wp _coreData _ [ "store" ] ) . getPlugin ( slug ) , [ slug ] ) ;
2022-02-17 20:18:25 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( BaseAddedBy , {
icon : plugins [ "a" /* default */ ] ,
text : ( plugin === null || plugin === void 0 ? void 0 : plugin . name ) || slug ,
2021-11-30 01:24:27 +01:00
isCustomized : isCustomized
2022-02-17 20:18:25 +01:00
} ) ;
2021-11-30 01:24:27 +01:00
}
2022-02-17 20:18:25 +01:00
function AddedByAuthor ( _ref5 ) {
2021-12-21 08:02:34 +01:00
var _user$avatar _urls ;
2021-11-30 01:24:27 +01:00
let {
id
2022-02-17 20:18:25 +01:00
} = _ref5 ;
2021-11-30 01:24:27 +01:00
const user = Object ( external _wp _data _ [ "useSelect" ] ) ( select => select ( external _wp _coreData _ [ "store" ] ) . getUser ( id ) , [ id ] ) ;
2022-02-17 20:18:25 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( BaseAddedBy , {
icon : comment _author _avatar ,
imageUrl : user === null || user === void 0 ? void 0 : ( _user$avatar _urls = user . avatar _urls ) === null || _user$avatar _urls === void 0 ? void 0 : _user$avatar _urls [ 48 ] ,
text : user === null || user === void 0 ? void 0 : user . nickname
} ) ;
2021-11-30 01:24:27 +01:00
}
function AddedBySite ( ) {
const {
name ,
logoURL
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
var _getMedia ;
const {
getEntityRecord ,
getMedia
} = select ( external _wp _coreData _ [ "store" ] ) ;
const siteData = getEntityRecord ( 'root' , '__unstableBase' ) ;
return {
2022-02-17 20:18:25 +01:00
name : siteData === null || siteData === void 0 ? void 0 : siteData . name ,
2021-11-30 01:24:27 +01:00
logoURL : siteData !== null && siteData !== void 0 && siteData . site _logo ? ( _getMedia = getMedia ( siteData . site _logo ) ) === null || _getMedia === void 0 ? void 0 : _getMedia . source _url : undefined
} ;
} , [ ] ) ;
2022-02-17 20:18:25 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( BaseAddedBy , {
icon : globe [ "a" /* default */ ] ,
imageUrl : logoURL ,
text : name
} ) ;
2021-11-30 01:24:27 +01:00
}
2022-02-17 20:18:25 +01:00
function AddedBy ( _ref6 ) {
2021-11-30 01:24:27 +01:00
let {
templateType ,
template
2022-02-17 20:18:25 +01:00
} = _ref6 ;
2021-11-30 01:24:27 +01:00
if ( ! template ) {
return ;
}
if ( TEMPLATE _POST _TYPE _NAMES . includes ( templateType ) ) {
// Template originally provided by a theme, but customized by a user.
// Templates originally didn't have the 'origin' field so identify
// older customized templates by checking for no origin and a 'theme'
// or 'custom' source.
if ( template . has _theme _file && ( template . origin === 'theme' || ! template . origin && [ 'theme' , 'custom' ] . includes ( template . source ) ) ) {
return Object ( external _wp _element _ [ "createElement" ] ) ( AddedByTheme , {
slug : template . theme ,
isCustomized : template . source === 'custom'
} ) ;
} // Template originally provided by a plugin, but customized by a user.
if ( template . has _theme _file && template . origin === 'plugin' ) {
return Object ( external _wp _element _ [ "createElement" ] ) ( AddedByPlugin , {
slug : template . theme ,
isCustomized : template . source === 'custom'
} ) ;
} // Template was created from scratch, but has no author. Author support
// was only added to templates in WordPress 5.9. Fallback to showing the
// site logo and title.
if ( ! template . has _theme _file && template . source === 'custom' && ! template . author ) {
return Object ( external _wp _element _ [ "createElement" ] ) ( AddedBySite , null ) ;
}
} // Simply show the author for templates created from scratch that have an
// author or for any other post type.
return Object ( external _wp _element _ [ "createElement" ] ) ( AddedByAuthor , {
id : template . author
} ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/list/table.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2021-12-14 02:57:26 +01:00
2021-11-30 01:24:27 +01:00
function Table ( _ref ) {
let {
templateType
} = _ref ;
2021-11-23 06:40:38 +01:00
const {
templates ,
isLoading ,
postType
2021-11-09 03:17:17 +01:00
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
const {
2021-11-23 06:40:38 +01:00
getEntityRecords ,
hasFinishedResolution ,
getPostType
2021-11-09 03:17:17 +01:00
} = select ( external _wp _coreData _ [ "store" ] ) ;
return {
2021-11-30 01:24:27 +01:00
templates : getEntityRecords ( 'postType' , templateType , {
per _page : - 1
} ) ,
isLoading : ! hasFinishedResolution ( 'getEntityRecords' , [ 'postType' , templateType , {
per _page : - 1
} ] ) ,
2021-11-23 06:40:38 +01:00
postType : getPostType ( templateType )
2021-11-09 03:17:17 +01:00
} ;
2021-11-23 06:40:38 +01:00
} , [ templateType ] ) ;
2021-11-09 03:17:17 +01:00
2021-11-23 06:40:38 +01:00
if ( ! templates || isLoading ) {
return null ;
}
2021-11-09 03:17:17 +01:00
2021-11-23 06:40:38 +01:00
if ( ! templates . length ) {
var _postType$labels , _postType$labels$name ;
2021-11-09 03:17:17 +01:00
2021-11-23 06:40:38 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( "div" , null , Object ( external _wp _i18n _ [ "sprintf" ] ) ( // translators: The template type name, should be either "templates" or "template parts".
Object ( external _wp _i18n _ [ "__" ] ) ( 'No %s found.' ) , postType === null || postType === void 0 ? void 0 : ( _postType$labels = postType . labels ) === null || _postType$labels === void 0 ? void 0 : ( _postType$labels$name = _postType$labels . name ) === null || _postType$labels$name === void 0 ? void 0 : _postType$labels$name . toLowerCase ( ) ) ) ;
2021-11-09 03:17:17 +01:00
}
2021-11-30 01:24:27 +01:00
return ( // These explicit aria roles are needed for Safari.
// See https://developer.mozilla.org/en-US/docs/Web/CSS/display#tables
Object ( external _wp _element _ [ "createElement" ] ) ( "table" , {
className : "edit-site-list-table" ,
role : "table"
} , Object ( external _wp _element _ [ "createElement" ] ) ( "thead" , null , Object ( external _wp _element _ [ "createElement" ] ) ( "tr" , {
className : "edit-site-list-table-head" ,
role : "row"
} , Object ( external _wp _element _ [ "createElement" ] ) ( "th" , {
className : "edit-site-list-table-column" ,
role : "columnheader"
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Template' ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "th" , {
className : "edit-site-list-table-column" ,
role : "columnheader"
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Added by' ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "th" , {
className : "edit-site-list-table-column" ,
role : "columnheader"
2021-12-06 07:20:27 +01:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "VisuallyHidden" ] , null , Object ( external _wp _i18n _ [ "__" ] ) ( 'Actions' ) ) ) ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "tbody" , null , templates . map ( template => {
var _template$title ;
return Object ( external _wp _element _ [ "createElement" ] ) ( "tr" , {
key : template . id ,
className : "edit-site-list-table-row" ,
role : "row"
} , Object ( external _wp _element _ [ "createElement" ] ) ( "td" , {
className : "edit-site-list-table-column" ,
role : "cell"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalHeading" ] , {
level : 4
2021-12-14 02:57:26 +01:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( Link , {
params : {
2021-12-06 07:20:27 +01:00
postId : template . id ,
postType : template . type
2021-12-14 02:57:26 +01:00
}
2021-12-06 07:20:27 +01:00
} , ( ( _template$title = template . title ) === null || _template$title === void 0 ? void 0 : _template$title . rendered ) || template . slug ) ) , template . description ) , Object ( external _wp _element _ [ "createElement" ] ) ( "td" , {
className : "edit-site-list-table-column" ,
role : "cell"
} , Object ( external _wp _element _ [ "createElement" ] ) ( AddedBy , {
templateType : templateType ,
template : template
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "td" , {
className : "edit-site-list-table-column" ,
role : "cell"
} , Object ( external _wp _element _ [ "createElement" ] ) ( Actions , {
template : template
} ) ) ) ;
} ) ) )
2021-11-30 01:24:27 +01:00
) ;
2021-11-09 03:17:17 +01:00
}
2021-11-23 06:40:38 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/list/index.js
2021-11-30 01:24:27 +01:00
/ * *
* External dependencies
* /
2021-11-23 06:40:38 +01:00
/ * *
* WordPress dependencies
* /
2021-11-30 01:24:27 +01:00
2021-11-23 06:40:38 +01:00
/ * *
* Internal dependencies
* /
2021-11-30 01:24:27 +01:00
2021-11-23 06:40:38 +01:00
2021-12-14 02:57:26 +01:00
function List ( ) {
var _postType$labels , _postType$labels2 ;
const {
params : {
postType : templateType
}
} = useLocation ( ) ;
2021-11-23 06:40:38 +01:00
useRegisterShortcuts ( ) ;
const {
previousShortcut ,
2021-11-30 01:24:27 +01:00
nextShortcut ,
isNavigationOpen
2021-11-23 06:40:38 +01:00
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
return {
previousShortcut : select ( external _wp _keyboardShortcuts _ [ "store" ] ) . getAllShortcutKeyCombinations ( 'core/edit-site/previous-region' ) ,
2021-11-30 01:24:27 +01:00
nextShortcut : select ( external _wp _keyboardShortcuts _ [ "store" ] ) . getAllShortcutKeyCombinations ( 'core/edit-site/next-region' ) ,
isNavigationOpen : select ( store ) . isNavigationOpened ( )
2021-11-23 06:40:38 +01:00
} ;
} , [ ] ) ;
2021-12-14 02:57:26 +01:00
const postType = Object ( external _wp _data _ [ "useSelect" ] ) ( select => select ( external _wp _coreData _ [ "store" ] ) . getPostType ( templateType ) , [ templateType ] ) ;
useTitle ( postType === null || postType === void 0 ? void 0 : ( _postType$labels = postType . labels ) === null || _postType$labels === void 0 ? void 0 : _postType$labels . name ) ; // `postType` could load in asynchronously. Only provide the detailed region labels if
2021-11-23 06:40:38 +01:00
// the postType has loaded, otherwise `InterfaceSkeleton` will fallback to the defaults.
2021-12-14 02:57:26 +01:00
const itemsListLabel = postType === null || postType === void 0 ? void 0 : ( _postType$labels2 = postType . labels ) === null || _postType$labels2 === void 0 ? void 0 : _postType$labels2 . items _list ;
2021-11-23 06:40:38 +01:00
const detailedRegionLabels = postType ? {
header : Object ( external _wp _i18n _ [ "sprintf" ] ) ( // translators: %s - the name of the page, 'Header' as in the header area of that page.
Object ( external _wp _i18n _ [ "__" ] ) ( '%s - Header' ) , itemsListLabel ) ,
body : Object ( external _wp _i18n _ [ "sprintf" ] ) ( // translators: %s - the name of the page, 'Content' as in the content area of that page.
Object ( external _wp _i18n _ [ "__" ] ) ( '%s - Content' ) , itemsListLabel )
} : undefined ;
return Object ( external _wp _element _ [ "createElement" ] ) ( build _module [ "e" /* InterfaceSkeleton */ ] , {
2021-11-30 01:24:27 +01:00
className : classnames _default ( ) ( 'edit-site-list' , {
'is-navigation-open' : isNavigationOpen
} ) ,
2021-11-23 06:40:38 +01:00
labels : {
drawer : Object ( external _wp _i18n _ [ "__" ] ) ( 'Navigation Sidebar' ) ,
... detailedRegionLabels
} ,
header : Object ( external _wp _element _ [ "createElement" ] ) ( header _Header , {
templateType : templateType
} ) ,
2021-12-14 02:57:26 +01:00
drawer : Object ( external _wp _element _ [ "createElement" ] ) ( navigation _sidebar . Slot , null ) ,
2021-11-30 01:24:27 +01:00
notices : Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "EditorSnackbars" ] , null ) ,
2021-12-14 02:57:26 +01:00
content : Object ( external _wp _element _ [ "createElement" ] ) ( Table , {
2021-11-23 06:40:38 +01:00
templateType : templateType
2021-12-14 02:57:26 +01:00
} ) ,
2021-11-23 06:40:38 +01:00
shortcuts : {
previous : previousShortcut ,
next : nextShortcut
}
} ) ;
}
2021-11-09 03:17:17 +01:00
2021-12-14 02:57:26 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/utils/get-is-list-page.js
/ * *
* Returns if the params match the list page route .
*
* @ param { Object } params The search params .
* @ param { string } params . postId The post ID .
* @ param { string } params . postType The post type .
* @ return { boolean } Is list page or not .
* /
function getIsListPage ( _ref ) {
let {
postId ,
postType
} = _ref ;
return ! ! ( ! postId && postType ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/app/index.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
function EditSiteApp ( _ref ) {
let {
reboot
} = _ref ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "SlotFillProvider" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "UnsavedChangesWarning" ] , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( Routes , null , _ref2 => {
let {
params
} = _ref2 ;
const isListPage = getIsListPage ( params ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , isListPage ? Object ( external _wp _element _ [ "createElement" ] ) ( List , null ) : Object ( external _wp _element _ [ "createElement" ] ) ( editor , {
onError : reboot
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( navigation _sidebar // Open the navigation sidebar by default when in the list page.
, {
isDefaultOpen : ! ! isListPage ,
activeTemplateType : isListPage ? params . postType : undefined
} ) ) ;
} ) ) ;
}
2022-02-17 20:18:25 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/routes/redirect-to-homepage.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
function getNeedsHomepageRedirect ( params ) {
const {
postType
} = params ;
return ! getIsListPage ( params ) && ! [ 'post' , 'page' , 'wp_template' , 'wp_template_part' ] . includes ( postType ) ;
}
/ * *
* Returns the postType and postId of the default homepage .
*
* @ param { string } siteUrl The URL of the site .
* @ return { Object } An object containing the postType and postId properties
* or ` undefined ` if a homepage could not be found .
* /
async function getHomepageParams ( siteUrl ) {
const siteSettings = await external _wp _apiFetch _default ( ) ( {
path : '/wp/v2/settings'
} ) ;
if ( ! siteSettings ) {
throw new Error ( '`getHomepageParams`: unable to load site settings.' ) ;
}
const {
show _on _front : showOnFront ,
page _on _front : frontpageId
} = siteSettings ; // If the user has set a page as the homepage, use those details.
if ( showOnFront === 'page' ) {
return {
postType : 'page' ,
postId : frontpageId
} ;
} // Else get the home template.
// This matches the logic in `__experimentalGetTemplateForLink`.
// (packages/core-data/src/resolvers.js)
const template = await window . fetch ( Object ( external _wp _url _ [ "addQueryArgs" ] ) ( siteUrl , {
'_wp-find-template' : true
} ) ) . then ( response => {
if ( ! response . ok ) {
throw new Error ( ` \` getHomepageParams \` : HTTP status error, ${ response . status } ${ response . statusText } ` ) ;
}
return response . json ( ) ;
} ) . then ( _ref => {
let {
data
} = _ref ;
if ( data . message ) {
throw new Error ( ` \` getHomepageParams \` : REST API error, ${ data . message } ` ) ;
}
return data ;
} ) ;
if ( ! ( template !== null && template !== void 0 && template . id ) ) {
throw new Error ( '`getHomepageParams`: unable to find home template.' ) ;
}
return {
postType : 'wp_template' ,
postId : template . id
} ;
}
async function redirectToHomepage ( siteUrl ) {
const searchParams = new URLSearchParams ( utils _history . location . search ) ;
const params = Object . fromEntries ( searchParams . entries ( ) ) ;
if ( getNeedsHomepageRedirect ( params ) ) {
const homepageParams = await getHomepageParams ( siteUrl ) ;
if ( homepageParams ) {
utils _history . replace ( homepageParams ) ;
}
}
}
2021-11-09 03:17:17 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar/plugin-sidebar/index.js
/ * *
* WordPress 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 :
*
* ` ` ` js
* wp . data . dispatch ( 'core/edit-site' ) . openGeneralSidebar ( 'plugin-name/sidebar-name' ) ;
* ` ` `
*
* @ see PluginSidebarMoreMenuItem
*
* @ 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 .
* @ 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 el = wp . element . createElement ;
* var PanelBody = wp . components . PanelBody ;
* var PluginSidebar = wp . editSite . PluginSidebar ;
* var moreIcon = wp . element . createElement ( 'svg' ) ; //... svg element.
*
* function MyPluginSidebar ( ) {
* return el (
* PluginSidebar ,
* {
* name : 'my-sidebar' ,
* title : 'My sidebar title' ,
* icon : moreIcon ,
* } ,
* el (
* PanelBody ,
* { } ,
* _ _ ( 'My sidebar content' )
* )
* ) ;
* }
* ` ` `
*
* @ example
* ` ` ` jsx
* // Using ESNext syntax
* import { _ _ } from '@wordpress/i18n' ;
* import { PanelBody } from '@wordpress/components' ;
* import { PluginSidebar } from '@wordpress/edit-site' ;
* import { more } from '@wordpress/icons' ;
*
* const MyPluginSidebar = ( ) => (
* < PluginSidebar
* name = "my-sidebar"
* title = "My sidebar title"
* icon = { more }
* >
* < 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 >
* ) ;
* ` ` `
* /
2021-11-15 13:50:17 +01:00
function PluginSidebarEditSite ( _ref ) {
let {
className ,
... props
} = _ref ;
2021-11-09 03:17:17 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( build _module [ "b" /* ComplementaryArea */ ] , Object ( esm _extends [ "a" /* default */ ] ) ( {
panelClassName : className ,
className : "edit-site-sidebar" ,
scope : "core/edit-site"
} , props ) ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/header/plugin-sidebar-more-menu-item/index.js
/ * *
* WordPress dependencies
* /
/ * *
* 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 .
*
* @ 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 .
* @ 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 . editSite . PluginSidebarMoreMenuItem ;
* var moreIcon = wp . element . createElement ( 'svg' ) ; //... svg element.
*
* function MySidebarMoreMenuItem ( ) {
* return wp . element . createElement (
* PluginSidebarMoreMenuItem ,
* {
* target : 'my-sidebar' ,
* icon : moreIcon ,
* } ,
* _ _ ( 'My sidebar title' )
* )
* }
* ` ` `
*
* @ example
* ` ` ` jsx
* // Using ESNext syntax
* import { _ _ } from '@wordpress/i18n' ;
* import { PluginSidebarMoreMenuItem } from '@wordpress/edit-site' ;
* 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 .
* /
function PluginSidebarMoreMenuItem ( props ) {
return Object ( external _wp _element _ [ "createElement" ] ) ( build _module [ "c" /* ComplementaryAreaMoreMenuItem */ ] // Menu item is marked with unstable prop for backward compatibility.
// @see https://github.com/WordPress/gutenberg/issues/14457
, Object ( esm _extends [ "a" /* default */ ] ) ( {
_ _unstableExplicitMenuItem : true ,
scope : "core/edit-site"
} , props ) ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/header/plugin-more-menu-item/index.js
/ * *
* WordPress dependencies
* /
/ * *
* 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 .
*
* @ 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 .
* @ 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.
* @ param { Function } [ props . onClick = noop ] The callback function to be executed when the user clicks the menu item .
* @ param { ... * } [ props . other ] Any additional props are passed through to the underlying [ Button ] ( / p a c k a g e s / c o m p o n e n t s / s r c / b u t t o n / R E A D M E . m d ) c o m p o n e n t .
*
* @ example
* ` ` ` js
* // Using ES5 syntax
* var _ _ = wp . i18n . _ _ ;
* var PluginMoreMenuItem = wp . editSite . 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-site' ;
* 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 .
* /
/* harmony default export */ var plugin _more _menu _item = ( Object ( external _wp _compose _ [ "compose" ] ) ( Object ( external _wp _plugins _ [ "withPluginContext" ] ) ( ( context , ownProps ) => {
return {
icon : ownProps . icon || context . icon ,
name : 'core/edit-site/plugin-more-menu'
} ;
} ) ) ( build _module [ "a" /* ActionItem */ ] ) ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/index.js
/ * *
* WordPress dependencies
* /
2021-11-23 06:40:38 +01:00
2021-11-30 01:24:27 +01:00
2021-12-14 02:57:26 +01:00
2022-02-17 20:18:25 +01:00
2021-11-09 03:17:17 +01:00
/ * *
* Internal dependencies
* /
2021-11-23 06:40:38 +01:00
2022-02-17 20:18:25 +01:00
2021-11-09 03:17:17 +01: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 { Element } target DOM node in which editor is rendered .
* @ param { ? Object } settings Editor settings object .
* /
2022-02-17 20:18:25 +01:00
async function reinitializeEditor ( target , settings ) {
// The site editor relies on `postType` and `postId` params in the URL to
// define what's being edited. When visiting via the dashboard link, these
// won't be present. Do a client side redirect to the 'homepage' if that's
// the case.
try {
await redirectToHomepage ( settings . siteUrl ) ;
} catch ( error ) {
Object ( external _wp _element _ [ "render" ] ) ( Object ( external _wp _element _ [ "createElement" ] ) ( ErrorBoundaryWarning , {
message : Object ( external _wp _i18n _ [ "__" ] ) ( 'The editor is unable to find a block template for the homepage.' ) ,
error : error ,
dashboardLink : "index.php"
} ) , target ) ;
return ;
} // This will be a no-op if the target doesn't have any React nodes.
2021-11-09 03:17:17 +01:00
Object ( external _wp _element _ [ "unmountComponentAtNode" ] ) ( target ) ;
2021-12-14 02:57:26 +01:00
const reboot = reinitializeEditor . bind ( null , target , settings ) ; // We dispatch actions and update the store synchronously before rendering
// so that we won't trigger unnecessary re-renders with useEffect.
{
Object ( external _wp _data _ [ "dispatch" ] ) ( store ) . updateSettings ( settings ) ; // Keep the defaultTemplateTypes in the core/editor settings too,
// so that they can be selected with core/editor selectors in any editor.
// This is needed because edit-site doesn't initialize with EditorProvider,
// which internally uses updateEditorSettings as well.
Object ( external _wp _data _ [ "dispatch" ] ) ( external _wp _editor _ [ "store" ] ) . updateEditorSettings ( {
defaultTemplateTypes : settings . defaultTemplateTypes ,
defaultTemplatePartAreas : settings . defaultTemplatePartAreas
} ) ;
const isLandingOnListPage = getIsListPage ( Object ( external _wp _url _ [ "getQueryArgs" ] ) ( window . location . href ) ) ;
if ( isLandingOnListPage ) {
// Default the navigation panel to be opened when we're in a bigger
// screen and land in the list screen.
Object ( external _wp _data _ [ "dispatch" ] ) ( store ) . setIsNavigationPanelOpened ( Object ( external _wp _data _ [ "select" ] ) ( external _wp _viewport _ [ "store" ] ) . isViewportMatch ( 'medium' ) ) ;
}
}
Object ( external _wp _element _ [ "render" ] ) ( Object ( external _wp _element _ [ "createElement" ] ) ( EditSiteApp , {
reboot : reboot
2021-11-09 03:17:17 +01:00
} ) , target ) ;
}
/ * *
* Initializes the site editor screen .
*
* @ param { string } id ID of the root element to render the screen in .
* @ param { Object } settings Editor settings .
* /
2021-11-23 06:40:38 +01:00
function initializeEditor ( id , settings ) {
2021-11-09 03:17:17 +01:00
settings . _ _experimentalFetchLinkSuggestions = ( search , searchOptions ) => Object ( external _wp _coreData _ [ "__experimentalFetchLinkSuggestions" ] ) ( search , searchOptions , settings ) ;
settings . _ _experimentalFetchRichUrlData = external _wp _coreData _ [ "__experimentalFetchUrlData" ] ;
settings . _ _experimentalSpotlightEntityBlocks = [ 'core/template-part' ] ;
const target = document . getElementById ( id ) ;
Object ( external _wp _data _ [ "dispatch" ] ) ( external _wp _blocks _ [ "store" ] ) . _ _experimentalReapplyBlockTypeFilters ( ) ;
Object ( external _wp _blockLibrary _ [ "registerCoreBlocks" ] ) ( ) ;
if ( false ) { }
2021-12-14 02:57:26 +01:00
reinitializeEditor ( target , settings ) ;
2021-11-23 06:40:38 +01:00
}
2021-11-09 03:17:17 +01:00
2022-02-17 20:18:25 +01:00
/***/ } ) ,
/***/ "K+tz" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( "GRId" ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( "Tqx9" ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
/ * *
* WordPress dependencies
* /
const external = Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "SVG" ] , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "Path" ] , {
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"
} ) ) ;
/* harmony default export */ _ _webpack _exports _ _ [ "a" ] = ( external ) ;
2021-11-09 03:17:17 +01:00
/***/ } ) ,
/***/ "K2cm" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( "GRId" ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( "Tqx9" ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
/ * *
* WordPress dependencies
* /
const redo = Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "SVG" ] , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "Path" ] , {
d : "M15.6 6.5l-1.1 1 2.9 3.3H8c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.3-.5h9.2L14.5 15l1.1 1.1 4.6-4.6-4.6-5z"
} ) ) ;
/* harmony default export */ _ _webpack _exports _ _ [ "a" ] = ( redo ) ;
2022-02-17 20:18:25 +01:00
/***/ } ) ,
/***/ "K8zD" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( "GRId" ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( "Tqx9" ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
/ * *
* WordPress dependencies
* /
const globe = Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "SVG" ] , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "Path" ] , {
d : "M12 3.3c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8s-4-8.8-8.8-8.8zm6.5 5.5h-2.6C15.4 7.3 14.8 6 14 5c2 .6 3.6 2 4.5 3.8zm.7 3.2c0 .6-.1 1.2-.2 1.8h-2.9c.1-.6.1-1.2.1-1.8s-.1-1.2-.1-1.8H19c.2.6.2 1.2.2 1.8zM12 18.7c-1-.7-1.8-1.9-2.3-3.5h4.6c-.5 1.6-1.3 2.9-2.3 3.5zm-2.6-4.9c-.1-.6-.1-1.1-.1-1.8 0-.6.1-1.2.1-1.8h5.2c.1.6.1 1.1.1 1.8s-.1 1.2-.1 1.8H9.4zM4.8 12c0-.6.1-1.2.2-1.8h2.9c-.1.6-.1 1.2-.1 1.8 0 .6.1 1.2.1 1.8H5c-.2-.6-.2-1.2-.2-1.8zM12 5.3c1 .7 1.8 1.9 2.3 3.5H9.7c.5-1.6 1.3-2.9 2.3-3.5zM10 5c-.8 1-1.4 2.3-1.8 3.8H5.5C6.4 7 8 5.6 10 5zM5.5 15.3h2.6c.4 1.5 1 2.8 1.8 3.7-1.8-.6-3.5-2-4.4-3.7zM14 19c.8-1 1.4-2.2 1.8-3.7h2.6C17.6 17 16 18.4 14 19z"
} ) ) ;
/* harmony default export */ _ _webpack _exports _ _ [ "a" ] = ( globe ) ;
2021-11-09 03:17:17 +01:00
/***/ } ) ,
/***/ "K9lf" :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = window [ "wp" ] [ "compose" ] ; } ( ) ) ;
/***/ } ) ,
/***/ "KEfo" :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = window [ "wp" ] [ "viewport" ] ; } ( ) ) ;
/***/ } ) ,
/***/ "Mmq9" :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = window [ "wp" ] [ "url" ] ; } ( ) ) ;
/***/ } ) ,
/***/ "NWDH" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( "GRId" ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( "Tqx9" ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
/ * *
* WordPress dependencies
* /
const chevronDown = Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "SVG" ] , {
viewBox : "0 0 24 24" ,
xmlns : "http://www.w3.org/2000/svg"
} , Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "Path" ] , {
d : "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"
} ) ) ;
/* harmony default export */ _ _webpack _exports _ _ [ "a" ] = ( chevronDown ) ;
/***/ } ) ,
/***/ "Ntru" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( "GRId" ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( "Tqx9" ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
/ * *
* WordPress dependencies
* /
const undo = Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "SVG" ] , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "Path" ] , {
d : "M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"
} ) ) ;
/* harmony default export */ _ _webpack _exports _ _ [ "a" ] = ( undo ) ;
2021-11-30 01:24:27 +01:00
/***/ } ) ,
/***/ "OE6V" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( "GRId" ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( "Tqx9" ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
/ * *
* WordPress dependencies
* /
const symbolFilled = Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "SVG" ] , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "Path" ] , {
d : "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"
} ) ) ;
/* harmony default export */ _ _webpack _exports _ _ [ "a" ] = ( symbolFilled ) ;
2021-11-09 03:17:17 +01:00
/***/ } ) ,
/***/ "OzlF" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( "GRId" ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( "Tqx9" ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
/ * *
* WordPress dependencies
* /
const listView = Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "SVG" ] , {
viewBox : "0 0 24 24" ,
xmlns : "http://www.w3.org/2000/svg"
} , Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "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 */ _ _webpack _exports _ _ [ "a" ] = ( listView ) ;
/***/ } ) ,
/***/ "Q4Sy" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( "GRId" ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( "Tqx9" ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
/ * *
* WordPress dependencies
* /
const plus = Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "SVG" ] , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "Path" ] , {
d : "M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"
} ) ) ;
/* harmony default export */ _ _webpack _exports _ _ [ "a" ] = ( plus ) ;
/***/ } ) ,
/***/ "QyPg" :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = window [ "wp" ] [ "blockLibrary" ] ; } ( ) ) ;
/***/ } ) ,
/***/ "RMJe" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( "GRId" ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( "Tqx9" ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
/ * *
* WordPress dependencies
* /
const check = Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "SVG" ] , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "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 */ _ _webpack _exports _ _ [ "a" ] = ( check ) ;
/***/ } ) ,
/***/ "RxS6" :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = window [ "wp" ] [ "keycodes" ] ; } ( ) ) ;
/***/ } ) ,
/***/ "TSYQ" :
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
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 { }
} ( ) ) ;
/***/ } ) ,
/***/ "Tqx9" :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = window [ "wp" ] [ "primitives" ] ; } ( ) ) ;
/***/ } ) ,
/***/ "TvNi" :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = window [ "wp" ] [ "plugins" ] ; } ( ) ) ;
/***/ } ) ,
/***/ "U60i" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
// EXPORTS
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "b" , function ( ) { return /* reexport */ complementary _area ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "c" , function ( ) { return /* reexport */ ComplementaryAreaMoreMenuItem ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "d" , function ( ) { return /* reexport */ fullscreen _mode ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "e" , function ( ) { return /* reexport */ interface _skeleton ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "h" , function ( ) { return /* reexport */ pinned _items ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "f" , function ( ) { return /* reexport */ MoreMenuDropdown ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "g" , function ( ) { return /* reexport */ MoreMenuFeatureToggle ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return /* reexport */ action _item ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "i" , function ( ) { return /* reexport */ store ; } ) ;
// NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/store/actions.js
var actions _namespaceObject = { } ;
_ _webpack _require _ _ . r ( actions _namespaceObject ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "enableComplementaryArea" , function ( ) { return actions _enableComplementaryArea ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "disableComplementaryArea" , function ( ) { return actions _disableComplementaryArea ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "pinItem" , function ( ) { return actions _pinItem ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "unpinItem" , function ( ) { return actions _unpinItem ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "toggleFeature" , function ( ) { return actions _toggleFeature ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "setFeatureValue" , function ( ) { return setFeatureValue ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "setFeatureDefaults" , function ( ) { return setFeatureDefaults ; } ) ;
// 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 selectors _getActiveComplementaryArea ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "isItemPinned" , function ( ) { return selectors _isItemPinned ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "isFeatureActive" , function ( ) { return isFeatureActive ; } ) ;
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
var esm _extends = _ _webpack _require _ _ ( "wx14" ) ;
// EXTERNAL MODULE: external ["wp","element"]
var external _wp _element _ = _ _webpack _require _ _ ( "GRId" ) ;
// EXTERNAL MODULE: ./node_modules/classnames/index.js
var classnames = _ _webpack _require _ _ ( "TSYQ" ) ;
var classnames _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( classnames ) ;
// EXTERNAL MODULE: external ["wp","components"]
var external _wp _components _ = _ _webpack _require _ _ ( "tI+e" ) ;
// EXTERNAL MODULE: external ["wp","data"]
var external _wp _data _ = _ _webpack _require _ _ ( "1ZqX" ) ;
// EXTERNAL MODULE: external ["wp","i18n"]
var external _wp _i18n _ = _ _webpack _require _ _ ( "l3Sj" ) ;
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/check.js
var check = _ _webpack _require _ _ ( "RMJe" ) ;
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/star-filled.js
var star _filled = _ _webpack _require _ _ ( "URob" ) ;
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/star-empty.js
var star _empty = _ _webpack _require _ _ ( "Xxwi" ) ;
// EXTERNAL MODULE: external ["wp","viewport"]
var external _wp _viewport _ = _ _webpack _require _ _ ( "KEfo" ) ;
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/close-small.js
var close _small = _ _webpack _require _ _ ( "bWcr" ) ;
// EXTERNAL MODULE: external "lodash"
var external _lodash _ = _ _webpack _require _ _ ( "YLtl" ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/reducer.js
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
/ * *
* Reducer to keep tract of the active area per scope .
*
* @ param { boolean } state Previous state .
* @ param { Object } action Action object .
* @ param { string } action . type Action type .
* @ param { string } action . itemType Type of item .
* @ param { string } action . scope Item scope .
* @ param { string } action . item Item name .
*
* @ return { Object } Updated state .
* /
2021-11-15 13:50:17 +01:00
function singleEnableItems ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
let {
type ,
itemType ,
scope ,
item
} = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2021-11-09 03:17:17 +01:00
if ( type !== 'SET_SINGLE_ENABLE_ITEM' || ! itemType || ! scope ) {
return state ;
}
return { ... state ,
[ itemType ] : { ... state [ itemType ] ,
[ scope ] : item || null
}
} ;
}
/ * *
* Reducer keeping track of the "pinned" items per scope .
*
* @ param { boolean } state Previous state .
* @ param { Object } action Action object .
* @ param { string } action . type Action type .
* @ param { string } action . itemType Type of item .
* @ param { string } action . scope Item scope .
* @ param { string } action . item Item name .
* @ param { boolean } action . isEnable Whether the item is pinned .
*
* @ return { Object } Updated state .
* /
2021-11-15 13:50:17 +01:00
function multipleEnableItems ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
let {
type ,
itemType ,
scope ,
item ,
isEnable
} = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2021-11-09 03:17:17 +01:00
if ( type !== 'SET_MULTIPLE_ENABLE_ITEM' || ! itemType || ! scope || ! item || Object ( external _lodash _ [ "get" ] ) ( state , [ itemType , scope , item ] ) === isEnable ) {
return state ;
}
const currentTypeState = state [ itemType ] || { } ;
const currentScopeState = currentTypeState [ scope ] || { } ;
return { ... state ,
[ itemType ] : { ... currentTypeState ,
[ scope ] : { ... currentScopeState ,
[ item ] : isEnable || false
}
}
} ;
}
/ * *
* Reducer returning the defaults for user preferences .
*
* This is kept intentionally separate from the preferences
* themselves so that defaults are not persisted .
*
* @ param { Object } state Current state .
* @ param { Object } action Dispatched action .
*
* @ return { Object } Updated state .
* /
const preferenceDefaults = Object ( external _wp _data _ [ "combineReducers" ] ) ( {
2021-11-15 13:50:17 +01:00
features ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2021-11-09 03:17:17 +01:00
if ( action . type === 'SET_FEATURE_DEFAULTS' ) {
const {
scope ,
defaults
} = action ;
return { ... state ,
[ scope ] : { ... state [ scope ] ,
... defaults
}
} ;
}
return state ;
}
} ) ;
/ * *
* Reducer returning the user preferences .
*
* @ param { Object } state Current state .
* @ param { Object } action Dispatched action .
*
* @ return { Object } Updated state .
* /
const preferences = Object ( external _wp _data _ [ "combineReducers" ] ) ( {
2021-11-15 13:50:17 +01:00
features ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2021-11-09 03:17:17 +01:00
if ( action . type === 'SET_FEATURE_VALUE' ) {
const {
scope ,
featureName ,
value
} = action ;
return { ... state ,
[ scope ] : { ... state [ scope ] ,
[ featureName ] : value
}
} ;
}
return state ;
}
} ) ;
const enableItems = Object ( external _wp _data _ [ "combineReducers" ] ) ( {
singleEnableItems ,
multipleEnableItems
} ) ;
/* harmony default export */ var reducer = ( Object ( external _wp _data _ [ "combineReducers" ] ) ( {
enableItems ,
preferenceDefaults ,
preferences
} ) ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/actions.js
/ * *
* Returns an action object used in signalling that an active area should be changed .
*
* @ param { string } itemType Type of item .
* @ param { string } scope Item scope .
* @ param { string } item Item identifier .
*
* @ return { Object } Action object .
* /
function setSingleEnableItem ( itemType , scope , item ) {
return {
type : 'SET_SINGLE_ENABLE_ITEM' ,
itemType ,
scope ,
item
} ;
}
/ * *
* Returns an action object used in signalling that a complementary item should be enabled .
*
* @ param { string } scope Complementary area scope .
* @ param { string } area Area identifier .
*
* @ return { Object } Action object .
* /
function actions _enableComplementaryArea ( scope , area ) {
return setSingleEnableItem ( 'complementaryArea' , scope , area ) ;
}
/ * *
* Returns an action object used in signalling that the complementary area of a given scope should be disabled .
*
* @ param { string } scope Complementary area scope .
*
* @ return { Object } Action object .
* /
function actions _disableComplementaryArea ( scope ) {
return setSingleEnableItem ( 'complementaryArea' , scope , undefined ) ;
}
/ * *
* Returns an action object to make an area enabled / disabled .
*
* @ param { string } itemType Type of item .
* @ param { string } scope Item scope .
* @ param { string } item Item identifier .
* @ param { boolean } isEnable Boolean indicating if an area should be pinned or not .
*
* @ return { Object } Action object .
* /
function setMultipleEnableItem ( itemType , scope , item , isEnable ) {
return {
type : 'SET_MULTIPLE_ENABLE_ITEM' ,
itemType ,
scope ,
item ,
isEnable
} ;
}
/ * *
* Returns an action object used in signalling that an item should be pinned .
*
* @ param { string } scope Item scope .
* @ param { string } itemId Item identifier .
*
* @ return { Object } Action object .
* /
function actions _pinItem ( scope , itemId ) {
return setMultipleEnableItem ( 'pinnedItems' , scope , itemId , true ) ;
}
/ * *
* Returns an action object used in signalling that an item should be unpinned .
*
* @ param { string } scope Item scope .
* @ param { string } itemId Item identifier .
*
* @ return { Object } Action object .
* /
function actions _unpinItem ( scope , itemId ) {
return setMultipleEnableItem ( 'pinnedItems' , scope , itemId , 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 actions _toggleFeature ( scope , featureName ) {
2021-11-15 13:50:17 +01:00
return function ( _ref ) {
let {
select ,
dispatch
} = _ref ;
2021-11-09 03:17:17 +01:00
const currentValue = select . isFeatureActive ( scope , featureName ) ;
dispatch . setFeatureValue ( scope , featureName , ! currentValue ) ;
} ;
}
/ * *
* 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 {
type : 'SET_FEATURE_VALUE' ,
scope ,
featureName ,
value : ! ! 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 {
type : 'SET_FEATURE_DEFAULTS' ,
scope ,
defaults
} ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/selectors.js
/ * *
* External dependencies
* /
/ * *
* Returns the item that is enabled in a given scope .
*
* @ param { Object } state Global application state .
* @ param { string } itemType Type of item .
* @ param { string } scope Item scope .
*
* @ return { ? string | null } The item that is enabled in the passed scope and type .
* /
function getSingleEnableItem ( state , itemType , scope ) {
return Object ( external _lodash _ [ "get" ] ) ( state . enableItems . singleEnableItems , [ itemType , scope ] ) ;
}
/ * *
* 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 .
* /
function selectors _getActiveComplementaryArea ( state , scope ) {
return getSingleEnableItem ( state , 'complementaryArea' , scope ) ;
}
/ * *
* Returns a boolean indicating if an item is enabled or not in a given scope .
*
* @ param { Object } state Global application state .
* @ param { string } itemType Type of item .
* @ param { string } scope Scope .
* @ param { string } item Item to check .
*
* @ return { boolean | undefined } True if the item is enabled , false otherwise if the item is explicitly disabled , and undefined if there is no information for that item .
* /
function isMultipleEnabledItemEnabled ( state , itemType , scope , item ) {
return Object ( external _lodash _ [ "get" ] ) ( state . enableItems . multipleEnableItems , [ itemType , scope , item ] ) ;
}
/ * *
* 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 .
* /
function selectors _isItemPinned ( state , scope , item ) {
return isMultipleEnabledItemEnabled ( state , 'pinnedItems' , scope , item ) !== false ;
}
/ * *
* 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 ?
* /
function isFeatureActive ( state , scope , featureName ) {
var _state$preferences$fe , _state$preferenceDefa ;
const featureValue = ( _state$preferences$fe = state . preferences . features [ scope ] ) === null || _state$preferences$fe === void 0 ? void 0 : _state$preferences$fe [ featureName ] ;
const defaultedFeatureValue = featureValue !== undefined ? featureValue : ( _state$preferenceDefa = state . preferenceDefaults . features [ scope ] ) === null || _state$preferenceDefa === void 0 ? void 0 : _state$preferenceDefa [ featureName ] ;
return ! ! defaultedFeatureValue ;
}
// 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
* /
/ * *
* Store definition for the interface namespace .
*
* @ see https : //github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
*
* @ type { Object }
* /
const store = Object ( external _wp _data _ [ "createReduxStore" ] ) ( STORE _NAME , {
reducer : reducer ,
actions : actions _namespaceObject ,
selectors : selectors _namespaceObject ,
persist : [ 'enableItems' , 'preferences' ] ,
_ _experimentalUseThunks : true
} ) ; // 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.
Object ( external _wp _data _ [ "registerStore" ] ) ( STORE _NAME , {
reducer : reducer ,
actions : actions _namespaceObject ,
selectors : selectors _namespaceObject ,
persist : [ 'enableItems' , 'preferences' ] ,
_ _experimentalUseThunks : true
} ) ;
// EXTERNAL MODULE: external ["wp","plugins"]
var external _wp _plugins _ = _ _webpack _require _ _ ( "TvNi" ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area-context/index.js
/ * *
* WordPress dependencies
* /
/* harmony default export */ var complementary _area _context = ( Object ( external _wp _plugins _ [ "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
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2021-11-15 13:50:17 +01:00
function ComplementaryAreaToggle ( _ref ) {
let {
as = external _wp _components _ [ "Button" ] ,
scope ,
identifier ,
icon ,
selectedIcon ,
... props
} = _ref ;
2021-11-09 03:17:17 +01:00
const ComponentToUse = as ;
const isSelected = Object ( external _wp _data _ [ "useSelect" ] ) ( select => select ( store ) . getActiveComplementaryArea ( scope ) === identifier , [ identifier ] ) ;
const {
enableComplementaryArea ,
disableComplementaryArea
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( ComponentToUse , Object ( esm _extends [ "a" /* default */ ] ) ( {
icon : selectedIcon && isSelected ? selectedIcon : icon ,
onClick : ( ) => {
if ( isSelected ) {
disableComplementaryArea ( scope ) ;
} else {
enableComplementaryArea ( scope , identifier ) ;
}
}
} , Object ( external _lodash _ [ "omit" ] ) ( props , [ 'name' ] ) ) ) ;
}
/* harmony default export */ var complementary _area _toggle = ( complementary _area _context ( ComplementaryAreaToggle ) ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area-header/index.js
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2021-11-15 13:50:17 +01:00
const ComplementaryAreaHeader = _ref => {
let {
smallScreenTitle ,
children ,
className ,
toggleButtonProps
} = _ref ;
2021-11-09 03:17:17 +01:00
const toggleButton = Object ( external _wp _element _ [ "createElement" ] ) ( complementary _area _toggle , Object ( esm _extends [ "a" /* default */ ] ) ( {
icon : close _small [ "a" /* default */ ]
} , toggleButtonProps ) ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "components-panel__header interface-complementary-area-header__small"
} , smallScreenTitle && Object ( external _wp _element _ [ "createElement" ] ) ( "span" , {
className : "interface-complementary-area-header__small-title"
} , smallScreenTitle ) , toggleButton ) , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : classnames _default ( ) ( 'components-panel__header' , 'interface-complementary-area-header' , className ) ,
tabIndex : - 1
} , children , toggleButton ) ) ;
} ;
/* harmony default export */ var complementary _area _header = ( ComplementaryAreaHeader ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/action-item/index.js
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
2021-11-15 13:50:17 +01:00
function ActionItemSlot ( _ref ) {
let {
name ,
as : Component = external _wp _components _ [ "ButtonGroup" ] ,
fillProps = { } ,
bubblesVirtually ,
... props
} = _ref ;
2021-11-09 03:17:17 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Slot" ] , {
name : name ,
bubblesVirtually : bubblesVirtually ,
fillProps : fillProps
} , fills => {
if ( Object ( external _lodash _ [ "isEmpty" ] ) ( external _wp _element _ [ "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
const initializedByPlugins = [ ] ;
2021-11-15 13:50:17 +01:00
external _wp _element _ [ "Children" ] . forEach ( fills , _ref2 => {
let {
props : {
_ _unstableExplicitMenuItem ,
_ _unstableTarget
}
} = _ref2 ;
2021-11-09 03:17:17 +01:00
if ( _ _unstableTarget && _ _unstableExplicitMenuItem ) {
initializedByPlugins . push ( _ _unstableTarget ) ;
}
} ) ;
const children = external _wp _element _ [ "Children" ] . map ( fills , child => {
if ( ! child . props . _ _unstableExplicitMenuItem && initializedByPlugins . includes ( child . props . _ _unstableTarget ) ) {
return null ;
}
return child ;
} ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( Component , props , children ) ;
} ) ;
}
2021-11-15 13:50:17 +01:00
function ActionItem ( _ref3 ) {
let {
name ,
as : Component = external _wp _components _ [ "Button" ] ,
onClick ,
... props
} = _ref3 ;
2021-11-09 03:17:17 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Fill" ] , {
name : name
2021-11-15 13:50:17 +01:00
} , _ref4 => {
let {
onClick : fpOnClick
} = _ref4 ;
2021-11-09 03:17:17 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( Component , Object ( esm _extends [ "a" /* default */ ] ) ( {
2021-11-15 13:50:17 +01:00
onClick : onClick || fpOnClick ? function ( ) {
( onClick || external _lodash _ [ "noop" ] ) ( ... arguments ) ;
( fpOnClick || external _lodash _ [ "noop" ] ) ( ... arguments ) ;
2021-11-09 03:17:17 +01:00
} : undefined
} , props ) ) ;
} ) ;
}
ActionItem . Slot = ActionItemSlot ;
/* harmony default export */ var action _item = ( ActionItem ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area-more-menu-item/index.js
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
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
Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuItem" ] , Object ( external _lodash _ [ "omit" ] ) ( props , [ '__unstableExplicitMenuItem' , '__unstableTarget' ] ) ) ;
2021-11-15 13:50:17 +01:00
function ComplementaryAreaMoreMenuItem ( _ref ) {
let {
scope ,
target ,
_ _unstableExplicitMenuItem ,
... props
} = _ref ;
2021-11-09 03:17:17 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( complementary _area _toggle , Object ( esm _extends [ "a" /* default */ ] ) ( {
as : toggleProps => {
return Object ( external _wp _element _ [ "createElement" ] ) ( action _item , Object ( esm _extends [ "a" /* default */ ] ) ( {
_ _unstableExplicitMenuItem : _ _unstableExplicitMenuItem ,
_ _unstableTarget : ` ${ scope } / ${ target } ` ,
as : PluginsMenuItem ,
name : ` ${ scope } /plugin-more-menu `
} , toggleProps ) ) ;
} ,
role : "menuitemcheckbox" ,
selectedIcon : check [ "a" /* default */ ] ,
name : target ,
scope : scope
} , props ) ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/pinned-items/index.js
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
2021-11-15 13:50:17 +01:00
function PinnedItems ( _ref ) {
let {
scope ,
... props
} = _ref ;
2021-11-09 03:17:17 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Fill" ] , Object ( esm _extends [ "a" /* default */ ] ) ( {
name : ` PinnedItems/ ${ scope } `
} , props ) ) ;
}
2021-11-15 13:50:17 +01:00
function PinnedItemsSlot ( _ref2 ) {
let {
scope ,
className ,
... props
} = _ref2 ;
2021-11-09 03:17:17 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Slot" ] , Object ( esm _extends [ "a" /* default */ ] ) ( {
name : ` PinnedItems/ ${ scope } `
} , props ) , fills => ! Object ( external _lodash _ [ "isEmpty" ] ) ( fills ) && Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : classnames _default ( ) ( className , 'interface-pinned-items' )
} , fills ) ) ;
}
PinnedItems . Slot = PinnedItemsSlot ;
/* harmony default export */ var pinned _items = ( PinnedItems ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area/index.js
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2021-11-15 13:50:17 +01:00
function ComplementaryAreaSlot ( _ref ) {
let {
scope ,
... props
} = _ref ;
2021-11-09 03:17:17 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Slot" ] , Object ( esm _extends [ "a" /* default */ ] ) ( {
name : ` ComplementaryArea/ ${ scope } `
} , props ) ) ;
}
2021-11-15 13:50:17 +01:00
function ComplementaryAreaFill ( _ref2 ) {
let {
scope ,
children ,
className
} = _ref2 ;
2021-11-09 03:17:17 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Fill" ] , {
name : ` ComplementaryArea/ ${ scope } `
} , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : className
} , children ) ) ;
}
function useAdjustComplementaryListener ( scope , identifier , activeArea , isActive , isSmall ) {
const previousIsSmall = Object ( external _wp _element _ [ "useRef" ] ) ( false ) ;
const shouldOpenWhenNotSmall = Object ( external _wp _element _ [ "useRef" ] ) ( false ) ;
const {
enableComplementaryArea ,
disableComplementaryArea
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store ) ;
Object ( external _wp _element _ [ "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.
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.
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 ;
}
if ( isSmall !== previousIsSmall . current ) {
previousIsSmall . current = isSmall ;
}
} , [ isActive , isSmall , scope , identifier , activeArea ] ) ;
}
2021-11-15 13:50:17 +01:00
function ComplementaryArea ( _ref3 ) {
let {
children ,
className ,
closeLabel = Object ( external _wp _i18n _ [ "__" ] ) ( 'Close plugin' ) ,
identifier ,
header ,
headerClassName ,
icon ,
isPinnable = true ,
panelClassName ,
scope ,
name ,
smallScreenTitle ,
title ,
toggleShortcut ,
isActiveByDefault ,
showIconLabels = false
} = _ref3 ;
2021-11-09 03:17:17 +01:00
const {
isActive ,
isPinned ,
activeArea ,
isSmall ,
isLarge
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
const {
getActiveComplementaryArea ,
isItemPinned
} = select ( store ) ;
const _activeArea = getActiveComplementaryArea ( scope ) ;
return {
isActive : _activeArea === identifier ,
isPinned : isItemPinned ( scope , identifier ) ,
activeArea : _activeArea ,
isSmall : select ( external _wp _viewport _ [ "store" ] ) . isViewportMatch ( '< medium' ) ,
isLarge : select ( external _wp _viewport _ [ "store" ] ) . isViewportMatch ( 'large' )
} ;
} , [ identifier , scope ] ) ;
useAdjustComplementaryListener ( scope , identifier , activeArea , isActive , isSmall ) ;
const {
enableComplementaryArea ,
disableComplementaryArea ,
pinItem ,
unpinItem
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store ) ;
Object ( external _wp _element _ [ "useEffect" ] ) ( ( ) => {
if ( isActiveByDefault && activeArea === undefined && ! isSmall ) {
enableComplementaryArea ( scope , identifier ) ;
}
} , [ activeArea , isActiveByDefault , scope , identifier , isSmall ] ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , isPinnable && Object ( external _wp _element _ [ "createElement" ] ) ( pinned _items , {
scope : scope
} , isPinned && Object ( external _wp _element _ [ "createElement" ] ) ( complementary _area _toggle , {
scope : scope ,
identifier : identifier ,
isPressed : isActive && ( ! showIconLabels || isLarge ) ,
"aria-expanded" : isActive ,
label : title ,
icon : showIconLabels ? check [ "a" /* default */ ] : icon ,
showTooltip : ! showIconLabels ,
variant : showIconLabels ? 'tertiary' : undefined
} ) ) , name && isPinnable && Object ( external _wp _element _ [ "createElement" ] ) ( ComplementaryAreaMoreMenuItem , {
target : name ,
scope : scope ,
icon : icon
} , title ) , isActive && Object ( external _wp _element _ [ "createElement" ] ) ( ComplementaryAreaFill , {
className : classnames _default ( ) ( 'interface-complementary-area' , className ) ,
scope : scope
} , Object ( external _wp _element _ [ "createElement" ] ) ( complementary _area _header , {
className : headerClassName ,
closeLabel : closeLabel ,
onClose : ( ) => disableComplementaryArea ( scope ) ,
smallScreenTitle : smallScreenTitle ,
toggleButtonProps : {
label : closeLabel ,
shortcut : toggleShortcut ,
scope ,
identifier
}
} , header || Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( "strong" , null , title ) , isPinnable && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
className : "interface-complementary-area__pin-unpin-item" ,
icon : isPinned ? star _filled [ "a" /* default */ ] : star _empty [ "a" /* default */ ] ,
label : isPinned ? Object ( external _wp _i18n _ [ "__" ] ) ( 'Unpin from toolbar' ) : Object ( external _wp _i18n _ [ "__" ] ) ( 'Pin to toolbar' ) ,
onClick : ( ) => ( isPinned ? unpinItem : pinItem ) ( scope , identifier ) ,
isPressed : isPinned ,
"aria-expanded" : isPinned
} ) ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Panel" ] , {
className : panelClassName
} , children ) ) ) ;
}
const ComplementaryAreaWrapped = complementary _area _context ( ComplementaryArea ) ;
ComplementaryAreaWrapped . Slot = ComplementaryAreaSlot ;
/* harmony default export */ var complementary _area = ( ComplementaryAreaWrapped ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/fullscreen-mode/index.js
/ * *
* WordPress dependencies
* /
2021-11-15 13:50:17 +01:00
const FullscreenMode = _ref => {
let {
isActive
} = _ref ;
2021-11-09 03:17:17 +01:00
Object ( external _wp _element _ [ "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
// a consequence of the FullscreenMode setup
if ( document . body . classList . contains ( 'sticky-menu' ) ) {
isSticky = true ;
document . body . classList . remove ( 'sticky-menu' ) ;
}
return ( ) => {
if ( isSticky ) {
document . body . classList . add ( 'sticky-menu' ) ;
}
} ;
} , [ ] ) ;
Object ( external _wp _element _ [ "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 ) ;
// EXTERNAL MODULE: external ["wp","compose"]
var external _wp _compose _ = _ _webpack _require _ _ ( "K9lf" ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/interface-skeleton/index.js
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
/ * *
* WordPress dependencies
* /
function useHTMLClass ( className ) {
Object ( external _wp _element _ [ "useEffect" ] ) ( ( ) => {
const element = document && document . querySelector ( ` html:not(. ${ className } ) ` ) ;
if ( ! element ) {
return ;
}
element . classList . toggle ( className ) ;
return ( ) => {
element . classList . toggle ( className ) ;
} ;
} , [ className ] ) ;
}
2021-11-15 13:50:17 +01:00
function InterfaceSkeleton ( _ref , ref ) {
let {
footer ,
header ,
sidebar ,
secondarySidebar ,
notices ,
content ,
drawer ,
actions ,
labels ,
className ,
shortcuts
} = _ref ;
2021-11-09 03:17:17 +01:00
const navigateRegionsProps = Object ( external _wp _components _ [ "__unstableUseNavigateRegions" ] ) ( shortcuts ) ;
useHTMLClass ( 'interface-interface-skeleton__html-container' ) ;
const defaultLabels = {
/* translators: accessibility text for the nav bar landmark region. */
drawer : Object ( external _wp _i18n _ [ "__" ] ) ( 'Drawer' ) ,
/* translators: accessibility text for the top bar landmark region. */
header : Object ( external _wp _i18n _ [ "__" ] ) ( 'Header' ) ,
/* translators: accessibility text for the content landmark region. */
body : Object ( external _wp _i18n _ [ "__" ] ) ( 'Content' ) ,
/* translators: accessibility text for the secondary sidebar landmark region. */
secondarySidebar : Object ( external _wp _i18n _ [ "__" ] ) ( 'Block Library' ) ,
/* translators: accessibility text for the settings landmark region. */
sidebar : Object ( external _wp _i18n _ [ "__" ] ) ( 'Settings' ) ,
/* translators: accessibility text for the publish landmark region. */
actions : Object ( external _wp _i18n _ [ "__" ] ) ( 'Publish' ) ,
/* translators: accessibility text for the footer landmark region. */
footer : Object ( external _wp _i18n _ [ "__" ] ) ( 'Footer' )
} ;
const mergedLabels = { ... defaultLabels ,
... labels
} ;
return Object ( external _wp _element _ [ "createElement" ] ) ( "div" , Object ( esm _extends [ "a" /* default */ ] ) ( { } , navigateRegionsProps , {
ref : Object ( external _wp _compose _ [ "useMergeRefs" ] ) ( [ ref , navigateRegionsProps . ref ] ) ,
className : classnames _default ( ) ( className , 'interface-interface-skeleton' , navigateRegionsProps . className , ! ! footer && 'has-footer' )
} ) , ! ! drawer && Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "interface-interface-skeleton__drawer" ,
role : "region" ,
2021-11-23 06:40:38 +01:00
"aria-label" : mergedLabels . drawer ,
tabIndex : "-1"
2021-11-09 03:17:17 +01:00
} , drawer ) , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "interface-interface-skeleton__editor"
} , ! ! header && Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "interface-interface-skeleton__header" ,
role : "region" ,
"aria-label" : mergedLabels . header ,
tabIndex : "-1"
} , header ) , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "interface-interface-skeleton__body"
} , ! ! secondarySidebar && Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "interface-interface-skeleton__secondary-sidebar" ,
role : "region" ,
"aria-label" : mergedLabels . secondarySidebar ,
tabIndex : "-1"
} , secondarySidebar ) , ! ! notices && Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "interface-interface-skeleton__notices"
} , notices ) , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "interface-interface-skeleton__content" ,
role : "region" ,
"aria-label" : mergedLabels . body ,
tabIndex : "-1"
} , content ) , ! ! sidebar && Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "interface-interface-skeleton__sidebar" ,
role : "region" ,
"aria-label" : mergedLabels . sidebar ,
tabIndex : "-1"
} , sidebar ) , ! ! actions && Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "interface-interface-skeleton__actions" ,
role : "region" ,
"aria-label" : mergedLabels . actions ,
tabIndex : "-1"
} , actions ) ) ) , ! ! footer && Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "interface-interface-skeleton__footer" ,
role : "region" ,
"aria-label" : mergedLabels . footer ,
tabIndex : "-1"
} , footer ) ) ;
}
/* harmony default export */ var interface _skeleton = ( Object ( external _wp _element _ [ "forwardRef" ] ) ( InterfaceSkeleton ) ) ;
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/more-vertical.js
var more _vertical = _ _webpack _require _ _ ( "VKE3" ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/more-menu-dropdown/index.js
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
2021-11-15 13:50:17 +01:00
function MoreMenuDropdown ( _ref ) {
let {
as : DropdownComponent = external _wp _components _ [ "DropdownMenu" ] ,
className ,
2021-11-09 03:17:17 +01:00
2021-11-15 13:50:17 +01:00
/* translators: button label text should, if possible, be under 16 characters. */
label = Object ( external _wp _i18n _ [ "__" ] ) ( 'Options' ) ,
popoverProps ,
toggleProps ,
children
} = _ref ;
2021-11-09 03:17:17 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( DropdownComponent , {
className : classnames _default ( ) ( 'interface-more-menu-dropdown' , className ) ,
icon : more _vertical [ "a" /* default */ ] ,
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 ) ) ;
}
// EXTERNAL MODULE: external ["wp","a11y"]
var external _wp _a11y _ = _ _webpack _require _ _ ( "gdqT" ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/more-menu-feature-toggle/index.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2021-11-15 13:50:17 +01:00
function MoreMenuFeatureToggle ( _ref ) {
let {
scope ,
label ,
info ,
messageActivated ,
messageDeactivated ,
shortcut ,
feature
} = _ref ;
2021-11-09 03:17:17 +01:00
const isActive = Object ( external _wp _data _ [ "useSelect" ] ) ( select => select ( store ) . isFeatureActive ( scope , feature ) , [ feature ] ) ;
const {
toggleFeature
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store ) ;
const speakMessage = ( ) => {
if ( isActive ) {
Object ( external _wp _a11y _ [ "speak" ] ) ( messageDeactivated || Object ( external _wp _i18n _ [ "__" ] ) ( 'Feature deactivated' ) ) ;
} else {
Object ( external _wp _a11y _ [ "speak" ] ) ( messageActivated || Object ( external _wp _i18n _ [ "__" ] ) ( 'Feature activated' ) ) ;
}
} ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuItem" ] , {
icon : isActive && check [ "a" /* default */ ] ,
isSelected : isActive ,
onClick : ( ) => {
toggleFeature ( scope , feature ) ;
speakMessage ( ) ;
} ,
role : "menuitemcheckbox" ,
info : info ,
shortcut : shortcut
} , label ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/index.js
// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/index.js
/***/ } ) ,
/***/ "URob" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( "GRId" ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( "Tqx9" ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
/ * *
* WordPress dependencies
* /
const starFilled = Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "SVG" ] , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "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 */ _ _webpack _exports _ _ [ "a" ] = ( starFilled ) ;
/***/ } ) ,
/***/ "VKE3" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( "GRId" ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( "Tqx9" ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
/ * *
* WordPress dependencies
* /
const moreVertical = Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "SVG" ] , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "Path" ] , {
d : "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"
} ) ) ;
/* harmony default export */ _ _webpack _exports _ _ [ "a" ] = ( moreVertical ) ;
/***/ } ) ,
/***/ "Xxwi" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( "GRId" ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( "Tqx9" ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
/ * *
* WordPress dependencies
* /
const starEmpty = Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "SVG" ] , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "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 */ _ _webpack _exports _ _ [ "a" ] = ( starEmpty ) ;
/***/ } ) ,
/***/ "YLtl" :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = window [ "lodash" ] ; } ( ) ) ;
/***/ } ) ,
/***/ "axFQ" :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = window [ "wp" ] [ "blockEditor" ] ; } ( ) ) ;
/***/ } ) ,
/***/ "bWcr" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( "GRId" ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( "Tqx9" ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
/ * *
* WordPress dependencies
* /
const closeSmall = Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "SVG" ] , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "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 */ _ _webpack _exports _ _ [ "a" ] = ( closeSmall ) ;
/***/ } ) ,
/***/ "cjQ8" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( "GRId" ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( "Tqx9" ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
/ * *
* WordPress dependencies
* /
const arrowLeft = Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "SVG" ] , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "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 */ _ _webpack _exports _ _ [ "a" ] = ( arrowLeft ) ;
2021-11-30 01:24:27 +01:00
/***/ } ) ,
/***/ "diJD" :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = window [ "wp" ] [ "reusableBlocks" ] ; } ( ) ) ;
2021-11-09 03:17:17 +01:00
/***/ } ) ,
/***/ "g56x" :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = window [ "wp" ] [ "hooks" ] ; } ( ) ) ;
/***/ } ) ,
/***/ "gdqT" :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = window [ "wp" ] [ "a11y" ] ; } ( ) ) ;
/***/ } ) ,
/***/ "hF7m" :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = window [ "wp" ] [ "keyboardShortcuts" ] ; } ( ) ) ;
/***/ } ) ,
/***/ "iClF" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( "GRId" ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
/ * *
* WordPress dependencies
* /
/** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */
/ * *
* Return an SVG icon .
*
* @ 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
*
* @ return { JSX . Element } Icon component
* /
2021-11-15 13:50:17 +01:00
function Icon ( _ref ) {
let {
icon ,
size = 24 ,
... props
} = _ref ;
2021-11-09 03:17:17 +01:00
return Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "cloneElement" ] ) ( icon , {
width : size ,
height : size ,
... props
} ) ;
}
/* harmony default export */ _ _webpack _exports _ _ [ "a" ] = ( Icon ) ;
/***/ } ) ,
/***/ "jSdM" :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = window [ "wp" ] [ "editor" ] ; } ( ) ) ;
/***/ } ) ,
/***/ "jZUy" :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = window [ "wp" ] [ "coreData" ] ; } ( ) ) ;
/***/ } ) ,
/***/ "l3Sj" :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = window [ "wp" ] [ "i18n" ] ; } ( ) ) ;
/***/ } ) ,
/***/ "onLe" :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = window [ "wp" ] [ "notices" ] ; } ( ) ) ;
/***/ } ) ,
/***/ "pPDe" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
var LEAF _KEY , hasWeakMap ;
/ * *
* Arbitrary value used as key for referencing cache object in WeakMap tree .
*
* @ type { Object }
* /
LEAF _KEY = { } ;
/ * *
* Whether environment supports WeakMap .
*
* @ type { boolean }
* /
hasWeakMap = typeof WeakMap !== 'undefined' ;
/ * *
* 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 ] ;
}
/ * *
* 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 ;
}
/ * *
* Creates and returns a new cache object .
*
* @ return { Object } Cache object .
* /
function createCache ( ) {
var cache = {
clear : function ( ) {
cache . head = null ;
} ,
} ;
return cache ;
}
/ * *
* 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 .
* /
function isShallowEqual ( a , b , fromIndex ) {
var i ;
if ( a . length !== b . length ) {
return false ;
}
for ( i = fromIndex ; i < a . length ; i ++ ) {
if ( a [ i ] !== b [ i ] ) {
return false ;
}
}
return true ;
}
/ * *
* 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 .
* /
/* harmony default export */ _ _webpack _exports _ _ [ "a" ] = ( function ( selector , getDependants ) {
var rootCache , getCache ;
// Use object source as dependant if getter not provided
if ( ! getDependants ) {
getDependants = arrayOf ;
}
/ * *
* 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 ;
}
/ * *
* 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 ;
for ( i = 0 ; i < dependants . length ; i ++ ) {
dependant = dependants [ i ] ;
// Can only compose WeakMap from object-like key.
if ( ! isObjectLike ( dependant ) ) {
isUniqueByDependants = false ;
break ;
}
// 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 ;
}
}
// 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 ) ;
}
return caches . get ( LEAF _KEY ) ;
}
// Assign cache handler by availability of WeakMap
getCache = hasWeakMap ? getWeakMapCache : getRootCache ;
/ * *
* Resets root memoization cache .
* /
function clear ( ) {
rootCache = hasWeakMap ? new WeakMap ( ) : createCache ( ) ;
}
// 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 ;
// Create copy of arguments (avoid leaking deoptimization).
args = new Array ( len ) ;
for ( i = 0 ; i < len ; i ++ ) {
args [ i ] = arguments [ i ] ;
}
dependants = getDependants . apply ( null , args ) ;
cache = getCache ( dependants ) ;
// 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 ( ) ;
}
cache . lastDependants = dependants ;
}
node = cache . head ;
while ( node ) {
// Check whether node arguments match arguments
if ( ! isShallowEqual ( node . args , args , 1 ) ) {
node = node . next ;
continue ;
}
// At this point we can assume we've found a match
// 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 ;
}
node . next = cache . head ;
node . prev = null ;
cache . head . prev = node ;
cache . head = node ;
}
// Return immediately
return node . val ;
}
// No cached value found. Continue to insertion phase:
node = {
// Generate the result from original function
val : selector . apply ( null , args ) ,
} ;
// Avoid including the source object in the cache.
args [ 0 ] = null ;
node . args = args ;
// Don't need to check whether node is already head, since it would
// have been returned above already if it was
// Shift existing head down list
if ( cache . head ) {
cache . head . prev = node ;
node . next = cache . head ;
}
cache . head = node ;
return node . val ;
}
callSelector . getDependants = getDependants ;
callSelector . clear = clear ;
clear ( ) ;
return callSelector ;
} ) ;
2021-11-23 06:40:38 +01:00
/***/ } ) ,
/***/ "rmEH" :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = window [ "wp" ] [ "htmlEntities" ] ; } ( ) ) ;
2021-11-09 03:17:17 +01:00
/***/ } ) ,
/***/ "rrFr" :
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
var _ _WEBPACK _AMD _DEFINE _FACTORY _ _ , _ _WEBPACK _AMD _DEFINE _ARRAY _ _ , _ _WEBPACK _AMD _DEFINE _RESULT _ _ ; //download.js v4.2, by dandavis; 2008-2016. [MIT] see http://danml.com/download.html for tests/usage
// v1 landed a FF+Chrome compat way of downloading strings to local un-named files, upgraded to use a hidden frame and optional mime
// v2 added named files via a[download], msSaveBlob, IE (10+) support, and window.URL support for larger+faster saves than dataURLs
// v3 added dataURL and Blob Input, bind-toggle arity, and legacy dataURL fallback was improved with force-download mime and base64 support. 3.1 improved safari handling.
// v4 adds AMD/UMD, commonJS, and plain browser support
// v4.1 adds url download capability via solo URL argument (same domain/CORS only)
// v4.2 adds semantic variable names, long (over 2MB) dataURL support, and hidden by default temp anchors
// https://github.com/rndme/download
( function ( root , factory ) {
if ( true ) {
// AMD. Register as an anonymous module.
! ( _ _WEBPACK _AMD _DEFINE _ARRAY _ _ = [ ] , _ _WEBPACK _AMD _DEFINE _FACTORY _ _ = ( factory ) ,
_ _WEBPACK _AMD _DEFINE _RESULT _ _ = ( typeof _ _WEBPACK _AMD _DEFINE _FACTORY _ _ === 'function' ?
( _ _WEBPACK _AMD _DEFINE _FACTORY _ _ . apply ( exports , _ _WEBPACK _AMD _DEFINE _ARRAY _ _ ) ) : _ _WEBPACK _AMD _DEFINE _FACTORY _ _ ) ,
_ _WEBPACK _AMD _DEFINE _RESULT _ _ !== undefined && ( module . exports = _ _WEBPACK _AMD _DEFINE _RESULT _ _ ) ) ;
} else { }
} ( this , function ( ) {
return function download ( data , strFileName , strMimeType ) {
var self = window , // this script is only for browsers anyway...
defaultMime = "application/octet-stream" , // this default mime also triggers iframe downloads
mimeType = strMimeType || defaultMime ,
payload = data ,
url = ! strFileName && ! strMimeType && payload ,
anchor = document . createElement ( "a" ) ,
toString = function ( a ) { return String ( a ) ; } ,
myBlob = ( self . Blob || self . MozBlob || self . WebKitBlob || toString ) ,
fileName = strFileName || "download" ,
blob ,
reader ;
myBlob = myBlob . call ? myBlob . bind ( self ) : Blob ;
if ( String ( this ) === "true" ) { //reverse arguments, allowing download.bind(true, "text/xml", "export.xml") to act as a callback
payload = [ payload , mimeType ] ;
mimeType = payload [ 0 ] ;
payload = payload [ 1 ] ;
}
if ( url && url . length < 2048 ) { // if no filename and no mime, assume a url was passed as the only argument
fileName = url . split ( "/" ) . pop ( ) . split ( "?" ) [ 0 ] ;
anchor . href = url ; // assign href prop to temp anchor
if ( anchor . href . indexOf ( url ) !== - 1 ) { // if the browser determines that it's a potentially valid url path:
var ajax = new XMLHttpRequest ( ) ;
ajax . open ( "GET" , url , true ) ;
ajax . responseType = 'blob' ;
ajax . onload = function ( e ) {
download ( e . target . response , fileName , defaultMime ) ;
} ;
setTimeout ( function ( ) { ajax . send ( ) ; } , 0 ) ; // allows setting custom ajax headers using the return:
return ajax ;
} // end if valid url?
} // end if url?
//go ahead and download dataURLs right away
if ( /^data:([\w+-]+\/[\w+.-]+)?[,;]/ . test ( payload ) ) {
if ( payload . length > ( 1024 * 1024 * 1.999 ) && myBlob !== toString ) {
payload = dataUrlToBlob ( payload ) ;
mimeType = payload . type || defaultMime ;
} else {
return navigator . msSaveBlob ? // IE10 can't do a[download], only Blobs:
navigator . msSaveBlob ( dataUrlToBlob ( payload ) , fileName ) :
saver ( payload ) ; // everyone else can save dataURLs un-processed
}
} else { //not data url, is it a string with special needs?
if ( /([\x80-\xff])/ . test ( payload ) ) {
var i = 0 , tempUiArr = new Uint8Array ( payload . length ) , mx = tempUiArr . length ;
for ( i ; i < mx ; ++ i ) tempUiArr [ i ] = payload . charCodeAt ( i ) ;
payload = new myBlob ( [ tempUiArr ] , { type : mimeType } ) ;
}
}
blob = payload instanceof myBlob ?
payload :
new myBlob ( [ payload ] , { type : mimeType } ) ;
function dataUrlToBlob ( strUrl ) {
var parts = strUrl . split ( /[:;,]/ ) ,
type = parts [ 1 ] ,
decoder = parts [ 2 ] == "base64" ? atob : decodeURIComponent ,
binData = decoder ( parts . pop ( ) ) ,
mx = binData . length ,
i = 0 ,
uiArr = new Uint8Array ( mx ) ;
for ( i ; i < mx ; ++ i ) uiArr [ i ] = binData . charCodeAt ( i ) ;
return new myBlob ( [ uiArr ] , { type : type } ) ;
}
function saver ( url , winMode ) {
if ( 'download' in anchor ) { //html5 A[download]
anchor . href = url ;
anchor . setAttribute ( "download" , fileName ) ;
anchor . className = "download-js-link" ;
anchor . innerHTML = "downloading..." ;
anchor . style . display = "none" ;
document . body . appendChild ( anchor ) ;
setTimeout ( function ( ) {
anchor . click ( ) ;
document . body . removeChild ( anchor ) ;
if ( winMode === true ) { setTimeout ( function ( ) { self . URL . revokeObjectURL ( anchor . href ) ; } , 250 ) ; }
} , 66 ) ;
return true ;
}
// handle non-a[download] safari as best we can:
if ( /(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\// . test ( navigator . userAgent ) ) {
if ( /^data:/ . test ( url ) ) url = "data:" + url . replace ( /^data:([\w\/\-\+]+)/ , defaultMime ) ;
if ( ! window . open ( url ) ) { // popup blocked, offer direct download:
if ( confirm ( "Displaying New Document\n\nUse Save As... to download, then click back to return to this page." ) ) { location . href = url ; }
}
return true ;
}
//do iframe dataURL download (old ch+FF):
var f = document . createElement ( "iframe" ) ;
document . body . appendChild ( f ) ;
if ( ! winMode && /^data:/ . test ( url ) ) { // force a mime that will download:
url = "data:" + url . replace ( /^data:([\w\/\-\+]+)/ , defaultMime ) ;
}
f . src = url ;
setTimeout ( function ( ) { document . body . removeChild ( f ) ; } , 333 ) ;
} //end saver
if ( navigator . msSaveBlob ) { // IE10+ : (has Blob, but not a[download] or URL)
return navigator . msSaveBlob ( blob , fileName ) ;
}
if ( self . URL ) { // simple fast and modern way using Blob and URL:
saver ( self . URL . createObjectURL ( blob ) , true ) ;
} else {
// handle non-Blob()+non-URL browsers:
if ( typeof blob === "string" || blob . constructor === toString ) {
try {
return saver ( "data:" + mimeType + ";base64," + self . btoa ( blob ) ) ;
} catch ( y ) {
return saver ( "data:" + mimeType + "," + encodeURIComponent ( blob ) ) ;
}
}
// Blob but not URL support:
reader = new FileReader ( ) ;
reader . onload = function ( e ) {
saver ( this . result ) ;
} ;
reader . readAsDataURL ( blob ) ;
}
return true ;
} ; /* end download() */
} ) ) ;
/***/ } ) ,
/***/ "tI+e" :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = window [ "wp" ] [ "components" ] ; } ( ) ) ;
/***/ } ) ,
/***/ "w95h" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( "GRId" ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( "Tqx9" ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
/ * *
* WordPress dependencies
* /
const close = Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "SVG" ] , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "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 */ _ _webpack _exports _ _ [ "a" ] = ( close ) ;
/***/ } ) ,
/***/ "wduq" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( "GRId" ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( "Tqx9" ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
/ * *
* WordPress dependencies
* /
const wordpress = Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "SVG" ] , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "-2 -2 24 24"
} , Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "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 */ _ _webpack _exports _ _ [ "a" ] = ( wordpress ) ;
/***/ } ) ,
/***/ "wx14" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _extends ; } ) ;
function _extends ( ) {
_extends = Object . assign || function ( target ) {
for ( var i = 1 ; i < arguments . length ; i ++ ) {
var source = arguments [ i ] ;
for ( var key in source ) {
if ( Object . prototype . hasOwnProperty . call ( source , key ) ) {
target [ key ] = source [ key ] ;
}
}
}
return target ;
} ;
return _extends . apply ( this , arguments ) ;
}
/***/ } ) ,
/***/ "ywyh" :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = window [ "wp" ] [ "apiFetch" ] ; } ( ) ) ;
/***/ } )
/******/ } ) ;