2018-12-14 04:41:57 +00:00
this [ "wp" ] = this [ "wp" ] || { } ; this [ "wp" ] [ "editPost" ] =
/******/ ( 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
2021-05-20 12:20:04 +00:00
/******/ return _ _webpack _require _ _ ( _ _webpack _require _ _ . s = "dSQ2" ) ;
2018-12-14 04:41:57 +00:00
/******/ } )
/************************************************************************/
/******/ ( {
2021-05-20 12:20:04 +00:00
/***/ "0dt7" :
2021-05-19 15:09:27 +00:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2020-02-10 22:33:27 +00:00
2021-05-19 15:09:27 +00:00
"use strict" ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return STORE _NAME ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "b" , function ( ) { return VIEW _AS _LINK _SELECTOR ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "c" , function ( ) { return VIEW _AS _PREVIEW _LINK _SELECTOR ; } ) ;
/ * *
* The identifier for the data store .
*
* @ type { string }
* /
const STORE _NAME = 'core/edit-post' ;
/ * *
* CSS selector string for the admin bar view post link anchor tag .
*
* @ type { string }
* /
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
const VIEW _AS _LINK _SELECTOR = '#wp-admin-bar-view a' ;
/ * *
* CSS selector string for the admin bar preview post link anchor tag .
*
* @ type { string }
* /
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
const VIEW _AS _PREVIEW _LINK _SELECTOR = '#wp-admin-bar-preview a' ;
2020-07-21 12:14:37 +00:00
2021-01-28 02:04:13 +00:00
/***/ } ) ,
2021-05-20 12:20:04 +00:00
/***/ "1ZqX" :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = window [ "wp" ] [ "data" ] ; } ( ) ) ;
/***/ } ) ,
2021-11-08 14:29:21 +00:00
/***/ "1iEr" :
2021-05-19 15:09:27 +00:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
2021-11-08 14:29:21 +00:00
/* 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
* /
2021-05-19 15:09:27 +00:00
2021-11-08 14:29:21 +00:00
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 ) ;
2021-04-15 15:19:43 +00:00
/***/ } ) ,
2021-05-20 12:20:04 +00:00
/***/ "51Zz" :
2021-04-15 15:19:43 +00:00
/***/ ( function ( module , exports ) {
2021-05-20 12:20:04 +00:00
( function ( ) { module . exports = window [ "wp" ] [ "dataControls" ] ; } ( ) ) ;
2021-04-15 15:19:43 +00:00
/***/ } ) ,
2021-05-20 12:20:04 +00:00
/***/ "6aBm" :
/***/ ( function ( module , exports ) {
2021-01-28 02:04:13 +00:00
2021-05-20 12:20:04 +00:00
( function ( ) { module . exports = window [ "wp" ] [ "mediaUtils" ] ; } ( ) ) ;
2021-01-28 02:04:13 +00:00
2021-05-20 12:20:04 +00:00
/***/ } ) ,
2021-01-28 02:04:13 +00:00
2021-05-20 12:20:04 +00:00
/***/ "8oxB" :
/***/ ( function ( module , exports ) {
2021-01-28 02:04:13 +00:00
2021-05-20 12:20:04 +00:00
// shim for using process in browser
var process = module . exports = { } ;
2021-05-07 11:48:27 +00:00
2021-05-20 12:20:04 +00:00
// cached from whatever global is present so that test runners that stub it
// don't break things. But we need to wrap it in a try catch in case it is
// wrapped in strict mode code which doesn't define any globals. It's inside a
// function because try/catches deoptimize in certain engines.
2021-05-07 11:48:27 +00:00
2021-05-20 12:20:04 +00:00
var cachedSetTimeout ;
var cachedClearTimeout ;
2021-01-28 02:04:13 +00:00
2021-05-20 12:20:04 +00:00
function defaultSetTimout ( ) {
throw new Error ( 'setTimeout has not been defined' ) ;
}
function defaultClearTimeout ( ) {
throw new Error ( 'clearTimeout has not been defined' ) ;
}
( function ( ) {
try {
if ( typeof setTimeout === 'function' ) {
cachedSetTimeout = setTimeout ;
} else {
cachedSetTimeout = defaultSetTimout ;
}
} catch ( e ) {
cachedSetTimeout = defaultSetTimout ;
}
try {
if ( typeof clearTimeout === 'function' ) {
cachedClearTimeout = clearTimeout ;
} else {
cachedClearTimeout = defaultClearTimeout ;
}
} catch ( e ) {
cachedClearTimeout = defaultClearTimeout ;
}
} ( ) )
function runTimeout ( fun ) {
if ( cachedSetTimeout === setTimeout ) {
//normal enviroments in sane situations
return setTimeout ( fun , 0 ) ;
}
// if setTimeout wasn't available but was latter defined
if ( ( cachedSetTimeout === defaultSetTimout || ! cachedSetTimeout ) && setTimeout ) {
cachedSetTimeout = setTimeout ;
return setTimeout ( fun , 0 ) ;
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedSetTimeout ( fun , 0 ) ;
} catch ( e ) {
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedSetTimeout . call ( null , fun , 0 ) ;
} catch ( e ) {
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
return cachedSetTimeout . call ( this , fun , 0 ) ;
}
}
2021-01-28 02:04:13 +00:00
2021-05-20 12:20:04 +00:00
}
function runClearTimeout ( marker ) {
if ( cachedClearTimeout === clearTimeout ) {
//normal enviroments in sane situations
return clearTimeout ( marker ) ;
}
// if clearTimeout wasn't available but was latter defined
if ( ( cachedClearTimeout === defaultClearTimeout || ! cachedClearTimeout ) && clearTimeout ) {
cachedClearTimeout = clearTimeout ;
return clearTimeout ( marker ) ;
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedClearTimeout ( marker ) ;
} catch ( e ) {
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedClearTimeout . call ( null , marker ) ;
} catch ( e ) {
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
return cachedClearTimeout . call ( this , marker ) ;
}
}
2021-01-28 02:04:13 +00:00
2021-05-20 12:20:04 +00:00
}
var queue = [ ] ;
var draining = false ;
var currentQueue ;
var queueIndex = - 1 ;
2021-01-28 02:04:13 +00:00
2021-05-20 12:20:04 +00:00
function cleanUpNextTick ( ) {
if ( ! draining || ! currentQueue ) {
return ;
}
draining = false ;
if ( currentQueue . length ) {
queue = currentQueue . concat ( queue ) ;
} else {
queueIndex = - 1 ;
}
if ( queue . length ) {
drainQueue ( ) ;
}
}
2021-01-28 02:04:13 +00:00
2021-05-20 12:20:04 +00:00
function drainQueue ( ) {
if ( draining ) {
return ;
}
var timeout = runTimeout ( cleanUpNextTick ) ;
draining = true ;
2021-01-28 02:04:13 +00:00
2021-05-20 12:20:04 +00:00
var len = queue . length ;
while ( len ) {
currentQueue = queue ;
queue = [ ] ;
while ( ++ queueIndex < len ) {
if ( currentQueue ) {
currentQueue [ queueIndex ] . run ( ) ;
}
}
queueIndex = - 1 ;
len = queue . length ;
}
currentQueue = null ;
draining = false ;
runClearTimeout ( timeout ) ;
}
2021-05-19 15:09:27 +00:00
2021-05-20 12:20:04 +00:00
process . nextTick = function ( fun ) {
var args = new Array ( arguments . length - 1 ) ;
if ( arguments . length > 1 ) {
for ( var i = 1 ; i < arguments . length ; i ++ ) {
args [ i - 1 ] = arguments [ i ] ;
}
}
queue . push ( new Item ( fun , args ) ) ;
if ( queue . length === 1 && ! draining ) {
runTimeout ( drainQueue ) ;
}
} ;
// v8 likes predictible objects
function Item ( fun , array ) {
this . fun = fun ;
this . array = array ;
}
Item . prototype . run = function ( ) {
this . fun . apply ( null , this . array ) ;
} ;
process . title = 'browser' ;
process . browser = true ;
process . env = { } ;
process . argv = [ ] ;
process . version = '' ; // empty string to avoid regexp issues
process . versions = { } ;
2021-05-19 15:09:27 +00:00
2021-05-20 12:20:04 +00:00
function noop ( ) { }
2021-05-19 15:09:27 +00:00
2021-05-20 12:20:04 +00:00
process . on = noop ;
process . addListener = noop ;
process . once = noop ;
process . off = noop ;
process . removeListener = noop ;
process . removeAllListeners = noop ;
process . emit = noop ;
process . prependListener = noop ;
process . prependOnceListener = noop ;
2021-05-19 15:09:27 +00:00
2021-05-20 12:20:04 +00:00
process . listeners = function ( name ) { return [ ] }
process . binding = function ( name ) {
throw new Error ( 'process.binding is not supported' ) ;
} ;
process . cwd = function ( ) { return '/' } ;
process . chdir = function ( dir ) {
throw new Error ( 'process.chdir is not supported' ) ;
} ;
process . umask = function ( ) { return 0 ; } ;
2021-01-28 02:04:13 +00:00
2021-05-25 08:40:25 +00:00
/***/ } ) ,
/***/ "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 ) ;
2021-05-20 12:20:04 +00:00
/***/ } ) ,
/***/ "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" ] ; } ( ) ) ;
/***/ } ) ,
/***/ "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 ) ;
/***/ } ) ,
/***/ "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" ] ; } ( ) ) ;
2021-06-01 08:10:04 +00:00
/***/ } ) ,
/***/ "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 ) ;
/***/ } ) ,
/***/ "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 ) ;
2021-05-20 12:20:04 +00:00
/***/ } ) ,
/***/ "Q4Sy" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( "GRId" ) ;
2021-05-19 15:09:27 +00:00
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
2021-05-20 12:20:04 +00:00
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( "Tqx9" ) ;
2021-05-19 15:09:27 +00:00
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
2021-05-07 11:48:27 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* WordPress dependencies
2021-05-07 11:48:27 +00:00
* /
2021-05-19 15:09:27 +00:00
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 ) ;
2021-05-07 11:48:27 +00:00
/***/ } ) ,
2021-05-20 12:20:04 +00:00
/***/ "QyPg" :
2020-07-07 16:08:28 +00:00
/***/ ( function ( module , exports ) {
2020-03-23 23:40:19 +00:00
2021-05-20 12:20:04 +00:00
( 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" ] , {
2021-11-08 14:29:21 +00:00
d : "M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"
2021-05-20 12:20:04 +00:00
} ) ) ;
/* harmony default export */ _ _webpack _exports _ _ [ "a" ] = ( check ) ;
/***/ } ) ,
/***/ "RxS6" :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = window [ "wp" ] [ "keycodes" ] ; } ( ) ) ;
2020-03-23 23:40:19 +00:00
2021-05-19 15:09:27 +00:00
/***/ } ) ,
2020-07-07 16:08:28 +00:00
2021-05-20 12:20:04 +00:00
/***/ "T40v" :
2021-05-19 15:09:27 +00:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2020-07-07 16:08:28 +00:00
2021-05-19 15:09:27 +00:00
"use strict" ;
2020-07-07 16:08:28 +00:00
2021-05-19 15:09:27 +00:00
// EXPORTS
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return /* binding */ store ; } ) ;
2020-07-07 16:08:28 +00:00
2021-05-19 15:09:27 +00:00
// NAMESPACE OBJECT: ./node_modules/@wordpress/edit-post/build-module/store/actions.js
var actions _namespaceObject = { } ;
_ _webpack _require _ _ . r ( actions _namespaceObject ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "openGeneralSidebar" , function ( ) { return openGeneralSidebar ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "closeGeneralSidebar" , function ( ) { return closeGeneralSidebar ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "openModal" , function ( ) { return openModal ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "closeModal" , function ( ) { return closeModal ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "openPublishSidebar" , function ( ) { return openPublishSidebar ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "closePublishSidebar" , function ( ) { return closePublishSidebar ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "togglePublishSidebar" , function ( ) { return togglePublishSidebar ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "toggleEditorPanelEnabled" , function ( ) { return toggleEditorPanelEnabled ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "toggleEditorPanelOpened" , function ( ) { return toggleEditorPanelOpened ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "removeEditorPanel" , function ( ) { return removeEditorPanel ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "toggleFeature" , function ( ) { return toggleFeature ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "switchEditorMode" , function ( ) { return switchEditorMode ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "togglePinnedPluginItem" , function ( ) { return togglePinnedPluginItem ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "hideBlockTypes" , function ( ) { return hideBlockTypes ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "updatePreferredStyleVariations" , function ( ) { return updatePreferredStyleVariations ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "__experimentalUpdateLocalAutosaveInterval" , function ( ) { return _ _experimentalUpdateLocalAutosaveInterval ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "showBlockTypes" , function ( ) { return showBlockTypes ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "setAvailableMetaBoxesPerLocation" , function ( ) { return setAvailableMetaBoxesPerLocation ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "requestMetaBoxUpdates" , function ( ) { return requestMetaBoxUpdates ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "metaBoxUpdatesSuccess" , function ( ) { return metaBoxUpdatesSuccess ; } ) ;
2021-11-08 14:29:21 +00:00
_ _webpack _require _ _ . d ( actions _namespaceObject , "metaBoxUpdatesFailure" , function ( ) { return metaBoxUpdatesFailure ; } ) ;
2021-05-19 15:09:27 +00:00
_ _webpack _require _ _ . d ( actions _namespaceObject , "__experimentalSetPreviewDeviceType" , function ( ) { return _ _experimentalSetPreviewDeviceType ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "setIsInserterOpened" , function ( ) { return setIsInserterOpened ; } ) ;
2021-05-21 10:14:23 +00:00
_ _webpack _require _ _ . d ( actions _namespaceObject , "setIsListViewOpened" , function ( ) { return setIsListViewOpened ; } ) ;
2021-05-19 15:09:27 +00:00
_ _webpack _require _ _ . d ( actions _namespaceObject , "setIsEditingTemplate" , function ( ) { return setIsEditingTemplate ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "__unstableSwitchToTemplateMode" , function ( ) { return _ _unstableSwitchToTemplateMode ; } ) ;
2021-11-08 14:29:21 +00:00
_ _webpack _require _ _ . d ( actions _namespaceObject , "__unstableCreateTemplate" , function ( ) { return _ _unstableCreateTemplate ; } ) ;
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 19:08:24 +00:00
_ _webpack _require _ _ . d ( actions _namespaceObject , "initializeMetaBoxes" , function ( ) { return initializeMetaBoxes ; } ) ;
2020-03-23 23:40:19 +00:00
2021-05-19 15:09:27 +00:00
// NAMESPACE OBJECT: ./node_modules/@wordpress/edit-post/build-module/store/selectors.js
var selectors _namespaceObject = { } ;
_ _webpack _require _ _ . r ( selectors _namespaceObject ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "getEditorMode" , function ( ) { return getEditorMode ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "isEditorSidebarOpened" , function ( ) { return isEditorSidebarOpened ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "isPluginSidebarOpened" , function ( ) { return isPluginSidebarOpened ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "getActiveGeneralSidebarName" , function ( ) { return getActiveGeneralSidebarName ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "getPreferences" , function ( ) { return getPreferences ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "getPreference" , function ( ) { return getPreference ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "isPublishSidebarOpened" , function ( ) { return isPublishSidebarOpened ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "isEditorPanelRemoved" , function ( ) { return isEditorPanelRemoved ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "isEditorPanelEnabled" , function ( ) { return isEditorPanelEnabled ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "isEditorPanelOpened" , function ( ) { return isEditorPanelOpened ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "isModalActive" , function ( ) { return isModalActive ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "isFeatureActive" , function ( ) { return isFeatureActive ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "isPluginItemPinned" , function ( ) { return isPluginItemPinned ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "getActiveMetaBoxLocations" , function ( ) { return getActiveMetaBoxLocations ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "isMetaBoxLocationVisible" , function ( ) { return isMetaBoxLocationVisible ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "isMetaBoxLocationActive" , function ( ) { return isMetaBoxLocationActive ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "getMetaBoxesPerLocation" , function ( ) { return getMetaBoxesPerLocation ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "getAllMetaBoxes" , function ( ) { return getAllMetaBoxes ; } ) ;
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 19:08:24 +00:00
_ _webpack _require _ _ . d ( selectors _namespaceObject , "hasMetaBoxes" , function ( ) { return selectors _hasMetaBoxes ; } ) ;
2021-05-19 15:09:27 +00:00
_ _webpack _require _ _ . d ( selectors _namespaceObject , "isSavingMetaBoxes" , function ( ) { return selectors _isSavingMetaBoxes ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "__experimentalGetPreviewDeviceType" , function ( ) { return _ _experimentalGetPreviewDeviceType ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "isInserterOpened" , function ( ) { return isInserterOpened ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "__experimentalGetInsertionPoint" , function ( ) { return _ _experimentalGetInsertionPoint ; } ) ;
2021-05-21 10:14:23 +00:00
_ _webpack _require _ _ . d ( selectors _namespaceObject , "isListViewOpened" , function ( ) { return isListViewOpened ; } ) ;
2021-05-19 15:09:27 +00:00
_ _webpack _require _ _ . d ( selectors _namespaceObject , "isEditingTemplate" , function ( ) { return selectors _isEditingTemplate ; } ) ;
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 19:08:24 +00:00
_ _webpack _require _ _ . d ( selectors _namespaceObject , "areMetaBoxesInitialized" , function ( ) { return areMetaBoxesInitialized ; } ) ;
2021-05-19 15:09:27 +00:00
_ _webpack _require _ _ . d ( selectors _namespaceObject , "getEditedPostTemplate" , function ( ) { return getEditedPostTemplate ; } ) ;
2020-03-23 23:40:19 +00:00
2021-05-19 15:09:27 +00:00
// EXTERNAL MODULE: external ["wp","data"]
2021-05-20 12:20:04 +00:00
var external _wp _data _ = _ _webpack _require _ _ ( "1ZqX" ) ;
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
// EXTERNAL MODULE: external ["wp","dataControls"]
2021-05-20 12:20:04 +00:00
var external _wp _dataControls _ = _ _webpack _require _ _ ( "51Zz" ) ;
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
// EXTERNAL MODULE: external "lodash"
2021-05-20 12:20:04 +00:00
var external _lodash _ = _ _webpack _require _ _ ( "YLtl" ) ;
2020-07-07 16:08:28 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/store/defaults.js
const PREFERENCES _DEFAULTS = {
editorMode : 'visual' ,
panels : {
'post-status' : {
opened : true
2020-07-07 16:08:28 +00:00
}
2021-05-19 15:09:27 +00:00
} ,
hiddenBlockTypes : [ ] ,
preferredStyleVariations : { } ,
localAutosaveInterval : 15
} ;
2020-07-07 16:08:28 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/store/reducer.js
/ * *
* External dependencies
* /
2020-07-07 16:08:28 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* WordPress dependencies
* /
2020-07-07 16:08:28 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* Internal dependencies
* /
2020-07-07 16:08:28 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* Higher - order reducer creator which provides the given initial state for the
* original reducer .
*
* @ param { * } initialState Initial state to provide to reducer .
*
* @ return { Function } Higher - order reducer .
* /
2020-07-07 16:08:28 +00:00
2021-05-19 15:09:27 +00:00
const createWithInitialState = initialState => reducer => {
2021-11-15 12:50:17 +00:00
return function ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : initialState ;
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
return reducer ( state , action ) ;
} ;
2020-07-07 16:08:28 +00:00
} ;
2021-05-19 15:09:27 +00:00
/ * *
* Reducer returning the user preferences .
*
* @ param { Object } state Current state .
* @ param { string } state . mode Current editor mode , either
* "visual" or "text" .
* @ param { boolean } state . isGeneralSidebarDismissed Whether general sidebar is
* dismissed . False by default
* or when closing general
* sidebar , true when opening
* sidebar .
* @ param { boolean } state . isSidebarOpened Whether the sidebar is
* opened or closed .
* @ param { Object } state . panels The state of the different
* sidebar panels .
* @ param { Object } action Dispatched action .
*
* @ return { Object } Updated state .
* /
2020-07-07 16:08:28 +00:00
2020-02-10 22:33:27 +00:00
2021-05-19 15:09:27 +00:00
const preferences = Object ( external _lodash _ [ "flow" ] ) ( [ external _wp _data _ [ "combineReducers" ] , createWithInitialState ( PREFERENCES _DEFAULTS ) ] ) ( {
panels ( state , action ) {
switch ( action . type ) {
case 'TOGGLE_PANEL_ENABLED' :
{
const {
panelName
} = action ;
return { ... state ,
[ panelName ] : { ... state [ panelName ] ,
enabled : ! Object ( external _lodash _ [ "get" ] ) ( state , [ panelName , 'enabled' ] , true )
}
} ;
}
2020-02-10 22:33:27 +00:00
2021-05-19 15:09:27 +00:00
case 'TOGGLE_PANEL_OPENED' :
{
const {
panelName
} = action ;
const isOpen = state [ panelName ] === true || Object ( external _lodash _ [ "get" ] ) ( state , [ panelName , 'opened' ] , false ) ;
return { ... state ,
[ panelName ] : { ... state [ panelName ] ,
opened : ! isOpen
}
} ;
}
}
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
return state ;
} ,
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
editorMode ( state , action ) {
if ( action . type === 'SWITCH_MODE' ) {
return action . mode ;
}
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
return state ;
} ,
2020-10-13 13:10:30 +00:00
2021-05-19 15:09:27 +00:00
hiddenBlockTypes ( state , action ) {
switch ( action . type ) {
case 'SHOW_BLOCK_TYPES' :
return Object ( external _lodash _ [ "without" ] ) ( state , ... action . blockNames ) ;
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
case 'HIDE_BLOCK_TYPES' :
return Object ( external _lodash _ [ "union" ] ) ( state , action . blockNames ) ;
}
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
return state ;
} ,
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
preferredStyleVariations ( state , action ) {
switch ( action . type ) {
case 'UPDATE_PREFERRED_STYLE_VARIATIONS' :
{
if ( ! action . blockName ) {
return state ;
}
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
if ( ! action . blockStyle ) {
return Object ( external _lodash _ [ "omit" ] ) ( state , [ action . blockName ] ) ;
}
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
return { ... state ,
[ action . blockName ] : action . blockStyle
} ;
}
}
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
return state ;
} ,
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
localAutosaveInterval ( state , action ) {
switch ( action . type ) {
case 'UPDATE_LOCAL_AUTOSAVE_INTERVAL' :
return action . interval ;
}
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
return state ;
}
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
} ) ;
2021-05-07 11:48:27 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Reducer storing the list of all programmatically removed panels .
*
* @ param { Array } state Current state .
* @ param { Object } action Action object .
*
* @ return { Array } Updated state .
2021-05-07 11:48:27 +00:00
* /
2021-11-15 12:50:17 +00:00
function removedPanels ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : [ ] ;
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2021-05-19 15:09:27 +00:00
switch ( action . type ) {
case 'REMOVE_PANEL' :
if ( ! Object ( external _lodash _ [ "includes" ] ) ( state , action . panelName ) ) {
return [ ... state , action . panelName ] ;
}
}
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
return state ;
}
2021-05-07 11:48:27 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Reducer for storing the name of the open modal , or null if no modal is open .
2021-05-07 11:48:27 +00:00
*
2021-05-19 15:09:27 +00:00
* @ param { Object } state Previous state .
* @ param { Object } action Action object containing the ` name ` of the modal
2021-05-07 11:48:27 +00:00
*
2021-05-19 15:09:27 +00:00
* @ return { Object } Updated state
2021-05-07 11:48:27 +00:00
* /
2021-11-15 12:50:17 +00:00
function activeModal ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : null ;
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2021-05-19 15:09:27 +00:00
switch ( action . type ) {
case 'OPEN_MODAL' :
return action . name ;
2020-01-22 22:06:21 +00:00
2021-05-19 15:09:27 +00:00
case 'CLOSE_MODAL' :
return null ;
}
2020-07-07 14:43:35 +00:00
2021-05-19 15:09:27 +00:00
return state ;
}
2021-11-15 12:50:17 +00:00
function publishSidebarActive ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : false ;
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2021-05-19 15:09:27 +00:00
switch ( action . type ) {
case 'OPEN_PUBLISH_SIDEBAR' :
return true ;
2020-10-13 13:10:30 +00:00
2021-05-19 15:09:27 +00:00
case 'CLOSE_PUBLISH_SIDEBAR' :
return false ;
2020-10-13 13:10:30 +00:00
2021-05-19 15:09:27 +00:00
case 'TOGGLE_PUBLISH_SIDEBAR' :
return ! state ;
2021-01-28 02:04:13 +00:00
}
2020-10-13 13:10:30 +00:00
2021-05-19 15:09:27 +00:00
return state ;
2019-09-19 15:19:18 +00:00
}
2021-05-19 15:09:27 +00:00
/ * *
* Reducer keeping track of the meta boxes isSaving state .
* A "true" value means the meta boxes saving request is in - flight .
*
*
2021-11-08 14:29:21 +00:00
* @ param { boolean } state Previous state .
* @ param { Object } action Action Object .
2021-05-19 15:09:27 +00:00
*
* @ return { Object } Updated state .
* /
2019-03-07 09:09:59 +00:00
2021-11-15 12:50:17 +00:00
function isSavingMetaBoxes ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : false ;
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2021-05-19 15:09:27 +00:00
switch ( action . type ) {
case 'REQUEST_META_BOX_UPDATES' :
return true ;
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
case 'META_BOX_UPDATES_SUCCESS' :
2021-11-08 14:29:21 +00:00
case 'META_BOX_UPDATES_FAILURE' :
2021-05-19 15:09:27 +00:00
return false ;
2020-03-23 23:40:19 +00:00
2021-05-19 15:09:27 +00:00
default :
return state ;
}
}
/ * *
* Reducer keeping track of the meta boxes per location .
*
2021-11-08 14:29:21 +00:00
* @ param { boolean } state Previous state .
* @ param { Object } action Action Object .
2021-05-19 15:09:27 +00:00
*
* @ return { Object } Updated state .
* /
2020-03-23 23:40:19 +00:00
2021-11-15 12:50:17 +00:00
function metaBoxLocations ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2021-05-19 15:09:27 +00:00
switch ( action . type ) {
case 'SET_META_BOXES_PER_LOCATIONS' :
return action . metaBoxesPerLocation ;
}
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
return state ;
}
/ * *
* Reducer returning the editing canvas device type .
*
* @ param { Object } state Current state .
* @ param { Object } action Dispatched action .
*
* @ return { Object } Updated state .
* /
2020-07-07 14:43:35 +00:00
2021-11-15 12:50:17 +00:00
function deviceType ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : 'Desktop' ;
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2021-05-19 15:09:27 +00:00
switch ( action . type ) {
case 'SET_PREVIEW_DEVICE_TYPE' :
return action . deviceType ;
}
2020-07-07 14:43:35 +00:00
2021-05-19 15:09:27 +00:00
return state ;
2020-07-07 14:43:35 +00:00
}
2021-05-19 15:09:27 +00:00
/ * *
2021-05-21 10:14:23 +00:00
* Reducer to set the block inserter panel open or closed .
2021-05-19 15:09:27 +00:00
*
2021-05-21 10:14:23 +00:00
* Note : this reducer interacts with the list view panel reducer
* to make sure that only one of the two panels is open at the same time .
*
2021-11-08 14:29:21 +00:00
* @ param { Object } state Current state .
2021-05-21 10:14:23 +00:00
* @ param { Object } action Dispatched action .
2021-05-19 15:09:27 +00:00
* /
2020-07-07 14:43:35 +00:00
2021-11-15 12:50:17 +00:00
function blockInserterPanel ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : false ;
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2021-05-19 15:09:27 +00:00
switch ( action . type ) {
2021-05-21 10:14:23 +00:00
case 'SET_IS_LIST_VIEW_OPENED' :
return action . isOpen ? false : state ;
2021-05-19 15:09:27 +00:00
case 'SET_IS_INSERTER_OPENED' :
return action . value ;
}
2020-07-07 14:43:35 +00:00
2021-05-19 15:09:27 +00:00
return state ;
2021-01-28 02:04:13 +00:00
}
2021-05-21 10:14:23 +00:00
/ * *
* Reducer to set the list view panel open or closed .
*
* Note : this reducer interacts with the inserter panel reducer
* to make sure that only one of the two panels is open at the same time .
*
2021-11-08 14:29:21 +00:00
* @ param { Object } state Current state .
2021-05-21 10:14:23 +00:00
* @ param { Object } action Dispatched action .
* /
2021-11-15 12:50:17 +00:00
function listViewPanel ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : false ;
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2021-05-21 10:14:23 +00:00
switch ( action . type ) {
case 'SET_IS_INSERTER_OPENED' :
return action . value ? false : state ;
case 'SET_IS_LIST_VIEW_OPENED' :
return action . isOpen ;
}
return state ;
}
2021-05-19 15:09:27 +00:00
/ * *
* Reducer tracking whether the inserter is open .
*
* @ param { boolean } state
* @ param { Object } action
* /
2020-07-07 14:43:35 +00:00
2021-11-15 12:50:17 +00:00
function isEditingTemplate ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : false ;
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2021-05-19 15:09:27 +00:00
switch ( action . type ) {
case 'SET_IS_EDITING_TEMPLATE' :
return action . value ;
}
2020-07-07 14:43:35 +00:00
2021-05-19 15:09:27 +00:00
return state ;
2020-07-07 14:43:35 +00:00
}
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 19:08:24 +00:00
/ * *
* Reducer tracking whether meta boxes are initialized .
*
* @ param { boolean } state
* @ param { Object } action
*
* @ return { boolean } Updated state .
* /
2021-11-15 12:50:17 +00:00
function metaBoxesInitialized ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : false ;
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 19:08:24 +00:00
switch ( action . type ) {
case 'META_BOXES_INITIALIZED' :
return true ;
}
return state ;
}
2018-12-18 03:14:52 +00:00
2021-05-19 15:09:27 +00:00
const metaBoxes = Object ( external _wp _data _ [ "combineReducers" ] ) ( {
isSaving : isSavingMetaBoxes ,
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 19:08:24 +00:00
locations : metaBoxLocations ,
initialized : metaBoxesInitialized
2021-05-19 15:09:27 +00:00
} ) ;
/* harmony default export */ var reducer = ( Object ( external _wp _data _ [ "combineReducers" ] ) ( {
activeModal ,
metaBoxes ,
preferences ,
publishSidebarActive ,
removedPanels ,
deviceType ,
blockInserterPanel ,
2021-05-21 10:14:23 +00:00
listViewPanel ,
2021-05-19 15:09:27 +00:00
isEditingTemplate
} ) ) ;
2018-12-18 03:14:52 +00:00
2021-05-19 15:09:27 +00:00
// EXTERNAL MODULE: external ["wp","i18n"]
2021-05-20 12:20:04 +00:00
var external _wp _i18n _ = _ _webpack _require _ _ ( "l3Sj" ) ;
2021-02-02 05:17:13 +00:00
2021-11-08 14:29:21 +00:00
// EXTERNAL MODULE: ./node_modules/@wordpress/interface/build-module/index.js + 17 modules
2021-05-20 12:20:04 +00:00
var build _module = _ _webpack _require _ _ ( "U60i" ) ;
2021-02-02 05:17:13 +00:00
2021-05-19 15:09:27 +00:00
// EXTERNAL MODULE: external ["wp","a11y"]
2021-05-20 12:20:04 +00:00
var external _wp _a11y _ = _ _webpack _require _ _ ( "gdqT" ) ;
2021-02-02 05:17:13 +00:00
2021-05-19 15:09:27 +00:00
// EXTERNAL MODULE: external ["wp","notices"]
2021-05-20 12:20:04 +00:00
var external _wp _notices _ = _ _webpack _require _ _ ( "onLe" ) ;
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
// EXTERNAL MODULE: external ["wp","coreData"]
2021-05-20 12:20:04 +00:00
var external _wp _coreData _ = _ _webpack _require _ _ ( "jZUy" ) ;
2021-05-07 11:48:27 +00:00
2021-11-08 14:29:21 +00:00
// EXTERNAL MODULE: external ["wp","blockEditor"]
var external _wp _blockEditor _ = _ _webpack _require _ _ ( "axFQ" ) ;
// EXTERNAL MODULE: external ["wp","editor"]
var external _wp _editor _ = _ _webpack _require _ _ ( "jSdM" ) ;
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/utils/meta-boxes.js
/ * *
* Function returning the current Meta Boxes DOM Node in the editor
* whether the meta box area is opened or not .
* If the MetaBox Area is visible returns it , and returns the original container instead .
*
2021-11-08 14:29:21 +00:00
* @ param { string } location Meta Box location .
*
* @ return { string } HTML content .
2021-05-19 15:09:27 +00:00
* /
const getMetaBoxContainer = location => {
const area = document . querySelector ( ` .edit-post-meta-boxes-area.is- ${ location } .metabox-location- ${ location } ` ) ;
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
if ( area ) {
return area ;
}
2018-12-18 03:14:52 +00:00
2021-05-19 15:09:27 +00:00
return document . querySelector ( '#metaboxes .metabox-location-' + location ) ;
} ;
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/store/actions.js
/ * *
* External dependencies
* /
2018-12-18 03:14:52 +00:00
2021-01-28 02:04:13 +00:00
/ * *
* WordPress dependencies
* /
2018-12-18 03:14:52 +00:00
2019-03-21 12:48:00 +00:00
2021-05-19 15:09:27 +00:00
2019-03-07 09:09:59 +00:00
2020-06-29 11:50:29 +00:00
2021-11-08 14:29:21 +00:00
2020-07-07 14:43:35 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Internal dependencies
2020-07-07 14:43:35 +00:00
* /
2019-03-07 09:09:59 +00:00
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* 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 .
* /
2019-03-07 09:09:59 +00:00
2021-05-19 15:09:27 +00:00
function * openGeneralSidebar ( name ) {
2021-11-08 14:29:21 +00:00
yield external _wp _data _ [ "controls" ] . dispatch ( build _module [ "i" /* store */ ] , 'enableComplementaryArea' , store . name , name ) ;
2021-05-19 15:09:27 +00:00
}
/ * *
* Returns an action object signalling that the user closed the sidebar .
*
* @ yield { Object } Action object .
* /
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
function * closeGeneralSidebar ( ) {
2021-11-08 14:29:21 +00:00
yield external _wp _data _ [ "controls" ] . dispatch ( build _module [ "i" /* store */ ] , 'disableComplementaryArea' , store . name ) ;
2021-05-19 15:09:27 +00:00
}
/ * *
* Returns an action object used in signalling that the user opened a modal .
*
* @ param { string } name A string that uniquely identifies the modal .
*
* @ return { Object } Action object .
* /
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
function openModal ( name ) {
return {
type : 'OPEN_MODAL' ,
name
} ;
}
2020-07-07 14:43:35 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Returns an action object signalling that the user closed a modal .
*
* @ return { Object } Action object .
2020-07-07 14:43:35 +00:00
* /
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
function closeModal ( ) {
return {
type : 'CLOSE_MODAL'
} ;
}
/ * *
* Returns an action object used in signalling that the user opened the publish
* sidebar .
*
* @ return { Object } Action object
* /
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
function openPublishSidebar ( ) {
return {
type : 'OPEN_PUBLISH_SIDEBAR'
} ;
}
/ * *
* Returns an action object used in signalling that the user closed the
* publish sidebar .
*
* @ return { Object } Action object .
* /
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
function closePublishSidebar ( ) {
return {
type : 'CLOSE_PUBLISH_SIDEBAR'
} ;
}
/ * *
* Returns an action object used in signalling that the user toggles the publish sidebar .
*
* @ return { Object } Action object
* /
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
function togglePublishSidebar ( ) {
return {
type : 'TOGGLE_PUBLISH_SIDEBAR'
} ;
}
/ * *
* Returns an action object used to enable or disable a panel in the editor .
*
* @ param { string } panelName A string that identifies the panel to enable or disable .
*
* @ return { Object } Action object .
* /
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
function toggleEditorPanelEnabled ( panelName ) {
return {
type : 'TOGGLE_PANEL_ENABLED' ,
panelName
} ;
}
/ * *
* Returns an action object used to open or close a panel in the editor .
*
* @ param { string } panelName A string that identifies the panel to open or close .
*
* @ return { Object } Action object .
* /
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
function toggleEditorPanelOpened ( panelName ) {
return {
type : 'TOGGLE_PANEL_OPENED' ,
panelName
} ;
}
/ * *
* Returns an action object used to remove a panel from the editor .
*
* @ param { string } panelName A string that identifies the panel to remove .
*
* @ return { Object } Action object .
* /
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
function removeEditorPanel ( panelName ) {
return {
type : 'REMOVE_PANEL' ,
panelName
} ;
2021-05-07 11:48:27 +00:00
}
2021-05-19 15:09:27 +00:00
/ * *
2021-11-08 14:29:21 +00:00
* Triggers an action used to toggle a feature flag .
2021-05-19 15:09:27 +00:00
*
* @ param { string } feature Feature name .
* /
2021-05-07 11:48:27 +00:00
2021-11-08 14:29:21 +00:00
function * toggleFeature ( feature ) {
yield external _wp _data _ [ "controls" ] . dispatch ( build _module [ "i" /* store */ ] . name , 'toggleFeature' , 'core/edit-post' , feature ) ;
2021-05-19 15:09:27 +00:00
}
function * switchEditorMode ( mode ) {
yield {
type : 'SWITCH_MODE' ,
mode
} ; // Unselect blocks when we switch to the code editor.
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
if ( mode !== 'visual' ) {
2021-11-08 14:29:21 +00:00
yield external _wp _data _ [ "controls" ] . dispatch ( external _wp _blockEditor _ [ "store" ] , 'clearSelectedBlock' ) ;
2021-05-19 15:09:27 +00:00
}
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
const message = mode === 'visual' ? Object ( external _wp _i18n _ [ "__" ] ) ( 'Visual editor selected' ) : Object ( external _wp _i18n _ [ "__" ] ) ( 'Code editor selected' ) ;
Object ( external _wp _a11y _ [ "speak" ] ) ( message , 'assertive' ) ;
}
/ * *
2021-11-08 14:29:21 +00:00
* Triggers an action object used to toggle a plugin name flag .
2021-05-19 15:09:27 +00:00
*
* @ param { string } pluginName Plugin name .
* /
2021-05-07 11:48:27 +00:00
2021-11-08 14:29:21 +00:00
function * togglePinnedPluginItem ( pluginName ) {
const isPinned = yield external _wp _data _ [ "controls" ] . select ( build _module [ "i" /* store */ ] , 'isItemPinned' , 'core/edit-post' , pluginName ) ;
yield external _wp _data _ [ "controls" ] . dispatch ( build _module [ "i" /* store */ ] , isPinned ? 'unpinItem' : 'pinItem' , 'core/edit-post' , pluginName ) ;
2021-05-19 15:09:27 +00:00
}
/ * *
* Returns an action object used in signalling that block types by the given
* name ( s ) should be hidden .
*
* @ param { string [ ] } blockNames Names of block types to hide .
*
* @ return { Object } Action object .
* /
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
function hideBlockTypes ( blockNames ) {
return {
type : 'HIDE_BLOCK_TYPES' ,
blockNames : Object ( external _lodash _ [ "castArray" ] ) ( blockNames )
} ;
}
/ * *
* Returns an action object used in signaling that a style should be auto - applied when a block is created .
*
* @ param { string } blockName Name of the block .
* @ param { ? string } blockStyle Name of the style that should be auto applied . If undefined , the "auto apply" setting of the block is removed .
*
* @ return { Object } Action object .
* /
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
function updatePreferredStyleVariations ( blockName , blockStyle ) {
return {
type : 'UPDATE_PREFERRED_STYLE_VARIATIONS' ,
blockName ,
blockStyle
} ;
}
/ * *
* Returns an action object used in signalling that the editor should attempt
* to locally autosave the current post every ` interval ` seconds .
*
* @ param { number } interval The new interval , in seconds .
* @ return { Object } Action object .
* /
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
function _ _experimentalUpdateLocalAutosaveInterval ( interval ) {
return {
type : 'UPDATE_LOCAL_AUTOSAVE_INTERVAL' ,
interval
} ;
}
2020-06-26 13:33:47 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Returns an action object used in signalling that block types by the given
* name ( s ) should be shown .
*
* @ param { string [ ] } blockNames Names of block types to show .
*
* @ return { Object } Action object .
2020-06-26 13:33:47 +00:00
* /
2021-05-19 15:09:27 +00:00
function showBlockTypes ( blockNames ) {
return {
type : 'SHOW_BLOCK_TYPES' ,
blockNames : Object ( external _lodash _ [ "castArray" ] ) ( blockNames )
} ;
}
2020-06-26 13:33:47 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Returns an action object used in signaling
* what Meta boxes are available in which location .
*
* @ param { Object } metaBoxesPerLocation Meta boxes per location .
*
* @ yield { Object } Action object .
2020-06-26 13:33:47 +00:00
* /
2021-05-19 15:09:27 +00:00
function * setAvailableMetaBoxesPerLocation ( metaBoxesPerLocation ) {
yield {
type : 'SET_META_BOXES_PER_LOCATIONS' ,
metaBoxesPerLocation
} ;
}
2020-06-26 13:33:47 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Returns an action object used to request meta box update .
*
* @ yield { Object } Action object .
2020-06-26 13:33:47 +00:00
* /
2021-05-19 15:09:27 +00:00
function * requestMetaBoxUpdates ( ) {
yield {
type : 'REQUEST_META_BOX_UPDATES'
} ; // Saves the wp_editor fields
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
if ( window . tinyMCE ) {
window . tinyMCE . triggerSave ( ) ;
} // Additional data needed for backward compatibility.
// If we do not provide this data, the post will be overridden with the default values.
2020-06-26 13:33:47 +00:00
2021-01-28 02:04:13 +00:00
2021-11-08 14:29:21 +00:00
const post = yield external _wp _data _ [ "controls" ] . select ( external _wp _editor _ [ "store" ] , 'getCurrentPost' ) ;
2021-05-19 15:09:27 +00:00
const additionalData = [ post . comment _status ? [ 'comment_status' , post . comment _status ] : false , post . ping _status ? [ 'ping_status' , post . ping _status ] : false , post . sticky ? [ 'sticky' , post . sticky ] : false , post . author ? [ 'post_author' , post . author ] : false ] . filter ( Boolean ) ; // We gather all the metaboxes locations data and the base form data
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
const baseFormData = new window . FormData ( document . querySelector ( '.metabox-base-form' ) ) ;
2021-11-08 14:29:21 +00:00
const activeMetaBoxLocations = yield external _wp _data _ [ "controls" ] . select ( store , 'getActiveMetaBoxLocations' ) ;
2021-05-19 15:09:27 +00:00
const formDataToMerge = [ baseFormData , ... activeMetaBoxLocations . map ( location => new window . FormData ( getMetaBoxContainer ( location ) ) ) ] ; // Merge all form data objects into a single one.
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
const formData = Object ( external _lodash _ [ "reduce" ] ) ( formDataToMerge , ( memo , currentFormData ) => {
for ( const [ key , value ] of currentFormData ) {
memo . append ( key , value ) ;
}
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
return memo ;
} , new window . FormData ( ) ) ;
2021-11-15 12:50:17 +00:00
additionalData . forEach ( _ref => {
let [ key , value ] = _ref ;
return formData . append ( key , value ) ;
} ) ;
2021-11-08 14:29:21 +00:00
try {
// Save the metaboxes
yield Object ( external _wp _dataControls _ [ "apiFetch" ] ) ( {
url : window . _wpMetaBoxUrl ,
method : 'POST' ,
body : formData ,
parse : false
} ) ;
yield external _wp _data _ [ "controls" ] . dispatch ( store , 'metaBoxUpdatesSuccess' ) ;
} catch {
yield external _wp _data _ [ "controls" ] . dispatch ( store , 'metaBoxUpdatesFailure' ) ;
}
2021-05-19 15:09:27 +00:00
}
2020-06-26 13:33:47 +00:00
/ * *
2021-11-08 14:29:21 +00:00
* Returns an action object used to signal a successful meta box update .
2020-06-26 13:33:47 +00:00
*
2021-05-19 15:09:27 +00:00
* @ return { Object } Action object .
* /
function metaBoxUpdatesSuccess ( ) {
return {
type : 'META_BOX_UPDATES_SUCCESS'
} ;
}
2021-11-08 14:29:21 +00:00
/ * *
* Returns an action object used to signal a failed meta box update .
*
* @ return { Object } Action object .
* /
function metaBoxUpdatesFailure ( ) {
return {
type : 'META_BOX_UPDATES_FAILURE'
} ;
}
2021-05-19 15:09:27 +00:00
/ * *
* Returns an action object used to toggle the width of the editing canvas .
2020-06-26 13:33:47 +00:00
*
2021-05-19 15:09:27 +00:00
* @ param { string } deviceType
2020-06-26 13:33:47 +00:00
*
2021-05-19 15:09:27 +00:00
* @ return { Object } Action object .
2020-06-26 13:33:47 +00:00
* /
2021-05-19 15:09:27 +00:00
function _ _experimentalSetPreviewDeviceType ( deviceType ) {
2020-06-26 13:33:47 +00:00
return {
2021-05-19 15:09:27 +00:00
type : 'SET_PREVIEW_DEVICE_TYPE' ,
deviceType
2020-06-26 13:33:47 +00:00
} ;
2021-05-19 15:09:27 +00:00
}
/ * *
* Returns an action object used to open / close the inserter .
*
* @ param { boolean | Object } value Whether the inserter should be
* opened ( true ) or closed ( false ) .
* To specify an insertion point ,
* use an object .
* @ param { string } value . rootClientId The root client ID to insert at .
* @ param { number } value . insertionIndex The index to insert at .
*
* @ return { Object } Action object .
* /
function setIsInserterOpened ( value ) {
2020-06-26 13:33:47 +00:00
return {
2021-05-19 15:09:27 +00:00
type : 'SET_IS_INSERTER_OPENED' ,
value
2020-06-26 13:33:47 +00:00
} ;
2021-05-19 15:09:27 +00:00
}
2021-05-21 10:14:23 +00:00
/ * *
* Returns an action object used to open / close the list view .
*
* @ param { boolean } isOpen A boolean representing whether the list view should be opened or closed .
* @ return { Object } Action object .
* /
function setIsListViewOpened ( isOpen ) {
return {
type : 'SET_IS_LIST_VIEW_OPENED' ,
isOpen
} ;
}
2021-05-19 15:09:27 +00:00
/ * *
* Returns an action object used to switch to template editing .
*
* @ param { boolean } value Is editing template .
* @ return { Object } Action object .
* /
function setIsEditingTemplate ( value ) {
2020-06-26 13:33:47 +00:00
return {
2021-05-19 15:09:27 +00:00
type : 'SET_IS_EDITING_TEMPLATE' ,
value
2020-06-26 13:33:47 +00:00
} ;
2021-01-28 02:04:13 +00:00
}
2020-10-13 13:10:30 +00:00
/ * *
2021-11-08 14:29:21 +00:00
* Switches to the template mode .
2021-05-19 15:09:27 +00:00
*
2021-11-08 14:29:21 +00:00
* @ param { boolean } newTemplate Is new template .
2020-10-13 13:10:30 +00:00
* /
2021-11-15 12:50:17 +00:00
function * _ _unstableSwitchToTemplateMode ( ) {
let newTemplate = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : false ;
2021-05-19 15:09:27 +00:00
yield setIsEditingTemplate ( true ) ;
2021-11-08 14:29:21 +00:00
const isWelcomeGuideActive = yield external _wp _data _ [ "controls" ] . select ( store , 'isFeatureActive' , 'welcomeGuideTemplate' ) ;
2021-06-01 08:10:04 +00:00
if ( ! isWelcomeGuideActive ) {
2021-11-08 14:29:21 +00:00
const message = newTemplate ? Object ( external _wp _i18n _ [ "__" ] ) ( "Custom template created. You're in template mode now." ) : Object ( external _wp _i18n _ [ "__" ] ) ( 'Editing template. Changes made here affect all posts and pages that use the template.' ) ;
2021-06-01 08:10:04 +00:00
yield external _wp _data _ [ "controls" ] . dispatch ( external _wp _notices _ [ "store" ] , 'createSuccessNotice' , message , {
type : 'snackbar'
} ) ;
}
2021-04-15 15:19:43 +00:00
}
2021-11-08 14:29:21 +00:00
/ * *
* Create a block based template .
*
* @ param { Object ? } template Template to create and assign .
* /
function * _ _unstableCreateTemplate ( template ) {
const savedTemplate = yield external _wp _data _ [ "controls" ] . dispatch ( external _wp _coreData _ [ "store" ] , 'saveEntityRecord' , 'postType' , 'wp_template' , template ) ;
const post = yield external _wp _data _ [ "controls" ] . select ( external _wp _editor _ [ "store" ] , 'getCurrentPost' ) ;
yield external _wp _data _ [ "controls" ] . dispatch ( external _wp _coreData _ [ "store" ] , 'editEntityRecord' , 'postType' , post . type , post . id , {
template : savedTemplate . slug
} ) ;
}
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 19:08:24 +00:00
let actions _metaBoxesInitialized = false ;
/ * *
* Initializes WordPress ` postboxes ` script and the logic for saving meta boxes .
* /
function * initializeMetaBoxes ( ) {
2021-11-08 14:29:21 +00:00
const isEditorReady = yield external _wp _data _ [ "controls" ] . select ( external _wp _editor _ [ "store" ] , '__unstableIsEditorReady' ) ;
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 19:08:24 +00:00
if ( ! isEditorReady ) {
return ;
}
2021-11-08 14:29:21 +00:00
const postType = yield external _wp _data _ [ "controls" ] . select ( external _wp _editor _ [ "store" ] , 'getCurrentPostType' ) ; // Only initialize once.
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 19:08:24 +00:00
if ( actions _metaBoxesInitialized ) {
return ;
}
if ( window . postboxes . page !== postType ) {
window . postboxes . add _postbox _toggles ( postType ) ;
}
actions _metaBoxesInitialized = true ;
2021-11-08 14:29:21 +00:00
let wasSavingPost = yield external _wp _data _ [ "controls" ] . select ( external _wp _editor _ [ "store" ] , 'isSavingPost' ) ;
let wasAutosavingPost = yield external _wp _data _ [ "controls" ] . select ( external _wp _editor _ [ "store" ] , 'isAutosavingPost' ) ;
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 19:08:24 +00:00
const hasMetaBoxes = yield external _wp _data _ [ "controls" ] . select ( store , 'hasMetaBoxes' ) ; // Save metaboxes when performing a full save on the post.
Object ( external _wp _data _ [ "subscribe" ] ) ( ( ) => {
2021-11-08 14:29:21 +00:00
const isSavingPost = Object ( external _wp _data _ [ "select" ] ) ( external _wp _editor _ [ "store" ] ) . isSavingPost ( ) ;
const isAutosavingPost = Object ( external _wp _data _ [ "select" ] ) ( external _wp _editor _ [ "store" ] ) . isAutosavingPost ( ) ; // Save metaboxes on save completion, except for autosaves that are not a post preview.
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 19:08:24 +00:00
//
// Meta boxes are initialized once at page load. It is not necessary to
// account for updates on each state change.
//
// See: https://github.com/WordPress/WordPress/blob/5.1.1/wp-admin/includes/post.php#L2307-L2309
const shouldTriggerMetaboxesSave = hasMetaBoxes && wasSavingPost && ! isSavingPost && ! wasAutosavingPost ; // Save current state for next inspection.
wasSavingPost = isSavingPost ;
wasAutosavingPost = isAutosavingPost ;
if ( shouldTriggerMetaboxesSave ) {
Object ( external _wp _data _ [ "dispatch" ] ) ( store ) . requestMetaBoxUpdates ( ) ;
}
} ) ;
return {
type : 'META_BOXES_INITIALIZED'
} ;
}
2021-04-15 15:19:43 +00:00
2021-05-19 15:09:27 +00:00
// EXTERNAL MODULE: ./node_modules/rememo/es/rememo.js
2021-05-20 12:20:04 +00:00
var rememo = _ _webpack _require _ _ ( "pPDe" ) ;
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/store/selectors.js
/ * *
* External dependencies
* /
2021-05-07 11:48:27 +00:00
/ * *
* WordPress dependencies
* /
2019-10-15 15:37:08 +00:00
2020-03-23 23:40:19 +00:00
2019-10-15 15:37:08 +00:00
2019-03-07 09:09:59 +00:00
2021-01-28 02:04:13 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Returns the current editing mode .
*
* @ param { Object } state Global application state .
*
* @ return { string } Editing mode .
2021-01-28 02:04:13 +00:00
* /
2019-03-07 09:09:59 +00:00
2021-05-19 15:09:27 +00:00
function getEditorMode ( state ) {
return getPreference ( state , 'editorMode' , 'visual' ) ;
}
2021-01-28 02:04:13 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Returns true if the editor sidebar is opened .
*
* @ param { Object } state Global application state
*
* @ return { boolean } Whether the editor sidebar is opened .
2021-01-28 02:04:13 +00:00
* /
2019-03-07 09:09:59 +00:00
2021-05-19 15:09:27 +00:00
const isEditorSidebarOpened = Object ( external _wp _data _ [ "createRegistrySelector" ] ) ( select => ( ) => {
2021-11-08 14:29:21 +00:00
const activeGeneralSidebar = select ( build _module [ "i" /* store */ ] ) . getActiveComplementaryArea ( 'core/edit-post' ) ;
2021-05-19 15:09:27 +00:00
return Object ( external _lodash _ [ "includes" ] ) ( [ 'edit-post/document' , 'edit-post/block' ] , activeGeneralSidebar ) ;
} ) ;
2021-01-28 02:04:13 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Returns true if the plugin sidebar is opened .
*
2021-11-08 14:29:21 +00:00
* @ param { Object } state Global application state .
*
* @ return { boolean } Whether the plugin sidebar is opened .
2021-01-28 02:04:13 +00:00
* /
2019-03-07 09:09:59 +00:00
2021-05-19 15:09:27 +00:00
const isPluginSidebarOpened = Object ( external _wp _data _ [ "createRegistrySelector" ] ) ( select => ( ) => {
2021-11-08 14:29:21 +00:00
const activeGeneralSidebar = select ( build _module [ "i" /* store */ ] ) . getActiveComplementaryArea ( 'core/edit-post' ) ;
2021-05-19 15:09:27 +00:00
return ! ! activeGeneralSidebar && ! Object ( external _lodash _ [ "includes" ] ) ( [ 'edit-post/document' , 'edit-post/block' ] , activeGeneralSidebar ) ;
} ) ;
2021-01-28 02:04:13 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Returns the current active general sidebar name , or null if there is no
* general sidebar active . The active general sidebar is a unique name to
* identify either an editor or plugin sidebar .
2021-01-28 02:04:13 +00:00
*
2021-05-19 15:09:27 +00:00
* Examples :
2021-01-28 02:04:13 +00:00
*
2021-05-19 15:09:27 +00:00
* - ` edit-post/document `
* - ` my-plugin/insert-image-sidebar `
2021-01-28 02:04:13 +00:00
*
2021-05-19 15:09:27 +00:00
* @ param { Object } state Global application state .
2021-01-28 02:04:13 +00:00
*
2021-05-19 15:09:27 +00:00
* @ return { ? string } Active general sidebar name .
2021-01-28 02:04:13 +00:00
* /
2020-03-23 23:40:19 +00:00
2021-05-19 15:09:27 +00:00
const getActiveGeneralSidebarName = Object ( external _wp _data _ [ "createRegistrySelector" ] ) ( select => ( ) => {
2021-11-08 14:29:21 +00:00
return select ( build _module [ "i" /* store */ ] ) . getActiveComplementaryArea ( 'core/edit-post' ) ;
2021-01-28 02:04:13 +00:00
} ) ;
/ * *
2021-05-19 15:09:27 +00:00
* Returns the preferences ( these preferences are persisted locally ) .
2021-01-28 02:04:13 +00:00
*
2021-05-19 15:09:27 +00:00
* @ param { Object } state Global application state .
2021-01-28 02:04:13 +00:00
*
2021-05-19 15:09:27 +00:00
* @ return { Object } Preferences Object .
2021-01-28 02:04:13 +00:00
* /
2020-10-20 13:36:16 +00:00
2021-05-19 15:09:27 +00:00
function getPreferences ( state ) {
return state . preferences ;
2021-01-28 02:04:13 +00:00
}
2020-06-26 13:33:47 +00:00
/ * *
2021-01-28 02:04:13 +00:00
*
2021-05-19 15:09:27 +00:00
* @ param { Object } state Global application state .
* @ param { string } preferenceKey Preference Key .
* @ param { * } defaultValue Default Value .
2021-01-28 02:04:13 +00:00
*
2021-05-19 15:09:27 +00:00
* @ return { * } Preference Value .
2020-06-26 13:33:47 +00:00
* /
2021-05-19 15:09:27 +00:00
function getPreference ( state , preferenceKey , defaultValue ) {
const preferences = getPreferences ( state ) ;
const value = preferences [ preferenceKey ] ;
return value === undefined ? defaultValue : value ;
2021-01-28 02:04:13 +00:00
}
2021-05-19 15:09:27 +00:00
/ * *
* Returns true if the publish sidebar is opened .
*
* @ param { Object } state Global application state
*
* @ return { boolean } Whether the publish sidebar is open .
* /
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
function isPublishSidebarOpened ( state ) {
return state . publishSidebarActive ;
2021-01-28 02:04:13 +00:00
}
2020-06-26 13:33:47 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Returns true if the given panel was programmatically removed , or false otherwise .
* All panels are not removed by default .
2021-01-28 02:04:13 +00:00
*
2021-05-19 15:09:27 +00:00
* @ param { Object } state Global application state .
* @ param { string } panelName A string that identifies the panel .
2021-01-28 02:04:13 +00:00
*
2021-05-19 15:09:27 +00:00
* @ return { boolean } Whether or not the panel is removed .
2020-06-26 13:33:47 +00:00
* /
2021-05-19 15:09:27 +00:00
function isEditorPanelRemoved ( state , panelName ) {
return Object ( external _lodash _ [ "includes" ] ) ( state . removedPanels , panelName ) ;
2020-12-01 12:19:43 +00:00
}
2021-01-28 02:04:13 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Returns true if the given panel is enabled , or false otherwise . Panels are
* enabled by default .
2021-01-28 02:04:13 +00:00
*
2021-05-19 15:09:27 +00:00
* @ param { Object } state Global application state .
* @ param { string } panelName A string that identifies the panel .
2021-01-28 02:04:13 +00:00
*
2021-05-19 15:09:27 +00:00
* @ return { boolean } Whether or not the panel is enabled .
2021-01-28 02:04:13 +00:00
* /
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
function isEditorPanelEnabled ( state , panelName ) {
const panels = getPreference ( state , 'panels' ) ;
return ! isEditorPanelRemoved ( state , panelName ) && Object ( external _lodash _ [ "get" ] ) ( panels , [ panelName , 'enabled' ] , true ) ;
2021-01-28 02:04:13 +00:00
}
2020-06-26 13:33:47 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Returns true if the given panel is open , or false otherwise . Panels are
* closed by default .
2021-01-28 02:04:13 +00:00
*
2021-11-08 14:29:21 +00:00
* @ param { Object } state Global application state .
* @ param { string } panelName A string that identifies the panel .
2021-01-28 02:04:13 +00:00
*
2021-05-19 15:09:27 +00:00
* @ return { boolean } Whether or not the panel is open .
2020-06-26 13:33:47 +00:00
* /
2021-05-19 15:09:27 +00:00
function isEditorPanelOpened ( state , panelName ) {
const panels = getPreference ( state , 'panels' ) ;
return Object ( external _lodash _ [ "get" ] ) ( panels , [ panelName ] ) === true || Object ( external _lodash _ [ "get" ] ) ( panels , [ panelName , 'opened' ] ) === true ;
2021-01-28 02:04:13 +00:00
}
/ * *
2021-05-19 15:09:27 +00:00
* Returns true if a modal is active , or false otherwise .
2021-01-28 02:04:13 +00:00
*
2021-11-08 14:29:21 +00:00
* @ param { Object } state Global application state .
* @ param { string } modalName A string that uniquely identifies the modal .
2021-05-19 15:09:27 +00:00
*
* @ return { boolean } Whether the modal is active .
2021-01-28 02:04:13 +00:00
* /
2019-03-07 09:09:59 +00:00
2021-05-19 15:09:27 +00:00
function isModalActive ( state , modalName ) {
return state . activeModal === modalName ;
2021-01-28 02:04:13 +00:00
}
/ * *
2021-05-19 15:09:27 +00:00
* Returns whether the given feature is enabled or not .
2021-01-28 02:04:13 +00:00
*
2021-05-19 15:09:27 +00:00
* @ param { Object } state Global application state .
* @ param { string } feature Feature slug .
*
* @ return { boolean } Is active .
2021-01-28 02:04:13 +00:00
* /
2019-10-15 15:37:08 +00:00
2021-11-08 14:29:21 +00:00
const isFeatureActive = Object ( external _wp _data _ [ "createRegistrySelector" ] ) ( select => ( state , feature ) => {
return select ( build _module [ "i" /* store */ ] ) . isFeatureActive ( 'core/edit-post' , feature ) ;
} ) ;
2021-05-19 15:09:27 +00:00
/ * *
* Returns true if the plugin item is pinned to the header .
* When the value is not set it defaults to true .
*
2021-11-08 14:29:21 +00:00
* @ param { Object } state Global application state .
* @ param { string } pluginName Plugin item name .
2021-05-19 15:09:27 +00:00
*
* @ return { boolean } Whether the plugin item is pinned .
* /
2020-03-23 23:40:19 +00:00
2021-11-08 14:29:21 +00:00
const isPluginItemPinned = Object ( external _wp _data _ [ "createRegistrySelector" ] ) ( select => ( state , pluginName ) => {
return select ( build _module [ "i" /* store */ ] ) . isItemPinned ( 'core/edit-post' , pluginName ) ;
2021-01-28 02:04:13 +00:00
} ) ;
2021-05-19 15:09:27 +00:00
/ * *
* Returns an array of active meta box locations .
*
* @ param { Object } state Post editor state .
*
* @ return { string [ ] } Active meta box locations .
* /
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
const getActiveMetaBoxLocations = Object ( rememo [ "a" /* default */ ] ) ( state => {
return Object . keys ( state . metaBoxes . locations ) . filter ( location => isMetaBoxLocationActive ( state , location ) ) ;
} , state => [ state . metaBoxes . locations ] ) ;
2019-09-19 15:19:18 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Returns true if a metabox location is active and visible
2020-01-22 22:06:21 +00:00
*
2021-05-19 15:09:27 +00:00
* @ param { Object } state Post editor state .
* @ param { string } location Meta box location to test .
2021-01-28 02:04:13 +00:00
*
2021-05-19 15:09:27 +00:00
* @ return { boolean } Whether the meta box location is active and visible .
2019-09-19 15:19:18 +00:00
* /
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
function isMetaBoxLocationVisible ( state , location ) {
2021-11-15 12:50:17 +00:00
return isMetaBoxLocationActive ( state , location ) && Object ( external _lodash _ [ "some" ] ) ( getMetaBoxesPerLocation ( state , location ) , _ref => {
let {
id
} = _ref ;
2021-05-19 15:09:27 +00:00
return isEditorPanelEnabled ( state , ` meta-box- ${ id } ` ) ;
} ) ;
2021-01-28 02:04:13 +00:00
}
2019-09-19 15:19:18 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Returns true if there is an active meta box in the given location , or false
* otherwise .
2020-01-22 22:06:21 +00:00
*
2021-05-19 15:09:27 +00:00
* @ param { Object } state Post editor state .
* @ param { string } location Meta box location to test .
*
* @ return { boolean } Whether the meta box location is active .
2019-09-19 15:19:18 +00:00
* /
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
function isMetaBoxLocationActive ( state , location ) {
const metaBoxes = getMetaBoxesPerLocation ( state , location ) ;
return ! ! metaBoxes && metaBoxes . length !== 0 ;
2021-01-28 02:04:13 +00:00
}
2019-10-15 15:37:08 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Returns the list of all the available meta boxes for a given location .
2019-10-15 15:37:08 +00:00
*
2021-05-19 15:09:27 +00:00
* @ param { Object } state Global application state .
* @ param { string } location Meta box location to test .
2019-10-15 15:37:08 +00:00
*
2021-05-19 15:09:27 +00:00
* @ return { ? Array } List of meta boxes .
2019-10-15 15:37:08 +00:00
* /
2020-01-22 22:06:21 +00:00
2021-05-19 15:09:27 +00:00
function getMetaBoxesPerLocation ( state , location ) {
return state . metaBoxes . locations [ location ] ;
2021-01-28 02:04:13 +00:00
}
2020-01-22 22:06:21 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Returns the list of all the available meta boxes .
2020-01-22 22:06:21 +00:00
*
2021-05-19 15:09:27 +00:00
* @ param { Object } state Global application state .
*
* @ return { Array } List of meta boxes .
2020-01-22 22:06:21 +00:00
* /
2021-05-19 15:09:27 +00:00
const getAllMetaBoxes = Object ( rememo [ "a" /* default */ ] ) ( state => {
return Object ( external _lodash _ [ "flatten" ] ) ( Object ( external _lodash _ [ "values" ] ) ( state . metaBoxes . locations ) ) ;
} , state => [ state . metaBoxes . locations ] ) ;
2020-01-22 22:06:21 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Returns true if the post is using Meta Boxes
2020-01-22 22:06:21 +00:00
*
2021-11-08 14:29:21 +00:00
* @ param { Object } state Global application state
2021-05-19 15:09:27 +00:00
*
* @ return { boolean } Whether there are metaboxes or not .
2020-01-22 22:06:21 +00:00
* /
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 19:08:24 +00:00
function selectors _hasMetaBoxes ( state ) {
2021-05-19 15:09:27 +00:00
return getActiveMetaBoxLocations ( state ) . length > 0 ;
2020-01-22 22:06:21 +00:00
}
/ * *
2021-05-19 15:09:27 +00:00
* Returns true if the Meta Boxes are being saved .
2020-01-22 22:06:21 +00:00
*
2021-11-08 14:29:21 +00:00
* @ param { Object } state Global application state .
2021-05-19 15:09:27 +00:00
*
* @ return { boolean } Whether the metaboxes are being saved .
2020-01-22 22:06:21 +00:00
* /
2021-05-19 15:09:27 +00:00
function selectors _isSavingMetaBoxes ( state ) {
return state . metaBoxes . isSaving ;
2021-01-28 02:04:13 +00:00
}
/ * *
2021-05-19 15:09:27 +00:00
* Returns the current editing canvas device type .
2021-01-28 02:04:13 +00:00
*
2021-05-19 15:09:27 +00:00
* @ param { Object } state Global application state .
*
* @ return { string } Device type .
2021-01-28 02:04:13 +00:00
* /
2020-01-22 22:06:21 +00:00
2021-05-19 15:09:27 +00:00
function _ _experimentalGetPreviewDeviceType ( state ) {
return state . deviceType ;
2021-01-28 02:04:13 +00:00
}
/ * *
2021-05-19 15:09:27 +00:00
* Returns true if the inserter is opened .
2021-01-28 02:04:13 +00:00
*
2021-11-08 14:29:21 +00:00
* @ param { Object } state Global application state .
2021-01-28 02:04:13 +00:00
*
2021-05-19 15:09:27 +00:00
* @ return { boolean } Whether the inserter is opened .
2021-01-28 02:04:13 +00:00
* /
2020-01-22 22:06:21 +00:00
2021-05-19 15:09:27 +00:00
function isInserterOpened ( state ) {
return ! ! state . blockInserterPanel ;
2021-01-28 02:04:13 +00:00
}
/ * *
2021-05-19 15:09:27 +00:00
* Get the insertion point for the inserter .
2021-01-28 02:04:13 +00:00
*
2021-05-19 15:09:27 +00:00
* @ param { Object } state Global application state .
2021-01-28 02:04:13 +00:00
*
2021-11-08 14:29:21 +00:00
* @ return { Object } The root client ID , index to insert at and starting filter value .
2021-01-28 02:04:13 +00:00
* /
2020-01-22 22:06:21 +00:00
2021-05-19 15:09:27 +00:00
function _ _experimentalGetInsertionPoint ( state ) {
const {
rootClientId ,
2021-11-08 14:29:21 +00:00
insertionIndex ,
filterValue
2021-05-19 15:09:27 +00:00
} = state . blockInserterPanel ;
2021-01-28 02:04:13 +00:00
return {
2021-05-19 15:09:27 +00:00
rootClientId ,
2021-11-08 14:29:21 +00:00
insertionIndex ,
filterValue
2021-01-28 02:04:13 +00:00
} ;
}
2021-05-21 10:14:23 +00:00
/ * *
* Returns true if the list view is opened .
*
2021-11-08 14:29:21 +00:00
* @ param { Object } state Global application state .
2021-05-21 10:14:23 +00:00
*
* @ return { boolean } Whether the list view is opened .
* /
function isListViewOpened ( state ) {
return state . listViewPanel ;
}
2021-01-28 02:04:13 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Returns true if the template editing mode is enabled .
2021-01-28 02:04:13 +00:00
*
2021-11-08 14:29:21 +00:00
* @ param { Object } state Global application state .
2021-01-28 02:04:13 +00:00
*
2021-05-19 15:09:27 +00:00
* @ return { boolean } Whether we ' re editing the template .
2021-01-28 02:04:13 +00:00
* /
2020-01-22 22:06:21 +00:00
2021-05-19 15:09:27 +00:00
function selectors _isEditingTemplate ( state ) {
return state . isEditingTemplate ;
2021-01-28 02:04:13 +00:00
}
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 19:08:24 +00:00
/ * *
* Returns true if meta boxes are initialized .
*
* @ param { Object } state Global application state .
*
* @ return { boolean } Whether meta boxes are initialized .
* /
function areMetaBoxesInitialized ( state ) {
return state . metaBoxes . initialized ;
}
2021-01-28 02:04:13 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Retrieves the template of the currently edited post .
2021-01-28 02:04:13 +00:00
*
2021-05-19 15:09:27 +00:00
* @ return { Object ? } Post Template .
2021-01-28 02:04:13 +00:00
* /
2020-01-22 22:06:21 +00:00
2021-05-19 15:09:27 +00:00
const getEditedPostTemplate = Object ( external _wp _data _ [ "createRegistrySelector" ] ) ( select => ( ) => {
const currentTemplate = select ( external _wp _editor _ [ "store" ] ) . getEditedPostAttribute ( 'template' ) ;
2020-01-22 22:06:21 +00:00
2021-05-19 15:09:27 +00:00
if ( currentTemplate ) {
var _select$getEntityReco ;
2020-01-22 22:06:21 +00:00
2022-02-17 19:18:25 +00:00
const templateWithSameSlug = ( _select$getEntityReco = select ( external _wp _coreData _ [ "store" ] ) . getEntityRecords ( 'postType' , 'wp_template' , {
per _page : - 1
} ) ) === null || _select$getEntityReco === void 0 ? void 0 : _select$getEntityReco . find ( template => template . slug === currentTemplate ) ;
2021-05-21 10:14:23 +00:00
if ( ! templateWithSameSlug ) {
return templateWithSameSlug ;
}
return select ( external _wp _coreData _ [ "store" ] ) . getEditedEntityRecord ( 'postType' , 'wp_template' , templateWithSameSlug . id ) ;
2021-05-19 15:09:27 +00:00
}
2020-01-22 22:06:21 +00:00
2021-05-19 15:09:27 +00:00
const post = select ( external _wp _editor _ [ "store" ] ) . getCurrentPost ( ) ;
2020-01-22 22:06:21 +00:00
2021-11-08 14:29:21 +00:00
if ( post . link ) {
2021-05-19 15:09:27 +00:00
return select ( external _wp _coreData _ [ "store" ] ) . _ _experimentalGetTemplateForLink ( post . link ) ;
}
return null ;
} ) ;
// EXTERNAL MODULE: ./node_modules/@wordpress/edit-post/build-module/store/constants.js
2021-05-20 12:20:04 +00:00
var constants = _ _webpack _require _ _ ( "0dt7" ) ;
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/store/index.js
2021-01-28 02:04:13 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* WordPress dependencies
2021-01-28 02:04:13 +00:00
* /
2020-01-22 22:06:21 +00:00
2021-05-19 15:09:27 +00:00
2021-01-28 02:04:13 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Internal dependencies
2021-01-28 02:04:13 +00:00
* /
2020-01-22 22:06:21 +00:00
2021-05-19 15:09:27 +00:00
const storeConfig = {
reducer : reducer ,
actions : actions _namespaceObject ,
selectors : selectors _namespaceObject ,
controls : external _wp _dataControls _ [ "controls" ] ,
persist : [ 'preferences' ]
} ;
2021-01-28 02:04:13 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Store definition for the edit post namespace .
2021-01-28 02:04:13 +00:00
*
2021-05-19 15:09:27 +00:00
* @ see https : //github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
2021-01-28 02:04:13 +00:00
*
2021-05-19 15:09:27 +00:00
* @ type { Object }
2021-01-28 02:04:13 +00:00
* /
2020-01-22 22:06:21 +00:00
2021-05-19 15:09:27 +00:00
const store = Object ( external _wp _data _ [ "createReduxStore" ] ) ( constants [ "a" /* STORE_NAME */ ] , storeConfig ) ; // Ideally we use register instead of register store.
Object ( external _wp _data _ [ "registerStore" ] ) ( constants [ "a" /* STORE_NAME */ ] , storeConfig ) ;
/***/ } ) ,
2021-05-20 12:20:04 +00:00
/***/ "TSYQ" :
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
2020-06-26 13:33:47 +00:00
2021-05-20 12:20:04 +00:00
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 */
2020-12-01 12:19:43 +00:00
2021-05-20 12:20:04 +00:00
( function ( ) {
'use strict' ;
2020-12-01 12:19:43 +00:00
2021-05-20 12:20:04 +00:00
var hasOwn = { } . hasOwnProperty ;
2020-12-01 12:19:43 +00:00
2021-05-20 12:20:04 +00:00
function classNames ( ) {
var classes = [ ] ;
2020-12-01 12:19:43 +00:00
2021-05-20 12:20:04 +00:00
for ( var i = 0 ; i < arguments . length ; i ++ ) {
var arg = arguments [ i ] ;
if ( ! arg ) continue ;
2020-10-13 13:10:30 +00:00
2021-05-20 12:20:04 +00:00
var argType = typeof arg ;
2020-10-13 13:10:30 +00:00
2021-05-20 12:20:04 +00:00
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 ( ) ) ;
}
}
}
2020-10-13 13:10:30 +00:00
2021-05-20 12:20:04 +00:00
return classes . join ( ' ' ) ;
}
2020-10-13 13:10:30 +00:00
2021-05-20 12:20:04 +00:00
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 { }
} ( ) ) ;
2020-10-13 13:10:30 +00:00
2021-05-19 15:09:27 +00:00
/***/ } ) ,
2020-10-13 13:10:30 +00:00
2021-05-20 12:20:04 +00:00
/***/ "Tqx9" :
/***/ ( function ( module , exports ) {
2020-07-21 12:14:37 +00:00
2021-05-20 12:20:04 +00:00
( function ( ) { module . exports = window [ "wp" ] [ "primitives" ] ; } ( ) ) ;
2020-07-21 12:14:37 +00:00
2021-05-20 12:20:04 +00:00
/***/ } ) ,
2020-07-21 12:14:37 +00:00
2021-05-20 12:20:04 +00:00
/***/ "TvNi" :
/***/ ( function ( module , exports ) {
2020-07-21 12:14:37 +00:00
2021-05-20 12:20:04 +00:00
( function ( ) { module . exports = window [ "wp" ] [ "plugins" ] ; } ( ) ) ;
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
/***/ } ) ,
2021-01-28 02:04:13 +00:00
2021-05-20 12:20:04 +00:00
/***/ "U60i" :
2021-05-19 15:09:27 +00:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
"use strict" ;
2021-01-28 02:04:13 +00:00
2021-05-20 12:20:04 +00:00
// 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 ; } ) ;
2021-11-08 14:29:21 +00:00
_ _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 ; } ) ;
2021-05-20 12:20:04 +00:00
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return /* reexport */ action _item ; } ) ;
2021-11-08 14:29:21 +00:00
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "i" , function ( ) { return /* reexport */ store ; } ) ;
2020-07-21 12:14:37 +00:00
2021-05-20 12:20:04 +00:00
// NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/store/actions.js
var actions _namespaceObject = { } ;
_ _webpack _require _ _ . r ( actions _namespaceObject ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "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 ; } ) ;
2021-11-08 14:29:21 +00:00
_ _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 ; } ) ;
2020-07-21 12:14:37 +00:00
2021-05-20 12:20:04 +00:00
// NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/store/selectors.js
var selectors _namespaceObject = { } ;
_ _webpack _require _ _ . r ( selectors _namespaceObject ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "getActiveComplementaryArea" , function ( ) { return selectors _getActiveComplementaryArea ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "isItemPinned" , function ( ) { return selectors _isItemPinned ; } ) ;
2021-11-08 14:29:21 +00:00
_ _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" ) ;
2020-12-01 12:19:43 +00:00
2021-05-20 12:20:04 +00:00
// EXTERNAL MODULE: external ["wp","data"]
var external _wp _data _ = _ _webpack _require _ _ ( "1ZqX" ) ;
2020-12-01 12:19:43 +00:00
2021-11-08 14:29:21 +00:00
// 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" ) ;
2021-05-20 12:20:04 +00:00
// EXTERNAL MODULE: external "lodash"
var external _lodash _ = _ _webpack _require _ _ ( "YLtl" ) ;
2020-12-01 12:19:43 +00:00
2021-05-20 12:20:04 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/reducer.js
2021-01-28 02:04:13 +00:00
/ * *
2021-05-20 12:20:04 +00:00
* External dependencies
2021-01-28 02:04:13 +00:00
* /
2020-01-22 22:06:21 +00:00
2021-05-07 11:48:27 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* WordPress dependencies
2021-05-07 11:48:27 +00:00
* /
2021-05-20 12:20:04 +00:00
/ * *
* 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-05-07 11:48:27 +00:00
2021-11-15 12:50:17 +00: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-05-20 12:20:04 +00:00
if ( type !== 'SET_SINGLE_ENABLE_ITEM' || ! itemType || ! scope ) {
return state ;
}
2021-05-07 11:48:27 +00:00
2021-05-20 12:20:04 +00:00
return { ... state ,
[ itemType ] : { ... state [ itemType ] ,
[ scope ] : item || null
}
} ;
2021-05-07 11:48:27 +00:00
}
2021-05-20 12:20:04 +00:00
/ * *
* 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-05-19 15:09:27 +00:00
2021-11-15 12:50:17 +00: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-05-20 12:20:04 +00:00
if ( type !== 'SET_MULTIPLE_ENABLE_ITEM' || ! itemType || ! scope || ! item || Object ( external _lodash _ [ "get" ] ) ( state , [ itemType , scope , item ] ) === isEnable ) {
return state ;
}
2021-05-19 15:09:27 +00:00
2021-05-20 12:20:04 +00:00
const currentTypeState = state [ itemType ] || { } ;
const currentScopeState = currentTypeState [ scope ] || { } ;
return { ... state ,
[ itemType ] : { ... currentTypeState ,
[ scope ] : { ... currentScopeState ,
[ item ] : isEnable || false
}
}
} ;
}
2021-11-08 14:29:21 +00:00
/ * *
* 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 12:50:17 +00:00
features ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2021-11-08 14:29:21 +00: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 12:50:17 +00:00
features ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2021-11-08 14:29:21 +00:00
if ( action . type === 'SET_FEATURE_VALUE' ) {
const {
scope ,
featureName ,
value
} = action ;
return { ... state ,
[ scope ] : { ... state [ scope ] ,
[ featureName ] : value
}
} ;
}
return state ;
}
} ) ;
2021-05-20 12:20:04 +00:00
const enableItems = Object ( external _wp _data _ [ "combineReducers" ] ) ( {
singleEnableItems ,
multipleEnableItems
} ) ;
/* harmony default export */ var reducer = ( Object ( external _wp _data _ [ "combineReducers" ] ) ( {
2021-11-08 14:29:21 +00:00
enableItems ,
preferenceDefaults ,
preferences
2021-05-20 12:20:04 +00:00
} ) ) ;
2021-05-19 15:09:27 +00:00
2021-05-20 12:20:04 +00:00
// 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 .
* /
2020-06-29 11:50:29 +00:00
2021-05-07 11:48:27 +00:00
2021-05-20 12:20:04 +00:00
function actions _enableComplementaryArea ( scope , area ) {
return setSingleEnableItem ( 'complementaryArea' , scope , area ) ;
}
2021-01-28 02:04:13 +00:00
/ * *
2021-05-20 12:20:04 +00:00
* 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 .
2021-01-28 02:04:13 +00:00
* /
2020-06-29 11:50:29 +00:00
2021-05-20 12:20:04 +00:00
function actions _disableComplementaryArea ( scope ) {
return setSingleEnableItem ( 'complementaryArea' , scope , undefined ) ;
}
2021-01-28 02:04:13 +00:00
/ * *
2021-05-20 12:20:04 +00:00
* 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 .
2021-01-28 02:04:13 +00:00
* /
2021-05-20 12:20:04 +00:00
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 .
* /
2020-01-22 22:06:21 +00:00
2021-05-20 12:20:04 +00:00
function actions _pinItem ( scope , itemId ) {
return setMultipleEnableItem ( 'pinnedItems' , scope , itemId , true ) ;
}
2021-01-28 02:04:13 +00:00
/ * *
2021-05-20 12:20:04 +00:00
* 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 .
2021-01-28 02:04:13 +00:00
* /
2021-05-20 12:20:04 +00:00
function actions _unpinItem ( scope , itemId ) {
return setMultipleEnableItem ( 'pinnedItems' , scope , itemId , false ) ;
}
2021-11-08 14:29:21 +00:00
/ * *
* Returns an action object used in signalling that a feature should be toggled .
*
* @ param { string } scope The feature scope ( e . g . core / edit - post ) .
* @ param { string } featureName The feature name .
* /
function actions _toggleFeature ( scope , featureName ) {
2021-11-15 12:50:17 +00:00
return function ( _ref ) {
let {
select ,
dispatch
} = _ref ;
2021-11-08 14:29:21 +00: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
} ;
}
2020-01-22 22:06:21 +00:00
2021-05-20 12:20:04 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/selectors.js
/ * *
* External dependencies
* /
2020-01-22 22:06:21 +00:00
2021-01-28 02:04:13 +00:00
/ * *
2021-05-20 12:20:04 +00:00
* Returns the item that is enabled in a given scope .
2021-01-28 02:04:13 +00:00
*
2021-05-20 12:20:04 +00:00
* @ param { Object } state Global application state .
* @ param { string } itemType Type of item .
* @ param { string } scope Item scope .
2021-01-28 02:04:13 +00:00
*
2021-05-20 12:20:04 +00:00
* @ 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 .
2021-01-28 02:04:13 +00:00
*
2021-11-08 14:29:21 +00:00
* @ param { Object } state Global application state .
* @ param { string } scope Item scope .
2021-01-28 02:04:13 +00:00
*
2021-05-20 12:20:04 +00:00
* @ 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 .
2021-01-28 02:04:13 +00:00
*
2021-05-20 12:20:04 +00:00
* @ param { Object } state Global application state .
* @ param { string } itemType Type of item .
* @ param { string } scope Scope .
* @ param { string } item Item to check .
2021-01-28 02:04:13 +00:00
*
2021-05-20 12:20:04 +00:00
* @ 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 .
2021-01-28 02:04:13 +00:00
*
2021-11-08 14:29:21 +00:00
* @ param { Object } state Global application state .
* @ param { string } scope Scope .
* @ param { string } item Item to check .
2021-01-28 02:04:13 +00:00
*
2021-05-20 12:20:04 +00:00
* @ return { boolean } True if the item is pinned and false otherwise .
2021-01-28 02:04:13 +00:00
* /
2020-10-20 13:36:16 +00:00
2021-05-19 15:09:27 +00:00
2021-05-20 12:20:04 +00:00
function selectors _isItemPinned ( state , scope , item ) {
return isMultipleEnabledItemEnabled ( state , 'pinnedItems' , scope , item ) !== false ;
}
2021-11-08 14:29:21 +00:00
/ * *
* Returns a boolean indicating whether a feature is active for a particular
* scope .
*
* @ param { Object } state The store state .
* @ param { string } scope The scope of the feature ( e . g . core / edit - post ) .
* @ param { string } featureName The name of the feature .
*
* @ return { boolean } Is the feature enabled ?
* /
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 ;
}
2021-05-19 15:09:27 +00:00
2021-05-20 12:20:04 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/constants.js
/ * *
* The identifier for the data store .
*
* @ type { string }
* /
const STORE _NAME = 'core/interface' ;
2021-05-19 15:09:27 +00:00
2021-05-20 12:20:04 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/index.js
/ * *
* WordPress dependencies
* /
2021-05-19 15:09:27 +00:00
2021-05-20 12:20:04 +00:00
/ * *
* Internal dependencies
* /
2021-05-19 15:09:27 +00:00
2021-05-20 12:20:04 +00:00
/ * *
* Store definition for the interface namespace .
*
* @ see https : //github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
*
* @ type { Object }
* /
2021-05-19 15:09:27 +00:00
2021-05-20 12:20:04 +00:00
const store = Object ( external _wp _data _ [ "createReduxStore" ] ) ( STORE _NAME , {
reducer : reducer ,
actions : actions _namespaceObject ,
selectors : selectors _namespaceObject ,
2021-11-08 14:29:21 +00:00
persist : [ 'enableItems' , 'preferences' ] ,
_ _experimentalUseThunks : true
2021-05-20 12:20:04 +00:00
} ) ; // Once we build a more generic persistence plugin that works across types of stores
// we'd be able to replace this with a register call.
2021-05-19 15:09:27 +00:00
2021-05-20 12:20:04 +00:00
Object ( external _wp _data _ [ "registerStore" ] ) ( STORE _NAME , {
reducer : reducer ,
actions : actions _namespaceObject ,
selectors : selectors _namespaceObject ,
2021-11-08 14:29:21 +00:00
persist : [ 'enableItems' , 'preferences' ] ,
_ _experimentalUseThunks : true
2021-05-20 12:20:04 +00:00
} ) ;
2021-05-19 15:09:27 +00:00
2021-11-08 14:29:21 +00:00
// EXTERNAL MODULE: external ["wp","plugins"]
var external _wp _plugins _ = _ _webpack _require _ _ ( "TvNi" ) ;
2021-05-19 15:09:27 +00:00
2021-11-08 14:29:21 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area-context/index.js
/ * *
* WordPress dependencies
* /
2021-05-19 15:09:27 +00:00
2021-11-08 14:29:21 +00:00
/* 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 } `
} ;
} ) ) ;
2021-05-19 15:09:27 +00:00
2021-11-08 14:29:21 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area-toggle/index.js
2021-05-20 12:20:04 +00:00
2021-05-19 15:09:27 +00:00
2021-01-28 02:04:13 +00:00
/ * *
2021-05-20 12:20:04 +00:00
* External dependencies
2021-01-28 02:04:13 +00:00
* /
2021-05-19 15:09:27 +00:00
2021-01-28 02:04:13 +00:00
/ * *
2021-05-20 12:20:04 +00:00
* WordPress dependencies
2021-01-28 02:04:13 +00:00
* /
2020-01-22 22:06:21 +00:00
2021-05-20 12:20:04 +00:00
2021-05-19 15:09:27 +00:00
2020-01-22 22:06:21 +00:00
/ * *
2021-05-20 12:20:04 +00:00
* Internal dependencies
2021-05-19 15:09:27 +00:00
* /
2018-12-14 04:41:57 +00:00
2020-06-26 13:33:47 +00:00
2021-11-15 12:50:17 +00:00
function ComplementaryAreaToggle ( _ref ) {
let {
as = external _wp _components _ [ "Button" ] ,
scope ,
identifier ,
icon ,
selectedIcon ,
... props
} = _ref ;
2021-05-19 15:09:27 +00: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' ] ) ) ) ;
}
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
/* harmony default export */ var complementary _area _toggle = ( complementary _area _context ( ComplementaryAreaToggle ) ) ;
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area-header/index.js
2020-06-26 13:33:47 +00:00
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* External dependencies
* /
2020-06-26 13:33:47 +00:00
2019-09-19 15:19:18 +00:00
/ * *
2021-01-28 02:04:13 +00:00
* WordPress dependencies
2019-09-19 15:19:18 +00:00
* /
2018-12-14 04:41:57 +00:00
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* Internal dependencies
* /
2019-10-15 15:37:08 +00:00
2018-12-14 04:41:57 +00:00
2019-03-21 12:48:00 +00:00
2021-11-15 12:50:17 +00:00
const ComplementaryAreaHeader = _ref => {
let {
smallScreenTitle ,
children ,
className ,
toggleButtonProps
} = _ref ;
2021-05-19 15:09:27 +00: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 ) ) ;
} ;
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
/* harmony default export */ var complementary _area _header = ( ComplementaryAreaHeader ) ;
2018-12-18 03:14:52 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/action-item/index.js
2020-02-06 21:03:31 +00:00
2018-12-14 04:41:57 +00:00
2018-12-18 03:14:52 +00:00
2019-10-15 15:37:08 +00:00
/ * *
2021-01-28 02:04:13 +00:00
* External dependencies
2019-10-15 15:37:08 +00:00
* /
2018-12-14 04:41:57 +00:00
2019-10-15 15:37:08 +00:00
/ * *
2021-01-28 02:04:13 +00:00
* WordPress dependencies
2019-10-15 15:37:08 +00:00
* /
2018-12-18 03:14:52 +00:00
2021-01-28 02:04:13 +00:00
2021-11-15 12:50:17 +00:00
function ActionItemSlot ( _ref ) {
let {
name ,
as : Component = external _wp _components _ [ "ButtonGroup" ] ,
fillProps = { } ,
bubblesVirtually ,
... props
} = _ref ;
2021-05-19 15:09:27 +00: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
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
const initializedByPlugins = [ ] ;
2021-11-15 12:50:17 +00:00
external _wp _element _ [ "Children" ] . forEach ( fills , _ref2 => {
let {
props : {
_ _unstableExplicitMenuItem ,
_ _unstableTarget
}
} = _ref2 ;
2021-05-19 15:09:27 +00: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 ;
}
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
return child ;
} ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( Component , props , children ) ;
} ) ;
}
2021-01-28 02:04:13 +00:00
2021-11-15 12:50:17 +00:00
function ActionItem ( _ref3 ) {
let {
name ,
as : Component = external _wp _components _ [ "Button" ] ,
onClick ,
... props
} = _ref3 ;
2021-05-19 15:09:27 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Fill" ] , {
name : name
2021-11-15 12:50:17 +00:00
} , _ref4 => {
let {
onClick : fpOnClick
} = _ref4 ;
2021-05-19 15:09:27 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( Component , Object ( esm _extends [ "a" /* default */ ] ) ( {
2021-11-15 12:50:17 +00:00
onClick : onClick || fpOnClick ? function ( ) {
( onClick || external _lodash _ [ "noop" ] ) ( ... arguments ) ;
( fpOnClick || external _lodash _ [ "noop" ] ) ( ... arguments ) ;
2021-05-19 15:09:27 +00:00
} : undefined
} , props ) ) ;
2021-01-28 02:04:13 +00:00
} ) ;
2020-07-07 14:43:35 +00:00
}
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
ActionItem . Slot = ActionItemSlot ;
/* harmony default export */ var action _item = ( ActionItem ) ;
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area-more-menu-item/index.js
2021-01-28 02:04:13 +00:00
2020-06-26 13:33:47 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* External dependencies
2020-06-26 13:33:47 +00:00
* /
2018-12-18 03:14:52 +00:00
/ * *
2021-01-28 02:04:13 +00:00
* WordPress dependencies
2018-12-18 03:14:52 +00:00
* /
2018-12-14 04:41:57 +00:00
2021-01-28 02:04:13 +00:00
2018-12-14 04:41:57 +00:00
/ * *
2021-01-28 02:04:13 +00:00
* Internal dependencies
2018-12-14 04:41:57 +00:00
* /
2021-01-28 02:04:13 +00:00
2018-12-17 04:52:00 +00:00
2021-05-19 15:09:27 +00:00
const PluginsMenuItem = props => // Menu item is marked with unstable prop for backward compatibility.
// They are removed so they don't leak to DOM elements.
// @see https://github.com/WordPress/gutenberg/issues/14457
Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuItem" ] , Object ( external _lodash _ [ "omit" ] ) ( props , [ '__unstableExplicitMenuItem' , '__unstableTarget' ] ) ) ;
2021-01-28 02:04:13 +00:00
2021-11-15 12:50:17 +00:00
function ComplementaryAreaMoreMenuItem ( _ref ) {
let {
scope ,
target ,
_ _unstableExplicitMenuItem ,
... props
} = _ref ;
2021-05-19 15:09:27 +00: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 ) ) ;
2021-01-28 02:04:13 +00:00
} ,
2021-05-19 15:09:27 +00:00
role : "menuitemcheckbox" ,
selectedIcon : check [ "a" /* default */ ] ,
name : target ,
scope : scope
} , props ) ) ;
2019-10-15 15:37:08 +00:00
}
2019-09-19 15:19:18 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/pinned-items/index.js
2021-01-28 02:04:13 +00:00
2019-09-19 15:19:18 +00:00
/ * *
2021-01-28 02:04:13 +00:00
* External dependencies
2019-09-19 15:19:18 +00:00
* /
2021-05-19 15:09:27 +00:00
2019-09-19 15:19:18 +00:00
/ * *
2021-01-28 02:04:13 +00:00
* WordPress dependencies
2019-09-19 15:19:18 +00:00
* /
2021-01-28 02:04:13 +00:00
2021-11-15 12:50:17 +00:00
function PinnedItems ( _ref ) {
let {
scope ,
... props
} = _ref ;
2021-05-19 15:09:27 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Fill" ] , Object ( esm _extends [ "a" /* default */ ] ) ( {
name : ` PinnedItems/ ${ scope } `
} , props ) ) ;
}
2021-01-28 02:04:13 +00:00
2021-11-15 12:50:17 +00:00
function PinnedItemsSlot ( _ref2 ) {
let {
scope ,
className ,
... props
} = _ref2 ;
2021-05-19 15:09:27 +00: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 ) ) ;
}
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
PinnedItems . Slot = PinnedItemsSlot ;
/* harmony default export */ var pinned _items = ( PinnedItems ) ;
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area/index.js
2021-01-28 02:04:13 +00:00
2019-09-19 15:19:18 +00:00
2019-10-15 15:37:08 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* External dependencies
2019-10-15 15:37:08 +00:00
* /
2019-09-19 15:19:18 +00:00
2019-10-15 15:37:08 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* WordPress dependencies
2019-10-15 15:37:08 +00:00
* /
2019-09-19 15:19:18 +00:00
2021-01-28 02:04:13 +00:00
2019-09-19 15:19:18 +00:00
2021-01-28 02:04:13 +00:00
2020-06-26 13:33:47 +00:00
/ * *
2021-01-28 02:04:13 +00:00
* Internal dependencies
2020-06-26 13:33:47 +00:00
* /
2021-01-28 02:04:13 +00:00
2021-11-15 12:50:17 +00:00
function ComplementaryAreaSlot ( _ref ) {
let {
scope ,
... props
} = _ref ;
2021-05-19 15:09:27 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Slot" ] , Object ( esm _extends [ "a" /* default */ ] ) ( {
name : ` ComplementaryArea/ ${ scope } `
} , props ) ) ;
}
2021-01-28 02:04:13 +00:00
2021-11-15 12:50:17 +00:00
function ComplementaryAreaFill ( _ref2 ) {
let {
scope ,
children ,
className
} = _ref2 ;
2021-05-19 15:09:27 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Fill" ] , {
name : ` ComplementaryArea/ ${ scope } `
} , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : className
} , children ) ) ;
}
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
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.
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
shouldOpenWhenNotSmall . current = true ;
} else if ( // If there is a flag indicating the complementary area should be enabled when we go from small to big window size
// and we are going from a small to big window size.
shouldOpenWhenNotSmall . current && ! isSmall && previousIsSmall . current ) {
// Remove the flag indicating the complementary area should be enabled.
shouldOpenWhenNotSmall . current = false ; // Enable the complementary area.
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
enableComplementaryArea ( scope , identifier ) ;
} else if ( // If the flag is indicating the current complementary should be reopened but another complementary area becomes active,
// remove the flag.
shouldOpenWhenNotSmall . current && activeArea && activeArea !== identifier ) {
shouldOpenWhenNotSmall . current = false ;
}
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
if ( isSmall !== previousIsSmall . current ) {
previousIsSmall . current = isSmall ;
}
} , [ isActive , isSmall , scope , identifier , activeArea ] ) ;
}
2020-07-07 14:43:35 +00:00
2021-11-15 12:50:17 +00: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-05-19 15:09:27 +00:00
const {
isActive ,
isPinned ,
activeArea ,
isSmall ,
isLarge
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
const {
getActiveComplementaryArea ,
isItemPinned
} = select ( store ) ;
const _activeArea = getActiveComplementaryArea ( scope ) ;
2019-09-19 15:19:18 +00:00
2021-05-19 15:09:27 +00:00
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 ,
2021-11-08 14:29:21 +00:00
variant : showIconLabels ? 'tertiary' : undefined
2021-05-19 15:09:27 +00:00
} ) ) , 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-08 14:29:21 +00:00
2021-11-15 12:50:17 +00:00
const FullscreenMode = _ref => {
let {
isActive
} = _ref ;
2021-11-08 14:29:21 +00: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
2021-05-19 15:09:27 +00:00
// `sticky-menu` to be applied by WordPress and prevents the admin menu being scrolled
// even if `is-fullscreen-mode` is then removed. Let's remove `sticky-menu` here as
// a consequence of the FullscreenMode setup
if ( document . body . classList . contains ( 'sticky-menu' ) ) {
2021-11-08 14:29:21 +00:00
isSticky = true ;
2021-05-19 15:09:27 +00:00
document . body . classList . remove ( 'sticky-menu' ) ;
}
2021-11-08 14:29:21 +00:00
return ( ) => {
if ( isSticky ) {
document . body . classList . add ( 'sticky-menu' ) ;
}
} ;
} , [ ] ) ;
Object ( external _wp _element _ [ "useEffect" ] ) ( ( ) => {
2021-05-19 15:09:27 +00:00
if ( isActive ) {
document . body . classList . add ( 'is-fullscreen-mode' ) ;
} else {
document . body . classList . remove ( 'is-fullscreen-mode' ) ;
}
2021-11-08 14:29:21 +00:00
return ( ) => {
if ( isActive ) {
document . body . classList . remove ( 'is-fullscreen-mode' ) ;
}
} ;
} , [ isActive ] ) ;
return null ;
} ;
2021-05-19 15:09:27 +00:00
2021-11-08 14:29:21 +00:00
/* harmony default export */ var fullscreen _mode = ( FullscreenMode ) ;
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
// EXTERNAL MODULE: external ["wp","compose"]
2021-05-20 12:20:04 +00:00
var external _wp _compose _ = _ _webpack _require _ _ ( "K9lf" ) ;
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/interface-skeleton/index.js
2021-01-28 02:04:13 +00:00
2021-11-08 14:29:21 +00:00
2019-10-15 15:37:08 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* External dependencies
2019-10-15 15:37:08 +00:00
* /
2019-09-19 15:19:18 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* WordPress dependencies
* /
2019-09-19 15:19:18 +00:00
2021-07-15 18:55:29 +00:00
/ * *
* WordPress dependencies
* /
2019-09-19 15:19:18 +00:00
2021-05-19 15:09:27 +00:00
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-01-28 02:04:13 +00:00
}
2019-09-19 15:19:18 +00:00
2021-11-15 12:50:17 +00:00
function InterfaceSkeleton ( _ref , ref ) {
let {
footer ,
header ,
sidebar ,
secondarySidebar ,
notices ,
content ,
drawer ,
actions ,
labels ,
className ,
shortcuts
} = _ref ;
2021-11-08 14:29:21 +00:00
const navigateRegionsProps = Object ( external _wp _components _ [ "__unstableUseNavigateRegions" ] ) ( shortcuts ) ;
2021-05-19 15:09:27 +00:00
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' )
2021-01-28 02:04:13 +00:00
} ;
2021-05-19 15:09:27 +00:00
const mergedLabels = { ... defaultLabels ,
... labels
2021-01-28 02:04:13 +00:00
} ;
2021-11-08 14:29:21 +00:00
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" , {
2021-05-19 15:09:27 +00:00
className : "interface-interface-skeleton__drawer" ,
role : "region" ,
2021-11-23 05:40:38 +00:00
"aria-label" : mergedLabels . drawer ,
tabIndex : "-1"
2021-05-19 15:09:27 +00: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"
2021-07-15 18:55:29 +00:00
} , secondarySidebar ) , ! ! notices && Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "interface-interface-skeleton__notices"
} , notices ) , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
2021-05-19 15:09:27 +00:00
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 ) ) ;
}
2019-09-19 15:19:18 +00:00
2021-05-19 15:09:27 +00:00
/* harmony default export */ var interface _skeleton = ( Object ( external _wp _element _ [ "forwardRef" ] ) ( InterfaceSkeleton ) ) ;
2021-05-07 11:48:27 +00:00
2021-11-08 14:29:21 +00:00
// 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 12:50:17 +00:00
function MoreMenuDropdown ( _ref ) {
let {
as : DropdownComponent = external _wp _components _ [ "DropdownMenu" ] ,
className ,
2021-11-08 14:29:21 +00:00
2021-11-15 12:50:17 +00:00
/* translators: button label text should, if possible, be under 16 characters. */
label = Object ( external _wp _i18n _ [ "__" ] ) ( 'Options' ) ,
popoverProps ,
toggleProps ,
children
} = _ref ;
2021-11-08 14:29:21 +00: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 12:50:17 +00:00
function MoreMenuFeatureToggle ( _ref ) {
let {
scope ,
label ,
info ,
messageActivated ,
messageDeactivated ,
shortcut ,
feature
} = _ref ;
2021-11-08 14:29:21 +00: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 ) ;
}
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/index.js
2021-05-07 11:48:27 +00:00
2020-06-26 13:33:47 +00:00
2021-05-07 11:48:27 +00:00
2021-11-08 14:29:21 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/index.js
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
/***/ } ) ,
2021-05-07 11:48:27 +00:00
2021-05-20 12:20:04 +00:00
/***/ "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 ) ;
/***/ } ) ,
/***/ "Y5n4" :
2021-05-19 15:09:27 +00:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
"use strict" ;
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
// EXPORTS
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return /* reexport */ enable _custom _fields ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "c" , function ( ) { return /* reexport */ enable _panel ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "d" , function ( ) { return /* reexport */ enable _plugin _document _setting _panel ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "e" , function ( ) { return /* reexport */ enable _publish _sidebar ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "b" , function ( ) { return /* reexport */ enable _feature ; } ) ;
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
// EXTERNAL MODULE: external ["wp","element"]
2021-05-20 12:20:04 +00:00
var external _wp _element _ = _ _webpack _require _ _ ( "GRId" ) ;
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
// EXTERNAL MODULE: external ["wp","i18n"]
2021-05-20 12:20:04 +00:00
var external _wp _i18n _ = _ _webpack _require _ _ ( "l3Sj" ) ;
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
// EXTERNAL MODULE: external ["wp","components"]
2021-05-20 12:20:04 +00:00
var external _wp _components _ = _ _webpack _require _ _ ( "tI+e" ) ;
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
// EXTERNAL MODULE: external ["wp","data"]
2021-05-20 12:20:04 +00:00
var external _wp _data _ = _ _webpack _require _ _ ( "1ZqX" ) ;
2021-05-07 11:48:27 +00:00
2021-11-08 14:29:21 +00:00
// EXTERNAL MODULE: external ["wp","editor"]
var external _wp _editor _ = _ _webpack _require _ _ ( "jSdM" ) ;
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/options/base.js
2021-05-07 11:48:27 +00:00
2019-09-19 15:19:18 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* WordPress dependencies
2019-09-19 15:19:18 +00:00
* /
2021-05-07 11:48:27 +00:00
2021-11-15 12:50:17 +00:00
function BaseOption ( _ref ) {
let {
help ,
label ,
isChecked ,
onChange ,
children
} = _ref ;
2021-05-19 15:09:27 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-post-preferences-modal__option"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "ToggleControl" ] , {
help : help ,
label : label ,
checked : isChecked ,
onChange : onChange
} ) , children ) ;
}
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
/* harmony default export */ var base = ( BaseOption ) ;
2019-09-19 15:19:18 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/options/enable-custom-fields.js
2019-09-19 15:19:18 +00:00
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* WordPress dependencies
* /
2019-09-19 15:19:18 +00:00
2021-01-28 02:04:13 +00:00
2021-11-08 14:29:21 +00:00
2019-09-19 15:19:18 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Internal dependencies
2019-09-19 15:19:18 +00:00
* /
2021-11-15 12:50:17 +00:00
function CustomFieldsConfirmation ( _ref ) {
let {
willEnable
} = _ref ;
2021-05-19 15:09:27 +00:00
const [ isReloading , setIsReloading ] = Object ( external _wp _element _ [ "useState" ] ) ( false ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( "p" , {
className : "edit-post-preferences-modal__custom-fields-confirmation-message"
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'A page reload is required for this change. Make sure your content is saved before reloading.' ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
className : "edit-post-preferences-modal__custom-fields-confirmation-button" ,
2021-11-08 14:29:21 +00:00
variant : "secondary" ,
2021-05-19 15:09:27 +00:00
isBusy : isReloading ,
disabled : isReloading ,
onClick : ( ) => {
setIsReloading ( true ) ;
document . getElementById ( 'toggle-custom-fields-form' ) . submit ( ) ;
}
} , willEnable ? Object ( external _wp _i18n _ [ "__" ] ) ( 'Enable & Reload' ) : Object ( external _wp _i18n _ [ "__" ] ) ( 'Disable & Reload' ) ) ) ;
}
2021-11-15 12:50:17 +00:00
function EnableCustomFieldsOption ( _ref2 ) {
let {
label ,
areCustomFieldsEnabled
} = _ref2 ;
2021-05-19 15:09:27 +00:00
const [ isChecked , setIsChecked ] = Object ( external _wp _element _ [ "useState" ] ) ( areCustomFieldsEnabled ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( base , {
label : label ,
isChecked : isChecked ,
onChange : setIsChecked
} , isChecked !== areCustomFieldsEnabled && Object ( external _wp _element _ [ "createElement" ] ) ( CustomFieldsConfirmation , {
willEnable : isChecked
} ) ) ;
}
/* harmony default export */ var enable _custom _fields = ( Object ( external _wp _data _ [ "withSelect" ] ) ( select => ( {
2021-11-08 14:29:21 +00:00
areCustomFieldsEnabled : ! ! select ( external _wp _editor _ [ "store" ] ) . getEditorSettings ( ) . enableCustomFields
2021-05-19 15:09:27 +00:00
} ) ) ( EnableCustomFieldsOption ) ) ;
2019-09-19 15:19:18 +00:00
2021-05-19 15:09:27 +00:00
// EXTERNAL MODULE: external ["wp","compose"]
2021-05-20 12:20:04 +00:00
var external _wp _compose _ = _ _webpack _require _ _ ( "K9lf" ) ;
2019-09-19 15:19:18 +00:00
2021-05-19 15:09:27 +00:00
// EXTERNAL MODULE: ./node_modules/@wordpress/edit-post/build-module/store/index.js + 5 modules
2021-05-20 12:20:04 +00:00
var store = _ _webpack _require _ _ ( "T40v" ) ;
2019-09-19 15:19:18 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/options/enable-panel.js
2021-05-07 11:48:27 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* WordPress dependencies
2021-05-07 11:48:27 +00:00
* /
2019-09-19 15:19:18 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* Internal dependencies
* /
2019-09-19 15:19:18 +00:00
2021-05-07 11:48:27 +00:00
2021-11-15 12:50:17 +00:00
/* harmony default export */ var enable _panel = ( Object ( external _wp _compose _ [ "compose" ] ) ( Object ( external _wp _data _ [ "withSelect" ] ) ( ( select , _ref ) => {
let {
panelName
} = _ref ;
2021-05-19 15:09:27 +00:00
const {
isEditorPanelEnabled ,
isEditorPanelRemoved
} = select ( store [ "a" /* store */ ] ) ;
return {
isRemoved : isEditorPanelRemoved ( panelName ) ,
isChecked : isEditorPanelEnabled ( panelName )
} ;
2021-11-15 12:50:17 +00:00
} ) , Object ( external _wp _compose _ [ "ifCondition" ] ) ( _ref2 => {
let {
isRemoved
} = _ref2 ;
return ! isRemoved ;
} ) , Object ( external _wp _data _ [ "withDispatch" ] ) ( ( dispatch , _ref3 ) => {
let {
panelName
} = _ref3 ;
return {
onChange : ( ) => dispatch ( store [ "a" /* store */ ] ) . toggleEditorPanelEnabled ( panelName )
} ;
} ) ) ( base ) ) ;
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js
2019-09-19 15:19:18 +00:00
2021-01-28 02:04:13 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* WordPress dependencies
2021-05-07 11:48:27 +00:00
* /
2021-05-19 15:09:27 +00:00
2021-05-07 11:48:27 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Internal dependencies
2021-01-28 02:04:13 +00:00
* /
2019-09-19 15:19:18 +00:00
2021-05-19 15:09:27 +00:00
const {
Fill ,
Slot
} = Object ( external _wp _components _ [ "createSlotFill" ] ) ( 'EnablePluginDocumentSettingPanelOption' ) ;
2019-09-19 15:19:18 +00:00
2021-11-15 12:50:17 +00:00
const EnablePluginDocumentSettingPanelOption = _ref => {
let {
label ,
panelName
} = _ref ;
return Object ( external _wp _element _ [ "createElement" ] ) ( Fill , null , Object ( external _wp _element _ [ "createElement" ] ) ( enable _panel , {
label : label ,
panelName : panelName
} ) ) ;
} ;
2021-05-19 15:09:27 +00:00
EnablePluginDocumentSettingPanelOption . Slot = Slot ;
/* harmony default export */ var enable _plugin _document _setting _panel = ( EnablePluginDocumentSettingPanelOption ) ;
2021-02-02 05:17:13 +00:00
2021-05-19 15:09:27 +00:00
// EXTERNAL MODULE: external ["wp","viewport"]
2021-05-20 12:20:04 +00:00
var external _wp _viewport _ = _ _webpack _require _ _ ( "KEfo" ) ;
2021-04-15 15:19:43 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/options/enable-publish-sidebar.js
2021-01-28 02:04:13 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* WordPress dependencies
2021-01-28 02:04:13 +00:00
* /
2019-09-19 15:19:18 +00:00
2021-11-08 14:29:21 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* Internal dependencies
* /
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
/* harmony default export */ var enable _publish _sidebar = ( Object ( external _wp _compose _ [ "compose" ] ) ( Object ( external _wp _data _ [ "withSelect" ] ) ( select => ( {
2021-11-08 14:29:21 +00:00
isChecked : select ( external _wp _editor _ [ "store" ] ) . isPublishSidebarEnabled ( )
2021-05-19 15:09:27 +00:00
} ) ) , Object ( external _wp _data _ [ "withDispatch" ] ) ( dispatch => {
const {
enablePublishSidebar ,
disablePublishSidebar
2021-11-08 14:29:21 +00:00
} = dispatch ( external _wp _editor _ [ "store" ] ) ;
2021-05-19 15:09:27 +00:00
return {
onChange : isEnabled => isEnabled ? enablePublishSidebar ( ) : disablePublishSidebar ( )
} ;
} ) , // In < medium viewports we override this option and always show the publish sidebar.
// See the edit-post's header component for the specific logic.
Object ( external _wp _viewport _ [ "ifViewportMatches" ] ) ( 'medium' ) ) ( base ) ) ;
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/options/enable-feature.js
/ * *
* WordPress dependencies
* /
2021-04-15 15:19:43 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* Internal dependencies
* /
2021-04-15 15:19:43 +00:00
2021-05-07 11:48:27 +00:00
2021-11-15 12:50:17 +00:00
/* harmony default export */ var enable _feature = ( Object ( external _wp _compose _ [ "compose" ] ) ( Object ( external _wp _data _ [ "withSelect" ] ) ( ( select , _ref ) => {
let {
featureName
} = _ref ;
2021-05-19 15:09:27 +00:00
const {
isFeatureActive
} = select ( store [ "a" /* store */ ] ) ;
return {
isChecked : isFeatureActive ( featureName )
} ;
2021-11-15 12:50:17 +00:00
} ) , Object ( external _wp _data _ [ "withDispatch" ] ) ( ( dispatch , _ref2 ) => {
let {
featureName
} = _ref2 ;
return {
onChange : ( ) => dispatch ( store [ "a" /* store */ ] ) . toggleFeature ( featureName )
} ;
} ) ) ( base ) ) ;
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/options/index.js
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
/***/ } ) ,
2021-05-07 11:48:27 +00:00
2021-05-20 12:20:04 +00:00
/***/ "YLtl" :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = window [ "lodash" ] ; } ( ) ) ;
/***/ } ) ,
/***/ "Z23Y" :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = window [ "wp" ] [ "warning" ] ; } ( ) ) ;
/***/ } ) ,
/***/ "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 ) ;
2021-06-01 08:10:04 +00:00
/***/ } ) ,
/***/ "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-05-19 15:09:27 +00:00
/***/ } ) ,
2021-05-07 11:48:27 +00:00
2021-05-20 12:20:04 +00:00
/***/ "dSQ2" :
2021-05-19 15:09:27 +00:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
"use strict" ;
// ESM COMPAT FLAG
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
// EXPORTS
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "reinitializeEditor" , function ( ) { return /* binding */ reinitializeEditor ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "initializeEditor" , function ( ) { return /* binding */ initializeEditor ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "PluginBlockSettingsMenuItem" , function ( ) { return /* reexport */ plugin _block _settings _menu _item ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "PluginDocumentSettingPanel" , function ( ) { return /* reexport */ plugin _document _setting _panel [ "a" /* default */ ] ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "PluginMoreMenuItem" , function ( ) { return /* reexport */ plugin _more _menu _item ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "PluginPostPublishPanel" , function ( ) { return /* reexport */ plugin _post _publish _panel ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "PluginPostStatusInfo" , function ( ) { return /* reexport */ plugin _post _status _info ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "PluginPrePublishPanel" , function ( ) { return /* reexport */ plugin _pre _publish _panel ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "PluginSidebar" , function ( ) { return /* reexport */ PluginSidebarEditPost ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "PluginSidebarMoreMenuItem" , function ( ) { return /* reexport */ PluginSidebarMoreMenuItem ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "__experimentalFullscreenModeClose" , function ( ) { return /* reexport */ fullscreen _mode _close ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "__experimentalMainDashboardButton" , function ( ) { return /* reexport */ main _dashboard _button ; } ) ;
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 19:08:24 +00:00
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "store" , function ( ) { return /* reexport */ store [ "a" /* store */ ] ; } ) ;
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
// EXTERNAL MODULE: external ["wp","element"]
2021-05-20 12:20:04 +00:00
var external _wp _element _ = _ _webpack _require _ _ ( "GRId" ) ;
2021-05-07 11:48:27 +00:00
2021-11-08 14:29:21 +00:00
// EXTERNAL MODULE: external ["wp","blocks"]
var external _wp _blocks _ = _ _webpack _require _ _ ( "HSyU" ) ;
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
// EXTERNAL MODULE: external ["wp","blockLibrary"]
2021-05-20 12:20:04 +00:00
var external _wp _blockLibrary _ = _ _webpack _require _ _ ( "QyPg" ) ;
2020-06-26 13:33:47 +00:00
2021-11-08 14:29:21 +00:00
// EXTERNAL MODULE: external ["wp","data"]
var external _wp _data _ = _ _webpack _require _ _ ( "1ZqX" ) ;
2021-05-19 15:09:27 +00:00
// EXTERNAL MODULE: external ["wp","hooks"]
2021-05-20 12:20:04 +00:00
var external _wp _hooks _ = _ _webpack _require _ _ ( "g56x" ) ;
2021-05-19 15:09:27 +00:00
2022-01-04 05:39:28 +00:00
// EXTERNAL MODULE: ./node_modules/@wordpress/interface/build-module/index.js + 17 modules
var build _module = _ _webpack _require _ _ ( "U60i" ) ;
2021-05-19 15:09:27 +00:00
// EXTERNAL MODULE: external ["wp","mediaUtils"]
2021-05-20 12:20:04 +00:00
var external _wp _mediaUtils _ = _ _webpack _require _ _ ( "6aBm" ) ;
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/hooks/components/index.js
2021-05-07 11:48:27 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* WordPress dependencies
2020-06-26 13:33:47 +00:00
* /
2021-05-19 15:09:27 +00:00
const replaceMediaUpload = ( ) => external _wp _mediaUtils _ [ "MediaUpload" ] ;
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
Object ( external _wp _hooks _ [ "addFilter" ] ) ( 'editor.MediaUpload' , 'core/edit-post/replace-media-upload' , replaceMediaUpload ) ;
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
2021-05-20 12:20:04 +00:00
var esm _extends = _ _webpack _require _ _ ( "wx14" ) ;
2021-05-19 15:09:27 +00:00
// EXTERNAL MODULE: external "lodash"
2021-05-20 12:20:04 +00:00
var external _lodash _ = _ _webpack _require _ _ ( "YLtl" ) ;
2021-05-19 15:09:27 +00:00
// EXTERNAL MODULE: external ["wp","components"]
2021-05-20 12:20:04 +00:00
var external _wp _components _ = _ _webpack _require _ _ ( "tI+e" ) ;
2020-06-26 13:33:47 +00:00
2021-11-08 14:29:21 +00:00
// EXTERNAL MODULE: external ["wp","blockEditor"]
var external _wp _blockEditor _ = _ _webpack _require _ _ ( "axFQ" ) ;
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
// EXTERNAL MODULE: external ["wp","i18n"]
2021-05-20 12:20:04 +00:00
var external _wp _i18n _ = _ _webpack _require _ _ ( "l3Sj" ) ;
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
// EXTERNAL MODULE: external ["wp","compose"]
2021-05-20 12:20:04 +00:00
var external _wp _compose _ = _ _webpack _require _ _ ( "K9lf" ) ;
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/hooks/validate-multiple-use/index.js
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* External dependencies
* /
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* WordPress dependencies
* /
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
const enhance = Object ( external _wp _compose _ [ "compose" ] ) (
/ * *
* For blocks whose block type doesn ' t support ` multiple ` , provides the
* wrapped component with ` originalBlockClientId ` -- a reference to the
* first block of the same type in the content -- if and only if that
* "original" block is not the current one . Thus , an inexisting
* ` originalBlockClientId ` prop signals that the block is valid .
*
* @ param { WPComponent } WrappedBlockEdit A filtered BlockEdit instance .
*
* @ return { WPComponent } Enhanced component with merged state data props .
* /
Object ( external _wp _data _ [ "withSelect" ] ) ( ( select , block ) => {
const multiple = Object ( external _wp _blocks _ [ "hasBlockSupport" ] ) ( block . name , 'multiple' , true ) ; // For block types with `multiple` support, there is no "original
// block" to be found in the content, as the block itself is valid.
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
if ( multiple ) {
return { } ;
} // Otherwise, only pass `originalBlockClientId` if it refers to a different
// block from the current one.
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
const blocks = select ( external _wp _blockEditor _ [ "store" ] ) . getBlocks ( ) ;
2021-11-15 12:50:17 +00:00
const firstOfSameType = Object ( external _lodash _ [ "find" ] ) ( blocks , _ref => {
let {
name
} = _ref ;
return block . name === name ;
} ) ;
2021-05-19 15:09:27 +00:00
const isInvalid = firstOfSameType && firstOfSameType . clientId !== block . clientId ;
return {
originalBlockClientId : isInvalid && firstOfSameType . clientId
} ;
2021-11-15 12:50:17 +00:00
} ) , Object ( external _wp _data _ [ "withDispatch" ] ) ( ( dispatch , _ref2 ) => {
let {
originalBlockClientId
} = _ref2 ;
return {
selectFirst : ( ) => dispatch ( external _wp _blockEditor _ [ "store" ] ) . selectBlock ( originalBlockClientId )
} ;
} ) ) ;
2021-05-19 15:09:27 +00:00
const withMultipleValidation = Object ( external _wp _compose _ [ "createHigherOrderComponent" ] ) ( BlockEdit => {
2021-11-15 12:50:17 +00:00
return enhance ( _ref3 => {
let {
originalBlockClientId ,
selectFirst ,
... props
} = _ref3 ;
2021-05-19 15:09:27 +00:00
if ( ! originalBlockClientId ) {
return Object ( external _wp _element _ [ "createElement" ] ) ( BlockEdit , props ) ;
}
2020-10-13 13:10:30 +00:00
2021-05-19 15:09:27 +00:00
const blockType = Object ( external _wp _blocks _ [ "getBlockType" ] ) ( props . name ) ;
const outboundType = getOutboundType ( props . name ) ;
return [ Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
key : "invalid-preview" ,
style : {
minHeight : '60px'
}
} , Object ( external _wp _element _ [ "createElement" ] ) ( BlockEdit , Object ( esm _extends [ "a" /* default */ ] ) ( {
key : "block-edit"
} , props ) ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "Warning" ] , {
key : "multiple-use-warning" ,
actions : [ Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
key : "find-original" ,
2021-11-08 14:29:21 +00:00
variant : "secondary" ,
2021-05-19 15:09:27 +00:00
onClick : selectFirst
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Find original' ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
key : "remove" ,
2021-11-08 14:29:21 +00:00
variant : "secondary" ,
2021-05-19 15:09:27 +00:00
onClick : ( ) => props . onReplace ( [ ] )
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Remove' ) ) , outboundType && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
key : "transform" ,
2021-11-08 14:29:21 +00:00
variant : "secondary" ,
2021-05-19 15:09:27 +00:00
onClick : ( ) => props . onReplace ( Object ( external _wp _blocks _ [ "createBlock" ] ) ( outboundType . name , props . attributes ) )
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Transform into:' ) , " " , outboundType . title ) ]
2021-11-08 14:29:21 +00:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( "strong" , null , blockType === null || blockType === void 0 ? void 0 : blockType . title , ": " ) , Object ( external _wp _i18n _ [ "__" ] ) ( 'This block can only be used once.' ) ) ] ;
2021-05-19 15:09:27 +00:00
} ) ;
} , 'withMultipleValidation' ) ;
2021-01-28 02:04:13 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Given a base block name , returns the default block type to which to offer
* transforms .
2021-05-07 11:48:27 +00:00
*
2021-05-19 15:09:27 +00:00
* @ param { string } blockName Base block name .
2021-05-07 11:48:27 +00:00
*
2021-05-19 15:09:27 +00:00
* @ return { ? Object } The chosen default block type .
2021-05-07 11:48:27 +00:00
* /
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
function getOutboundType ( blockName ) {
// Grab the first outbound transform
2021-11-15 12:50:17 +00:00
const transform = Object ( external _wp _blocks _ [ "findTransform" ] ) ( Object ( external _wp _blocks _ [ "getBlockTransforms" ] ) ( 'to' , blockName ) , _ref4 => {
let {
type ,
blocks
} = _ref4 ;
return type === 'block' && blocks . length === 1 ;
} // What about when .length > 1?
2021-05-19 15:09:27 +00:00
) ;
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
if ( ! transform ) {
return null ;
}
2020-10-13 13:10:30 +00:00
2021-05-19 15:09:27 +00:00
return Object ( external _wp _blocks _ [ "getBlockType" ] ) ( transform . blocks [ 0 ] ) ;
}
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
Object ( external _wp _hooks _ [ "addFilter" ] ) ( 'editor.BlockEdit' , 'core/edit-post/validate-multiple-use/with-multiple-validation' , withMultipleValidation ) ;
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/hooks/index.js
2021-05-07 11:48:27 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Internal dependencies
2021-05-07 11:48:27 +00:00
* /
2021-05-19 15:09:27 +00:00
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/external.js
2021-05-20 12:20:04 +00:00
var external = _ _webpack _require _ _ ( "K+tz" ) ;
2021-05-19 15:09:27 +00:00
// EXTERNAL MODULE: external ["wp","plugins"]
2021-05-20 12:20:04 +00:00
var external _wp _plugins _ = _ _webpack _require _ _ ( "TvNi" ) ;
2021-05-19 15:09:27 +00:00
// EXTERNAL MODULE: external ["wp","url"]
2021-05-20 12:20:04 +00:00
var external _wp _url _ = _ _webpack _require _ _ ( "Mmq9" ) ;
2021-05-19 15:09:27 +00:00
// EXTERNAL MODULE: external ["wp","notices"]
2021-05-20 12:20:04 +00:00
var external _wp _notices _ = _ _webpack _require _ _ ( "onLe" ) ;
2021-05-19 15:09:27 +00:00
2021-11-08 14:29:21 +00:00
// EXTERNAL MODULE: external ["wp","editor"]
var external _wp _editor _ = _ _webpack _require _ _ ( "jSdM" ) ;
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/plugins/copy-content-menu-item/index.js
/ * *
* WordPress dependencies
* /
function CopyContentMenuItem ( ) {
const {
createNotice
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( external _wp _notices _ [ "store" ] ) ;
const getText = Object ( external _wp _data _ [ "useSelect" ] ) ( select => ( ) => select ( external _wp _editor _ [ "store" ] ) . getEditedPostAttribute ( 'content' ) , [ ] ) ;
function onSuccess ( ) {
createNotice ( 'info' , Object ( external _wp _i18n _ [ "__" ] ) ( 'All content copied.' ) , {
isDismissible : true ,
type : 'snackbar'
2021-05-07 11:48:27 +00:00
} ) ;
2021-05-19 15:09:27 +00:00
}
const ref = Object ( external _wp _compose _ [ "useCopyToClipboard" ] ) ( getText , onSuccess ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuItem" ] , {
ref : ref
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Copy all content' ) ) ;
2021-01-28 02:04:13 +00:00
}
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
// EXTERNAL MODULE: external ["wp","keycodes"]
2021-05-20 12:20:04 +00:00
var external _wp _keycodes _ = _ _webpack _require _ _ ( "RxS6" ) ;
2021-05-19 15:09:27 +00:00
2021-11-08 14:29:21 +00:00
// EXTERNAL MODULE: ./node_modules/@wordpress/edit-post/build-module/store/index.js + 5 modules
var store = _ _webpack _require _ _ ( "T40v" ) ;
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js
2020-06-26 13:33:47 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* WordPress dependencies
2020-06-26 13:33:47 +00:00
* /
2021-05-19 15:09:27 +00:00
/ * *
* Internal dependencies
* /
2021-11-15 12:50:17 +00:00
function KeyboardShortcutsHelpMenuItem ( _ref ) {
let {
openModal
} = _ref ;
2021-05-19 15:09:27 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuItem" ] , {
onClick : ( ) => {
openModal ( 'edit-post/keyboard-shortcut-help' ) ;
} ,
shortcut : external _wp _keycodes _ [ "displayShortcut" ] . access ( 'h' )
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Keyboard shortcuts' ) ) ;
2021-05-07 11:48:27 +00:00
}
2021-05-19 15:09:27 +00:00
/* harmony default export */ var keyboard _shortcuts _help _menu _item = ( Object ( external _wp _data _ [ "withDispatch" ] ) ( dispatch => {
const {
openModal
} = dispatch ( store [ "a" /* store */ ] ) ;
return {
openModal
} ;
} ) ( KeyboardShortcutsHelpMenuItem ) ) ;
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/tools-more-menu-group/index.js
2020-06-26 13:33:47 +00:00
2021-05-07 11:48:27 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* External dependencies
2021-05-07 11:48:27 +00:00
* /
2021-05-19 15:09:27 +00:00
2021-05-07 11:48:27 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* WordPress dependencies
2021-05-07 11:48:27 +00:00
* /
2021-05-19 15:09:27 +00:00
const {
Fill : ToolsMoreMenuGroup ,
Slot
} = Object ( external _wp _components _ [ "createSlotFill" ] ) ( 'ToolsMoreMenuGroup' ) ;
2021-11-15 12:50:17 +00:00
ToolsMoreMenuGroup . Slot = _ref => {
let {
fillProps
} = _ref ;
return Object ( external _wp _element _ [ "createElement" ] ) ( Slot , {
fillProps : fillProps
} , fills => ! Object ( external _lodash _ [ "isEmpty" ] ) ( fills ) && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuGroup" ] , {
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Tools' )
} , fills ) ) ;
} ;
2021-05-19 15:09:27 +00:00
/* harmony default export */ var tools _more _menu _group = ( ToolsMoreMenuGroup ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/plugins/welcome-guide-menu-item/index.js
2021-05-07 11:48:27 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* WordPress dependencies
2021-05-07 11:48:27 +00:00
* /
2021-05-19 15:09:27 +00:00
2021-05-07 11:48:27 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Internal dependencies
2021-05-07 11:48:27 +00:00
* /
2021-05-19 15:09:27 +00:00
function WelcomeGuideMenuItem ( ) {
2021-05-21 10:14:23 +00:00
const isTemplateMode = Object ( external _wp _data _ [ "useSelect" ] ) ( select => select ( store [ "a" /* store */ ] ) . isEditingTemplate ( ) , [ ] ) ;
2021-11-08 14:29:21 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( build _module [ "g" /* MoreMenuFeatureToggle */ ] , {
scope : "core/edit-post" ,
feature : isTemplateMode ? 'welcomeGuideTemplate' : 'welcomeGuide' ,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Welcome Guide' )
} ) ;
2021-05-07 11:48:27 +00:00
}
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/plugins/index.js
2021-05-07 11:48:27 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* WordPress dependencies
2021-05-07 11:48:27 +00:00
* /
2021-05-19 15:09:27 +00:00
2021-05-07 11:48:27 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Internal dependencies
2021-05-07 11:48:27 +00:00
* /
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
Object ( external _wp _plugins _ [ "registerPlugin" ] ) ( 'edit-post' , {
render ( ) {
2021-11-15 12:50:17 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( tools _more _menu _group , null , _ref => {
let {
onClose
} = _ref ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuItem" ] , {
role : "menuitem" ,
href : Object ( external _wp _url _ [ "addQueryArgs" ] ) ( 'edit.php' , {
post _type : 'wp_block'
} )
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Manage Reusable blocks' ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( keyboard _shortcuts _help _menu _item , {
onSelect : onClose
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( WelcomeGuideMenuItem , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( CopyContentMenuItem , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuItem" ] , {
role : "menuitem" ,
icon : external [ "a" /* default */ ] ,
href : Object ( external _wp _i18n _ [ "__" ] ) ( 'https://wordpress.org/support/article/wordpress-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)' ) ) ) ) ;
} ) ) ;
2021-05-19 15:09:27 +00:00
}
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
} ) ;
2020-06-26 13:33:47 +00:00
2021-11-08 14:29:21 +00:00
// EXTERNAL MODULE: external ["wp","coreData"]
var external _wp _coreData _ = _ _webpack _require _ _ ( "jZUy" ) ;
// EXTERNAL MODULE: external ["wp","keyboardShortcuts"]
var external _wp _keyboardShortcuts _ = _ _webpack _require _ _ ( "hF7m" ) ;
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/prevent-event-discovery.js
/* harmony default export */ var prevent _event _discovery = ( {
't a l e s o f g u t e n b e r g' : event => {
const {
ownerDocument
} = event . target ;
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
if ( ! ownerDocument . activeElement . classList . contains ( 'edit-post-visual-editor' ) && ownerDocument . activeElement !== ownerDocument . body ) {
return ;
}
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
event . preventDefault ( ) ;
window . wp . data . dispatch ( 'core/block-editor' ) . insertBlock ( window . wp . blocks . createBlock ( 'core/paragraph' , {
content : '🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️'
} ) ) ;
}
} ) ;
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
// EXTERNAL MODULE: ./node_modules/classnames/index.js
2021-05-20 12:20:04 +00:00
var classnames = _ _webpack _require _ _ ( "TSYQ" ) ;
2021-05-19 15:09:27 +00:00
var classnames _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( classnames ) ;
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/text-editor/index.js
2020-06-26 13:33:47 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* WordPress dependencies
2021-05-07 11:48:27 +00:00
* /
2021-01-28 02:04:13 +00:00
2021-05-07 11:48:27 +00:00
2021-01-28 02:04:13 +00:00
2020-06-26 13:33:47 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Internal dependencies
2020-06-26 13:33:47 +00:00
* /
2021-11-15 12:50:17 +00:00
function TextEditor ( _ref ) {
let {
onExit ,
isRichEditingEnabled
} = _ref ;
2021-05-19 15:09:27 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-post-text-editor"
} , isRichEditingEnabled && Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-post-text-editor__toolbar"
} , Object ( external _wp _element _ [ "createElement" ] ) ( "h2" , null , Object ( external _wp _i18n _ [ "__" ] ) ( 'Editing code' ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
2021-11-08 14:29:21 +00:00
variant : "tertiary" ,
2021-05-19 15:09:27 +00:00
onClick : onExit ,
shortcut : external _wp _keycodes _ [ "displayShortcut" ] . secondary ( 'm' )
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Exit code editor' ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "TextEditorGlobalKeyboardShortcuts" ] , null ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-post-text-editor__body"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostTitle" ] , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostTextEditor" ] , null ) ) ) ;
2021-05-07 11:48:27 +00:00
}
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
/* harmony default export */ var text _editor = ( Object ( external _wp _compose _ [ "compose" ] ) ( Object ( external _wp _data _ [ "withSelect" ] ) ( select => ( {
2021-11-08 14:29:21 +00:00
isRichEditingEnabled : select ( external _wp _editor _ [ "store" ] ) . getEditorSettings ( ) . richEditingEnabled
2021-05-19 15:09:27 +00:00
} ) ) , Object ( external _wp _data _ [ "withDispatch" ] ) ( dispatch => {
return {
onExit ( ) {
dispatch ( store [ "a" /* store */ ] ) . switchEditorMode ( 'visual' ) ;
}
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
} ;
} ) ) ( TextEditor ) ) ;
2021-01-28 02:04:13 +00:00
2021-11-08 14:29:21 +00:00
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/arrow-left.js
var arrow _left = _ _webpack _require _ _ ( "cjQ8" ) ;
2021-05-07 11:48:27 +00:00
2021-11-08 14:29:21 +00:00
// EXTERNAL MODULE: external ["wp","a11y"]
var external _wp _a11y _ = _ _webpack _require _ _ ( "gdqT" ) ;
2021-05-07 11:48:27 +00:00
2021-11-08 14:29:21 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/visual-editor/block-inspector-button.js
2021-05-07 11:48:27 +00:00
2021-11-08 14:29:21 +00:00
/ * *
* External dependencies
* /
2021-05-07 11:48:27 +00:00
2021-11-08 14:29:21 +00:00
/ * *
* WordPress dependencies
* /
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
/ * *
2021-11-08 14:29:21 +00:00
* Internal dependencies
2021-05-07 11:48:27 +00:00
* /
2021-11-15 12:50:17 +00:00
function BlockInspectorButton ( _ref ) {
let {
onClick = external _lodash _ [ "noop" ] ,
small = false
} = _ref ;
2021-05-19 15:09:27 +00:00
const {
shortcut ,
areAdvancedSettingsOpened
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => ( {
shortcut : select ( external _wp _keyboardShortcuts _ [ "store" ] ) . getShortcutRepresentation ( 'core/edit-post/toggle-sidebar' ) ,
areAdvancedSettingsOpened : select ( store [ "a" /* store */ ] ) . getActiveGeneralSidebarName ( ) === 'edit-post/block'
} ) , [ ] ) ;
const {
openGeneralSidebar ,
closeGeneralSidebar
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store [ "a" /* store */ ] ) ;
const label = areAdvancedSettingsOpened ? 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 ( areAdvancedSettingsOpened ) {
closeGeneralSidebar ( ) ;
2021-11-08 14:29:21 +00:00
Object ( external _wp _a11y _ [ "speak" ] ) ( Object ( external _wp _i18n _ [ "__" ] ) ( 'Block settings closed' ) ) ;
2021-05-19 15:09:27 +00:00
} else {
openGeneralSidebar ( 'edit-post/block' ) ;
2021-11-08 14:29:21 +00:00
Object ( external _wp _a11y _ [ "speak" ] ) ( Object ( external _wp _i18n _ [ "__" ] ) ( 'Additional settings are now available in the Editor block settings sidebar' ) ) ;
2021-05-19 15:09:27 +00:00
}
2021-11-08 14:29:21 +00:00
onClick ( ) ;
2021-05-19 15:09:27 +00:00
} ,
shortcut : shortcut
} , ! small && label ) ;
2021-05-07 11:48:27 +00:00
}
2021-05-19 15:09:27 +00:00
/* harmony default export */ var block _inspector _button = ( BlockInspectorButton ) ;
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/visual-editor/index.js
2021-05-07 11:48:27 +00:00
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2021-11-15 12:50:17 +00:00
function MaybeIframe ( _ref ) {
let {
children ,
contentRef ,
shouldIframe ,
styles ,
style
} = _ref ;
2021-05-19 15:09:27 +00:00
const ref = Object ( external _wp _blockEditor _ [ "__unstableUseMouseMoveTypingReset" ] ) ( ) ;
2021-05-07 11:48:27 +00:00
2021-11-08 14:29:21 +00:00
if ( ! shouldIframe ) {
2021-05-19 15:09:27 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "__unstableEditorStyles" ] , {
styles : styles
2021-07-15 18:55:29 +00:00
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "WritingFlow" ] , {
2021-05-19 15:09:27 +00:00
ref : contentRef ,
className : "editor-styles-wrapper" ,
style : {
2021-05-21 10:14:23 +00:00
flex : '1' ,
2021-05-19 15:09:27 +00:00
... style
2021-07-15 18:55:29 +00:00
} ,
tabIndex : - 1
2021-05-19 15:09:27 +00:00
} , children ) ) ;
}
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "__unstableIframe" ] , {
head : Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "__unstableEditorStyles" ] , {
styles : styles
} ) ,
ref : ref ,
contentRef : contentRef ,
style : {
width : '100%' ,
height : '100%' ,
display : 'block'
2021-11-08 14:29:21 +00:00
} ,
name : "editor-canvas"
} , children ) ;
2021-05-19 15:09:27 +00:00
}
2021-05-07 11:48:27 +00:00
2021-11-15 12:50:17 +00:00
function VisualEditor ( _ref2 ) {
let {
styles
} = _ref2 ;
2021-05-19 15:09:27 +00:00
const {
deviceType ,
2021-05-21 10:14:23 +00:00
isTemplateMode ,
wrapperBlockName ,
wrapperUniqueId
2021-05-19 15:09:27 +00:00
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
const {
isEditingTemplate ,
_ _experimentalGetPreviewDeviceType
} = select ( store [ "a" /* store */ ] ) ;
2021-05-21 10:14:23 +00:00
const {
getCurrentPostId ,
getCurrentPostType
} = select ( external _wp _editor _ [ "store" ] ) ;
const _isTemplateMode = isEditingTemplate ( ) ;
let _wrapperBlockName ;
if ( getCurrentPostType ( ) === 'wp_block' ) {
_wrapperBlockName = 'core/block' ;
} else if ( ! _isTemplateMode ) {
_wrapperBlockName = 'core/post-content' ;
}
2021-05-07 11:48:27 +00:00
return {
2021-05-19 15:09:27 +00:00
deviceType : _ _experimentalGetPreviewDeviceType ( ) ,
2021-05-21 10:14:23 +00:00
isTemplateMode : _isTemplateMode ,
wrapperBlockName : _wrapperBlockName ,
wrapperUniqueId : getCurrentPostId ( )
2021-05-07 11:48:27 +00:00
} ;
2021-05-19 15:09:27 +00:00
} , [ ] ) ;
const hasMetaBoxes = Object ( external _wp _data _ [ "useSelect" ] ) ( select => select ( store [ "a" /* store */ ] ) . hasMetaBoxes ( ) , [ ] ) ;
const themeSupportsLayout = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
const {
getSettings
} = select ( external _wp _blockEditor _ [ "store" ] ) ;
return getSettings ( ) . supportsLayout ;
} , [ ] ) ;
const {
clearSelectedBlock
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( external _wp _blockEditor _ [ "store" ] ) ;
const {
setIsEditingTemplate
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store [ "a" /* store */ ] ) ;
const desktopCanvasStyles = {
2021-11-08 14:29:21 +00:00
// We intentionally omit a 100% height here. The container is a flex item, so the 100% height is granted by default.
// If a percentage height is present, older browsers such as Safari 13 apply that, but do so incorrectly as the inheritance is buggy.
2021-05-19 15:09:27 +00:00
width : '100%' ,
2021-05-21 10:14:23 +00:00
margin : 0 ,
display : 'flex' ,
flexFlow : 'column' ,
// Default background color so that grey
// .edit-post-editor-regions__content color doesn't show through.
background : 'white'
2021-05-07 11:48:27 +00:00
} ;
2021-05-19 15:09:27 +00:00
const templateModeStyles = { ... desktopCanvasStyles ,
borderRadius : '2px 2px 0 0' ,
border : '1px solid #ddd' ,
borderBottom : 0
} ;
const resizedCanvasStyles = Object ( external _wp _blockEditor _ [ "__experimentalUseResizeCanvas" ] ) ( deviceType , isTemplateMode ) ;
2021-05-21 10:14:23 +00:00
const defaultLayout = Object ( external _wp _blockEditor _ [ "useSetting" ] ) ( 'layout' ) ;
2021-11-08 14:29:21 +00:00
const previewMode = 'is-' + deviceType . toLowerCase ( ) + '-preview' ;
2021-05-19 15:09:27 +00:00
let animatedStyles = isTemplateMode ? templateModeStyles : desktopCanvasStyles ;
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
if ( resizedCanvasStyles ) {
animatedStyles = resizedCanvasStyles ;
}
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
let paddingBottom ; // Add a constant padding for the typewritter effect. When typing at the
// bottom, there needs to be room to scroll up.
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
if ( ! hasMetaBoxes && ! resizedCanvasStyles && ! isTemplateMode ) {
paddingBottom = '40vh' ;
}
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
const ref = Object ( external _wp _element _ [ "useRef" ] ) ( ) ;
const contentRef = Object ( external _wp _compose _ [ "useMergeRefs" ] ) ( [ ref , Object ( external _wp _blockEditor _ [ "__unstableUseClipboardHandler" ] ) ( ) , Object ( external _wp _blockEditor _ [ "__unstableUseCanvasClickRedirect" ] ) ( ) , Object ( external _wp _blockEditor _ [ "__unstableUseTypewriter" ] ) ( ) , Object ( external _wp _blockEditor _ [ "__unstableUseTypingObserver" ] ) ( ) , Object ( external _wp _blockEditor _ [ "__unstableUseBlockSelectionClearer" ] ) ( ) ] ) ;
2021-05-21 10:14:23 +00:00
const blockSelectionClearerRef = Object ( external _wp _blockEditor _ [ "__unstableUseBlockSelectionClearer" ] ) ( ) ;
const [ , RecursionProvider ] = Object ( external _wp _blockEditor _ [ "__experimentalUseNoRecursiveRenders" ] ) ( wrapperUniqueId , wrapperBlockName ) ;
2021-06-08 08:09:53 +00:00
const layout = Object ( external _wp _element _ [ "useMemo" ] ) ( ( ) => {
if ( isTemplateMode ) {
return {
type : 'default'
} ;
}
if ( themeSupportsLayout ) {
2021-11-08 14:29:21 +00:00
return defaultLayout ;
2021-06-08 08:09:53 +00:00
}
return undefined ;
2021-11-08 14:29:21 +00:00
} , [ isTemplateMode , themeSupportsLayout , defaultLayout ] ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "BlockTools" ] , {
_ _unstableContentRef : ref ,
2021-05-19 15:09:27 +00:00
className : classnames _default ( ) ( 'edit-post-visual-editor' , {
'is-template-mode' : isTemplateMode
2021-05-21 10:14:23 +00:00
} )
2021-11-08 14:29:21 +00:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "VisualEditorGlobalKeyboardShortcuts" ] , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__unstableMotion" ] . div , {
2021-05-21 10:14:23 +00:00
className : "edit-post-visual-editor__content-area" ,
animate : {
padding : isTemplateMode ? '48px 48px 0' : '0'
2021-05-19 15:09:27 +00:00
} ,
ref : blockSelectionClearerRef
2021-05-21 10:14:23 +00:00
} , isTemplateMode && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
2021-05-19 15:09:27 +00:00
className : "edit-post-visual-editor__exit-template-mode" ,
2021-06-01 08:10:04 +00:00
icon : arrow _left [ "a" /* default */ ] ,
2021-05-19 15:09:27 +00:00
onClick : ( ) => {
clearSelectedBlock ( ) ;
setIsEditingTemplate ( false ) ;
}
2021-11-08 14:29:21 +00:00
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Back' ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__unstableMotion" ] . div , {
2021-05-19 15:09:27 +00:00
animate : animatedStyles ,
2021-11-08 14:29:21 +00:00
initial : desktopCanvasStyles ,
className : previewMode
2021-05-21 10:14:23 +00:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( MaybeIframe , {
2021-11-08 14:29:21 +00:00
shouldIframe : isTemplateMode || deviceType === 'Tablet' || deviceType === 'Mobile' ,
2021-05-19 15:09:27 +00:00
contentRef : contentRef ,
styles : styles ,
style : {
paddingBottom
}
2021-06-08 08:09:53 +00:00
} , themeSupportsLayout && ! isTemplateMode && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "__experimentalLayoutStyle" ] , {
2021-05-21 10:14:23 +00:00
selector : ".edit-post-visual-editor__post-title-wrapper, .block-editor-block-list__layout.is-root-container" ,
layout : defaultLayout
2021-07-15 18:55:29 +00:00
} ) , ! isTemplateMode && Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
2021-05-19 15:09:27 +00:00
className : "edit-post-visual-editor__post-title-wrapper"
2021-05-21 10:14:23 +00:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostTitle" ] , null ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( RecursionProvider , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "BlockList" ] , {
2021-11-08 14:29:21 +00:00
className : isTemplateMode ? 'wp-site-blocks' : undefined ,
2021-06-08 08:09:53 +00:00
_ _experimentalLayout : layout
2021-11-15 12:50:17 +00:00
} ) ) ) ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "__unstableBlockSettingsMenuFirstItem" ] , null , _ref3 => {
let {
onClose
} = _ref3 ;
return Object ( external _wp _element _ [ "createElement" ] ) ( block _inspector _button , {
onClick : onClose
} ) ;
} ) ) ;
2021-05-19 15:09:27 +00:00
}
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/keyboard-shortcuts/index.js
2021-05-07 11:48:27 +00:00
/ * *
* WordPress dependencies
* /
2021-05-21 10:14:23 +00:00
2021-05-07 11:48:27 +00:00
/ * *
* Internal dependencies
* /
2021-05-19 15:09:27 +00:00
function KeyboardShortcuts ( ) {
const {
getBlockSelectionStart
2021-05-21 10:14:23 +00:00
} = Object ( external _wp _data _ [ "useSelect" ] ) ( external _wp _blockEditor _ [ "store" ] ) ;
2021-05-19 15:09:27 +00:00
const {
getEditorMode ,
2021-05-21 10:14:23 +00:00
isEditorSidebarOpened ,
isListViewOpened
2021-05-19 15:09:27 +00:00
} = Object ( external _wp _data _ [ "useSelect" ] ) ( store [ "a" /* store */ ] ) ;
const isModeToggleDisabled = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
const {
richEditingEnabled ,
codeEditingEnabled
2021-05-21 10:14:23 +00:00
} = select ( external _wp _editor _ [ "store" ] ) . getEditorSettings ( ) ;
2021-05-19 15:09:27 +00:00
return ! richEditingEnabled || ! codeEditingEnabled ;
} , [ ] ) ;
const {
switchEditorMode ,
openGeneralSidebar ,
closeGeneralSidebar ,
2021-05-21 10:14:23 +00:00
toggleFeature ,
setIsListViewOpened
2021-05-19 15:09:27 +00:00
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store [ "a" /* store */ ] ) ;
const {
registerShortcut
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( external _wp _keyboardShortcuts _ [ "store" ] ) ;
Object ( external _wp _element _ [ "useEffect" ] ) ( ( ) => {
registerShortcut ( {
name : 'core/edit-post/toggle-mode' ,
category : 'global' ,
description : Object ( external _wp _i18n _ [ "__" ] ) ( 'Switch between visual editor and code editor.' ) ,
keyCombination : {
modifier : 'secondary' ,
character : 'm'
}
} ) ;
registerShortcut ( {
name : 'core/edit-post/toggle-fullscreen' ,
category : 'global' ,
description : Object ( external _wp _i18n _ [ "__" ] ) ( 'Toggle fullscreen mode.' ) ,
keyCombination : {
modifier : 'secondary' ,
character : 'f'
}
} ) ;
registerShortcut ( {
2021-11-08 14:29:21 +00:00
name : 'core/edit-post/toggle-list-view' ,
2021-05-19 15:09:27 +00:00
category : 'global' ,
description : Object ( external _wp _i18n _ [ "__" ] ) ( 'Open the block list view.' ) ,
keyCombination : {
modifier : 'access' ,
character : 'o'
}
} ) ;
registerShortcut ( {
name : 'core/edit-post/toggle-sidebar' ,
category : 'global' ,
description : Object ( external _wp _i18n _ [ "__" ] ) ( 'Show or hide the settings sidebar.' ) ,
keyCombination : {
modifier : 'primaryShift' ,
character : ','
}
} ) ;
registerShortcut ( {
name : 'core/edit-post/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-post/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 ( {
name : 'core/edit-post/keyboard-shortcuts' ,
category : 'main' ,
description : Object ( external _wp _i18n _ [ "__" ] ) ( 'Display these keyboard shortcuts.' ) ,
keyCombination : {
modifier : 'access' ,
character : 'h'
}
} ) ;
} , [ ] ) ;
Object ( external _wp _keyboardShortcuts _ [ "useShortcut" ] ) ( 'core/edit-post/toggle-mode' , ( ) => {
switchEditorMode ( getEditorMode ( ) === 'visual' ? 'text' : 'visual' ) ;
} , {
isDisabled : isModeToggleDisabled
} ) ;
Object ( external _wp _keyboardShortcuts _ [ "useShortcut" ] ) ( 'core/edit-post/toggle-fullscreen' , ( ) => {
toggleFeature ( 'fullscreenMode' ) ;
} ) ;
Object ( external _wp _keyboardShortcuts _ [ "useShortcut" ] ) ( 'core/edit-post/toggle-sidebar' , event => {
// This shortcut has no known clashes, but use preventDefault to prevent any
// obscure shortcuts from triggering.
event . preventDefault ( ) ;
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
if ( isEditorSidebarOpened ( ) ) {
closeGeneralSidebar ( ) ;
} else {
const sidebarToOpen = getBlockSelectionStart ( ) ? 'edit-post/block' : 'edit-post/document' ;
openGeneralSidebar ( sidebarToOpen ) ;
2021-05-07 11:48:27 +00:00
}
2021-05-21 10:14:23 +00:00
} ) ;
2021-11-08 14:29:21 +00:00
Object ( external _wp _keyboardShortcuts _ [ "useShortcut" ] ) ( 'core/edit-post/toggle-list-view' , ( ) => setIsListViewOpened ( ! isListViewOpened ( ) ) ) ;
2021-05-19 15:09:27 +00:00
return null ;
2021-05-07 11:48:27 +00:00
}
2021-05-19 15:09:27 +00:00
/* harmony default export */ var keyboard _shortcuts = ( KeyboardShortcuts ) ;
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/keyboard-shortcut-help-modal/config.js
2021-05-07 11:48:27 +00:00
/ * *
* WordPress dependencies
* /
2021-05-19 15:09:27 +00:00
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.' )
} ] ;
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/keyboard-shortcut-help-modal/shortcut.js
2021-05-07 11:48:27 +00:00
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
2021-11-15 12:50:17 +00:00
function KeyCombination ( _ref ) {
let {
keyCombination ,
forceAriaLabel
} = _ref ;
2021-05-19 15:09:27 +00:00
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-post-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 ) ;
2021-05-07 11:48:27 +00:00
}
2021-05-19 15:09:27 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( "kbd" , {
key : index ,
className : "edit-post-keyboard-shortcut-help-modal__shortcut-key"
} , character ) ;
} ) ) ;
2021-05-07 11:48:27 +00:00
}
2021-11-15 12:50:17 +00:00
function Shortcut ( _ref2 ) {
let {
description ,
keyCombination ,
aliases = [ ] ,
ariaLabel
} = _ref2 ;
2021-05-19 15:09:27 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-post-keyboard-shortcut-help-modal__shortcut-description"
} , description ) , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-post-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
} ) ) ) ) ;
}
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
/* harmony default export */ var keyboard _shortcut _help _modal _shortcut = ( Shortcut ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js
2021-05-07 11:48:27 +00:00
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2021-11-15 12:50:17 +00:00
function DynamicShortcut ( _ref ) {
let {
name
} = _ref ;
2021-05-19 15:09:27 +00:00
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 )
} ;
2021-11-08 14:29:21 +00:00
} , [ name ] ) ;
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
if ( ! keyCombination ) {
2021-05-07 11:48:27 +00:00
return null ;
}
2021-05-19 15:09:27 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( keyboard _shortcut _help _modal _shortcut , {
keyCombination : keyCombination ,
description : description ,
aliases : aliases
} ) ;
2021-05-07 11:48:27 +00:00
}
2021-05-19 15:09:27 +00:00
/* harmony default export */ var dynamic _shortcut = ( DynamicShortcut ) ;
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/keyboard-shortcut-help-modal/index.js
2021-05-07 11:48:27 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* External dependencies
2021-05-07 11:48:27 +00:00
* /
/ * *
2021-05-19 15:09:27 +00:00
* WordPress dependencies
2021-05-07 11:48:27 +00:00
* /
/ * *
2021-05-19 15:09:27 +00:00
* Internal dependencies
2021-05-07 11:48:27 +00:00
* /
2021-05-19 15:09:27 +00:00
const MODAL _NAME = 'edit-post/keyboard-shortcut-help' ;
2021-11-15 12:50:17 +00:00
const ShortcutList = _ref => {
let {
shortcuts
} = _ref ;
return (
/ *
* Disable reason : The ` list ` ARIA role is redundant but
* Safari + VoiceOver won ' t announce the list otherwise .
* /
/* eslint-disable jsx-a11y/no-redundant-roles */
Object ( external _wp _element _ [ "createElement" ] ) ( "ul" , {
className : "edit-post-keyboard-shortcut-help-modal__shortcut-list" ,
role : "list"
} , shortcuts . map ( ( shortcut , index ) => Object ( external _wp _element _ [ "createElement" ] ) ( "li" , {
className : "edit-post-keyboard-shortcut-help-modal__shortcut" ,
key : index
} , Object ( external _lodash _ [ "isString" ] ) ( shortcut ) ? Object ( external _wp _element _ [ "createElement" ] ) ( dynamic _shortcut , {
name : shortcut
} ) : Object ( external _wp _element _ [ "createElement" ] ) ( keyboard _shortcut _help _modal _shortcut , shortcut ) ) ) )
/* eslint-enable jsx-a11y/no-redundant-roles */
2021-05-07 11:48:27 +00:00
2021-11-15 12:50:17 +00:00
) ;
} ;
const ShortcutSection = _ref2 => {
let {
title ,
shortcuts ,
className
} = _ref2 ;
return Object ( external _wp _element _ [ "createElement" ] ) ( "section" , {
className : classnames _default ( ) ( 'edit-post-keyboard-shortcut-help-modal__section' , className )
} , ! ! title && Object ( external _wp _element _ [ "createElement" ] ) ( "h2" , {
className : "edit-post-keyboard-shortcut-help-modal__section-title"
} , title ) , Object ( external _wp _element _ [ "createElement" ] ) ( ShortcutList , {
shortcuts : shortcuts
} ) ) ;
} ;
const ShortcutCategorySection = _ref3 => {
let {
title ,
categoryName ,
additionalShortcuts = [ ]
} = _ref3 ;
2021-05-19 15:09:27 +00:00
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 )
} ) ;
} ;
2021-05-07 11:48:27 +00:00
2021-11-15 12:50:17 +00:00
function KeyboardShortcutHelpModal ( _ref4 ) {
let {
isModalActive ,
toggleModal
} = _ref4 ;
2021-11-08 14:29:21 +00:00
Object ( external _wp _keyboardShortcuts _ [ "useShortcut" ] ) ( 'core/edit-post/keyboard-shortcuts' , toggleModal ) ;
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
if ( ! isModalActive ) {
return null ;
}
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Modal" ] , {
className : "edit-post-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-post-keyboard-shortcut-help-modal__main-shortcuts" ,
shortcuts : [ 'core/edit-post/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
} ) ) ;
}
/* harmony default export */ var keyboard _shortcut _help _modal = ( Object ( external _wp _compose _ [ "compose" ] ) ( [ Object ( external _wp _data _ [ "withSelect" ] ) ( select => ( {
isModalActive : select ( store [ "a" /* store */ ] ) . isModalActive ( MODAL _NAME )
2021-11-15 12:50:17 +00:00
} ) ) , Object ( external _wp _data _ [ "withDispatch" ] ) ( ( dispatch , _ref5 ) => {
let {
isModalActive
} = _ref5 ;
2021-05-19 15:09:27 +00:00
const {
openModal ,
closeModal
} = dispatch ( store [ "a" /* store */ ] ) ;
2021-05-07 11:48:27 +00:00
return {
2021-05-19 15:09:27 +00:00
toggleModal : ( ) => isModalActive ? closeModal ( ) : openModal ( MODAL _NAME )
2021-05-07 11:48:27 +00:00
} ;
2021-05-19 15:09:27 +00:00
} ) ] ) ( KeyboardShortcutHelpModal ) ) ;
2021-05-07 11:48:27 +00:00
2021-11-08 14:29:21 +00: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" ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/section.js
2021-11-15 12:50:17 +00:00
const Section = _ref => {
let {
description ,
title ,
children
} = _ref ;
return Object ( external _wp _element _ [ "createElement" ] ) ( "section" , {
className : "edit-post-preferences-modal__section"
} , Object ( external _wp _element _ [ "createElement" ] ) ( "h2" , {
className : "edit-post-preferences-modal__section-title"
} , title ) , description && Object ( external _wp _element _ [ "createElement" ] ) ( "p" , {
className : "edit-post-preferences-modal__section-description"
} , description ) , children ) ;
} ;
2021-11-08 14:29:21 +00:00
/* harmony default export */ var preferences _modal _section = ( Section ) ;
// EXTERNAL MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/options/index.js + 6 modules
var options = _ _webpack _require _ _ ( "Y5n4" ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/meta-boxes-section.js
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2021-11-15 12:50:17 +00:00
function MetaBoxesSection ( _ref ) {
let {
areCustomFieldsRegistered ,
metaBoxes ,
... sectionProps
} = _ref ;
2021-11-08 14:29:21 +00:00
// The 'Custom Fields' meta box is a special case that we handle separately.
2021-11-15 12:50:17 +00:00
const thirdPartyMetaBoxes = Object ( external _lodash _ [ "filter" ] ) ( metaBoxes , _ref2 => {
let {
id
} = _ref2 ;
return id !== 'postcustom' ;
} ) ;
2021-11-08 14:29:21 +00:00
if ( ! areCustomFieldsRegistered && thirdPartyMetaBoxes . length === 0 ) {
return null ;
}
return Object ( external _wp _element _ [ "createElement" ] ) ( preferences _modal _section , sectionProps , areCustomFieldsRegistered && Object ( external _wp _element _ [ "createElement" ] ) ( options [ "a" /* EnableCustomFieldsOption */ ] , {
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Custom fields' )
2021-11-15 12:50:17 +00:00
} ) , Object ( external _lodash _ [ "map" ] ) ( thirdPartyMetaBoxes , _ref3 => {
let {
id ,
title
} = _ref3 ;
return Object ( external _wp _element _ [ "createElement" ] ) ( options [ "c" /* EnablePanelOption */ ] , {
key : id ,
label : title ,
panelName : ` meta-box- ${ id } `
} ) ;
} ) ) ;
2021-11-08 14:29:21 +00:00
}
/* harmony default export */ var meta _boxes _section = ( Object ( external _wp _data _ [ "withSelect" ] ) ( select => {
const {
getEditorSettings
} = select ( external _wp _editor _ [ "store" ] ) ;
const {
getAllMetaBoxes
} = select ( store [ "a" /* store */ ] ) ;
return {
// This setting should not live in the block editor's store.
areCustomFieldsRegistered : getEditorSettings ( ) . enableCustomFields !== undefined ,
metaBoxes : getAllMetaBoxes ( )
} ;
} ) ( MetaBoxesSection ) ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/block-manager/checklist.js
2021-05-07 11:48:27 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* External dependencies
2021-05-07 11:48:27 +00:00
* /
/ * *
2021-05-19 15:09:27 +00:00
* WordPress dependencies
2021-05-07 11:48:27 +00:00
* /
2021-11-15 12:50:17 +00:00
function BlockTypesChecklist ( _ref ) {
let {
blockTypes ,
value ,
onItemChange
} = _ref ;
2021-05-19 15:09:27 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( "ul" , {
2021-11-08 14:29:21 +00:00
className : "edit-post-block-manager__checklist"
2021-05-19 15:09:27 +00:00
} , blockTypes . map ( blockType => Object ( external _wp _element _ [ "createElement" ] ) ( "li" , {
key : blockType . name ,
2021-11-08 14:29:21 +00:00
className : "edit-post-block-manager__checklist-item"
2021-05-19 15:09:27 +00:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "CheckboxControl" ] , {
label : Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , blockType . title , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "BlockIcon" ] , {
icon : blockType . icon
} ) ) ,
checked : value . includes ( blockType . name ) ,
onChange : Object ( external _lodash _ [ "partial" ] ) ( onItemChange , blockType . name )
2021-05-07 11:48:27 +00:00
} ) ) ) ) ;
}
2021-05-19 15:09:27 +00:00
/* harmony default export */ var checklist = ( BlockTypesChecklist ) ;
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/edit-post-settings/index.js
2021-05-07 11:48:27 +00:00
/ * *
* WordPress dependencies
* /
2021-05-19 15:09:27 +00:00
const EditPostSettings = Object ( external _wp _element _ [ "createContext" ] ) ( { } ) ;
/* harmony default export */ var edit _post _settings = ( EditPostSettings ) ;
2021-05-07 11:48:27 +00:00
2021-11-08 14:29:21 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/block-manager/category.js
2021-05-07 11:48:27 +00:00
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2021-11-15 12:50:17 +00:00
function BlockManagerCategory ( _ref ) {
let {
instanceId ,
title ,
blockTypes ,
hiddenBlockTypes ,
toggleVisible ,
toggleAllVisible
} = _ref ;
2021-05-19 15:09:27 +00:00
const settings = Object ( external _wp _element _ [ "useContext" ] ) ( edit _post _settings ) ;
const {
allowedBlockTypes
} = settings ;
const filteredBlockTypes = Object ( external _wp _element _ [ "useMemo" ] ) ( ( ) => {
if ( allowedBlockTypes === true ) {
return blockTypes ;
}
2021-05-07 11:48:27 +00:00
2021-11-15 12:50:17 +00:00
return blockTypes . filter ( _ref2 => {
let {
name
} = _ref2 ;
2021-05-19 15:09:27 +00:00
return Object ( external _lodash _ [ "includes" ] ) ( allowedBlockTypes || [ ] , name ) ;
} ) ;
} , [ allowedBlockTypes , blockTypes ] ) ;
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
if ( ! filteredBlockTypes . length ) {
return null ;
}
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
const checkedBlockNames = Object ( external _lodash _ [ "without" ] ) ( Object ( external _lodash _ [ "map" ] ) ( filteredBlockTypes , 'name' ) , ... hiddenBlockTypes ) ;
2021-11-08 14:29:21 +00:00
const titleId = 'edit-post-block-manager__category-title-' + instanceId ;
2021-05-19 15:09:27 +00:00
const isAllChecked = checkedBlockNames . length === filteredBlockTypes . length ;
let ariaChecked ;
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
if ( isAllChecked ) {
ariaChecked = 'true' ;
} else if ( checkedBlockNames . length > 0 ) {
ariaChecked = 'mixed' ;
} else {
ariaChecked = 'false' ;
}
2021-05-07 11:48:27 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
2021-05-19 15:09:27 +00:00
role : "group" ,
"aria-labelledby" : titleId ,
2021-11-08 14:29:21 +00:00
className : "edit-post-block-manager__category"
2021-05-19 15:09:27 +00:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "CheckboxControl" ] , {
checked : isAllChecked ,
onChange : toggleAllVisible ,
2021-11-08 14:29:21 +00:00
className : "edit-post-block-manager__category-title" ,
2021-05-19 15:09:27 +00:00
"aria-checked" : ariaChecked ,
label : Object ( external _wp _element _ [ "createElement" ] ) ( "span" , {
id : titleId
} , title )
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( checklist , {
blockTypes : filteredBlockTypes ,
value : checkedBlockNames ,
onItemChange : toggleVisible
} ) ) ;
2021-05-07 11:48:27 +00:00
}
2021-11-08 14:29:21 +00:00
/* harmony default export */ var block _manager _category = ( Object ( external _wp _compose _ [ "compose" ] ) ( [ external _wp _compose _ [ "withInstanceId" ] , Object ( external _wp _data _ [ "withSelect" ] ) ( select => {
2021-05-19 15:09:27 +00:00
const {
getPreference
} = select ( store [ "a" /* store */ ] ) ;
return {
hiddenBlockTypes : getPreference ( 'hiddenBlockTypes' )
} ;
} ) , Object ( external _wp _data _ [ "withDispatch" ] ) ( ( dispatch , ownProps ) => {
const {
showBlockTypes ,
hideBlockTypes
} = dispatch ( store [ "a" /* store */ ] ) ;
return {
toggleVisible ( blockName , nextIsChecked ) {
if ( nextIsChecked ) {
showBlockTypes ( blockName ) ;
} else {
hideBlockTypes ( blockName ) ;
}
} ,
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
toggleAllVisible ( nextIsChecked ) {
const blockNames = Object ( external _lodash _ [ "map" ] ) ( ownProps . blockTypes , 'name' ) ;
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
if ( nextIsChecked ) {
showBlockTypes ( blockNames ) ;
} else {
hideBlockTypes ( blockNames ) ;
}
}
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
} ;
} ) ] ) ( BlockManagerCategory ) ) ;
2021-05-07 11:48:27 +00:00
2021-11-08 14:29:21 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/block-manager/index.js
2021-05-07 11:48:27 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* External dependencies
2021-05-07 11:48:27 +00:00
* /
/ * *
2021-05-19 15:09:27 +00:00
* WordPress dependencies
2021-05-07 11:48:27 +00:00
* /
2021-05-19 15:09:27 +00:00
/ * *
* Internal dependencies
* /
2021-05-07 11:48:27 +00:00
2021-11-15 12:50:17 +00:00
function BlockManager ( _ref ) {
let {
blockTypes ,
categories ,
hasBlockSupport ,
isMatchingSearchTerm ,
numberOfHiddenBlocks
} = _ref ;
2021-11-08 14:29:21 +00:00
const [ search , setSearch ] = Object ( external _wp _element _ [ "useState" ] ) ( '' ) ; // Filtering occurs here (as opposed to `withSelect`) to avoid
2021-05-19 15:09:27 +00:00
// wasted renders by consequence of `Array#filter` producing
// a new value reference on each call.
2021-11-08 14:29:21 +00:00
2021-05-19 15:09:27 +00:00
blockTypes = blockTypes . filter ( blockType => hasBlockSupport ( blockType , 'inserter' , true ) && ( ! search || isMatchingSearchTerm ( blockType , search ) ) && ( ! blockType . parent || Object ( external _lodash _ [ "includes" ] ) ( blockType . parent , 'core/post-content' ) ) ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
2021-11-08 14:29:21 +00:00
className : "edit-post-block-manager__content"
} , ! ! numberOfHiddenBlocks && Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-post-block-manager__disabled-blocks-count"
2021-05-19 15:09:27 +00:00
} , Object ( external _wp _i18n _ [ "sprintf" ] ) (
/* translators: %d: number of blocks. */
2021-11-08 14:29:21 +00:00
Object ( external _wp _i18n _ [ "_n" ] ) ( '%d block is hidden.' , '%d blocks are hidden.' , numberOfHiddenBlocks ) , numberOfHiddenBlocks ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "SearchControl" ] , {
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Search for a block' ) ,
placeholder : Object ( external _wp _i18n _ [ "__" ] ) ( 'Search for a block' ) ,
value : search ,
onChange : nextSearch => setSearch ( nextSearch ) ,
className : "edit-post-block-manager__search"
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
2021-05-19 15:09:27 +00:00
tabIndex : "0" ,
role : "region" ,
"aria-label" : Object ( external _wp _i18n _ [ "__" ] ) ( 'Available block types' ) ,
2021-11-08 14:29:21 +00:00
className : "edit-post-block-manager__results"
2021-05-19 15:09:27 +00:00
} , blockTypes . length === 0 && Object ( external _wp _element _ [ "createElement" ] ) ( "p" , {
2021-11-08 14:29:21 +00:00
className : "edit-post-block-manager__no-results"
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'No blocks found.' ) ) , categories . map ( category => Object ( external _wp _element _ [ "createElement" ] ) ( block _manager _category , {
2021-05-19 15:09:27 +00:00
key : category . slug ,
title : category . title ,
blockTypes : Object ( external _lodash _ [ "filter" ] ) ( blockTypes , {
category : category . slug
} )
2021-11-08 14:29:21 +00:00
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( block _manager _category , {
2021-05-19 15:09:27 +00:00
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Uncategorized' ) ,
2021-11-15 12:50:17 +00:00
blockTypes : Object ( external _lodash _ [ "filter" ] ) ( blockTypes , _ref2 => {
let {
category
} = _ref2 ;
return ! category ;
} )
2021-05-19 15:09:27 +00:00
} ) ) ) ;
}
2021-05-07 11:48:27 +00:00
2021-11-08 14:29:21 +00:00
/* harmony default export */ var block _manager = ( Object ( external _wp _data _ [ "withSelect" ] ) ( select => {
2021-05-19 15:09:27 +00:00
const {
getBlockTypes ,
getCategories ,
hasBlockSupport ,
2021-11-08 14:29:21 +00:00
isMatchingSearchTerm
} = select ( external _wp _blocks _ [ "store" ] ) ;
2021-05-19 15:09:27 +00:00
const {
2021-11-08 14:29:21 +00:00
getPreference
2021-05-19 15:09:27 +00:00
} = select ( store [ "a" /* store */ ] ) ;
2021-11-08 14:29:21 +00:00
const hiddenBlockTypes = getPreference ( 'hiddenBlockTypes' ) ;
const numberOfHiddenBlocks = Object ( external _lodash _ [ "isArray" ] ) ( hiddenBlockTypes ) && hiddenBlockTypes . length ;
2021-05-19 15:09:27 +00:00
return {
2021-11-08 14:29:21 +00:00
blockTypes : getBlockTypes ( ) ,
categories : getCategories ( ) ,
hasBlockSupport ,
isMatchingSearchTerm ,
numberOfHiddenBlocks
2021-05-19 15:09:27 +00:00
} ;
2021-11-08 14:29:21 +00:00
} ) ( BlockManager ) ) ;
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/index.js
2018-12-14 04:41:57 +00:00
2021-11-08 14:29:21 +00:00
2020-01-08 11:57:23 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* External dependencies
2020-01-08 11:57:23 +00:00
* /
2019-09-19 15:19:18 +00:00
2021-05-07 11:48:27 +00:00
/ * *
* WordPress dependencies
* /
2018-12-14 04:41:57 +00:00
2018-12-19 03:16:48 +00:00
2019-09-19 15:19:18 +00:00
2018-12-14 04:41:57 +00:00
2021-11-08 14:29:21 +00:00
2018-12-14 04:41:57 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Internal dependencies
2018-12-14 04:41:57 +00:00
* /
2021-01-28 02:04:13 +00:00
2020-06-26 13:33:47 +00:00
2021-11-08 14:29:21 +00:00
2021-05-19 15:09:27 +00:00
const preferences _modal _MODAL _NAME = 'edit-post/preferences' ;
const PREFERENCES _MENU = 'preferences-menu' ;
2021-11-08 14:29:21 +00:00
2021-11-15 12:50:17 +00:00
function NavigationButton ( _ref ) {
let {
as : Tag = external _wp _components _ [ "Button" ] ,
path ,
isBack = false ,
... props
} = _ref ;
2021-11-08 14:29:21 +00:00
const navigator = Object ( external _wp _components _ [ "__experimentalUseNavigator" ] ) ( ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( Tag , Object ( esm _extends [ "a" /* default */ ] ) ( {
onClick : ( ) => navigator . push ( path , {
isBack
} )
} , props ) ) ;
}
2021-05-19 15:09:27 +00:00
function PreferencesModal ( ) {
const isLargeViewport = Object ( external _wp _compose _ [ "useViewportMatch" ] ) ( 'medium' ) ;
const {
closeModal
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store [ "a" /* store */ ] ) ;
const {
isModalActive ,
isViewable
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
const {
getEditedPostAttribute
} = select ( external _wp _editor _ [ "store" ] ) ;
const {
getPostType
} = select ( external _wp _coreData _ [ "store" ] ) ;
const postType = getPostType ( getEditedPostAttribute ( 'type' ) ) ;
return {
isModalActive : select ( store [ "a" /* store */ ] ) . isModalActive ( preferences _modal _MODAL _NAME ) ,
isViewable : Object ( external _lodash _ [ "get" ] ) ( postType , [ 'viewable' ] , false )
} ;
} , [ ] ) ;
const showBlockBreadcrumbsOption = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
const {
getEditorSettings
} = select ( external _wp _editor _ [ "store" ] ) ;
const {
getEditorMode ,
isFeatureActive
} = select ( store [ "a" /* store */ ] ) ;
const mode = getEditorMode ( ) ;
const isRichEditingEnabled = getEditorSettings ( ) . richEditingEnabled ;
const hasReducedUI = isFeatureActive ( 'reducedUI' ) ;
return ! hasReducedUI && isLargeViewport && isRichEditingEnabled && mode === 'visual' ;
} , [ isLargeViewport ] ) ;
const sections = Object ( external _wp _element _ [ "useMemo" ] ) ( ( ) => [ {
name : 'general' ,
tabLabel : Object ( external _wp _i18n _ [ "__" ] ) ( 'General' ) ,
content : Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , isLargeViewport && Object ( external _wp _element _ [ "createElement" ] ) ( preferences _modal _section , {
2021-11-08 14:29:21 +00:00
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Publishing' ) ,
description : Object ( external _wp _i18n _ [ "__" ] ) ( 'Change options related to publishing.' )
} , Object ( external _wp _element _ [ "createElement" ] ) ( options [ "e" /* EnablePublishSidebarOption */ ] , {
help : Object ( external _wp _i18n _ [ "__" ] ) ( 'Review settings, such as visibility and tags.' ) ,
2021-05-19 15:09:27 +00:00
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Include pre-publish checklist' )
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( preferences _modal _section , {
2021-11-08 14:29:21 +00:00
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Appearance' ) ,
description : Object ( external _wp _i18n _ [ "__" ] ) ( 'Customize options related to the block editor interface and editing flow.' )
} , Object ( external _wp _element _ [ "createElement" ] ) ( options [ "b" /* EnableFeature */ ] , {
2021-05-19 15:09:27 +00:00
featureName : "reducedUI" ,
help : Object ( external _wp _i18n _ [ "__" ] ) ( 'Compacts options and outlines in the toolbar.' ) ,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Reduce the interface' )
2021-11-08 14:29:21 +00:00
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( options [ "b" /* EnableFeature */ ] , {
2021-05-19 15:09:27 +00:00
featureName : "focusMode" ,
help : Object ( external _wp _i18n _ [ "__" ] ) ( 'Highlights the current block and fades other content.' ) ,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Spotlight mode' )
2021-11-08 14:29:21 +00:00
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( options [ "b" /* EnableFeature */ ] , {
2021-05-19 15:09:27 +00:00
featureName : "showIconLabels" ,
2021-11-08 14:29:21 +00:00
help : Object ( external _wp _i18n _ [ "__" ] ) ( 'Shows text instead of icons.' ) ,
2021-05-19 15:09:27 +00:00
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Display button labels' )
2021-11-08 14:29:21 +00:00
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( options [ "b" /* EnableFeature */ ] , {
2021-05-19 15:09:27 +00:00
featureName : "themeStyles" ,
help : Object ( external _wp _i18n _ [ "__" ] ) ( 'Make the editor look like your theme.' ) ,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Use theme styles' )
2021-11-08 14:29:21 +00:00
} ) , showBlockBreadcrumbsOption && Object ( external _wp _element _ [ "createElement" ] ) ( options [ "b" /* EnableFeature */ ] , {
featureName : "showBlockBreadcrumbs" ,
help : Object ( external _wp _i18n _ [ "__" ] ) ( 'Shows block breadcrumbs at the bottom of the editor.' ) ,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Display block breadcrumbs' )
} ) ) )
2021-05-19 15:09:27 +00:00
} , {
name : 'blocks' ,
tabLabel : Object ( external _wp _i18n _ [ "__" ] ) ( 'Blocks' ) ,
2021-11-08 14:29:21 +00:00
content : Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( preferences _modal _section , {
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Block interactions' ) ,
description : Object ( external _wp _i18n _ [ "__" ] ) ( 'Customize how you interact with blocks in the block library and editing canvas.' )
} , Object ( external _wp _element _ [ "createElement" ] ) ( options [ "b" /* EnableFeature */ ] , {
2021-05-19 15:09:27 +00:00
featureName : "mostUsedBlocks" ,
help : Object ( external _wp _i18n _ [ "__" ] ) ( 'Places the most frequent blocks in the block library.' ) ,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Show most used blocks' )
2021-11-08 14:29:21 +00:00
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( options [ "b" /* EnableFeature */ ] , {
2021-05-19 15:09:27 +00:00
featureName : "keepCaretInsideBlock" ,
help : Object ( external _wp _i18n _ [ "__" ] ) ( 'Aids screen readers by stopping text caret from leaving blocks.' ) ,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Contain text cursor inside block' )
2021-11-08 14:29:21 +00:00
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( preferences _modal _section , {
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Visible blocks' ) ,
description : Object ( external _wp _i18n _ [ "__" ] ) ( "Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later." )
} , Object ( external _wp _element _ [ "createElement" ] ) ( block _manager , null ) ) )
2021-05-19 15:09:27 +00:00
} , {
name : 'panels' ,
tabLabel : Object ( external _wp _i18n _ [ "__" ] ) ( 'Panels' ) ,
content : Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( preferences _modal _section , {
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Document settings' ) ,
description : Object ( external _wp _i18n _ [ "__" ] ) ( 'Choose what displays in the panel.' )
2021-11-08 14:29:21 +00:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( options [ "d" /* EnablePluginDocumentSettingPanelOption */ ] . Slot , null ) , isViewable && Object ( external _wp _element _ [ "createElement" ] ) ( options [ "c" /* EnablePanelOption */ ] , {
2021-05-19 15:09:27 +00:00
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Permalink' ) ,
panelName : "post-link"
2021-11-08 14:29:21 +00:00
} ) , isViewable && Object ( external _wp _element _ [ "createElement" ] ) ( options [ "c" /* EnablePanelOption */ ] , {
2021-05-19 15:09:27 +00:00
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Template' ) ,
panelName : "template"
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostTaxonomies" ] , {
2021-11-08 14:29:21 +00:00
taxonomyWrapper : ( content , taxonomy ) => Object ( external _wp _element _ [ "createElement" ] ) ( options [ "c" /* EnablePanelOption */ ] , {
2021-05-19 15:09:27 +00:00
label : Object ( external _lodash _ [ "get" ] ) ( taxonomy , [ 'labels' , 'menu_name' ] ) ,
panelName : ` taxonomy-panel- ${ taxonomy . slug } `
} )
2021-11-08 14:29:21 +00:00
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostFeaturedImageCheck" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( options [ "c" /* EnablePanelOption */ ] , {
2021-05-19 15:09:27 +00:00
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Featured image' ) ,
panelName : "featured-image"
2021-11-08 14:29:21 +00:00
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostExcerptCheck" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( options [ "c" /* EnablePanelOption */ ] , {
2021-05-19 15:09:27 +00:00
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Excerpt' ) ,
panelName : "post-excerpt"
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostTypeSupportCheck" ] , {
supportKeys : [ 'comments' , 'trackbacks' ]
2021-11-08 14:29:21 +00:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( options [ "c" /* EnablePanelOption */ ] , {
2021-05-19 15:09:27 +00:00
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Discussion' ) ,
panelName : "discussion-panel"
2021-11-08 14:29:21 +00:00
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PageAttributesCheck" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( options [ "c" /* EnablePanelOption */ ] , {
2021-05-19 15:09:27 +00:00
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Page attributes' ) ,
panelName : "page-attributes"
2021-11-08 14:29:21 +00:00
} ) ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( meta _boxes _section , {
2021-05-19 15:09:27 +00:00
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Additional' ) ,
description : Object ( external _wp _i18n _ [ "__" ] ) ( 'Add extra areas to the editor.' )
2021-11-08 14:29:21 +00:00
} ) )
2021-05-19 15:09:27 +00:00
} ] , [ isViewable , isLargeViewport , showBlockBreadcrumbsOption ] ) ; // This is also used to sync the two different rendered components
// between small and large viewports.
const [ activeMenu , setActiveMenu ] = Object ( external _wp _element _ [ "useState" ] ) ( PREFERENCES _MENU ) ;
/ * *
* Create helper objects from ` sections ` for easier data handling .
* ` tabs ` is used for creating the ` TabPanel ` and ` sectionsContentMap `
* is used for easier access to active tab ' s content .
* /
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
const {
tabs ,
sectionsContentMap
2021-11-15 12:50:17 +00:00
} = Object ( external _wp _element _ [ "useMemo" ] ) ( ( ) => sections . reduce ( ( accumulator , _ref2 ) => {
let {
name ,
tabLabel : title ,
content
} = _ref2 ;
2021-05-19 15:09:27 +00:00
accumulator . tabs . push ( {
name ,
title
} ) ;
accumulator . sectionsContentMap [ name ] = content ;
return accumulator ;
} , {
tabs : [ ] ,
sectionsContentMap : { }
} ) , [ sections ] ) ;
const getCurrentTab = Object ( external _wp _element _ [ "useCallback" ] ) ( tab => sectionsContentMap [ tab . name ] || null , [ sectionsContentMap ] ) ;
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
if ( ! isModalActive ) {
return null ;
}
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
let modalContent ; // We render different components based on the viewport size.
2020-07-07 14:43:35 +00:00
2021-05-19 15:09:27 +00:00
if ( isLargeViewport ) {
modalContent = Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "TabPanel" ] , {
className : "edit-post-preferences__tabs" ,
tabs : tabs ,
initialTabName : activeMenu !== PREFERENCES _MENU ? activeMenu : undefined ,
onSelect : setActiveMenu ,
orientation : "vertical"
} , getCurrentTab ) ;
} else {
2021-11-08 14:29:21 +00:00
modalContent = 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" ] ) ( external _wp _components _ [ "Card" ] , {
isBorderless : true ,
size : "small"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "CardBody" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalItemGroup" ] , null , tabs . map ( tab => {
return Object ( external _wp _element _ [ "createElement" ] ) ( NavigationButton , {
2021-05-19 15:09:27 +00:00
key : tab . name ,
2021-11-08 14:29:21 +00:00
path : tab . name ,
as : external _wp _components _ [ "__experimentalItem" ] ,
isAction : true
} , 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 _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalTruncate" ] , null , tab . title ) ) , 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 */ ]
} ) ) ) ) ;
} ) ) ) ) ) , sections . map ( section => {
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalNavigatorScreen" ] , {
2021-05-19 15:09:27 +00:00
key : ` ${ section . name } -menu ` ,
2021-11-08 14:29:21 +00:00
path : section . name
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Card" ] , {
isBorderless : true ,
size : "large"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "CardHeader" ] , {
isBorderless : false ,
justify : "left" ,
size : "small" ,
gap : "6"
} , Object ( external _wp _element _ [ "createElement" ] ) ( NavigationButton , {
path : "/" ,
icon : Object ( external _wp _i18n _ [ "isRTL" ] ) ( ) ? chevron _right [ "a" /* default */ ] : chevron _left [ "a" /* default */ ] ,
isBack : true ,
"aria-label" : Object ( external _wp _i18n _ [ "__" ] ) ( 'Navigate to the previous view' )
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalText" ] , {
size : "16"
} , section . tabLabel ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "CardBody" ] , null , section . content ) ) ) ;
2021-05-19 15:09:27 +00:00
} ) ) ;
}
2020-07-07 14:43:35 +00:00
2021-05-19 15:09:27 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Modal" ] , {
className : "edit-post-preferences-modal" ,
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Preferences' ) ,
closeLabel : Object ( external _wp _i18n _ [ "__" ] ) ( 'Close' ) ,
onRequestClose : closeModal
} , modalContent ) ;
}
2020-07-07 14:43:35 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/browser-url/index.js
/ * *
* WordPress dependencies
* /
2020-07-07 14:43:35 +00:00
2021-11-08 14:29:21 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* Returns the Post ' s Edit URL .
*
* @ param { number } postId Post ID .
*
* @ return { string } Post edit URL .
* /
2020-07-07 14:43:35 +00:00
2021-05-19 15:09:27 +00:00
function getPostEditURL ( postId ) {
return Object ( external _wp _url _ [ "addQueryArgs" ] ) ( 'post.php' , {
post : postId ,
action : 'edit'
} ) ;
}
2021-05-07 11:48:27 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Returns the Post ' s Trashed URL .
*
2021-11-08 14:29:21 +00:00
* @ param { number } postId Post ID .
2021-05-19 15:09:27 +00:00
* @ param { string } postType Post Type .
*
* @ return { string } Post trashed URL .
2021-05-07 11:48:27 +00:00
* /
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
function getPostTrashedURL ( postId , postType ) {
return Object ( external _wp _url _ [ "addQueryArgs" ] ) ( 'edit.php' , {
trashed : 1 ,
post _type : postType ,
ids : postId
} ) ;
2021-01-28 02:04:13 +00:00
}
2021-05-19 15:09:27 +00:00
class browser _url _BrowserURL extends external _wp _element _ [ "Component" ] {
constructor ( ) {
super ( ... arguments ) ;
this . state = {
historyId : null
} ;
}
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
componentDidUpdate ( prevProps ) {
const {
postId ,
postStatus ,
postType ,
isSavingPost
} = this . props ;
const {
historyId
} = this . state ; // Posts are still dirty while saving so wait for saving to finish
// to avoid the unsaved changes warning when trashing posts.
if ( postStatus === 'trash' && ! isSavingPost ) {
this . setTrashURL ( postId , postType ) ;
return ;
}
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
if ( ( postId !== prevProps . postId || postId !== historyId ) && postStatus !== 'auto-draft' && postId ) {
this . setBrowserURL ( postId ) ;
2021-05-07 11:48:27 +00:00
}
2021-05-19 15:09:27 +00:00
}
/ * *
* Navigates the browser to the post trashed URL to show a notice about the trashed post .
*
2021-11-08 14:29:21 +00:00
* @ param { number } postId Post ID .
* @ param { string } postType Post Type .
2021-05-19 15:09:27 +00:00
* /
2021-04-15 15:19:43 +00:00
2020-01-08 11:57:23 +00:00
2021-05-19 15:09:27 +00:00
setTrashURL ( postId , postType ) {
window . location . href = getPostTrashedURL ( postId , postType ) ;
}
/ * *
* Replaces the browser URL with a post editor link for the given post ID .
*
* Note it is important that , since this function may be called when the
* editor first loads , the result generated ` getPostEditURL ` matches that
* produced by the server . Otherwise , the URL will change unexpectedly .
*
* @ param { number } postId Post ID for which to generate post editor URL .
* /
2020-01-08 11:57:23 +00:00
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
setBrowserURL ( postId ) {
window . history . replaceState ( {
id : postId
} , 'Post ' + postId , getPostEditURL ( postId ) ) ;
this . setState ( ( ) => ( {
historyId : postId
} ) ) ;
}
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
render ( ) {
return null ;
}
2018-12-14 04:41:57 +00:00
2021-05-07 11:48:27 +00:00
}
2021-05-19 15:09:27 +00:00
/* harmony default export */ var browser _url = ( Object ( external _wp _data _ [ "withSelect" ] ) ( select => {
const {
getCurrentPost ,
isSavingPost
2021-11-08 14:29:21 +00:00
} = select ( external _wp _editor _ [ "store" ] ) ;
2021-05-19 15:09:27 +00:00
const post = getCurrentPost ( ) ;
let {
id ,
status ,
type
} = post ;
const isTemplate = [ 'wp_template' , 'wp_template_part' ] . includes ( type ) ;
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
if ( isTemplate ) {
id = post . wp _id ;
}
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
return {
postId : id ,
postStatus : status ,
postType : type ,
isSavingPost : isSavingPost ( )
} ;
} ) ( browser _url _BrowserURL ) ) ;
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/wordpress.js
2021-05-20 12:20:04 +00:00
var wordpress = _ _webpack _require _ _ ( "wduq" ) ;
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/fullscreen-mode-close/index.js
2019-10-15 15:37:08 +00:00
2020-01-08 11:57:23 +00:00
2021-01-28 02:04:13 +00:00
/ * *
2021-05-07 11:48:27 +00:00
* External dependencies
2021-01-28 02:04:13 +00:00
* /
2020-01-08 11:57:23 +00:00
2021-05-07 11:48:27 +00:00
/ * *
* WordPress dependencies
* /
2020-01-08 11:57:23 +00:00
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
2021-11-08 14:29:21 +00:00
2021-05-07 11:48:27 +00:00
/ * *
* Internal dependencies
* /
2020-01-08 11:57:23 +00:00
2018-12-14 04:41:57 +00:00
2021-11-15 12:50:17 +00:00
function FullscreenModeClose ( _ref ) {
let {
showTooltip ,
icon ,
href
} = _ref ;
2021-05-19 15:09:27 +00:00
const {
isActive ,
isRequestingSiteIcon ,
postType ,
siteIconUrl
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
const {
getCurrentPostType
2021-11-08 14:29:21 +00:00
} = select ( external _wp _editor _ [ "store" ] ) ;
2021-05-19 15:09:27 +00:00
const {
isFeatureActive
} = select ( store [ "a" /* store */ ] ) ;
const {
getEntityRecord ,
2021-11-08 14:29:21 +00:00
getPostType ,
isResolving
} = select ( external _wp _coreData _ [ "store" ] ) ;
2021-05-19 15:09:27 +00:00
const siteData = getEntityRecord ( 'root' , '__unstableBase' , undefined ) || { } ;
return {
isActive : isFeatureActive ( 'fullscreenMode' ) ,
2021-11-08 14:29:21 +00:00
isRequestingSiteIcon : isResolving ( 'getEntityRecord' , [ 'root' , '__unstableBase' , undefined ] ) ,
2021-05-19 15:09:27 +00:00
postType : getPostType ( getCurrentPostType ( ) ) ,
siteIconUrl : siteData . site _icon _url
} ;
} , [ ] ) ;
2021-11-08 14:29:21 +00:00
const disableMotion = Object ( external _wp _compose _ [ "useReducedMotion" ] ) ( ) ;
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
if ( ! isActive || ! postType ) {
2021-05-07 11:48:27 +00:00
return null ;
}
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
let buttonIcon = Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Icon" ] , {
size : "36px" ,
icon : wordpress [ "a" /* default */ ]
} ) ;
2021-11-08 14:29:21 +00:00
const effect = {
expand : {
scale : 1.7 ,
borderRadius : 0 ,
transition : {
type : 'tween' ,
duration : '0.2'
}
}
} ;
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
if ( siteIconUrl ) {
2021-11-08 14:29:21 +00:00
buttonIcon = Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__unstableMotion" ] . img , {
variants : ! disableMotion && effect ,
2021-05-19 15:09:27 +00:00
alt : Object ( external _wp _i18n _ [ "__" ] ) ( 'Site Icon' ) ,
className : "edit-post-fullscreen-mode-close_site-icon" ,
src : siteIconUrl
} ) ;
2021-05-07 11:48:27 +00:00
}
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
if ( isRequestingSiteIcon ) {
buttonIcon = null ;
} // Override default icon if custom icon is provided via props.
if ( icon ) {
buttonIcon = Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Icon" ] , {
size : "36px" ,
icon : icon
} ) ;
}
2021-11-08 14:29:21 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__unstableMotion" ] . div , {
whileHover : "expand"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
2021-05-19 15:09:27 +00:00
className : "edit-post-fullscreen-mode-close has-icon" ,
href : href !== null && href !== void 0 ? href : Object ( external _wp _url _ [ "addQueryArgs" ] ) ( 'edit.php' , {
post _type : postType . slug
} ) ,
label : Object ( external _lodash _ [ "get" ] ) ( postType , [ 'labels' , 'view_items' ] , Object ( external _wp _i18n _ [ "__" ] ) ( 'Back' ) ) ,
showTooltip : showTooltip
2021-11-08 14:29:21 +00:00
} , buttonIcon ) ) ;
2021-05-07 11:48:27 +00:00
}
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
/* harmony default export */ var fullscreen _mode _close = ( FullscreenModeClose ) ;
2018-12-14 04:41:57 +00:00
2021-06-01 08:10:04 +00:00
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/list-view.js
var list _view = _ _webpack _require _ _ ( "OzlF" ) ;
2021-05-21 10:14:23 +00:00
2021-05-19 15:09:27 +00:00
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/plus.js
2021-05-20 12:20:04 +00:00
var plus = _ _webpack _require _ _ ( "Q4Sy" ) ;
2021-05-19 15:09:27 +00:00
2021-06-25 15:52:22 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/header-toolbar/index.js
2021-05-21 10:14:23 +00:00
/ * *
* WordPress dependencies
* /
2021-06-25 15:52:22 +00:00
2021-05-21 10:14:23 +00:00
/ * *
* Internal dependencies
* /
2021-06-25 15:52:22 +00:00
2021-11-08 14:29:21 +00:00
const preventDefault = event => {
event . preventDefault ( ) ;
} ;
2021-06-25 15:52:22 +00:00
function HeaderToolbar ( ) {
const inserterButton = Object ( external _wp _element _ [ "useRef" ] ) ( ) ;
2021-05-21 10:14:23 +00:00
const {
2021-06-25 15:52:22 +00:00
setIsInserterOpened ,
setIsListViewOpened
2021-05-21 10:14:23 +00:00
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store [ "a" /* store */ ] ) ;
const {
2021-06-25 15:52:22 +00:00
isInserterEnabled ,
isInserterOpened ,
isTextModeEnabled ,
showIconLabels ,
isListViewOpen ,
listViewShortcut
2021-05-21 10:14:23 +00:00
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
const {
2021-06-25 15:52:22 +00:00
hasInserterItems ,
getBlockRootClientId ,
getBlockSelectionEnd
} = select ( external _wp _blockEditor _ [ "store" ] ) ;
const {
getEditorSettings
} = select ( external _wp _editor _ [ "store" ] ) ;
const {
getEditorMode ,
isFeatureActive ,
isListViewOpened
2021-05-21 10:14:23 +00:00
} = select ( store [ "a" /* store */ ] ) ;
2021-06-25 15:52:22 +00:00
const {
getShortcutRepresentation
} = select ( external _wp _keyboardShortcuts _ [ "store" ] ) ;
2021-05-21 10:14:23 +00:00
return {
2021-06-25 15:52:22 +00:00
// This setting (richEditingEnabled) should not live in the block editor's setting.
isInserterEnabled : getEditorMode ( ) === 'visual' && getEditorSettings ( ) . richEditingEnabled && hasInserterItems ( getBlockRootClientId ( getBlockSelectionEnd ( ) ) ) ,
isInserterOpened : select ( store [ "a" /* store */ ] ) . isInserterOpened ( ) ,
isTextModeEnabled : getEditorMode ( ) === 'text' ,
showIconLabels : isFeatureActive ( 'showIconLabels' ) ,
isListViewOpen : isListViewOpened ( ) ,
2021-11-08 14:29:21 +00:00
listViewShortcut : getShortcutRepresentation ( 'core/edit-post/toggle-list-view' )
2021-05-21 10:14:23 +00:00
} ;
} , [ ] ) ;
2021-06-25 15:52:22 +00:00
const isLargeViewport = Object ( external _wp _compose _ [ "useViewportMatch" ] ) ( 'medium' ) ;
const isWideViewport = Object ( external _wp _compose _ [ "useViewportMatch" ] ) ( 'wide' ) ;
/* translators: accessibility text for the editor toolbar */
2021-05-21 10:14:23 +00:00
2021-06-25 15:52:22 +00:00
const toolbarAriaLabel = Object ( external _wp _i18n _ [ "__" ] ) ( 'Document tools' ) ;
2021-05-21 10:14:23 +00:00
2021-11-08 14:29:21 +00:00
const toggleListView = Object ( external _wp _element _ [ "useCallback" ] ) ( ( ) => setIsListViewOpened ( ! isListViewOpen ) , [ setIsListViewOpened , isListViewOpen ] ) ;
2021-06-25 15:52:22 +00:00
const overflowItems = Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "ToolbarItem" ] , {
as : external _wp _editor _ [ "TableOfContents" ] ,
hasOutlineItemsDisabled : isTextModeEnabled ,
repositionDropdown : showIconLabels && ! isWideViewport ,
showTooltip : ! showIconLabels ,
2021-11-08 14:29:21 +00:00
variant : showIconLabels ? 'tertiary' : undefined
2021-06-25 15:52:22 +00:00
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "ToolbarItem" ] , {
as : external _wp _components _ [ "Button" ] ,
className : "edit-post-header-toolbar__list-view-toggle" ,
icon : list _view [ "a" /* default */ ] ,
disabled : isTextModeEnabled ,
isPressed : isListViewOpen
/* translators: button label text should, if possible, be under 16 characters. */
,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'List View' ) ,
2021-11-08 14:29:21 +00:00
onClick : toggleListView ,
2021-06-25 15:52:22 +00:00
shortcut : listViewShortcut ,
showTooltip : ! showIconLabels
} ) ) ;
2021-11-08 14:29:21 +00:00
const openInserter = Object ( external _wp _element _ [ "useCallback" ] ) ( ( ) => {
if ( isInserterOpened ) {
// Focusing the inserter button closes the inserter popover
inserterButton . current . focus ( ) ;
} else {
setIsInserterOpened ( true ) ;
}
} , [ isInserterOpened , setIsInserterOpened ] ) ;
2021-06-25 15:52:22 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "NavigableToolbar" ] , {
className : "edit-post-header-toolbar" ,
"aria-label" : toolbarAriaLabel
} , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-post-header-toolbar__left"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "ToolbarItem" ] , {
ref : inserterButton ,
as : external _wp _components _ [ "Button" ] ,
className : "edit-post-header-toolbar__inserter-toggle" ,
2021-11-08 14:29:21 +00:00
variant : "primary" ,
2021-06-25 15:52:22 +00:00
isPressed : isInserterOpened ,
2021-11-08 14:29:21 +00:00
onMouseDown : preventDefault ,
onClick : openInserter ,
2021-06-25 15:52:22 +00:00
disabled : ! isInserterEnabled ,
icon : plus [ "a" /* default */ ]
/ * t r a n s l a t o r s : b u t t o n l a b e l t e x t s h o u l d , i f p o s s i b l e , b e u n d e r 1 6
characters . * /
,
label : Object ( external _wp _i18n _ [ "_x" ] ) ( 'Toggle block inserter' , 'Generic label for block inserter button' ) ,
showTooltip : ! showIconLabels
2021-11-08 14:29:21 +00:00
} , showIconLabels && ( ! isInserterOpened ? Object ( external _wp _i18n _ [ "__" ] ) ( 'Add' ) : Object ( external _wp _i18n _ [ "__" ] ) ( 'Close' ) ) ) , ( isWideViewport || ! showIconLabels ) && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , isLargeViewport && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "ToolbarItem" ] , {
2021-06-25 15:52:22 +00:00
as : external _wp _blockEditor _ [ "ToolSelector" ] ,
showTooltip : ! showIconLabels ,
2021-11-08 14:29:21 +00:00
variant : showIconLabels ? 'tertiary' : undefined ,
2021-06-25 15:52:22 +00:00
disabled : isTextModeEnabled
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "ToolbarItem" ] , {
as : external _wp _editor _ [ "EditorHistoryUndo" ] ,
showTooltip : ! showIconLabels ,
2021-11-08 14:29:21 +00:00
variant : showIconLabels ? 'tertiary' : undefined
2021-06-25 15:52:22 +00:00
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "ToolbarItem" ] , {
as : external _wp _editor _ [ "EditorHistoryRedo" ] ,
showTooltip : ! showIconLabels ,
2021-11-08 14:29:21 +00:00
variant : showIconLabels ? 'tertiary' : undefined
2021-06-25 15:52:22 +00:00
} ) , overflowItems ) ) ) ;
2021-05-21 10:14:23 +00:00
}
2021-06-25 15:52:22 +00:00
/* harmony default export */ var header _toolbar = ( HeaderToolbar ) ;
2021-05-21 10:14:23 +00:00
2021-06-25 15:52:22 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/mode-switcher/index.js
2021-05-21 10:14:23 +00:00
/ * *
* WordPress dependencies
* /
2021-11-08 14:29:21 +00:00
2021-06-25 15:52:22 +00:00
/ * *
* Internal dependencies
* /
2021-05-21 10:14:23 +00:00
/ * *
2021-06-25 15:52:22 +00:00
* Set of available mode options .
*
* @ type { Array }
2021-05-21 10:14:23 +00:00
* /
2021-06-25 15:52:22 +00:00
const MODES = [ {
value : 'visual' ,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Visual editor' )
} , {
value : 'text' ,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Code editor' )
} ] ;
2021-05-21 10:14:23 +00:00
2021-06-25 15:52:22 +00:00
function ModeSwitcher ( ) {
2021-05-21 10:14:23 +00:00
const {
2021-06-25 15:52:22 +00:00
shortcut ,
isRichEditingEnabled ,
isCodeEditingEnabled ,
2022-01-04 05:39:28 +00:00
isEditingTemplate ,
2021-06-25 15:52:22 +00:00
mode
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => ( {
shortcut : select ( external _wp _keyboardShortcuts _ [ "store" ] ) . getShortcutRepresentation ( 'core/edit-post/toggle-mode' ) ,
2021-11-08 14:29:21 +00:00
isRichEditingEnabled : select ( external _wp _editor _ [ "store" ] ) . getEditorSettings ( ) . richEditingEnabled ,
isCodeEditingEnabled : select ( external _wp _editor _ [ "store" ] ) . getEditorSettings ( ) . codeEditingEnabled ,
2022-01-04 05:39:28 +00:00
isEditingTemplate : select ( store [ "a" /* store */ ] ) . isEditingTemplate ( ) ,
2021-06-25 15:52:22 +00:00
mode : select ( store [ "a" /* store */ ] ) . getEditorMode ( )
} ) , [ ] ) ;
2021-05-21 10:14:23 +00:00
const {
2021-06-25 15:52:22 +00:00
switchEditorMode
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store [ "a" /* store */ ] ) ;
2021-05-21 10:14:23 +00:00
2022-01-04 05:39:28 +00:00
if ( isEditingTemplate ) {
return null ;
}
2021-06-25 15:52:22 +00:00
if ( ! isRichEditingEnabled || ! isCodeEditingEnabled ) {
return null ;
2021-05-21 10:14:23 +00:00
}
2021-06-25 15:52:22 +00:00
const choices = MODES . map ( choice => {
if ( choice . value !== mode ) {
return { ... choice ,
shortcut
} ;
2021-05-21 10:14:23 +00:00
}
2021-06-15 15:30:24 +00:00
2021-06-25 15:52:22 +00:00
return choice ;
} ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuGroup" ] , {
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Editor' )
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuItemsChoice" ] , {
choices : choices ,
value : mode ,
onSelect : switchEditorMode
} ) ) ;
}
/* harmony default export */ var mode _switcher = ( ModeSwitcher ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/preferences-menu-item/index.js
/ * *
* WordPress dependencies
2021-06-15 15:30:24 +00:00
* /
2021-06-25 15:52:22 +00:00
2021-06-15 15:30:24 +00:00
/ * *
* Internal dependencies
* /
2021-06-25 15:52:22 +00:00
function PreferencesMenuItem ( ) {
2021-06-15 15:30:24 +00:00
const {
2021-06-25 15:52:22 +00:00
openModal
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store [ "a" /* store */ ] ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuItem" ] , {
onClick : ( ) => {
openModal ( 'edit-post/preferences' ) ;
}
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Preferences' ) ) ;
2021-06-15 15:30:24 +00:00
}
2021-06-25 15:52:22 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/writing-menu/index.js
2021-06-15 15:30:24 +00:00
2021-05-19 15:09:27 +00:00
2021-06-25 15:52:22 +00:00
/ * *
* WordPress dependencies
* /
2021-05-19 15:09:27 +00:00
2021-06-25 15:52:22 +00:00
function WritingMenu ( ) {
const isLargeViewport = Object ( external _wp _compose _ [ "useViewportMatch" ] ) ( 'medium' ) ;
if ( ! isLargeViewport ) {
return null ;
2021-05-19 15:09:27 +00:00
}
2021-06-25 15:52:22 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuGroup" ] , {
label : Object ( external _wp _i18n _ [ "_x" ] ) ( 'View' , 'noun' )
2021-11-08 14:29:21 +00:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( build _module [ "g" /* MoreMenuFeatureToggle */ ] , {
scope : "core/edit-post" ,
2021-06-25 15:52:22 +00:00
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' )
2021-11-08 14:29:21 +00:00
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( build _module [ "g" /* MoreMenuFeatureToggle */ ] , {
scope : "core/edit-post" ,
2021-06-25 15:52:22 +00:00
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' )
2021-11-08 14:29:21 +00:00
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( build _module [ "g" /* MoreMenuFeatureToggle */ ] , {
scope : "core/edit-post" ,
2021-06-25 15:52:22 +00:00
feature : "fullscreenMode" ,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Fullscreen mode' ) ,
info : Object ( external _wp _i18n _ [ "__" ] ) ( 'Work without distraction' ) ,
messageActivated : Object ( external _wp _i18n _ [ "__" ] ) ( 'Fullscreen mode activated' ) ,
messageDeactivated : Object ( external _wp _i18n _ [ "__" ] ) ( 'Fullscreen mode deactivated' ) ,
shortcut : external _wp _keycodes _ [ "displayShortcut" ] . secondary ( 'f' )
} ) ) ;
2020-01-08 11:57:23 +00:00
}
2018-12-14 04:41:57 +00:00
2021-06-25 15:52:22 +00:00
/* harmony default export */ var writing _menu = ( WritingMenu ) ;
2021-05-07 11:48:27 +00:00
2021-06-25 15:52:22 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/more-menu/index.js
2018-12-14 04:41:57 +00:00
2019-03-21 12:48:00 +00:00
2019-10-15 15:37:08 +00:00
/ * *
2021-01-28 02:04:13 +00:00
* WordPress dependencies
2019-10-15 15:37:08 +00:00
* /
2018-12-14 04:41:57 +00:00
2019-03-21 12:48:00 +00:00
2019-09-19 15:19:18 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Internal dependencies
2019-09-19 15:19:18 +00:00
* /
2019-03-21 12:48:00 +00:00
2019-09-19 15:19:18 +00:00
2019-03-21 12:48:00 +00:00
2021-01-28 02:04:13 +00:00
2021-05-21 10:14:23 +00:00
2021-06-25 15:52:22 +00:00
const POPOVER _PROPS = {
2021-11-08 14:29:21 +00:00
className : 'edit-post-more-menu__content'
2021-06-25 15:52:22 +00:00
} ;
2021-05-21 10:14:23 +00:00
2021-11-15 12:50:17 +00:00
const MoreMenu = _ref => {
let {
showIconLabels
} = _ref ;
2021-06-25 15:52:22 +00:00
const isLargeViewport = Object ( external _wp _compose _ [ "useViewportMatch" ] ) ( 'large' ) ;
2021-11-08 14:29:21 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( build _module [ "f" /* MoreMenuDropdown */ ] , {
2021-06-25 15:52:22 +00:00
className : "edit-post-more-menu" ,
popoverProps : POPOVER _PROPS ,
toggleProps : {
showTooltip : ! showIconLabels ,
2021-11-08 14:29:21 +00:00
... ( showIconLabels && {
variant : 'tertiary'
} )
2021-06-25 15:52:22 +00:00
}
2021-11-15 12:50:17 +00:00
} , _ref2 => {
let {
2021-06-25 15:52:22 +00:00
onClose
2021-11-15 12:50:17 +00:00
} = _ref2 ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , showIconLabels && ! isLargeViewport && Object ( external _wp _element _ [ "createElement" ] ) ( build _module [ "h" /* PinnedItems */ ] . Slot , {
className : showIconLabels && 'show-icon-labels' ,
scope : "core/edit-post"
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( writing _menu , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( mode _switcher , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( build _module [ "a" /* ActionItem */ ] . Slot , {
name : "core/edit-post/plugin-more-menu" ,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Plugins' ) ,
as : external _wp _components _ [ "MenuGroup" ] ,
fillProps : {
onClick : onClose
}
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( tools _more _menu _group . Slot , {
fillProps : {
onClose
}
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuGroup" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( PreferencesMenuItem , null ) ) ) ;
} ) ;
2021-06-25 15:52:22 +00:00
} ;
2021-01-28 02:04:13 +00:00
2021-06-25 15:52:22 +00:00
/* harmony default export */ var more _menu = ( MoreMenu ) ;
2021-01-28 02:04:13 +00:00
2021-06-25 15:52:22 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/post-publish-button-or-toggle.js
2019-03-21 12:48:00 +00:00
2020-06-26 13:33:47 +00:00
2021-06-25 15:52:22 +00:00
/ * *
* External dependencies
* /
2019-10-15 15:37:08 +00:00
2021-01-28 02:04:13 +00:00
/ * *
* WordPress dependencies
* /
2019-10-15 15:37:08 +00:00
2019-03-21 12:48:00 +00:00
2021-01-28 02:04:13 +00:00
/ * *
2021-05-07 11:48:27 +00:00
* Internal dependencies
2021-01-28 02:04:13 +00:00
* /
2021-11-15 12:50:17 +00:00
function PostPublishButtonOrToggle ( _ref ) {
let {
forceIsDirty ,
forceIsSaving ,
hasPublishAction ,
isBeingScheduled ,
isPending ,
isPublished ,
isPublishSidebarEnabled ,
isPublishSidebarOpened ,
isScheduled ,
togglePublishSidebar ,
setEntitiesSavedStatesCallback
} = _ref ;
2021-06-25 15:52:22 +00:00
const IS _TOGGLE = 'toggle' ;
const IS _BUTTON = 'button' ;
const isSmallerThanMediumViewport = Object ( external _wp _compose _ [ "useViewportMatch" ] ) ( 'medium' , '<' ) ;
let component ;
/ * *
* Conditions to show a BUTTON ( publish directly ) or a TOGGLE ( open publish sidebar ) :
*
* 1 ) We want to show a BUTTON when the post status is at the _final stage _
* for a particular role ( see https : //wordpress.org/support/article/post-status/):
*
* - is published
* - is scheduled to be published
* - is pending and can ' t be published ( but only for viewports >= medium ) .
* Originally , we considered showing a button for pending posts that couldn ' t be published
* ( for example , for an author with the contributor role ) . Some languages can have
* long translations for "Submit for review" , so given the lack of UI real estate available
* we decided to take into account the viewport in that case .
* See : https : //github.com/WordPress/gutenberg/issues/10475
*
* 2 ) Then , in small viewports , we ' ll show a TOGGLE .
*
* 3 ) Finally , we ' ll use the publish sidebar status to decide :
*
* - if it is enabled , we show a TOGGLE
* - if it is disabled , we show a BUTTON
* /
if ( isPublished || isScheduled && isBeingScheduled || isPending && ! hasPublishAction && ! isSmallerThanMediumViewport ) {
component = IS _BUTTON ;
} else if ( isSmallerThanMediumViewport ) {
component = IS _TOGGLE ;
} else if ( isPublishSidebarEnabled ) {
component = IS _TOGGLE ;
} else {
component = IS _BUTTON ;
}
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostPublishButton" ] , {
forceIsDirty : forceIsDirty ,
forceIsSaving : forceIsSaving ,
isOpen : isPublishSidebarOpened ,
isToggle : component === IS _TOGGLE ,
onToggle : togglePublishSidebar ,
setEntitiesSavedStatesCallback : setEntitiesSavedStatesCallback
} ) ;
}
/* harmony default export */ var post _publish _button _or _toggle = ( Object ( external _wp _compose _ [ "compose" ] ) ( Object ( external _wp _data _ [ "withSelect" ] ) ( select => ( {
2021-11-08 14:29:21 +00:00
hasPublishAction : Object ( external _lodash _ [ "get" ] ) ( select ( external _wp _editor _ [ "store" ] ) . getCurrentPost ( ) , [ '_links' , 'wp:action-publish' ] , false ) ,
isBeingScheduled : select ( external _wp _editor _ [ "store" ] ) . isEditedPostBeingScheduled ( ) ,
isPending : select ( external _wp _editor _ [ "store" ] ) . isCurrentPostPending ( ) ,
isPublished : select ( external _wp _editor _ [ "store" ] ) . isCurrentPostPublished ( ) ,
isPublishSidebarEnabled : select ( external _wp _editor _ [ "store" ] ) . isPublishSidebarEnabled ( ) ,
2021-06-25 15:52:22 +00:00
isPublishSidebarOpened : select ( store [ "a" /* store */ ] ) . isPublishSidebarOpened ( ) ,
2021-11-08 14:29:21 +00:00
isScheduled : select ( external _wp _editor _ [ "store" ] ) . isCurrentPostScheduled ( )
2021-06-25 15:52:22 +00:00
} ) ) , Object ( external _wp _data _ [ "withDispatch" ] ) ( dispatch => {
const {
togglePublishSidebar
} = dispatch ( store [ "a" /* store */ ] ) ;
return {
togglePublishSidebar
} ;
} ) ) ( PostPublishButtonOrToggle ) ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/device-preview/index.js
2021-01-28 02:04:13 +00:00
/ * *
2021-06-25 15:52:22 +00:00
* WordPress dependencies
2021-01-28 02:04:13 +00:00
* /
2019-09-19 15:19:18 +00:00
2021-05-07 11:48:27 +00:00
2019-10-15 15:37:08 +00:00
2019-03-21 12:48:00 +00:00
2020-06-26 13:33:47 +00:00
2021-06-25 15:52:22 +00:00
/ * *
* Internal dependencies
* /
function DevicePreview ( ) {
const {
hasActiveMetaboxes ,
isPostSaveable ,
isSaving ,
deviceType
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => ( {
hasActiveMetaboxes : select ( store [ "a" /* store */ ] ) . hasMetaBoxes ( ) ,
isSaving : select ( store [ "a" /* store */ ] ) . isSavingMetaBoxes ( ) ,
2021-11-08 14:29:21 +00:00
isPostSaveable : select ( external _wp _editor _ [ "store" ] ) . isEditedPostSaveable ( ) ,
2021-06-25 15:52:22 +00:00
deviceType : select ( store [ "a" /* store */ ] ) . _ _experimentalGetPreviewDeviceType ( )
} ) , [ ] ) ;
const {
_ _experimentalSetPreviewDeviceType : setPreviewDeviceType
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store [ "a" /* store */ ] ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "__experimentalPreviewOptions" ] , {
isEnabled : isPostSaveable ,
className : "edit-post-post-preview-dropdown" ,
deviceType : deviceType ,
setDeviceType : setPreviewDeviceType
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuGroup" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-post-header-preview__grouping-external"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostPreviewButton" ] , {
className : 'edit-post-header-preview__button-external' ,
role : "menuitem" ,
forceIsAutosaveable : hasActiveMetaboxes ,
forcePreviewLink : isSaving ? null : undefined ,
textContent : Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _i18n _ [ "__" ] ) ( 'Preview in new tab' ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Icon" ] , {
icon : external [ "a" /* default */ ]
} ) )
} ) ) ) ) ;
2021-05-19 15:09:27 +00:00
}
2021-01-28 02:04:13 +00:00
2021-06-25 15:52:22 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/main-dashboard-button/index.js
2020-06-26 13:33:47 +00:00
/ * *
* WordPress dependencies
* /
2021-06-25 15:52:22 +00:00
const slotName = '__experimentalMainDashboardButton' ;
const {
Fill ,
Slot : MainDashboardButtonSlot
} = Object ( external _wp _components _ [ "createSlotFill" ] ) ( slotName ) ;
const MainDashboardButton = Fill ;
2019-03-21 12:48:00 +00:00
2021-11-15 12:50:17 +00:00
const main _dashboard _button _Slot = _ref => {
let {
children
} = _ref ;
2021-06-25 15:52:22 +00:00
const slot = Object ( external _wp _components _ [ "__experimentalUseSlot" ] ) ( slotName ) ;
const hasFills = Boolean ( slot . fills && slot . fills . length ) ;
2019-03-21 12:48:00 +00:00
2021-06-25 15:52:22 +00:00
if ( ! hasFills ) {
return children ;
}
2019-03-21 12:48:00 +00:00
2021-06-25 15:52:22 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( MainDashboardButtonSlot , {
bubblesVirtually : true
} ) ;
} ;
2020-02-10 22:33:27 +00:00
2021-06-25 15:52:22 +00:00
MainDashboardButton . Slot = main _dashboard _button _Slot ;
/* harmony default export */ var main _dashboard _button = ( MainDashboardButton ) ;
2019-10-15 15:37:08 +00:00
2021-06-25 15:52:22 +00:00
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-down.js
var chevron _down = _ _webpack _require _ _ ( "NWDH" ) ;
2019-03-21 12:48:00 +00:00
2021-06-25 15:52:22 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/template-title/delete-template.js
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* External dependencies
* /
2020-08-10 14:18:33 +00:00
2021-05-07 11:48:27 +00:00
/ * *
* WordPress dependencies
* /
2019-10-15 15:37:08 +00:00
2020-02-06 21:03:31 +00:00
2019-10-15 15:37:08 +00:00
2020-01-08 11:57:23 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Internal dependencies
2020-01-08 11:57:23 +00:00
* /
2021-06-25 15:52:22 +00:00
function DeleteTemplate ( ) {
const {
clearSelectedBlock
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( external _wp _blockEditor _ [ "store" ] ) ;
const {
setIsEditingTemplate
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store [ "a" /* store */ ] ) ;
const {
getEditorSettings
} = Object ( external _wp _data _ [ "useSelect" ] ) ( external _wp _editor _ [ "store" ] ) ;
const {
updateEditorSettings ,
editPost
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( external _wp _editor _ [ "store" ] ) ;
const {
deleteEntityRecord
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( external _wp _coreData _ [ "store" ] ) ;
const {
template
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
const {
isEditingTemplate ,
getEditedPostTemplate
} = select ( store [ "a" /* store */ ] ) ;
2021-05-07 11:48:27 +00:00
2021-06-25 15:52:22 +00:00
const _isEditing = isEditingTemplate ( ) ;
2021-05-07 11:48:27 +00:00
2021-06-25 15:52:22 +00:00
return {
template : _isEditing ? getEditedPostTemplate ( ) : null
} ;
} , [ ] ) ;
2020-01-08 11:57:23 +00:00
2021-06-25 15:52:22 +00:00
if ( ! template || ! template . wp _id ) {
return null ;
2021-05-19 15:09:27 +00:00
}
2021-01-28 02:04:13 +00:00
2021-06-25 15:52:22 +00:00
let templateTitle = template . slug ;
2021-05-19 15:09:27 +00:00
2021-06-25 15:52:22 +00:00
if ( template !== null && template !== void 0 && template . title ) {
templateTitle = template . title ;
2021-05-19 15:09:27 +00:00
}
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuGroup" ] , {
2021-06-25 15:52:22 +00:00
className : "edit-post-template-top-area__second-menu-group"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuItem" ] , {
className : "edit-post-template-top-area__delete-template-button" ,
isDestructive : true ,
2021-11-08 14:29:21 +00:00
variant : "secondary" ,
2021-06-25 15:52:22 +00:00
"aria-label" : Object ( external _wp _i18n _ [ "__" ] ) ( 'Delete template' ) ,
onClick : ( ) => {
if ( // eslint-disable-next-line no-alert
window . confirm ( Object ( external _wp _i18n _ [ "sprintf" ] ) (
/* translators: %s: template name */
Object ( external _wp _i18n _ [ "__" ] ) ( 'Are you sure you want to delete the %s template? It may be used by other pages or posts.' ) , templateTitle ) ) ) {
clearSelectedBlock ( ) ;
setIsEditingTemplate ( false ) ;
editPost ( {
template : ''
} ) ;
const settings = getEditorSettings ( ) ;
const newAvailableTemplates = Object ( external _lodash _ [ "pickBy" ] ) ( settings . availableTemplates , ( _title , id ) => {
return id !== template . slug ;
} ) ;
updateEditorSettings ( { ... settings ,
availableTemplates : newAvailableTemplates
} ) ;
deleteEntityRecord ( 'postType' , 'wp_template' , template . id ) ;
}
}
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Delete template' ) ) ) ;
2021-05-19 15:09:27 +00:00
}
2021-06-25 15:52:22 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/template-title/edit-template-title.js
2019-10-15 15:37:08 +00:00
2020-02-06 21:03:31 +00:00
2021-06-25 15:52:22 +00:00
/ * *
* External dependencies
* /
2020-10-20 13:36:16 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* WordPress dependencies
* /
2019-10-15 15:37:08 +00:00
2021-01-28 02:04:13 +00:00
2018-12-14 04:41:57 +00:00
2018-12-18 03:14:52 +00:00
2021-06-25 15:52:22 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* Internal dependencies
* /
2018-12-14 04:41:57 +00:00
2021-06-25 15:52:22 +00:00
function EditTemplateTitle ( ) {
const {
template
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
const {
getEditedPostTemplate
} = select ( store [ "a" /* store */ ] ) ;
return {
template : getEditedPostTemplate ( )
} ;
} , [ ] ) ;
const {
editEntityRecord
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( external _wp _coreData _ [ "store" ] ) ;
const {
getEditorSettings
} = Object ( external _wp _data _ [ "useSelect" ] ) ( external _wp _editor _ [ "store" ] ) ;
const {
updateEditorSettings
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( external _wp _editor _ [ "store" ] ) ;
2018-12-14 04:41:57 +00:00
2021-12-21 07:02:34 +00:00
if ( template . has _theme _file ) {
return null ;
}
2021-06-25 15:52:22 +00:00
let templateTitle = Object ( external _wp _i18n _ [ "__" ] ) ( 'Default' ) ;
2018-12-14 04:41:57 +00:00
2021-06-25 15:52:22 +00:00
if ( template !== null && template !== void 0 && template . title ) {
templateTitle = template . title ;
} else if ( ! ! template ) {
templateTitle = template . slug ;
}
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "TextControl" ] , {
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Title' ) ,
value : templateTitle ,
help : Object ( external _wp _i18n _ [ "__" ] ) ( 'Give the template a title that indicates its purpose, e.g. "Full Width".' ) ,
onChange : newTitle => {
const settings = getEditorSettings ( ) ;
const newAvailableTemplates = Object ( external _lodash _ [ "mapValues" ] ) ( settings . availableTemplates , ( existingTitle , id ) => {
if ( id !== template . slug ) {
return existingTitle ;
}
2019-09-19 15:19:18 +00:00
2021-06-25 15:52:22 +00:00
return newTitle ;
} ) ;
updateEditorSettings ( { ... settings ,
availableTemplates : newAvailableTemplates
} ) ;
editEntityRecord ( 'postType' , 'wp_template' , template . id , {
title : newTitle
} ) ;
}
} ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/template-title/template-description.js
2020-10-13 13:10:30 +00:00
2018-12-14 04:41:57 +00:00
2020-01-08 11:57:23 +00:00
/ * *
2021-01-28 02:04:13 +00:00
* WordPress dependencies
2020-01-08 11:57:23 +00:00
* /
2018-12-14 04:41:57 +00:00
2020-01-08 11:57:23 +00:00
/ * *
2021-01-28 02:04:13 +00:00
* Internal dependencies
2020-01-08 11:57:23 +00:00
* /
2019-10-15 15:37:08 +00:00
2021-01-28 02:04:13 +00:00
2021-06-25 15:52:22 +00:00
function TemplateDescription ( ) {
const {
2021-12-21 07:02:34 +00:00
description ,
title
2021-06-25 15:52:22 +00:00
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
const {
getEditedPostTemplate
} = select ( store [ "a" /* store */ ] ) ;
return {
2021-12-21 07:02:34 +00:00
title : getEditedPostTemplate ( ) . title ,
2021-06-25 15:52:22 +00:00
description : getEditedPostTemplate ( ) . description
} ;
} , [ ] ) ;
2019-10-15 15:37:08 +00:00
2021-06-25 15:52:22 +00:00
if ( ! description ) {
return null ;
2021-05-19 15:09:27 +00:00
}
2019-10-15 15:37:08 +00:00
2021-12-21 07:02:34 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalHeading" ] , {
level : 4 ,
weight : 600
} , title ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalText" ] , {
className : "edit-post-template-details__description" ,
size : "body" ,
as : "p" ,
style : {
marginTop : '12px'
}
} , description ) ) ;
2021-05-19 15:09:27 +00:00
}
2019-10-15 15:37:08 +00:00
2021-06-25 15:52:22 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/template-title/index.js
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* WordPress dependencies
* /
2019-10-15 15:37:08 +00:00
2018-12-14 04:41:57 +00:00
2020-01-08 11:57:23 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* Internal dependencies
* /
2021-05-07 11:48:27 +00:00
2021-01-28 02:04:13 +00:00
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
2021-01-28 02:04:13 +00:00
2020-06-26 13:33:47 +00:00
2021-06-25 15:52:22 +00:00
function TemplateTitle ( ) {
const {
template ,
isEditing ,
title
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
const {
isEditingTemplate ,
getEditedPostTemplate
} = select ( store [ "a" /* store */ ] ) ;
const {
getEditedPostAttribute
} = select ( external _wp _editor _ [ "store" ] ) ;
const _isEditing = isEditingTemplate ( ) ;
return {
template : _isEditing ? getEditedPostTemplate ( ) : null ,
isEditing : _isEditing ,
2021-11-08 14:29:21 +00:00
title : getEditedPostAttribute ( 'title' ) ? getEditedPostAttribute ( 'title' ) : Object ( external _wp _i18n _ [ "__" ] ) ( 'Untitled' )
2021-06-25 15:52:22 +00:00
} ;
} , [ ] ) ;
const {
clearSelectedBlock
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( external _wp _blockEditor _ [ "store" ] ) ;
const {
setIsEditingTemplate
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store [ "a" /* store */ ] ) ;
if ( ! isEditing || ! template ) {
return null ;
2021-05-19 15:09:27 +00:00
}
2020-06-26 13:33:47 +00:00
2021-06-25 15:52:22 +00:00
let templateTitle = Object ( external _wp _i18n _ [ "__" ] ) ( 'Default' ) ;
2020-06-26 13:33:47 +00:00
2021-06-25 15:52:22 +00:00
if ( template !== null && template !== void 0 && template . title ) {
templateTitle = template . title ;
} else if ( ! ! template ) {
templateTitle = template . slug ;
}
2021-12-21 07:02:34 +00:00
const hasOptions = ! ! ( template . custom || template . wp _id || template . description ) ;
2021-06-25 15:52:22 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-post-template-top-area"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
className : "edit-post-template-post-title" ,
isLink : true ,
showTooltip : true ,
label : Object ( external _wp _i18n _ [ "sprintf" ] ) (
/* translators: %s: Title of the referring post, e.g: "Hello World!" */
Object ( external _wp _i18n _ [ "__" ] ) ( 'Edit %s' ) , title ) ,
onClick : ( ) => {
clearSelectedBlock ( ) ;
setIsEditingTemplate ( false ) ;
}
2021-12-21 07:02:34 +00:00
} , title ) , hasOptions ? Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Dropdown" ] , {
2021-06-25 15:52:22 +00:00
position : "bottom center" ,
contentClassName : "edit-post-template-top-area__popover" ,
2021-11-15 12:50:17 +00:00
renderToggle : _ref => {
let {
onToggle
} = _ref ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
className : "edit-post-template-title" ,
isLink : true ,
icon : chevron _down [ "a" /* default */ ] ,
showTooltip : true ,
onClick : onToggle ,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Template Options' )
} , templateTitle ) ;
} ,
2021-12-21 07:02:34 +00:00
renderContent : ( ) => Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( EditTemplateTitle , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( TemplateDescription , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( DeleteTemplate , null ) )
} ) : Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "__experimentalText" ] , {
className : "edit-post-template-title" ,
size : "body" ,
style : {
lineHeight : '24px'
}
} , templateTitle ) ) ;
2021-06-25 15:52:22 +00:00
}
/* harmony default export */ var template _title = ( TemplateTitle ) ;
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/index.js
2020-06-26 13:33:47 +00:00
2020-10-13 13:10:30 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* External dependencies
* /
2021-01-28 02:04:13 +00:00
2018-12-18 03:14:52 +00:00
/ * *
2021-05-07 11:48:27 +00:00
* WordPress dependencies
2018-12-18 03:14:52 +00:00
* /
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
2021-01-28 02:04:13 +00:00
/ * *
2021-05-07 11:48:27 +00:00
* Internal dependencies
2021-01-28 02:04:13 +00:00
* /
2018-12-14 04:41:57 +00:00
2020-01-08 11:57:23 +00:00
2021-05-07 11:48:27 +00:00
2020-01-08 11:57:23 +00:00
2021-05-07 11:48:27 +00:00
2021-06-25 15:52:22 +00:00
2021-11-15 12:50:17 +00:00
function Header ( _ref ) {
let {
setEntitiesSavedStatesCallback
} = _ref ;
2021-05-19 15:09:27 +00:00
const {
hasActiveMetaboxes ,
isPublishSidebarOpened ,
isSaving ,
showIconLabels ,
hasReducedUI
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => ( {
hasActiveMetaboxes : select ( store [ "a" /* store */ ] ) . hasMetaBoxes ( ) ,
isPublishSidebarOpened : select ( store [ "a" /* store */ ] ) . isPublishSidebarOpened ( ) ,
isSaving : select ( store [ "a" /* store */ ] ) . isSavingMetaBoxes ( ) ,
showIconLabels : select ( store [ "a" /* store */ ] ) . isFeatureActive ( 'showIconLabels' ) ,
hasReducedUI : select ( store [ "a" /* store */ ] ) . isFeatureActive ( 'reducedUI' )
} ) , [ ] ) ;
const isLargeViewport = Object ( external _wp _compose _ [ "useViewportMatch" ] ) ( 'large' ) ;
const classes = classnames _default ( ) ( 'edit-post-header' , {
'has-reduced-ui' : hasReducedUI
} ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : classes
} , Object ( external _wp _element _ [ "createElement" ] ) ( main _dashboard _button . Slot , null , Object ( external _wp _element _ [ "createElement" ] ) ( fullscreen _mode _close , null ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-post-header__toolbar"
2021-06-25 15:52:22 +00:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( header _toolbar , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( template _title , null ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
2021-05-19 15:09:27 +00:00
className : "edit-post-header__settings"
} , ! isPublishSidebarOpened && // This button isn't completely hidden by the publish sidebar.
// We can't hide the whole toolbar when the publish sidebar is open because
// we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.
// We track that DOM node to return focus to the PostPublishButtonOrToggle
// when the publish sidebar has been closed.
Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostSavedState" ] , {
forceIsDirty : hasActiveMetaboxes ,
forceIsSaving : isSaving ,
showIconLabels : showIconLabels
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( DevicePreview , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostPreviewButton" ] , {
forceIsAutosaveable : hasActiveMetaboxes ,
forcePreviewLink : isSaving ? null : undefined
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( post _publish _button _or _toggle , {
forceIsDirty : hasActiveMetaboxes ,
forceIsSaving : isSaving ,
setEntitiesSavedStatesCallback : setEntitiesSavedStatesCallback
2021-11-08 14:29:21 +00:00
} ) , ( isLargeViewport || ! showIconLabels ) && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( build _module [ "h" /* PinnedItems */ ] . Slot , {
2021-05-19 15:09:27 +00:00
scope : "core/edit-post"
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( more _menu , {
showIconLabels : showIconLabels
} ) ) , showIconLabels && ! isLargeViewport && Object ( external _wp _element _ [ "createElement" ] ) ( more _menu , {
showIconLabels : showIconLabels
} ) ) ) ;
}
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
/* harmony default export */ var header = ( Header ) ;
2021-01-28 02:04:13 +00:00
2021-05-21 10:14:23 +00:00
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/close.js
var library _close = _ _webpack _require _ _ ( "w95h" ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/secondary-sidebar/inserter-sidebar.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
function InserterSidebar ( ) {
const {
insertionPoint ,
showMostUsedBlocks
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
const {
isFeatureActive ,
_ _experimentalGetInsertionPoint
} = select ( store [ "a" /* store */ ] ) ;
return {
insertionPoint : _ _experimentalGetInsertionPoint ( ) ,
showMostUsedBlocks : isFeatureActive ( 'mostUsedBlocks' )
} ;
} , [ ] ) ;
const {
setIsInserterOpened
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store [ "a" /* store */ ] ) ;
const isMobileViewport = 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-post-editor__inserter-panel"
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-post-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-post-editor__inserter-panel-content"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "__experimentalLibrary" ] , {
showMostUsedBlocks : showMostUsedBlocks ,
showInserterHelpPanel : true ,
shouldFocusBlock : isMobileViewport ,
rootClientId : insertionPoint . rootClientId ,
2021-11-08 14:29:21 +00:00
_ _experimentalInsertionIndex : insertionPoint . insertionIndex ,
_ _experimentalFilterValue : insertionPoint . filterValue
2021-05-21 10:14:23 +00:00
} ) ) ) ;
}
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/close-small.js
var close _small = _ _webpack _require _ _ ( "bWcr" ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/secondary-sidebar/list-view-sidebar.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
function ListViewSidebar ( ) {
const {
setIsListViewOpened
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store [ "a" /* 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 ) {
2021-11-08 14:29:21 +00:00
if ( event . keyCode === external _wp _keycodes _ [ "ESCAPE" ] && ! event . defaultPrevented ) {
event . preventDefault ( ) ;
2021-05-21 10:14:23 +00:00
setIsListViewOpened ( false ) ;
}
}
const instanceId = Object ( external _wp _compose _ [ "useInstanceId" ] ) ( ListViewSidebar ) ;
const labelId = ` edit-post-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-post-editor__list-view-panel" ,
onKeyDown : closeOnEscape
} , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-post-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-post-editor__list-view-panel-content" ,
ref : Object ( external _wp _compose _ [ "useMergeRefs" ] ) ( [ focusReturnRef , focusOnMountRef ] )
2021-11-08 14:29:21 +00:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "__experimentalListView" ] , {
2021-06-01 08:10:04 +00:00
onSelect : selectEditorBlock ,
2021-05-21 10:14:23 +00:00
showNestedBlocks : true ,
2021-11-08 14:29:21 +00:00
_ _experimentalFeatures : true ,
2021-05-21 10:14:23 +00:00
_ _experimentalPersistentListViewFeatures : true
} ) ) )
) ;
}
2021-05-25 08:40:25 +00:00
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/cog.js
var cog = _ _webpack _require _ _ ( "Cg8A" ) ;
2018-12-18 03:14:52 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/settings-header/index.js
2018-12-18 03:14:52 +00:00
2019-03-07 09:09:59 +00:00
2019-10-15 15:37:08 +00:00
/ * *
* WordPress dependencies
* /
2019-03-07 09:09:59 +00:00
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
2021-11-08 14:29:21 +00:00
2021-05-07 11:48:27 +00:00
/ * *
* Internal dependencies
* /
2021-11-15 12:50:17 +00:00
const SettingsHeader = _ref => {
let {
sidebarName
} = _ref ;
2021-05-19 15:09:27 +00:00
const {
openGeneralSidebar
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store [ "a" /* store */ ] ) ;
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
const openDocumentSettings = ( ) => openGeneralSidebar ( 'edit-post/document' ) ;
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
const openBlockSettings = ( ) => openGeneralSidebar ( 'edit-post/block' ) ;
const {
documentLabel ,
isTemplateMode
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
2021-11-08 14:29:21 +00:00
const postTypeLabel = select ( external _wp _editor _ [ "store" ] ) . getPostTypeLabel ( ) ;
2021-05-19 15:09:27 +00:00
return {
2021-11-08 14:29:21 +00:00
// translators: Default label for the Document sidebar tab, not selected.
documentLabel : postTypeLabel || Object ( external _wp _i18n _ [ "_x" ] ) ( 'Document' , 'noun' ) ,
2021-05-19 15:09:27 +00:00
isTemplateMode : select ( store [ "a" /* store */ ] ) . isEditingTemplate ( )
} ;
} , [ ] ) ;
const [ documentAriaLabel , documentActiveClass ] = sidebarName === 'edit-post/document' ? // translators: ARIA label for the Document sidebar tab, selected. %s: Document label.
[ Object ( external _wp _i18n _ [ "sprintf" ] ) ( Object ( external _wp _i18n _ [ "__" ] ) ( '%s (selected)' ) , documentLabel ) , 'is-active' ] : [ documentLabel , '' ] ;
const [ blockAriaLabel , blockActiveClass ] = sidebarName === 'edit-post/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' ) , '' ] ;
const [ templateAriaLabel , templateActiveClass ] = sidebarName === 'edit-post/document' ? [ Object ( external _wp _i18n _ [ "__" ] ) ( 'Template (selected)' ) , 'is-active' ] : [ Object ( external _wp _i18n _ [ "__" ] ) ( 'Template' ) , '' ] ;
/* Use a list so screen readers will announce how many tabs there are. */
return Object ( external _wp _element _ [ "createElement" ] ) ( "ul" , null , ! isTemplateMode && Object ( external _wp _element _ [ "createElement" ] ) ( "li" , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
onClick : openDocumentSettings ,
className : ` edit-post-sidebar__panel-tab ${ documentActiveClass } ` ,
"aria-label" : documentAriaLabel ,
"data-label" : documentLabel
} , documentLabel ) ) , isTemplateMode && Object ( external _wp _element _ [ "createElement" ] ) ( "li" , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
onClick : openDocumentSettings ,
className : ` edit-post-sidebar__panel-tab ${ templateActiveClass } ` ,
"aria-label" : templateAriaLabel ,
"data-label" : Object ( external _wp _i18n _ [ "__" ] ) ( 'Template' )
} , 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-post-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 ) ;
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-visibility/index.js
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* WordPress dependencies
* /
2021-05-07 11:48:27 +00:00
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
function PostVisibility ( ) {
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostVisibilityCheck" ] , {
2021-11-15 12:50:17 +00:00
render : _ref => {
let {
canEdit
} = _ref ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "PanelRow" ] , {
className : "edit-post-post-visibility"
} , Object ( external _wp _element _ [ "createElement" ] ) ( "span" , null , Object ( external _wp _i18n _ [ "__" ] ) ( 'Visibility' ) ) , ! canEdit && Object ( external _wp _element _ [ "createElement" ] ) ( "span" , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostVisibilityLabel" ] , null ) ) , canEdit && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Dropdown" ] , {
position : "bottom left" ,
contentClassName : "edit-post-post-visibility__dialog" ,
renderToggle : _ref2 => {
let {
isOpen ,
onToggle
} = _ref2 ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
"aria-expanded" : isOpen ,
className : "edit-post-post-visibility__toggle" ,
onClick : onToggle ,
variant : "tertiary"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostVisibilityLabel" ] , null ) ) ;
} ,
renderContent : ( ) => Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostVisibility" ] , null )
} ) ) ;
}
2021-05-19 15:09:27 +00:00
} ) ;
}
/* harmony default export */ var post _visibility = ( PostVisibility ) ;
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-trash/index.js
2018-12-18 03:14:52 +00:00
2020-01-08 11:57:23 +00:00
2021-01-28 02:04:13 +00:00
/ * *
2021-05-07 11:48:27 +00:00
* WordPress dependencies
2021-01-28 02:04:13 +00:00
* /
2018-12-18 03:14:52 +00:00
2020-10-13 13:10:30 +00:00
2021-05-19 15:09:27 +00:00
function PostTrash ( ) {
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostTrashCheck" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "PanelRow" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostTrash" ] , null ) ) ) ;
}
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-schedule/index.js
2020-10-13 13:10:30 +00:00
2021-05-07 11:48:27 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* WordPress dependencies
2021-05-07 11:48:27 +00:00
* /
2018-12-18 03:14:52 +00:00
2018-12-14 04:41:57 +00:00
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
function PostSchedule ( ) {
const anchorRef = Object ( external _wp _element _ [ "useRef" ] ) ( ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostScheduleCheck" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "PanelRow" ] , {
className : "edit-post-post-schedule" ,
ref : anchorRef
} , Object ( external _wp _element _ [ "createElement" ] ) ( "span" , null , Object ( external _wp _i18n _ [ "__" ] ) ( 'Publish' ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Dropdown" ] , {
popoverProps : {
anchorRef : anchorRef . current
} ,
position : "bottom left" ,
contentClassName : "edit-post-post-schedule__dialog" ,
2021-11-15 12:50:17 +00:00
renderToggle : _ref => {
let {
onToggle ,
isOpen
} = _ref ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
className : "edit-post-post-schedule__toggle" ,
onClick : onToggle ,
"aria-expanded" : isOpen ,
variant : "tertiary"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostScheduleLabel" ] , null ) ) ) ;
} ,
2021-05-19 15:09:27 +00:00
renderContent : ( ) => Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostSchedule" ] , null )
} ) ) ) ;
}
/* harmony default export */ var post _schedule = ( PostSchedule ) ;
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-sticky/index.js
2018-12-18 03:14:52 +00:00
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 15:37:00 +00:00
2021-05-07 11:48:27 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* WordPress dependencies
2021-05-07 11:48:27 +00:00
* /
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
function PostSticky ( ) {
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostStickyCheck" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "PanelRow" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostSticky" ] , null ) ) ) ;
}
/* harmony default export */ var post _sticky = ( PostSticky ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-author/index.js
2021-05-07 11:48:27 +00:00
/ * *
* WordPress dependencies
* /
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
function PostAuthor ( ) {
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostAuthorCheck" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "PanelRow" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostAuthor" ] , null ) ) ) ;
}
/* harmony default export */ var post _author = ( PostAuthor ) ;
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-slug/index.js
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 15:37:00 +00:00
2018-12-18 03:14:52 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* WordPress dependencies
2018-12-18 03:14:52 +00:00
* /
2021-05-19 15:09:27 +00:00
function PostSlug ( ) {
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostSlugCheck" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "PanelRow" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostSlug" ] , null ) ) ) ;
}
/* harmony default export */ var post _slug = ( PostSlug ) ;
2018-12-18 03:14:52 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-format/index.js
2018-12-18 03:14:52 +00:00
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* WordPress dependencies
* /
2018-12-18 03:14:52 +00:00
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
function PostFormat ( ) {
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostFormatCheck" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "PanelRow" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostFormat" ] , null ) ) ) ;
}
/* harmony default export */ var post _format = ( PostFormat ) ;
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-pending-status/index.js
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* WordPress dependencies
* /
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
function PostPendingStatus ( ) {
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostPendingStatusCheck" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "PanelRow" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostPendingStatus" ] , null ) ) ) ;
}
/* harmony default export */ var post _pending _status = ( PostPendingStatus ) ;
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/plugin-post-status-info/index.js
2018-12-18 03:14:52 +00:00
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* Defines as extensibility slot for the Status & visibility panel .
* /
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* WordPress dependencies
* /
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
const {
Fill : plugin _post _status _info _Fill ,
Slot : plugin _post _status _info _Slot
} = Object ( external _wp _components _ [ "createSlotFill" ] ) ( 'PluginPostStatusInfo' ) ;
/ * *
* Renders a row in the Status & visibility panel of the Document sidebar .
* It should be noted that this is named and implemented around the function it serves
* and not its location , which may change in future iterations .
*
* @ param { Object } props Component properties .
* @ param { string } [ props . className ] An optional class name added to the row .
* @ param { WPElement } props . children Children to be rendered .
*
* @ example
* ` ` ` js
* // Using ES5 syntax
* var _ _ = wp . i18n . _ _ ;
* var PluginPostStatusInfo = wp . editPost . PluginPostStatusInfo ;
*
* function MyPluginPostStatusInfo ( ) {
* return wp . element . createElement (
* PluginPostStatusInfo ,
* {
* className : 'my-plugin-post-status-info' ,
* } ,
* _ _ ( 'My post status info' )
* )
* }
* ` ` `
*
* @ example
* ` ` ` jsx
* // Using ESNext syntax
* import { _ _ } from '@wordpress/i18n' ;
* import { PluginPostStatusInfo } from '@wordpress/edit-post' ;
*
* const MyPluginPostStatusInfo = ( ) => (
* < PluginPostStatusInfo
* className = "my-plugin-post-status-info"
* >
* { _ _ ( 'My post status info' ) }
* < / P l u g i n P o s t S t a t u s I n f o >
* ) ;
* ` ` `
*
* @ return { WPComponent } The component to be rendered .
* /
2018-12-18 03:14:52 +00:00
2021-11-15 12:50:17 +00:00
const PluginPostStatusInfo = _ref => {
let {
children ,
className
} = _ref ;
return Object ( external _wp _element _ [ "createElement" ] ) ( plugin _post _status _info _Fill , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "PanelRow" ] , {
className : className
} , children ) ) ;
} ;
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
PluginPostStatusInfo . Slot = plugin _post _status _info _Slot ;
/* harmony default export */ var plugin _post _status _info = ( PluginPostStatusInfo ) ;
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-status/index.js
2018-12-14 04:41:57 +00:00
2019-10-15 15:37:08 +00:00
/ * *
* WordPress dependencies
* /
2018-12-14 04:41:57 +00:00
2021-01-28 02:04:13 +00:00
2020-01-08 11:57:23 +00:00
/ * *
2021-01-28 02:04:13 +00:00
* Internal dependencies
2020-01-08 11:57:23 +00:00
* /
2021-05-07 11:48:27 +00:00
2021-01-28 02:04:13 +00:00
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* Module Constants
* /
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
const PANEL _NAME = 'post-status' ;
2021-05-07 11:48:27 +00:00
2021-11-15 12:50:17 +00:00
function PostStatus ( _ref ) {
let {
isOpened ,
onTogglePanel
} = _ref ;
2021-05-07 11:48:27 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "PanelBody" ] , {
2021-05-19 15:09:27 +00:00
className : "edit-post-post-status" ,
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Status & visibility' ) ,
2021-01-28 02:04:13 +00:00
opened : isOpened ,
onToggle : onTogglePanel
2021-05-19 15:09:27 +00:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( plugin _post _status _info . Slot , null , fills => Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( post _visibility , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( post _schedule , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( post _format , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( post _sticky , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( post _pending _status , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( post _slug , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( post _author , null ) , fills , Object ( external _wp _element _ [ "createElement" ] ) ( PostTrash , null ) ) ) ) ;
2020-01-08 11:57:23 +00:00
}
2021-05-19 15:09:27 +00:00
/* harmony default export */ var post _status = ( Object ( external _wp _compose _ [ "compose" ] ) ( [ Object ( external _wp _data _ [ "withSelect" ] ) ( select => {
// We use isEditorPanelRemoved to hide the panel if it was programatically removed. We do
// not use isEditorPanelEnabled since this panel should not be disabled through the UI.
const {
isEditorPanelRemoved ,
isEditorPanelOpened
} = select ( store [ "a" /* store */ ] ) ;
return {
isRemoved : isEditorPanelRemoved ( PANEL _NAME ) ,
isOpened : isEditorPanelOpened ( PANEL _NAME )
} ;
2021-11-15 12:50:17 +00:00
} ) , Object ( external _wp _compose _ [ "ifCondition" ] ) ( _ref2 => {
let {
isRemoved
} = _ref2 ;
return ! isRemoved ;
} ) , Object ( external _wp _data _ [ "withDispatch" ] ) ( dispatch => ( {
2021-05-19 15:09:27 +00:00
onTogglePanel ( ) {
return dispatch ( store [ "a" /* store */ ] ) . toggleEditorPanelOpened ( PANEL _NAME ) ;
}
2018-12-18 03:14:52 +00:00
2021-05-19 15:09:27 +00:00
} ) ) ] ) ( PostStatus ) ) ;
2018-12-18 03:14:52 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/last-revision/index.js
2018-12-18 03:14:52 +00:00
2021-05-07 11:48:27 +00:00
/ * *
* WordPress dependencies
* /
2018-12-18 03:14:52 +00:00
2019-03-07 09:09:59 +00:00
2021-05-19 15:09:27 +00:00
function LastRevision ( ) {
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostLastRevisionCheck" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "PanelBody" ] , {
className : "edit-post-last-revision__panel"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostLastRevision" ] , null ) ) ) ;
2021-05-07 11:48:27 +00:00
}
2021-05-19 15:09:27 +00:00
/* harmony default export */ var last _revision = ( LastRevision ) ;
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js
2021-01-28 02:04:13 +00:00
2019-10-15 15:37:08 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* External dependencies
2019-10-15 15:37:08 +00:00
* /
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* WordPress dependencies
* /
2021-05-07 11:48:27 +00:00
2019-10-15 15:37:08 +00:00
/ * *
2021-05-07 11:48:27 +00:00
* Internal dependencies
2019-10-15 15:37:08 +00:00
* /
2018-12-14 04:41:57 +00:00
2019-03-21 12:48:00 +00:00
2021-01-28 02:04:13 +00:00
2021-11-15 12:50:17 +00:00
function TaxonomyPanel ( _ref ) {
let {
isEnabled ,
taxonomy ,
isOpened ,
onTogglePanel ,
children
} = _ref ;
2021-05-19 15:09:27 +00:00
if ( ! isEnabled ) {
return null ;
}
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
const taxonomyMenuName = Object ( external _lodash _ [ "get" ] ) ( taxonomy , [ 'labels' , 'menu_name' ] ) ;
2019-03-21 12:48:00 +00:00
2021-05-19 15:09:27 +00:00
if ( ! taxonomyMenuName ) {
return null ;
}
2019-03-21 12:48:00 +00:00
2021-05-19 15:09:27 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "PanelBody" ] , {
title : taxonomyMenuName ,
opened : isOpened ,
onToggle : onTogglePanel
} , children ) ;
}
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
/* harmony default export */ var taxonomy _panel = ( Object ( external _wp _compose _ [ "compose" ] ) ( Object ( external _wp _data _ [ "withSelect" ] ) ( ( select , ownProps ) => {
const slug = Object ( external _lodash _ [ "get" ] ) ( ownProps . taxonomy , [ 'slug' ] ) ;
const panelName = slug ? ` taxonomy-panel- ${ slug } ` : '' ;
return {
panelName ,
isEnabled : slug ? select ( store [ "a" /* store */ ] ) . isEditorPanelEnabled ( panelName ) : false ,
isOpened : slug ? select ( store [ "a" /* store */ ] ) . isEditorPanelOpened ( panelName ) : false
} ;
} ) , Object ( external _wp _data _ [ "withDispatch" ] ) ( ( dispatch , ownProps ) => ( {
onTogglePanel : ( ) => {
dispatch ( store [ "a" /* store */ ] ) . toggleEditorPanelOpened ( ownProps . panelName ) ;
}
} ) ) ) ( TaxonomyPanel ) ) ;
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-taxonomies/index.js
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* WordPress dependencies
* /
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* Internal dependencies
* /
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
function PostTaxonomies ( ) {
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostTaxonomiesCheck" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostTaxonomies" ] , {
taxonomyWrapper : ( content , taxonomy ) => {
return Object ( external _wp _element _ [ "createElement" ] ) ( taxonomy _panel , {
taxonomy : taxonomy
} , content ) ;
2021-01-28 02:04:13 +00:00
}
2021-05-19 15:09:27 +00:00
} ) ) ;
}
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
/* harmony default export */ var post _taxonomies = ( PostTaxonomies ) ;
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/featured-image/index.js
2018-12-14 04:41:57 +00:00
2019-09-19 15:19:18 +00:00
2021-05-07 11:48:27 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* External dependencies
2021-05-07 11:48:27 +00:00
* /
2018-12-14 04:41:57 +00:00
/ * *
* WordPress dependencies
* /
2021-05-07 11:48:27 +00:00
2021-05-19 15:09:27 +00:00
2021-11-08 14:29:21 +00:00
2018-12-14 04:41:57 +00:00
/ * *
2018-12-18 03:14:52 +00:00
* Internal dependencies
2018-12-14 04:41:57 +00:00
* /
2021-05-19 15:09:27 +00:00
/ * *
* Module Constants
* /
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
const featured _image _PANEL _NAME = 'featured-image' ;
2018-12-18 03:14:52 +00:00
2021-11-15 12:50:17 +00:00
function FeaturedImage ( _ref ) {
let {
isEnabled ,
isOpened ,
postType ,
onTogglePanel
} = _ref ;
2021-05-19 15:09:27 +00:00
if ( ! isEnabled ) {
2021-05-07 11:48:27 +00:00
return null ;
2021-01-28 02:04:13 +00:00
}
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostFeaturedImageCheck" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "PanelBody" ] , {
title : Object ( external _lodash _ [ "get" ] ) ( postType , [ 'labels' , 'featured_image' ] , Object ( external _wp _i18n _ [ "__" ] ) ( 'Featured image' ) ) ,
opened : isOpened ,
onToggle : onTogglePanel
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostFeaturedImage" ] , null ) ) ) ;
2021-05-07 11:48:27 +00:00
}
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
const applyWithSelect = Object ( external _wp _data _ [ "withSelect" ] ) ( select => {
const {
getEditedPostAttribute
2021-11-08 14:29:21 +00:00
} = select ( external _wp _editor _ [ "store" ] ) ;
2021-05-19 15:09:27 +00:00
const {
getPostType
2021-11-08 14:29:21 +00:00
} = select ( external _wp _coreData _ [ "store" ] ) ;
2021-05-19 15:09:27 +00:00
const {
isEditorPanelEnabled ,
isEditorPanelOpened
} = select ( store [ "a" /* store */ ] ) ;
return {
postType : getPostType ( getEditedPostAttribute ( 'type' ) ) ,
isEnabled : isEditorPanelEnabled ( featured _image _PANEL _NAME ) ,
isOpened : isEditorPanelOpened ( featured _image _PANEL _NAME )
} ;
} ) ;
const applyWithDispatch = Object ( external _wp _data _ [ "withDispatch" ] ) ( dispatch => {
const {
toggleEditorPanelOpened
} = dispatch ( store [ "a" /* store */ ] ) ;
return {
onTogglePanel : Object ( external _lodash _ [ "partial" ] ) ( toggleEditorPanelOpened , featured _image _PANEL _NAME )
} ;
} ) ;
/* harmony default export */ var featured _image = ( Object ( external _wp _compose _ [ "compose" ] ) ( applyWithSelect , applyWithDispatch ) ( FeaturedImage ) ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-excerpt/index.js
2018-12-14 04:41:57 +00:00
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 15:37:00 +00:00
2019-10-15 15:37:08 +00:00
/ * *
* WordPress dependencies
* /
2018-12-14 04:41:57 +00:00
2018-12-18 03:14:52 +00:00
2021-05-07 11:48:27 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Internal dependencies
2021-05-07 11:48:27 +00:00
* /
2018-12-18 03:14:52 +00:00
2018-12-14 04:41:57 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Module Constants
2018-12-14 04:41:57 +00:00
* /
2021-05-19 15:09:27 +00:00
const post _excerpt _PANEL _NAME = 'post-excerpt' ;
2018-12-14 04:41:57 +00:00
2021-11-15 12:50:17 +00:00
function PostExcerpt ( _ref ) {
let {
isEnabled ,
isOpened ,
onTogglePanel
} = _ref ;
2021-05-19 15:09:27 +00:00
if ( ! isEnabled ) {
return null ;
}
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostExcerptCheck" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "PanelBody" ] , {
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Excerpt' ) ,
opened : isOpened ,
onToggle : onTogglePanel
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostExcerpt" ] , null ) ) ) ;
}
2019-09-19 15:19:18 +00:00
2021-05-19 15:09:27 +00:00
/* harmony default export */ var post _excerpt = ( Object ( external _wp _compose _ [ "compose" ] ) ( [ Object ( external _wp _data _ [ "withSelect" ] ) ( select => {
2021-05-07 11:48:27 +00:00
return {
2021-05-19 15:09:27 +00:00
isEnabled : select ( store [ "a" /* store */ ] ) . isEditorPanelEnabled ( post _excerpt _PANEL _NAME ) ,
isOpened : select ( store [ "a" /* store */ ] ) . isEditorPanelOpened ( post _excerpt _PANEL _NAME )
2021-05-07 11:48:27 +00:00
} ;
2021-05-19 15:09:27 +00:00
} ) , Object ( external _wp _data _ [ "withDispatch" ] ) ( dispatch => ( {
onTogglePanel ( ) {
return dispatch ( store [ "a" /* store */ ] ) . toggleEditorPanelOpened ( post _excerpt _PANEL _NAME ) ;
}
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
} ) ) ] ) ( PostExcerpt ) ) ;
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-link/index.js
/ * *
* External dependencies
* /
2018-12-14 04:41:57 +00:00
2018-12-18 03:14:52 +00:00
/ * *
2019-10-15 15:37:08 +00:00
* WordPress dependencies
2018-12-18 03:14:52 +00:00
* /
2018-12-14 04:41:57 +00:00
2019-10-15 15:37:08 +00:00
2021-05-19 15:09:27 +00:00
2021-11-08 14:29:21 +00:00
2018-12-14 04:41:57 +00:00
/ * *
2021-01-28 02:04:13 +00:00
* Internal dependencies
2018-12-14 04:41:57 +00:00
* /
2021-05-19 15:09:27 +00:00
/ * *
* Module Constants
* /
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
const post _link _PANEL _NAME = 'post-link' ;
2018-12-14 04:41:57 +00:00
2021-11-15 12:50:17 +00:00
function PostLink ( _ref ) {
let {
isOpened ,
onTogglePanel ,
isEditable ,
postLink ,
permalinkPrefix ,
permalinkSuffix ,
editPermalink ,
postSlug ,
postTypeLabel
} = _ref ;
2021-11-08 14:29:21 +00:00
const [ forceEmptyField , setForceEmptyField ] = Object ( external _wp _element _ [ "useState" ] ) ( false ) ;
2021-05-19 15:09:27 +00:00
let prefixElement , postNameElement , suffixElement ;
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
if ( isEditable ) {
prefixElement = permalinkPrefix && Object ( external _wp _element _ [ "createElement" ] ) ( "span" , {
className : "edit-post-post-link__link-prefix"
} , permalinkPrefix ) ;
postNameElement = postSlug && Object ( external _wp _element _ [ "createElement" ] ) ( "span" , {
className : "edit-post-post-link__link-post-name"
} , postSlug ) ;
suffixElement = permalinkSuffix && Object ( external _wp _element _ [ "createElement" ] ) ( "span" , {
className : "edit-post-post-link__link-suffix"
} , permalinkSuffix ) ;
}
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "PanelBody" ] , {
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Permalink' ) ,
opened : isOpened ,
onToggle : onTogglePanel
} , isEditable && Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "editor-post-link"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "TextControl" ] , {
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'URL Slug' ) ,
value : forceEmptyField ? '' : postSlug ,
2021-11-08 14:29:21 +00:00
autoComplete : "off" ,
spellCheck : "false" ,
2021-05-19 15:09:27 +00:00
onChange : newValue => {
editPermalink ( newValue ) ; // When we delete the field the permalink gets
// reverted to the original value.
// The forceEmptyField logic allows the user to have
// the field temporarily empty while typing.
2019-10-15 15:37:08 +00:00
2021-05-19 15:09:27 +00:00
if ( ! newValue ) {
if ( ! forceEmptyField ) {
2021-11-08 14:29:21 +00:00
setForceEmptyField ( true ) ;
2021-05-19 15:09:27 +00:00
}
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
return ;
}
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
if ( forceEmptyField ) {
2021-11-08 14:29:21 +00:00
setForceEmptyField ( false ) ;
2021-05-19 15:09:27 +00:00
}
} ,
onBlur : event => {
editPermalink ( Object ( external _wp _editor _ [ "cleanForSlug" ] ) ( event . target . value ) ) ;
2019-10-15 15:37:08 +00:00
2021-05-19 15:09:27 +00:00
if ( forceEmptyField ) {
2021-11-08 14:29:21 +00:00
setForceEmptyField ( false ) ;
2021-05-19 15:09:27 +00:00
}
}
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( "p" , null , Object ( external _wp _i18n _ [ "__" ] ) ( 'The last part of the URL.' ) , ' ' , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "ExternalLink" ] , {
2021-11-08 14:29:21 +00:00
href : Object ( external _wp _i18n _ [ "__" ] ) ( 'https://wordpress.org/support/article/writing-posts/#post-field-descriptions' )
2021-05-19 15:09:27 +00:00
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Read about permalinks' ) ) ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "h3" , {
className : "edit-post-post-link__preview-label"
} , postTypeLabel || Object ( external _wp _i18n _ [ "__" ] ) ( 'View post' ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-post-post-link__preview-link-container"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "ExternalLink" ] , {
className : "edit-post-post-link__link" ,
href : postLink ,
target : "_blank"
} , isEditable ? Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , prefixElement , postNameElement , suffixElement ) : postLink ) ) ) ;
2018-12-18 03:14:52 +00:00
}
2021-05-19 15:09:27 +00:00
/* harmony default export */ var post _link = ( Object ( external _wp _compose _ [ "compose" ] ) ( [ Object ( external _wp _data _ [ "withSelect" ] ) ( select => {
const {
isPermalinkEditable ,
getCurrentPost ,
isCurrentPostPublished ,
getPermalinkParts ,
getEditedPostAttribute ,
getEditedPostSlug
2021-11-08 14:29:21 +00:00
} = select ( external _wp _editor _ [ "store" ] ) ;
2021-05-19 15:09:27 +00:00
const {
isEditorPanelEnabled ,
isEditorPanelOpened
} = select ( store [ "a" /* store */ ] ) ;
const {
getPostType
2021-11-08 14:29:21 +00:00
} = select ( external _wp _coreData _ [ "store" ] ) ;
2021-05-19 15:09:27 +00:00
const {
link
} = getCurrentPost ( ) ;
const postTypeName = getEditedPostAttribute ( 'type' ) ;
const postType = getPostType ( postTypeName ) ;
const permalinkParts = getPermalinkParts ( ) ;
return {
postLink : link ,
isEditable : isPermalinkEditable ( ) ,
isPublished : isCurrentPostPublished ( ) ,
isOpened : isEditorPanelOpened ( post _link _PANEL _NAME ) ,
isEnabled : isEditorPanelEnabled ( post _link _PANEL _NAME ) ,
isViewable : Object ( external _lodash _ [ "get" ] ) ( postType , [ 'viewable' ] , false ) ,
postSlug : Object ( external _wp _url _ [ "safeDecodeURIComponent" ] ) ( getEditedPostSlug ( ) ) ,
postTypeLabel : Object ( external _lodash _ [ "get" ] ) ( postType , [ 'labels' , 'view_item' ] ) ,
hasPermalinkParts : ! ! permalinkParts ,
permalinkPrefix : permalinkParts === null || permalinkParts === void 0 ? void 0 : permalinkParts . prefix ,
permalinkSuffix : permalinkParts === null || permalinkParts === void 0 ? void 0 : permalinkParts . suffix
} ;
2021-11-15 12:50:17 +00:00
} ) , Object ( external _wp _compose _ [ "ifCondition" ] ) ( _ref2 => {
let {
isEnabled ,
postLink ,
isViewable ,
hasPermalinkParts
} = _ref2 ;
2021-05-19 15:09:27 +00:00
return isEnabled && postLink && isViewable && hasPermalinkParts ;
} ) , Object ( external _wp _data _ [ "withDispatch" ] ) ( dispatch => {
const {
toggleEditorPanelOpened
} = dispatch ( store [ "a" /* store */ ] ) ;
const {
editPost
2021-11-08 14:29:21 +00:00
} = dispatch ( external _wp _editor _ [ "store" ] ) ;
2021-05-19 15:09:27 +00:00
return {
onTogglePanel : ( ) => toggleEditorPanelOpened ( post _link _PANEL _NAME ) ,
editPermalink : newSlug => {
editPost ( {
slug : newSlug
} ) ;
}
} ;
} ) ] ) ( PostLink ) ) ;
2019-10-15 15:37:08 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/discussion-panel/index.js
2018-12-14 04:41:57 +00:00
/ * *
2019-10-15 15:37:08 +00:00
* WordPress dependencies
2018-12-14 04:41:57 +00:00
* /
2019-10-15 15:37:08 +00:00
2018-12-14 04:41:57 +00:00
/ * *
2021-01-28 02:04:13 +00:00
* Internal dependencies
2018-12-14 04:41:57 +00:00
* /
2019-10-15 15:37:08 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* Module Constants
* /
2019-10-15 15:37:08 +00:00
2021-05-19 15:09:27 +00:00
const discussion _panel _PANEL _NAME = 'discussion-panel' ;
2021-01-28 02:04:13 +00:00
2021-11-15 12:50:17 +00:00
function DiscussionPanel ( _ref ) {
let {
isEnabled ,
isOpened ,
onTogglePanel
} = _ref ;
2021-05-19 15:09:27 +00:00
if ( ! isEnabled ) {
return null ;
}
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostTypeSupportCheck" ] , {
supportKeys : [ 'comments' , 'trackbacks' ]
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "PanelBody" ] , {
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Discussion' ) ,
opened : isOpened ,
onToggle : onTogglePanel
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostTypeSupportCheck" ] , {
supportKeys : "comments"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "PanelRow" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostComments" ] , null ) ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostTypeSupportCheck" ] , {
supportKeys : "trackbacks"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "PanelRow" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostPingbacks" ] , null ) ) ) ) ) ;
2019-09-19 15:19:18 +00:00
}
2019-10-15 15:37:08 +00:00
2021-05-19 15:09:27 +00:00
/* harmony default export */ var discussion _panel = ( Object ( external _wp _compose _ [ "compose" ] ) ( [ Object ( external _wp _data _ [ "withSelect" ] ) ( select => {
return {
isEnabled : select ( store [ "a" /* store */ ] ) . isEditorPanelEnabled ( discussion _panel _PANEL _NAME ) ,
isOpened : select ( store [ "a" /* store */ ] ) . isEditorPanelOpened ( discussion _panel _PANEL _NAME )
} ;
} ) , Object ( external _wp _data _ [ "withDispatch" ] ) ( dispatch => ( {
onTogglePanel ( ) {
return dispatch ( store [ "a" /* store */ ] ) . toggleEditorPanelOpened ( discussion _panel _PANEL _NAME ) ;
}
2019-10-15 15:37:08 +00:00
2021-05-19 15:09:27 +00:00
} ) ) ] ) ( DiscussionPanel ) ) ;
2018-12-18 03:14:52 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/page-attributes/index.js
2021-01-28 02:04:13 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* External dependencies
2021-01-28 02:04:13 +00:00
* /
/ * *
2021-05-19 15:09:27 +00:00
* WordPress dependencies
2021-01-28 02:04:13 +00:00
* /
2018-12-14 04:41:57 +00:00
2020-01-08 11:57:23 +00:00
2020-01-22 22:06:21 +00:00
2021-01-28 02:04:13 +00:00
/ * *
* Internal dependencies
* /
2021-05-19 15:09:27 +00:00
2021-01-28 02:04:13 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Module Constants
2021-01-28 02:04:13 +00:00
* /
2020-01-08 11:57:23 +00:00
2021-05-19 15:09:27 +00:00
const page _attributes _PANEL _NAME = 'page-attributes' ;
function PageAttributes ( ) {
const {
isEnabled ,
isOpened ,
postType
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
const {
getEditedPostAttribute
} = select ( external _wp _editor _ [ "store" ] ) ;
const {
isEditorPanelEnabled ,
isEditorPanelOpened
} = select ( store [ "a" /* store */ ] ) ;
const {
getPostType
} = select ( external _wp _coreData _ [ "store" ] ) ;
return {
isEnabled : isEditorPanelEnabled ( page _attributes _PANEL _NAME ) ,
isOpened : isEditorPanelOpened ( page _attributes _PANEL _NAME ) ,
postType : getPostType ( getEditedPostAttribute ( 'type' ) )
} ;
} , [ ] ) ;
const {
toggleEditorPanelOpened
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store [ "a" /* store */ ] ) ;
2020-01-08 11:57:23 +00:00
2021-05-19 15:09:27 +00:00
if ( ! isEnabled || ! postType ) {
return null ;
}
2020-01-08 11:57:23 +00:00
2021-05-19 15:09:27 +00:00
const onTogglePanel = Object ( external _lodash _ [ "partial" ] ) ( toggleEditorPanelOpened , page _attributes _PANEL _NAME ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PageAttributesCheck" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "PanelBody" ] , {
title : Object ( external _lodash _ [ "get" ] ) ( postType , [ 'labels' , 'attributes' ] , Object ( external _wp _i18n _ [ "__" ] ) ( 'Page attributes' ) ) ,
opened : isOpened ,
onToggle : onTogglePanel
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PageAttributesParent" ] , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "PanelRow" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PageAttributesOrder" ] , null ) ) ) ) ;
}
/* harmony default export */ var page _attributes = ( PageAttributes ) ;
2020-01-08 11:57:23 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/meta-boxes/meta-boxes-area/index.js
2020-06-26 13:33:47 +00:00
2020-01-08 11:57:23 +00:00
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
2021-01-28 02:04:13 +00:00
/ * *
* Internal dependencies
* /
2020-06-26 13:33:47 +00:00
2020-01-08 11:57:23 +00:00
2021-11-08 14:29:21 +00:00
/ * *
* Render metabox area .
*
* @ param { Object } props Component props .
* @ param { string } props . location metabox location .
* @ return { WPComponent } The component to be rendered .
* /
2020-01-08 11:57:23 +00:00
2021-11-15 12:50:17 +00:00
function MetaBoxesArea ( _ref ) {
let {
location
} = _ref ;
2021-11-08 14:29:21 +00:00
const container = Object ( external _wp _element _ [ "useRef" ] ) ( null ) ;
const formRef = Object ( external _wp _element _ [ "useRef" ] ) ( null ) ;
Object ( external _wp _element _ [ "useEffect" ] ) ( ( ) => {
formRef . current = document . querySelector ( '.metabox-location-' + location ) ;
2021-01-28 02:04:13 +00:00
2021-11-08 14:29:21 +00:00
if ( formRef . current ) {
container . current . appendChild ( formRef . current ) ;
2021-01-28 02:04:13 +00:00
}
2020-01-08 11:57:23 +00:00
2021-11-08 14:29:21 +00:00
return ( ) => {
if ( formRef . current ) {
document . querySelector ( '#metaboxes' ) . appendChild ( formRef . current ) ;
}
} ;
} , [ location ] ) ;
const isSaving = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
return select ( store [ "a" /* store */ ] ) . isSavingMetaBoxes ( ) ;
} , [ ] ) ;
const classes = classnames _default ( ) ( 'edit-post-meta-boxes-area' , ` is- ${ location } ` , {
'is-loading' : isSaving
} ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : classes
} , isSaving && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Spinner" ] , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-post-meta-boxes-area__container" ,
ref : container
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-post-meta-boxes-area__clear"
} ) ) ;
2021-05-19 15:09:27 +00:00
}
2020-01-08 11:57:23 +00:00
2021-11-08 14:29:21 +00:00
/* harmony default export */ var meta _boxes _area = ( MetaBoxesArea ) ;
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/meta-boxes/meta-box-visibility.js
2021-01-28 02:04:13 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* WordPress dependencies
2021-01-28 02:04:13 +00:00
* /
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
2020-01-08 11:57:23 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Internal dependencies
2020-01-08 11:57:23 +00:00
* /
2021-05-19 15:09:27 +00:00
class meta _box _visibility _MetaBoxVisibility extends external _wp _element _ [ "Component" ] {
componentDidMount ( ) {
this . updateDOM ( ) ;
}
2020-01-08 11:57:23 +00:00
2021-05-19 15:09:27 +00:00
componentDidUpdate ( prevProps ) {
if ( this . props . isVisible !== prevProps . isVisible ) {
this . updateDOM ( ) ;
}
}
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
updateDOM ( ) {
const {
id ,
isVisible
} = this . props ;
const element = document . getElementById ( id ) ;
2020-01-08 11:57:23 +00:00
2021-05-19 15:09:27 +00:00
if ( ! element ) {
return ;
}
2020-01-08 11:57:23 +00:00
2021-05-19 15:09:27 +00:00
if ( isVisible ) {
element . classList . remove ( 'is-hidden' ) ;
} else {
element . classList . add ( 'is-hidden' ) ;
}
}
2020-01-08 11:57:23 +00:00
2021-05-19 15:09:27 +00:00
render ( ) {
return null ;
}
2020-01-08 11:57:23 +00:00
2021-05-19 15:09:27 +00:00
}
2021-01-28 02:04:13 +00:00
2021-11-15 12:50:17 +00:00
/* harmony default export */ var meta _box _visibility = ( Object ( external _wp _data _ [ "withSelect" ] ) ( ( select , _ref ) => {
let {
id
} = _ref ;
return {
isVisible : select ( store [ "a" /* store */ ] ) . isEditorPanelEnabled ( ` meta-box- ${ id } ` )
} ;
} ) ( meta _box _visibility _MetaBoxVisibility ) ) ;
2020-01-08 11:57:23 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/meta-boxes/index.js
2020-01-08 11:57:23 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* External dependencies
2020-01-08 11:57:23 +00:00
* /
/ * *
2021-05-19 15:09:27 +00:00
* WordPress dependencies
* /
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 19:08:24 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* Internal dependencies
2020-01-08 11:57:23 +00:00
* /
2021-05-19 15:09:27 +00:00
2021-11-15 12:50:17 +00:00
function MetaBoxes ( _ref ) {
let {
location
} = _ref ;
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 19:08:24 +00:00
const registry = Object ( external _wp _data _ [ "useRegistry" ] ) ( ) ;
const {
metaBoxes ,
areMetaBoxesInitialized ,
isEditorReady
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
const {
_ _unstableIsEditorReady
} = select ( external _wp _editor _ [ "store" ] ) ;
const {
getMetaBoxesPerLocation ,
areMetaBoxesInitialized : _areMetaBoxesInitialized
} = select ( store [ "a" /* store */ ] ) ;
return {
metaBoxes : getMetaBoxesPerLocation ( location ) ,
areMetaBoxesInitialized : _areMetaBoxesInitialized ( ) ,
isEditorReady : _ _unstableIsEditorReady ( )
} ;
} , [ location ] ) ; // When editor is ready, initialize postboxes (wp core script) and metabox
// saving. This initializes all meta box locations, not just this specific
// one.
Object ( external _wp _element _ [ "useEffect" ] ) ( ( ) => {
if ( isEditorReady && ! areMetaBoxesInitialized ) {
registry . dispatch ( store [ "a" /* store */ ] ) . initializeMetaBoxes ( ) ;
}
} , [ isEditorReady , areMetaBoxesInitialized ] ) ;
if ( ! areMetaBoxesInitialized ) {
return null ;
}
2021-11-15 12:50:17 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _lodash _ [ "map" ] ) ( metaBoxes , _ref2 => {
let {
id
} = _ref2 ;
return Object ( external _wp _element _ [ "createElement" ] ) ( meta _box _visibility , {
key : id ,
id : id
} ) ;
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( meta _boxes _area , {
2021-05-19 15:09:27 +00:00
location : location
} ) ) ;
}
// EXTERNAL MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/plugin-document-setting-panel/index.js
2021-05-20 12:20:04 +00:00
var plugin _document _setting _panel = _ _webpack _require _ _ ( "xrib" ) ;
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/plugin-sidebar/index.js
2019-10-15 15:37:08 +00:00
2019-09-19 15:19:18 +00:00
/ * *
2020-06-26 13:33:47 +00:00
* WordPress dependencies
2019-09-19 15:19:18 +00:00
* /
2018-12-18 03:14:52 +00:00
2021-05-19 15:09:27 +00:00
2021-11-08 14:29:21 +00:00
2019-09-19 15:19:18 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Internal dependencies
* /
/ * *
* Renders a sidebar when activated . The contents within the ` PluginSidebar ` will appear as content within the sidebar .
* It also automatically renders a corresponding ` PluginSidebarMenuItem ` component when ` isPinnable ` flag is set to ` true ` .
* If you wish to display the sidebar , you can with use the ` PluginSidebarMoreMenuItem ` component or the ` wp.data.dispatch ` API :
2020-06-26 13:33:47 +00:00
*
2021-05-19 15:09:27 +00:00
* ` ` ` js
* wp . data . dispatch ( 'core/edit-post' ) . openGeneralSidebar ( 'plugin-name/sidebar-name' ) ;
* ` ` `
*
* @ see PluginSidebarMoreMenuItem
*
2021-11-08 14:29:21 +00:00
* @ param { Object } props Element props .
* @ param { string } props . name A string identifying the sidebar . Must be unique for every sidebar registered within the scope of your plugin .
* @ param { string } [ props . className ] An optional class name added to the sidebar body .
* @ param { string } props . title Title displayed at the top of the sidebar .
* @ param { boolean } [ props . isPinnable = true ] Whether to allow to pin sidebar to the toolbar . When set to ` true ` it also automatically renders a corresponding menu item .
2021-05-19 15:09:27 +00:00
* @ param { WPBlockTypeIconRender } [ props . icon = inherits from the plugin ] The [ Dashicon ] ( https : //developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.
2019-09-19 15:19:18 +00:00
*
2020-06-26 13:33:47 +00:00
* @ example
2019-10-15 15:37:08 +00:00
* ` ` ` js
* // Using ES5 syntax
* var _ _ = wp . i18n . _ _ ;
2021-05-19 15:09:27 +00:00
* var el = wp . element . createElement ;
* var PanelBody = wp . components . PanelBody ;
* var PluginSidebar = wp . editPost . PluginSidebar ;
2020-06-26 13:33:47 +00:00
* var moreIcon = wp . element . createElement ( 'svg' ) ; //... svg element.
2019-09-19 15:19:18 +00:00
*
2021-05-19 15:09:27 +00:00
* function MyPluginSidebar ( ) {
* return el (
* PluginSidebar ,
* {
* name : 'my-sidebar' ,
* title : 'My sidebar title' ,
* icon : moreIcon ,
* } ,
* el (
* PanelBody ,
* { } ,
* _ _ ( 'My sidebar content' )
* )
* ) ;
2019-10-15 15:37:08 +00:00
* }
* ` ` `
2019-09-19 15:19:18 +00:00
*
2020-06-26 13:33:47 +00:00
* @ example
2019-10-15 15:37:08 +00:00
* ` ` ` jsx
* // Using ESNext syntax
2020-06-26 13:33:47 +00:00
* import { _ _ } from '@wordpress/i18n' ;
2021-05-19 15:09:27 +00:00
* import { PanelBody } from '@wordpress/components' ;
* import { PluginSidebar } from '@wordpress/edit-post' ;
2020-06-26 13:33:47 +00:00
* import { more } from '@wordpress/icons' ;
2019-09-19 15:19:18 +00:00
*
2021-05-19 15:09:27 +00:00
* const MyPluginSidebar = ( ) => (
* < PluginSidebar
* name = "my-sidebar"
* title = "My sidebar title"
2020-06-26 13:33:47 +00:00
* icon = { more }
* >
2021-05-19 15:09:27 +00:00
* < PanelBody >
* { _ _ ( 'My sidebar content' ) }
* < / P a n e l B o d y >
* < / P l u g i n S i d e b a r >
2020-06-26 13:33:47 +00:00
* ) ;
2019-10-15 15:37:08 +00:00
* ` ` `
2021-01-28 02:04:13 +00:00
* /
2021-11-15 12:50:17 +00:00
function PluginSidebarEditPost ( _ref ) {
let {
className ,
... props
} = _ref ;
2021-05-19 15:09:27 +00:00
const {
postTitle ,
shortcut ,
showIconLabels
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
return {
2021-11-08 14:29:21 +00:00
postTitle : select ( external _wp _editor _ [ "store" ] ) . getEditedPostAttribute ( 'title' ) ,
2021-05-19 15:09:27 +00:00
shortcut : select ( external _wp _keyboardShortcuts _ [ "store" ] ) . getShortcutRepresentation ( 'core/edit-post/toggle-sidebar' ) ,
showIconLabels : select ( store [ "a" /* store */ ] ) . isFeatureActive ( 'showIconLabels' )
} ;
2021-11-08 14:29:21 +00:00
} , [ ] ) ;
2021-05-19 15:09:27 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( build _module [ "b" /* ComplementaryArea */ ] , Object ( esm _extends [ "a" /* default */ ] ) ( {
panelClassName : className ,
className : "edit-post-sidebar" ,
smallScreenTitle : postTitle || Object ( external _wp _i18n _ [ "__" ] ) ( '(no title)' ) ,
scope : "core/edit-post" ,
toggleShortcut : shortcut ,
showIconLabels : showIconLabels
2021-01-28 02:04:13 +00:00
} , props ) ) ;
}
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/template/actions.js
2021-01-28 02:04:13 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* External dependencies
2021-01-28 02:04:13 +00:00
* /
/ * *
2021-05-19 15:09:27 +00:00
* WordPress dependencies
2021-01-28 02:04:13 +00:00
* /
2021-05-19 15:09:27 +00:00
2021-01-28 02:04:13 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Internal dependencies
2018-12-14 04:41:57 +00:00
* /
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
function PostTemplateActions ( ) {
const [ isModalOpen , setIsModalOpen ] = Object ( external _wp _element _ [ "useState" ] ) ( false ) ;
2021-11-08 14:29:21 +00:00
const [ isBusy , setIsBusy ] = Object ( external _wp _element _ [ "useState" ] ) ( false ) ;
2021-05-19 15:09:27 +00:00
const [ title , setTitle ] = Object ( external _wp _element _ [ "useState" ] ) ( '' ) ;
const {
template ,
2021-06-22 10:00:50 +00:00
supportsTemplateMode ,
defaultTemplate
2021-05-19 15:09:27 +00:00
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
var _getPostType$viewable , _getPostType ;
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
const {
2021-06-22 10:00:50 +00:00
getCurrentPostType ,
getEditorSettings
2021-05-19 15:09:27 +00:00
} = select ( external _wp _editor _ [ "store" ] ) ;
const {
getPostType
} = select ( external _wp _coreData _ [ "store" ] ) ;
const {
getEditedPostTemplate
} = select ( store [ "a" /* store */ ] ) ;
const isViewable = ( _getPostType$viewable = ( _getPostType = getPostType ( getCurrentPostType ( ) ) ) === null || _getPostType === void 0 ? void 0 : _getPostType . viewable ) !== null && _getPostType$viewable !== void 0 ? _getPostType$viewable : false ;
2021-01-28 02:04:13 +00:00
2021-06-22 10:00:50 +00:00
const _supportsTemplateMode = getEditorSettings ( ) . supportsTemplateMode && isViewable ;
2019-10-15 15:37:08 +00:00
2021-05-19 15:09:27 +00:00
return {
template : _supportsTemplateMode && getEditedPostTemplate ( ) ,
2021-06-22 10:00:50 +00:00
supportsTemplateMode : _supportsTemplateMode ,
defaultTemplate : getEditorSettings ( ) . defaultBlockTemplate
2021-05-19 15:09:27 +00:00
} ;
} , [ ] ) ;
const {
2021-11-08 14:29:21 +00:00
_ _unstableCreateTemplate ,
2021-05-19 15:09:27 +00:00
_ _unstableSwitchToTemplateMode
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store [ "a" /* store */ ] ) ;
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
if ( ! supportsTemplateMode ) {
return null ;
}
2021-01-28 02:04:13 +00:00
2021-06-22 10:00:50 +00:00
const defaultTitle = Object ( external _wp _i18n _ [ "__" ] ) ( 'Custom Template' ) ;
2021-11-08 14:29:21 +00:00
async function onCreateTemplate ( event ) {
event . preventDefault ( ) ;
if ( isBusy ) {
return ;
}
setIsBusy ( true ) ;
const newTemplateContent = defaultTemplate !== null && defaultTemplate !== void 0 ? defaultTemplate : Object ( external _wp _blocks _ [ "serialize" ] ) ( [ Object ( external _wp _blocks _ [ "createBlock" ] ) ( 'core/group' , {
tagName : 'header' ,
layout : {
inherit : true
}
} , [ Object ( external _wp _blocks _ [ "createBlock" ] ) ( 'core/site-title' ) , Object ( external _wp _blocks _ [ "createBlock" ] ) ( 'core/site-tagline' ) ] ) , Object ( external _wp _blocks _ [ "createBlock" ] ) ( 'core/separator' ) , Object ( external _wp _blocks _ [ "createBlock" ] ) ( 'core/group' , {
tagName : 'main'
} , [ Object ( external _wp _blocks _ [ "createBlock" ] ) ( 'core/group' , {
layout : {
inherit : true
}
} , [ Object ( external _wp _blocks _ [ "createBlock" ] ) ( 'core/post-title' ) ] ) , Object ( external _wp _blocks _ [ "createBlock" ] ) ( 'core/post-content' , {
layout : {
inherit : true
}
} ) ] ) ] ) ;
await _ _unstableCreateTemplate ( {
slug : 'wp-custom-template-' + Object ( external _lodash _ [ "kebabCase" ] ) ( title || defaultTitle ) ,
content : newTemplateContent ,
title : title || defaultTitle
} ) ;
setIsBusy ( false ) ;
setIsModalOpen ( false ) ;
_ _unstableSwitchToTemplateMode ( true ) ;
}
2021-05-19 15:09:27 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-post-template__actions"
} , ! ! template && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
2021-11-08 14:29:21 +00:00
variant : "link" ,
2021-05-19 15:09:27 +00:00
onClick : ( ) => _ _unstableSwitchToTemplateMode ( )
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Edit' ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
2021-11-08 14:29:21 +00:00
variant : "link" ,
2021-05-19 15:09:27 +00:00
onClick : ( ) => setIsModalOpen ( true )
2021-11-23 05:40:38 +00:00
} ,
/* translators: button to create a new template */
Object ( external _wp _i18n _ [ "_x" ] ) ( 'New' , 'action' ) ) ) , isModalOpen && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Modal" ] , {
2021-06-15 08:52:30 +00:00
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Create custom template' ) ,
2021-05-19 15:09:27 +00:00
closeLabel : Object ( external _wp _i18n _ [ "__" ] ) ( 'Close' ) ,
onRequestClose : ( ) => {
setIsModalOpen ( false ) ;
setTitle ( '' ) ;
} ,
overlayClassName : "edit-post-template__modal"
} , Object ( external _wp _element _ [ "createElement" ] ) ( "form" , {
2021-11-08 14:29:21 +00:00
onSubmit : onCreateTemplate
2021-06-15 08:52:30 +00:00
} , 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" ] , {
2021-05-19 15:09:27 +00:00
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Name' ) ,
value : title ,
2021-06-15 08:52:30 +00:00
onChange : setTitle ,
2021-06-22 10:00:50 +00:00
placeholder : defaultTitle ,
2021-11-08 14:29:21 +00:00
disabled : isBusy ,
2021-06-15 08:52:30 +00:00
help : Object ( external _wp _i18n _ [ "__" ] ) ( 'Describe the purpose of the template, e.g. "Full Width". Custom templates can be applied to any post or page.' )
} ) ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Flex" ] , {
className : "edit-post-template__modal-actions" ,
justify : "flex-end" ,
expanded : false
2021-05-19 15:09:27 +00:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "FlexItem" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
2021-11-08 14:29:21 +00:00
variant : "tertiary" ,
2021-05-19 15:09:27 +00:00
onClick : ( ) => {
setIsModalOpen ( false ) ;
setTitle ( '' ) ;
}
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Cancel' ) ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "FlexItem" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
2021-11-08 14:29:21 +00:00
variant : "primary" ,
type : "submit" ,
isBusy : isBusy ,
"aria-disabled" : isBusy
2021-05-19 15:09:27 +00:00
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Create' ) ) ) ) ) ) ) ;
2020-06-26 13:33:47 +00:00
}
2019-10-15 15:37:08 +00:00
2021-05-19 15:09:27 +00:00
/* harmony default export */ var actions = ( PostTemplateActions ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/template/index.js
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* External dependencies
* /
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* WordPress dependencies
* /
2019-09-19 15:19:18 +00:00
2018-12-14 04:41:57 +00:00
2018-12-17 04:52:00 +00:00
2021-06-25 15:52:22 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* Internal dependencies
* /
2018-12-14 04:41:57 +00:00
2018-12-18 03:14:52 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* Module Constants
* /
2018-12-18 03:14:52 +00:00
2021-05-19 15:09:27 +00:00
const template _PANEL _NAME = 'template' ;
function TemplatePanel ( ) {
const {
isEnabled ,
isOpened ,
selectedTemplate ,
availableTemplates ,
2021-06-25 15:52:22 +00:00
fetchedTemplates ,
2021-05-19 15:09:27 +00:00
isViewable ,
template ,
2021-11-08 14:29:21 +00:00
supportsTemplateMode ,
canUserCreate
2021-05-19 15:09:27 +00:00
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
var _getPostType$viewable , _getPostType ;
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
const {
isEditorPanelEnabled ,
isEditorPanelOpened ,
getEditedPostTemplate
} = select ( store [ "a" /* store */ ] ) ;
const {
getEditedPostAttribute ,
getEditorSettings ,
getCurrentPostType
} = select ( external _wp _editor _ [ "store" ] ) ;
const {
2021-06-25 15:52:22 +00:00
getPostType ,
2021-11-08 14:29:21 +00:00
getEntityRecords ,
canUser
2021-05-19 15:09:27 +00:00
} = select ( external _wp _coreData _ [ "store" ] ) ;
2021-11-08 14:29:21 +00:00
const currentPostType = getCurrentPostType ( ) ;
2018-12-14 04:41:57 +00:00
2021-11-08 14:29:21 +00:00
const _isViewable = ( _getPostType$viewable = ( _getPostType = getPostType ( currentPostType ) ) === null || _getPostType === void 0 ? void 0 : _getPostType . viewable ) !== null && _getPostType$viewable !== void 0 ? _getPostType$viewable : false ;
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
const _supportsTemplateMode = select ( external _wp _editor _ [ "store" ] ) . getEditorSettings ( ) . supportsTemplateMode && _isViewable ;
2019-10-15 15:37:08 +00:00
2021-06-25 15:52:22 +00:00
const wpTemplates = getEntityRecords ( 'postType' , 'wp_template' , {
2022-02-17 19:18:25 +00:00
post _type : currentPostType ,
per _page : - 1
2021-06-25 15:52:22 +00:00
} ) ;
2021-11-15 12:50:17 +00:00
const newAvailableTemplates = Object ( external _lodash _ [ "fromPairs" ] ) ( ( wpTemplates || [ ] ) . map ( _ref => {
let {
slug ,
title
} = _ref ;
return [ slug , title . rendered ] ;
} ) ) ;
2021-05-19 15:09:27 +00:00
return {
isEnabled : isEditorPanelEnabled ( template _PANEL _NAME ) ,
isOpened : isEditorPanelOpened ( template _PANEL _NAME ) ,
selectedTemplate : getEditedPostAttribute ( 'template' ) ,
availableTemplates : getEditorSettings ( ) . availableTemplates ,
2021-06-25 15:52:22 +00:00
fetchedTemplates : newAvailableTemplates ,
2021-05-19 15:09:27 +00:00
template : _supportsTemplateMode && getEditedPostTemplate ( ) ,
isViewable : _isViewable ,
2021-11-08 14:29:21 +00:00
supportsTemplateMode : _supportsTemplateMode ,
canUserCreate : canUser ( 'create' , 'templates' )
2021-05-19 15:09:27 +00:00
} ;
} , [ ] ) ;
2021-06-25 15:52:22 +00:00
const templates = Object ( external _wp _element _ [ "useMemo" ] ) ( ( ) => {
return { ... availableTemplates ,
... fetchedTemplates
} ;
} , [ availableTemplates , fetchedTemplates ] ) ;
2021-05-19 15:09:27 +00:00
const {
toggleEditorPanelOpened
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store [ "a" /* store */ ] ) ;
const {
editPost
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( external _wp _editor _ [ "store" ] ) ;
2019-10-15 15:37:08 +00:00
2021-11-08 14:29:21 +00:00
if ( ! isEnabled || ! isViewable || Object ( external _lodash _ [ "isEmpty" ] ) ( availableTemplates ) && ( ! supportsTemplateMode || ! canUserCreate ) ) {
2021-05-19 15:09:27 +00:00
return null ;
}
2019-10-15 15:37:08 +00:00
2021-05-19 15:09:27 +00:00
const onTogglePanel = Object ( external _lodash _ [ "partial" ] ) ( toggleEditorPanelOpened , template _PANEL _NAME ) ;
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
let panelTitle = Object ( external _wp _i18n _ [ "__" ] ) ( 'Template' ) ;
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
if ( ! ! template ) {
2021-05-21 10:14:23 +00:00
var _template$title ;
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
panelTitle = Object ( external _wp _i18n _ [ "sprintf" ] ) (
/* translators: %s: template title */
2021-05-21 10:14:23 +00:00
Object ( external _wp _i18n _ [ "__" ] ) ( 'Template: %s' ) , ( _template$title = template === null || template === void 0 ? void 0 : template . title ) !== null && _template$title !== void 0 ? _template$title : template . slug ) ;
2021-01-28 02:04:13 +00:00
}
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "PanelBody" ] , {
title : panelTitle ,
opened : isOpened ,
onToggle : onTogglePanel
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "SelectControl" ] , {
hideLabelFromVision : true ,
label : Object ( external _wp _i18n _ [ "__" ] ) ( 'Template:' ) ,
2021-06-25 15:52:22 +00:00
value : Object . keys ( templates ) . includes ( selectedTemplate ) ? selectedTemplate : '' ,
2021-05-19 15:09:27 +00:00
onChange : templateSlug => {
editPost ( {
template : templateSlug || ''
} ) ;
} ,
2021-06-25 15:52:22 +00:00
options : Object ( external _lodash _ [ "map" ] ) ( templates , ( templateName , templateSlug ) => ( {
2021-05-19 15:09:27 +00:00
value : templateSlug ,
label : templateName
} ) )
2021-11-08 14:29:21 +00:00
} ) , canUserCreate && Object ( external _wp _element _ [ "createElement" ] ) ( actions , null ) ) ;
2021-01-28 02:04:13 +00:00
}
2021-05-19 15:09:27 +00:00
/* harmony default export */ var sidebar _template = ( TemplatePanel ) ;
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/layout.js
2021-05-20 12:20:04 +00:00
var library _layout = _ _webpack _require _ _ ( "Civd" ) ;
2019-10-15 15:37:08 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/template-summary/index.js
2019-10-15 15:37:08 +00:00
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* WordPress dependencies
* /
2021-02-02 05:17:13 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* Internal dependencies
* /
2021-02-02 05:17:13 +00:00
2021-04-15 15:19:43 +00:00
2021-05-19 15:09:27 +00:00
function TemplateSummary ( ) {
const template = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
const {
getEditedPostTemplate
} = select ( store [ "a" /* store */ ] ) ;
return getEditedPostTemplate ( ) ;
} , [ ] ) ;
2021-04-15 15:19:43 +00:00
2021-05-19 15:09:27 +00:00
if ( ! template ) {
return null ;
2021-04-15 15:19:43 +00:00
}
2021-05-19 15:09:27 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "PanelBody" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Flex" ] , {
2021-11-08 14:29:21 +00:00
align : "flex-start" ,
gap : "3"
2021-05-19 15:09:27 +00:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "FlexItem" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( build _module _icon [ "a" /* default */ ] , {
icon : library _layout [ "a" /* default */ ]
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "FlexBlock" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( "h2" , {
className : "edit-post-template-summary__title"
2021-05-21 10:14:23 +00:00
} , ( template === null || template === void 0 ? void 0 : template . title ) || ( template === null || template === void 0 ? void 0 : template . slug ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "p" , null , template === null || template === void 0 ? void 0 : template . description ) ) ) ) ;
2021-04-15 15:19:43 +00:00
}
2021-05-19 15:09:27 +00:00
/* harmony default export */ var template _summary = ( TemplateSummary ) ;
2021-02-02 05:17:13 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/settings-sidebar/index.js
2021-02-02 05:17:13 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* WordPress dependencies
* /
2021-02-02 05:17:13 +00:00
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* Internal dependencies
* /
2020-06-26 13:33:47 +00:00
2021-01-28 02:04:13 +00:00
2020-06-26 13:33:47 +00:00
2019-10-15 15:37:08 +00:00
2018-12-14 04:41:57 +00:00
2019-10-15 15:37:08 +00:00
2021-05-19 15:09:27 +00:00
const SIDEBAR _ACTIVE _BY _DEFAULT = external _wp _element _ [ "Platform" ] . select ( {
web : true ,
native : false
} ) ;
2019-10-15 15:37:08 +00:00
2021-05-19 15:09:27 +00:00
const SettingsSidebar = ( ) => {
const {
sidebarName ,
keyboardShortcut ,
isTemplateMode
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
// The settings sidebar is used by the edit-post/document and edit-post/block sidebars.
// sidebarName represents the sidebar that is active or that should be active when the SettingsSidebar toggle button is pressed.
// If one of the two sidebars is active the component will contain the content of that sidebar.
// When neither of the the two sidebars is active we can not simply return null, because the PluginSidebarEditPost
// component, besides being used to render the sidebar, also renders the toggle button. In that case sidebarName
// should contain the sidebar that will be active when the toggle button is pressed. If a block
// is selected, that should be edit-post/block otherwise it's edit-post/document.
2021-11-08 14:29:21 +00:00
let sidebar = select ( build _module [ "i" /* store */ ] ) . getActiveComplementaryArea ( store [ "a" /* store */ ] . name ) ;
2019-10-15 15:37:08 +00:00
2021-05-19 15:09:27 +00:00
if ( ! [ 'edit-post/document' , 'edit-post/block' ] . includes ( sidebar ) ) {
if ( select ( external _wp _blockEditor _ [ "store" ] ) . getBlockSelectionStart ( ) ) {
sidebar = 'edit-post/block' ;
}
2019-10-15 15:37:08 +00:00
2021-05-19 15:09:27 +00:00
sidebar = 'edit-post/document' ;
}
const shortcut = select ( external _wp _keyboardShortcuts _ [ "store" ] ) . getShortcutRepresentation ( 'core/edit-post/toggle-sidebar' ) ;
return {
sidebarName : sidebar ,
keyboardShortcut : shortcut ,
isTemplateMode : select ( store [ "a" /* store */ ] ) . isEditingTemplate ( )
} ;
} , [ ] ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( PluginSidebarEditPost , {
identifier : sidebarName ,
header : Object ( external _wp _element _ [ "createElement" ] ) ( settings _header , {
sidebarName : sidebarName
} ) ,
closeLabel : Object ( external _wp _i18n _ [ "__" ] ) ( 'Close settings' ) ,
headerClassName : "edit-post-sidebar__panel-tabs"
/* translators: button label text should, if possible, be under 16 characters. */
,
title : Object ( external _wp _i18n _ [ "__" ] ) ( 'Settings' ) ,
toggleShortcut : keyboardShortcut ,
2021-05-25 08:40:25 +00:00
icon : cog [ "a" /* default */ ] ,
2021-05-19 15:09:27 +00:00
isActiveByDefault : SIDEBAR _ACTIVE _BY _DEFAULT
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 19:08:24 +00:00
} , ! isTemplateMode && sidebarName === 'edit-post/document' && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( post _status , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( sidebar _template , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( plugin _document _setting _panel [ "a" /* default */ ] . Slot , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( last _revision , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( post _link , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( post _taxonomies , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( featured _image , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( post _excerpt , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( discussion _panel , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( page _attributes , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( MetaBoxes , {
2021-05-19 15:09:27 +00:00
location : "side"
} ) ) , isTemplateMode && sidebarName === 'edit-post/document' && Object ( external _wp _element _ [ "createElement" ] ) ( template _summary , null ) , sidebarName === 'edit-post/block' && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "BlockInspector" ] , null ) ) ;
} ;
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
/* harmony default export */ var settings _sidebar = ( SettingsSidebar ) ;
2021-06-01 08:10:04 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/image.js
2021-01-28 02:04:13 +00:00
2021-11-15 12:50:17 +00:00
function WelcomeGuideImage ( _ref ) {
let {
nonAnimatedSrc ,
animatedSrc
} = _ref ;
2021-06-01 08:10:04 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( "picture" , {
className : "edit-post-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 : ""
} ) ) ;
}
2019-10-15 15:37:08 +00:00
2021-05-21 10:14:23 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/default.js
2019-10-15 15:37:08 +00:00
2021-01-28 02:04:13 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* WordPress dependencies
2021-01-28 02:04:13 +00:00
* /
2019-10-15 15:37:08 +00:00
2021-01-28 02:04:13 +00:00
2021-05-21 10:14:23 +00:00
/ * *
* Internal dependencies
* /
2018-12-18 03:14:52 +00:00
2019-10-15 15:37:08 +00:00
2021-05-21 10:14:23 +00:00
function WelcomeGuideDefault ( ) {
2021-05-19 15:09:27 +00:00
const {
toggleFeature
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store [ "a" /* store */ ] ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Guide" ] , {
className : "edit-post-welcome-guide" ,
contentLabel : Object ( external _wp _i18n _ [ "__" ] ) ( 'Welcome to the block editor' ) ,
finishButtonText : Object ( external _wp _i18n _ [ "__" ] ) ( 'Get started' ) ,
onFinish : ( ) => toggleFeature ( 'welcomeGuide' ) ,
pages : [ {
2021-06-01 08:10:04 +00:00
image : Object ( external _wp _element _ [ "createElement" ] ) ( WelcomeGuideImage , {
nonAnimatedSrc : "https://s.w.org/images/block-editor/welcome-canvas.svg" ,
animatedSrc : "https://s.w.org/images/block-editor/welcome-canvas.gif"
} ) ,
2021-05-19 15:09:27 +00:00
content : Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( "h1" , {
className : "edit-post-welcome-guide__heading"
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Welcome to the block editor' ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "p" , {
className : "edit-post-welcome-guide__text"
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'In the WordPress editor, each paragraph, image, or video is presented as a distinct “block” of content.' ) ) )
} , {
2021-06-01 08:10:04 +00:00
image : Object ( external _wp _element _ [ "createElement" ] ) ( WelcomeGuideImage , {
nonAnimatedSrc : "https://s.w.org/images/block-editor/welcome-editor.svg" ,
animatedSrc : "https://s.w.org/images/block-editor/welcome-editor.gif"
} ) ,
2021-05-19 15:09:27 +00:00
content : Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( "h1" , {
className : "edit-post-welcome-guide__heading"
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Make each block your own' ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "p" , {
className : "edit-post-welcome-guide__text"
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.' ) ) )
} , {
2021-06-01 08:10:04 +00:00
image : Object ( external _wp _element _ [ "createElement" ] ) ( WelcomeGuideImage , {
nonAnimatedSrc : "https://s.w.org/images/block-editor/welcome-library.svg" ,
animatedSrc : "https://s.w.org/images/block-editor/welcome-library.gif"
} ) ,
2021-05-19 15:09:27 +00:00
content : Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( "h1" , {
className : "edit-post-welcome-guide__heading"
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Get to know the block library' ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "p" , {
className : "edit-post-welcome-guide__text"
} , Object ( external _wp _element _ [ "createInterpolateElement" ] ) ( Object ( external _wp _i18n _ [ "__" ] ) ( 'All of the blocks available to you live in the block library. You’ ll find it wherever you see the <InserterIconImage /> icon.' ) , {
2021-06-01 08:10:04 +00:00
InserterIconImage : Object ( external _wp _element _ [ "createElement" ] ) ( "img" , {
alt : Object ( external _wp _i18n _ [ "__" ] ) ( 'inserter' ) ,
src : "data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A"
2021-05-19 15:09:27 +00:00
} )
} ) ) )
} , {
2021-06-01 08:10:04 +00:00
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"
} ) ,
2021-05-19 15:09:27 +00:00
content : Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( "h1" , {
className : "edit-post-welcome-guide__heading"
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Learn how to use the block editor' ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "p" , {
className : "edit-post-welcome-guide__text"
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'New to the block editor? Want to learn more about using it? ' ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "ExternalLink" ] , {
href : Object ( external _wp _i18n _ [ "__" ] ) ( 'https://wordpress.org/support/article/wordpress-editor/' )
} , Object ( external _wp _i18n _ [ "__" ] ) ( "Here's a detailed guide." ) ) ) )
} ]
} ) ;
2021-01-28 02:04:13 +00:00
}
2019-10-15 15:37:08 +00:00
2021-05-21 10:14:23 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/template.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
function WelcomeGuideTemplate ( ) {
const {
toggleFeature
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store [ "a" /* store */ ] ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Guide" ] , {
className : "edit-post-welcome-guide" ,
contentLabel : Object ( external _wp _i18n _ [ "__" ] ) ( 'Welcome to the template editor' ) ,
finishButtonText : Object ( external _wp _i18n _ [ "__" ] ) ( 'Get started' ) ,
onFinish : ( ) => toggleFeature ( 'welcomeGuideTemplate' ) ,
pages : [ {
2021-06-01 08:10:04 +00:00
image : Object ( external _wp _element _ [ "createElement" ] ) ( WelcomeGuideImage , {
nonAnimatedSrc : "https://s.w.org/images/block-editor/welcome-template-editor.svg" ,
animatedSrc : "https://s.w.org/images/block-editor/welcome-template-editor.gif"
} ) ,
2021-05-21 10:14:23 +00:00
content : Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( "h1" , {
className : "edit-post-welcome-guide__heading"
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Welcome to the template editor' ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "p" , {
className : "edit-post-welcome-guide__text"
2021-11-08 14:29:21 +00:00
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Templates help define the layout of the site. You can customize all aspects of your posts and pages using blocks and patterns in this editor.' ) ) )
2021-05-21 10:14:23 +00:00
} ]
} ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/index.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
function WelcomeGuide ( ) {
const {
isActive ,
isTemplateMode
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
const {
isFeatureActive ,
isEditingTemplate
} = select ( store [ "a" /* store */ ] ) ;
const _isTemplateMode = isEditingTemplate ( ) ;
const feature = _isTemplateMode ? 'welcomeGuideTemplate' : 'welcomeGuide' ;
return {
isActive : isFeatureActive ( feature ) ,
isTemplateMode : _isTemplateMode
} ;
} , [ ] ) ;
if ( ! isActive ) {
return null ;
}
return isTemplateMode ? Object ( external _wp _element _ [ "createElement" ] ) ( WelcomeGuideTemplate , null ) : Object ( external _wp _element _ [ "createElement" ] ) ( WelcomeGuideDefault , null ) ;
}
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/plugin-post-publish-panel/index.js
2020-01-08 11:57:23 +00:00
2019-10-15 15:37:08 +00:00
2019-09-19 15:19:18 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* WordPress dependencies
2019-09-19 15:19:18 +00:00
* /
2019-10-15 15:37:08 +00:00
2021-05-19 15:09:27 +00:00
const {
Fill : plugin _post _publish _panel _Fill ,
Slot : plugin _post _publish _panel _Slot
} = Object ( external _wp _components _ [ "createSlotFill" ] ) ( 'PluginPostPublishPanel' ) ;
2019-10-15 15:37:08 +00:00
2021-11-15 12:50:17 +00:00
const PluginPostPublishPanelFill = _ref => {
let {
children ,
className ,
title ,
initialOpen = false ,
icon
} = _ref ;
return Object ( external _wp _element _ [ "createElement" ] ) ( plugin _post _publish _panel _Fill , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "PanelBody" ] , {
className : className ,
initialOpen : initialOpen || ! title ,
title : title ,
icon : icon
} , children ) ) ;
} ;
2021-01-28 02:04:13 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Renders provided content to the post - publish panel in the publish flow
* ( side panel that opens after a user publishes the post ) .
2021-01-28 02:04:13 +00:00
*
2021-11-08 14:29:21 +00:00
* @ param { Object } props Component properties .
* @ param { string } [ props . className ] An optional class name added to the panel .
* @ param { string } [ props . title ] Title displayed at the top of the panel .
* @ param { boolean } [ props . initialOpen = false ] Whether to have the panel initially opened . When no title is provided it is always opened .
2021-05-19 15:09:27 +00:00
* @ param { WPBlockTypeIconRender } [ props . icon = inherits from the plugin ] The [ Dashicon ] ( https : //developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.
2021-01-28 02:04:13 +00:00
*
2021-05-19 15:09:27 +00:00
* @ example
* ` ` ` js
* // Using ES5 syntax
* var _ _ = wp . i18n . _ _ ;
* var PluginPostPublishPanel = wp . editPost . PluginPostPublishPanel ;
*
* function MyPluginPostPublishPanel ( ) {
* return wp . element . createElement (
* PluginPostPublishPanel ,
* {
* className : 'my-plugin-post-publish-panel' ,
* title : _ _ ( 'My panel title' ) ,
* initialOpen : true ,
* } ,
* _ _ ( 'My panel content' )
* ) ;
* }
* ` ` `
*
* @ example
* ` ` ` jsx
* // Using ESNext syntax
* import { _ _ } from '@wordpress/i18n' ;
* import { PluginPostPublishPanel } from '@wordpress/edit-post' ;
*
* const MyPluginPostPublishPanel = ( ) => (
* < PluginPostPublishPanel
* className = "my-plugin-post-publish-panel"
* title = { _ _ ( 'My panel title' ) }
* initialOpen = { true }
* >
* { _ _ ( 'My panel content' ) }
* < / P l u g i n P o s t P u b l i s h P a n e l >
* ) ;
* ` ` `
*
* @ return { WPComponent } The component to be rendered .
2021-01-28 02:04:13 +00:00
* /
2019-10-15 15:37:08 +00:00
2020-08-10 14:18:33 +00:00
2021-05-19 15:09:27 +00:00
const PluginPostPublishPanel = Object ( external _wp _compose _ [ "compose" ] ) ( Object ( external _wp _plugins _ [ "withPluginContext" ] ) ( ( context , ownProps ) => {
return {
icon : ownProps . icon || context . icon
} ;
} ) ) ( PluginPostPublishPanelFill ) ;
PluginPostPublishPanel . Slot = plugin _post _publish _panel _Slot ;
/* harmony default export */ var plugin _post _publish _panel = ( PluginPostPublishPanel ) ;
2020-08-10 14:18:33 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/plugin-pre-publish-panel/index.js
2020-08-10 14:18:33 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* WordPress dependencies
* /
2020-08-10 14:18:33 +00:00
2021-05-19 15:09:27 +00:00
const {
Fill : plugin _pre _publish _panel _Fill ,
Slot : plugin _pre _publish _panel _Slot
} = Object ( external _wp _components _ [ "createSlotFill" ] ) ( 'PluginPrePublishPanel' ) ;
2020-08-10 14:18:33 +00:00
2021-11-15 12:50:17 +00:00
const PluginPrePublishPanelFill = _ref => {
let {
children ,
className ,
title ,
initialOpen = false ,
icon
} = _ref ;
return Object ( external _wp _element _ [ "createElement" ] ) ( plugin _pre _publish _panel _Fill , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "PanelBody" ] , {
className : className ,
initialOpen : initialOpen || ! title ,
title : title ,
icon : icon
} , children ) ) ;
} ;
2020-08-10 14:18:33 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Renders provided content to the pre - publish side panel in the publish flow
* ( side panel that opens when a user first pushes "Publish" from the main editor ) .
*
* @ param { Object } props Component props .
* @ param { string } [ props . className ] An optional class name added to the panel .
* @ param { string } [ props . title ] Title displayed at the top of the panel .
* @ param { boolean } [ props . initialOpen = false ] Whether to have the panel initially opened .
* When no title is provided it is always opened .
* @ param { WPBlockTypeIconRender } [ props . icon = inherits from the plugin ] The [ Dashicon ] ( https : //developer.wordpress.org/resource/dashicons/)
* icon slug string , or an SVG WP element , to be rendered when
* the sidebar is pinned to toolbar .
*
* @ example
* ` ` ` js
* // Using ES5 syntax
* var _ _ = wp . i18n . _ _ ;
* var PluginPrePublishPanel = wp . editPost . PluginPrePublishPanel ;
*
* function MyPluginPrePublishPanel ( ) {
* return wp . element . createElement (
* PluginPrePublishPanel ,
* {
* className : 'my-plugin-pre-publish-panel' ,
* title : _ _ ( 'My panel title' ) ,
* initialOpen : true ,
* } ,
* _ _ ( 'My panel content' )
* ) ;
* }
* ` ` `
*
* @ example
* ` ` ` jsx
* // Using ESNext syntax
* import { _ _ } from '@wordpress/i18n' ;
* import { PluginPrePublishPanel } from '@wordpress/edit-post' ;
*
* const MyPluginPrePublishPanel = ( ) => (
* < PluginPrePublishPanel
* className = "my-plugin-pre-publish-panel"
* title = { _ _ ( 'My panel title' ) }
* initialOpen = { true }
* >
* { _ _ ( 'My panel content' ) }
* < / P l u g i n P r e P u b l i s h P a n e l >
* ) ;
* ` ` `
*
* @ return { WPComponent } The component to be rendered .
2020-08-10 14:18:33 +00:00
* /
2021-05-19 15:09:27 +00:00
const PluginPrePublishPanel = Object ( external _wp _compose _ [ "compose" ] ) ( Object ( external _wp _plugins _ [ "withPluginContext" ] ) ( ( context , ownProps ) => {
2021-01-28 02:04:13 +00:00
return {
2021-05-19 15:09:27 +00:00
icon : ownProps . icon || context . icon
2021-01-28 02:04:13 +00:00
} ;
2021-05-19 15:09:27 +00:00
} ) ) ( PluginPrePublishPanelFill ) ;
PluginPrePublishPanel . Slot = plugin _pre _publish _panel _Slot ;
/* harmony default export */ var plugin _pre _publish _panel = ( PluginPrePublishPanel ) ;
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/layout/actions-panel.js
2020-06-26 13:33:47 +00:00
2018-12-14 04:41:57 +00:00
/ * *
2018-12-18 03:14:52 +00:00
* WordPress dependencies
2018-12-14 04:41:57 +00:00
* /
2021-05-19 15:09:27 +00:00
2020-06-26 13:33:47 +00:00
/ * *
* Internal dependencies
* /
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
const {
Fill : actions _panel _Fill ,
Slot : actions _panel _Slot
} = Object ( external _wp _components _ [ "createSlotFill" ] ) ( 'ActionsPanel' ) ;
const ActionsPanelFill = actions _panel _Fill ;
2021-11-15 12:50:17 +00:00
function ActionsPanel ( _ref ) {
let {
setEntitiesSavedStatesCallback ,
closeEntitiesSavedStates ,
isEntitiesSavedStatesOpen
} = _ref ;
2021-05-19 15:09:27 +00:00
const {
closePublishSidebar ,
togglePublishSidebar
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store [ "a" /* store */ ] ) ;
const {
publishSidebarOpened ,
hasActiveMetaboxes ,
isSavingMetaBoxes ,
hasNonPostEntityChanges
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
return {
publishSidebarOpened : select ( store [ "a" /* store */ ] ) . isPublishSidebarOpened ( ) ,
hasActiveMetaboxes : select ( store [ "a" /* store */ ] ) . hasMetaBoxes ( ) ,
isSavingMetaBoxes : select ( store [ "a" /* store */ ] ) . isSavingMetaBoxes ( ) ,
2021-11-08 14:29:21 +00:00
hasNonPostEntityChanges : select ( external _wp _editor _ [ "store" ] ) . hasNonPostEntityChanges ( )
2021-05-19 15:09:27 +00:00
} ;
} , [ ] ) ;
const openEntitiesSavedStates = Object ( external _wp _element _ [ "useCallback" ] ) ( ( ) => setEntitiesSavedStatesCallback ( true ) , [ ] ) ; // It is ok for these components to be unmounted when not in visual use.
// We don't want more than one present at a time, decide which to render.
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
let unmountableContent ;
if ( publishSidebarOpened ) {
unmountableContent = Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostPublishPanel" ] , {
onClose : closePublishSidebar ,
forceIsDirty : hasActiveMetaboxes ,
forceIsSaving : isSavingMetaBoxes ,
PrePublishExtension : plugin _pre _publish _panel . Slot ,
PostPublishExtension : plugin _post _publish _panel . Slot
} ) ;
} else if ( hasNonPostEntityChanges ) {
unmountableContent = Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-post-layout__toggle-entities-saved-states-panel"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
2021-11-08 14:29:21 +00:00
variant : "secondary" ,
2021-05-19 15:09:27 +00:00
className : "edit-post-layout__toggle-entities-saved-states-panel-button" ,
onClick : openEntitiesSavedStates ,
"aria-expanded" : false
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Open save panel' ) ) ) ;
} else {
unmountableContent = Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-post-layout__toggle-publish-panel"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
2021-11-08 14:29:21 +00:00
variant : "secondary" ,
2021-05-19 15:09:27 +00:00
className : "edit-post-layout__toggle-publish-panel-button" ,
onClick : togglePublishSidebar ,
"aria-expanded" : false
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Open publish panel' ) ) ) ;
} // Since EntitiesSavedStates controls its own panel, we can keep it
// always mounted to retain its own component state (such as checkboxes).
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
return 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" ] ) ( actions _panel _Slot , {
bubblesVirtually : true
} ) , ! isEntitiesSavedStatesOpen && unmountableContent ) ;
2021-01-28 02:04:13 +00:00
}
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/layout/index.js
2020-02-10 22:33:27 +00:00
2018-12-14 04:41:57 +00:00
2019-09-19 15:19:18 +00:00
/ * *
2021-01-28 02:04:13 +00:00
* External dependencies
2019-09-19 15:19:18 +00:00
* /
2018-12-14 04:41:57 +00:00
2019-09-19 15:19:18 +00:00
/ * *
2021-01-28 02:04:13 +00:00
* WordPress dependencies
2019-09-19 15:19:18 +00:00
* /
2018-12-14 04:41:57 +00:00
2018-12-18 03:14:52 +00:00
2019-03-21 12:48:00 +00:00
2021-01-28 02:04:13 +00:00
2021-04-15 15:19:43 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Internal dependencies
2021-04-15 15:19:43 +00:00
* /
2021-05-21 10:14:23 +00:00
2021-05-19 15:09:27 +00:00
const interfaceLabels = {
secondarySidebar : Object ( external _wp _i18n _ [ "__" ] ) ( 'Block library' ) ,
2021-04-15 15:19:43 +00:00
2021-05-19 15:09:27 +00:00
/* translators: accessibility text for the editor top bar landmark region. */
header : Object ( external _wp _i18n _ [ "__" ] ) ( 'Editor top bar' ) ,
2021-04-15 15:19:43 +00:00
2021-05-19 15:09:27 +00:00
/* translators: accessibility text for the editor content landmark region. */
body : Object ( external _wp _i18n _ [ "__" ] ) ( 'Editor content' ) ,
2021-04-15 15:19:43 +00:00
2021-05-19 15:09:27 +00:00
/* translators: accessibility text for the editor settings landmark region. */
sidebar : Object ( external _wp _i18n _ [ "__" ] ) ( 'Editor settings' ) ,
2021-04-15 15:19:43 +00:00
2021-05-19 15:09:27 +00:00
/* translators: accessibility text for the editor publish landmark region. */
actions : Object ( external _wp _i18n _ [ "__" ] ) ( 'Editor publish' ) ,
2021-04-15 15:19:43 +00:00
2021-05-19 15:09:27 +00:00
/* translators: accessibility text for the editor footer landmark region. */
footer : Object ( external _wp _i18n _ [ "__" ] ) ( 'Editor footer' )
} ;
2021-04-15 15:19:43 +00:00
2021-11-15 12:50:17 +00:00
function Layout ( _ref ) {
let {
styles
} = _ref ;
2021-05-19 15:09:27 +00:00
const isMobileViewport = Object ( external _wp _compose _ [ "useViewportMatch" ] ) ( 'medium' , '<' ) ;
const isHugeViewport = Object ( external _wp _compose _ [ "useViewportMatch" ] ) ( 'huge' , '>=' ) ;
const {
openGeneralSidebar ,
closeGeneralSidebar ,
setIsInserterOpened
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store [ "a" /* store */ ] ) ;
const {
mode ,
isFullscreenActive ,
isRichEditingEnabled ,
sidebarIsOpened ,
hasActiveMetaboxes ,
hasFixedToolbar ,
previousShortcut ,
nextShortcut ,
hasBlockSelected ,
isInserterOpened ,
2021-05-21 10:14:23 +00:00
isListViewOpened ,
2021-05-19 15:09:27 +00:00
showIconLabels ,
hasReducedUI ,
2021-06-01 08:10:04 +00:00
showBlockBreadcrumbs ,
2021-11-08 14:29:21 +00:00
isTemplateMode ,
documentLabel
2021-05-19 15:09:27 +00:00
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
2021-11-08 14:29:21 +00:00
const {
getEditorSettings ,
getPostTypeLabel
} = select ( external _wp _editor _ [ "store" ] ) ;
const editorSettings = getEditorSettings ( ) ;
const postTypeLabel = getPostTypeLabel ( ) ;
2021-05-19 15:09:27 +00:00
return {
2021-06-01 08:10:04 +00:00
isTemplateMode : select ( store [ "a" /* store */ ] ) . isEditingTemplate ( ) ,
2021-05-19 15:09:27 +00:00
hasFixedToolbar : select ( store [ "a" /* store */ ] ) . isFeatureActive ( 'fixedToolbar' ) ,
2021-11-08 14:29:21 +00:00
sidebarIsOpened : ! ! ( select ( build _module [ "i" /* store */ ] ) . getActiveComplementaryArea ( store [ "a" /* store */ ] . name ) || select ( store [ "a" /* store */ ] ) . isPublishSidebarOpened ( ) ) ,
2021-05-19 15:09:27 +00:00
isFullscreenActive : select ( store [ "a" /* store */ ] ) . isFeatureActive ( 'fullscreenMode' ) ,
isInserterOpened : select ( store [ "a" /* store */ ] ) . isInserterOpened ( ) ,
2021-05-21 10:14:23 +00:00
isListViewOpened : select ( store [ "a" /* store */ ] ) . isListViewOpened ( ) ,
2021-05-19 15:09:27 +00:00
mode : select ( store [ "a" /* store */ ] ) . getEditorMode ( ) ,
isRichEditingEnabled : editorSettings . richEditingEnabled ,
hasActiveMetaboxes : select ( store [ "a" /* store */ ] ) . hasMetaBoxes ( ) ,
2021-11-08 14:29:21 +00:00
previousShortcut : select ( external _wp _keyboardShortcuts _ [ "store" ] ) . getAllShortcutKeyCombinations ( 'core/edit-post/previous-region' ) ,
nextShortcut : select ( external _wp _keyboardShortcuts _ [ "store" ] ) . getAllShortcutKeyCombinations ( 'core/edit-post/next-region' ) ,
2021-05-19 15:09:27 +00:00
showIconLabels : select ( store [ "a" /* store */ ] ) . isFeatureActive ( 'showIconLabels' ) ,
hasReducedUI : select ( store [ "a" /* store */ ] ) . isFeatureActive ( 'reducedUI' ) ,
2021-11-08 14:29:21 +00:00
showBlockBreadcrumbs : select ( store [ "a" /* store */ ] ) . isFeatureActive ( 'showBlockBreadcrumbs' ) ,
// translators: Default label for the Document in the Block Breadcrumb.
documentLabel : postTypeLabel || Object ( external _wp _i18n _ [ "_x" ] ) ( 'Document' , 'noun' )
2021-05-19 15:09:27 +00:00
} ;
} , [ ] ) ;
const className = classnames _default ( ) ( 'edit-post-layout' , 'is-mode-' + mode , {
'is-sidebar-opened' : sidebarIsOpened ,
'has-fixed-toolbar' : hasFixedToolbar ,
'has-metaboxes' : hasActiveMetaboxes ,
'show-icon-labels' : showIconLabels
} ) ;
2021-04-15 15:19:43 +00:00
2021-05-19 15:09:27 +00:00
const openSidebarPanel = ( ) => openGeneralSidebar ( hasBlockSelected ? 'edit-post/block' : 'edit-post/document' ) ; // Inserter and Sidebars are mutually exclusive
2021-04-15 15:19:43 +00:00
2021-05-19 15:09:27 +00:00
Object ( external _wp _element _ [ "useEffect" ] ) ( ( ) => {
if ( sidebarIsOpened && ! isHugeViewport ) {
setIsInserterOpened ( false ) ;
}
} , [ sidebarIsOpened , isHugeViewport ] ) ;
Object ( external _wp _element _ [ "useEffect" ] ) ( ( ) => {
if ( isInserterOpened && ! isHugeViewport ) {
closeGeneralSidebar ( ) ;
}
} , [ isInserterOpened , isHugeViewport ] ) ; // Local state for save panel.
// Note 'truthy' callback implies an open panel.
2021-04-15 15:19:43 +00:00
2021-05-19 15:09:27 +00:00
const [ entitiesSavedStatesCallback , setEntitiesSavedStatesCallback ] = Object ( external _wp _element _ [ "useState" ] ) ( false ) ;
const closeEntitiesSavedStates = Object ( external _wp _element _ [ "useCallback" ] ) ( arg => {
if ( typeof entitiesSavedStatesCallback === 'function' ) {
entitiesSavedStatesCallback ( arg ) ;
}
2021-04-15 15:19:43 +00:00
2021-05-19 15:09:27 +00:00
setEntitiesSavedStatesCallback ( false ) ;
} , [ entitiesSavedStatesCallback ] ) ;
2021-05-21 10:14:23 +00:00
const secondarySidebar = ( ) => {
if ( mode === 'visual' && isInserterOpened ) {
return Object ( external _wp _element _ [ "createElement" ] ) ( InserterSidebar , null ) ;
}
if ( mode === 'visual' && isListViewOpened ) {
2021-11-08 14:29:21 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( ListViewSidebar , null ) ;
2021-05-21 10:14:23 +00:00
}
return null ;
} ;
2021-05-19 15:09:27 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( build _module [ "d" /* FullscreenMode */ ] , {
isActive : isFullscreenActive
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( browser _url , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "UnsavedChangesWarning" ] , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "AutosaveMonitor" ] , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "LocalAutosaveMonitor" ] , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( keyboard _shortcuts , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "EditorKeyboardShortcutsRegister" ] , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( settings _sidebar , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( build _module [ "e" /* InterfaceSkeleton */ ] , {
className : className ,
labels : interfaceLabels ,
header : Object ( external _wp _element _ [ "createElement" ] ) ( header , {
setEntitiesSavedStatesCallback : setEntitiesSavedStatesCallback
} ) ,
2021-05-21 10:14:23 +00:00
secondarySidebar : secondarySidebar ( ) ,
2021-05-19 15:09:27 +00:00
sidebar : ( ! isMobileViewport || sidebarIsOpened ) && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , ! isMobileViewport && ! sidebarIsOpened && Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-post-layout__toggle-sidebar-panel"
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
2021-11-08 14:29:21 +00:00
variant : "secondary" ,
2021-05-19 15:09:27 +00:00
className : "edit-post-layout__toggle-sidebar-panel-button" ,
onClick : openSidebarPanel ,
"aria-expanded" : false
} , hasBlockSelected ? Object ( external _wp _i18n _ [ "__" ] ) ( 'Open block settings' ) : Object ( external _wp _i18n _ [ "__" ] ) ( 'Open document settings' ) ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( build _module [ "b" /* ComplementaryArea */ ] . Slot , {
scope : "core/edit-post"
} ) ) ,
2021-07-15 18:55:29 +00:00
notices : Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "EditorSnackbars" ] , null ) ,
2021-05-19 15:09:27 +00:00
content : Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "EditorNotices" ] , null ) , ( mode === 'text' || ! isRichEditingEnabled ) && Object ( external _wp _element _ [ "createElement" ] ) ( text _editor , null ) , isRichEditingEnabled && mode === 'visual' && Object ( external _wp _element _ [ "createElement" ] ) ( VisualEditor , {
styles : styles
2021-06-01 08:10:04 +00:00
} ) , ! isTemplateMode && Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
2021-05-19 15:09:27 +00:00
className : "edit-post-layout__metaboxes"
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 19:08:24 +00:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( MetaBoxes , {
2021-05-19 15:09:27 +00:00
location : "normal"
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 19:08:24 +00:00
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( MetaBoxes , {
2021-05-19 15:09:27 +00:00
location : "advanced"
} ) ) , isMobileViewport && sidebarIsOpened && Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "ScrollLock" ] , null ) ) ,
footer : ! hasReducedUI && showBlockBreadcrumbs && ! isMobileViewport && isRichEditingEnabled && mode === 'visual' && Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
className : "edit-post-layout__footer"
2021-11-08 14:29:21 +00:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "BlockBreadcrumb" ] , {
rootLabelText : documentLabel
} ) ) ,
2021-05-19 15:09:27 +00:00
actions : Object ( external _wp _element _ [ "createElement" ] ) ( ActionsPanel , {
closeEntitiesSavedStates : closeEntitiesSavedStates ,
isEntitiesSavedStatesOpen : entitiesSavedStatesCallback ,
setEntitiesSavedStatesCallback : setEntitiesSavedStatesCallback
} ) ,
shortcuts : {
previous : previousShortcut ,
next : nextShortcut
}
2021-11-08 14:29:21 +00:00
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( PreferencesModal , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( keyboard _shortcut _help _modal , null ) , 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-04-15 15:19:43 +00:00
}
2021-05-19 15:09:27 +00:00
/* harmony default export */ var components _layout = ( Layout ) ;
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 15:37:00 +00:00
2021-05-19 15:09:27 +00:00
// EXTERNAL MODULE: ./node_modules/@wordpress/edit-post/build-module/store/constants.js
2021-05-20 12:20:04 +00:00
var constants = _ _webpack _require _ _ ( "0dt7" ) ;
2019-09-19 15:19:18 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/editor-initialization/listener-hooks.js
/ * *
* WordPress dependencies
* /
2018-12-14 04:41:57 +00:00
2019-03-21 12:48:00 +00:00
2021-11-08 14:29:21 +00:00
2019-10-15 15:37:08 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* Internal dependencies
2019-10-15 15:37:08 +00:00
* /
2018-12-14 04:41:57 +00:00
2021-01-28 02:04:13 +00:00
/ * *
2021-05-19 15:09:27 +00:00
* This listener hook monitors for block selection and triggers the appropriate
* sidebar state .
*
2021-11-08 14:29:21 +00:00
* @ param { number } postId The current post id .
2021-01-28 02:04:13 +00:00
* /
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
const useBlockSelectionListener = postId => {
const {
hasBlockSelection ,
isEditorSidebarOpened
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => ( {
2021-11-08 14:29:21 +00:00
hasBlockSelection : ! ! select ( external _wp _blockEditor _ [ "store" ] ) . getBlockSelectionStart ( ) ,
2021-05-19 15:09:27 +00:00
isEditorSidebarOpened : select ( constants [ "a" /* STORE_NAME */ ] ) . isEditorSidebarOpened ( )
} ) , [ postId ] ) ;
const {
openGeneralSidebar
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( constants [ "a" /* STORE_NAME */ ] ) ;
Object ( external _wp _element _ [ "useEffect" ] ) ( ( ) => {
if ( ! isEditorSidebarOpened ) {
return ;
}
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
if ( hasBlockSelection ) {
openGeneralSidebar ( 'edit-post/block' ) ;
} else {
openGeneralSidebar ( 'edit-post/document' ) ;
}
} , [ hasBlockSelection , isEditorSidebarOpened ] ) ;
} ;
/ * *
* This listener hook monitors any change in permalink and updates the view
* post link in the admin bar .
*
* @ param { number } postId
* /
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
const useUpdatePostLinkListener = postId => {
const {
newPermalink
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => ( {
2021-11-08 14:29:21 +00:00
newPermalink : select ( external _wp _editor _ [ "store" ] ) . getCurrentPost ( ) . link
2021-05-19 15:09:27 +00:00
} ) , [ postId ] ) ;
const nodeToUpdate = Object ( external _wp _element _ [ "useRef" ] ) ( ) ;
Object ( external _wp _element _ [ "useEffect" ] ) ( ( ) => {
nodeToUpdate . current = document . querySelector ( constants [ "c" /* VIEW_AS_PREVIEW_LINK_SELECTOR */ ] ) || document . querySelector ( constants [ "b" /* VIEW_AS_LINK_SELECTOR */ ] ) ;
} , [ postId ] ) ;
Object ( external _wp _element _ [ "useEffect" ] ) ( ( ) => {
if ( ! newPermalink || ! nodeToUpdate . current ) {
return ;
}
2018-12-18 03:14:52 +00:00
2021-05-19 15:09:27 +00:00
nodeToUpdate . current . setAttribute ( 'href' , newPermalink ) ;
} , [ newPermalink ] ) ;
} ;
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/editor-initialization/index.js
/ * *
* Internal dependencies
* /
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* Data component used for initializing the editor and re - initializes
* when postId changes or on unmount .
*
2021-11-08 14:29:21 +00:00
* @ param { number } postId The id of the post .
2021-05-19 15:09:27 +00:00
* @ return { null } This is a data component so does not render any ui .
* /
2018-12-14 04:41:57 +00:00
2021-11-15 12:50:17 +00:00
function EditorInitialization ( _ref ) {
let {
postId
} = _ref ;
2021-05-19 15:09:27 +00:00
useBlockSelectionListener ( postId ) ;
useUpdatePostLinkListener ( postId ) ;
return null ;
}
2020-02-06 21:03:31 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/editor.js
2020-02-06 21:03:31 +00:00
2020-06-26 13:33:47 +00:00
2019-10-15 15:37:08 +00:00
/ * *
* External dependencies
* /
2018-12-14 04:41:57 +00:00
2019-10-15 15:37:08 +00:00
/ * *
* WordPress dependencies
* /
2019-09-19 15:19:18 +00:00
2018-12-14 04:41:57 +00:00
2018-12-14 04:53:54 +00:00
2018-12-14 04:41:57 +00:00
2021-11-08 14:29:21 +00:00
2018-12-14 04:41:57 +00:00
/ * *
2019-10-15 15:37:08 +00:00
* Internal dependencies
2018-12-14 04:41:57 +00:00
* /
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 15:37:00 +00:00
2021-11-15 12:50:17 +00:00
function Editor ( _ref ) {
let {
postId ,
postType ,
settings ,
initialEdits ,
onError ,
... props
} = _ref ;
2021-05-19 15:09:27 +00:00
const {
hasFixedToolbar ,
focusMode ,
hasReducedUI ,
hasThemeStyles ,
post ,
preferredStyleVariations ,
hiddenBlockTypes ,
blockTypes ,
_ _experimentalLocalAutosaveInterval ,
keepCaretInsideBlock ,
isTemplateMode ,
template
} = Object ( external _wp _data _ [ "useSelect" ] ) ( select => {
var _getPostType$viewable , _getPostType ;
2021-04-15 15:19:43 +00:00
2021-05-19 15:09:27 +00:00
const {
isFeatureActive ,
getPreference ,
_ _experimentalGetPreviewDeviceType ,
isEditingTemplate ,
getEditedPostTemplate
} = select ( store [ "a" /* store */ ] ) ;
const {
getEntityRecord ,
getPostType ,
getEntityRecords
2021-11-08 14:29:21 +00:00
} = select ( external _wp _coreData _ [ "store" ] ) ;
2021-05-19 15:09:27 +00:00
const {
getEditorSettings
2021-11-08 14:29:21 +00:00
} = select ( external _wp _editor _ [ "store" ] ) ;
2021-05-19 15:09:27 +00:00
const {
getBlockTypes
} = select ( external _wp _blocks _ [ "store" ] ) ;
const isTemplate = [ 'wp_template' , 'wp_template_part' ] . includes ( postType ) ; // Ideally the initializeEditor function should be called using the ID of the REST endpoint.
// to avoid the special case.
2018-12-18 03:14:52 +00:00
2021-05-19 15:09:27 +00:00
let postObject ;
2018-12-18 03:14:52 +00:00
2021-05-19 15:09:27 +00:00
if ( isTemplate ) {
const posts = getEntityRecords ( 'postType' , postType , {
wp _id : postId
} ) ;
postObject = posts === null || posts === void 0 ? void 0 : posts [ 0 ] ;
} else {
postObject = getEntityRecord ( 'postType' , postType , postId ) ;
2019-10-15 15:37:08 +00:00
}
2018-12-18 03:14:52 +00:00
2021-05-19 15:09:27 +00:00
const supportsTemplateMode = getEditorSettings ( ) . supportsTemplateMode ;
const isViewable = ( _getPostType$viewable = ( _getPostType = getPostType ( postType ) ) === null || _getPostType === void 0 ? void 0 : _getPostType . viewable ) !== null && _getPostType$viewable !== void 0 ? _getPostType$viewable : false ;
2021-01-28 02:04:13 +00:00
return {
2021-05-19 15:09:27 +00:00
hasFixedToolbar : isFeatureActive ( 'fixedToolbar' ) || _ _experimentalGetPreviewDeviceType ( ) !== 'Desktop' ,
focusMode : isFeatureActive ( 'focusMode' ) ,
hasReducedUI : isFeatureActive ( 'reducedUI' ) ,
hasThemeStyles : isFeatureActive ( 'themeStyles' ) ,
preferredStyleVariations : getPreference ( 'preferredStyleVariations' ) ,
hiddenBlockTypes : getPreference ( 'hiddenBlockTypes' ) ,
blockTypes : getBlockTypes ( ) ,
_ _experimentalLocalAutosaveInterval : getPreference ( 'localAutosaveInterval' ) ,
keepCaretInsideBlock : isFeatureActive ( 'keepCaretInsideBlock' ) ,
isTemplateMode : isEditingTemplate ( ) ,
template : supportsTemplateMode && isViewable ? getEditedPostTemplate ( ) : null ,
post : postObject
2021-01-28 02:04:13 +00:00
} ;
2021-11-08 14:29:21 +00:00
} , [ postType , postId ] ) ;
2021-05-19 15:09:27 +00:00
const {
updatePreferredStyleVariations ,
setIsInserterOpened
} = Object ( external _wp _data _ [ "useDispatch" ] ) ( store [ "a" /* store */ ] ) ;
const editorSettings = Object ( external _wp _element _ [ "useMemo" ] ) ( ( ) => {
2021-11-08 14:29:21 +00:00
const result = { ... settings ,
2021-05-19 15:09:27 +00:00
_ _experimentalPreferredStyleVariations : {
value : preferredStyleVariations ,
onChange : updatePreferredStyleVariations
} ,
hasFixedToolbar ,
focusMode ,
hasReducedUI ,
_ _experimentalLocalAutosaveInterval ,
// This is marked as experimental to give time for the quick inserter to mature.
_ _experimentalSetIsInserterOpened : setIsInserterOpened ,
keepCaretInsideBlock
} ; // Omit hidden block types if exists and non-empty.
2018-12-18 03:14:52 +00:00
2021-05-19 15:09:27 +00:00
if ( Object ( external _lodash _ [ "size" ] ) ( hiddenBlockTypes ) > 0 ) {
// Defer to passed setting for `allowedBlockTypes` if provided as
// anything other than `true` (where `true` is equivalent to allow
// all block types).
const defaultAllowedBlockTypes = true === settings . allowedBlockTypes ? Object ( external _lodash _ [ "map" ] ) ( blockTypes , 'name' ) : settings . allowedBlockTypes || [ ] ;
result . allowedBlockTypes = Object ( external _lodash _ [ "without" ] ) ( defaultAllowedBlockTypes , ... hiddenBlockTypes ) ;
2021-01-28 02:04:13 +00:00
}
2021-05-19 15:09:27 +00:00
return result ;
} , [ settings , hasFixedToolbar , focusMode , hasReducedUI , hiddenBlockTypes , blockTypes , preferredStyleVariations , _ _experimentalLocalAutosaveInterval , setIsInserterOpened , updatePreferredStyleVariations , keepCaretInsideBlock ] ) ;
const styles = Object ( external _wp _element _ [ "useMemo" ] ) ( ( ) => {
2021-11-08 14:29:21 +00:00
const themeStyles = [ ] ;
const presetStyles = [ ] ;
settings . styles . forEach ( style => {
if ( ! style . _ _unstableType || style . _ _unstableType === 'theme' ) {
themeStyles . push ( style ) ;
} else {
presetStyles . push ( style ) ;
}
} ) ;
const defaultEditorStyles = [ ... settings . defaultEditorStyles , ... presetStyles ] ;
return hasThemeStyles && themeStyles . length ? settings . styles : defaultEditorStyles ;
2021-05-19 15:09:27 +00:00
} , [ settings , hasThemeStyles ] ) ;
2018-12-14 04:53:54 +00:00
2021-05-19 15:09:27 +00:00
if ( ! post ) {
return null ;
2021-01-28 02:04:13 +00:00
}
2018-12-14 04:53:54 +00:00
2021-11-08 14:29:21 +00:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "StrictMode" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _keyboardShortcuts _ [ "ShortcutProvider" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( edit _post _settings . Provider , {
2021-05-19 15:09:27 +00:00
value : settings
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "SlotFillProvider" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "EditorProvider" ] , Object ( esm _extends [ "a" /* default */ ] ) ( {
settings : editorSettings ,
post : post ,
initialEdits : initialEdits ,
useSubRegistry : false ,
_ _unstableTemplate : isTemplateMode ? template : undefined
} , props ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "ErrorBoundary" ] , {
onError : onError
} , Object ( external _wp _element _ [ "createElement" ] ) ( EditorInitialization , {
postId : postId
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( components _layout , {
styles : styles
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "KeyboardShortcuts" ] , {
shortcuts : prevent _event _discovery
2021-11-08 14:29:21 +00:00
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editor _ [ "PostLockedModal" ] , null ) ) ) ) ) ) ;
2021-05-19 15:09:27 +00:00
}
2018-12-14 04:53:54 +00:00
2021-05-19 15:09:27 +00:00
/* harmony default export */ var editor = ( Editor ) ;
2018-12-14 04:53:54 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js
2018-12-14 04:53:54 +00:00
2020-01-22 22:06:21 +00:00
/ * *
2021-01-28 02:04:13 +00:00
* External dependencies
2020-01-22 22:06:21 +00:00
* /
2018-12-14 04:53:54 +00:00
2020-01-22 22:06:21 +00:00
/ * *
2021-01-28 02:04:13 +00:00
* WordPress dependencies
2020-01-22 22:06:21 +00:00
* /
2018-12-14 04:53:54 +00:00
2019-03-07 09:09:59 +00:00
2021-05-19 15:09:27 +00:00
const isEverySelectedBlockAllowed = ( selected , allowed ) => Object ( external _lodash _ [ "difference" ] ) ( selected , allowed ) . length === 0 ;
/ * *
* Plugins may want to add an item to the menu either for every block
* or only for the specific ones provided in the ` allowedBlocks ` component property .
*
* If there are multiple blocks selected the item will be rendered if every block
* is of one allowed type ( not necessarily the same ) .
*
* @ param { string [ ] } selectedBlocks Array containing the names of the blocks selected
2021-11-08 14:29:21 +00:00
* @ param { string [ ] } allowedBlocks Array containing the names of the blocks allowed
2021-05-19 15:09:27 +00:00
* @ return { boolean } Whether the item will be rendered or not .
* /
2021-04-15 15:19:43 +00:00
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
const shouldRenderItem = ( selectedBlocks , allowedBlocks ) => ! Array . isArray ( allowedBlocks ) || isEverySelectedBlockAllowed ( selectedBlocks , allowedBlocks ) ;
/ * *
* Renders a new item in the block settings menu .
*
* @ param { Object } props Component props .
* @ param { Array } [ props . allowedBlocks ] An array containing a list of block names for which the item should be shown . If not present , it 'll be rendered for any block. If multiple blocks are selected, it' ll be shown if and only if all of them are in the allowed list .
* @ param { WPBlockTypeIconRender } [ props . icon ] The [ Dashicon ] ( https : //developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element.
* @ param { string } props . label The menu item text .
* @ param { Function } props . onClick Callback function to be executed when the user click the menu item .
* @ param { boolean } [ props . small ] Whether to render the label or not .
* @ param { string } [ props . role ] The ARIA role for the menu item .
*
* @ example
* ` ` ` js
* // Using ES5 syntax
* var _ _ = wp . i18n . _ _ ;
* var PluginBlockSettingsMenuItem = wp . editPost . PluginBlockSettingsMenuItem ;
*
* function doOnClick ( ) {
* // To be called when the user clicks the menu item.
* }
*
* function MyPluginBlockSettingsMenuItem ( ) {
* return wp . element . createElement (
* PluginBlockSettingsMenuItem ,
* {
* allowedBlocks : [ 'core/paragraph' ] ,
* icon : 'dashicon-name' ,
* label : _ _ ( 'Menu item text' ) ,
* onClick : doOnClick ,
* }
* ) ;
* }
* ` ` `
*
* @ example
* ` ` ` jsx
* // Using ESNext syntax
* import { _ _ } from '@wordpress/i18n' ;
* import { PluginBlockSettingsMenuItem } from '@wordpress/edit-post' ;
*
* const doOnClick = ( ) => {
* // To be called when the user clicks the menu item.
* } ;
*
* const MyPluginBlockSettingsMenuItem = ( ) => (
* < PluginBlockSettingsMenuItem
* allowedBlocks = { [ 'core/paragraph' ] }
* icon = 'dashicon-name'
* label = { _ _ ( 'Menu item text' ) }
* onClick = { doOnClick } / >
* ) ;
* ` ` `
*
* @ return { WPComponent } The component to be rendered .
* /
2018-12-14 04:41:57 +00:00
2021-11-15 12:50:17 +00:00
const PluginBlockSettingsMenuItem = _ref => {
let {
allowedBlocks ,
icon ,
label ,
onClick ,
small ,
role
} = _ref ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "BlockSettingsMenuControls" ] , null , _ref2 => {
let {
selectedBlocks ,
onClose
} = _ref2 ;
2018-12-14 04:41:57 +00:00
2021-11-15 12:50:17 +00:00
if ( ! shouldRenderItem ( selectedBlocks , allowedBlocks ) ) {
return null ;
}
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "MenuItem" ] , {
onClick : Object ( external _wp _compose _ [ "compose" ] ) ( onClick , onClose ) ,
icon : icon ,
label : small ? label : undefined ,
role : role
} , ! small && label ) ;
} ) ;
} ;
2018-12-14 04:41:57 +00:00
2021-05-19 15:09:27 +00:00
/* harmony default export */ var plugin _block _settings _menu _item = ( PluginBlockSettingsMenuItem ) ;
2020-01-22 22:06:21 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/plugin-more-menu-item/index.js
/ * *
* WordPress dependencies
* /
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* Renders a menu item in ` Plugins ` group in ` More Menu ` drop down , and can be used to as a button or link depending on the props provided .
* The text within the component appears as the menu item label .
*
2021-11-08 14:29:21 +00:00
* @ param { Object } props Component properties .
* @ param { string } [ props . href ] When ` href ` is provided then the menu item is represented as an anchor rather than button . It corresponds to the ` href ` attribute of the anchor .
2021-05-19 15:09:27 +00:00
* @ param { WPBlockTypeIconRender } [ props . icon = inherits from the plugin ] The [ Dashicon ] ( https : //developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered to the left of the menu item label.
2021-11-08 14:29:21 +00:00
* @ 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 [ MenuItem ] ( / p a c k a g e s / c o m p o n e n t s / s r c / m e n u - i t e m / R E A D M E . m d ) c o m p o n e n t .
2021-05-19 15:09:27 +00:00
*
* @ example
* ` ` ` js
* // Using ES5 syntax
* var _ _ = wp . i18n . _ _ ;
* var PluginMoreMenuItem = wp . editPost . PluginMoreMenuItem ;
* var moreIcon = wp . element . createElement ( 'svg' ) ; //... svg element.
*
* function onButtonClick ( ) {
* alert ( 'Button clicked.' ) ;
* }
*
* function MyButtonMoreMenuItem ( ) {
* return wp . element . createElement (
* PluginMoreMenuItem ,
* {
* icon : moreIcon ,
* onClick : onButtonClick ,
* } ,
* _ _ ( 'My button title' )
* ) ;
* }
* ` ` `
*
* @ example
* ` ` ` jsx
* // Using ESNext syntax
* import { _ _ } from '@wordpress/i18n' ;
* import { PluginMoreMenuItem } from '@wordpress/edit-post' ;
* import { more } from '@wordpress/icons' ;
*
* function onButtonClick ( ) {
* alert ( 'Button clicked.' ) ;
* }
*
* const MyButtonMoreMenuItem = ( ) => (
* < PluginMoreMenuItem
* icon = { more }
* onClick = { onButtonClick }
* >
* { _ _ ( 'My button title' ) }
* < / P l u g i n M o r e M e n u I t e m >
* ) ;
* ` ` `
*
* @ return { WPComponent } The component to be rendered .
* /
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
/* 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-post/plugin-more-menu'
} ;
} ) ) ( build _module [ "a" /* ActionItem */ ] ) ) ;
2020-01-22 22:06:21 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/plugin-sidebar-more-menu-item/index.js
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* WordPress dependencies
* /
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* Renders a menu item in ` Plugins ` group in ` More Menu ` drop down ,
* and can be used to activate the corresponding ` PluginSidebar ` component .
* The text within the component appears as the menu item label .
*
2021-11-08 14:29:21 +00:00
* @ param { Object } props Component props .
* @ param { string } props . target A string identifying the target sidebar you wish to be activated by this menu item . Must be the same as the ` name ` prop you have given to that sidebar .
2021-05-19 15:09:27 +00:00
* @ param { WPBlockTypeIconRender } [ props . icon = inherits from the plugin ] The [ Dashicon ] ( https : //developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered to the left of the menu item label.
*
* @ example
* ` ` ` js
* // Using ES5 syntax
* var _ _ = wp . i18n . _ _ ;
* var PluginSidebarMoreMenuItem = wp . editPost . PluginSidebarMoreMenuItem ;
* var moreIcon = wp . element . createElement ( 'svg' ) ; //... svg element.
*
* function MySidebarMoreMenuItem ( ) {
* return wp . element . createElement (
* PluginSidebarMoreMenuItem ,
* {
* target : 'my-sidebar' ,
* icon : moreIcon ,
* } ,
* _ _ ( 'My sidebar title' )
* )
* }
* ` ` `
*
* @ example
* ` ` ` jsx
* // Using ESNext syntax
* import { _ _ } from '@wordpress/i18n' ;
* import { PluginSidebarMoreMenuItem } from '@wordpress/edit-post' ;
* import { more } from '@wordpress/icons' ;
*
* const MySidebarMoreMenuItem = ( ) => (
* < PluginSidebarMoreMenuItem
* target = "my-sidebar"
* icon = { more }
* >
* { _ _ ( 'My sidebar title' ) }
* < / P l u g i n S i d e b a r M o r e M e n u I t e m >
* ) ;
* ` ` `
*
* @ return { WPComponent } The component to be rendered .
* /
2020-01-22 22:06:21 +00:00
2021-05-19 15:09:27 +00:00
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-post"
} , props ) ) ;
}
2020-01-22 22:06:21 +00:00
2021-05-19 15:09:27 +00:00
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/index.js
2020-01-22 22:06:21 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* WordPress dependencies
* /
2021-01-28 02:04:13 +00:00
2020-01-22 22:06:21 +00:00
2021-05-07 11:48:27 +00:00
2022-01-04 05:39:28 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* Internal dependencies
* /
2021-05-07 11:48:27 +00:00
2022-01-04 05:39:28 +00:00
2021-05-19 15:09:27 +00:00
/ * *
* Reinitializes the editor after the user chooses to reboot the editor after
* an unhandled error occurs , replacing previously mounted editor element using
* an initial state from prior to the crash .
*
* @ param { Object } postType Post type of the post to edit .
* @ param { Object } postId ID of the post to edit .
* @ param { Element } target DOM node in which editor is rendered .
* @ param { ? Object } settings Editor settings object .
* @ param { Object } initialEdits Programmatic edits to apply initially , to be
* considered as non - user - initiated ( bypass for
* unsaved changes prompt ) .
* /
2020-01-22 22:06:21 +00:00
2021-05-19 15:09:27 +00:00
function reinitializeEditor ( postType , postId , target , settings , initialEdits ) {
Object ( external _wp _element _ [ "unmountComponentAtNode" ] ) ( target ) ;
const reboot = reinitializeEditor . bind ( null , postType , postId , target , settings , initialEdits ) ;
Object ( external _wp _element _ [ "render" ] ) ( Object ( external _wp _element _ [ "createElement" ] ) ( editor , {
settings : settings ,
onError : reboot ,
postId : postId ,
postType : postType ,
initialEdits : initialEdits ,
recovery : true
} ) , target ) ;
}
/ * *
* Initializes and returns an instance of Editor .
*
* @ param { string } id Unique identifier for editor instance .
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 19:08:24 +00:00
* @ param { string } postType Post type of the post to edit .
2021-05-19 15:09:27 +00:00
* @ param { Object } postId ID of the post to edit .
* @ param { ? Object } settings Editor settings object .
* @ param { Object } initialEdits Programmatic edits to apply initially , to be
* considered as non - user - initiated ( bypass for
* unsaved changes prompt ) .
* /
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
function initializeEditor ( id , postType , postId , settings , initialEdits ) {
2022-01-04 05:39:28 +00:00
// Prevent adding template part in the post editor.
// Only add the filter when the post editor is initialized, not imported.
Object ( external _wp _hooks _ [ "addFilter" ] ) ( 'blockEditor.__unstableCanInsertBlockType' , 'removeTemplatePartsFromInserter' , ( can , blockType ) => {
if ( ! Object ( external _wp _data _ [ "select" ] ) ( store [ "a" /* store */ ] ) . isEditingTemplate ( ) && blockType . name === 'core/template-part' ) {
return false ;
}
return can ;
} ) ;
2021-05-19 15:09:27 +00:00
const target = document . getElementById ( id ) ;
const reboot = reinitializeEditor . bind ( null , postType , postId , target , settings , initialEdits ) ;
2021-11-08 14:29:21 +00:00
Object ( external _wp _data _ [ "dispatch" ] ) ( build _module [ "i" /* store */ ] ) . setFeatureDefaults ( 'core/edit-post' , {
fixedToolbar : false ,
welcomeGuide : true ,
fullscreenMode : true ,
showIconLabels : false ,
themeStyles : true ,
showBlockBreadcrumbs : true ,
welcomeGuideTemplate : true
} ) ;
Object ( external _wp _data _ [ "dispatch" ] ) ( external _wp _blocks _ [ "store" ] ) . _ _experimentalReapplyBlockTypeFilters ( ) ;
2021-05-19 15:09:27 +00:00
Object ( external _wp _blockLibrary _ [ "registerCoreBlocks" ] ) ( ) ;
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
if ( false ) { } // Show a console log warning if the browser is not in Standards rendering mode.
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
const documentMode = document . compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks' ;
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
if ( documentMode !== 'Standards' ) {
// eslint-disable-next-line no-console
console . warn ( "Your browser is using Quirks Mode. \nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins." ) ;
} // This is a temporary fix for a couple of issues specific to Webkit on iOS.
// Without this hack the browser scrolls the mobile toolbar off-screen.
// Once supported in Safari we can replace this in favor of preventScroll.
// For details see issue #18632 and PR #18686
// Specifically, we scroll `interface-interface-skeleton__body` to enable a fixed top toolbar.
// But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar.
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
const isIphone = window . navigator . userAgent . indexOf ( 'iPhone' ) !== - 1 ;
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
if ( isIphone ) {
window . addEventListener ( 'scroll' , event => {
const editorScrollContainer = document . getElementsByClassName ( 'interface-interface-skeleton__body' ) [ 0 ] ;
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
if ( event . target === document ) {
// Scroll element into view by scrolling the editor container by the same amount
// that Mobile Safari tried to scroll the html element upwards.
if ( window . scrollY > 100 ) {
editorScrollContainer . scrollTop = editorScrollContainer . scrollTop + window . scrollY ;
} // Undo unwanted scroll on html element, but only in the visual editor.
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
if ( document . getElementsByClassName ( 'is-mode-visual' ) [ 0 ] ) {
window . scrollTo ( 0 , 0 ) ;
}
}
} ) ;
}
2021-01-28 02:04:13 +00:00
2021-05-19 15:09:27 +00:00
Object ( external _wp _element _ [ "render" ] ) ( Object ( external _wp _element _ [ "createElement" ] ) ( editor , {
settings : settings ,
onError : reboot ,
postId : postId ,
postType : postType ,
initialEdits : initialEdits
} ) , target ) ;
2021-01-28 02:04:13 +00:00
}
2020-10-20 13:36:16 +00:00
2020-03-23 23:40:19 +00:00
2020-06-26 13:33:47 +00:00
2021-01-28 02:04:13 +00:00
2020-06-26 13:33:47 +00:00
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 19:08:24 +00:00
2021-05-19 15:09:27 +00:00
/***/ } ) ,
2020-06-26 13:33:47 +00:00
2021-05-20 12:20:04 +00:00
/***/ "g56x" :
2021-05-19 15:09:27 +00:00
/***/ ( function ( module , exports ) {
2020-06-26 13:33:47 +00:00
2021-05-20 12:20:04 +00:00
( function ( ) { module . exports = window [ "wp" ] [ "hooks" ] ; } ( ) ) ;
2020-06-26 13:33:47 +00:00
2021-05-19 15:09:27 +00:00
/***/ } ) ,
2020-06-26 13:33:47 +00:00
2021-05-20 12:20:04 +00:00
/***/ "gdqT" :
2021-05-19 15:09:27 +00:00
/***/ ( function ( module , exports ) {
2020-06-26 13:33:47 +00:00
2021-05-20 12:20:04 +00:00
( 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 12:50:17 +00:00
function Icon ( _ref ) {
let {
icon ,
size = 24 ,
... props
} = _ref ;
2021-05-20 12:20:04 +00: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 ) ;
}
2020-06-26 13:33:47 +00:00
2021-05-20 12:20:04 +00:00
return caches . get ( LEAF _KEY ) ;
}
2020-06-26 13:33:47 +00:00
2021-05-20 12:20:04 +00:00
// Assign cache handler by availability of WeakMap
getCache = hasWeakMap ? getWeakMapCache : getRootCache ;
2020-06-26 13:33:47 +00:00
2021-05-20 12:20:04 +00:00
/ * *
* Resets root memoization cache .
* /
function clear ( ) {
rootCache = hasWeakMap ? new WeakMap ( ) : createCache ( ) ;
}
2020-06-26 13:33:47 +00:00
2021-05-20 12:20:04 +00:00
// eslint-disable-next-line jsdoc/check-param-names
/ * *
* The augmented selector call , considering first whether dependants have
* changed before passing it to underlying memoize function .
*
* @ param { Object } source Source object for derivation .
* @ param { ... * } extraArgs Additional arguments to pass to selector .
*
* @ return { * } Selector result .
* /
function callSelector ( /* source, ...extraArgs */ ) {
var len = arguments . length ,
cache , node , i , args , dependants ;
2020-06-26 13:33:47 +00:00
2021-05-20 12:20:04 +00:00
// Create copy of arguments (avoid leaking deoptimization).
args = new Array ( len ) ;
for ( i = 0 ; i < len ; i ++ ) {
args [ i ] = arguments [ i ] ;
}
2021-01-28 02:04:13 +00:00
2021-05-20 12:20:04 +00:00
dependants = getDependants . apply ( null , args ) ;
cache = getCache ( dependants ) ;
2020-06-26 13:33:47 +00:00
2021-05-20 12:20:04 +00:00
// If not guaranteed uniqueness by dependants (primitive type or lack
// of WeakMap support), shallow compare against last dependants and, if
// references have changed, destroy cache to recalculate result.
if ( ! cache . isUniqueByDependants ) {
if ( cache . lastDependants && ! isShallowEqual ( dependants , cache . lastDependants , 0 ) ) {
cache . clear ( ) ;
}
2020-06-26 13:33:47 +00:00
2021-05-20 12:20:04 +00:00
cache . lastDependants = dependants ;
}
2020-07-21 12:14:37 +00:00
2021-05-20 12:20:04 +00:00
node = cache . head ;
while ( node ) {
// Check whether node arguments match arguments
if ( ! isShallowEqual ( node . args , args , 1 ) ) {
node = node . next ;
continue ;
}
2019-03-07 09:09:59 +00:00
2021-05-20 12:20:04 +00:00
// At this point we can assume we've found a match
2019-03-07 09:09:59 +00:00
2021-05-20 12:20:04 +00:00
// Surface matched node to head if not already
if ( node !== cache . head ) {
// Adjust siblings to point to each other.
node . prev . next = node . next ;
if ( node . next ) {
node . next . prev = node . prev ;
}
2020-03-10 14:53:18 +00:00
2021-05-20 12:20:04 +00:00
node . next = cache . head ;
node . prev = null ;
cache . head . prev = node ;
cache . head = node ;
}
2020-03-10 14:53:18 +00:00
2021-05-20 12:20:04 +00:00
// Return immediately
return node . val ;
}
2020-03-10 14:53:18 +00:00
2021-05-20 12:20:04 +00:00
// No cached value found. Continue to insertion phase:
2020-03-10 14:53:18 +00:00
2021-05-20 12:20:04 +00:00
node = {
// Generate the result from original function
val : selector . apply ( null , args ) ,
} ;
2020-03-10 14:53:18 +00:00
2021-05-20 12:20:04 +00:00
// Avoid including the source object in the cache.
args [ 0 ] = null ;
node . args = args ;
2019-03-07 09:09:59 +00:00
2021-05-20 12:20:04 +00:00
// Don't need to check whether node is already head, since it would
// have been returned above already if it was
2019-03-07 09:09:59 +00:00
2021-05-20 12:20:04 +00:00
// Shift existing head down list
if ( cache . head ) {
cache . head . prev = node ;
node . next = cache . head ;
2021-05-19 15:09:27 +00:00
}
2019-03-07 09:09:59 +00:00
2021-05-20 12:20:04 +00:00
cache . head = node ;
return node . val ;
2021-05-19 15:09:27 +00:00
}
2019-03-07 09:09:59 +00:00
2021-05-20 12:20:04 +00:00
callSelector . getDependants = getDependants ;
callSelector . clear = clear ;
clear ( ) ;
return callSelector ;
} ) ;
2019-03-07 09:09:59 +00:00
2021-05-19 15:09:27 +00:00
/***/ } ) ,
2019-03-07 09:09:59 +00:00
2021-05-20 12:20:04 +00:00
/***/ "tI+e" :
2021-05-19 15:09:27 +00:00
/***/ ( function ( module , exports ) {
2019-03-07 09:09:59 +00:00
2021-05-20 12:20:04 +00:00
( function ( ) { module . exports = window [ "wp" ] [ "components" ] ; } ( ) ) ;
2019-03-07 09:09:59 +00:00
2021-05-20 12:20:04 +00:00
/***/ } ) ,
2019-03-07 09:09:59 +00:00
2021-05-20 12:20:04 +00:00
/***/ "w95h" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2019-03-07 09:09:59 +00:00
2021-05-20 12:20:04 +00:00
"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 _ _ ) ;
2019-03-07 09:09:59 +00:00
2021-05-20 12:20:04 +00:00
/ * *
* 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 ) ;
2019-03-07 09:09:59 +00:00
2021-05-20 12:20:04 +00:00
/***/ } ) ,
2018-12-14 04:41:57 +00:00
2021-05-20 12:20:04 +00:00
/***/ "wduq" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2018-12-14 04:41:57 +00:00
2021-05-20 12:20:04 +00:00
"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 _ _ ) ;
2019-10-15 15:37:08 +00:00
2020-03-10 14:53:18 +00:00
2021-05-20 12:20:04 +00:00
/ * *
* WordPress dependencies
* /
2020-03-10 14:53:18 +00:00
2021-05-20 12:20:04 +00:00
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 ) ;
2018-12-14 04:41:57 +00:00
2021-05-20 12:20:04 +00:00
/***/ } ) ,
2019-09-19 15:19:18 +00:00
2021-05-20 12:20:04 +00:00
/***/ "wx14" :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2019-09-19 15:19:18 +00:00
2021-05-20 12:20:04 +00:00
"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 ] ;
2019-09-19 15:19:18 +00:00
2021-05-20 12:20:04 +00:00
for ( var key in source ) {
if ( Object . prototype . hasOwnProperty . call ( source , key ) ) {
target [ key ] = source [ key ] ;
}
}
}
2021-02-02 05:17:13 +00:00
2021-05-20 12:20:04 +00:00
return target ;
} ;
2020-01-22 22:06:21 +00:00
2021-05-20 12:20:04 +00:00
return _extends . apply ( this , arguments ) ;
}
2020-01-22 22:06:21 +00:00
/***/ } ) ,
2021-05-20 12:20:04 +00:00
/***/ "xrib" :
2020-01-22 22:06:21 +00:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
2021-05-20 12:20:04 +00:00
/* WEBPACK VAR INJECTION */ ( function ( process ) { /* unused harmony export Fill */
/* unused harmony export Slot */
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( "GRId" ) ;
2021-05-19 15:09:27 +00:00
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
2021-05-20 12:20:04 +00:00
/* harmony import */ var _wordpress _components _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( "tI+e" ) ;
/* harmony import */ var _wordpress _components _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _components _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
/* harmony import */ var _wordpress _compose _ _WEBPACK _IMPORTED _MODULE _2 _ _ = _ _webpack _require _ _ ( "K9lf" ) ;
/* harmony import */ var _wordpress _compose _ _WEBPACK _IMPORTED _MODULE _2 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _compose _ _WEBPACK _IMPORTED _MODULE _2 _ _ ) ;
/* harmony import */ var _wordpress _plugins _ _WEBPACK _IMPORTED _MODULE _3 _ _ = _ _webpack _require _ _ ( "TvNi" ) ;
/* harmony import */ var _wordpress _plugins _ _WEBPACK _IMPORTED _MODULE _3 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _plugins _ _WEBPACK _IMPORTED _MODULE _3 _ _ ) ;
/* harmony import */ var _wordpress _data _ _WEBPACK _IMPORTED _MODULE _4 _ _ = _ _webpack _require _ _ ( "1ZqX" ) ;
/* harmony import */ var _wordpress _data _ _WEBPACK _IMPORTED _MODULE _4 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _data _ _WEBPACK _IMPORTED _MODULE _4 _ _ ) ;
/* harmony import */ var _wordpress _warning _ _WEBPACK _IMPORTED _MODULE _5 _ _ = _ _webpack _require _ _ ( "Z23Y" ) ;
/* harmony import */ var _wordpress _warning _ _WEBPACK _IMPORTED _MODULE _5 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _warning _ _WEBPACK _IMPORTED _MODULE _5 _ _ ) ;
/* harmony import */ var _preferences _modal _options _ _WEBPACK _IMPORTED _MODULE _6 _ _ = _ _webpack _require _ _ ( "Y5n4" ) ;
/* harmony import */ var _store _ _WEBPACK _IMPORTED _MODULE _7 _ _ = _ _webpack _require _ _ ( "T40v" ) ;
/ * *
* Defines as extensibility slot for the Settings sidebar
* /
2021-05-19 15:09:27 +00:00
/ * *
* WordPress dependencies
* /
2020-02-06 21:03:31 +00:00
2021-05-20 12:20:04 +00:00
2020-02-06 21:03:31 +00:00
2021-05-19 15:09:27 +00:00
/ * *
2021-05-20 12:20:04 +00:00
* Internal dependencies
* /
const {
Fill ,
Slot
} = Object ( _wordpress _components _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "createSlotFill" ] ) ( 'PluginDocumentSettingPanel' ) ;
2021-11-15 12:50:17 +00:00
const PluginDocumentSettingFill = _ref => {
let {
isEnabled ,
panelName ,
opened ,
onToggle ,
className ,
title ,
icon ,
children
} = _ref ;
2021-05-20 12:20:04 +00:00
return Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "Fragment" ] , null , Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _preferences _modal _options _ _WEBPACK _IMPORTED _MODULE _6 _ _ [ /* EnablePluginDocumentSettingPanelOption */ "d" ] , {
label : title ,
panelName : panelName
} ) , Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( Fill , null , isEnabled && Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _components _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "PanelBody" ] , {
className : className ,
title : title ,
icon : icon ,
opened : opened ,
onToggle : onToggle
} , children ) ) ) ;
} ;
/ * *
* Renders items below the Status & Availability panel in the Document Sidebar .
2021-05-19 15:09:27 +00:00
*
2021-11-08 14:29:21 +00:00
* @ param { Object } props Component properties .
* @ param { string } [ props . name ] The machine - friendly name for the panel .
* @ param { string } [ props . className ] An optional class name added to the row .
* @ param { string } [ props . title ] The title of the panel
2021-05-20 12:20:04 +00:00
* @ param { WPBlockTypeIconRender } [ props . icon = inherits from the plugin ] The [ Dashicon ] ( https : //developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.
2021-05-19 15:09:27 +00:00
*
2021-05-20 12:20:04 +00:00
* @ example
* ` ` ` js
* // Using ES5 syntax
* var el = wp . element . createElement ;
* var _ _ = wp . i18n . _ _ ;
* var registerPlugin = wp . plugins . registerPlugin ;
* var PluginDocumentSettingPanel = wp . editPost . PluginDocumentSettingPanel ;
*
* function MyDocumentSettingPlugin ( ) {
* return el (
* PluginDocumentSettingPanel ,
* {
* className : 'my-document-setting-plugin' ,
* title : 'My Panel' ,
* } ,
* _ _ ( 'My Document Setting Panel' )
* ) ;
* }
*
* registerPlugin ( 'my-document-setting-plugin' , {
* render : MyDocumentSettingPlugin
* } ) ;
* ` ` `
*
* @ example
* ` ` ` jsx
* // Using ESNext syntax
* import { registerPlugin } from '@wordpress/plugins' ;
* import { PluginDocumentSettingPanel } from '@wordpress/edit-post' ;
*
* const MyDocumentSettingTest = ( ) => (
* < PluginDocumentSettingPanel className = "my-document-setting-plugin" title = "My Panel" >
* < p > My Document Setting Panel < / p >
* < / P l u g i n D o c u m e n t S e t t i n g P a n e l >
* ) ;
*
* registerPlugin ( 'document-setting-test' , { render : MyDocumentSettingTest } ) ;
* ` ` `
*
* @ return { WPComponent } The component to be rendered .
2021-05-19 15:09:27 +00:00
* /
2020-02-06 21:03:31 +00:00
2021-05-20 12:20:04 +00:00
const PluginDocumentSettingPanel = Object ( _wordpress _compose _ _WEBPACK _IMPORTED _MODULE _2 _ _ [ "compose" ] ) ( Object ( _wordpress _plugins _ _WEBPACK _IMPORTED _MODULE _3 _ _ [ "withPluginContext" ] ) ( ( context , ownProps ) => {
if ( undefined === ownProps . name ) {
typeof process !== "undefined" && process . env && "production" !== "production" ? _wordpress _warning _ _WEBPACK _IMPORTED _MODULE _5 _ _ _default ( ) ( 'PluginDocumentSettingPanel requires a name property.' ) : void 0 ;
}
return {
icon : ownProps . icon || context . icon ,
panelName : ` ${ context . name } / ${ ownProps . name } `
} ;
2021-11-15 12:50:17 +00:00
} ) , Object ( _wordpress _data _ _WEBPACK _IMPORTED _MODULE _4 _ _ [ "withSelect" ] ) ( ( select , _ref2 ) => {
let {
panelName
} = _ref2 ;
2021-05-20 12:20:04 +00:00
return {
opened : select ( _store _ _WEBPACK _IMPORTED _MODULE _7 _ _ [ /* store */ "a" ] ) . isEditorPanelOpened ( panelName ) ,
isEnabled : select ( _store _ _WEBPACK _IMPORTED _MODULE _7 _ _ [ /* store */ "a" ] ) . isEditorPanelEnabled ( panelName )
} ;
2021-11-15 12:50:17 +00:00
} ) , Object ( _wordpress _data _ _WEBPACK _IMPORTED _MODULE _4 _ _ [ "withDispatch" ] ) ( ( dispatch , _ref3 ) => {
let {
panelName
} = _ref3 ;
return {
onToggle ( ) {
return dispatch ( _store _ _WEBPACK _IMPORTED _MODULE _7 _ _ [ /* store */ "a" ] ) . toggleEditorPanelOpened ( panelName ) ;
}
2021-05-20 12:20:04 +00:00
2021-11-15 12:50:17 +00:00
} ;
} ) ) ( PluginDocumentSettingFill ) ;
2021-05-20 12:20:04 +00:00
PluginDocumentSettingPanel . Slot = Slot ;
/* harmony default export */ _ _webpack _exports _ _ [ "a" ] = ( PluginDocumentSettingPanel ) ;
2020-07-07 14:43:35 +00:00
2021-05-20 12:20:04 +00:00
/* WEBPACK VAR INJECTION */ } . call ( this , _ _webpack _require _ _ ( "8oxB" ) ) )
2020-07-07 14:43:35 +00:00
2018-12-14 04:41:57 +00:00
/***/ } )
2018-12-18 03:14:52 +00:00
/******/ } ) ;