2020-01-03 14:17:24 +01:00
this [ "wp" ] = this [ "wp" ] || { } ; this [ "wp" ] [ "blockDirectory" ] =
/******/ ( function ( modules ) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = { } ;
/******/
/******/ // The require function
/******/ function _ _webpack _require _ _ ( moduleId ) {
/******/
/******/ // Check if module is in cache
/******/ if ( installedModules [ moduleId ] ) {
/******/ return installedModules [ moduleId ] . exports ;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules [ moduleId ] = {
/******/ i : moduleId ,
/******/ l : false ,
/******/ exports : { }
/******/ } ;
/******/
/******/ // Execute the module function
/******/ modules [ moduleId ] . call ( module . exports , module , module . exports , _ _webpack _require _ _ ) ;
/******/
/******/ // Flag the module as loaded
/******/ module . l = true ;
/******/
/******/ // Return the exports of the module
/******/ return module . exports ;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ _ _webpack _require _ _ . m = modules ;
/******/
/******/ // expose the module cache
/******/ _ _webpack _require _ _ . c = installedModules ;
/******/
/******/ // define getter function for harmony exports
/******/ _ _webpack _require _ _ . d = function ( exports , name , getter ) {
/******/ if ( ! _ _webpack _require _ _ . o ( exports , name ) ) {
/******/ Object . defineProperty ( exports , name , { enumerable : true , get : getter } ) ;
/******/ }
/******/ } ;
/******/
/******/ // define __esModule on exports
/******/ _ _webpack _require _ _ . r = function ( exports ) {
/******/ if ( typeof Symbol !== 'undefined' && Symbol . toStringTag ) {
/******/ Object . defineProperty ( exports , Symbol . toStringTag , { value : 'Module' } ) ;
/******/ }
/******/ Object . defineProperty ( exports , '__esModule' , { value : true } ) ;
/******/ } ;
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ _ _webpack _require _ _ . t = function ( value , mode ) {
/******/ if ( mode & 1 ) value = _ _webpack _require _ _ ( value ) ;
/******/ if ( mode & 8 ) return value ;
/******/ if ( ( mode & 4 ) && typeof value === 'object' && value && value . _ _esModule ) return value ;
/******/ var ns = Object . create ( null ) ;
/******/ _ _webpack _require _ _ . r ( ns ) ;
/******/ Object . defineProperty ( ns , 'default' , { enumerable : true , value : value } ) ;
/******/ if ( mode & 2 && typeof value != 'string' ) for ( var key in value ) _ _webpack _require _ _ . d ( ns , key , function ( key ) { return value [ key ] ; } . bind ( null , key ) ) ;
/******/ return ns ;
/******/ } ;
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ _ _webpack _require _ _ . n = function ( module ) {
/******/ var getter = module && module . _ _esModule ?
/******/ function getDefault ( ) { return module [ 'default' ] ; } :
/******/ function getModuleExports ( ) { return module ; } ;
/******/ _ _webpack _require _ _ . d ( getter , 'a' , getter ) ;
/******/ return getter ;
/******/ } ;
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ _ _webpack _require _ _ . o = function ( object , property ) { return Object . prototype . hasOwnProperty . call ( object , property ) ; } ;
/******/
/******/ // __webpack_public_path__
/******/ _ _webpack _require _ _ . p = "" ;
/******/
/******/
/******/ // Load entry module and return exports
2021-02-02 06:17:13 +01:00
/******/ return _ _webpack _require _ _ ( _ _webpack _require _ _ . s = 463 ) ;
2020-01-03 14:17:24 +01:00
/******/ } )
/************************************************************************/
/******/ ( {
/***/ 0 :
/***/ ( function ( module , exports ) {
2021-01-28 03:04:13 +01:00
( function ( ) { module . exports = window [ "wp" ] [ "element" ] ; } ( ) ) ;
2020-01-03 14:17:24 +01:00
/***/ } ) ,
/***/ 1 :
/***/ ( function ( module , exports ) {
2021-01-28 03:04:13 +01:00
( function ( ) { module . exports = window [ "wp" ] [ "i18n" ] ; } ( ) ) ;
2020-02-10 23:33:27 +01:00
/***/ } ) ,
2020-10-13 15:10:30 +02:00
/***/ 11 :
2020-06-26 15:33:47 +02:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2020-01-03 14:17:24 +01:00
2020-07-21 14:14:37 +02:00
"use strict" ;
// EXPORTS
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return /* binding */ _slicedToArray ; } ) ;
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
var arrayWithHoles = _ _webpack _require _ _ ( 38 ) ;
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
function _iterableToArrayLimit ( arr , i ) {
if ( typeof Symbol === "undefined" || ! ( Symbol . iterator in Object ( arr ) ) ) return ;
var _arr = [ ] ;
var _n = true ;
var _d = false ;
var _e = undefined ;
try {
for ( var _i = arr [ Symbol . iterator ] ( ) , _s ; ! ( _n = ( _s = _i . next ( ) ) . done ) ; _n = true ) {
_arr . push ( _s . value ) ;
if ( i && _arr . length === i ) break ;
}
} catch ( err ) {
_d = true ;
_e = err ;
} finally {
try {
if ( ! _n && _i [ "return" ] != null ) _i [ "return" ] ( ) ;
} finally {
if ( _d ) throw _e ;
}
}
return _arr ;
}
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
2021-02-02 06:17:13 +01:00
var unsupportedIterableToArray = _ _webpack _require _ _ ( 31 ) ;
2020-07-21 14:14:37 +02:00
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
var nonIterableRest = _ _webpack _require _ _ ( 39 ) ;
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
function _slicedToArray ( arr , i ) {
return Object ( arrayWithHoles [ "a" /* default */ ] ) ( arr ) || _iterableToArrayLimit ( arr , i ) || Object ( unsupportedIterableToArray [ "a" /* default */ ] ) ( arr , i ) || Object ( nonIterableRest [ "a" /* default */ ] ) ( ) ;
}
/***/ } ) ,
2021-01-28 03:04:13 +01:00
/***/ 12 :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = window [ "wp" ] [ "compose" ] ; } ( ) ) ;
/***/ } ) ,
/***/ 13 :
2020-07-21 14:14:37 +02:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2020-06-26 15:33:47 +02:00
"use strict" ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _objectWithoutProperties ; } ) ;
2021-02-02 06:17:13 +01:00
/* harmony import */ var _babel _runtime _helpers _esm _objectWithoutPropertiesLoose _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 44 ) ;
2020-06-26 15:33:47 +02:00
function _objectWithoutProperties ( source , excluded ) {
if ( source == null ) return { } ;
2021-01-28 03:04:13 +01:00
var target = Object ( _babel _runtime _helpers _esm _objectWithoutPropertiesLoose _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ /* default */ "a" ] ) ( source , excluded ) ;
2020-06-26 15:33:47 +02:00
var key , i ;
if ( Object . getOwnPropertySymbols ) {
var sourceSymbolKeys = Object . getOwnPropertySymbols ( source ) ;
for ( i = 0 ; i < sourceSymbolKeys . length ; i ++ ) {
key = sourceSymbolKeys [ i ] ;
if ( excluded . indexOf ( key ) >= 0 ) continue ;
if ( ! Object . prototype . propertyIsEnumerable . call ( source , key ) ) continue ;
target [ key ] = source [ key ] ;
}
}
return target ;
}
2020-01-03 14:17:24 +01:00
2020-10-13 15:10:30 +02:00
/***/ } ) ,
2021-02-02 06:17:13 +01:00
/***/ 138 :
2020-10-13 15:10:30 +02:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony import */ var _babel _runtime _helpers _esm _defineProperty _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 5 ) ;
2021-01-28 03:04:13 +01:00
/* harmony import */ var _babel _runtime _helpers _esm _objectWithoutProperties _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( 13 ) ;
2020-10-13 15:10:30 +02:00
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _2 _ _ = _ _webpack _require _ _ ( 0 ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _2 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _2 _ _ ) ;
function ownKeys ( object , enumerableOnly ) { var keys = Object . keys ( object ) ; if ( Object . getOwnPropertySymbols ) { var symbols = Object . getOwnPropertySymbols ( object ) ; if ( enumerableOnly ) symbols = symbols . filter ( function ( sym ) { return Object . getOwnPropertyDescriptor ( object , sym ) . enumerable ; } ) ; keys . push . apply ( keys , symbols ) ; } return keys ; }
function _objectSpread ( target ) { for ( var i = 1 ; i < arguments . length ; i ++ ) { var source = arguments [ i ] != null ? arguments [ i ] : { } ; if ( i % 2 ) { ownKeys ( Object ( source ) , true ) . forEach ( function ( key ) { Object ( _babel _runtime _helpers _esm _defineProperty _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ /* default */ "a" ] ) ( target , key , source [ key ] ) ; } ) ; } else if ( Object . getOwnPropertyDescriptors ) { Object . defineProperties ( target , Object . getOwnPropertyDescriptors ( source ) ) ; } else { ownKeys ( Object ( source ) ) . forEach ( function ( key ) { Object . defineProperty ( target , key , Object . getOwnPropertyDescriptor ( source , key ) ) ; } ) ; } } return target ; }
/ * *
* WordPress dependencies
* /
2020-10-20 15:36:16 +02:00
/** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */
2020-10-13 15:10:30 +02:00
/ * *
* Return an SVG icon .
*
* @ param { IconProps } props icon is the SVG component to render
* size is a number specifiying the icon size in pixels
* Other props will be passed to wrapped SVG component
*
* @ return { JSX . Element } Icon component
* /
function Icon ( _ref ) {
var icon = _ref . icon ,
_ref$size = _ref . size ,
size = _ref$size === void 0 ? 24 : _ref$size ,
props = Object ( _babel _runtime _helpers _esm _objectWithoutProperties _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ /* default */ "a" ] ) ( _ref , [ "icon" , "size" ] ) ;
return Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _2 _ _ [ "cloneElement" ] ) ( icon , _objectSpread ( {
width : size ,
height : size
} , props ) ) ;
}
/* harmony default export */ _ _webpack _exports _ _ [ "a" ] = ( Icon ) ;
2020-01-03 14:17:24 +01:00
/***/ } ) ,
2021-01-28 03:04:13 +01:00
/***/ 15 :
2020-06-26 15:33:47 +02:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
2020-06-29 13:50:29 +02:00
// EXPORTS
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return /* binding */ _toConsumableArray ; } ) ;
2020-06-26 15:33:47 +02:00
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
2021-01-28 03:04:13 +01:00
var arrayLikeToArray = _ _webpack _require _ _ ( 24 ) ;
2020-06-26 15:33:47 +02:00
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
function _arrayWithoutHoles ( arr ) {
if ( Array . isArray ( arr ) ) return Object ( arrayLikeToArray [ "a" /* default */ ] ) ( arr ) ;
}
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
2020-10-13 15:10:30 +02:00
var iterableToArray = _ _webpack _require _ _ ( 37 ) ;
2020-06-26 15:33:47 +02:00
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
2021-02-02 06:17:13 +01:00
var unsupportedIterableToArray = _ _webpack _require _ _ ( 31 ) ;
2020-06-26 15:33:47 +02:00
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
function _nonIterableSpread ( ) {
throw new TypeError ( "Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method." ) ;
}
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
function _toConsumableArray ( arr ) {
return _arrayWithoutHoles ( arr ) || Object ( iterableToArray [ "a" /* default */ ] ) ( arr ) || Object ( unsupportedIterableToArray [ "a" /* default */ ] ) ( arr ) || _nonIterableSpread ( ) ;
}
/***/ } ) ,
2021-02-02 06:17:13 +01:00
/***/ 16 :
2020-06-26 15:33:47 +02:00
/***/ ( function ( module , exports ) {
2021-01-28 03:04:13 +01:00
( function ( ) { module . exports = window [ "regeneratorRuntime" ] ; } ( ) ) ;
2020-06-26 15:33:47 +02:00
2020-10-13 15:10:30 +02:00
/***/ } ) ,
2021-01-28 03:04:13 +01:00
/***/ 2 :
2020-10-20 15:36:16 +02:00
/***/ ( function ( module , exports ) {
2021-01-28 03:04:13 +01:00
( function ( ) { module . exports = window [ "lodash" ] ; } ( ) ) ;
2020-10-20 15:36:16 +02:00
/***/ } ) ,
2021-02-02 06:17:13 +01:00
/***/ 215 :
2020-10-13 15:10:30 +02:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 0 ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( 7 ) ;
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
/ * *
* WordPress dependencies
* /
var blockDefault = Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "SVG" ] , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "Path" ] , {
d : "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"
} ) ) ;
/* harmony default export */ _ _webpack _exports _ _ [ "a" ] = ( blockDefault ) ;
2020-01-03 14:17:24 +01:00
/***/ } ) ,
2021-01-28 03:04:13 +01:00
/***/ 24 :
2020-03-24 00:40:19 +01:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _arrayLikeToArray ; } ) ;
function _arrayLikeToArray ( arr , len ) {
if ( len == null || len > arr . length ) len = arr . length ;
for ( var i = 0 , arr2 = new Array ( len ) ; i < len ; i ++ ) {
arr2 [ i ] = arr [ i ] ;
}
return arr2 ;
}
/***/ } ) ,
2021-02-02 06:17:13 +01:00
/***/ 278 :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = window [ "wp" ] [ "editPost" ] ; } ( ) ) ;
/***/ } ) ,
/***/ 3 :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = window [ "wp" ] [ "components" ] ; } ( ) ) ;
/***/ } ) ,
/***/ 303 :
2020-06-26 15:33:47 +02:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 0 ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
2020-10-13 15:10:30 +02:00
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( 7 ) ;
2020-06-26 15:33:47 +02:00
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
/ * *
* WordPress dependencies
* /
var starFilled = Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "SVG" ] , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "Path" ] , {
d : "M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"
} ) ) ;
/* harmony default export */ _ _webpack _exports _ _ [ "a" ] = ( starFilled ) ;
/***/ } ) ,
2021-02-02 06:17:13 +01:00
/***/ 304 :
2020-06-26 15:33:47 +02:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 0 ) ;
/* harmony import */ var _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
2020-10-13 15:10:30 +02:00
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( 7 ) ;
2020-06-26 15:33:47 +02:00
/* harmony import */ var _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
/ * *
* WordPress dependencies
* /
var starEmpty = Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "SVG" ] , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , Object ( _wordpress _element _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ "createElement" ] ) ( _wordpress _primitives _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ "Path" ] , {
fillRule : "evenodd" ,
d : "M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z" ,
clipRule : "evenodd"
} ) ) ;
/* harmony default export */ _ _webpack _exports _ _ [ "a" ] = ( starEmpty ) ;
2020-12-01 13:19:43 +01:00
/***/ } ) ,
2021-02-02 06:17:13 +01:00
/***/ 31 :
2020-12-01 13:19:43 +01:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _unsupportedIterableToArray ; } ) ;
2021-01-28 03:04:13 +01:00
/* harmony import */ var _babel _runtime _helpers _esm _arrayLikeToArray _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 24 ) ;
2020-12-01 13:19:43 +01:00
function _unsupportedIterableToArray ( o , minLen ) {
if ( ! o ) return ;
2021-01-28 03:04:13 +01:00
if ( typeof o === "string" ) return Object ( _babel _runtime _helpers _esm _arrayLikeToArray _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ /* default */ "a" ] ) ( o , minLen ) ;
2020-12-01 13:19:43 +01:00
var n = Object . prototype . toString . call ( o ) . slice ( 8 , - 1 ) ;
if ( n === "Object" && o . constructor ) n = o . constructor . name ;
if ( n === "Map" || n === "Set" ) return Array . from ( o ) ;
2021-01-28 03:04:13 +01:00
if ( n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/ . test ( n ) ) return Object ( _babel _runtime _helpers _esm _arrayLikeToArray _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ /* default */ "a" ] ) ( o , minLen ) ;
2020-12-01 13:19:43 +01:00
}
2020-03-24 00:40:19 +01:00
/***/ } ) ,
2021-02-02 06:17:13 +01:00
/***/ 33 :
2020-10-13 15:10:30 +02:00
/***/ ( function ( module , exports ) {
2021-01-28 03:04:13 +01:00
( function ( ) { module . exports = window [ "wp" ] [ "hooks" ] ; } ( ) ) ;
2020-10-13 15:10:30 +02:00
/***/ } ) ,
/***/ 37 :
2020-01-03 14:17:24 +01:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _iterableToArray ; } ) ;
function _iterableToArray ( iter ) {
2020-03-24 00:40:19 +01:00
if ( typeof Symbol !== "undefined" && Symbol . iterator in Object ( iter ) ) return Array . from ( iter ) ;
2020-01-03 14:17:24 +01:00
}
/***/ } ) ,
2020-03-24 00:40:19 +01:00
/***/ 38 :
2020-01-08 12:57:23 +01:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _arrayWithHoles ; } ) ;
function _arrayWithHoles ( arr ) {
if ( Array . isArray ( arr ) ) return arr ;
}
/***/ } ) ,
2020-03-24 00:40:19 +01:00
/***/ 39 :
2020-01-08 12:57:23 +01:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _nonIterableRest ; } ) ;
function _nonIterableRest ( ) {
2020-03-24 00:40:19 +01:00
throw new TypeError ( "Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method." ) ;
2020-01-08 12:57:23 +01:00
}
/***/ } ) ,
2020-02-06 22:03:31 +01:00
/***/ 4 :
/***/ ( function ( module , exports ) {
2021-01-28 03:04:13 +01:00
( function ( ) { module . exports = window [ "wp" ] [ "data" ] ; } ( ) ) ;
2020-02-06 22:03:31 +01:00
/***/ } ) ,
2021-02-02 06:17:13 +01:00
/***/ 44 :
2020-06-26 15:33:47 +02:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2020-02-06 22:03:31 +01:00
2020-06-26 15:33:47 +02:00
"use strict" ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _objectWithoutPropertiesLoose ; } ) ;
function _objectWithoutPropertiesLoose ( source , excluded ) {
if ( source == null ) return { } ;
var target = { } ;
var sourceKeys = Object . keys ( source ) ;
var key , i ;
for ( i = 0 ; i < sourceKeys . length ; i ++ ) {
key = sourceKeys [ i ] ;
if ( excluded . indexOf ( key ) >= 0 ) continue ;
target [ key ] = source [ key ] ;
}
return target ;
}
2020-02-06 22:03:31 +01:00
/***/ } ) ,
2021-02-02 06:17:13 +01:00
/***/ 463 :
2020-01-03 14:17:24 +01:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
2020-06-29 13:50:29 +02:00
// ESM COMPAT FLAG
2020-01-03 14:17:24 +01:00
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
2020-06-29 13:50:29 +02:00
2021-01-28 03:04:13 +01:00
// EXPORTS
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "store" , function ( ) { return /* reexport */ store ; } ) ;
2020-06-29 13:50:29 +02:00
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-directory/build-module/store/selectors.js
2020-01-03 14:17:24 +01:00
var selectors _namespaceObject = { } ;
_ _webpack _require _ _ . r ( selectors _namespaceObject ) ;
2021-01-28 03:04:13 +01:00
_ _webpack _require _ _ . d ( selectors _namespaceObject , "isRequestingDownloadableBlocks" , function ( ) { return selectors _isRequestingDownloadableBlocks ; } ) ;
2020-01-03 14:17:24 +01:00
_ _webpack _require _ _ . d ( selectors _namespaceObject , "getDownloadableBlocks" , function ( ) { return selectors _getDownloadableBlocks ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "getInstalledBlockTypes" , function ( ) { return getInstalledBlockTypes ; } ) ;
2020-06-26 15:33:47 +02:00
_ _webpack _require _ _ . d ( selectors _namespaceObject , "getNewBlockTypes" , function ( ) { return getNewBlockTypes ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "getUnusedBlockTypes" , function ( ) { return getUnusedBlockTypes ; } ) ;
2021-01-28 03:04:13 +01:00
_ _webpack _require _ _ . d ( selectors _namespaceObject , "isInstalling" , function ( ) { return selectors _isInstalling ; } ) ;
2020-06-26 15:33:47 +02:00
_ _webpack _require _ _ . d ( selectors _namespaceObject , "getErrorNotices" , function ( ) { return getErrorNotices ; } ) ;
2021-01-28 03:04:13 +01:00
_ _webpack _require _ _ . d ( selectors _namespaceObject , "getErrorNoticeForBlock" , function ( ) { return selectors _getErrorNoticeForBlock ; } ) ;
2020-06-29 13:50:29 +02:00
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-directory/build-module/store/actions.js
2020-01-03 14:17:24 +01:00
var actions _namespaceObject = { } ;
_ _webpack _require _ _ . r ( actions _namespaceObject ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "fetchDownloadableBlocks" , function ( ) { return fetchDownloadableBlocks ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "receiveDownloadableBlocks" , function ( ) { return receiveDownloadableBlocks ; } ) ;
2020-06-26 15:33:47 +02:00
_ _webpack _require _ _ . d ( actions _namespaceObject , "installBlockType" , function ( ) { return actions _installBlockType ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "uninstallBlockType" , function ( ) { return actions _uninstallBlockType ; } ) ;
2020-01-03 14:17:24 +01:00
_ _webpack _require _ _ . d ( actions _namespaceObject , "addInstalledBlockType" , function ( ) { return addInstalledBlockType ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "removeInstalledBlockType" , function ( ) { return removeInstalledBlockType ; } ) ;
2020-06-26 15:33:47 +02:00
_ _webpack _require _ _ . d ( actions _namespaceObject , "setIsInstalling" , function ( ) { return setIsInstalling ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "setErrorNotice" , function ( ) { return setErrorNotice ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "clearErrorNotice" , function ( ) { return clearErrorNotice ; } ) ;
2021-01-28 03:04:13 +01:00
// EXTERNAL MODULE: external ["wp","element"]
var external _wp _element _ = _ _webpack _require _ _ ( 0 ) ;
// EXTERNAL MODULE: external ["wp","plugins"]
2021-02-02 06:17:13 +01:00
var external _wp _plugins _ = _ _webpack _require _ _ ( 73 ) ;
2021-01-28 03:04:13 +01:00
// EXTERNAL MODULE: external ["wp","hooks"]
2021-02-02 06:17:13 +01:00
var external _wp _hooks _ = _ _webpack _require _ _ ( 33 ) ;
2021-01-28 03:04:13 +01:00
// EXTERNAL MODULE: external ["wp","blocks"]
var external _wp _blocks _ = _ _webpack _require _ _ ( 9 ) ;
// EXTERNAL MODULE: external ["wp","data"]
var external _wp _data _ = _ _webpack _require _ _ ( 4 ) ;
2020-07-07 16:43:35 +02:00
2020-06-26 15:33:47 +02:00
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
var defineProperty = _ _webpack _require _ _ ( 5 ) ;
2020-01-03 14:17:24 +01:00
2021-01-28 03:04:13 +01:00
// EXTERNAL MODULE: external ["wp","dataControls"]
2021-02-02 06:17:13 +01:00
var external _wp _dataControls _ = _ _webpack _require _ _ ( 49 ) ;
2020-01-03 14:17:24 +01:00
2020-06-26 15:33:47 +02:00
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
2021-01-28 03:04:13 +01:00
var toConsumableArray = _ _webpack _require _ _ ( 15 ) ;
2020-07-07 16:43:35 +02:00
2021-01-28 03:04:13 +01:00
// EXTERNAL MODULE: external "lodash"
var external _lodash _ = _ _webpack _require _ _ ( 2 ) ;
2020-01-03 14:17:24 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/reducer.js
2020-02-06 22:03:31 +01:00
function ownKeys ( object , enumerableOnly ) { var keys = Object . keys ( object ) ; if ( Object . getOwnPropertySymbols ) { var symbols = Object . getOwnPropertySymbols ( object ) ; if ( enumerableOnly ) symbols = symbols . filter ( function ( sym ) { return Object . getOwnPropertyDescriptor ( object , sym ) . enumerable ; } ) ; keys . push . apply ( keys , symbols ) ; } return keys ; }
function _objectSpread ( target ) { for ( var i = 1 ; i < arguments . length ; i ++ ) { var source = arguments [ i ] != null ? arguments [ i ] : { } ; if ( i % 2 ) { ownKeys ( Object ( source ) , true ) . forEach ( function ( key ) { Object ( defineProperty [ "a" /* default */ ] ) ( target , key , source [ key ] ) ; } ) ; } else if ( Object . getOwnPropertyDescriptors ) { Object . defineProperties ( target , Object . getOwnPropertyDescriptors ( source ) ) ; } else { ownKeys ( Object ( source ) ) . forEach ( function ( key ) { Object . defineProperty ( target , key , Object . getOwnPropertyDescriptor ( source , key ) ) ; } ) ; } } return target ; }
2020-01-03 14:17:24 +01:00
2020-07-07 16:43:35 +02:00
/ * *
* External dependencies
* /
2020-01-03 14:17:24 +01:00
/ * *
* WordPress dependencies
* /
2020-07-07 16:43:35 +02:00
2020-01-03 14:17:24 +01:00
/ * *
* Reducer returning an array of downloadable blocks .
*
* @ param { Object } state Current state .
* @ param { Object } action Dispatched action .
*
* @ return { Object } Updated state .
* /
var reducer _downloadableBlocks = function downloadableBlocks ( ) {
2020-06-26 15:33:47 +02:00
var state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
2020-01-03 14:17:24 +01:00
var action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
switch ( action . type ) {
case 'FETCH_DOWNLOADABLE_BLOCKS' :
2020-10-13 15:10:30 +02:00
return _objectSpread ( _objectSpread ( { } , state ) , { } , Object ( defineProperty [ "a" /* default */ ] ) ( { } , action . filterValue , {
2020-06-26 15:33:47 +02:00
isRequesting : true
} ) ) ;
2020-01-03 14:17:24 +01:00
case 'RECEIVE_DOWNLOADABLE_BLOCKS' :
2020-10-13 15:10:30 +02:00
return _objectSpread ( _objectSpread ( { } , state ) , { } , Object ( defineProperty [ "a" /* default */ ] ) ( { } , action . filterValue , {
2020-06-26 15:33:47 +02:00
results : action . downloadableBlocks ,
isRequesting : false
} ) ) ;
2020-02-06 22:03:31 +01:00
}
2020-01-03 14:17:24 +01:00
2020-02-06 22:03:31 +01:00
return state ;
} ;
/ * *
* Reducer managing the installation and deletion of blocks .
*
* @ param { Object } state Current state .
* @ param { Object } action Dispatched action .
*
* @ return { Object } Updated state .
* /
var reducer _blockManagement = function blockManagement ( ) {
var state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : {
2020-06-26 15:33:47 +02:00
installedBlockTypes : [ ] ,
isInstalling : { }
2020-02-06 22:03:31 +01:00
} ;
var action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2020-01-03 14:17:24 +01:00
2020-02-06 22:03:31 +01:00
switch ( action . type ) {
2020-01-03 14:17:24 +01:00
case 'ADD_INSTALLED_BLOCK_TYPE' :
2020-10-13 15:10:30 +02:00
return _objectSpread ( _objectSpread ( { } , state ) , { } , {
2020-01-03 14:17:24 +01:00
installedBlockTypes : [ ] . concat ( Object ( toConsumableArray [ "a" /* default */ ] ) ( state . installedBlockTypes ) , [ action . item ] )
} ) ;
case 'REMOVE_INSTALLED_BLOCK_TYPE' :
2020-10-13 15:10:30 +02:00
return _objectSpread ( _objectSpread ( { } , state ) , { } , {
2020-01-03 14:17:24 +01:00
installedBlockTypes : state . installedBlockTypes . filter ( function ( blockType ) {
return blockType . name !== action . item . name ;
} )
} ) ;
2020-06-26 15:33:47 +02:00
case 'SET_INSTALLING_BLOCK' :
2020-10-13 15:10:30 +02:00
return _objectSpread ( _objectSpread ( { } , state ) , { } , {
isInstalling : _objectSpread ( _objectSpread ( { } , state . isInstalling ) , { } , Object ( defineProperty [ "a" /* default */ ] ) ( { } , action . blockId , action . isInstalling ) )
2020-06-26 15:33:47 +02:00
} ) ;
2020-01-03 14:17:24 +01:00
}
return state ;
} ;
2020-06-26 15:33:47 +02:00
/ * *
* Reducer returning an object of error notices .
*
* @ param { Object } state Current state .
* @ param { Object } action Dispatched action .
*
* @ return { Object } Updated state .
* /
var reducer _errorNotices = function errorNotices ( ) {
var state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
var action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
switch ( action . type ) {
case 'SET_ERROR_NOTICE' :
2020-10-13 15:10:30 +02:00
return _objectSpread ( _objectSpread ( { } , state ) , { } , Object ( defineProperty [ "a" /* default */ ] ) ( { } , action . blockId , {
2020-07-07 16:43:35 +02:00
message : action . message ,
isFatal : action . isFatal
} ) ) ;
case 'CLEAR_ERROR_NOTICE' :
2021-01-28 03:04:13 +01:00
return Object ( external _lodash _ [ "omit" ] ) ( state , action . blockId ) ;
2020-06-26 15:33:47 +02:00
}
return state ;
} ;
2021-01-28 03:04:13 +01:00
/* harmony default export */ var reducer = ( Object ( external _wp _data _ [ "combineReducers" ] ) ( {
2020-02-06 22:03:31 +01:00
downloadableBlocks : reducer _downloadableBlocks ,
blockManagement : reducer _blockManagement ,
2020-06-26 15:33:47 +02:00
errorNotices : reducer _errorNotices
2020-01-03 14:17:24 +01:00
} ) ) ;
2020-06-26 15:33:47 +02:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/utils/has-block-type.js
/ * *
* Check if a block list contains a specific block type . Recursively searches
* through ` innerBlocks ` if they exist .
*
* @ param { Object } blockType A block object to search for .
* @ param { Object [ ] } blocks The list of blocks to look through .
*
* @ return { boolean } Whether the blockType is found .
* /
function hasBlockType ( blockType ) {
var blocks = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : [ ] ;
if ( ! blocks . length ) {
return false ;
}
if ( blocks . some ( function ( _ref ) {
var name = _ref . name ;
return name === blockType . name ;
} ) ) {
return true ;
}
for ( var i = 0 ; i < blocks . length ; i ++ ) {
if ( hasBlockType ( blockType , blocks [ i ] . innerBlocks ) ) {
return true ;
}
}
return false ;
}
2020-01-03 14:17:24 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/selectors.js
2020-06-26 15:33:47 +02:00
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2020-01-03 14:17:24 +01:00
/ * *
* Returns true if application is requesting for downloadable blocks .
*
2020-10-13 15:10:30 +02:00
* @ param { Object } state Global application state .
2020-06-26 15:33:47 +02:00
* @ param { string } filterValue Search string .
*
2020-10-13 15:10:30 +02:00
* @ return { boolean } Whether a request is in progress for the blocks list .
2020-01-03 14:17:24 +01:00
* /
2020-06-26 15:33:47 +02:00
2021-01-28 03:04:13 +01:00
function selectors _isRequestingDownloadableBlocks ( state , filterValue ) {
2020-06-26 15:33:47 +02:00
if ( ! state . downloadableBlocks [ filterValue ] || ! state . downloadableBlocks [ filterValue ] . isRequesting ) {
return false ;
}
return state . downloadableBlocks [ filterValue ] . isRequesting ;
2020-01-03 14:17:24 +01:00
}
/ * *
2020-10-13 15:10:30 +02:00
* Returns the available uninstalled blocks .
2020-01-03 14:17:24 +01:00
*
* @ param { Object } state Global application state .
* @ param { string } filterValue Search string .
*
2020-10-13 15:10:30 +02:00
* @ return { Array } Downloadable blocks .
2020-01-03 14:17:24 +01:00
* /
function selectors _getDownloadableBlocks ( state , filterValue ) {
2020-06-26 15:33:47 +02:00
if ( ! state . downloadableBlocks [ filterValue ] || ! state . downloadableBlocks [ filterValue ] . results ) {
2020-01-03 14:17:24 +01:00
return [ ] ;
}
2020-06-26 15:33:47 +02:00
return state . downloadableBlocks [ filterValue ] . results ;
2020-01-03 14:17:24 +01:00
}
/ * *
2020-10-13 15:10:30 +02:00
* Returns the block types that have been installed on the server in this
* session .
2020-01-03 14:17:24 +01:00
*
* @ param { Object } state Global application state .
*
2020-10-13 15:10:30 +02:00
* @ return { Array } Block type items
2020-01-03 14:17:24 +01:00
* /
function getInstalledBlockTypes ( state ) {
2020-02-06 22:03:31 +01:00
return state . blockManagement . installedBlockTypes ;
2020-01-03 14:17:24 +01:00
}
/ * *
2020-06-26 15:33:47 +02:00
* Returns block types that have been installed on the server and used in the
* current post .
*
* @ param { Object } state Global application state .
*
* @ return { Array } Block type items .
2020-01-03 14:17:24 +01:00
* /
2021-01-28 03:04:13 +01:00
var getNewBlockTypes = Object ( external _wp _data _ [ "createRegistrySelector" ] ) ( function ( select ) {
2020-06-26 15:33:47 +02:00
return function ( state ) {
var usedBlockTree = select ( 'core/block-editor' ) . getBlocks ( ) ;
var installedBlockTypes = getInstalledBlockTypes ( state ) ;
2020-10-13 15:10:30 +02:00
return installedBlockTypes . filter ( function ( blockType ) {
return hasBlockType ( blockType , usedBlockTree ) ;
2020-06-26 15:33:47 +02:00
} ) ;
} ;
} ) ;
2020-01-03 14:17:24 +01:00
/ * *
2020-06-26 15:33:47 +02:00
* Returns the block types that have been installed on the server but are not
* used in the current post .
*
* @ param { Object } state Global application state .
*
* @ return { Array } Block type items .
2020-01-03 14:17:24 +01:00
* /
2021-01-28 03:04:13 +01:00
var getUnusedBlockTypes = Object ( external _wp _data _ [ "createRegistrySelector" ] ) ( function ( select ) {
2020-06-26 15:33:47 +02:00
return function ( state ) {
var usedBlockTree = select ( 'core/block-editor' ) . getBlocks ( ) ;
var installedBlockTypes = getInstalledBlockTypes ( state ) ;
2020-10-13 15:10:30 +02:00
return installedBlockTypes . filter ( function ( blockType ) {
return ! hasBlockType ( blockType , usedBlockTree ) ;
2020-06-26 15:33:47 +02:00
} ) ;
} ;
} ) ;
2020-01-03 14:17:24 +01:00
/ * *
2020-10-13 15:10:30 +02:00
* Returns true if a block plugin install is in progress .
2020-01-03 14:17:24 +01:00
*
2020-10-13 15:10:30 +02:00
* @ param { Object } state Global application state .
2020-06-26 15:33:47 +02:00
* @ param { string } blockId Id of the block .
2020-01-03 14:17:24 +01:00
*
2020-10-13 15:10:30 +02:00
* @ return { boolean } Whether this block is currently being installed .
2020-01-03 14:17:24 +01:00
* /
2021-01-28 03:04:13 +01:00
function selectors _isInstalling ( state , blockId ) {
2020-06-26 15:33:47 +02:00
return state . blockManagement . isInstalling [ blockId ] || false ;
2020-01-03 14:17:24 +01:00
}
/ * *
2020-10-13 15:10:30 +02:00
* Returns all block error notices .
2020-01-03 14:17:24 +01:00
*
2020-06-26 15:33:47 +02:00
* @ param { Object } state Global application state .
2020-01-03 14:17:24 +01:00
*
2020-06-26 15:33:47 +02:00
* @ return { Object } Object with error notices .
2020-01-03 14:17:24 +01:00
* /
2020-06-26 15:33:47 +02:00
function getErrorNotices ( state ) {
return state . errorNotices ;
2020-01-03 14:17:24 +01:00
}
/ * *
2020-06-26 15:33:47 +02:00
* Returns the error notice for a given block .
2020-01-03 14:17:24 +01:00
*
2020-06-26 15:33:47 +02:00
* @ param { Object } state Global application state .
* @ param { string } blockId The ID of the block plugin . eg : my - block
2020-01-03 14:17:24 +01:00
*
2020-06-26 15:33:47 +02:00
* @ return { string | boolean } The error text , or false if no error .
2020-01-03 14:17:24 +01:00
* /
2021-01-28 03:04:13 +01:00
function selectors _getErrorNoticeForBlock ( state , blockId ) {
2020-07-07 16:43:35 +02:00
return state . errorNotices [ blockId ] ;
2020-01-03 14:17:24 +01:00
}
2020-06-26 15:33:47 +02:00
2021-01-28 03:04:13 +01:00
// EXTERNAL MODULE: external "regeneratorRuntime"
2021-02-02 06:17:13 +01:00
var external _regeneratorRuntime _ = _ _webpack _require _ _ ( 16 ) ;
2021-01-28 03:04:13 +01:00
var external _regeneratorRuntime _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( external _regeneratorRuntime _ ) ;
// EXTERNAL MODULE: external ["wp","i18n"]
var external _wp _i18n _ = _ _webpack _require _ _ ( 1 ) ;
2020-06-26 15:33:47 +02:00
2021-01-28 03:04:13 +01:00
// EXTERNAL MODULE: external ["wp","notices"]
2021-02-02 06:17:13 +01:00
var external _wp _notices _ = _ _webpack _require _ _ ( 51 ) ;
2020-06-26 15:33:47 +02:00
2020-07-27 22:10:36 +02:00
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
2021-01-28 03:04:13 +01:00
var asyncToGenerator = _ _webpack _require _ _ ( 47 ) ;
2020-07-27 22:10:36 +02:00
2021-01-28 03:04:13 +01:00
// EXTERNAL MODULE: external ["wp","apiFetch"]
2021-02-02 06:17:13 +01:00
var external _wp _apiFetch _ = _ _webpack _require _ _ ( 50 ) ;
2021-01-28 03:04:13 +01:00
var external _wp _apiFetch _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( external _wp _apiFetch _ ) ;
2020-07-07 16:43:35 +02:00
2020-06-26 15:33:47 +02:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/controls.js
2020-07-27 22:10:36 +02:00
2021-01-28 03:04:13 +01:00
function _createForOfIteratorHelper ( o , allowArrayLike ) { var it ; if ( typeof Symbol === "undefined" || o [ Symbol . iterator ] == null ) { if ( Array . isArray ( o ) || ( it = _unsupportedIterableToArray ( o ) ) || allowArrayLike && o && typeof o . length === "number" ) { if ( it ) o = it ; var i = 0 ; var F = function F ( ) { } ; return { s : F , n : function n ( ) { if ( i >= o . length ) return { done : true } ; return { done : false , value : o [ i ++ ] } ; } , e : function e ( _e ) { throw _e ; } , f : F } ; } throw new TypeError ( "Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method." ) ; } var normalCompletion = true , didErr = false , err ; return { s : function s ( ) { it = o [ Symbol . iterator ] ( ) ; } , n : function n ( ) { var step = it . next ( ) ; normalCompletion = step . done ; return step ; } , e : function e ( _e2 ) { didErr = true ; err = _e2 ; } , f : function f ( ) { try { if ( ! normalCompletion && it . return != null ) it . return ( ) ; } finally { if ( didErr ) throw err ; } } } ; }
function _unsupportedIterableToArray ( o , minLen ) { if ( ! o ) return ; if ( typeof o === "string" ) return _arrayLikeToArray ( o , minLen ) ; var n = Object . prototype . toString . call ( o ) . slice ( 8 , - 1 ) ; if ( n === "Object" && o . constructor ) n = o . constructor . name ; if ( n === "Map" || n === "Set" ) return Array . from ( o ) ; if ( n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/ . test ( n ) ) return _arrayLikeToArray ( o , minLen ) ; }
function _arrayLikeToArray ( arr , len ) { if ( len == null || len > arr . length ) len = arr . length ; for ( var i = 0 , arr2 = new Array ( len ) ; i < len ; i ++ ) { arr2 [ i ] = arr [ i ] ; } return arr2 ; }
2020-07-07 16:43:35 +02:00
/ * *
* WordPress dependencies
* /
2020-01-03 14:17:24 +01:00
/ * *
2020-07-27 22:10:36 +02:00
* Load an asset for a block .
*
* This function returns a Promise that will resolve once the asset is loaded ,
2021-01-28 03:04:13 +01:00
* or in the case of Stylesheets and Inline JavaScript , will resolve immediately .
2020-06-26 15:33:47 +02:00
*
2020-07-27 22:10:36 +02:00
* @ param { HTMLElement } el A HTML Element asset to inject .
2020-01-03 14:17:24 +01:00
*
2020-06-26 15:33:47 +02:00
* @ return { Promise } Promise which will resolve when the asset is loaded .
2020-01-03 14:17:24 +01:00
* /
2020-07-07 16:43:35 +02:00
2020-07-27 22:10:36 +02:00
var loadAsset = function loadAsset ( el ) {
2020-06-26 15:33:47 +02:00
return new Promise ( function ( resolve , reject ) {
2020-07-27 22:10:36 +02:00
/ *
* Reconstruct the passed element , this is required as inserting the Node directly
* won 't always fire the required onload events, even if the asset wasn' t already loaded .
* /
var newNode = document . createElement ( el . nodeName ) ;
[ 'id' , 'rel' , 'src' , 'href' , 'type' ] . forEach ( function ( attr ) {
if ( el [ attr ] ) {
newNode [ attr ] = el [ attr ] ;
}
} ) ; // Append inline <script> contents.
2020-01-03 14:17:24 +01:00
2020-07-27 22:10:36 +02:00
if ( el . innerHTML ) {
newNode . appendChild ( document . createTextNode ( el . innerHTML ) ) ;
2020-06-26 15:33:47 +02:00
}
2020-07-27 22:10:36 +02:00
newNode . onload = function ( ) {
2020-06-26 15:33:47 +02:00
return resolve ( true ) ;
} ;
2020-01-03 14:17:24 +01:00
2020-07-27 22:10:36 +02:00
newNode . onerror = function ( ) {
return reject ( new Error ( 'Error loading asset.' ) ) ;
2020-06-26 15:33:47 +02:00
} ;
2020-07-27 22:10:36 +02:00
document . body . appendChild ( newNode ) ; // Resolve Stylesheets and Inline JavaScript immediately.
2020-01-03 14:17:24 +01:00
2020-07-27 22:10:36 +02:00
if ( 'link' === newNode . nodeName . toLowerCase ( ) || 'script' === newNode . nodeName . toLowerCase ( ) && ! newNode . src ) {
resolve ( ) ;
}
2020-06-26 15:33:47 +02:00
} ) ;
2020-01-03 14:17:24 +01:00
} ;
/ * *
* Load the asset files for a block
*
2020-06-26 15:33:47 +02:00
* @ param { Array } assets A collection of URLs for the assets .
2020-01-03 14:17:24 +01:00
*
* @ return { Object } Control descriptor .
* /
function loadAssets ( assets ) {
2020-06-26 15:33:47 +02:00
return {
type : 'LOAD_ASSETS' ,
assets : assets
} ;
2020-01-03 14:17:24 +01:00
}
var controls = {
2020-07-27 22:10:36 +02:00
LOAD _ASSETS : function LOAD _ASSETS ( ) {
2021-01-28 03:04:13 +01:00
return Object ( asyncToGenerator [ "a" /* default */ ] ) ( /*#__PURE__*/ external _regeneratorRuntime _default . a . mark ( function _callee ( ) {
var response , data , doc , newAssets , _iterator , _step , newAsset ;
return external _regeneratorRuntime _default . a . wrap ( function _callee$ ( _context ) {
while ( 1 ) {
switch ( _context . prev = _context . next ) {
case 0 :
_context . next = 2 ;
return external _wp _apiFetch _default ( ) ( {
url : document . location . href ,
parse : false
} ) ;
case 2 :
response = _context . sent ;
_context . next = 5 ;
return response . text ( ) ;
case 5 :
data = _context . sent ;
doc = new window . DOMParser ( ) . parseFromString ( data , 'text/html' ) ;
newAssets = Array . from ( doc . querySelectorAll ( 'link[rel="stylesheet"],script' ) ) . filter ( function ( asset ) {
return asset . id && ! document . getElementById ( asset . id ) ;
} ) ;
/ *
* Load each asset in order , as they may depend upon an earlier loaded script .
* Stylesheets and Inline Scripts will resolve immediately upon insertion .
* /
_iterator = _createForOfIteratorHelper ( newAssets ) ;
_context . prev = 9 ;
_iterator . s ( ) ;
case 11 :
if ( ( _step = _iterator . n ( ) ) . done ) {
_context . next = 17 ;
break ;
2020-07-27 22:10:36 +02:00
}
2021-01-28 03:04:13 +01:00
newAsset = _step . value ;
_context . next = 15 ;
return loadAsset ( newAsset ) ;
case 15 :
_context . next = 11 ;
break ;
case 17 :
_context . next = 22 ;
break ;
case 19 :
_context . prev = 19 ;
_context . t0 = _context [ "catch" ] ( 9 ) ;
_iterator . e ( _context . t0 ) ;
case 22 :
_context . prev = 22 ;
_iterator . f ( ) ;
return _context . finish ( 22 ) ;
case 25 :
case "end" :
return _context . stop ( ) ;
}
}
} , _callee , null , [ [ 9 , 19 , 22 , 25 ] ] ) ;
} ) ) ( ) ;
2020-01-03 14:17:24 +01:00
}
} ;
/* harmony default export */ var store _controls = ( controls ) ;
2020-07-07 16:43:35 +02:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/utils/get-plugin-url.js
/ * *
* Get the plugin ' s direct API link out of a block - directory response .
*
* @ param { Object } block The block object
*
* @ return { string } The plugin URL , if exists .
* /
function getPluginUrl ( block ) {
if ( ! block ) {
return false ;
}
var link = block . links [ 'wp:plugin' ] || block . links . self ;
if ( link && link . length ) {
return link [ 0 ] . href ;
}
return false ;
}
2020-01-03 14:17:24 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/actions.js
2020-06-26 15:33:47 +02:00
2021-01-28 03:04:13 +01:00
var _marked = /*#__PURE__*/ external _regeneratorRuntime _default . a . mark ( actions _installBlockType ) ,
_marked2 = /*#__PURE__*/ external _regeneratorRuntime _default . a . mark ( actions _uninstallBlockType ) ;
2020-06-26 15:33:47 +02:00
function actions _ownKeys ( object , enumerableOnly ) { var keys = Object . keys ( object ) ; if ( Object . getOwnPropertySymbols ) { var symbols = Object . getOwnPropertySymbols ( object ) ; if ( enumerableOnly ) symbols = symbols . filter ( function ( sym ) { return Object . getOwnPropertyDescriptor ( object , sym ) . enumerable ; } ) ; keys . push . apply ( keys , symbols ) ; } return keys ; }
function actions _objectSpread ( target ) { for ( var i = 1 ; i < arguments . length ; i ++ ) { var source = arguments [ i ] != null ? arguments [ i ] : { } ; if ( i % 2 ) { actions _ownKeys ( Object ( source ) , true ) . forEach ( function ( key ) { Object ( defineProperty [ "a" /* default */ ] ) ( target , key , source [ key ] ) ; } ) ; } else if ( Object . getOwnPropertyDescriptors ) { Object . defineProperties ( target , Object . getOwnPropertyDescriptors ( source ) ) ; } else { actions _ownKeys ( Object ( source ) ) . forEach ( function ( key ) { Object . defineProperty ( target , key , Object . getOwnPropertyDescriptor ( source , key ) ) ; } ) ; } } return target ; }
2020-01-03 14:17:24 +01:00
/ * *
* WordPress dependencies
* /
2020-06-26 15:33:47 +02:00
2021-01-28 03:04:13 +01:00
2020-01-03 14:17:24 +01:00
/ * *
* Internal dependencies
* /
2020-07-07 16:43:35 +02:00
2020-01-03 14:17:24 +01:00
/ * *
2020-06-26 15:33:47 +02:00
* Returns an action object used in signalling that the downloadable blocks
2020-10-13 15:10:30 +02:00
* have been requested and are loading .
2020-06-26 15:33:47 +02:00
*
* @ param { string } filterValue Search string .
2020-01-03 14:17:24 +01:00
*
* @ return { Object } Action object .
* /
2020-06-26 15:33:47 +02:00
function fetchDownloadableBlocks ( filterValue ) {
2020-01-03 14:17:24 +01:00
return {
2020-06-26 15:33:47 +02:00
type : 'FETCH_DOWNLOADABLE_BLOCKS' ,
filterValue : filterValue
2020-01-03 14:17:24 +01:00
} ;
}
/ * *
2020-06-26 15:33:47 +02:00
* Returns an action object used in signalling that the downloadable blocks
* have been updated .
2020-01-03 14:17:24 +01:00
*
2020-06-26 15:33:47 +02:00
* @ param { Array } downloadableBlocks Downloadable blocks .
* @ param { string } filterValue Search string .
2020-01-03 14:17:24 +01:00
*
* @ return { Object } Action object .
* /
function receiveDownloadableBlocks ( downloadableBlocks , filterValue ) {
return {
type : 'RECEIVE_DOWNLOADABLE_BLOCKS' ,
downloadableBlocks : downloadableBlocks ,
filterValue : filterValue
} ;
}
/ * *
2020-06-26 15:33:47 +02:00
* Action triggered to install a block plugin .
*
* @ param { Object } block The block item returned by search .
2020-01-03 14:17:24 +01:00
*
2020-06-26 15:33:47 +02:00
* @ return { boolean } Whether the block was successfully installed & loaded .
2020-01-03 14:17:24 +01:00
* /
2020-06-26 15:33:47 +02:00
function actions _installBlockType ( block ) {
2020-07-07 16:43:35 +02:00
var id , assets , success , url , links , response , registeredBlocks , message , isFatal , fatalAPIErrors ;
2021-01-28 03:04:13 +01:00
return external _regeneratorRuntime _default . a . wrap ( function installBlockType$ ( _context ) {
2020-01-03 14:17:24 +01:00
while ( 1 ) {
switch ( _context . prev = _context . next ) {
case 0 :
2020-06-26 15:33:47 +02:00
id = block . id , assets = block . assets ;
success = false ;
_context . next = 4 ;
return clearErrorNotice ( id ) ;
case 4 :
_context . prev = 4 ;
2020-07-27 22:10:36 +02:00
_context . next = 7 ;
2020-06-26 15:33:47 +02:00
return setIsInstalling ( block . id , true ) ;
2020-01-03 14:17:24 +01:00
2020-07-27 22:10:36 +02:00
case 7 :
2020-07-07 16:43:35 +02:00
// If we have a wp:plugin link, the plugin is installed but inactive.
url = getPluginUrl ( block ) ;
links = { } ;
if ( ! url ) {
2020-07-27 22:10:36 +02:00
_context . next = 14 ;
2020-07-07 16:43:35 +02:00
break ;
}
2020-07-27 22:10:36 +02:00
_context . next = 12 ;
2021-01-28 03:04:13 +01:00
return Object ( external _wp _dataControls _ [ "apiFetch" ] ) ( {
2020-07-07 16:43:35 +02:00
url : url ,
data : {
status : 'active'
} ,
method : 'PUT'
} ) ;
2020-07-27 22:10:36 +02:00
case 12 :
_context . next = 18 ;
2020-07-07 16:43:35 +02:00
break ;
2020-07-27 22:10:36 +02:00
case 14 :
_context . next = 16 ;
2021-01-28 03:04:13 +01:00
return Object ( external _wp _dataControls _ [ "apiFetch" ] ) ( {
2020-07-07 16:43:35 +02:00
path : 'wp/v2/plugins' ,
2020-06-26 15:33:47 +02:00
data : {
slug : block . id ,
status : 'active'
} ,
method : 'POST'
} ) ;
2020-01-03 14:17:24 +01:00
2020-07-27 22:10:36 +02:00
case 16 :
2020-06-26 15:33:47 +02:00
response = _context . sent ;
2020-07-07 16:43:35 +02:00
// Add the `self` link for newly-installed blocks.
links = response . _links ;
2020-07-27 22:10:36 +02:00
case 18 :
_context . next = 20 ;
2020-10-13 15:10:30 +02:00
return addInstalledBlockType ( actions _objectSpread ( actions _objectSpread ( { } , block ) , { } , {
links : actions _objectSpread ( actions _objectSpread ( { } , block . links ) , links )
2020-06-26 15:33:47 +02:00
} ) ) ;
2020-01-03 14:17:24 +01:00
2020-07-27 22:10:36 +02:00
case 20 :
_context . next = 22 ;
2020-06-26 15:33:47 +02:00
return loadAssets ( assets ) ;
2020-01-03 14:17:24 +01:00
2020-07-27 22:10:36 +02:00
case 22 :
_context . next = 24 ;
2021-01-28 03:04:13 +01:00
return external _wp _data _ [ "controls" ] . select ( external _wp _blocks _ [ "store" ] . name , 'getBlockTypes' ) ;
2020-01-03 14:17:24 +01:00
2020-07-27 22:10:36 +02:00
case 24 :
2020-06-26 15:33:47 +02:00
registeredBlocks = _context . sent ;
2020-01-03 14:17:24 +01:00
2021-01-28 03:04:13 +01:00
if ( registeredBlocks . some ( function ( i ) {
2020-07-07 16:43:35 +02:00
return i . name === block . name ;
2021-01-28 03:04:13 +01:00
} ) ) {
2020-07-27 22:10:36 +02:00
_context . next = 27 ;
2020-01-03 14:17:24 +01:00
break ;
}
2021-01-28 03:04:13 +01:00
throw new Error ( Object ( external _wp _i18n _ [ "__" ] ) ( 'Error registering block. Try reloading the page.' ) ) ;
2020-01-03 14:17:24 +01:00
2020-07-27 22:10:36 +02:00
case 27 :
2020-06-26 15:33:47 +02:00
success = true ;
2020-07-27 22:10:36 +02:00
_context . next = 38 ;
2020-01-03 14:17:24 +01:00
break ;
2020-07-27 22:10:36 +02:00
case 30 :
_context . prev = 30 ;
2020-06-26 15:33:47 +02:00
_context . t0 = _context [ "catch" ] ( 4 ) ;
2021-01-28 03:04:13 +01:00
message = _context . t0 . message || Object ( external _wp _i18n _ [ "__" ] ) ( 'An error occurred.' ) ; // Errors we throw are fatal
2020-01-03 14:17:24 +01:00
2020-07-07 16:43:35 +02:00
isFatal = _context . t0 instanceof Error ; // Specific API errors that are fatal
fatalAPIErrors = {
2021-01-28 03:04:13 +01:00
folder _exists : Object ( external _wp _i18n _ [ "__" ] ) ( 'This block is already installed. Try reloading the page.' ) ,
unable _to _connect _to _filesystem : Object ( external _wp _i18n _ [ "__" ] ) ( 'Error installing block. You can reload the page and try again.' )
2020-07-07 16:43:35 +02:00
} ;
if ( fatalAPIErrors [ _context . t0 . code ] ) {
isFatal = true ;
message = fatalAPIErrors [ _context . t0 . code ] ;
}
2020-07-27 22:10:36 +02:00
_context . next = 38 ;
2020-07-07 16:43:35 +02:00
return setErrorNotice ( id , message , isFatal ) ;
2020-07-27 22:10:36 +02:00
case 38 :
_context . next = 40 ;
2020-06-26 15:33:47 +02:00
return setIsInstalling ( block . id , false ) ;
2020-07-27 22:10:36 +02:00
case 40 :
2020-06-26 15:33:47 +02:00
return _context . abrupt ( "return" , success ) ;
2020-07-27 22:10:36 +02:00
case 41 :
2020-01-03 14:17:24 +01:00
case "end" :
2020-06-26 15:33:47 +02:00
return _context . stop ( ) ;
2020-01-03 14:17:24 +01:00
}
}
2020-07-27 22:10:36 +02:00
} , _marked , null , [ [ 4 , 30 ] ] ) ;
2020-01-03 14:17:24 +01:00
}
/ * *
* Action triggered to uninstall a block plugin .
*
2020-06-26 15:33:47 +02:00
* @ param { Object } block The blockType object .
2020-01-03 14:17:24 +01:00
* /
2020-06-26 15:33:47 +02:00
function actions _uninstallBlockType ( block ) {
2021-01-28 03:04:13 +01:00
return external _regeneratorRuntime _default . a . wrap ( function uninstallBlockType$ ( _context2 ) {
2020-01-03 14:17:24 +01:00
while ( 1 ) {
2020-06-26 15:33:47 +02:00
switch ( _context2 . prev = _context2 . next ) {
2020-01-03 14:17:24 +01:00
case 0 :
2020-06-26 15:33:47 +02:00
_context2 . prev = 0 ;
_context2 . next = 3 ;
2021-01-28 03:04:13 +01:00
return Object ( external _wp _dataControls _ [ "apiFetch" ] ) ( {
2020-07-07 16:43:35 +02:00
url : getPluginUrl ( block ) ,
2020-01-03 14:17:24 +01:00
data : {
2020-06-26 15:33:47 +02:00
status : 'inactive'
2020-01-03 14:17:24 +01:00
} ,
2020-06-26 15:33:47 +02:00
method : 'PUT'
} ) ;
2020-01-03 14:17:24 +01:00
2020-06-26 15:33:47 +02:00
case 3 :
_context2 . next = 5 ;
2021-01-28 03:04:13 +01:00
return Object ( external _wp _dataControls _ [ "apiFetch" ] ) ( {
2020-07-07 16:43:35 +02:00
url : getPluginUrl ( block ) ,
2020-06-26 15:33:47 +02:00
method : 'DELETE'
2020-01-03 14:17:24 +01:00
} ) ;
2020-06-26 15:33:47 +02:00
case 5 :
_context2 . next = 7 ;
return removeInstalledBlockType ( block ) ;
case 7 :
_context2 . next = 13 ;
2020-01-03 14:17:24 +01:00
break ;
2020-06-26 15:33:47 +02:00
case 9 :
_context2 . prev = 9 ;
_context2 . t0 = _context2 [ "catch" ] ( 0 ) ;
_context2 . next = 13 ;
2021-01-28 03:04:13 +01:00
return external _wp _data _ [ "controls" ] . dispatch ( external _wp _notices _ [ "store" ] , 'createErrorNotice' , _context2 . t0 . message || Object ( external _wp _i18n _ [ "__" ] ) ( 'An error occurred.' ) ) ;
2020-01-03 14:17:24 +01:00
2020-06-26 15:33:47 +02:00
case 13 :
2020-01-03 14:17:24 +01:00
case "end" :
2020-06-26 15:33:47 +02:00
return _context2 . stop ( ) ;
2020-01-03 14:17:24 +01:00
}
}
2020-06-26 15:33:47 +02:00
} , _marked2 , null , [ [ 0 , 9 ] ] ) ;
2020-01-03 14:17:24 +01:00
}
/ * *
2020-10-13 15:10:30 +02:00
* Returns an action object used to add a block type to the "newly installed"
* tracking list .
2020-01-03 14:17:24 +01:00
*
2020-06-26 15:33:47 +02:00
* @ param { Object } item The block item with the block id and name .
2020-01-03 14:17:24 +01:00
*
* @ return { Object } Action object .
* /
function addInstalledBlockType ( item ) {
return {
type : 'ADD_INSTALLED_BLOCK_TYPE' ,
item : item
} ;
}
/ * *
2020-10-13 15:10:30 +02:00
* Returns an action object used to remove a block type from the "newly installed"
* tracking list .
2020-01-03 14:17:24 +01:00
*
* @ param { string } item The block item with the block id and name .
*
* @ return { Object } Action object .
* /
function removeInstalledBlockType ( item ) {
return {
type : 'REMOVE_INSTALLED_BLOCK_TYPE' ,
item : item
} ;
}
2020-06-26 15:33:47 +02:00
/ * *
2020-10-13 15:10:30 +02:00
* Returns an action object used to indicate install in progress .
2020-06-26 15:33:47 +02:00
*
* @ param { string } blockId
* @ param { boolean } isInstalling
*
* @ return { Object } Action object .
* /
function setIsInstalling ( blockId , isInstalling ) {
return {
type : 'SET_INSTALLING_BLOCK' ,
blockId : blockId ,
isInstalling : isInstalling
} ;
}
/ * *
2020-10-13 15:10:30 +02:00
* Sets an error notice to be displayed to the user for a given block .
2020-06-26 15:33:47 +02:00
*
2020-10-13 15:10:30 +02:00
* @ param { string } blockId The ID of the block plugin . eg : my - block
2020-07-07 16:43:35 +02:00
* @ param { string } message The message shown in the notice .
2020-10-13 15:10:30 +02:00
* @ param { boolean } isFatal Whether the user can recover from the error .
2020-06-26 15:33:47 +02:00
*
* @ return { Object } Action object .
* /
2020-07-07 16:43:35 +02:00
function setErrorNotice ( blockId , message ) {
var isFatal = arguments . length > 2 && arguments [ 2 ] !== undefined ? arguments [ 2 ] : false ;
2020-06-26 15:33:47 +02:00
return {
type : 'SET_ERROR_NOTICE' ,
blockId : blockId ,
2020-07-07 16:43:35 +02:00
message : message ,
isFatal : isFatal
2020-06-26 15:33:47 +02:00
} ;
}
/ * *
2020-10-13 15:10:30 +02:00
* Sets the error notice to empty for specific block .
2020-06-26 15:33:47 +02:00
*
* @ param { string } blockId The ID of the block plugin . eg : my - block
*
* @ return { Object } Action object .
* /
function clearErrorNotice ( blockId ) {
return {
2020-07-07 16:43:35 +02:00
type : 'CLEAR_ERROR_NOTICE' ,
blockId : blockId
2020-06-26 15:33:47 +02:00
} ;
}
2020-01-03 14:17:24 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/resolvers.js
/ * *
* External dependencies
* /
/ * *
2020-06-26 15:33:47 +02:00
* WordPress dependencies
2020-01-03 14:17:24 +01:00
* /
2020-06-26 15:33:47 +02:00
/ * *
* Internal dependencies
* /
2020-01-03 14:17:24 +01:00
/* harmony default export */ var resolvers = ( {
2021-01-28 03:04:13 +01:00
getDownloadableBlocks : /*#__PURE__*/ external _regeneratorRuntime _default . a . mark ( function getDownloadableBlocks ( filterValue ) {
2020-01-03 14:17:24 +01:00
var results , blocks ;
2021-01-28 03:04:13 +01:00
return external _regeneratorRuntime _default . a . wrap ( function getDownloadableBlocks$ ( _context ) {
2020-01-03 14:17:24 +01:00
while ( 1 ) {
switch ( _context . prev = _context . next ) {
case 0 :
if ( filterValue ) {
_context . next = 2 ;
break ;
}
return _context . abrupt ( "return" ) ;
case 2 :
_context . prev = 2 ;
_context . next = 5 ;
return fetchDownloadableBlocks ( filterValue ) ;
case 5 :
_context . next = 7 ;
2021-01-28 03:04:13 +01:00
return Object ( external _wp _dataControls _ [ "apiFetch" ] ) ( {
2020-07-07 16:43:35 +02:00
path : "wp/v2/block-directory/search?term=" . concat ( filterValue )
2020-01-03 14:17:24 +01:00
} ) ;
case 7 :
results = _context . sent ;
blocks = results . map ( function ( result ) {
2021-01-28 03:04:13 +01:00
return Object ( external _lodash _ [ "mapKeys" ] ) ( result , function ( value , key ) {
return Object ( external _lodash _ [ "camelCase" ] ) ( key ) ;
2020-01-03 14:17:24 +01:00
} ) ;
} ) ;
_context . next = 11 ;
return receiveDownloadableBlocks ( blocks , filterValue ) ;
case 11 :
2020-07-07 16:43:35 +02:00
_context . next = 15 ;
2020-01-03 14:17:24 +01:00
break ;
case 13 :
_context . prev = 13 ;
_context . t0 = _context [ "catch" ] ( 2 ) ;
2020-07-07 16:43:35 +02:00
case 15 :
2020-01-03 14:17:24 +01:00
case "end" :
return _context . stop ( ) ;
}
}
} , getDownloadableBlocks , null , [ [ 2 , 13 ] ] ) ;
} )
} ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/index.js
2020-06-26 15:33:47 +02:00
function store _ownKeys ( object , enumerableOnly ) { var keys = Object . keys ( object ) ; if ( Object . getOwnPropertySymbols ) { var symbols = Object . getOwnPropertySymbols ( object ) ; if ( enumerableOnly ) symbols = symbols . filter ( function ( sym ) { return Object . getOwnPropertyDescriptor ( object , sym ) . enumerable ; } ) ; keys . push . apply ( keys , symbols ) ; } return keys ; }
function store _objectSpread ( target ) { for ( var i = 1 ; i < arguments . length ; i ++ ) { var source = arguments [ i ] != null ? arguments [ i ] : { } ; if ( i % 2 ) { store _ownKeys ( Object ( source ) , true ) . forEach ( function ( key ) { Object ( defineProperty [ "a" /* default */ ] ) ( target , key , source [ key ] ) ; } ) ; } else if ( Object . getOwnPropertyDescriptors ) { Object . defineProperties ( target , Object . getOwnPropertyDescriptors ( source ) ) ; } else { store _ownKeys ( Object ( source ) ) . forEach ( function ( key ) { Object . defineProperty ( target , key , Object . getOwnPropertyDescriptor ( source , key ) ) ; } ) ; } } return target ; }
2020-01-03 14:17:24 +01:00
/ * *
* WordPress dependencies
* /
2020-06-26 15:33:47 +02:00
2020-01-03 14:17:24 +01:00
/ * *
* Internal dependencies
* /
/ * *
* Module Constants
* /
2021-01-28 03:04:13 +01:00
var STORE _NAME = 'core/block-directory' ;
2020-01-03 14:17:24 +01:00
/ * *
* Block editor data store configuration .
*
2021-02-02 06:17:13 +01:00
* @ see https : //github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore
2020-01-03 14:17:24 +01:00
*
* @ type { Object }
* /
var storeConfig = {
reducer : reducer ,
selectors : selectors _namespaceObject ,
actions : actions _namespaceObject ,
2021-01-28 03:04:13 +01:00
controls : store _objectSpread ( store _objectSpread ( { } , external _wp _dataControls _ [ "controls" ] ) , store _controls ) ,
2020-01-03 14:17:24 +01:00
resolvers : resolvers
} ;
2021-01-28 03:04:13 +01:00
/ * *
* Store definition for the block directory namespace .
*
2021-02-02 06:17:13 +01:00
* @ see https : //github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
2021-01-28 03:04:13 +01:00
*
* @ type { Object }
* /
2020-06-26 15:33:47 +02:00
2021-01-28 03:04:13 +01:00
var store = Object ( external _wp _data _ [ "createReduxStore" ] ) ( STORE _NAME , storeConfig ) ;
Object ( external _wp _data _ [ "register" ] ) ( store ) ;
2020-06-26 15:33:47 +02:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/auto-block-uninstaller/index.js
/ * *
* WordPress dependencies
* /
2021-01-28 03:04:13 +01:00
/ * *
* Internal dependencies
* /
2020-06-26 15:33:47 +02:00
function AutoBlockUninstaller ( ) {
2021-01-28 03:04:13 +01:00
var _useDispatch = Object ( external _wp _data _ [ "useDispatch" ] ) ( store ) ,
2020-06-26 15:33:47 +02:00
uninstallBlockType = _useDispatch . uninstallBlockType ;
2021-01-28 03:04:13 +01:00
var shouldRemoveBlockTypes = Object ( external _wp _data _ [ "useSelect" ] ) ( function ( select ) {
2020-06-26 15:33:47 +02:00
var _select = select ( 'core/editor' ) ,
isAutosavingPost = _select . isAutosavingPost ,
isSavingPost = _select . isSavingPost ;
return isSavingPost ( ) && ! isAutosavingPost ( ) ;
2020-07-07 16:43:35 +02:00
} , [ ] ) ;
2021-01-28 03:04:13 +01:00
var unusedBlockTypes = Object ( external _wp _data _ [ "useSelect" ] ) ( function ( select ) {
return select ( store ) . getUnusedBlockTypes ( ) ;
2020-07-07 16:43:35 +02:00
} , [ ] ) ;
2021-01-28 03:04:13 +01:00
Object ( external _wp _element _ [ "useEffect" ] ) ( function ( ) {
2020-06-26 15:33:47 +02:00
if ( shouldRemoveBlockTypes && unusedBlockTypes . length ) {
unusedBlockTypes . forEach ( function ( blockType ) {
uninstallBlockType ( blockType ) ;
2021-01-28 03:04:13 +01:00
Object ( external _wp _blocks _ [ "unregisterBlockType" ] ) ( blockType . name ) ;
2020-06-26 15:33:47 +02:00
} ) ;
}
} , [ shouldRemoveBlockTypes ] ) ;
return null ;
}
2020-01-08 12:57:23 +01:00
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
2021-01-28 03:04:13 +01:00
var slicedToArray = _ _webpack _require _ _ ( 11 ) ;
2020-01-08 12:57:23 +01:00
2021-01-28 03:04:13 +01:00
// EXTERNAL MODULE: external ["wp","blockEditor"]
var external _wp _blockEditor _ = _ _webpack _require _ _ ( 6 ) ;
2020-01-08 12:57:23 +01:00
2021-01-28 03:04:13 +01:00
// EXTERNAL MODULE: external ["wp","compose"]
var external _wp _compose _ = _ _webpack _require _ _ ( 12 ) ;
2020-01-03 14:17:24 +01:00
2021-01-28 03:04:13 +01:00
// EXTERNAL MODULE: external ["wp","components"]
var external _wp _components _ = _ _webpack _require _ _ ( 3 ) ;
2020-01-03 14:17:24 +01:00
2021-01-28 03:04:13 +01:00
// EXTERNAL MODULE: external ["wp","a11y"]
2021-02-02 06:17:13 +01:00
var external _wp _a11y _ = _ _webpack _require _ _ ( 48 ) ;
2020-10-20 15:36:16 +02:00
2020-06-26 15:33:47 +02:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-author-info/index.js
/ * *
* WordPress dependencies
* /
function DownloadableBlockAuthorInfo ( _ref ) {
var author = _ref . author ,
authorBlockCount = _ref . authorBlockCount ,
authorBlockRating = _ref . authorBlockRating ;
2021-01-28 03:04:13 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( "span" , {
2020-06-26 15:33:47 +02:00
className : "block-directory-downloadable-block-author-info__content-author"
2021-01-28 03:04:13 +01:00
} , Object ( external _wp _i18n _ [ "sprintf" ] ) (
2020-06-26 15:33:47 +02:00
/* translators: %s: author name. */
2021-01-28 03:04:13 +01:00
Object ( external _wp _i18n _ [ "__" ] ) ( 'Authored by %s' ) , author ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "span" , {
2020-06-26 15:33:47 +02:00
className : "block-directory-downloadable-block-author-info__content"
2021-01-28 03:04:13 +01:00
} , authorBlockRating > 0 ? Object ( external _wp _i18n _ [ "sprintf" ] ) (
2020-06-26 15:33:47 +02:00
/* translators: 1: number of blocks. 2: average rating. */
2021-01-28 03:04:13 +01:00
Object ( external _wp _i18n _ [ "_n" ] ) ( 'This author has %1$d block, with an average rating of %2$.1f.' , 'This author has %1$d blocks, with an average rating of %2$.1f.' , authorBlockCount ) , authorBlockCount , authorBlockRating ) : Object ( external _wp _i18n _ [ "sprintf" ] ) (
2020-06-26 15:33:47 +02:00
/* translators: 1: number of blocks. */
2021-01-28 03:04:13 +01:00
Object ( external _wp _i18n _ [ "_n" ] ) ( 'This author has %1$d block.' , 'This author has %1$d blocks.' , authorBlockCount ) , authorBlockCount ) ) ) ;
2020-06-26 15:33:47 +02:00
}
/* harmony default export */ var downloadable _block _author _info = ( DownloadableBlockAuthorInfo ) ;
2021-01-28 03:04:13 +01:00
// EXTERNAL MODULE: external ["wp","htmlEntities"]
2021-02-02 06:17:13 +01:00
var external _wp _htmlEntities _ = _ _webpack _require _ _ ( 64 ) ;
2020-10-13 15:10:30 +02:00
2020-06-26 15:33:47 +02:00
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js
2021-02-02 06:17:13 +01:00
var build _module _icon = _ _webpack _require _ _ ( 138 ) ;
2020-06-26 15:33:47 +02:00
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/star-filled.js
2021-02-02 06:17:13 +01:00
var star _filled = _ _webpack _require _ _ ( 303 ) ;
2020-06-26 15:33:47 +02:00
2021-01-28 03:04:13 +01:00
// EXTERNAL MODULE: external ["wp","primitives"]
var external _wp _primitives _ = _ _webpack _require _ _ ( 7 ) ;
2020-06-26 15:33:47 +02:00
// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/star-half.js
/ * *
* WordPress dependencies
* /
2021-01-28 03:04:13 +01:00
var starHalf = Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _primitives _ [ "SVG" ] , {
2020-06-26 15:33:47 +02:00
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
2021-01-28 03:04:13 +01:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _primitives _ [ "Path" ] , {
2020-06-26 15:33:47 +02:00
d : "M9.518 8.783a.25.25 0 00.188-.137l2.069-4.192a.25.25 0 01.448 0l2.07 4.192a.25.25 0 00.187.137l4.626.672a.25.25 0 01.139.427l-3.347 3.262a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.363.264l-4.137-2.176a.25.25 0 00-.233 0l-4.138 2.175a.25.25 0 01-.362-.263l.79-4.607a.25.25 0 00-.072-.222L4.753 9.882a.25.25 0 01.14-.427l4.625-.672zM12 14.533c.28 0 .559.067.814.2l1.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.39v7.143z"
} ) ) ;
/* harmony default export */ var star _half = ( starHalf ) ;
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/star-empty.js
2021-02-02 06:17:13 +01:00
var star _empty = _ _webpack _require _ _ ( 304 ) ;
2020-06-26 15:33:47 +02:00
2020-01-03 14:17:24 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/block-ratings/stars.js
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
function Stars ( _ref ) {
var rating = _ref . rating ;
var stars = Math . round ( rating / 0.5 ) * 0.5 ;
var fullStarCount = Math . floor ( rating ) ;
var halfStarCount = Math . ceil ( rating - fullStarCount ) ;
var emptyStarCount = 5 - ( fullStarCount + halfStarCount ) ;
2021-01-28 03:04:13 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
"aria-label" : Object ( external _wp _i18n _ [ "sprintf" ] ) (
2020-06-26 15:33:47 +02:00
/* translators: %s: number of stars. */
2021-01-28 03:04:13 +01:00
Object ( external _wp _i18n _ [ "__" ] ) ( '%s out of 5 stars' ) , stars )
} , Object ( external _lodash _ [ "times" ] ) ( fullStarCount , function ( i ) {
return Object ( external _wp _element _ [ "createElement" ] ) ( build _module _icon [ "a" /* default */ ] , {
2020-01-03 14:17:24 +01:00
key : "full_stars_" . concat ( i ) ,
2020-06-26 15:33:47 +02:00
icon : star _filled [ "a" /* default */ ] ,
2020-01-03 14:17:24 +01:00
size : 16
} ) ;
2021-01-28 03:04:13 +01:00
} ) , Object ( external _lodash _ [ "times" ] ) ( halfStarCount , function ( i ) {
return Object ( external _wp _element _ [ "createElement" ] ) ( build _module _icon [ "a" /* default */ ] , {
2020-01-03 14:17:24 +01:00
key : "half_stars_" . concat ( i ) ,
2020-06-26 15:33:47 +02:00
icon : star _half ,
2020-01-03 14:17:24 +01:00
size : 16
} ) ;
2021-01-28 03:04:13 +01:00
} ) , Object ( external _lodash _ [ "times" ] ) ( emptyStarCount , function ( i ) {
return Object ( external _wp _element _ [ "createElement" ] ) ( build _module _icon [ "a" /* default */ ] , {
2020-01-03 14:17:24 +01:00
key : "empty_stars_" . concat ( i ) ,
2020-06-26 15:33:47 +02:00
icon : star _empty [ "a" /* default */ ] ,
2020-01-03 14:17:24 +01:00
size : 16
} ) ;
} ) ) ;
}
/* harmony default export */ var block _ratings _stars = ( Stars ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/block-ratings/index.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
var block _ratings _BlockRatings = function BlockRatings ( _ref ) {
var rating = _ref . rating ,
ratingCount = _ref . ratingCount ;
2021-01-28 03:04:13 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
2020-01-03 14:17:24 +01:00
className : "block-directory-block-ratings"
2021-01-28 03:04:13 +01:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( block _ratings _stars , {
2020-01-03 14:17:24 +01:00
rating : rating
2021-01-28 03:04:13 +01:00
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( "span" , {
2020-01-03 14:17:24 +01:00
className : "block-directory-block-ratings__rating-count" ,
2021-01-28 03:04:13 +01:00
"aria-label" : Object ( external _wp _i18n _ [ "sprintf" ] ) ( // translators: %d: number of ratings (number).
Object ( external _wp _i18n _ [ "_n" ] ) ( '%d total rating' , '%d total ratings' , ratingCount ) , ratingCount )
2020-01-03 14:17:24 +01:00
} , "(" , ratingCount , ")" ) ) ;
} ;
/* harmony default export */ var block _ratings = ( block _ratings _BlockRatings ) ;
2020-06-26 15:33:47 +02:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-icon/index.js
/ * *
* WordPress dependencies
* /
function DownloadableBlockIcon ( _ref ) {
var icon = _ref . icon ,
title = _ref . title ;
2021-01-28 03:04:13 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
2020-06-26 15:33:47 +02:00
className : "block-directory-downloadable-block-icon"
2021-01-28 03:04:13 +01:00
} , icon . match ( /\.(jpeg|jpg|gif|png|svg)(?:\?.*)?$/ ) !== null ? Object ( external _wp _element _ [ "createElement" ] ) ( "img" , {
2020-06-26 15:33:47 +02:00
src : icon ,
2021-01-28 03:04:13 +01:00
alt : Object ( external _wp _i18n _ [ "sprintf" ] ) ( // translators: %s: Name of the plugin e.g: "Akismet".
Object ( external _wp _i18n _ [ "__" ] ) ( '%s block icon' ) , title )
} ) : Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "BlockIcon" ] , {
2020-06-26 15:33:47 +02:00
icon : icon ,
showColors : true
} ) ) ;
}
/* harmony default export */ var downloadable _block _icon = ( DownloadableBlockIcon ) ;
2020-01-03 14:17:24 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-header/index.js
/ * *
* WordPress dependencies
* /
2020-10-13 15:10:30 +02:00
2020-01-03 14:17:24 +01:00
/ * *
* Internal dependencies
* /
function DownloadableBlockHeader ( _ref ) {
var icon = _ref . icon ,
title = _ref . title ,
rating = _ref . rating ,
ratingCount = _ref . ratingCount ,
2020-07-07 16:43:35 +02:00
_ref$isLoading = _ref . isLoading ,
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading ,
_ref$isInstallable = _ref . isInstallable ,
isInstallable = _ref$isInstallable === void 0 ? true : _ref$isInstallable ,
2020-01-03 14:17:24 +01:00
_onClick = _ref . onClick ;
2021-01-28 03:04:13 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
2020-01-03 14:17:24 +01:00
className : "block-directory-downloadable-block-header__row"
2021-01-28 03:04:13 +01:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( downloadable _block _icon , {
2020-01-03 14:17:24 +01:00
icon : icon ,
2020-06-26 15:33:47 +02:00
title : title
2021-01-28 03:04:13 +01:00
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
2020-01-03 14:17:24 +01:00
className : "block-directory-downloadable-block-header__column"
2021-01-28 03:04:13 +01:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( "h2" , {
2020-01-03 14:17:24 +01:00
className : "block-directory-downloadable-block-header__title"
2021-01-28 03:04:13 +01:00
} , Object ( external _wp _htmlEntities _ [ "decodeEntities" ] ) ( title ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( block _ratings , {
2020-01-03 14:17:24 +01:00
rating : rating ,
ratingCount : ratingCount
2021-01-28 03:04:13 +01:00
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
2020-06-26 15:33:47 +02:00
isSecondary : true ,
isBusy : isLoading ,
2020-07-07 16:43:35 +02:00
disabled : isLoading || ! isInstallable ,
2020-01-03 14:17:24 +01:00
onClick : function onClick ( event ) {
event . preventDefault ( ) ;
2020-07-07 16:43:35 +02:00
if ( ! isLoading && isInstallable ) {
2020-06-26 15:33:47 +02:00
_onClick ( ) ;
}
2020-01-03 14:17:24 +01:00
}
2021-01-28 03:04:13 +01:00
} , isLoading ? Object ( external _wp _i18n _ [ "__" ] ) ( 'Adding…' ) : Object ( external _wp _i18n _ [ "__" ] ) ( 'Add block' ) ) ) ;
2020-01-03 14:17:24 +01:00
}
/* harmony default export */ var downloadable _block _header = ( DownloadableBlockHeader ) ;
2020-06-26 15:33:47 +02:00
// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chart-line.js
2020-01-03 14:17:24 +01:00
/ * *
* WordPress dependencies
* /
2021-01-28 03:04:13 +01:00
var chartLine = Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _primitives _ [ "SVG" ] , {
2020-06-26 15:33:47 +02:00
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "-2 -2 24 24"
2021-01-28 03:04:13 +01:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _primitives _ [ "Path" ] , {
2020-06-26 15:33:47 +02:00
d : "M18 3.5c0 .62-.38 1.16-.92 1.38v13.11H1.99l4.22-6.73c-.13-.23-.21-.48-.21-.76C6 9.67 6.67 9 7.5 9S9 9.67 9 10.5c0 .13-.02.25-.05.37l1.44.63c.27-.3.67-.5 1.11-.5.18 0 .35.04.51.09l3.58-6.41c-.36-.27-.59-.7-.59-1.18 0-.83.67-1.5 1.5-1.5.19 0 .36.04.53.1l.05-.09v.11c.54.22.92.76.92 1.38zm-1.92 13.49V5.85l-3.29 5.89c.13.23.21.48.21.76 0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5l.01-.07-1.63-.72c-.25.18-.55.29-.88.29-.18 0-.35-.04-.51-.1l-3.2 5.09h12.29z"
} ) ) ;
/* harmony default export */ var chart _line = ( chartLine ) ;
2020-02-10 23:33:27 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/update.js
/ * *
* WordPress dependencies
* /
2021-01-28 03:04:13 +01:00
var update = Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _primitives _ [ "SVG" ] , {
2020-02-10 23:33:27 +01:00
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "-2 -2 24 24"
2021-01-28 03:04:13 +01:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _primitives _ [ "Path" ] , {
2020-02-10 23:33:27 +01:00
d : "M10.2 3.28c3.53 0 6.43 2.61 6.92 6h2.08l-3.5 4-3.5-4h2.32c-.45-1.97-2.21-3.45-4.32-3.45-1.45 0-2.73.71-3.54 1.78L4.95 5.66C6.23 4.2 8.11 3.28 10.2 3.28zm-.4 13.44c-3.52 0-6.43-2.61-6.92-6H.8l3.5-4c1.17 1.33 2.33 2.67 3.5 4H5.48c.45 1.97 2.21 3.45 4.32 3.45 1.45 0 2.73-.71 3.54-1.78l1.71 1.95c-1.28 1.46-3.15 2.38-5.25 2.38z"
} ) ) ;
/* harmony default export */ var library _update = ( update ) ;
2020-01-03 14:17:24 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-info/index.js
/ * *
* WordPress dependencies
* /
2020-10-13 15:10:30 +02:00
2020-01-03 14:17:24 +01:00
function DownloadableBlockInfo ( _ref ) {
2020-10-13 15:10:30 +02:00
var activeInstalls = _ref . activeInstalls ,
description = _ref . description ,
2020-01-03 14:17:24 +01:00
humanizedUpdated = _ref . humanizedUpdated ;
2020-10-13 15:10:30 +02:00
var activeInstallsString ;
if ( activeInstalls > 1000000 ) {
2021-01-28 03:04:13 +01:00
activeInstallsString = Object ( external _wp _i18n _ [ "sprintf" ] ) (
2020-10-13 15:10:30 +02:00
/* translators: %d: number of active installations. */
2021-01-28 03:04:13 +01:00
Object ( external _wp _i18n _ [ "__" ] ) ( '%d+ Million active installations' ) , Math . floor ( activeInstalls / 1000000 ) ) ;
2020-10-13 15:10:30 +02:00
} else if ( 0 === activeInstalls ) {
2021-01-28 03:04:13 +01:00
activeInstallsString = Object ( external _wp _i18n _ [ "__" ] ) ( 'Less than 10 active installations' ) ;
2020-10-13 15:10:30 +02:00
} else {
2021-01-28 03:04:13 +01:00
activeInstallsString = Object ( external _wp _i18n _ [ "sprintf" ] ) (
2020-10-13 15:10:30 +02:00
/* translators: %d: number of active installations. */
2021-01-28 03:04:13 +01:00
Object ( external _wp _i18n _ [ "__" ] ) ( '%d+ active installations' ) , activeInstalls ) ;
2020-10-13 15:10:30 +02:00
}
2021-01-28 03:04:13 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( "p" , {
2020-01-03 14:17:24 +01:00
className : "block-directory-downloadable-block-info__content"
2021-01-28 03:04:13 +01:00
} , Object ( external _wp _htmlEntities _ [ "decodeEntities" ] ) ( description ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
2020-06-26 15:33:47 +02:00
className : "block-directory-downloadable-block-info__meta"
2021-01-28 03:04:13 +01:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( build _module _icon [ "a" /* default */ ] , {
2020-06-26 15:33:47 +02:00
className : "block-directory-downloadable-block-info__icon" ,
icon : chart _line
2021-01-28 03:04:13 +01:00
} ) , activeInstallsString ) , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
2020-06-26 15:33:47 +02:00
className : "block-directory-downloadable-block-info__meta"
2021-01-28 03:04:13 +01:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( build _module _icon [ "a" /* default */ ] , {
2020-06-26 15:33:47 +02:00
className : "block-directory-downloadable-block-info__icon" ,
2020-02-10 23:33:27 +01:00
icon : library _update
2020-02-06 22:03:31 +01:00
} ) , // translators: %s: Humanized date of last update e.g: "2 months ago".
2021-01-28 03:04:13 +01:00
Object ( external _wp _i18n _ [ "sprintf" ] ) ( Object ( external _wp _i18n _ [ "__" ] ) ( 'Updated %s' ) , humanizedUpdated ) ) ) ;
2020-01-03 14:17:24 +01:00
}
/* harmony default export */ var downloadable _block _info = ( DownloadableBlockInfo ) ;
2020-06-26 15:33:47 +02:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-notice/index.js
/ * *
* WordPress dependencies
* /
2021-01-28 03:04:13 +01:00
/ * *
* Internal dependencies
* /
2020-06-26 15:33:47 +02:00
var downloadable _block _notice _DownloadableBlockNotice = function DownloadableBlockNotice ( _ref ) {
var block = _ref . block ,
_onClick = _ref . onClick ;
2021-01-28 03:04:13 +01:00
var errorNotice = Object ( external _wp _data _ [ "useSelect" ] ) ( function ( select ) {
return select ( store ) . getErrorNoticeForBlock ( block . id ) ;
2020-06-26 15:33:47 +02:00
} , [ block ] ) ;
if ( ! errorNotice ) {
return null ;
}
2021-01-28 03:04:13 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Notice" ] , {
2020-06-26 15:33:47 +02:00
status : "error" ,
isDismissible : false ,
className : "block-directory-downloadable-block-notice"
2021-01-28 03:04:13 +01:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
2020-06-26 15:33:47 +02:00
className : "block-directory-downloadable-block-notice__content"
2021-01-28 03:04:13 +01:00
} , errorNotice . message ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
2020-06-26 15:33:47 +02:00
isSmall : true ,
isPrimary : true ,
onClick : function onClick ( ) {
2020-07-07 16:43:35 +02:00
if ( errorNotice . isFatal ) {
window . location . reload ( ) ;
return false ;
}
2020-06-26 15:33:47 +02:00
_onClick ( block ) ;
}
2021-01-28 03:04:13 +01:00
} , errorNotice . isFatal ? Object ( external _wp _i18n _ [ "__" ] ) ( 'Reload' ) : Object ( external _wp _i18n _ [ "__" ] ) ( 'Retry' ) ) ) ;
2020-06-26 15:33:47 +02:00
} ;
/* harmony default export */ var downloadable _block _notice = ( downloadable _block _notice _DownloadableBlockNotice ) ;
2020-01-03 14:17:24 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-list-item/index.js
2020-06-26 15:33:47 +02:00
/ * *
* WordPress dependencies
* /
2020-01-03 14:17:24 +01:00
/ * *
* Internal dependencies
* /
2020-06-26 15:33:47 +02:00
2021-01-28 03:04:13 +01:00
2020-01-03 14:17:24 +01:00
function DownloadableBlockListItem ( _ref ) {
var item = _ref . item ,
onClick = _ref . onClick ;
2020-07-07 16:43:35 +02:00
2021-01-28 03:04:13 +01:00
var _useSelect = Object ( external _wp _data _ [ "useSelect" ] ) ( function ( select ) {
var _select = select ( store ) ,
2020-07-07 16:43:35 +02:00
isInstalling = _select . isInstalling ,
getErrorNoticeForBlock = _select . getErrorNoticeForBlock ;
var notice = getErrorNoticeForBlock ( item . id ) ;
var hasFatal = notice && notice . isFatal ;
return {
isLoading : isInstalling ( item . id ) ,
isInstallable : ! hasFatal
} ;
} , [ item ] ) ,
isLoading = _useSelect . isLoading ,
isInstallable = _useSelect . isInstallable ;
2020-01-03 14:17:24 +01:00
var icon = item . icon ,
title = item . title ,
description = item . description ,
rating = item . rating ,
activeInstalls = item . activeInstalls ,
ratingCount = item . ratingCount ,
author = item . author ,
humanizedUpdated = item . humanizedUpdated ,
authorBlockCount = item . authorBlockCount ,
authorBlockRating = item . authorBlockRating ;
2021-01-28 03:04:13 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( "li" , {
2020-01-03 14:17:24 +01:00
className : "block-directory-downloadable-block-list-item"
2021-01-28 03:04:13 +01:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( "article" , {
2020-01-03 14:17:24 +01:00
className : "block-directory-downloadable-block-list-item__panel"
2021-01-28 03:04:13 +01:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( "header" , {
2020-01-03 14:17:24 +01:00
className : "block-directory-downloadable-block-list-item__header"
2021-01-28 03:04:13 +01:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( downloadable _block _header , {
2020-01-03 14:17:24 +01:00
icon : icon ,
onClick : onClick ,
title : title ,
rating : rating ,
2020-06-26 15:33:47 +02:00
ratingCount : ratingCount ,
2020-07-07 16:43:35 +02:00
isLoading : isLoading ,
isInstallable : isInstallable
2021-01-28 03:04:13 +01:00
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "section" , {
2020-01-03 14:17:24 +01:00
className : "block-directory-downloadable-block-list-item__body"
2021-01-28 03:04:13 +01:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( downloadable _block _notice , {
2020-06-26 15:33:47 +02:00
onClick : onClick ,
block : item
2021-01-28 03:04:13 +01:00
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( downloadable _block _info , {
2020-01-03 14:17:24 +01:00
activeInstalls : activeInstalls ,
description : description ,
humanizedUpdated : humanizedUpdated
2021-01-28 03:04:13 +01:00
} ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( "footer" , {
2020-01-03 14:17:24 +01:00
className : "block-directory-downloadable-block-list-item__footer"
2021-01-28 03:04:13 +01:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( downloadable _block _author _info , {
2020-01-03 14:17:24 +01:00
author : author ,
authorBlockCount : authorBlockCount ,
authorBlockRating : authorBlockRating
} ) ) ) ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-blocks-list/index.js
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
2021-01-28 03:04:13 +01:00
2020-01-03 14:17:24 +01:00
/ * *
* Internal dependencies
* /
2021-01-28 03:04:13 +01:00
2020-01-03 14:17:24 +01:00
function DownloadableBlocksList ( _ref ) {
var items = _ref . items ,
_ref$onHover = _ref . onHover ,
2021-01-28 03:04:13 +01:00
onHover = _ref$onHover === void 0 ? external _lodash _ [ "noop" ] : _ref$onHover ,
2020-06-26 15:33:47 +02:00
onSelect = _ref . onSelect ;
2021-01-28 03:04:13 +01:00
var _useDispatch = Object ( external _wp _data _ [ "useDispatch" ] ) ( store ) ,
2020-06-26 15:33:47 +02:00
installBlockType = _useDispatch . installBlockType ;
if ( ! items . length ) {
return null ;
}
2020-01-03 14:17:24 +01:00
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 */
2021-01-28 03:04:13 +01:00
Object ( external _wp _element _ [ "createElement" ] ) ( "ul" , {
2020-01-03 14:17:24 +01:00
role : "list" ,
className : "block-directory-downloadable-blocks-list"
2020-06-26 15:33:47 +02:00
} , items . map ( function ( item ) {
2021-01-28 03:04:13 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( DownloadableBlockListItem , {
2020-01-03 14:17:24 +01:00
key : item . id ,
onClick : function onClick ( ) {
2021-02-02 06:17:13 +01:00
// Check if the block is registered (`getBlockType`
// will return an object). If so, insert the block.
// This prevents installing existing plugins.
if ( Object ( external _wp _blocks _ [ "getBlockType" ] ) ( item . name ) ) {
onSelect ( item ) ;
} else {
installBlockType ( item ) . then ( function ( success ) {
if ( success ) {
onSelect ( item ) ;
}
} ) ;
}
2020-01-03 14:17:24 +01:00
onHover ( null ) ;
} ,
item : item
} ) ;
2020-06-26 15:33:47 +02:00
} ) )
2020-01-03 14:17:24 +01:00
/* eslint-enable jsx-a11y/no-redundant-roles */
) ;
}
2020-06-26 15:33:47 +02:00
/* harmony default export */ var downloadable _blocks _list = ( DownloadableBlocksList ) ;
2020-01-03 14:17:24 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-blocks-panel/index.js
/ * *
* WordPress dependencies
* /
2020-10-20 15:36:16 +02:00
2021-02-02 06:17:13 +01:00
2020-01-03 14:17:24 +01:00
/ * *
* Internal dependencies
* /
2021-01-28 03:04:13 +01:00
2020-01-03 14:17:24 +01:00
function DownloadableBlocksPanel ( _ref ) {
var downloadableItems = _ref . downloadableItems ,
onSelect = _ref . onSelect ,
onHover = _ref . onHover ,
hasPermission = _ref . hasPermission ,
isLoading = _ref . isLoading ,
2020-10-20 15:36:16 +02:00
isWaiting = _ref . isWaiting ;
2021-01-28 03:04:13 +01:00
var debouncedSpeak = Object ( external _wp _compose _ [ "useDebounce" ] ) ( external _wp _a11y _ [ "speak" ] , 500 ) ;
2020-01-03 14:17:24 +01:00
2020-07-07 16:43:35 +02:00
if ( false === hasPermission ) {
2021-01-28 03:04:13 +01:00
debouncedSpeak ( Object ( external _wp _i18n _ [ "__" ] ) ( 'No blocks found in your library.' ) ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( "p" , {
2020-01-03 14:17:24 +01:00
className : "block-directory-downloadable-blocks-panel__description has-no-results"
2021-01-28 03:04:13 +01:00
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'No blocks found in your library.' ) ) ;
2020-01-03 14:17:24 +01:00
}
2020-07-07 16:43:35 +02:00
if ( typeof hasPermission === 'undefined' || isLoading || isWaiting ) {
2021-01-28 03:04:13 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( "p" , {
2020-01-03 14:17:24 +01:00
className : "block-directory-downloadable-blocks-panel__description has-no-results"
2021-01-28 03:04:13 +01:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Spinner" ] , null ) ) ;
2020-01-03 14:17:24 +01:00
}
if ( ! downloadableItems . length ) {
2021-01-28 03:04:13 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( "p" , {
2020-01-03 14:17:24 +01:00
className : "block-directory-downloadable-blocks-panel__description has-no-results"
2021-01-28 03:04:13 +01:00
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'No blocks found in your library.' ) ) ;
2020-01-03 14:17:24 +01:00
}
2021-01-28 03:04:13 +01:00
var resultsFoundMessage = Object ( external _wp _i18n _ [ "sprintf" ] ) (
2020-06-26 15:33:47 +02:00
/* translators: %s: number of available blocks. */
2021-01-28 03:04:13 +01:00
Object ( external _wp _i18n _ [ "_n" ] ) ( 'No blocks found in your library. We did find %d block available for download.' , 'No blocks found in your library. We did find %d blocks available for download.' , downloadableItems . length ) , downloadableItems . length ) ;
2020-01-03 14:17:24 +01:00
debouncedSpeak ( resultsFoundMessage ) ;
2021-01-28 03:04:13 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( "p" , {
2020-01-03 14:17:24 +01:00
className : "block-directory-downloadable-blocks-panel__description"
2021-01-28 03:04:13 +01:00
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'No blocks found in your library. These blocks can be downloaded and installed:' ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( downloadable _blocks _list , {
2020-01-03 14:17:24 +01:00
items : downloadableItems ,
onSelect : onSelect ,
onHover : onHover
} ) ) ;
}
2021-01-28 03:04:13 +01:00
/* harmony default export */ var downloadable _blocks _panel = ( Object ( external _wp _compose _ [ "compose" ] ) ( [ Object ( external _wp _data _ [ "withSelect" ] ) ( function ( select , _ref2 ) {
2021-02-02 06:17:13 +01:00
var filterValue = _ref2 . filterValue ,
_ref2$rootClientId = _ref2 . rootClientId ,
rootClientId = _ref2$rootClientId === void 0 ? null : _ref2$rootClientId ;
2020-01-03 14:17:24 +01:00
2021-01-28 03:04:13 +01:00
var _select = select ( store ) ,
2020-01-03 14:17:24 +01:00
getDownloadableBlocks = _select . getDownloadableBlocks ,
isRequestingDownloadableBlocks = _select . isRequestingDownloadableBlocks ;
2021-02-02 06:17:13 +01:00
var _select2 = select ( external _wp _blockEditor _ [ "store" ] ) ,
canInsertBlockType = _select2 . canInsertBlockType ;
2020-07-07 16:43:35 +02:00
var hasPermission = select ( 'core' ) . canUser ( 'read' , 'block-directory/search' ) ;
2021-02-02 06:17:13 +01:00
function getInstallableBlocks ( term ) {
return getDownloadableBlocks ( term ) . filter ( function ( block ) {
return canInsertBlockType ( block , rootClientId , true ) ;
} ) ;
}
var downloadableItems = hasPermission ? getInstallableBlocks ( filterValue ) : [ ] ;
2020-06-26 15:33:47 +02:00
var isLoading = isRequestingDownloadableBlocks ( filterValue ) ;
2020-01-03 14:17:24 +01:00
return {
downloadableItems : downloadableItems ,
hasPermission : hasPermission ,
isLoading : isLoading
} ;
} ) ] ) ( DownloadableBlocksPanel ) ) ;
2020-01-08 12:57:23 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/inserter-menu-downloadable-blocks-panel/index.js
/ * *
* External dependencies
* /
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
function InserterMenuDownloadableBlocksPanel ( ) {
2021-01-28 03:04:13 +01:00
var _useState = Object ( external _wp _element _ [ "useState" ] ) ( '' ) ,
2020-01-08 12:57:23 +01:00
_useState2 = Object ( slicedToArray [ "a" /* default */ ] ) ( _useState , 2 ) ,
debouncedFilterValue = _useState2 [ 0 ] ,
setFilterValue = _useState2 [ 1 ] ;
2021-01-28 03:04:13 +01:00
var debouncedSetFilterValue = Object ( external _lodash _ [ "debounce" ] ) ( setFilterValue , 400 ) ;
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "__experimentalInserterMenuExtension" ] , null , function ( _ref ) {
2020-01-08 12:57:23 +01:00
var onSelect = _ref . onSelect ,
onHover = _ref . onHover ,
filterValue = _ref . filterValue ,
2021-02-02 06:17:13 +01:00
hasItems = _ref . hasItems ,
rootClientId = _ref . rootClientId ;
2020-01-08 12:57:23 +01:00
if ( hasItems || ! filterValue ) {
return null ;
}
if ( debouncedFilterValue !== filterValue ) {
debouncedSetFilterValue ( filterValue ) ;
}
2021-01-28 03:04:13 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( downloadable _blocks _panel , {
2020-01-08 12:57:23 +01:00
onSelect : onSelect ,
onHover : onHover ,
2021-02-02 06:17:13 +01:00
rootClientId : rootClientId ,
2020-01-08 12:57:23 +01:00
filterValue : debouncedFilterValue ,
isWaiting : filterValue !== debouncedFilterValue
} ) ;
} ) ;
}
/* harmony default export */ var inserter _menu _downloadable _blocks _panel = ( InserterMenuDownloadableBlocksPanel ) ;
2021-02-02 06:17:13 +01:00
// EXTERNAL MODULE: external ["wp","editPost"]
var external _wp _editPost _ = _ _webpack _require _ _ ( 278 ) ;
2020-10-13 15:10:30 +02:00
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/block-default.js
2021-02-02 06:17:13 +01:00
var block _default = _ _webpack _require _ _ ( 215 ) ;
2020-06-26 15:33:47 +02:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/compact-list/index.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
function CompactList ( _ref ) {
var items = _ref . items ;
if ( ! items . length ) {
return null ;
}
2021-01-28 03:04:13 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( "ul" , {
2020-06-26 15:33:47 +02:00
className : "block-directory-compact-list"
} , items . map ( function ( _ref2 ) {
var icon = _ref2 . icon ,
id = _ref2 . id ,
title = _ref2 . title ,
author = _ref2 . author ;
2021-01-28 03:04:13 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( "li" , {
2020-06-26 15:33:47 +02:00
key : id ,
className : "block-directory-compact-list__item"
2021-01-28 03:04:13 +01:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( downloadable _block _icon , {
2020-06-26 15:33:47 +02:00
icon : icon ,
title : title
2021-01-28 03:04:13 +01:00
} ) , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
2020-06-26 15:33:47 +02:00
className : "block-directory-compact-list__item-details"
2021-01-28 03:04:13 +01:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
2020-06-26 15:33:47 +02:00
className : "block-directory-compact-list__item-title"
2021-01-28 03:04:13 +01:00
} , title ) , Object ( external _wp _element _ [ "createElement" ] ) ( "div" , {
2020-06-26 15:33:47 +02:00
className : "block-directory-compact-list__item-author"
2021-01-28 03:04:13 +01:00
} , Object ( external _wp _i18n _ [ "sprintf" ] ) (
2020-06-26 15:33:47 +02:00
/* translators: %s: Name of the block author. */
2021-01-28 03:04:13 +01:00
Object ( external _wp _i18n _ [ "__" ] ) ( 'By %s' ) , author ) ) ) ) ;
2020-06-26 15:33:47 +02:00
} ) ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/installed-blocks-pre-publish-panel/index.js
/ * *
* WordPress dependencies
* /
2020-10-13 15:10:30 +02:00
2020-06-26 15:33:47 +02:00
/ * *
* Internal dependencies
* /
2021-01-28 03:04:13 +01:00
2020-06-26 15:33:47 +02:00
function InstalledBlocksPrePublishPanel ( ) {
2021-01-28 03:04:13 +01:00
var newBlockTypes = Object ( external _wp _data _ [ "useSelect" ] ) ( function ( select ) {
return select ( store ) . getNewBlockTypes ( ) ;
2020-07-07 16:43:35 +02:00
} , [ ] ) ;
2020-06-26 15:33:47 +02:00
if ( ! newBlockTypes . length ) {
return null ;
}
2021-01-28 03:04:13 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _editPost _ [ "PluginPrePublishPanel" ] , {
2020-10-13 15:10:30 +02:00
icon : block _default [ "a" /* default */ ] ,
2021-01-28 03:04:13 +01:00
title : Object ( external _wp _i18n _ [ "sprintf" ] ) ( // translators: %d: number of blocks (number).
Object ( external _wp _i18n _ [ "_n" ] ) ( 'Added: %d block' , 'Added: %d blocks' , newBlockTypes . length ) , newBlockTypes . length ) ,
2020-06-26 15:33:47 +02:00
initialOpen : true
2021-01-28 03:04:13 +01:00
} , Object ( external _wp _element _ [ "createElement" ] ) ( "p" , {
2020-06-26 15:33:47 +02:00
className : "installed-blocks-pre-publish-panel__copy"
2021-01-28 03:04:13 +01:00
} , Object ( external _wp _i18n _ [ "_n" ] ) ( 'The following block has been added to your site.' , 'The following blocks have been added to your site.' , newBlockTypes . length ) ) , Object ( external _wp _element _ [ "createElement" ] ) ( CompactList , {
2020-06-26 15:33:47 +02:00
items : newBlockTypes
} ) ) ;
}
2021-01-28 03:04:13 +01:00
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
var objectWithoutProperties = _ _webpack _require _ _ ( 13 ) ;
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
var esm _extends = _ _webpack _require _ _ ( 8 ) ;
2020-10-13 15:10:30 +02:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/get-install-missing/install-button.js
/ * *
* WordPress dependencies
* /
2021-01-28 03:04:13 +01:00
/ * *
* Internal dependencies
* /
2020-10-13 15:10:30 +02:00
function InstallButton ( _ref ) {
var attributes = _ref . attributes ,
block = _ref . block ,
clientId = _ref . clientId ;
2021-01-28 03:04:13 +01:00
var isInstallingBlock = Object ( external _wp _data _ [ "useSelect" ] ) ( function ( select ) {
return select ( store ) . isInstalling ( block . id ) ;
2020-10-13 15:10:30 +02:00
} ) ;
2021-01-28 03:04:13 +01:00
var _useDispatch = Object ( external _wp _data _ [ "useDispatch" ] ) ( store ) ,
2020-10-13 15:10:30 +02:00
installBlockType = _useDispatch . installBlockType ;
2021-01-28 03:04:13 +01:00
var _useDispatch2 = Object ( external _wp _data _ [ "useDispatch" ] ) ( 'core/block-editor' ) ,
2020-10-13 15:10:30 +02:00
replaceBlock = _useDispatch2 . replaceBlock ;
2021-01-28 03:04:13 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
2020-10-13 15:10:30 +02:00
onClick : function onClick ( ) {
return installBlockType ( block ) . then ( function ( success ) {
if ( success ) {
2021-01-28 03:04:13 +01:00
var blockType = Object ( external _wp _blocks _ [ "getBlockType" ] ) ( block . name ) ;
2020-10-13 15:10:30 +02:00
2021-01-28 03:04:13 +01:00
var _parse = Object ( external _wp _blocks _ [ "parse" ] ) ( attributes . originalContent ) ,
2020-10-13 15:10:30 +02:00
_parse2 = Object ( slicedToArray [ "a" /* default */ ] ) ( _parse , 1 ) ,
originalBlock = _parse2 [ 0 ] ;
if ( originalBlock ) {
2021-01-28 03:04:13 +01:00
replaceBlock ( clientId , Object ( external _wp _blocks _ [ "createBlock" ] ) ( blockType . name , originalBlock . attributes , originalBlock . innerBlocks ) ) ;
2020-10-13 15:10:30 +02:00
}
}
} ) ;
} ,
disabled : isInstallingBlock ,
isBusy : isInstallingBlock ,
isPrimary : true
2021-01-28 03:04:13 +01:00
} , Object ( external _wp _i18n _ [ "sprintf" ] ) (
2020-10-13 15:10:30 +02:00
/* translators: %s: block name */
2021-01-28 03:04:13 +01:00
Object ( external _wp _i18n _ [ "__" ] ) ( 'Install %s' ) , block . title ) ) ;
2020-10-13 15:10:30 +02:00
}
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/get-install-missing/index.js
2020-01-08 12:57:23 +01:00
2021-01-28 03:04:13 +01:00
2020-01-08 12:57:23 +01:00
/ * *
* WordPress dependencies
* /
2020-10-13 15:10:30 +02:00
2020-01-08 12:57:23 +01:00
/ * *
* Internal dependencies
* /
2020-06-26 15:33:47 +02:00
2021-01-28 03:04:13 +01:00
2020-10-13 15:10:30 +02:00
var get _install _missing _getInstallMissing = function getInstallMissing ( OriginalComponent ) {
return function ( props ) {
2021-01-28 03:04:13 +01:00
var originalName = props . attributes . originalName ; // Disable reason: This is a valid component, but it's mistaken for a callback.
2020-10-13 15:10:30 +02:00
// eslint-disable-next-line react-hooks/rules-of-hooks
2021-01-28 03:04:13 +01:00
var _useSelect = Object ( external _wp _data _ [ "useSelect" ] ) ( function ( select ) {
var _select = select ( store ) ,
2020-10-13 15:10:30 +02:00
getDownloadableBlocks = _select . getDownloadableBlocks ;
var blocks = getDownloadableBlocks ( 'block:' + originalName ) . filter ( function ( _ref ) {
var name = _ref . name ;
return originalName === name ;
} ) ;
return {
hasPermission : select ( 'core' ) . canUser ( 'read' , 'block-directory/search' ) ,
block : blocks . length && blocks [ 0 ]
} ;
} , [ originalName ] ) ,
block = _useSelect . block ,
2021-01-28 03:04:13 +01:00
hasPermission = _useSelect . hasPermission ; // The user can't install blocks, or the block isn't available for download.
2020-10-13 15:10:30 +02:00
if ( ! hasPermission || ! block ) {
2021-01-28 03:04:13 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( OriginalComponent , props ) ;
2020-10-13 15:10:30 +02:00
}
2021-01-28 03:04:13 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( get _install _missing _ModifiedWarning , Object ( esm _extends [ "a" /* default */ ] ) ( { } , props , {
originalBlock : block
} ) ) ;
} ;
} ;
var get _install _missing _ModifiedWarning = function ModifiedWarning ( _ref2 ) {
var originalBlock = _ref2 . originalBlock ,
props = Object ( objectWithoutProperties [ "a" /* default */ ] ) ( _ref2 , [ "originalBlock" ] ) ;
var _props$attributes = props . attributes ,
originalName = _props$attributes . originalName ,
originalUndelimitedContent = _props$attributes . originalUndelimitedContent ;
2020-10-13 15:10:30 +02:00
2021-01-28 03:04:13 +01:00
var _useDispatch = Object ( external _wp _data _ [ "useDispatch" ] ) ( 'core/block-editor' ) ,
replaceBlock = _useDispatch . replaceBlock ;
var convertToHTML = function convertToHTML ( ) {
replaceBlock ( props . clientId , Object ( external _wp _blocks _ [ "createBlock" ] ) ( 'core/html' , {
content : originalUndelimitedContent
} ) ) ;
2020-10-13 15:10:30 +02:00
} ;
2021-01-28 03:04:13 +01:00
var hasContent = ! ! originalUndelimitedContent ;
var hasHTMLBlock = Object ( external _wp _blocks _ [ "getBlockType" ] ) ( 'core/html' ) ;
var messageHTML = Object ( external _wp _i18n _ [ "sprintf" ] ) (
/* translators: %s: block name */
Object ( external _wp _i18n _ [ "__" ] ) ( 'Your site doesn’ t include support for the %s block. You can try installing the block or remove it entirely!' ) , originalBlock . title || originalName ) ;
var actions = [ Object ( external _wp _element _ [ "createElement" ] ) ( InstallButton , {
key : "install" ,
block : originalBlock ,
attributes : props . attributes ,
clientId : props . clientId
} ) ] ;
if ( hasContent && hasHTMLBlock ) {
messageHTML = Object ( external _wp _i18n _ [ "sprintf" ] ) (
/* translators: %s: block name */
Object ( external _wp _i18n _ [ "__" ] ) ( 'Your site doesn’ t include support for the %s block. You can try installing the block, convert it to a Custom HTML block, or remove it entirely.' ) , originalBlock . title || originalName ) ;
actions . push ( Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _components _ [ "Button" ] , {
key : "convert" ,
onClick : convertToHTML ,
isLink : true
} , Object ( external _wp _i18n _ [ "__" ] ) ( 'Keep as HTML' ) ) ) ;
}
return Object ( external _wp _element _ [ "createElement" ] ) ( "div" , Object ( external _wp _blockEditor _ [ "useBlockProps" ] ) ( ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _blockEditor _ [ "Warning" ] , {
actions : actions
} , messageHTML ) , Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "RawHTML" ] , null , originalUndelimitedContent ) ) ;
2020-10-13 15:10:30 +02:00
} ;
/* harmony default export */ var get _install _missing = ( get _install _missing _getInstallMissing ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/index.js
2020-06-26 15:33:47 +02:00
2020-01-08 12:57:23 +01:00
2020-07-07 16:43:35 +02:00
/ * *
* WordPress dependencies
* /
2020-10-13 15:10:30 +02:00
2020-01-03 14:17:24 +01:00
/ * *
* Internal dependencies
* /
2020-07-07 16:43:35 +02:00
2021-01-28 03:04:13 +01:00
Object ( external _wp _plugins _ [ "registerPlugin" ] ) ( 'block-directory' , {
2020-10-13 15:10:30 +02:00
render : function render ( ) {
2021-01-28 03:04:13 +01:00
return Object ( external _wp _element _ [ "createElement" ] ) ( external _wp _element _ [ "Fragment" ] , null , Object ( external _wp _element _ [ "createElement" ] ) ( AutoBlockUninstaller , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( inserter _menu _downloadable _blocks _panel , null ) , Object ( external _wp _element _ [ "createElement" ] ) ( InstalledBlocksPrePublishPanel , null ) ) ;
2020-10-13 15:10:30 +02:00
}
} ) ;
2021-01-28 03:04:13 +01:00
Object ( external _wp _hooks _ [ "addFilter" ] ) ( 'blocks.registerBlockType' , 'block-directory/fallback' , function ( settings , name ) {
2020-10-13 15:10:30 +02:00
if ( name !== 'core/missing' ) {
return settings ;
}
2020-07-27 22:10:36 +02:00
2020-10-13 15:10:30 +02:00
settings . edit = get _install _missing ( settings . edit ) ;
return settings ;
} ) ;
2020-07-27 22:10:36 +02:00
2020-10-13 15:10:30 +02:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/index.js
/ * *
* Internal dependencies
* /
2020-07-27 22:10:36 +02:00
2020-01-08 12:57:23 +01:00
2020-01-03 14:17:24 +01:00
2020-02-06 22:03:31 +01:00
2020-01-03 14:17:24 +01:00
/***/ } ) ,
2020-10-13 15:10:30 +02:00
/***/ 47 :
2021-01-28 03:04:13 +01:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _asyncToGenerator ; } ) ;
function asyncGeneratorStep ( gen , resolve , reject , _next , _throw , key , arg ) {
try {
var info = gen [ key ] ( arg ) ;
var value = info . value ;
} catch ( error ) {
reject ( error ) ;
return ;
}
if ( info . done ) {
resolve ( value ) ;
} else {
Promise . resolve ( value ) . then ( _next , _throw ) ;
}
}
function _asyncToGenerator ( fn ) {
return function ( ) {
var self = this ,
args = arguments ;
return new Promise ( function ( resolve , reject ) {
var gen = fn . apply ( self , args ) ;
function _next ( value ) {
asyncGeneratorStep ( gen , resolve , reject , _next , _throw , "next" , value ) ;
}
function _throw ( err ) {
asyncGeneratorStep ( gen , resolve , reject , _next , _throw , "throw" , err ) ;
}
_next ( undefined ) ;
} ) ;
} ;
}
/***/ } ) ,
/***/ 48 :
2020-10-20 15:36:16 +02:00
/***/ ( function ( module , exports ) {
2020-07-27 22:10:36 +02:00
2021-02-02 06:17:13 +01:00
( function ( ) { module . exports = window [ "wp" ] [ "a11y" ] ; } ( ) ) ;
2021-01-28 03:04:13 +01:00
/***/ } ) ,
/***/ 49 :
/***/ ( function ( module , exports ) {
2021-02-02 06:17:13 +01:00
( function ( ) { module . exports = window [ "wp" ] [ "dataControls" ] ; } ( ) ) ;
2020-07-27 22:10:36 +02:00
/***/ } ) ,
2020-10-13 15:10:30 +02:00
/***/ 5 :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _defineProperty ; } ) ;
function _defineProperty ( obj , key , value ) {
if ( key in obj ) {
Object . defineProperty ( obj , key , {
value : value ,
enumerable : true ,
configurable : true ,
writable : true
} ) ;
} else {
obj [ key ] = value ;
}
return obj ;
}
/***/ } ) ,
2021-01-28 03:04:13 +01:00
/***/ 50 :
/***/ ( function ( module , exports ) {
2021-02-02 06:17:13 +01:00
( function ( ) { module . exports = window [ "wp" ] [ "apiFetch" ] ; } ( ) ) ;
/***/ } ) ,
/***/ 51 :
/***/ ( function ( module , exports ) {
2021-01-28 03:04:13 +01:00
( function ( ) { module . exports = window [ "wp" ] [ "notices" ] ; } ( ) ) ;
/***/ } ) ,
2020-06-26 15:33:47 +02:00
/***/ 6 :
2020-01-22 23:06:21 +01:00
/***/ ( function ( module , exports ) {
2021-01-28 03:04:13 +01:00
( function ( ) { module . exports = window [ "wp" ] [ "blockEditor" ] ; } ( ) ) ;
/***/ } ) ,
2021-02-02 06:17:13 +01:00
/***/ 64 :
2021-01-28 03:04:13 +01:00
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = window [ "wp" ] [ "htmlEntities" ] ; } ( ) ) ;
2020-01-22 23:06:21 +01:00
/***/ } ) ,
2021-02-02 06:17:13 +01:00
/***/ 7 :
2020-01-03 14:17:24 +01:00
/***/ ( function ( module , exports ) {
2021-02-02 06:17:13 +01:00
( function ( ) { module . exports = window [ "wp" ] [ "primitives" ] ; } ( ) ) ;
2020-01-03 14:17:24 +01:00
/***/ } ) ,
2021-02-02 06:17:13 +01:00
/***/ 73 :
2020-02-06 22:03:31 +01:00
/***/ ( function ( module , exports ) {
2020-01-08 12:57:23 +01:00
2021-02-02 06:17:13 +01:00
( function ( ) { module . exports = window [ "wp" ] [ "plugins" ] ; } ( ) ) ;
2020-01-03 14:17:24 +01:00
2020-07-07 16:43:35 +02:00
/***/ } ) ,
2021-01-28 03:04:13 +01:00
/***/ 8 :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2020-07-07 16:43:35 +02:00
2021-01-28 03:04:13 +01:00
"use strict" ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _extends ; } ) ;
function _extends ( ) {
_extends = Object . assign || function ( target ) {
for ( var i = 1 ; i < arguments . length ; i ++ ) {
var source = arguments [ i ] ;
for ( var key in source ) {
if ( Object . prototype . hasOwnProperty . call ( source , key ) ) {
target [ key ] = source [ key ] ;
}
}
}
return target ;
} ;
return _extends . apply ( this , arguments ) ;
}
2020-07-07 16:43:35 +02:00
2020-10-20 15:36:16 +02:00
/***/ } ) ,
2021-01-28 03:04:13 +01:00
/***/ 9 :
2020-10-20 15:36:16 +02:00
/***/ ( function ( module , exports ) {
2021-01-28 03:04:13 +01:00
( function ( ) { module . exports = window [ "wp" ] [ "blocks" ] ; } ( ) ) ;
2020-10-20 15:36:16 +02:00
2020-01-03 14:17:24 +01:00
/***/ } )
/******/ } ) ;