2022-04-11 14:04:30 +02:00
/******/ ( function ( ) { // webpackBootstrap
/******/ var _ _webpack _modules _ _ = ( {
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 21:08:24 +02:00
2022-04-11 14:04:30 +02:00
/***/ 4403 :
2021-05-25 10:40:25 +02:00
/***/ ( function ( module , exports ) {
2022-04-11 14:04:30 +02: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 */
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
( function ( ) {
'use strict' ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
var hasOwn = { } . hasOwnProperty ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
function classNames ( ) {
var classes = [ ] ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
for ( var i = 0 ; i < arguments . length ; i ++ ) {
var arg = arguments [ i ] ;
if ( ! arg ) continue ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
var argType = typeof arg ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02: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 ( ) ) ;
}
}
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
return classes . join ( ' ' ) ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02: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 { }
} ( ) ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
/***/ } )
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
/******/ } ) ;
/************************************************************************/
/******/ // The module cache
/******/ var _ _webpack _module _cache _ _ = { } ;
/******/
/******/ // The require function
/******/ function _ _webpack _require _ _ ( moduleId ) {
/******/ // Check if module is in cache
/******/ var cachedModule = _ _webpack _module _cache _ _ [ moduleId ] ;
/******/ if ( cachedModule !== undefined ) {
/******/ return cachedModule . exports ;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = _ _webpack _module _cache _ _ [ moduleId ] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports : { }
/******/ } ;
/******/
/******/ // Execute the module function
/******/ _ _webpack _modules _ _ [ moduleId ] ( module , module . exports , _ _webpack _require _ _ ) ;
/******/
/******/ // Return the exports of the module
/******/ return module . exports ;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ ! function ( ) {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ _ _webpack _require _ _ . n = function ( module ) {
/******/ var getter = module && module . _ _esModule ?
/******/ function ( ) { return module [ 'default' ] ; } :
/******/ function ( ) { return module ; } ;
/******/ _ _webpack _require _ _ . d ( getter , { a : getter } ) ;
/******/ return getter ;
/******/ } ;
/******/ } ( ) ;
/******/
/******/ /* webpack/runtime/define property getters */
/******/ ! function ( ) {
/******/ // define getter functions for harmony exports
/******/ _ _webpack _require _ _ . d = function ( exports , definition ) {
/******/ for ( var key in definition ) {
/******/ if ( _ _webpack _require _ _ . o ( definition , key ) && ! _ _webpack _require _ _ . o ( exports , key ) ) {
/******/ Object . defineProperty ( exports , key , { enumerable : true , get : definition [ key ] } ) ;
/******/ }
/******/ }
/******/ } ;
/******/ } ( ) ;
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ ! function ( ) {
/******/ _ _webpack _require _ _ . o = function ( obj , prop ) { return Object . prototype . hasOwnProperty . call ( obj , prop ) ; }
/******/ } ( ) ;
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ ! function ( ) {
/******/ // define __esModule on exports
/******/ _ _webpack _require _ _ . r = function ( exports ) {
/******/ if ( typeof Symbol !== 'undefined' && Symbol . toStringTag ) {
/******/ Object . defineProperty ( exports , Symbol . toStringTag , { value : 'Module' } ) ;
/******/ }
/******/ Object . defineProperty ( exports , '__esModule' , { value : true } ) ;
/******/ } ;
/******/ } ( ) ;
/******/
/************************************************************************/
var _ _webpack _exports _ _ = { } ;
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
! function ( ) {
2021-05-25 10:40:25 +02:00
"use strict" ;
// ESM COMPAT FLAG
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
// EXPORTS
2022-04-11 14:04:30 +02:00
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , {
"initialize" : function ( ) { return /* binding */ initialize ; } ,
"reinitializeEditor" : function ( ) { return /* binding */ reinitializeEditor ; }
} ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
// NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/store/actions.js
2021-05-25 10:40:25 +02:00
var actions _namespaceObject = { } ;
_ _webpack _require _ _ . r ( actions _namespaceObject ) ;
2022-04-11 14:04:30 +02:00
_ _webpack _require _ _ . d ( actions _namespaceObject , {
"disableComplementaryArea" : function ( ) { return disableComplementaryArea ; } ,
"enableComplementaryArea" : function ( ) { return enableComplementaryArea ; } ,
"pinItem" : function ( ) { return pinItem ; } ,
"setFeatureDefaults" : function ( ) { return setFeatureDefaults ; } ,
"setFeatureValue" : function ( ) { return setFeatureValue ; } ,
"toggleFeature" : function ( ) { return toggleFeature ; } ,
"unpinItem" : function ( ) { return unpinItem ; }
} ) ;
// NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/store/selectors.js
var selectors _namespaceObject = { } ;
_ _webpack _require _ _ . r ( selectors _namespaceObject ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , {
"getActiveComplementaryArea" : function ( ) { return getActiveComplementaryArea ; } ,
"isFeatureActive" : function ( ) { return isFeatureActive ; } ,
"isItemPinned" : function ( ) { return isItemPinned ; }
} ) ;
// NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/store/actions.js
var store _actions _namespaceObject = { } ;
_ _webpack _require _ _ . r ( store _actions _namespaceObject ) ;
_ _webpack _require _ _ . d ( store _actions _namespaceObject , {
"closeGeneralSidebar" : function ( ) { return closeGeneralSidebar ; } ,
"moveBlockToWidgetArea" : function ( ) { return moveBlockToWidgetArea ; } ,
"persistStubPost" : function ( ) { return persistStubPost ; } ,
"saveEditedWidgetAreas" : function ( ) { return saveEditedWidgetAreas ; } ,
"saveWidgetArea" : function ( ) { return saveWidgetArea ; } ,
"saveWidgetAreas" : function ( ) { return saveWidgetAreas ; } ,
"setIsInserterOpened" : function ( ) { return setIsInserterOpened ; } ,
"setIsListViewOpened" : function ( ) { return setIsListViewOpened ; } ,
"setIsWidgetAreaOpen" : function ( ) { return setIsWidgetAreaOpen ; } ,
"setWidgetAreasOpenState" : function ( ) { return setWidgetAreasOpenState ; } ,
"setWidgetIdForClientId" : function ( ) { return setWidgetIdForClientId ; }
} ) ;
2021-05-25 10:40:25 +02:00
// NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/store/resolvers.js
var resolvers _namespaceObject = { } ;
_ _webpack _require _ _ . r ( resolvers _namespaceObject ) ;
2022-04-11 14:04:30 +02:00
_ _webpack _require _ _ . d ( resolvers _namespaceObject , {
"getWidgetAreas" : function ( ) { return getWidgetAreas ; } ,
"getWidgets" : function ( ) { return getWidgets ; }
} ) ;
2021-05-25 10:40:25 +02:00
// NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/store/selectors.js
2022-04-11 14:04:30 +02:00
var store _selectors _namespaceObject = { } ;
_ _webpack _require _ _ . r ( store _selectors _namespaceObject ) ;
_ _webpack _require _ _ . d ( store _selectors _namespaceObject , {
"__experimentalGetInsertionPoint" : function ( ) { return _ _experimentalGetInsertionPoint ; } ,
"canInsertBlockInWidgetArea" : function ( ) { return canInsertBlockInWidgetArea ; } ,
"getEditedWidgetAreas" : function ( ) { return getEditedWidgetAreas ; } ,
"getIsWidgetAreaOpen" : function ( ) { return getIsWidgetAreaOpen ; } ,
"getParentWidgetAreaBlock" : function ( ) { return getParentWidgetAreaBlock ; } ,
"getReferenceWidgetBlocks" : function ( ) { return getReferenceWidgetBlocks ; } ,
"getWidget" : function ( ) { return getWidget ; } ,
"getWidgetAreaForWidgetId" : function ( ) { return getWidgetAreaForWidgetId ; } ,
"getWidgetAreas" : function ( ) { return selectors _getWidgetAreas ; } ,
"getWidgets" : function ( ) { return selectors _getWidgets ; } ,
"isInserterOpened" : function ( ) { return isInserterOpened ; } ,
"isListViewOpened" : function ( ) { return isListViewOpened ; } ,
"isSavingWidgetAreas" : function ( ) { return isSavingWidgetAreas ; }
} ) ;
2021-05-25 10:40:25 +02:00
// NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/blocks/widget-area/index.js
var widget _area _namespaceObject = { } ;
_ _webpack _require _ _ . r ( widget _area _namespaceObject ) ;
2022-04-11 14:04:30 +02:00
_ _webpack _require _ _ . d ( widget _area _namespaceObject , {
"metadata" : function ( ) { return metadata ; } ,
"name" : function ( ) { return widget _area _name ; } ,
"settings" : function ( ) { return settings ; }
} ) ;
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: external ["wp","element"]
var external _wp _element _namespaceObject = window [ "wp" ] [ "element" ] ;
; // CONCATENATED MODULE: external ["wp","blocks"]
var external _wp _blocks _namespaceObject = window [ "wp" ] [ "blocks" ] ;
; // CONCATENATED MODULE: external ["wp","data"]
var external _wp _data _namespaceObject = window [ "wp" ] [ "data" ] ;
; // CONCATENATED MODULE: external ["wp","blockLibrary"]
var external _wp _blockLibrary _namespaceObject = window [ "wp" ] [ "blockLibrary" ] ;
; // CONCATENATED MODULE: external ["wp","coreData"]
var external _wp _coreData _namespaceObject = window [ "wp" ] [ "coreData" ] ;
; // CONCATENATED MODULE: external ["wp","widgets"]
var external _wp _widgets _namespaceObject = window [ "wp" ] [ "widgets" ] ;
2022-04-12 17:12:47 +02:00
; // CONCATENATED MODULE: external ["wp","preferences"]
var external _wp _preferences _namespaceObject = window [ "wp" ] [ "preferences" ] ;
; // CONCATENATED MODULE: external ["wp","apiFetch"]
var external _wp _apiFetch _namespaceObject = window [ "wp" ] [ "apiFetch" ] ;
var external _wp _apiFetch _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( external _wp _apiFetch _namespaceObject ) ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/store/reducer.js
/ * *
* WordPress dependencies
* /
/ * *
* Controls the open state of the widget areas .
*
* @ param { Object } state Redux state .
* @ param { Object } action Redux action .
*
* @ return { Array } Updated state .
* /
function widgetAreasOpenState ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
const {
type
} = action ;
switch ( type ) {
case 'SET_WIDGET_AREAS_OPEN_STATE' :
{
return action . widgetAreasOpenState ;
}
case 'SET_IS_WIDGET_AREA_OPEN' :
{
const {
clientId ,
isOpen
} = action ;
return { ... state ,
[ clientId ] : isOpen
} ;
}
default :
{
return state ;
}
}
}
/ * *
* Reducer to set the block inserter panel open or closed .
*
* 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 .
*
* @ param { Object } state Current state .
* @ param { Object } action Dispatched action .
* /
function blockInserterPanel ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : false ;
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
switch ( action . type ) {
case 'SET_IS_LIST_VIEW_OPENED' :
return action . isOpen ? false : state ;
case 'SET_IS_INSERTER_OPENED' :
return action . value ;
}
return state ;
}
/ * *
* Reducer to set the list view panel open or closed .
*
* Note : this reducer interacts with the inserter panel reducer
* to make sure that only one of the two panels is open at the same time .
*
* @ param { Object } state Current state .
* @ param { Object } action Dispatched action .
* /
function listViewPanel ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : false ;
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
switch ( action . type ) {
case 'SET_IS_INSERTER_OPENED' :
return action . value ? false : state ;
case 'SET_IS_LIST_VIEW_OPENED' :
return action . isOpen ;
}
return state ;
}
/* harmony default export */ var reducer = ( ( 0 , external _wp _data _namespaceObject . combineReducers ) ( {
blockInserterPanel ,
listViewPanel ,
widgetAreasOpenState
} ) ) ;
; // CONCATENATED MODULE: external ["wp","i18n"]
var external _wp _i18n _namespaceObject = window [ "wp" ] [ "i18n" ] ;
; // CONCATENATED MODULE: external ["wp","notices"]
var external _wp _notices _namespaceObject = window [ "wp" ] [ "notices" ] ;
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
function _extends ( ) {
_extends = Object . assign || function ( target ) {
for ( var i = 1 ; i < arguments . length ; i ++ ) {
var source = arguments [ i ] ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
for ( var key in source ) {
if ( Object . prototype . hasOwnProperty . call ( source , key ) ) {
target [ key ] = source [ key ] ;
}
}
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
return target ;
} ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
return _extends . apply ( this , arguments ) ;
}
// EXTERNAL MODULE: ./node_modules/classnames/index.js
var classnames = _ _webpack _require _ _ ( 4403 ) ;
var classnames _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( classnames ) ;
; // CONCATENATED MODULE: external ["wp","components"]
var external _wp _components _namespaceObject = window [ "wp" ] [ "components" ] ;
; // CONCATENATED MODULE: external ["wp","primitives"]
var external _wp _primitives _namespaceObject = window [ "wp" ] [ "primitives" ] ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/check.js
2021-11-08 15:29:21 +01:00
2021-05-25 10:40:25 +02:00
/ * *
* WordPress dependencies
* /
2022-04-11 14:04:30 +02:00
const check = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
d : "M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"
} ) ) ;
/* harmony default export */ var library _check = ( check ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/star-filled.js
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* WordPress dependencies
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
const starFilled = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
d : "M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"
} ) ) ;
/* harmony default export */ var star _filled = ( starFilled ) ;
2021-11-15 13:50:17 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/star-empty.js
2021-11-08 15:29:21 +01:00
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* WordPress dependencies
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
const starEmpty = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
fillRule : "evenodd" ,
d : "M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z" ,
clipRule : "evenodd"
2021-05-25 10:40:25 +02:00
} ) ) ;
2022-04-11 14:04:30 +02:00
/* harmony default export */ var star _empty = ( starEmpty ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: external ["wp","viewport"]
var external _wp _viewport _namespaceObject = window [ "wp" ] [ "viewport" ] ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close-small.js
2021-11-08 15:29:21 +01:00
/ * *
* WordPress dependencies
* /
2022-04-11 14:04:30 +02:00
const closeSmall = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
d : "M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"
} ) ) ;
/* harmony default export */ var close _small = ( closeSmall ) ;
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: external "lodash"
var external _lodash _namespaceObject = window [ "lodash" ] ;
2022-04-12 17:12:47 +02:00
; // CONCATENATED MODULE: external ["wp","deprecated"]
var external _wp _deprecated _namespaceObject = window [ "wp" ] [ "deprecated" ] ;
var external _wp _deprecated _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( external _wp _deprecated _namespaceObject ) ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/actions.js
2022-04-11 14:04:30 +02:00
/ * *
* WordPress dependencies
* /
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
/ * *
2022-04-12 17:12:47 +02:00
* Enable the complementary area .
2022-04-11 14:04:30 +02:00
*
2022-04-12 17:12:47 +02:00
* @ param { string } scope Complementary area scope .
* @ param { string } area Area identifier .
2022-04-11 14:04:30 +02:00
* /
2021-11-08 15:29:21 +01:00
2022-04-12 17:12:47 +02:00
const enableComplementaryArea = ( scope , area ) => _ref => {
2022-04-11 14:04:30 +02:00
let {
2022-04-12 17:12:47 +02:00
registry
} = _ref ;
2021-11-08 15:29:21 +01:00
2022-04-12 17:12:47 +02:00
// Return early if there's no area.
if ( ! area ) {
return ;
2021-11-08 15:29:21 +01:00
}
2022-04-12 17:12:47 +02:00
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . set ( scope , 'complementaryArea' , area ) ;
} ;
2021-11-08 15:29:21 +01:00
/ * *
2022-04-12 17:12:47 +02:00
* Disable the complementary area .
2022-04-11 14:04:30 +02:00
*
2022-04-12 17:12:47 +02:00
* @ param { string } scope Complementary area scope .
2021-11-08 15:29:21 +01:00
* /
2022-04-12 17:12:47 +02:00
const disableComplementaryArea = scope => _ref2 => {
2022-04-11 14:04:30 +02:00
let {
2022-04-12 17:12:47 +02:00
registry
} = _ref2 ;
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . set ( scope , 'complementaryArea' , null ) ;
} ;
2021-05-25 10:40:25 +02:00
/ * *
2022-04-12 17:12:47 +02:00
* Pins an item .
2021-05-25 10:40:25 +02:00
*
2022-04-12 17:12:47 +02:00
* @ param { string } scope Item scope .
* @ param { string } item Item identifier .
2022-04-11 14:04:30 +02:00
*
* @ return { Object } Action object .
2021-05-25 10:40:25 +02:00
* /
2022-04-12 17:12:47 +02:00
const pinItem = ( scope , item ) => _ref3 => {
let {
registry
} = _ref3 ;
2022-04-11 14:04:30 +02:00
2022-04-12 17:12:47 +02:00
// Return early if there's no item.
if ( ! item ) {
return ;
}
2021-05-25 10:40:25 +02:00
2022-04-12 17:12:47 +02:00
const pinnedItems = registry . select ( external _wp _preferences _namespaceObject . store ) . get ( scope , 'pinnedItems' ) ; // The item is already pinned, there's nothing to do.
2021-05-25 10:40:25 +02:00
2022-04-12 17:12:47 +02:00
if ( ( pinnedItems === null || pinnedItems === void 0 ? void 0 : pinnedItems [ item ] ) === true ) {
return ;
}
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . set ( scope , 'pinnedItems' , { ... pinnedItems ,
[ item ] : true
} ) ;
} ;
2021-05-25 10:40:25 +02:00
/ * *
2022-04-12 17:12:47 +02:00
* Unpins an item .
2021-05-25 10:40:25 +02:00
*
2022-04-12 17:12:47 +02:00
* @ param { string } scope Item scope .
* @ param { string } item Item identifier .
2021-05-25 10:40:25 +02:00
* /
2022-04-12 17:12:47 +02:00
const unpinItem = ( scope , item ) => _ref4 => {
let {
registry
} = _ref4 ;
2021-05-25 10:40:25 +02:00
2022-04-12 17:12:47 +02:00
// Return early if there's no item.
if ( ! item ) {
return ;
}
2021-05-25 10:40:25 +02:00
2022-04-12 17:12:47 +02:00
const pinnedItems = registry . select ( external _wp _preferences _namespaceObject . store ) . get ( scope , 'pinnedItems' ) ;
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . set ( scope , 'pinnedItems' , { ... pinnedItems ,
[ item ] : false
} ) ;
} ;
2022-04-11 14:04:30 +02:00
/ * *
* Returns an action object used in signalling that a feature should be toggled .
*
* @ param { string } scope The feature scope ( e . g . core / edit - post ) .
* @ param { string } featureName The feature name .
* /
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
function toggleFeature ( scope , featureName ) {
2022-04-12 17:12:47 +02:00
return function ( _ref5 ) {
2022-04-11 14:04:30 +02:00
let {
2022-04-12 17:12:47 +02:00
registry
} = _ref5 ;
external _wp _deprecated _default ( ) ( ` wp.dispatch( 'core/interface' ).toggleFeature ` , {
since : '6.0' ,
alternative : ` wp.dispatch( 'core/preferences' ).toggle `
} ) ;
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . toggle ( scope , featureName ) ;
2022-04-11 14:04:30 +02:00
} ;
}
/ * *
* Returns an action object used in signalling that a feature should be set to
* a true or false value
*
* @ param { string } scope The feature scope ( e . g . core / edit - post ) .
* @ param { string } featureName The feature name .
* @ param { boolean } value The value to set .
*
* @ return { Object } Action object .
* /
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
function setFeatureValue ( scope , featureName , value ) {
2022-04-12 17:12:47 +02:00
return function ( _ref6 ) {
let {
registry
} = _ref6 ;
external _wp _deprecated _default ( ) ( ` wp.dispatch( 'core/interface' ).setFeatureValue ` , {
since : '6.0' ,
alternative : ` wp.dispatch( 'core/preferences' ).set `
} ) ;
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . set ( scope , featureName , ! ! value ) ;
2022-04-11 14:04:30 +02:00
} ;
}
/ * *
* Returns an action object used in signalling that defaults should be set for features .
*
* @ param { string } scope The feature scope ( e . g . core / edit - post ) .
* @ param { Object < string , boolean > } defaults A key / value map of feature names to values .
*
* @ return { Object } Action object .
* /
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
function setFeatureDefaults ( scope , defaults ) {
2022-04-12 17:12:47 +02:00
return function ( _ref7 ) {
let {
registry
} = _ref7 ;
external _wp _deprecated _default ( ) ( ` wp.dispatch( 'core/interface' ).setFeatureDefaults ` , {
since : '6.0' ,
alternative : ` wp.dispatch( 'core/preferences' ).setDefaults `
} ) ;
registry . dispatch ( external _wp _preferences _namespaceObject . store ) . setDefaults ( scope , defaults ) ;
2022-04-11 14:04:30 +02:00
} ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/selectors.js
/ * *
2022-04-12 17:12:47 +02:00
* WordPress dependencies
2022-04-11 14:04:30 +02:00
* /
2021-05-25 10:40:25 +02:00
2022-04-12 17:12:47 +02:00
2022-04-11 14:04:30 +02:00
/ * *
* Returns the complementary area that is active in a given scope .
*
* @ param { Object } state Global application state .
* @ param { string } scope Item scope .
*
* @ return { string } The complementary area that is active in the given scope .
* /
2021-05-25 10:40:25 +02:00
2022-04-12 17:12:47 +02:00
const getActiveComplementaryArea = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( select => ( state , scope ) => {
return select ( external _wp _preferences _namespaceObject . store ) . get ( scope , 'complementaryArea' ) ;
} ) ;
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* Returns a boolean indicating if an item is pinned or not .
2021-05-25 10:40:25 +02:00
*
2022-04-11 14:04:30 +02:00
* @ param { Object } state Global application state .
* @ param { string } scope Scope .
* @ param { string } item Item to check .
*
* @ return { boolean } True if the item is pinned and false otherwise .
2021-05-25 10:40:25 +02:00
* /
2022-04-12 17:12:47 +02:00
const isItemPinned = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( select => ( state , scope , item ) => {
var _pinnedItems$item ;
2022-04-11 14:04:30 +02:00
2022-04-12 17:12:47 +02:00
const pinnedItems = select ( external _wp _preferences _namespaceObject . store ) . get ( scope , 'pinnedItems' ) ;
return ( _pinnedItems$item = pinnedItems === null || pinnedItems === void 0 ? void 0 : pinnedItems [ item ] ) !== null && _pinnedItems$item !== void 0 ? _pinnedItems$item : true ;
} ) ;
2021-11-08 15:29:21 +01:00
/ * *
2022-04-11 14:04:30 +02:00
* Returns a boolean indicating whether a feature is active for a particular
* scope .
2021-11-08 15:29:21 +01:00
*
2022-04-11 14:04:30 +02:00
* @ 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 .
2021-11-08 15:29:21 +01:00
*
2022-04-11 14:04:30 +02:00
* @ return { boolean } Is the feature enabled ?
2021-11-08 15:29:21 +01:00
* /
2022-04-12 17:12:47 +02:00
const isFeatureActive = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( select => ( state , scope , featureName ) => {
external _wp _deprecated _default ( ) ( ` wp.select( 'core/interface' ).isFeatureActive( scope, featureName ) ` , {
since : '6.0' ,
alternative : ` !! wp.select( 'core/preferences' ).isFeatureActive( scope, featureName ) `
} ) ;
return ! ! select ( external _wp _preferences _namespaceObject . store ) . get ( scope , featureName ) ;
} ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/constants.js
2021-11-08 15:29:21 +01:00
/ * *
2022-04-11 14:04:30 +02:00
* The identifier for the data store .
2021-11-08 15:29:21 +01:00
*
2022-04-11 14:04:30 +02:00
* @ type { string }
2021-11-08 15:29:21 +01:00
* /
2022-04-11 14:04:30 +02:00
const STORE _NAME = 'core/interface' ;
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/index.js
/ * *
* WordPress dependencies
* /
2021-11-15 13:50:17 +01:00
2021-11-08 15:29:21 +01:00
/ * *
2022-04-11 14:04:30 +02:00
* Internal dependencies
2021-11-08 15:29:21 +01:00
* /
2021-05-25 10:40:25 +02:00
2021-06-25 17:52:22 +02:00
2022-04-11 14:04:30 +02:00
/ * *
* Store definition for the interface namespace .
*
* @ see https : //github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
*
* @ type { Object }
* /
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const store = ( 0 , external _wp _data _namespaceObject . createReduxStore ) ( STORE _NAME , {
2022-04-12 17:12:47 +02:00
reducer : ( ) => { } ,
2022-04-11 14:04:30 +02:00
actions : actions _namespaceObject ,
2022-04-12 17:12:47 +02:00
selectors : selectors _namespaceObject
2022-04-11 14:04:30 +02:00
} ) ; // Once we build a more generic persistence plugin that works across types of stores
// we'd be able to replace this with a register call.
2021-06-22 12:00:50 +02:00
2022-04-12 17:12:47 +02:00
( 0 , external _wp _data _namespaceObject . register ) ( store ) ;
2021-06-22 12:00:50 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: external ["wp","plugins"]
var external _wp _plugins _namespaceObject = window [ "wp" ] [ "plugins" ] ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area-context/index.js
/ * *
* WordPress dependencies
* /
2021-06-22 12:00:50 +02:00
2022-04-11 14:04:30 +02:00
/* harmony default export */ var complementary _area _context = ( ( 0 , external _wp _plugins _namespaceObject . withPluginContext ) ( ( context , ownProps ) => {
return {
icon : ownProps . icon || context . icon ,
identifier : ownProps . identifier || ` ${ context . name } / ${ ownProps . name } `
} ;
} ) ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area-toggle/index.js
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
/ * *
* External dependencies
* /
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
/ * *
* WordPress dependencies
* /
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
/ * *
* Internal dependencies
* /
2021-05-25 10:40:25 +02:00
2021-06-15 10:52:30 +02:00
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
function ComplementaryAreaToggle ( _ref ) {
let {
as = external _wp _components _namespaceObject . Button ,
scope ,
identifier ,
icon ,
selectedIcon ,
... props
} = _ref ;
const ComponentToUse = as ;
const isSelected = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => select ( store ) . getActiveComplementaryArea ( scope ) === identifier , [ identifier ] ) ;
const {
enableComplementaryArea ,
disableComplementaryArea
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( ComponentToUse , _extends ( {
icon : selectedIcon && isSelected ? selectedIcon : icon ,
onClick : ( ) => {
if ( isSelected ) {
disableComplementaryArea ( scope ) ;
} else {
enableComplementaryArea ( scope , identifier ) ;
}
2021-05-25 10:40:25 +02:00
}
2022-04-11 14:04:30 +02:00
} , ( 0 , external _lodash _namespaceObject . omit ) ( props , [ 'name' ] ) ) ) ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
/* harmony default export */ var complementary _area _toggle = ( complementary _area _context ( ComplementaryAreaToggle ) ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area-header/index.js
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* External dependencies
2021-05-25 10:40:25 +02:00
* /
/ * *
2022-04-11 14:04:30 +02:00
* WordPress dependencies
2021-05-25 10:40:25 +02:00
* /
/ * *
2022-04-11 14:04:30 +02:00
* Internal dependencies
2021-05-25 10:40:25 +02:00
* /
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
const ComplementaryAreaHeader = _ref => {
2021-11-15 13:50:17 +01:00
let {
2022-04-11 14:04:30 +02:00
smallScreenTitle ,
children ,
className ,
toggleButtonProps
} = _ref ;
const toggleButton = ( 0 , external _wp _element _namespaceObject . createElement ) ( complementary _area _toggle , _extends ( {
icon : close _small
} , toggleButtonProps ) ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "components-panel__header interface-complementary-area-header__small"
} , smallScreenTitle && ( 0 , external _wp _element _namespaceObject . createElement ) ( "span" , {
className : "interface-complementary-area-header__small-title"
} , smallScreenTitle ) , toggleButton ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : classnames _default ( ) ( 'components-panel__header' , 'interface-complementary-area-header' , className ) ,
tabIndex : - 1
} , children , toggleButton ) ) ;
2021-11-08 15:29:21 +01:00
} ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
/* harmony default export */ var complementary _area _header = ( ComplementaryAreaHeader ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/action-item/index.js
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* External dependencies
2021-05-25 10:40:25 +02:00
* /
/ * *
2022-04-11 14:04:30 +02:00
* WordPress dependencies
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
function ActionItemSlot ( _ref ) {
2021-11-15 13:50:17 +01:00
let {
2022-04-11 14:04:30 +02:00
name ,
as : Component = external _wp _components _namespaceObject . ButtonGroup ,
fillProps = { } ,
bubblesVirtually ,
... props
2021-11-15 13:50:17 +01:00
} = _ref ;
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Slot , {
name : name ,
bubblesVirtually : bubblesVirtually ,
fillProps : fillProps
} , fills => {
if ( ( 0 , external _lodash _namespaceObject . isEmpty ) ( external _wp _element _namespaceObject . Children . toArray ( fills ) ) ) {
return null ;
} // Special handling exists for backward compatibility.
// It ensures that menu items created by plugin authors aren't
// duplicated with automatically injected menu items coming
// from pinnable plugin sidebars.
// @see https://github.com/WordPress/gutenberg/issues/14457
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const initializedByPlugins = [ ] ;
external _wp _element _namespaceObject . Children . forEach ( fills , _ref2 => {
let {
props : {
_ _unstableExplicitMenuItem ,
_ _unstableTarget
}
} = _ref2 ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
if ( _ _unstableTarget && _ _unstableExplicitMenuItem ) {
initializedByPlugins . push ( _ _unstableTarget ) ;
}
} ) ;
const children = external _wp _element _namespaceObject . Children . map ( fills , child => {
if ( ! child . props . _ _unstableExplicitMenuItem && initializedByPlugins . includes ( child . props . _ _unstableTarget ) ) {
return null ;
}
return child ;
} ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( Component , props , children ) ;
2021-05-25 10:40:25 +02:00
} ) ;
2022-04-11 14:04:30 +02:00
}
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
function ActionItem ( _ref3 ) {
2021-11-15 13:50:17 +01:00
let {
2022-04-11 14:04:30 +02:00
name ,
as : Component = external _wp _components _namespaceObject . Button ,
onClick ,
... props
} = _ref3 ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Fill , {
name : name
} , _ref4 => {
let {
onClick : fpOnClick
} = _ref4 ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( Component , _extends ( {
onClick : onClick || fpOnClick ? function ( ) {
( onClick || external _lodash _namespaceObject . noop ) ( ... arguments ) ;
( fpOnClick || external _lodash _namespaceObject . noop ) ( ... arguments ) ;
} : undefined
} , props ) ) ;
} ) ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
ActionItem . Slot = ActionItemSlot ;
/* harmony default export */ var action _item = ( ActionItem ) ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area-more-menu-item/index.js
2021-05-25 10:40:25 +02:00
2021-11-08 15:29:21 +01:00
2021-05-25 10:40:25 +02:00
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
const PluginsMenuItem = props => // Menu item is marked with unstable prop for backward compatibility.
// They are removed so they don't leak to DOM elements.
// @see https://github.com/WordPress/gutenberg/issues/14457
( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . MenuItem , ( 0 , external _lodash _namespaceObject . omit ) ( props , [ '__unstableExplicitMenuItem' , '__unstableTarget' ] ) ) ;
function ComplementaryAreaMoreMenuItem ( _ref ) {
let {
scope ,
target ,
_ _unstableExplicitMenuItem ,
... props
} = _ref ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( complementary _area _toggle , _extends ( {
as : toggleProps => {
return ( 0 , external _wp _element _namespaceObject . createElement ) ( action _item , _extends ( {
_ _unstableExplicitMenuItem : _ _unstableExplicitMenuItem ,
_ _unstableTarget : ` ${ scope } / ${ target } ` ,
as : PluginsMenuItem ,
name : ` ${ scope } /plugin-more-menu `
} , toggleProps ) ) ;
} ,
role : "menuitemcheckbox" ,
selectedIcon : library _check ,
name : target ,
scope : scope
} , props ) ) ;
}
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/pinned-items/index.js
2021-05-25 10:40:25 +02:00
2021-11-08 15:29:21 +01:00
2021-05-25 10:40:25 +02:00
2021-07-06 16:38:40 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* External dependencies
2021-07-06 16:38:40 +02:00
* /
2022-04-11 14:04:30 +02:00
2021-11-08 15:29:21 +01:00
/ * *
2022-04-11 14:04:30 +02:00
* WordPress dependencies
2021-11-08 15:29:21 +01:00
* /
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
function PinnedItems ( _ref ) {
let {
scope ,
... props
} = _ref ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Fill , _extends ( {
name : ` PinnedItems/ ${ scope } `
} , props ) ) ;
}
function PinnedItemsSlot ( _ref2 ) {
let {
scope ,
className ,
... props
} = _ref2 ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Slot , _extends ( {
name : ` PinnedItems/ ${ scope } `
} , props ) , fills => ! ( 0 , external _lodash _namespaceObject . isEmpty ) ( fills ) && ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : classnames _default ( ) ( className , 'interface-pinned-items' )
} , fills ) ) ;
}
PinnedItems . Slot = PinnedItemsSlot ;
/* harmony default export */ var pinned _items = ( PinnedItems ) ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area/index.js
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* External dependencies
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
/ * *
* WordPress dependencies
* /
2021-05-25 10:40:25 +02:00
2021-11-08 15:29:21 +01:00
/ * *
2022-04-11 14:04:30 +02:00
* Internal dependencies
2021-11-08 15:29:21 +01:00
* /
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
function ComplementaryAreaSlot ( _ref ) {
let {
scope ,
... props
} = _ref ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Slot , _extends ( {
name : ` ComplementaryArea/ ${ scope } `
} , props ) ) ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
function ComplementaryAreaFill ( _ref2 ) {
let {
scope ,
children ,
className
} = _ref2 ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Fill , {
name : ` ComplementaryArea/ ${ scope } `
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : className
} , children ) ) ;
2021-05-25 10:40:25 +02:00
}
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 21:08:24 +02:00
2022-04-11 14:04:30 +02:00
function useAdjustComplementaryListener ( scope , identifier , activeArea , isActive , isSmall ) {
const previousIsSmall = ( 0 , external _wp _element _namespaceObject . useRef ) ( false ) ;
const shouldOpenWhenNotSmall = ( 0 , external _wp _element _namespaceObject . useRef ) ( false ) ;
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 21:08:24 +02:00
const {
2022-04-11 14:04:30 +02:00
enableComplementaryArea ,
disableComplementaryArea
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store ) ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
// If the complementary area is active and the editor is switching from a big to a small window size.
if ( isActive && isSmall && ! previousIsSmall . current ) {
// Disable the complementary area.
disableComplementaryArea ( scope ) ; // Flag the complementary area to be reopened when the window size goes from small to big.
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
shouldOpenWhenNotSmall . current = true ;
} else if ( // If there is a flag indicating the complementary area should be enabled when we go from small to big window size
// and we are going from a small to big window size.
shouldOpenWhenNotSmall . current && ! isSmall && previousIsSmall . current ) {
// Remove the flag indicating the complementary area should be enabled.
shouldOpenWhenNotSmall . current = false ; // Enable the complementary area.
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
enableComplementaryArea ( scope , identifier ) ;
} else if ( // If the flag is indicating the current complementary should be reopened but another complementary area becomes active,
// remove the flag.
shouldOpenWhenNotSmall . current && activeArea && activeArea !== identifier ) {
shouldOpenWhenNotSmall . current = false ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
if ( isSmall !== previousIsSmall . current ) {
previousIsSmall . current = isSmall ;
}
} , [ isActive , isSmall , scope , identifier , activeArea ] ) ;
2021-05-25 10:40:25 +02:00
}
2022-04-11 14:04:30 +02:00
function ComplementaryArea ( _ref3 ) {
let {
children ,
className ,
closeLabel = ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Close plugin' ) ,
identifier ,
header ,
headerClassName ,
icon ,
isPinnable = true ,
panelClassName ,
scope ,
name ,
smallScreenTitle ,
title ,
toggleShortcut ,
isActiveByDefault ,
showIconLabels = false
} = _ref3 ;
const {
isActive ,
isPinned ,
activeArea ,
isSmall ,
isLarge
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
const {
getActiveComplementaryArea ,
isItemPinned
} = select ( store ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const _activeArea = getActiveComplementaryArea ( scope ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
return {
isActive : _activeArea === identifier ,
isPinned : isItemPinned ( scope , identifier ) ,
activeArea : _activeArea ,
isSmall : select ( external _wp _viewport _namespaceObject . store ) . isViewportMatch ( '< medium' ) ,
isLarge : select ( external _wp _viewport _namespaceObject . store ) . isViewportMatch ( 'large' )
} ;
} , [ identifier , scope ] ) ;
useAdjustComplementaryListener ( scope , identifier , activeArea , isActive , isSmall ) ;
const {
enableComplementaryArea ,
disableComplementaryArea ,
pinItem ,
unpinItem
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store ) ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
if ( isActiveByDefault && activeArea === undefined && ! isSmall ) {
enableComplementaryArea ( scope , identifier ) ;
}
} , [ activeArea , isActiveByDefault , scope , identifier , isSmall ] ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , isPinnable && ( 0 , external _wp _element _namespaceObject . createElement ) ( pinned _items , {
scope : scope
} , isPinned && ( 0 , external _wp _element _namespaceObject . createElement ) ( complementary _area _toggle , {
scope : scope ,
identifier : identifier ,
isPressed : isActive && ( ! showIconLabels || isLarge ) ,
"aria-expanded" : isActive ,
label : title ,
icon : showIconLabels ? library _check : icon ,
showTooltip : ! showIconLabels ,
variant : showIconLabels ? 'tertiary' : undefined
} ) ) , name && isPinnable && ( 0 , external _wp _element _namespaceObject . createElement ) ( ComplementaryAreaMoreMenuItem , {
target : name ,
scope : scope ,
icon : icon
} , title ) , isActive && ( 0 , external _wp _element _namespaceObject . createElement ) ( ComplementaryAreaFill , {
className : classnames _default ( ) ( 'interface-complementary-area' , className ) ,
scope : scope
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( complementary _area _header , {
className : headerClassName ,
closeLabel : closeLabel ,
onClose : ( ) => disableComplementaryArea ( scope ) ,
smallScreenTitle : smallScreenTitle ,
toggleButtonProps : {
label : closeLabel ,
shortcut : toggleShortcut ,
scope ,
identifier
}
} , header || ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( "strong" , null , title ) , isPinnable && ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
className : "interface-complementary-area__pin-unpin-item" ,
icon : isPinned ? star _filled : star _empty ,
label : isPinned ? ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Unpin from toolbar' ) : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Pin to toolbar' ) ,
onClick : ( ) => ( isPinned ? unpinItem : pinItem ) ( scope , identifier ) ,
isPressed : isPinned ,
"aria-expanded" : isPinned
} ) ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Panel , {
className : panelClassName
} , children ) ) ) ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const ComplementaryAreaWrapped = complementary _area _context ( ComplementaryArea ) ;
ComplementaryAreaWrapped . Slot = ComplementaryAreaSlot ;
/* harmony default export */ var complementary _area = ( ComplementaryAreaWrapped ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: external ["wp","compose"]
var external _wp _compose _namespaceObject = window [ "wp" ] [ "compose" ] ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/interface-skeleton/index.js
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
/ * *
* External dependencies
* /
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* WordPress dependencies
2021-05-25 10:40:25 +02:00
* /
/ * *
2022-04-11 14:04:30 +02:00
* WordPress dependencies
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
function useHTMLClass ( className ) {
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
const element = document && document . querySelector ( ` html:not(. ${ className } ) ` ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
if ( ! element ) {
return ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
element . classList . toggle ( className ) ;
return ( ) => {
element . classList . toggle ( className ) ;
} ;
} , [ className ] ) ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
function InterfaceSkeleton ( _ref , ref ) {
let {
footer ,
header ,
sidebar ,
secondarySidebar ,
notices ,
content ,
drawer ,
actions ,
labels ,
className ,
shortcuts
} = _ref ;
const navigateRegionsProps = ( 0 , external _wp _components _namespaceObject . _ _unstableUseNavigateRegions ) ( shortcuts ) ;
useHTMLClass ( 'interface-interface-skeleton__html-container' ) ;
const defaultLabels = {
/* translators: accessibility text for the nav bar landmark region. */
drawer : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Drawer' ) ,
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
/* translators: accessibility text for the top bar landmark region. */
header : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Header' ) ,
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
/* translators: accessibility text for the content landmark region. */
body : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Content' ) ,
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
/* translators: accessibility text for the secondary sidebar landmark region. */
secondarySidebar : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Block Library' ) ,
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
/* translators: accessibility text for the settings landmark region. */
sidebar : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Settings' ) ,
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
/* translators: accessibility text for the publish landmark region. */
actions : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Publish' ) ,
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
/* translators: accessibility text for the footer landmark region. */
footer : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Footer' )
} ;
const mergedLabels = { ... defaultLabels ,
... labels
} ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , _extends ( { } , navigateRegionsProps , {
ref : ( 0 , external _wp _compose _namespaceObject . useMergeRefs ) ( [ ref , navigateRegionsProps . ref ] ) ,
className : classnames _default ( ) ( className , 'interface-interface-skeleton' , navigateRegionsProps . className , ! ! footer && 'has-footer' )
} ) , ! ! drawer && ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "interface-interface-skeleton__drawer" ,
role : "region" ,
"aria-label" : mergedLabels . drawer ,
tabIndex : "-1"
} , drawer ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "interface-interface-skeleton__editor"
} , ! ! header && ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "interface-interface-skeleton__header" ,
role : "region" ,
"aria-label" : mergedLabels . header ,
tabIndex : "-1"
} , header ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "interface-interface-skeleton__body"
} , ! ! secondarySidebar && ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "interface-interface-skeleton__secondary-sidebar" ,
role : "region" ,
"aria-label" : mergedLabels . secondarySidebar ,
tabIndex : "-1"
} , secondarySidebar ) , ! ! notices && ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "interface-interface-skeleton__notices"
} , notices ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "interface-interface-skeleton__content" ,
role : "region" ,
"aria-label" : mergedLabels . body ,
tabIndex : "-1"
} , content ) , ! ! sidebar && ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "interface-interface-skeleton__sidebar" ,
role : "region" ,
"aria-label" : mergedLabels . sidebar ,
tabIndex : "-1"
} , sidebar ) , ! ! actions && ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "interface-interface-skeleton__actions" ,
role : "region" ,
"aria-label" : mergedLabels . actions ,
tabIndex : "-1"
} , actions ) ) ) , ! ! footer && ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "interface-interface-skeleton__footer" ,
role : "region" ,
"aria-label" : mergedLabels . footer ,
tabIndex : "-1"
} , footer ) ) ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
/* harmony default export */ var interface _skeleton = ( ( 0 , external _wp _element _namespaceObject . forwardRef ) ( InterfaceSkeleton ) ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/more-vertical.js
2021-05-25 10:40:25 +02:00
/ * *
* WordPress dependencies
* /
2022-04-11 14:04:30 +02:00
const moreVertical = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
d : "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"
} ) ) ;
/* harmony default export */ var more _vertical = ( moreVertical ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/more-menu-dropdown/index.js
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* External dependencies
2021-05-25 10:40:25 +02:00
* /
2021-06-25 17:52:22 +02:00
/ * *
* WordPress dependencies
* /
2022-04-11 14:04:30 +02:00
function MoreMenuDropdown ( _ref ) {
let {
as : DropdownComponent = external _wp _components _namespaceObject . DropdownMenu ,
className ,
2021-06-25 17:52:22 +02:00
2022-04-11 14:04:30 +02:00
/* translators: button label text should, if possible, be under 16 characters. */
label = ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Options' ) ,
popoverProps ,
toggleProps ,
children
} = _ref ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( DropdownComponent , {
className : classnames _default ( ) ( 'interface-more-menu-dropdown' , className ) ,
icon : more _vertical ,
label : label ,
popoverProps : {
position : 'bottom left' ,
... popoverProps ,
className : classnames _default ( ) ( 'interface-more-menu-dropdown__content' , popoverProps === null || popoverProps === void 0 ? void 0 : popoverProps . className )
} ,
toggleProps : {
tooltipPosition : 'bottom' ,
... toggleProps
2021-06-25 17:52:22 +02:00
}
2022-04-11 14:04:30 +02:00
} , onClose => children ( onClose ) ) ;
}
2021-06-25 17:52:22 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/index.js
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
2021-05-25 10:40:25 +02:00
2021-06-25 17:52:22 +02:00
2021-05-25 10:40:25 +02:00
2022-04-12 17:12:47 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/index.js
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: external ["wp","blockEditor"]
var external _wp _blockEditor _namespaceObject = window [ "wp" ] [ "blockEditor" ] ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/store/transformers.js
2021-05-25 10:40:25 +02:00
/ * *
* WordPress dependencies
* /
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 21:08:24 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* Converts a widget entity record into a block .
*
* @ param { Object } widget The widget entity record .
* @ return { Object } a block ( converted from the entity record ) .
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 21:08:24 +02:00
* /
2022-04-11 14:04:30 +02:00
function transformWidgetToBlock ( widget ) {
if ( widget . id _base === 'block' ) {
const parsedBlocks = ( 0 , external _wp _blocks _namespaceObject . parse ) ( widget . instance . raw . content ) ;
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 21:08:24 +02:00
2022-04-11 14:04:30 +02:00
if ( ! parsedBlocks . length ) {
return ( 0 , external _wp _widgets _namespaceObject . addWidgetIdToBlock ) ( ( 0 , external _wp _blocks _namespaceObject . createBlock ) ( 'core/paragraph' , { } , [ ] ) , widget . id ) ;
}
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 21:08:24 +02:00
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _widgets _namespaceObject . addWidgetIdToBlock ) ( parsedBlocks [ 0 ] , widget . id ) ;
}
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 21:08:24 +02:00
2022-04-11 14:04:30 +02:00
let attributes ;
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 21:08:24 +02:00
2022-04-11 14:04:30 +02:00
if ( widget . _embedded . about [ 0 ] . is _multi ) {
attributes = {
idBase : widget . id _base ,
instance : widget . instance
} ;
} else {
attributes = {
id : widget . id
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 21:08:24 +02:00
} ;
}
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _widgets _namespaceObject . addWidgetIdToBlock ) ( ( 0 , external _wp _blocks _namespaceObject . createBlock ) ( 'core/legacy-widget' , attributes , [ ] ) , widget . id ) ;
}
/ * *
* Converts a block to a widget entity record .
*
* @ param { Object } block The block .
* @ param { Object ? } relatedWidget A related widget entity record from the API ( optional ) .
* @ return { Object } the widget object ( converted from block ) .
* /
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 21:08:24 +02:00
2022-04-11 14:04:30 +02:00
function transformBlockToWidget ( block ) {
let relatedWidget = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : { } ;
let widget ;
const isValidLegacyWidgetBlock = block . name === 'core/legacy-widget' && ( block . attributes . id || block . attributes . 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 21:08:24 +02:00
2022-04-11 14:04:30 +02:00
if ( isValidLegacyWidgetBlock ) {
var _block$attributes$id , _block$attributes$idB , _block$attributes$ins ;
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 21:08:24 +02:00
2022-04-11 14:04:30 +02:00
widget = { ... relatedWidget ,
id : ( _block$attributes$id = block . attributes . id ) !== null && _block$attributes$id !== void 0 ? _block$attributes$id : relatedWidget . id ,
id _base : ( _block$attributes$idB = block . attributes . idBase ) !== null && _block$attributes$idB !== void 0 ? _block$attributes$idB : relatedWidget . id _base ,
instance : ( _block$attributes$ins = block . attributes . instance ) !== null && _block$attributes$ins !== void 0 ? _block$attributes$ins : relatedWidget . instance
} ;
} else {
widget = { ... relatedWidget ,
id _base : 'block' ,
instance : {
raw : {
content : ( 0 , external _wp _blocks _namespaceObject . serialize ) ( block )
}
}
} ;
} // Delete read-only properties.
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 21:08:24 +02:00
2022-04-11 14:04:30 +02:00
delete widget . rendered ;
delete widget . rendered _form ;
return widget ;
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 21:08:24 +02:00
}
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/store/utils.js
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* "Kind" of the navigation post .
*
* @ type { string }
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
const KIND = 'root' ;
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* "post type" of the navigation post .
*
* @ type { string }
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
const WIDGET _AREA _ENTITY _TYPE = 'sidebar' ;
/ * *
* "post type" of the widget area post .
*
* @ type { string }
* /
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const POST _TYPE = 'postType' ;
/ * *
* Builds an ID for a new widget area post .
*
* @ param { number } widgetAreaId Widget area id .
* @ return { string } An ID .
* /
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const buildWidgetAreaPostId = widgetAreaId => ` widget-area- ${ widgetAreaId } ` ;
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* Builds an ID for a global widget areas post .
*
* @ return { string } An ID .
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
const buildWidgetAreasPostId = ( ) => ` widget-areas ` ;
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* Builds a query to resolve sidebars .
*
* @ return { Object } Query .
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
function buildWidgetAreasQuery ( ) {
return {
per _page : - 1
} ;
}
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* Builds a query to resolve widgets .
2021-05-25 10:40:25 +02:00
*
2022-04-11 14:04:30 +02:00
* @ return { Object } Query .
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
function buildWidgetsQuery ( ) {
return {
per _page : - 1 ,
_embed : 'about'
} ;
}
/ * *
* Creates a stub post with given id and set of blocks . Used as a governing entity records
* for all widget areas .
*
* @ param { string } id Post ID .
* @ param { Array } blocks The list of blocks .
* @ return { Object } A stub post object formatted in compliance with the data layer .
* /
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const createStubPost = ( id , blocks ) => ( {
id ,
slug : id ,
status : 'draft' ,
type : 'page' ,
blocks ,
meta : {
widgetAreaId : id
2021-07-06 16:38:40 +02:00
}
2022-04-11 14:04:30 +02:00
} ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/store/constants.js
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* Module Constants
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
const constants _STORE _NAME = 'core/edit-widgets' ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/store/actions.js
2021-05-25 10:40:25 +02:00
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2022-04-11 14:04:30 +02:00
/ * *
* Persists a stub post with given ID to core data store . The post is meant to be in - memory only and
* shouldn ' t be saved via the API .
*
* @ param { string } id Post ID .
* @ param { Array } blocks Blocks the post should consist of .
* @ return { Object } The post object .
* /
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const persistStubPost = ( id , blocks ) => _ref => {
2021-11-15 13:50:17 +01:00
let {
2022-04-11 14:04:30 +02:00
registry
2021-11-15 13:50:17 +01:00
} = _ref ;
2022-04-11 14:04:30 +02:00
const stubPost = createStubPost ( id , blocks ) ;
registry . dispatch ( external _wp _coreData _namespaceObject . store ) . receiveEntityRecords ( KIND , POST _TYPE , stubPost , {
id : stubPost . id
} , false ) ;
return stubPost ;
} ;
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* Converts all the blocks from edited widget areas into widgets ,
* and submits a batch request to save everything at once .
*
* Creates a snackbar notice on either success or error .
*
* @ return { Function } An action creator .
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
const saveEditedWidgetAreas = ( ) => async _ref2 => {
2021-11-15 13:50:17 +01:00
let {
2022-04-11 14:04:30 +02:00
select ,
dispatch ,
registry
} = _ref2 ;
const editedWidgetAreas = select . getEditedWidgetAreas ( ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
if ( ! ( editedWidgetAreas !== null && editedWidgetAreas !== void 0 && editedWidgetAreas . length ) ) {
return ;
2021-05-25 10:40:25 +02:00
}
2022-04-11 14:04:30 +02:00
try {
await dispatch . saveWidgetAreas ( editedWidgetAreas ) ;
registry . dispatch ( external _wp _notices _namespaceObject . store ) . createSuccessNotice ( ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Widgets saved.' ) , {
type : 'snackbar'
} ) ;
} catch ( e ) {
registry . dispatch ( external _wp _notices _namespaceObject . store ) . createErrorNotice (
/* translators: %s: The error message. */
( 0 , external _wp _i18n _namespaceObject . sprintf ) ( ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'There was an error. %s' ) , e . message ) , {
type : 'snackbar'
} ) ;
}
} ;
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* Converts all the blocks from specified widget areas into widgets ,
* and submits a batch request to save everything at once .
*
* @ param { Object [ ] } widgetAreas Widget areas to save .
* @ return { Function } An action creator .
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
const saveWidgetAreas = widgetAreas => async _ref3 => {
2021-11-15 13:50:17 +01:00
let {
2022-04-11 14:04:30 +02:00
dispatch ,
registry
} = _ref3 ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
try {
for ( const widgetArea of widgetAreas ) {
await dispatch . saveWidgetArea ( widgetArea . id ) ;
2021-05-25 10:40:25 +02:00
}
2022-04-11 14:04:30 +02:00
} finally {
2022-04-12 17:12:47 +02:00
// saveEditedEntityRecord resets the resolution status, let's fix it manually.
2022-04-11 14:04:30 +02:00
await registry . dispatch ( external _wp _coreData _namespaceObject . store ) . finishResolution ( 'getEntityRecord' , KIND , WIDGET _AREA _ENTITY _TYPE , buildWidgetAreasQuery ( ) ) ;
}
} ;
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* Converts all the blocks from a widget area specified by ID into widgets ,
* and submits a batch request to save everything at once .
*
* @ param { string } widgetAreaId ID of the widget area to process .
* @ return { Function } An action creator .
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
const saveWidgetArea = widgetAreaId => async _ref4 => {
let {
dispatch ,
select ,
registry
} = _ref4 ;
const widgets = select . getWidgets ( ) ;
const post = registry . select ( external _wp _coreData _namespaceObject . store ) . getEditedEntityRecord ( KIND , POST _TYPE , buildWidgetAreaPostId ( widgetAreaId ) ) ; // Get all widgets from this area
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const areaWidgets = Object . values ( widgets ) . filter ( _ref5 => {
let {
sidebar
} = _ref5 ;
return sidebar === widgetAreaId ;
} ) ; // Remove all duplicate reference widget instances for legacy widgets.
// Why? We filter out the widgets with duplicate IDs to prevent adding more than one instance of a widget
// implemented using a function. WordPress doesn't support having more than one instance of these, if you try to
// save multiple instances of these in different sidebars you will run into undefined behaviors.
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const usedReferenceWidgets = [ ] ;
const widgetsBlocks = post . blocks . filter ( block => {
2021-05-25 10:40:25 +02:00
const {
2022-04-11 14:04:30 +02:00
id
} = block . attributes ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
if ( block . name === 'core/legacy-widget' && id ) {
if ( usedReferenceWidgets . includes ( id ) ) {
return false ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
usedReferenceWidgets . push ( id ) ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
return true ;
} ) ; // Determine which widgets have been deleted. We can tell if a widget is
// deleted and not just moved to a different area by looking to see if
// getWidgetAreaForWidgetId() finds something.
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const deletedWidgets = [ ] ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
for ( const widget of areaWidgets ) {
const widgetsNewArea = select . getWidgetAreaForWidgetId ( widget . id ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
if ( ! widgetsNewArea ) {
deletedWidgets . push ( widget ) ;
}
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const batchMeta = [ ] ;
const batchTasks = [ ] ;
const sidebarWidgetsIds = [ ] ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
for ( let i = 0 ; i < widgetsBlocks . length ; i ++ ) {
const block = widgetsBlocks [ i ] ;
const widgetId = ( 0 , external _wp _widgets _namespaceObject . getWidgetIdFromBlock ) ( block ) ;
const oldWidget = widgets [ widgetId ] ;
const widget = transformBlockToWidget ( block , oldWidget ) ; // We'll replace the null widgetId after save, but we track it here
// since order is important.
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
sidebarWidgetsIds . push ( widgetId ) ; // Check oldWidget as widgetId might refer to an ID which has been
// deleted, e.g. if a deleted block is restored via undo after saving.
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
if ( oldWidget ) {
// Update an existing widget.
registry . dispatch ( external _wp _coreData _namespaceObject . store ) . editEntityRecord ( 'root' , 'widget' , widgetId , { ... widget ,
sidebar : widgetAreaId
} , {
undoIgnore : true
} ) ;
const hasEdits = registry . select ( external _wp _coreData _namespaceObject . store ) . hasEditsForEntityRecord ( 'root' , 'widget' , widgetId ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
if ( ! hasEdits ) {
continue ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
batchTasks . push ( _ref6 => {
let {
saveEditedEntityRecord
} = _ref6 ;
return saveEditedEntityRecord ( 'root' , 'widget' , widgetId ) ;
} ) ;
} else {
// Create a new widget.
batchTasks . push ( _ref7 => {
let {
saveEntityRecord
} = _ref7 ;
return saveEntityRecord ( 'root' , 'widget' , { ... widget ,
sidebar : widgetAreaId
} ) ;
} ) ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
batchMeta . push ( {
block ,
position : i ,
clientId : block . clientId
} ) ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
for ( const widget of deletedWidgets ) {
batchTasks . push ( _ref8 => {
let {
deleteEntityRecord
} = _ref8 ;
return deleteEntityRecord ( 'root' , 'widget' , widget . id , {
force : true
} ) ;
} ) ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const records = await registry . dispatch ( external _wp _coreData _namespaceObject . store ) . _ _experimentalBatch ( batchTasks ) ;
const preservedRecords = records . filter ( record => ! record . hasOwnProperty ( 'deleted' ) ) ;
const failedWidgetNames = [ ] ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
for ( let i = 0 ; i < preservedRecords . length ; i ++ ) {
const widget = preservedRecords [ i ] ;
const {
block ,
position
} = batchMeta [ i ] ; // Set __internalWidgetId on the block. This will be persisted to the
// store when we dispatch receiveEntityRecords( post ) below.
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
post . blocks [ position ] . attributes . _ _internalWidgetId = widget . id ;
const error = registry . select ( external _wp _coreData _namespaceObject . store ) . getLastEntitySaveError ( 'root' , 'widget' , widget . id ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
if ( error ) {
var _block$attributes ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
failedWidgetNames . push ( ( ( _block$attributes = block . attributes ) === null || _block$attributes === void 0 ? void 0 : _block$attributes . name ) || ( block === null || block === void 0 ? void 0 : block . name ) ) ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
if ( ! sidebarWidgetsIds [ position ] ) {
sidebarWidgetsIds [ position ] = widget . id ;
}
}
2021-11-15 13:50:17 +01:00
2022-04-11 14:04:30 +02:00
if ( failedWidgetNames . length ) {
throw new Error ( ( 0 , external _wp _i18n _namespaceObject . sprintf ) (
/* translators: %s: List of widget names */
( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Could not save the following widgets: %s.' ) , failedWidgetNames . join ( ', ' ) ) ) ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
registry . dispatch ( external _wp _coreData _namespaceObject . store ) . editEntityRecord ( KIND , WIDGET _AREA _ENTITY _TYPE , widgetAreaId , {
widgets : sidebarWidgetsIds
} , {
undoIgnore : true
2021-05-25 10:40:25 +02:00
} ) ;
2022-04-11 14:04:30 +02:00
dispatch ( trySaveWidgetArea ( widgetAreaId ) ) ;
registry . dispatch ( external _wp _coreData _namespaceObject . store ) . receiveEntityRecords ( KIND , POST _TYPE , post , undefined ) ;
2021-05-25 10:40:25 +02:00
} ;
2022-04-11 14:04:30 +02:00
const trySaveWidgetArea = widgetAreaId => _ref9 => {
2021-11-15 13:50:17 +01:00
let {
2022-04-11 14:04:30 +02:00
registry
} = _ref9 ;
2022-04-12 17:12:47 +02:00
registry . dispatch ( external _wp _coreData _namespaceObject . store ) . saveEditedEntityRecord ( KIND , WIDGET _AREA _ENTITY _TYPE , widgetAreaId , {
throwOnError : true
} ) ;
2022-04-11 14:04:30 +02:00
} ;
/ * *
* Sets the clientId stored for a particular widgetId .
*
* @ param { number } clientId Client id .
* @ param { number } widgetId Widget id .
*
* @ return { Object } Action .
* /
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
function setWidgetIdForClientId ( clientId , widgetId ) {
return {
type : 'SET_WIDGET_ID_FOR_CLIENT_ID' ,
clientId ,
widgetId
} ;
}
/ * *
* Sets the open state of all the widget areas .
*
* @ param { Object } widgetAreasOpenState The open states of all the widget areas .
*
* @ return { Object } Action .
* /
function setWidgetAreasOpenState ( widgetAreasOpenState ) {
return {
type : 'SET_WIDGET_AREAS_OPEN_STATE' ,
widgetAreasOpenState
} ;
}
/ * *
* Sets the open state of the widget area .
*
* @ param { string } clientId The clientId of the widget area .
* @ param { boolean } isOpen Whether the widget area should be opened .
*
* @ return { Object } Action .
* /
function setIsWidgetAreaOpen ( clientId , isOpen ) {
return {
type : 'SET_IS_WIDGET_AREA_OPEN' ,
clientId ,
isOpen
} ;
2021-05-25 10:40:25 +02:00
}
/ * *
2022-04-11 14:04:30 +02:00
* Returns an action object used to open / close the inserter .
*
* @ param { boolean | Object } value Whether the inserter should be
* opened ( true ) or closed ( false ) .
* To specify an insertion point ,
* use an object .
* @ param { string } value . rootClientId The root client ID to insert at .
* @ param { number } value . insertionIndex The index to insert at .
*
* @ return { Object } Action object .
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
function setIsInserterOpened ( value ) {
return {
type : 'SET_IS_INSERTER_OPENED' ,
value
} ;
}
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02: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 .
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
function setIsListViewOpened ( isOpen ) {
return {
type : 'SET_IS_LIST_VIEW_OPENED' ,
isOpen
} ;
2021-05-25 10:40:25 +02:00
}
/ * *
2022-04-11 14:04:30 +02:00
* Returns an action object signalling that the user closed the sidebar .
*
* @ return { Object } Action creator .
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
const closeGeneralSidebar = ( ) => _ref10 => {
let {
registry
} = _ref10 ;
registry . dispatch ( store ) . disableComplementaryArea ( constants _STORE _NAME ) ;
} ;
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* Action that handles moving a block between widget areas
*
* @ param { string } clientId The clientId of the block to move .
* @ param { string } widgetAreaId The id of the widget area to move the block to .
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
const moveBlockToWidgetArea = ( clientId , widgetAreaId ) => async _ref11 => {
let {
dispatch ,
select ,
registry
} = _ref11 ;
const sourceRootClientId = registry . select ( external _wp _blockEditor _namespaceObject . store ) . getBlockRootClientId ( [ clientId ] ) ; // Search the top level blocks (widget areas) for the one with the matching
// id attribute. Makes the assumption that all top-level blocks are widget
// areas.
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const widgetAreas = registry . select ( external _wp _blockEditor _namespaceObject . store ) . getBlocks ( ) ;
const destinationWidgetAreaBlock = widgetAreas . find ( _ref12 => {
let {
attributes
} = _ref12 ;
return attributes . id === widgetAreaId ;
} ) ;
const destinationRootClientId = destinationWidgetAreaBlock . clientId ; // Get the index for moving to the end of the the destination widget area.
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const destinationInnerBlocksClientIds = registry . select ( external _wp _blockEditor _namespaceObject . store ) . getBlockOrder ( destinationRootClientId ) ;
const destinationIndex = destinationInnerBlocksClientIds . length ; // Reveal the widget area, if it's not open.
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const isDestinationWidgetAreaOpen = select . getIsWidgetAreaOpen ( destinationRootClientId ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
if ( ! isDestinationWidgetAreaOpen ) {
dispatch . setIsWidgetAreaOpen ( destinationRootClientId , true ) ;
} // Move the block.
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
registry . dispatch ( external _wp _blockEditor _namespaceObject . store ) . moveBlocksToPosition ( [ clientId ] , sourceRootClientId , destinationRootClientId , destinationIndex ) ;
} ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/store/resolvers.js
/ * *
* WordPress dependencies
* /
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
/ * *
* Internal dependencies
* /
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* Creates a "stub" widgets post reflecting all available widget areas . The
* post is meant as a convenient to only exists in runtime and should never be saved . It
* enables a convenient way of editing the widgets by using a regular post editor .
*
* Fetches all widgets from all widgets aras , converts them into blocks , and hydrates a new post with them .
*
* @ return { Function } An action creator .
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
const getWidgetAreas = ( ) => async _ref => {
let {
dispatch ,
registry
} = _ref ;
const query = buildWidgetAreasQuery ( ) ;
const widgetAreas = await registry . resolveSelect ( external _wp _coreData _namespaceObject . store ) . getEntityRecords ( KIND , WIDGET _AREA _ENTITY _TYPE , query ) ;
const widgetAreaBlocks = [ ] ;
const sortedWidgetAreas = widgetAreas . sort ( ( a , b ) => {
if ( a . id === 'wp_inactive_widgets' ) {
return 1 ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
if ( b . id === 'wp_inactive_widgets' ) {
return - 1 ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
return 0 ;
} ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
for ( const widgetArea of sortedWidgetAreas ) {
widgetAreaBlocks . push ( ( 0 , external _wp _blocks _namespaceObject . createBlock ) ( 'core/widget-area' , {
id : widgetArea . id ,
name : widgetArea . name
} ) ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
if ( ! widgetArea . widgets . length ) {
// If this widget area has no widgets, it won't get a post setup by
// the getWidgets resolver.
dispatch ( persistStubPost ( buildWidgetAreaPostId ( widgetArea . id ) , [ ] ) ) ;
}
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const widgetAreasOpenState = { } ;
widgetAreaBlocks . forEach ( ( widgetAreaBlock , index ) => {
// Defaults to open the first widget area.
widgetAreasOpenState [ widgetAreaBlock . clientId ] = index === 0 ;
2021-05-25 10:40:25 +02:00
} ) ;
2022-04-11 14:04:30 +02:00
dispatch ( setWidgetAreasOpenState ( widgetAreasOpenState ) ) ;
dispatch ( persistStubPost ( buildWidgetAreasPostId ( ) , widgetAreaBlocks ) ) ;
} ;
/ * *
* Fetches all widgets from all widgets ares , and groups them by widget area Id .
*
* @ return { Function } An action creator .
* /
const getWidgets = ( ) => async _ref2 => {
let {
dispatch ,
registry
} = _ref2 ;
const query = buildWidgetsQuery ( ) ;
const widgets = await registry . resolveSelect ( external _wp _coreData _namespaceObject . store ) . getEntityRecords ( 'root' , 'widget' , query ) ;
const groupedBySidebar = { } ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
for ( const widget of widgets ) {
const block = transformWidgetToBlock ( widget ) ;
groupedBySidebar [ widget . sidebar ] = groupedBySidebar [ widget . sidebar ] || [ ] ;
groupedBySidebar [ widget . sidebar ] . push ( block ) ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
for ( const sidebarId in groupedBySidebar ) {
if ( groupedBySidebar . hasOwnProperty ( sidebarId ) ) {
// Persist the actual post containing the widget block
dispatch ( persistStubPost ( buildWidgetAreaPostId ( sidebarId ) , groupedBySidebar [ sidebarId ] ) ) ;
}
}
} ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/store/selectors.js
/ * *
* External dependencies
* /
2021-05-25 10:40:25 +02:00
/ * *
* WordPress dependencies
* /
2021-06-22 12:00:50 +02:00
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
2021-05-25 10:40:25 +02:00
/ * *
* Internal dependencies
* /
/ * *
2022-04-11 14:04:30 +02:00
* Returns all API widgets .
*
* @ return { Object [ ] } API List of widgets .
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
const selectors _getWidgets = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( select => ( ) => {
const widgets = select ( external _wp _coreData _namespaceObject . store ) . getEntityRecords ( 'root' , 'widget' , buildWidgetsQuery ( ) ) ;
return ( 0 , external _lodash _namespaceObject . keyBy ) ( widgets , 'id' ) ;
} ) ;
/ * *
* Returns API widget data for a particular widget ID .
*
* @ param { number } id Widget ID .
*
* @ return { Object } API widget data for a particular widget ID .
* /
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const getWidget = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( select => ( state , id ) => {
const widgets = select ( constants _STORE _NAME ) . getWidgets ( ) ;
return widgets [ id ] ;
} ) ;
/ * *
* Returns all API widget areas .
*
* @ return { Object [ ] } API List of widget areas .
* /
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
const selectors _getWidgetAreas = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( select => ( ) => {
const query = buildWidgetAreasQuery ( ) ;
return select ( external _wp _coreData _namespaceObject . store ) . getEntityRecords ( KIND , WIDGET _AREA _ENTITY _TYPE , query ) ;
} ) ;
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* Returns widgetArea containing a block identify by given widgetId
*
* @ param { string } widgetId The ID of the widget .
* @ return { Object } Containing widget area .
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
const getWidgetAreaForWidgetId = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( select => ( state , widgetId ) => {
const widgetAreas = select ( constants _STORE _NAME ) . getWidgetAreas ( ) ;
return widgetAreas . find ( widgetArea => {
const post = select ( external _wp _coreData _namespaceObject . store ) . getEditedEntityRecord ( KIND , POST _TYPE , buildWidgetAreaPostId ( widgetArea . id ) ) ;
const blockWidgetIds = post . blocks . map ( block => ( 0 , external _wp _widgets _namespaceObject . getWidgetIdFromBlock ) ( block ) ) ;
return blockWidgetIds . includes ( widgetId ) ;
} ) ;
} ) ;
/ * *
* Given a child client id , returns the parent widget area block .
*
* @ param { string } clientId The client id of a block in a widget area .
*
* @ return { WPBlock } The widget area block .
* /
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const getParentWidgetAreaBlock = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( select => ( state , clientId ) => {
const {
getBlock ,
getBlockName ,
getBlockParents
} = select ( external _wp _blockEditor _namespaceObject . store ) ;
const blockParents = getBlockParents ( clientId ) ;
const widgetAreaClientId = blockParents . find ( parentClientId => getBlockName ( parentClientId ) === 'core/widget-area' ) ;
return getBlock ( widgetAreaClientId ) ;
} ) ;
/ * *
* Returns all edited widget area entity records .
*
* @ return { Object [ ] } List of edited widget area entity records .
* /
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const getEditedWidgetAreas = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( select => ( state , ids ) => {
let widgetAreas = select ( constants _STORE _NAME ) . getWidgetAreas ( ) ;
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 21:08:24 +02:00
2022-04-11 14:04:30 +02:00
if ( ! widgetAreas ) {
return [ ] ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
if ( ids ) {
widgetAreas = widgetAreas . filter ( _ref => {
let {
id
} = _ref ;
return ids . includes ( id ) ;
} ) ;
}
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 21:08:24 +02:00
2022-04-11 14:04:30 +02:00
return widgetAreas . filter ( _ref2 => {
let {
id
} = _ref2 ;
return select ( external _wp _coreData _namespaceObject . store ) . hasEditsForEntityRecord ( KIND , POST _TYPE , buildWidgetAreaPostId ( id ) ) ;
} ) . map ( _ref3 => {
let {
id
} = _ref3 ;
return select ( external _wp _coreData _namespaceObject . store ) . getEditedEntityRecord ( KIND , WIDGET _AREA _ENTITY _TYPE , id ) ;
} ) ;
} ) ;
/ * *
* Returns all blocks representing reference widgets .
*
* @ param { string } referenceWidgetName Optional . If given , only reference widgets with this name will be returned .
* @ return { Array } List of all blocks representing reference widgets
* /
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 21:08:24 +02:00
2022-04-11 14:04:30 +02:00
const getReferenceWidgetBlocks = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( select => function ( state ) {
let referenceWidgetName = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : null ;
const results = [ ] ;
const widgetAreas = select ( constants _STORE _NAME ) . getWidgetAreas ( ) ;
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 21:08:24 +02:00
2022-04-11 14:04:30 +02:00
for ( const _widgetArea of widgetAreas ) {
const post = select ( external _wp _coreData _namespaceObject . store ) . getEditedEntityRecord ( KIND , POST _TYPE , buildWidgetAreaPostId ( _widgetArea . id ) ) ;
Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`
Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719
git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 21:08:24 +02:00
2022-04-11 14:04:30 +02:00
for ( const block of post . blocks ) {
var _block$attributes ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
if ( block . name === 'core/legacy-widget' && ( ! referenceWidgetName || ( ( _block$attributes = block . attributes ) === null || _block$attributes === void 0 ? void 0 : _block$attributes . referenceWidgetName ) === referenceWidgetName ) ) {
results . push ( block ) ;
}
2021-05-25 10:40:25 +02:00
}
2022-04-11 14:04:30 +02:00
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
return results ;
} ) ;
/ * *
* Returns true if any widget area is currently being saved .
*
* @ return { boolean } True if any widget area is currently being saved . False otherwise .
* /
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
const isSavingWidgetAreas = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( select => ( ) => {
var _select$getWidgetArea ;
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
const widgetAreasIds = ( _select$getWidgetArea = select ( constants _STORE _NAME ) . getWidgetAreas ( ) ) === null || _select$getWidgetArea === void 0 ? void 0 : _select$getWidgetArea . map ( _ref4 => {
let {
id
} = _ref4 ;
return id ;
} ) ;
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
if ( ! widgetAreasIds ) {
return false ;
}
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
for ( const id of widgetAreasIds ) {
const isSaving = select ( external _wp _coreData _namespaceObject . store ) . isSavingEntityRecord ( KIND , WIDGET _AREA _ENTITY _TYPE , id ) ;
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
if ( isSaving ) {
return true ;
}
}
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
const widgetIds = [ ... Object . keys ( select ( constants _STORE _NAME ) . getWidgets ( ) ) , undefined // account for new widgets without an ID
] ;
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
for ( const id of widgetIds ) {
const isSaving = select ( external _wp _coreData _namespaceObject . store ) . isSavingEntityRecord ( 'root' , 'widget' , id ) ;
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
if ( isSaving ) {
return true ;
}
}
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
return false ;
} ) ;
2021-11-08 15:29:21 +01:00
/ * *
2022-04-11 14:04:30 +02:00
* Gets whether the widget area is opened .
*
* @ param { Array } state The open state of the widget areas .
* @ param { string } clientId The clientId of the widget area .
*
* @ return { boolean } True if the widget area is open .
2021-11-08 15:29:21 +01:00
* /
2022-04-11 14:04:30 +02:00
const getIsWidgetAreaOpen = ( state , clientId ) => {
const {
widgetAreasOpenState
} = state ;
return ! ! widgetAreasOpenState [ clientId ] ;
} ;
/ * *
* Returns true if the inserter is opened .
*
* @ param { Object } state Global application state .
*
* @ return { boolean } Whether the inserter is opened .
* /
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
function isInserterOpened ( state ) {
return ! ! state . blockInserterPanel ;
}
/ * *
* Get the insertion point for the inserter .
*
* @ param { Object } state Global application state .
*
* @ return { Object } The root client ID and index to insert at .
* /
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
function _ _experimentalGetInsertionPoint ( state ) {
2021-11-08 15:29:21 +01:00
const {
rootClientId ,
insertionIndex
2022-04-11 14:04:30 +02:00
} = state . blockInserterPanel ;
return {
rootClientId ,
insertionIndex
} ;
2021-11-08 15:29:21 +01:00
}
2022-04-11 14:04:30 +02:00
/ * *
* Returns true if a block can be inserted into a widget area .
*
* @ param { Array } state The open state of the widget areas .
* @ param { string } blockName The name of the block being inserted .
*
* @ return { boolean } True if the block can be inserted in a widget area .
* /
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
const canInsertBlockInWidgetArea = ( 0 , external _wp _data _namespaceObject . createRegistrySelector ) ( select => ( state , blockName ) => {
// Widget areas are always top-level blocks, which getBlocks will return.
const widgetAreas = select ( external _wp _blockEditor _namespaceObject . store ) . getBlocks ( ) ; // Makes an assumption that a block that can be inserted into one
// widget area can be inserted into any widget area. Uses the first
// widget area for testing whether the block can be inserted.
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
const [ firstWidgetArea ] = widgetAreas ;
return select ( external _wp _blockEditor _namespaceObject . store ) . canInsertBlockType ( blockName , firstWidgetArea . clientId ) ;
} ) ;
/ * *
* Returns true if the list view is opened .
*
* @ param { Object } state Global application state .
*
* @ return { boolean } Whether the list view is opened .
* /
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
function isListViewOpened ( state ) {
return state . listViewPanel ;
}
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/store/index.js
2021-11-08 15:29:21 +01:00
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2021-05-25 10:40:25 +02:00
2021-11-08 15:29:21 +01:00
/ * *
2022-04-11 14:04:30 +02:00
* Block editor data store configuration .
*
2022-04-12 17:12:47 +02:00
* @ see https : //github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#register
2022-04-11 14:04:30 +02:00
*
* @ type { Object }
2021-11-08 15:29:21 +01:00
* /
2022-04-11 14:04:30 +02:00
const storeConfig = {
2022-04-12 17:12:47 +02:00
reducer : reducer ,
2022-04-11 14:04:30 +02:00
selectors : store _selectors _namespaceObject ,
resolvers : resolvers _namespaceObject ,
2022-04-12 17:12:47 +02:00
actions : store _actions _namespaceObject
2022-04-11 14:04:30 +02:00
} ;
2021-11-08 15:29:21 +01:00
/ * *
2022-04-11 14:04:30 +02:00
* Store definition for the edit widgets namespace .
*
* @ see https : //github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
*
* @ type { Object }
2021-11-08 15:29:21 +01:00
* /
2022-04-12 17:12:47 +02:00
const store _store = ( 0 , external _wp _data _namespaceObject . createReduxStore ) ( constants _STORE _NAME , storeConfig ) ;
( 0 , external _wp _data _namespaceObject . register ) ( store _store ) ; // This package uses a few in-memory post types as wrappers for convenience.
2022-04-11 14:04:30 +02:00
// This middleware prevents any network requests related to these types as they are
// bound to fail anyway.
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
external _wp _apiFetch _default ( ) . use ( function ( options , next ) {
var _options$path ;
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
if ( ( ( _options$path = options . path ) === null || _options$path === void 0 ? void 0 : _options$path . indexOf ( '/wp/v2/types/widget-area' ) ) === 0 ) {
return Promise . resolve ( { } ) ;
2021-11-08 15:29:21 +01:00
}
2022-04-11 14:04:30 +02:00
return next ( options ) ;
} ) ;
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: external ["wp","hooks"]
var external _wp _hooks _namespaceObject = window [ "wp" ] [ "hooks" ] ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/filters/move-to-widget-area.js
2021-11-08 15:29:21 +01:00
2021-05-25 10:40:25 +02:00
2021-11-08 15:29:21 +01:00
/ * *
* WordPress dependencies
* /
2021-05-25 10:40:25 +02:00
/ * *
* Internal dependencies
* /
2022-04-11 14:04:30 +02:00
const withMoveToWidgetAreaToolbarItem = ( 0 , external _wp _compose _namespaceObject . createHigherOrderComponent ) ( BlockEdit => props => {
2021-05-25 10:40:25 +02:00
const {
2022-04-11 14:04:30 +02:00
clientId ,
name : blockName
} = props ;
2021-05-25 10:40:25 +02:00
const {
2022-04-11 14:04:30 +02:00
widgetAreas ,
currentWidgetAreaId ,
canInsertBlockInWidgetArea
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
var _widgetAreaBlock$attr ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
// Component won't display for a widget area, so don't run selectors.
if ( blockName === 'core/widget-area' ) {
return { } ;
2021-06-22 12:00:50 +02:00
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const selectors = select ( store _store ) ;
const widgetAreaBlock = selectors . getParentWidgetAreaBlock ( clientId ) ;
return {
widgetAreas : selectors . getWidgetAreas ( ) ,
currentWidgetAreaId : widgetAreaBlock === null || widgetAreaBlock === void 0 ? void 0 : ( _widgetAreaBlock$attr = widgetAreaBlock . attributes ) === null || _widgetAreaBlock$attr === void 0 ? void 0 : _widgetAreaBlock$attr . id ,
canInsertBlockInWidgetArea : selectors . canInsertBlockInWidgetArea ( blockName )
} ;
} , [ clientId , blockName ] ) ;
const {
moveBlockToWidgetArea
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
const hasMultipleWidgetAreas = ( widgetAreas === null || widgetAreas === void 0 ? void 0 : widgetAreas . length ) > 1 ;
const isMoveToWidgetAreaVisible = blockName !== 'core/widget-area' && hasMultipleWidgetAreas && canInsertBlockInWidgetArea ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( BlockEdit , props ) , isMoveToWidgetAreaVisible && ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . BlockControls , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _widgets _namespaceObject . MoveToWidgetArea , {
widgetAreas : widgetAreas ,
currentWidgetAreaId : currentWidgetAreaId ,
onSelect : widgetAreaId => {
moveBlockToWidgetArea ( props . clientId , widgetAreaId ) ;
}
} ) ) ) ;
} , 'withMoveToWidgetAreaToolbarItem' ) ;
( 0 , external _wp _hooks _namespaceObject . addFilter ) ( 'editor.BlockEdit' , 'core/edit-widgets/block-edit' , withMoveToWidgetAreaToolbarItem ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: external ["wp","mediaUtils"]
var external _wp _mediaUtils _namespaceObject = window [ "wp" ] [ "mediaUtils" ] ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/filters/replace-media-upload.js
2021-05-25 10:40:25 +02:00
/ * *
* WordPress dependencies
* /
2022-04-11 14:04:30 +02:00
const replaceMediaUpload = ( ) => external _wp _mediaUtils _namespaceObject . MediaUpload ;
( 0 , external _wp _hooks _namespaceObject . addFilter ) ( 'editor.MediaUpload' , 'core/edit-widgets/replace-media-upload' , replaceMediaUpload ) ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/filters/index.js
2021-06-01 10:10:04 +02:00
/ * *
* Internal dependencies
* /
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/blocks/widget-area/edit/use-is-dragging-within.js
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* WordPress dependencies
* /
/** @typedef {import('@wordpress/element').RefObject} RefObject */
/ * *
* A React hook to determine if it ' s dragging within the target element .
2021-05-25 10:40:25 +02:00
*
2022-04-11 14:04:30 +02:00
* @ param { RefObject < HTMLElement > } elementRef The target elementRef object .
2021-05-25 10:40:25 +02:00
*
2022-04-11 14:04:30 +02:00
* @ return { boolean } Is dragging within the target element .
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
const useIsDraggingWithin = elementRef => {
const [ isDraggingWithin , setIsDraggingWithin ] = ( 0 , external _wp _element _namespaceObject . useState ) ( false ) ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
2021-06-01 10:10:04 +02:00
const {
2022-04-11 14:04:30 +02:00
ownerDocument
} = elementRef . current ;
function handleDragStart ( event ) {
// Check the first time when the dragging starts.
handleDragEnter ( event ) ;
} // Set to false whenever the user cancel the drag event by either releasing the mouse or press Escape.
function handleDragEnd ( ) {
setIsDraggingWithin ( false ) ;
}
function handleDragEnter ( event ) {
// Check if the current target is inside the item element.
if ( elementRef . current . contains ( event . target ) ) {
setIsDraggingWithin ( true ) ;
} else {
setIsDraggingWithin ( false ) ;
2021-05-25 10:40:25 +02:00
}
2022-04-11 14:04:30 +02:00
} // Bind these events to the document to catch all drag events.
// Ideally, we can also use `event.relatedTarget`, but sadly that doesn't work in Safari.
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
ownerDocument . addEventListener ( 'dragstart' , handleDragStart ) ;
ownerDocument . addEventListener ( 'dragend' , handleDragEnd ) ;
ownerDocument . addEventListener ( 'dragenter' , handleDragEnter ) ;
2021-05-25 10:40:25 +02:00
return ( ) => {
2022-04-11 14:04:30 +02:00
ownerDocument . removeEventListener ( 'dragstart' , handleDragStart ) ;
ownerDocument . removeEventListener ( 'dragend' , handleDragEnd ) ;
ownerDocument . removeEventListener ( 'dragenter' , handleDragEnter ) ;
2021-05-25 10:40:25 +02:00
} ;
2022-04-11 14:04:30 +02:00
} , [ ] ) ;
return isDraggingWithin ;
} ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
/* harmony default export */ var use _is _dragging _within = ( useIsDraggingWithin ) ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/blocks/widget-area/edit/inner-blocks.js
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
/ * *
* External dependencies
* /
2021-05-25 10:40:25 +02:00
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2022-04-11 14:04:30 +02:00
function WidgetAreaInnerBlocks ( _ref ) {
2021-11-15 13:50:17 +01:00
let {
2022-04-11 14:04:30 +02:00
id
2021-11-15 13:50:17 +01:00
} = _ref ;
2022-04-11 14:04:30 +02:00
const [ blocks , onInput , onChange ] = ( 0 , external _wp _coreData _namespaceObject . useEntityBlockEditor ) ( 'root' , 'postType' ) ;
const innerBlocksRef = ( 0 , external _wp _element _namespaceObject . useRef ) ( ) ;
const isDraggingWithinInnerBlocks = use _is _dragging _within ( innerBlocksRef ) ;
const shouldHighlightDropZone = isDraggingWithinInnerBlocks ; // Using the experimental hook so that we can control the className of the element.
const innerBlocksProps = ( 0 , external _wp _blockEditor _namespaceObject . useInnerBlocksProps ) ( {
ref : innerBlocksRef
} , {
value : blocks ,
onInput ,
onChange ,
templateLock : false ,
renderAppender : external _wp _blockEditor _namespaceObject . InnerBlocks . ButtonBlockAppender
} ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
"data-widget-area-id" : id ,
className : classnames _default ( ) ( 'wp-block-widget-area__inner-blocks block-editor-inner-blocks editor-styles-wrapper' , {
'wp-block-widget-area__highlight-drop-zone' : shouldHighlightDropZone
} )
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , innerBlocksProps ) ) ;
2021-06-01 10:10:04 +02:00
}
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/blocks/widget-area/edit/index.js
2021-05-25 10:40:25 +02:00
/ * *
* WordPress dependencies
* /
2022-04-11 14:04:30 +02:00
2021-05-25 10:40:25 +02:00
/ * *
* Internal dependencies
* /
2022-04-11 14:04:30 +02:00
/** @typedef {import('@wordpress/element').RefObject} RefObject */
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
function WidgetAreaEdit ( _ref ) {
2021-11-15 13:50:17 +01:00
let {
2022-04-11 14:04:30 +02:00
clientId ,
className ,
attributes : {
id ,
name
}
2021-11-15 13:50:17 +01:00
} = _ref ;
2022-04-11 14:04:30 +02:00
const isOpen = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => select ( store _store ) . getIsWidgetAreaOpen ( clientId ) , [ clientId ] ) ;
const {
setIsWidgetAreaOpen
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
const wrapper = ( 0 , external _wp _element _namespaceObject . useRef ) ( ) ;
const setOpen = ( 0 , external _wp _element _namespaceObject . useCallback ) ( openState => setIsWidgetAreaOpen ( clientId , openState ) , [ clientId ] ) ;
const isDragging = useIsDragging ( wrapper ) ;
const isDraggingWithin = use _is _dragging _within ( wrapper ) ;
const [ openedWhileDragging , setOpenedWhileDragging ] = ( 0 , external _wp _element _namespaceObject . useState ) ( false ) ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
if ( ! isDragging ) {
setOpenedWhileDragging ( false ) ;
return ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
if ( isDraggingWithin && ! isOpen ) {
setOpen ( true ) ;
setOpenedWhileDragging ( true ) ;
} else if ( ! isDraggingWithin && isOpen && openedWhileDragging ) {
setOpen ( false ) ;
}
} , [ isOpen , isDragging , isDraggingWithin , openedWhileDragging ] ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Panel , {
className : className ,
ref : wrapper
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . PanelBody , {
title : name ,
opened : isOpen ,
onToggle : ( ) => {
setIsWidgetAreaOpen ( clientId , ! isOpen ) ;
} ,
scrollAfterOpen : ! isDragging
} , _ref2 => {
let {
opened
} = _ref2 ;
return ( // This is required to ensure LegacyWidget blocks are not
// unmounted when the panel is collapsed. Unmounting legacy
// widgets may have unintended consequences (e.g. TinyMCE
// not being properly reinitialized)
( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _unstableDisclosureContent , {
className : "wp-block-widget-area__panel-body-content" ,
visible : opened
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _coreData _namespaceObject . EntityProvider , {
kind : "root" ,
type : "postType" ,
id : ` widget-area- ${ id } `
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( WidgetAreaInnerBlocks , {
id : id
} ) ) )
) ;
} ) ) ;
}
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* A React hook to determine if dragging is active .
*
* @ param { RefObject < HTMLElement > } elementRef The target elementRef object .
*
* @ return { boolean } Is dragging within the entire document .
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
const useIsDragging = elementRef => {
const [ isDragging , setIsDragging ] = ( 0 , external _wp _element _namespaceObject . useState ) ( false ) ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
const {
ownerDocument
} = elementRef . current ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
function handleDragStart ( ) {
setIsDragging ( true ) ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
function handleDragEnd ( ) {
setIsDragging ( false ) ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
ownerDocument . addEventListener ( 'dragstart' , handleDragStart ) ;
ownerDocument . addEventListener ( 'dragend' , handleDragEnd ) ;
return ( ) => {
ownerDocument . removeEventListener ( 'dragstart' , handleDragStart ) ;
ownerDocument . removeEventListener ( 'dragend' , handleDragEnd ) ;
} ;
} , [ ] ) ;
return isDragging ;
} ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/blocks/widget-area/index.js
/ * *
* WordPress dependencies
* /
2021-11-08 15:29:21 +01:00
2021-05-25 10:40:25 +02:00
/ * *
* Internal dependencies
* /
2022-04-11 14:04:30 +02:00
const metadata = {
name : "core/widget-area" ,
category : "widgets" ,
attributes : {
id : {
type : "string"
} ,
name : {
type : "string"
}
} ,
supports : {
html : false ,
inserter : false ,
customClassName : false ,
reusable : false ,
_ _experimentalToolbar : false ,
_ _experimentalParentSelector : false
} ,
editorStyle : "wp-block-widget-area-editor" ,
style : "wp-block-widget-area"
} ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const {
name : widget _area _name
} = metadata ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const settings = {
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Widget Area' ) ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'A widget area container.' ) ,
_ _experimentalLabel : _ref => {
let {
name : label
} = _ref ;
return label ;
} ,
edit : WidgetAreaEdit
} ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/error-boundary/index.js
2021-05-25 10:40:25 +02:00
2021-06-25 17:52:22 +02:00
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* WordPress dependencies
2021-05-25 10:40:25 +02:00
* /
2021-07-06 16:38:40 +02:00
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
function CopyButton ( _ref ) {
let {
text ,
children
} = _ref ;
const ref = ( 0 , external _wp _compose _namespaceObject . useCopyToClipboard ) ( text ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
variant : "secondary" ,
ref : ref
} , children ) ;
2021-05-25 10:40:25 +02:00
}
2022-04-11 14:04:30 +02:00
class ErrorBoundary extends external _wp _element _namespaceObject . Component {
constructor ( ) {
super ( ... arguments ) ;
this . reboot = this . reboot . bind ( this ) ;
this . state = {
error : null
} ;
2021-05-25 10:40:25 +02:00
}
2022-04-11 14:04:30 +02:00
componentDidCatch ( error ) {
this . setState ( {
error
2021-05-25 10:40:25 +02:00
} ) ;
}
2022-04-11 14:04:30 +02:00
reboot ( ) {
this . props . onError ( ) ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
render ( ) {
const {
error
} = this . state ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
if ( ! error ) {
return this . props . children ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . Warning , {
className : "edit-widgets-error-boundary" ,
actions : [ ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
key : "recovery" ,
onClick : this . reboot ,
variant : "secondary"
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Attempt Recovery' ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( CopyButton , {
key : "copy-error" ,
text : error . stack
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Copy Error' ) ) ]
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'The editor has encountered an unexpected error.' ) ) ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: external ["wp","reusableBlocks"]
var external _wp _reusableBlocks _namespaceObject = window [ "wp" ] [ "reusableBlocks" ] ;
; // CONCATENATED MODULE: external ["wp","keyboardShortcuts"]
var external _wp _keyboardShortcuts _namespaceObject = window [ "wp" ] [ "keyboardShortcuts" ] ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/keyboard-shortcuts/index.js
/ * *
* WordPress dependencies
* /
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
/ * *
* Internal dependencies
* /
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
function KeyboardShortcuts ( ) {
const {
redo ,
undo
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _coreData _namespaceObject . store ) ;
const {
saveEditedWidgetAreas
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
( 0 , external _wp _keyboardShortcuts _namespaceObject . useShortcut ) ( 'core/edit-widgets/undo' , event => {
undo ( ) ;
event . preventDefault ( ) ;
} ) ;
( 0 , external _wp _keyboardShortcuts _namespaceObject . useShortcut ) ( 'core/edit-widgets/redo' , event => {
redo ( ) ;
event . preventDefault ( ) ;
} ) ;
( 0 , external _wp _keyboardShortcuts _namespaceObject . useShortcut ) ( 'core/edit-widgets/save' , event => {
event . preventDefault ( ) ;
saveEditedWidgetAreas ( ) ;
} ) ;
return null ;
}
function KeyboardShortcutsRegister ( ) {
2022-04-12 17:12:47 +02:00
// Registering the shortcuts.
2022-04-11 14:04:30 +02:00
const {
registerShortcut
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _keyboardShortcuts _namespaceObject . store ) ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
registerShortcut ( {
name : 'core/edit-widgets/undo' ,
category : 'global' ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Undo your last changes.' ) ,
keyCombination : {
modifier : 'primary' ,
character : 'z'
}
} ) ;
registerShortcut ( {
name : 'core/edit-widgets/redo' ,
category : 'global' ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Redo your last undo.' ) ,
keyCombination : {
modifier : 'primaryShift' ,
character : 'z'
}
} ) ;
registerShortcut ( {
name : 'core/edit-widgets/save' ,
category : 'global' ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Save your changes.' ) ,
keyCombination : {
modifier : 'primary' ,
character : 's'
}
} ) ;
registerShortcut ( {
name : 'core/edit-widgets/keyboard-shortcuts' ,
category : 'main' ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Display these keyboard shortcuts.' ) ,
keyCombination : {
modifier : 'access' ,
character : 'h'
}
} ) ;
registerShortcut ( {
name : 'core/edit-widgets/next-region' ,
category : 'global' ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Navigate to the next part of the editor.' ) ,
keyCombination : {
modifier : 'ctrl' ,
character : '`'
} ,
aliases : [ {
modifier : 'access' ,
character : 'n'
} ]
} ) ;
registerShortcut ( {
name : 'core/edit-widgets/previous-region' ,
category : 'global' ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Navigate to the previous part of the editor.' ) ,
keyCombination : {
modifier : 'ctrlShift' ,
character : '`'
} ,
aliases : [ {
modifier : 'access' ,
character : 'p'
} ]
} ) ;
} , [ registerShortcut ] ) ;
return null ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
KeyboardShortcuts . Register = KeyboardShortcutsRegister ;
/* harmony default export */ var keyboard _shortcuts = ( KeyboardShortcuts ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/hooks/use-last-selected-widget-area.js
2021-05-25 10:40:25 +02:00
/ * *
* WordPress dependencies
* /
2022-04-11 14:04:30 +02:00
/ * *
* Internal dependencies
* /
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* A react hook that returns the client id of the last widget area to have
* been selected , or to have a selected block within it .
*
* @ return { string } clientId of the widget area last selected .
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
const useLastSelectedWidgetArea = ( ) => ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
var _widgetAreasPost$bloc ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const {
getBlockSelectionEnd ,
getBlockName
} = select ( external _wp _blockEditor _namespaceObject . store ) ;
const selectionEndClientId = getBlockSelectionEnd ( ) ; // If the selected block is a widget area, return its clientId.
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
if ( getBlockName ( selectionEndClientId ) === 'core/widget-area' ) {
return selectionEndClientId ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const {
getParentWidgetAreaBlock
} = select ( store _store ) ;
const widgetAreaBlock = getParentWidgetAreaBlock ( selectionEndClientId ) ;
const widgetAreaBlockClientId = widgetAreaBlock === null || widgetAreaBlock === void 0 ? void 0 : widgetAreaBlock . clientId ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
if ( widgetAreaBlockClientId ) {
return widgetAreaBlockClientId ;
} // If no widget area has been selected, return the clientId of the first
// area.
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const {
getEntityRecord
} = select ( external _wp _coreData _namespaceObject . store ) ;
const widgetAreasPost = getEntityRecord ( KIND , POST _TYPE , buildWidgetAreasPostId ( ) ) ;
return widgetAreasPost === null || widgetAreasPost === void 0 ? void 0 : ( _widgetAreasPost$bloc = widgetAreasPost . blocks [ 0 ] ) === null || _widgetAreasPost$bloc === void 0 ? void 0 : _widgetAreasPost$bloc . clientId ;
} , [ ] ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
/* harmony default export */ var use _last _selected _widget _area = ( useLastSelectedWidgetArea ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/constants.js
const ALLOW _REUSABLE _BLOCKS = false ;
const ENABLE _EXPERIMENTAL _FSE _BLOCKS = false ;
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/widget-areas-block-editor-provider/index.js
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
/ * *
* External dependencies
* /
2021-11-08 15:29:21 +01:00
/ * *
* WordPress dependencies
* /
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* Internal dependencies
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
function WidgetAreasBlockEditorProvider ( _ref ) {
let {
blockEditorSettings ,
children ,
... props
} = _ref ;
const {
hasUploadPermissions ,
reusableBlocks ,
isFixedToolbarActive ,
keepCaretInsideBlock
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => ( {
hasUploadPermissions : ( 0 , external _lodash _namespaceObject . defaultTo ) ( select ( external _wp _coreData _namespaceObject . store ) . canUser ( 'create' , 'media' ) , true ) ,
widgetAreas : select ( store _store ) . getWidgetAreas ( ) ,
widgets : select ( store _store ) . getWidgets ( ) ,
reusableBlocks : ALLOW _REUSABLE _BLOCKS ? select ( external _wp _coreData _namespaceObject . store ) . getEntityRecords ( 'postType' , 'wp_block' ) : [ ] ,
2022-04-12 17:12:47 +02:00
isFixedToolbarActive : ! ! select ( external _wp _preferences _namespaceObject . store ) . get ( 'core/edit-widgets' , 'fixedToolbar' ) ,
keepCaretInsideBlock : ! ! select ( external _wp _preferences _namespaceObject . store ) . get ( 'core/edit-widgets' , 'keepCaretInsideBlock' )
2022-04-11 14:04:30 +02:00
} ) , [ ] ) ;
const {
setIsInserterOpened
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
const settings = ( 0 , external _wp _element _namespaceObject . useMemo ) ( ( ) => {
let mediaUploadBlockEditor ;
if ( hasUploadPermissions ) {
mediaUploadBlockEditor = _ref2 => {
let {
onError ,
... argumentsObject
} = _ref2 ;
( 0 , external _wp _mediaUtils _namespaceObject . uploadMedia ) ( {
wpAllowedMimeTypes : blockEditorSettings . allowedMimeTypes ,
onError : _ref3 => {
let {
message
} = _ref3 ;
return onError ( message ) ;
} ,
... argumentsObject
} ) ;
} ;
}
return { ... blockEditorSettings ,
_ _experimentalReusableBlocks : reusableBlocks ,
hasFixedToolbar : isFixedToolbarActive ,
keepCaretInsideBlock ,
mediaUpload : mediaUploadBlockEditor ,
templateLock : 'all' ,
_ _experimentalSetIsInserterOpened : setIsInserterOpened
} ;
} , [ blockEditorSettings , isFixedToolbarActive , keepCaretInsideBlock , hasUploadPermissions , reusableBlocks , setIsInserterOpened ] ) ;
const widgetAreaId = use _last _selected _widget _area ( ) ;
const [ blocks , onInput , onChange ] = ( 0 , external _wp _coreData _namespaceObject . useEntityBlockEditor ) ( KIND , POST _TYPE , {
id : buildWidgetAreasPostId ( )
} ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _keyboardShortcuts _namespaceObject . ShortcutProvider , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . BlockEditorKeyboardShortcuts . Register , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( keyboard _shortcuts . Register , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . SlotFillProvider , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . BlockEditorProvider , _extends ( {
value : blocks ,
onInput : onInput ,
onChange : onChange ,
settings : settings ,
useSubRegistry : false
} , props ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . CopyHandler , null , children ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _reusableBlocks _namespaceObject . ReusableBlocksMenuItems , {
rootClientId : widgetAreaId
} ) ) ) ) ;
}
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/cog.js
2021-05-25 10:40:25 +02:00
/ * *
* WordPress dependencies
* /
2022-04-11 14:04:30 +02:00
const cog = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
2021-05-25 10:40:25 +02:00
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
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"
2021-05-25 10:40:25 +02:00
} ) ) ;
2022-04-11 14:04:30 +02:00
/* harmony default export */ var library _cog = ( cog ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/block-default.js
2021-05-25 10:40:25 +02:00
/ * *
* WordPress dependencies
* /
2022-04-11 14:04:30 +02:00
const blockDefault = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
2021-05-25 10:40:25 +02:00
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
d : "M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"
2021-05-25 10:40:25 +02:00
} ) ) ;
2022-04-11 14:04:30 +02:00
/* harmony default export */ var block _default = ( blockDefault ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: external ["wp","url"]
var external _wp _url _namespaceObject = window [ "wp" ] [ "url" ] ;
; // CONCATENATED MODULE: external ["wp","dom"]
var external _wp _dom _namespaceObject = window [ "wp" ] [ "dom" ] ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/sidebar/widget-areas.js
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
/ * *
* WordPress dependencies
* /
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
/ * *
* Internal dependencies
* /
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
function WidgetAreas ( _ref ) {
let {
selectedWidgetAreaId
} = _ref ;
const widgetAreas = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => select ( store _store ) . getWidgetAreas ( ) , [ ] ) ;
const selectedWidgetArea = ( 0 , external _wp _element _namespaceObject . useMemo ) ( ( ) => selectedWidgetAreaId && ( widgetAreas === null || widgetAreas === void 0 ? void 0 : widgetAreas . find ( widgetArea => widgetArea . id === selectedWidgetAreaId ) ) , [ selectedWidgetAreaId , widgetAreas ] ) ;
let description ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
if ( ! selectedWidgetArea ) {
description = ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Widget Areas are global parts in your site’ s layout that can accept blocks. These vary by theme, but are typically parts like your Sidebar or Footer.' ) ;
} else if ( selectedWidgetAreaId === 'wp_inactive_widgets' ) {
description = ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Blocks in this Widget Area will not be displayed in your site.' ) ;
} else {
description = selectedWidgetArea . description ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "edit-widgets-widget-areas"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "edit-widgets-widget-areas__top-container"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . BlockIcon , {
icon : block _default
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( "p" , {
// Use `dangerouslySetInnerHTML` to keep backwards
// compatibility. Basic markup in the description is an
// established feature of WordPress.
// @see https://github.com/WordPress/gutenberg/issues/33106
dangerouslySetInnerHTML : {
_ _html : ( 0 , external _wp _dom _namespaceObject . safeHTML ) ( description )
}
} ) , ( widgetAreas === null || widgetAreas === void 0 ? void 0 : widgetAreas . length ) === 0 && ( 0 , external _wp _element _namespaceObject . createElement ) ( "p" , null , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Your theme does not contain any Widget Areas.' ) ) , ! selectedWidgetArea && ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
href : ( 0 , external _wp _url _namespaceObject . addQueryArgs ) ( 'customize.php' , {
'autofocus[panel]' : 'widgets' ,
return : window . location . pathname
} ) ,
variant : "tertiary"
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Manage with live preview' ) ) ) ) ) ;
}
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/sidebar/index.js
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
/ * *
* External dependencies
* /
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
/ * *
* WordPress dependencies
* /
2021-05-25 10:40:25 +02:00
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
const SIDEBAR _ACTIVE _BY _DEFAULT = external _wp _element _namespaceObject . Platform . select ( {
web : true ,
native : false
} ) ;
const BLOCK _INSPECTOR _IDENTIFIER = 'edit-widgets/block-inspector' ; // Widget areas were one called block areas, so use 'edit-widgets/block-areas'
// for backwards compatibility.
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const WIDGET _AREAS _IDENTIFIER = 'edit-widgets/block-areas' ;
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* Internal dependencies
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
function ComplementaryAreaTab ( _ref ) {
2021-11-15 13:50:17 +01:00
let {
2022-04-11 14:04:30 +02:00
identifier ,
label ,
isActive
} = _ref ;
const {
enableComplementaryArea
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
onClick : ( ) => enableComplementaryArea ( store _store . name , identifier ) ,
className : classnames _default ( ) ( 'edit-widgets-sidebar__panel-tab' , {
'is-active' : isActive
} ) ,
"aria-label" : isActive ? // translators: %s: sidebar label e.g: "Widget Areas".
( 0 , external _wp _i18n _namespaceObject . sprintf ) ( ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( '%s (selected)' ) , label ) : label ,
"data-label" : label
} , label ) ;
}
2021-11-15 13:50:17 +01:00
2022-04-11 14:04:30 +02:00
function Sidebar ( ) {
const {
enableComplementaryArea
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store ) ;
const {
currentArea ,
hasSelectedNonAreaBlock ,
isGeneralSidebarOpen ,
selectedWidgetAreaBlock
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
const {
getSelectedBlock ,
getBlock ,
getBlockParentsByBlockName
} = select ( external _wp _blockEditor _namespaceObject . store ) ;
const {
getActiveComplementaryArea
} = select ( store ) ;
const selectedBlock = getSelectedBlock ( ) ;
const activeArea = getActiveComplementaryArea ( store _store . name ) ;
let currentSelection = activeArea ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
if ( ! currentSelection ) {
if ( selectedBlock ) {
currentSelection = BLOCK _INSPECTOR _IDENTIFIER ;
} else {
currentSelection = WIDGET _AREAS _IDENTIFIER ;
}
2021-05-25 10:40:25 +02:00
}
2021-11-15 13:50:17 +01:00
2022-04-11 14:04:30 +02:00
let widgetAreaBlock ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
if ( selectedBlock ) {
if ( selectedBlock . name === 'core/widget-area' ) {
widgetAreaBlock = selectedBlock ;
} else {
widgetAreaBlock = getBlock ( getBlockParentsByBlockName ( selectedBlock . clientId , 'core/widget-area' ) [ 0 ] ) ;
2021-05-25 10:40:25 +02:00
}
}
2022-04-11 14:04:30 +02:00
return {
currentArea : currentSelection ,
hasSelectedNonAreaBlock : ! ! ( selectedBlock && selectedBlock . name !== 'core/widget-area' ) ,
isGeneralSidebarOpen : ! ! activeArea ,
selectedWidgetAreaBlock : widgetAreaBlock
} ;
} , [ ] ) ; // currentArea, and isGeneralSidebarOpen are intentionally left out from the dependencies,
// because we want to run the effect when a block is selected/unselected and not when the sidebar state changes.
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
if ( hasSelectedNonAreaBlock && currentArea === WIDGET _AREAS _IDENTIFIER && isGeneralSidebarOpen ) {
enableComplementaryArea ( 'core/edit-widgets' , BLOCK _INSPECTOR _IDENTIFIER ) ;
}
if ( ! hasSelectedNonAreaBlock && currentArea === BLOCK _INSPECTOR _IDENTIFIER && isGeneralSidebarOpen ) {
enableComplementaryArea ( 'core/edit-widgets' , WIDGET _AREAS _IDENTIFIER ) ;
}
} , [ hasSelectedNonAreaBlock , enableComplementaryArea ] ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( complementary _area , {
className : "edit-widgets-sidebar" ,
header : ( 0 , external _wp _element _namespaceObject . createElement ) ( "ul" , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( "li" , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( ComplementaryAreaTab , {
identifier : WIDGET _AREAS _IDENTIFIER ,
label : selectedWidgetAreaBlock ? selectedWidgetAreaBlock . attributes . name : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Widget Areas' ) ,
isActive : currentArea === WIDGET _AREAS _IDENTIFIER
} ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "li" , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( ComplementaryAreaTab , {
identifier : BLOCK _INSPECTOR _IDENTIFIER ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Block' ) ,
isActive : currentArea === BLOCK _INSPECTOR _IDENTIFIER
} ) ) ) ,
headerClassName : "edit-widgets-sidebar__panel-tabs"
/* translators: button label text should, if possible, be under 16 characters. */
,
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Settings' ) ,
closeLabel : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Close settings' ) ,
scope : "core/edit-widgets" ,
identifier : currentArea ,
icon : library _cog ,
isActiveByDefault : SIDEBAR _ACTIVE _BY _DEFAULT
} , currentArea === WIDGET _AREAS _IDENTIFIER && ( 0 , external _wp _element _namespaceObject . createElement ) ( WidgetAreas , {
selectedWidgetAreaId : selectedWidgetAreaBlock === null || selectedWidgetAreaBlock === void 0 ? void 0 : selectedWidgetAreaBlock . attributes . id
} ) , currentArea === BLOCK _INSPECTOR _IDENTIFIER && ( hasSelectedNonAreaBlock ? ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . BlockInspector , null ) : // Pretend that Widget Areas are part of the UI by not
// showing the Block Inspector when one is selected.
( 0 , external _wp _element _namespaceObject . createElement ) ( "span" , {
className : "block-editor-block-inspector__no-blocks"
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'No block selected.' ) ) ) ) ;
2021-05-25 10:40:25 +02:00
}
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/plus.js
2021-11-08 15:29:21 +01:00
/ * *
2022-04-11 14:04:30 +02:00
* WordPress dependencies
2021-11-08 15:29:21 +01:00
* /
2022-04-11 14:04:30 +02:00
const plus = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
d : "M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"
} ) ) ;
/* harmony default export */ var library _plus = ( plus ) ;
2021-11-15 13:50:17 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/list-view.js
2021-11-08 15:29:21 +01:00
/ * *
2022-04-11 14:04:30 +02:00
* WordPress dependencies
2021-11-08 15:29:21 +01:00
* /
2022-04-11 14:04:30 +02:00
const listView = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
viewBox : "0 0 24 24" ,
xmlns : "http://www.w3.org/2000/svg"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
d : "M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"
} ) ) ;
/* harmony default export */ var list _view = ( listView ) ;
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/save-button/index.js
2021-11-08 15:29:21 +01:00
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* WordPress dependencies
2021-05-25 10:40:25 +02:00
* /
/ * *
2022-04-11 14:04:30 +02:00
* Internal dependencies
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
function SaveButton ( ) {
const {
hasEditedWidgetAreaIds ,
isSaving
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
var _getEditedWidgetAreas ;
const {
getEditedWidgetAreas ,
isSavingWidgetAreas
} = select ( store _store ) ;
return {
hasEditedWidgetAreaIds : ( ( _getEditedWidgetAreas = getEditedWidgetAreas ( ) ) === null || _getEditedWidgetAreas === void 0 ? void 0 : _getEditedWidgetAreas . length ) > 0 ,
isSaving : isSavingWidgetAreas ( )
} ;
} , [ ] ) ;
const {
saveEditedWidgetAreas
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
variant : "primary" ,
isBusy : isSaving ,
"aria-disabled" : isSaving ,
onClick : isSaving ? undefined : saveEditedWidgetAreas ,
disabled : ! hasEditedWidgetAreaIds
} , isSaving ? ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Saving…' ) : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Update' ) ) ;
2021-05-25 10:40:25 +02:00
}
2022-04-11 14:04:30 +02:00
/* harmony default export */ var save _button = ( SaveButton ) ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/undo.js
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* WordPress dependencies
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
const undo = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
d : "M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"
} ) ) ;
/* harmony default export */ var library _undo = ( undo ) ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/redo.js
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* WordPress dependencies
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
const redo = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
d : "M15.6 6.5l-1.1 1 2.9 3.3H8c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.3-.5h9.2L14.5 15l1.1 1.1 4.6-4.6-4.6-5z"
} ) ) ;
/* harmony default export */ var library _redo = ( redo ) ;
; // CONCATENATED MODULE: external ["wp","keycodes"]
var external _wp _keycodes _namespaceObject = window [ "wp" ] [ "keycodes" ] ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/header/undo-redo/undo.js
2021-11-08 15:29:21 +01:00
/ * *
2022-04-11 14:04:30 +02:00
* WordPress dependencies
2021-11-08 15:29:21 +01:00
* /
2022-04-11 14:04:30 +02:00
function UndoButton ( ) {
const hasUndo = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => select ( external _wp _coreData _namespaceObject . store ) . hasUndo ( ) , [ ] ) ;
const {
undo
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _coreData _namespaceObject . store ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . ToolbarButton , {
icon : ! ( 0 , external _wp _i18n _namespaceObject . isRTL ) ( ) ? library _undo : library _redo ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Undo' ) ,
shortcut : external _wp _keycodes _namespaceObject . displayShortcut . primary ( 'z' ) // If there are no undo levels we don't want to actually disable this
// button, because it will remove focus for keyboard users.
// See: https://github.com/WordPress/gutenberg/issues/3486
,
"aria-disabled" : ! hasUndo ,
onClick : hasUndo ? undo : undefined
} ) ;
2021-11-08 15:29:21 +01:00
}
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/header/undo-redo/redo.js
2021-11-08 15:29:21 +01:00
/ * *
2022-04-11 14:04:30 +02:00
* WordPress dependencies
2021-11-08 15:29:21 +01:00
* /
2022-04-11 14:04:30 +02:00
function RedoButton ( ) {
const hasRedo = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => select ( external _wp _coreData _namespaceObject . store ) . hasRedo ( ) , [ ] ) ;
const {
redo
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _coreData _namespaceObject . store ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . ToolbarButton , {
icon : ! ( 0 , external _wp _i18n _namespaceObject . isRTL ) ( ) ? library _redo : library _undo ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Redo' ) ,
shortcut : external _wp _keycodes _namespaceObject . displayShortcut . primaryShift ( 'z' ) // If there are no undo levels we don't want to actually disable this
// button, because it will remove focus for keyboard users.
// See: https://github.com/WordPress/gutenberg/issues/3486
,
"aria-disabled" : ! hasRedo ,
onClick : hasRedo ? redo : undefined
} ) ;
2021-11-08 15:29:21 +01:00
}
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/external.js
2021-11-08 15:29:21 +01:00
/ * *
2022-04-11 14:04:30 +02:00
* WordPress dependencies
2021-11-08 15:29:21 +01:00
* /
2022-04-11 14:04:30 +02:00
const external = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
d : "M18.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 */ var library _external = ( external ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/keyboard-shortcut-help-modal/config.js
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* WordPress dependencies
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
const textFormattingShortcuts = [ {
keyCombination : {
modifier : 'primary' ,
character : 'b'
} ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Make the selected text bold.' )
} , {
keyCombination : {
modifier : 'primary' ,
character : 'i'
} ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Make the selected text italic.' )
} , {
keyCombination : {
modifier : 'primary' ,
character : 'k'
} ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Convert the selected text into a link.' )
} , {
keyCombination : {
modifier : 'primaryShift' ,
character : 'k'
} ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Remove a link.' )
} , {
keyCombination : {
modifier : 'primary' ,
character : 'u'
} ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Underline the selected text.' )
} ] ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/keyboard-shortcut-help-modal/shortcut.js
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* External dependencies
2021-05-25 10:40:25 +02:00
* /
/ * *
2022-04-11 14:04:30 +02:00
* WordPress dependencies
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
function KeyCombination ( _ref ) {
let {
keyCombination ,
forceAriaLabel
} = _ref ;
const shortcut = keyCombination . modifier ? external _wp _keycodes _namespaceObject . displayShortcutList [ keyCombination . modifier ] ( keyCombination . character ) : keyCombination . character ;
const ariaLabel = keyCombination . modifier ? external _wp _keycodes _namespaceObject . shortcutAriaLabel [ keyCombination . modifier ] ( keyCombination . character ) : keyCombination . character ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( "kbd" , {
className : "edit-widgets-keyboard-shortcut-help-modal__shortcut-key-combination" ,
"aria-label" : forceAriaLabel || ariaLabel
} , ( 0 , external _lodash _namespaceObject . castArray ) ( shortcut ) . map ( ( character , index ) => {
if ( character === '+' ) {
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , {
key : index
} , character ) ;
}
return ( 0 , external _wp _element _namespaceObject . createElement ) ( "kbd" , {
key : index ,
className : "edit-widgets-keyboard-shortcut-help-modal__shortcut-key"
} , character ) ;
} ) ) ;
2021-05-25 10:40:25 +02:00
}
2022-04-11 14:04:30 +02:00
function Shortcut ( _ref2 ) {
let {
description ,
keyCombination ,
aliases = [ ] ,
ariaLabel
} = _ref2 ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "edit-widgets-keyboard-shortcut-help-modal__shortcut-description"
} , description ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "edit-widgets-keyboard-shortcut-help-modal__shortcut-term"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( KeyCombination , {
keyCombination : keyCombination ,
forceAriaLabel : ariaLabel
} ) , aliases . map ( ( alias , index ) => ( 0 , external _wp _element _namespaceObject . createElement ) ( KeyCombination , {
keyCombination : alias ,
forceAriaLabel : ariaLabel ,
key : index
} ) ) ) ) ;
2021-05-25 10:40:25 +02:00
}
2022-04-11 14:04:30 +02:00
/* harmony default export */ var keyboard _shortcut _help _modal _shortcut = ( Shortcut ) ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* WordPress dependencies
2021-05-25 10:40:25 +02:00
* /
2021-11-08 15:29:21 +01:00
/ * *
2022-04-11 14:04:30 +02:00
* Internal dependencies
2021-11-08 15:29:21 +01:00
* /
2022-04-11 14:04:30 +02:00
function DynamicShortcut ( _ref ) {
let {
name
} = _ref ;
const {
keyCombination ,
description ,
aliases
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
const {
getShortcutKeyCombination ,
getShortcutDescription ,
getShortcutAliases
} = select ( external _wp _keyboardShortcuts _namespaceObject . store ) ;
return {
keyCombination : getShortcutKeyCombination ( name ) ,
aliases : getShortcutAliases ( name ) ,
description : getShortcutDescription ( name )
} ;
} , [ name ] ) ;
if ( ! keyCombination ) {
return null ;
}
return ( 0 , external _wp _element _namespaceObject . createElement ) ( keyboard _shortcut _help _modal _shortcut , {
keyCombination : keyCombination ,
description : description ,
aliases : aliases
} ) ;
2021-11-08 15:29:21 +01:00
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
/* harmony default export */ var dynamic _shortcut = ( DynamicShortcut ) ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/keyboard-shortcut-help-modal/index.js
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* External dependencies
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
2021-05-25 10:40:25 +02:00
/ * *
* WordPress dependencies
* /
2022-04-11 14:04:30 +02:00
2021-05-25 10:40:25 +02:00
/ * *
* Internal dependencies
* /
2022-04-11 14:04:30 +02: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 */
( 0 , external _wp _element _namespaceObject . createElement ) ( "ul" , {
className : "edit-widgets-keyboard-shortcut-help-modal__shortcut-list" ,
role : "list"
} , shortcuts . map ( ( shortcut , index ) => ( 0 , external _wp _element _namespaceObject . createElement ) ( "li" , {
className : "edit-widgets-keyboard-shortcut-help-modal__shortcut" ,
key : index
} , ( 0 , external _lodash _namespaceObject . isString ) ( shortcut ) ? ( 0 , external _wp _element _namespaceObject . createElement ) ( dynamic _shortcut , {
name : shortcut
} ) : ( 0 , external _wp _element _namespaceObject . createElement ) ( keyboard _shortcut _help _modal _shortcut , shortcut ) ) ) )
/* eslint-enable jsx-a11y/no-redundant-roles */
) ;
} ;
const ShortcutSection = _ref2 => {
let {
title ,
shortcuts ,
className
} = _ref2 ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( "section" , {
className : classnames _default ( ) ( 'edit-widgets-keyboard-shortcut-help-modal__section' , className )
} , ! ! title && ( 0 , external _wp _element _namespaceObject . createElement ) ( "h2" , {
className : "edit-widgets-keyboard-shortcut-help-modal__section-title"
} , title ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( ShortcutList , {
shortcuts : shortcuts
} ) ) ;
} ;
const ShortcutCategorySection = _ref3 => {
let {
title ,
categoryName ,
additionalShortcuts = [ ]
} = _ref3 ;
const categoryShortcuts = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
return select ( external _wp _keyboardShortcuts _namespaceObject . store ) . getCategoryShortcuts ( categoryName ) ;
} , [ categoryName ] ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( ShortcutSection , {
title : title ,
shortcuts : categoryShortcuts . concat ( additionalShortcuts )
} ) ;
} ;
function KeyboardShortcutHelpModal ( _ref4 ) {
let {
isModalActive ,
toggleModal
} = _ref4 ;
( 0 , external _wp _keyboardShortcuts _namespaceObject . useShortcut ) ( 'core/edit-widgets/keyboard-shortcuts' , toggleModal , {
bindGlobal : true
} ) ;
if ( ! isModalActive ) {
return null ;
}
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Modal , {
className : "edit-widgets-keyboard-shortcut-help-modal" ,
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Keyboard shortcuts' ) ,
closeLabel : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Close' ) ,
onRequestClose : toggleModal
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( ShortcutSection , {
className : "edit-widgets-keyboard-shortcut-help-modal__main-shortcuts" ,
shortcuts : [ 'core/edit-widgets/keyboard-shortcuts' ]
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( ShortcutCategorySection , {
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Global shortcuts' ) ,
categoryName : "global"
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( ShortcutCategorySection , {
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Selection shortcuts' ) ,
categoryName : "selection"
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( ShortcutCategorySection , {
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Block shortcuts' ) ,
categoryName : "block" ,
additionalShortcuts : [ {
keyCombination : {
character : '/'
} ,
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Change the block type after adding a new paragraph.' ) ,
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
/* translators: The forward-slash character. e.g. '/'. */
ariaLabel : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Forward-slash' )
} ]
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( ShortcutSection , {
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Text formatting' ) ,
shortcuts : textFormattingShortcuts
} ) ) ;
}
2021-05-25 10:40:25 +02:00
2022-04-12 17:12:47 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/more-menu/tools-more-menu-group.js
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
const {
Fill : ToolsMoreMenuGroup ,
Slot
} = ( 0 , external _wp _components _namespaceObject . createSlotFill ) ( 'EditWidgetsToolsMoreMenuGroup' ) ;
ToolsMoreMenuGroup . Slot = _ref => {
let {
fillProps
} = _ref ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( Slot , {
fillProps : fillProps
} , fills => ! ( 0 , external _lodash _namespaceObject . isEmpty ) ( fills ) && fills ) ;
} ;
/* harmony default export */ var tools _more _menu _group = ( ToolsMoreMenuGroup ) ;
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/more-menu/index.js
2021-05-25 10:40:25 +02:00
/ * *
* WordPress dependencies
* /
2022-04-12 17:12:47 +02:00
2021-05-25 10:40:25 +02:00
/ * *
* Internal dependencies
* /
2022-04-12 17:12:47 +02:00
2022-04-11 14:04:30 +02:00
function MoreMenu ( ) {
const [ isKeyboardShortcutsModalActive , setIsKeyboardShortcutsModalVisible ] = ( 0 , external _wp _element _namespaceObject . useState ) ( false ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const toggleKeyboardShortcutsModal = ( ) => setIsKeyboardShortcutsModalVisible ( ! isKeyboardShortcutsModalActive ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
( 0 , external _wp _keyboardShortcuts _namespaceObject . useShortcut ) ( 'core/edit-widgets/keyboard-shortcuts' , toggleKeyboardShortcutsModal ) ;
const isLargeViewport = ( 0 , external _wp _compose _namespaceObject . useViewportMatch ) ( 'medium' ) ;
2022-04-12 17:12:47 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( MoreMenuDropdown , null , onClose => ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , isLargeViewport && ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . MenuGroup , {
2022-04-11 14:04:30 +02:00
label : ( 0 , external _wp _i18n _namespaceObject . _x ) ( 'View' , 'noun' )
2022-04-12 17:12:47 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _preferences _namespaceObject . PreferenceToggleMenuItem , {
2022-04-11 14:04:30 +02:00
scope : "core/edit-widgets" ,
2022-04-12 17:12:47 +02:00
name : "fixedToolbar" ,
2022-04-11 14:04:30 +02:00
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Top toolbar' ) ,
info : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Access all block and document tools in a single place' ) ,
messageActivated : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Top toolbar activated' ) ,
messageDeactivated : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Top toolbar deactivated' )
} ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . MenuGroup , {
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Tools' )
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . MenuItem , {
2021-05-25 10:40:25 +02:00
onClick : ( ) => {
2022-04-11 14:04:30 +02:00
setIsKeyboardShortcutsModalVisible ( true ) ;
} ,
shortcut : external _wp _keycodes _namespaceObject . displayShortcut . access ( 'h' )
2022-04-12 17:12:47 +02:00
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Keyboard shortcuts' ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _preferences _namespaceObject . PreferenceToggleMenuItem , {
2022-04-11 14:04:30 +02:00
scope : "core/edit-widgets" ,
2022-04-12 17:12:47 +02:00
name : "welcomeGuide" ,
2022-04-11 14:04:30 +02:00
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Welcome Guide' )
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . MenuItem , {
role : "menuitem" ,
icon : library _external ,
href : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'https://wordpress.org/support/article/block-based-widgets-editor/' ) ,
target : "_blank" ,
rel : "noopener noreferrer"
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Help' ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . VisuallyHidden , {
as : "span"
} ,
/* translators: accessibility text */
2022-04-12 17:12:47 +02:00
( 0 , external _wp _i18n _namespaceObject . _ _ ) ( '(opens in a new tab)' ) ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( tools _more _menu _group . Slot , {
fillProps : {
onClose
}
} ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . MenuGroup , {
2022-04-11 14:04:30 +02:00
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Preferences' )
2022-04-12 17:12:47 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _preferences _namespaceObject . PreferenceToggleMenuItem , {
2022-04-11 14:04:30 +02:00
scope : "core/edit-widgets" ,
2022-04-12 17:12:47 +02:00
name : "keepCaretInsideBlock" ,
2022-04-11 14:04:30 +02:00
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Contain text cursor inside block' ) ,
info : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Aids screen readers by stopping text caret from leaving blocks.' ) ,
messageActivated : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Contain text cursor inside block activated' ) ,
messageDeactivated : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Contain text cursor inside block deactivated' )
2022-04-12 17:12:47 +02:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _preferences _namespaceObject . PreferenceToggleMenuItem , {
2022-04-11 14:04:30 +02:00
scope : "core/edit-widgets" ,
2022-04-12 17:12:47 +02:00
name : "themeStyles" ,
2022-04-11 14:04:30 +02:00
info : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Make the editor look like your theme.' ) ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Use theme styles' )
2022-04-12 17:12:47 +02:00
} ) , isLargeViewport && ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _preferences _namespaceObject . PreferenceToggleMenuItem , {
2022-04-11 14:04:30 +02:00
scope : "core/edit-widgets" ,
2022-04-12 17:12:47 +02:00
name : "showBlockBreadcrumbs" ,
2022-04-11 14:04:30 +02:00
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Display block breadcrumbs' ) ,
info : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Shows block breadcrumbs at the bottom of the editor.' ) ,
messageActivated : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Display block breadcrumbs activated' ) ,
messageDeactivated : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Display block breadcrumbs deactivated' )
} ) ) ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( KeyboardShortcutHelpModal , {
isModalActive : isKeyboardShortcutsModalActive ,
toggleModal : toggleKeyboardShortcutsModal
} ) ) ;
2021-05-25 10:40:25 +02:00
}
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/header/index.js
2021-05-25 10:40:25 +02:00
/ * *
* WordPress dependencies
* /
/ * *
2022-04-11 14:04:30 +02:00
* Internal dependencies
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
function Header ( ) {
const isMediumViewport = ( 0 , external _wp _compose _namespaceObject . useViewportMatch ) ( 'medium' ) ;
const inserterButton = ( 0 , external _wp _element _namespaceObject . useRef ) ( ) ;
const widgetAreaClientId = use _last _selected _widget _area ( ) ;
const isLastSelectedWidgetAreaOpen = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => select ( store _store ) . getIsWidgetAreaOpen ( widgetAreaClientId ) , [ widgetAreaClientId ] ) ;
const {
isInserterOpen ,
isListViewOpen
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
const {
isInserterOpened ,
isListViewOpened
} = select ( store _store ) ;
return {
isInserterOpen : isInserterOpened ( ) ,
isListViewOpen : isListViewOpened ( )
} ;
} , [ ] ) ;
const {
setIsWidgetAreaOpen ,
setIsInserterOpened ,
setIsListViewOpened
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
const {
selectBlock
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _blockEditor _namespaceObject . store ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const handleClick = ( ) => {
if ( isInserterOpen ) {
2022-04-12 17:12:47 +02:00
// Focusing the inserter button closes the inserter popover.
2022-04-11 14:04:30 +02:00
setIsInserterOpened ( false ) ;
} else {
if ( ! isLastSelectedWidgetAreaOpen ) {
// Select the last selected block if hasn't already.
selectBlock ( widgetAreaClientId ) ; // Open the last selected widget area when opening the inserter.
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
setIsWidgetAreaOpen ( widgetAreaClientId , true ) ;
} // The DOM updates resulting from selectBlock() and setIsInserterOpened() calls are applied the
// same tick and pretty much in a random order. The inserter is closed if any other part of the
// app receives focus. If selectBlock() happens to take effect after setIsInserterOpened() then
// the inserter is visible for a brief moment and then gets auto-closed due to focus moving to
// the selected block.
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
window . requestAnimationFrame ( ( ) => setIsInserterOpened ( true ) ) ;
}
} ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const toggleListView = ( 0 , external _wp _element _namespaceObject . useCallback ) ( ( ) => setIsListViewOpened ( ! isListViewOpen ) , [ setIsListViewOpened , isListViewOpen ] ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "edit-widgets-header"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "edit-widgets-header__navigable-toolbar-wrapper"
} , isMediumViewport && ( 0 , external _wp _element _namespaceObject . createElement ) ( "h1" , {
className : "edit-widgets-header__title"
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Widgets' ) ) , ! isMediumViewport && ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . VisuallyHidden , {
as : "h1" ,
className : "edit-widgets-header__title"
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Widgets' ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . NavigableToolbar , {
className : "edit-widgets-header-toolbar" ,
"aria-label" : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Document tools' )
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . ToolbarItem , {
ref : inserterButton ,
as : external _wp _components _namespaceObject . Button ,
className : "edit-widgets-header-toolbar__inserter-toggle" ,
variant : "primary" ,
isPressed : isInserterOpen ,
onMouseDown : event => {
event . preventDefault ( ) ;
2021-05-25 10:40:25 +02:00
} ,
2022-04-11 14:04:30 +02:00
onClick : handleClick ,
icon : library _plus
/ * 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 : ( 0 , external _wp _i18n _namespaceObject . _x ) ( 'Toggle block inserter' , 'Generic label for block inserter button' )
} ) , isMediumViewport && ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( UndoButton , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( RedoButton , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . ToolbarItem , {
as : external _wp _components _namespaceObject . Button ,
className : "edit-widgets-header-toolbar__list-view-toggle" ,
icon : list _view ,
isPressed : isListViewOpen
/* translators: button label text should, if possible, be under 16 characters. */
,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'List View' ) ,
onClick : toggleListView
} ) ) ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "edit-widgets-header__actions"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( save _button , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( pinned _items . Slot , {
scope : "core/edit-widgets"
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( MoreMenu , null ) ) ) ) ;
2021-05-25 10:40:25 +02:00
}
2022-04-11 14:04:30 +02:00
/* harmony default export */ var header = ( Header ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/notices/index.js
2021-05-25 10:40:25 +02:00
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
2022-04-11 14:04:30 +02:00
function Notices ( ) {
const {
removeNotice
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _notices _namespaceObject . store ) ;
const {
notices
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
return {
notices : select ( external _wp _notices _namespaceObject . store ) . getNotices ( )
} ;
} , [ ] ) ;
const dismissibleNotices = ( 0 , external _lodash _namespaceObject . filter ) ( notices , {
isDismissible : true ,
type : 'default'
} ) ;
const nonDismissibleNotices = ( 0 , external _lodash _namespaceObject . filter ) ( notices , {
isDismissible : false ,
type : 'default'
} ) ;
const snackbarNotices = ( 0 , external _lodash _namespaceObject . filter ) ( notices , {
type : 'snackbar'
} ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . NoticeList , {
notices : nonDismissibleNotices ,
className : "edit-widgets-notices__pinned"
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . NoticeList , {
notices : dismissibleNotices ,
className : "edit-widgets-notices__dismissible" ,
onRemove : removeNotice
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . SnackbarList , {
notices : snackbarNotices ,
className : "edit-widgets-notices__snackbar" ,
onRemove : removeNotice
} ) ) ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
/* harmony default export */ var notices = ( Notices ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/widget-areas-block-editor-content/index.js
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* WordPress dependencies
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* Internal dependencies
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
function WidgetAreasBlockEditorContent ( _ref ) {
let {
blockEditorSettings
} = _ref ;
2022-04-12 17:12:47 +02:00
const hasThemeStyles = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => ! ! select ( external _wp _preferences _namespaceObject . store ) . get ( 'core/edit-widgets' , 'themeStyles' ) , [ ] ) ;
2022-04-11 14:04:30 +02:00
const styles = ( 0 , external _wp _element _namespaceObject . useMemo ) ( ( ) => {
return hasThemeStyles ? blockEditorSettings . styles : [ ] ;
} , [ blockEditorSettings , hasThemeStyles ] ) ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "edit-widgets-block-editor"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( notices , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . BlockTools , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( keyboard _shortcuts , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . _ _unstableEditorStyles , {
styles : styles
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . BlockSelectionClearer , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . WritingFlow , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . ObserveTyping , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . BlockList , {
className : "edit-widgets-main-block-list"
} ) ) ) ) ) ) ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close.js
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* WordPress dependencies
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
const close _close = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
d : "M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"
} ) ) ;
/* harmony default export */ var library _close = ( close _close ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/hooks/use-widget-library-insertion-point.js
/ * *
* WordPress dependencies
* /
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
/ * *
* Internal dependencies
* /
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const useWidgetLibraryInsertionPoint = ( ) => {
const firstRootId = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
var _widgetAreasPost$bloc ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
// Default to the first widget area
const {
getEntityRecord
} = select ( external _wp _coreData _namespaceObject . store ) ;
const widgetAreasPost = getEntityRecord ( KIND , POST _TYPE , buildWidgetAreasPostId ( ) ) ;
return widgetAreasPost === null || widgetAreasPost === void 0 ? void 0 : ( _widgetAreasPost$bloc = widgetAreasPost . blocks [ 0 ] ) === null || _widgetAreasPost$bloc === void 0 ? void 0 : _widgetAreasPost$bloc . clientId ;
} , [ ] ) ;
return ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
const {
getBlockRootClientId ,
getBlockSelectionEnd ,
getBlockOrder ,
getBlockIndex
} = select ( external _wp _blockEditor _namespaceObject . store ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const insertionPoint = select ( store _store ) . _ _experimentalGetInsertionPoint ( ) ; // "Browse all" in the quick inserter will set the rootClientId to the current block.
// Otherwise, it will just be undefined, and we'll have to handle it differently below.
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
if ( insertionPoint . rootClientId ) {
return insertionPoint ;
2021-05-25 10:40:25 +02:00
}
2022-04-11 14:04:30 +02:00
const clientId = getBlockSelectionEnd ( ) || firstRootId ;
const rootClientId = getBlockRootClientId ( clientId ) ; // If the selected block is at the root level, it's a widget area and
// blocks can't be inserted here. Return this block as the root and the
// last child clientId indicating insertion at the end.
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
if ( clientId && rootClientId === '' ) {
return {
rootClientId : clientId ,
insertionIndex : getBlockOrder ( clientId ) . length
} ;
}
2021-05-25 10:40:25 +02:00
return {
2022-04-11 14:04:30 +02:00
rootClientId ,
insertionIndex : getBlockIndex ( clientId ) + 1
2021-05-25 10:40:25 +02:00
} ;
2022-04-11 14:04:30 +02:00
} , [ firstRootId ] ) ;
} ;
/* harmony default export */ var use _widget _library _insertion _point = ( useWidgetLibraryInsertionPoint ) ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/secondary-sidebar/inserter-sidebar.js
2021-05-25 10:40:25 +02:00
/ * *
* WordPress dependencies
* /
2021-11-08 15:29:21 +01:00
2021-05-25 10:40:25 +02:00
2022-04-12 17:12:47 +02:00
2022-04-11 14:04:30 +02:00
/ * *
* Internal dependencies
* /
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
function InserterSidebar ( ) {
const isMobileViewport = ( 0 , external _wp _compose _namespaceObject . useViewportMatch ) ( 'medium' , '<' ) ;
const {
rootClientId ,
insertionIndex
} = use _widget _library _insertion _point ( ) ;
const {
setIsInserterOpened
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
const closeInserter = ( 0 , external _wp _element _namespaceObject . useCallback ) ( ( ) => {
2022-04-12 17:12:47 +02:00
return setIsInserterOpened ( false ) ;
2022-04-11 14:04:30 +02:00
} , [ setIsInserterOpened ] ) ;
2022-04-12 17:12:47 +02:00
const TagName = ! isMobileViewport ? external _wp _components _namespaceObject . VisuallyHidden : 'div' ;
2022-04-11 14:04:30 +02:00
const [ inserterDialogRef , inserterDialogProps ] = ( 0 , external _wp _compose _namespaceObject . _ _experimentalUseDialog ) ( {
2022-04-12 17:12:47 +02:00
onClose : closeInserter ,
focusOnMount : null
2022-04-11 14:04:30 +02:00
} ) ;
2022-04-12 17:12:47 +02:00
const libraryRef = ( 0 , external _wp _element _namespaceObject . useRef ) ( ) ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
libraryRef . current . focusSearch ( ) ;
} , [ ] ) ;
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , _extends ( {
ref : inserterDialogRef
} , inserterDialogProps , {
className : "edit-widgets-layout__inserter-panel"
2022-04-12 17:12:47 +02:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( TagName , {
2022-04-11 14:04:30 +02:00
className : "edit-widgets-layout__inserter-panel-header"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
icon : library _close ,
2022-04-12 17:12:47 +02:00
onClick : closeInserter ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Close block inserter' )
2022-04-11 14:04:30 +02:00
} ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "edit-widgets-layout__inserter-panel-content"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . _ _experimentalLibrary , {
showInserterHelpPanel : true ,
shouldFocusBlock : isMobileViewport ,
rootClientId : rootClientId ,
2022-04-12 17:12:47 +02:00
_ _experimentalInsertionIndex : insertionIndex ,
ref : libraryRef
2022-04-11 14:04:30 +02:00
} ) ) ) ;
}
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/secondary-sidebar/list-view-sidebar.js
2021-05-25 10:40:25 +02:00
2021-07-15 20:55:29 +02:00
/ * *
* WordPress dependencies
* /
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
/ * *
* Internal dependencies
* /
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
function ListViewSidebar ( ) {
const {
setIsListViewOpened
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
const focusOnMountRef = ( 0 , external _wp _compose _namespaceObject . useFocusOnMount ) ( 'firstElement' ) ;
2022-04-12 17:12:47 +02:00
const headerFocusReturnRef = ( 0 , external _wp _compose _namespaceObject . useFocusReturn ) ( ) ;
const contentFocusReturnRef = ( 0 , external _wp _compose _namespaceObject . useFocusReturn ) ( ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
function closeOnEscape ( event ) {
if ( event . keyCode === external _wp _keycodes _namespaceObject . ESCAPE && ! event . defaultPrevented ) {
event . preventDefault ( ) ;
setIsListViewOpened ( false ) ;
}
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const instanceId = ( 0 , external _wp _compose _namespaceObject . useInstanceId ) ( ListViewSidebar ) ;
const labelId = ` edit-widgets-editor__list-view-panel-label- ${ instanceId } ` ;
return ( // eslint-disable-next-line jsx-a11y/no-static-element-interactions
( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
"aria-labelledby" : labelId ,
className : "edit-widgets-editor__list-view-panel" ,
onKeyDown : closeOnEscape
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
2022-04-12 17:12:47 +02:00
className : "edit-widgets-editor__list-view-panel-header" ,
ref : headerFocusReturnRef
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( "strong" , {
id : labelId
2022-04-12 17:12:47 +02:00
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'List View' ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
2022-04-11 14:04:30 +02:00
icon : close _small ,
2022-04-12 17:12:47 +02:00
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Close List View Sidebar' ) ,
2022-04-11 14:04:30 +02:00
onClick : ( ) => setIsListViewOpened ( false )
} ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "edit-widgets-editor__list-view-panel-content" ,
2022-04-12 17:12:47 +02:00
ref : ( 0 , external _wp _compose _namespaceObject . useMergeRefs ) ( [ contentFocusReturnRef , focusOnMountRef ] )
2022-04-11 14:04:30 +02:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . _ _experimentalListView , {
showNestedBlocks : true ,
_ _experimentalHideContainerBlockActions : true ,
_ _experimentalFeatures : true ,
_ _experimentalPersistentListViewFeatures : true
} ) ) )
) ;
2021-05-25 10:40:25 +02:00
}
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/secondary-sidebar/index.js
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
/ * *
* WordPress dependencies
* /
2021-11-08 15:29:21 +01:00
/ * *
2022-04-11 14:04:30 +02:00
* Internal dependencies
2021-11-08 15:29:21 +01:00
* /
2022-04-11 14:04:30 +02:00
2021-11-08 15:29:21 +01:00
/ * *
2022-04-11 14:04:30 +02:00
* Internal dependencies
2021-11-08 15:29:21 +01:00
* /
2022-04-11 14:04:30 +02:00
function SecondarySidebar ( ) {
const {
isInserterOpen ,
isListViewOpen
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
const {
isInserterOpened ,
isListViewOpened
} = select ( store _store ) ;
return {
isInserterOpen : isInserterOpened ( ) ,
isListViewOpen : isListViewOpened ( )
} ;
} , [ ] ) ;
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
if ( isInserterOpen ) {
return ( 0 , external _wp _element _namespaceObject . createElement ) ( InserterSidebar , null ) ;
}
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
if ( isListViewOpen ) {
return ( 0 , external _wp _element _namespaceObject . createElement ) ( ListViewSidebar , null ) ;
}
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
return null ;
}
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/layout/interface.js
2021-11-08 15:29:21 +01:00
/ * *
* WordPress dependencies
* /
2022-04-11 14:04:30 +02:00
2022-04-12 17:12:47 +02:00
2021-11-08 15:29:21 +01:00
/ * *
* Internal dependencies
* /
2022-04-11 14:04:30 +02:00
const interfaceLabels = {
/* translators: accessibility text for the widgets screen top bar landmark region. */
header : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Widgets top bar' ) ,
/* translators: accessibility text for the widgets screen content landmark region. */
body : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Widgets and blocks' ) ,
/* translators: accessibility text for the widgets screen settings landmark region. */
sidebar : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Widgets settings' ) ,
/* translators: accessibility text for the widgets screen footer landmark region. */
footer : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Widgets footer' )
} ;
function Interface ( _ref ) {
2021-11-15 13:50:17 +01:00
let {
2022-04-11 14:04:30 +02:00
blockEditorSettings
2021-11-15 13:50:17 +01:00
} = _ref ;
2022-04-11 14:04:30 +02:00
const isMobileViewport = ( 0 , external _wp _compose _namespaceObject . useViewportMatch ) ( 'medium' , '<' ) ;
const isHugeViewport = ( 0 , external _wp _compose _namespaceObject . useViewportMatch ) ( 'huge' , '>=' ) ;
2021-11-08 15:29:21 +01:00
const {
2022-04-11 14:04:30 +02:00
setIsInserterOpened ,
setIsListViewOpened ,
closeGeneralSidebar
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store _store ) ;
const {
hasBlockBreadCrumbsEnabled ,
hasSidebarEnabled ,
isInserterOpened ,
isListViewOpened ,
previousShortcut ,
nextShortcut
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => ( {
hasSidebarEnabled : ! ! select ( store ) . getActiveComplementaryArea ( store _store . name ) ,
isInserterOpened : ! ! select ( store _store ) . isInserterOpened ( ) ,
isListViewOpened : ! ! select ( store _store ) . isListViewOpened ( ) ,
2022-04-12 17:12:47 +02:00
hasBlockBreadCrumbsEnabled : ! ! select ( external _wp _preferences _namespaceObject . store ) . get ( 'core/edit-widgets' , 'showBlockBreadcrumbs' ) ,
2022-04-11 14:04:30 +02:00
previousShortcut : select ( external _wp _keyboardShortcuts _namespaceObject . store ) . getAllShortcutKeyCombinations ( 'core/edit-widgets/previous-region' ) ,
nextShortcut : select ( external _wp _keyboardShortcuts _namespaceObject . store ) . getAllShortcutKeyCombinations ( 'core/edit-widgets/next-region' )
} ) , [ ] ) ; // Inserter and Sidebars are mutually exclusive
2021-11-08 15:29:21 +01:00
2022-04-11 14:04:30 +02:00
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
if ( hasSidebarEnabled && ! isHugeViewport ) {
setIsInserterOpened ( false ) ;
setIsListViewOpened ( false ) ;
2021-11-08 15:29:21 +01:00
}
2022-04-11 14:04:30 +02:00
} , [ hasSidebarEnabled , isHugeViewport ] ) ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
if ( ( isInserterOpened || isListViewOpened ) && ! isHugeViewport ) {
closeGeneralSidebar ( ) ;
}
} , [ isInserterOpened , isListViewOpened , isHugeViewport ] ) ;
const hasSecondarySidebar = isListViewOpened || isInserterOpened ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( interface _skeleton , {
labels : interfaceLabels ,
header : ( 0 , external _wp _element _namespaceObject . createElement ) ( header , null ) ,
secondarySidebar : hasSecondarySidebar && ( 0 , external _wp _element _namespaceObject . createElement ) ( SecondarySidebar , null ) ,
sidebar : hasSidebarEnabled && ( 0 , external _wp _element _namespaceObject . createElement ) ( complementary _area . Slot , {
scope : "core/edit-widgets"
} ) ,
2022-04-12 17:12:47 +02:00
content : ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( WidgetAreasBlockEditorContent , {
2022-04-11 14:04:30 +02:00
blockEditorSettings : blockEditorSettings
2022-04-12 17:12:47 +02:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . BlockStyles . Slot , {
scope : "core/block-inspector"
} ) ) ,
2022-04-11 14:04:30 +02:00
footer : hasBlockBreadCrumbsEnabled && ! isMobileViewport && ( 0 , external _wp _element _namespaceObject . createElement ) ( "div" , {
className : "edit-widgets-layout__footer"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . BlockBreadcrumb , {
rootLabelText : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Widgets' )
} ) ) ,
shortcuts : {
previous : previousShortcut ,
next : nextShortcut
}
} ) ;
2021-11-08 15:29:21 +01:00
}
2022-04-11 14:04:30 +02:00
/* harmony default export */ var layout _interface = ( Interface ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/layout/unsaved-changes-warning.js
2021-05-25 10:40:25 +02:00
/ * *
* WordPress dependencies
* /
/ * *
2022-04-11 14:04:30 +02:00
* Internal dependencies
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
/ * *
* Warns the user if there are unsaved changes before leaving the editor .
*
* This is a duplicate of the component implemented in the editor package .
* Duplicated here as edit - widgets doesn ' t depend on editor .
*
* @ return { WPComponent } The component .
* /
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
function UnsavedChangesWarning ( ) {
const isDirty = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
const {
getEditedWidgetAreas
} = select ( store _store ) ;
const editedWidgetAreas = getEditedWidgetAreas ( ) ;
return ( editedWidgetAreas === null || editedWidgetAreas === void 0 ? void 0 : editedWidgetAreas . length ) > 0 ;
} , [ ] ) ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
/ * *
* Warns the user if there are unsaved changes before leaving the editor .
*
* @ param { Event } event ` beforeunload ` event .
*
* @ return { ? string } Warning prompt message , if unsaved changes exist .
* /
const warnIfUnsavedChanges = event => {
if ( isDirty ) {
event . returnValue = ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'You have unsaved changes. If you proceed, they will be lost.' ) ;
return event . returnValue ;
}
} ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
window . addEventListener ( 'beforeunload' , warnIfUnsavedChanges ) ;
return ( ) => {
window . removeEventListener ( 'beforeunload' , warnIfUnsavedChanges ) ;
} ;
} , [ isDirty ] ) ;
return null ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/welcome-guide/index.js
2021-05-25 10:40:25 +02:00
/ * *
* WordPress dependencies
* /
2022-04-11 14:04:30 +02:00
/ * *
* Internal dependencies
* /
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
function WelcomeGuide ( ) {
var _widgetAreas$filter$l ;
2021-05-25 10:40:25 +02:00
2022-04-12 17:12:47 +02:00
const isActive = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => ! ! select ( external _wp _preferences _namespaceObject . store ) . get ( 'core/edit-widgets' , 'welcomeGuide' ) , [ ] ) ;
2022-04-11 14:04:30 +02:00
const {
2022-04-12 17:12:47 +02:00
toggle
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _preferences _namespaceObject . store ) ;
2022-04-11 14:04:30 +02:00
const widgetAreas = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => select ( store _store ) . getWidgetAreas ( {
per _page : - 1
} ) , [ ] ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
if ( ! isActive ) {
return null ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const isEntirelyBlockWidgets = widgetAreas === null || widgetAreas === void 0 ? void 0 : widgetAreas . every ( widgetArea => widgetArea . id === 'wp_inactive_widgets' || widgetArea . widgets . every ( widgetId => widgetId . startsWith ( 'block-' ) ) ) ;
const numWidgetAreas = ( _widgetAreas$filter$l = widgetAreas === null || widgetAreas === void 0 ? void 0 : widgetAreas . filter ( widgetArea => widgetArea . id !== 'wp_inactive_widgets' ) . length ) !== null && _widgetAreas$filter$l !== void 0 ? _widgetAreas$filter$l : 0 ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Guide , {
className : "edit-widgets-welcome-guide" ,
contentLabel : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Welcome to block Widgets' ) ,
finishButtonText : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Get started' ) ,
2022-04-12 17:12:47 +02:00
onFinish : ( ) => toggle ( 'core/edit-widgets' , 'welcomeGuide' ) ,
2022-04-11 14:04:30 +02:00
pages : [ {
image : ( 0 , external _wp _element _namespaceObject . createElement ) ( WelcomeGuideImage , {
nonAnimatedSrc : "https://s.w.org/images/block-editor/welcome-canvas.svg" ,
animatedSrc : "https://s.w.org/images/block-editor/welcome-canvas.gif"
} ) ,
content : ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( "h1" , {
className : "edit-widgets-welcome-guide__heading"
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Welcome to block Widgets' ) ) , isEntirelyBlockWidgets ? ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( "p" , {
className : "edit-widgets-welcome-guide__text"
} , ( 0 , external _wp _i18n _namespaceObject . sprintf ) ( // Translators: %s: Number of block areas in the current theme.
( 0 , external _wp _i18n _namespaceObject . _n ) ( 'Your theme provides %s “block” area for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ ll look on your site.' , 'Your theme provides %s different “block” areas for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ ll look on your site.' , numWidgetAreas ) , numWidgetAreas ) ) ) : ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( "p" , {
className : "edit-widgets-welcome-guide__text"
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'You can now add any block to your site’ s widget areas. Don’ t worry, all of your favorite widgets still work flawlessly.' ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "p" , {
className : "edit-widgets-welcome-guide__text"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( "strong" , null , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Want to stick with the old widgets?' ) ) , ' ' , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . ExternalLink , {
href : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'https://wordpress.org/plugins/classic-widgets/' )
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Get the Classic Widgets plugin.' ) ) ) ) )
} , {
image : ( 0 , external _wp _element _namespaceObject . createElement ) ( WelcomeGuideImage , {
nonAnimatedSrc : "https://s.w.org/images/block-editor/welcome-editor.svg" ,
animatedSrc : "https://s.w.org/images/block-editor/welcome-editor.gif"
} ) ,
content : ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( "h1" , {
className : "edit-widgets-welcome-guide__heading"
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Make each block your own' ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "p" , {
className : "edit-widgets-welcome-guide__text"
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.' ) ) )
} , {
image : ( 0 , external _wp _element _namespaceObject . createElement ) ( WelcomeGuideImage , {
nonAnimatedSrc : "https://s.w.org/images/block-editor/welcome-library.svg" ,
animatedSrc : "https://s.w.org/images/block-editor/welcome-library.gif"
} ) ,
content : ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( "h1" , {
className : "edit-widgets-welcome-guide__heading"
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Get to know the block library' ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "p" , {
className : "edit-widgets-welcome-guide__text"
} , ( 0 , external _wp _element _namespaceObject . createInterpolateElement ) ( ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'All of the blocks available to you live in the block library. You’ ll find it wherever you see the <InserterIconImage /> icon.' ) , {
InserterIconImage : ( 0 , external _wp _element _namespaceObject . createElement ) ( "img" , {
className : "edit-widgets-welcome-guide__inserter-icon" ,
alt : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'inserter' ) ,
src : "data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A"
} )
} ) ) )
} , {
image : ( 0 , external _wp _element _namespaceObject . createElement ) ( WelcomeGuideImage , {
nonAnimatedSrc : "https://s.w.org/images/block-editor/welcome-documentation.svg" ,
animatedSrc : "https://s.w.org/images/block-editor/welcome-documentation.gif"
} ) ,
content : ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _element _namespaceObject . Fragment , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( "h1" , {
className : "edit-widgets-welcome-guide__heading"
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Learn how to use the block editor' ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "p" , {
className : "edit-widgets-welcome-guide__text"
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'New to the block editor? Want to learn more about using it? ' ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . ExternalLink , {
href : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'https://wordpress.org/support/article/wordpress-editor/' )
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( "Here's a detailed guide." ) ) ) )
} ]
} ) ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
function WelcomeGuideImage ( _ref ) {
let {
nonAnimatedSrc ,
animatedSrc
} = _ref ;
return ( 0 , external _wp _element _namespaceObject . createElement ) ( "picture" , {
className : "edit-widgets-welcome-guide__image"
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( "source" , {
srcSet : nonAnimatedSrc ,
media : "(prefers-reduced-motion: reduce)"
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "img" , {
src : animatedSrc ,
width : "312" ,
height : "240" ,
alt : ""
} ) ) ;
}
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/layout/index.js
2021-05-25 10:40:25 +02:00
/ * *
* WordPress dependencies
* /
2022-04-12 17:12:47 +02:00
2022-04-11 14:04:30 +02:00
/ * *
* Internal dependencies
* /
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
function Layout ( _ref ) {
let {
blockEditorSettings ,
onError
} = _ref ;
2022-04-12 17:12:47 +02:00
const {
createErrorNotice
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _notices _namespaceObject . store ) ;
function onPluginAreaError ( name ) {
createErrorNotice ( ( 0 , external _wp _i18n _namespaceObject . sprintf ) (
/* translators: %s: plugin name */
( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'The "%s" plugin has encountered an error and cannot be rendered.' ) , name ) ) ;
}
2022-04-11 14:04:30 +02:00
return ( 0 , external _wp _element _namespaceObject . createElement ) ( ErrorBoundary , {
onError : onError
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( WidgetAreasBlockEditorProvider , {
blockEditorSettings : blockEditorSettings
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( layout _interface , {
blockEditorSettings : blockEditorSettings
2022-04-12 17:12:47 +02:00
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( Sidebar , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Popover . Slot , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _plugins _namespaceObject . PluginArea , {
onError : onPluginAreaError
} ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( UnsavedChangesWarning , null ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( WelcomeGuide , null ) ) ) ;
2022-04-11 14:04:30 +02:00
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
/* harmony default export */ var layout = ( Layout ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/index.js
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
/ * *
* WordPress dependencies
* /
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
/ * *
* Internal dependencies
* /
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const disabledBlocks = [ 'core/more' , 'core/freeform' , 'core/template-part' , ... ( ALLOW _REUSABLE _BLOCKS ? [ ] : [ 'core/block' ] ) ] ;
/ * *
* Reinitializes the editor after the user chooses to reboot the editor after
* an unhandled error occurs , replacing previously mounted editor element using
* an initial state from prior to the crash .
*
* @ param { Element } target DOM node in which editor is rendered .
* @ param { ? Object } settings Editor settings object .
* /
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
function reinitializeEditor ( target , settings ) {
( 0 , external _wp _element _namespaceObject . unmountComponentAtNode ) ( target ) ;
const reboot = reinitializeEditor . bind ( null , target , settings ) ;
( 0 , external _wp _element _namespaceObject . render ) ( ( 0 , external _wp _element _namespaceObject . createElement ) ( layout , {
blockEditorSettings : settings ,
onError : reboot
} ) , target ) ;
}
2021-05-25 10:40:25 +02:00
/ * *
2022-04-11 14:04:30 +02:00
* Initializes the block editor in the widgets screen .
*
* @ param { string } id ID of the root element to render the screen in .
* @ param { Object } settings Block editor settings .
2021-05-25 10:40:25 +02:00
* /
2022-04-11 14:04:30 +02:00
function initialize ( id , settings ) {
const target = document . getElementById ( id ) ;
const reboot = reinitializeEditor . bind ( null , target , settings ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const coreBlocks = ( 0 , external _wp _blockLibrary _namespaceObject . _ _experimentalGetCoreBlocks ) ( ) . filter ( block => {
return ! ( disabledBlocks . includes ( block . name ) || block . name . startsWith ( 'core/post' ) || block . name . startsWith ( 'core/query' ) || block . name . startsWith ( 'core/site' ) || block . name . startsWith ( 'core/navigation' ) ) ;
} ) ;
2021-05-25 10:40:25 +02:00
2022-04-12 17:12:47 +02:00
( 0 , external _wp _data _namespaceObject . dispatch ) ( external _wp _preferences _namespaceObject . store ) . setDefaults ( 'core/edit-widgets' , {
2022-04-11 14:04:30 +02:00
fixedToolbar : false ,
welcomeGuide : true ,
showBlockBreadcrumbs : true ,
themeStyles : true
} ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
( 0 , external _wp _data _namespaceObject . dispatch ) ( external _wp _blocks _namespaceObject . store ) . _ _experimentalReapplyBlockTypeFilters ( ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
( 0 , external _wp _blockLibrary _namespaceObject . registerCoreBlocks ) ( coreBlocks ) ;
( 0 , external _wp _widgets _namespaceObject . registerLegacyWidgetBlock ) ( ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
if ( false ) { }
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
( 0 , external _wp _widgets _namespaceObject . registerLegacyWidgetVariations ) ( settings ) ;
registerBlock ( widget _area _namespaceObject ) ;
( 0 , external _wp _widgets _namespaceObject . registerWidgetGroupBlock ) ( ) ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
settings . _ _experimentalFetchLinkSuggestions = ( search , searchOptions ) => ( 0 , external _wp _coreData _namespaceObject . _ _experimentalFetchLinkSuggestions ) ( search , searchOptions , settings ) ; // As we are unregistering `core/freeform` to avoid the Classic block, we must
// replace it with something as the default freeform content handler. Failure to
// do this will result in errors in the default block parser.
// see: https://github.com/WordPress/gutenberg/issues/33097
( 0 , external _wp _blocks _namespaceObject . setFreeformContentHandlerName ) ( 'core/html' ) ;
( 0 , external _wp _element _namespaceObject . render ) ( ( 0 , external _wp _element _namespaceObject . createElement ) ( layout , {
blockEditorSettings : settings ,
onError : reboot
} ) , target ) ;
2021-05-25 10:40:25 +02:00
}
2022-04-11 14:04:30 +02:00
/ * *
* Function to register an individual block .
*
* @ param { Object } block The block to be registered .
*
* /
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const registerBlock = block => {
if ( ! block ) {
return ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
const {
metadata ,
settings ,
name
} = block ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
if ( metadata ) {
( 0 , external _wp _blocks _namespaceObject . unstable _ _bootstrapServerSideBlockDefinitions ) ( {
[ name ] : metadata
} ) ;
}
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
( 0 , external _wp _blocks _namespaceObject . registerBlockType ) ( name , settings ) ;
} ;
2021-05-25 10:40:25 +02:00
2022-04-11 14:04:30 +02:00
} ( ) ;
( window . wp = window . wp || { } ) . editWidgets = _ _webpack _exports _ _ ;
/******/ } ) ( )
;