2020-01-03 08:17:24 -05: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
2020-07-07 12:08:28 -04:00
/******/ return _ _webpack _require _ _ ( _ _webpack _require _ _ . s = 439 ) ;
2020-01-03 08:17:24 -05:00
/******/ } )
/************************************************************************/
/******/ ( {
/***/ 0 :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = this [ "wp" ] [ "element" ] ; } ( ) ) ;
/***/ } ) ,
/***/ 1 :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = this [ "wp" ] [ "i18n" ] ; } ( ) ) ;
/***/ } ) ,
2020-07-07 10:43:35 -04:00
/***/ 10 :
2020-02-10 17:33:27 -05:00
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = this [ "wp" ] [ "blocks" ] ; } ( ) ) ;
/***/ } ) ,
2020-07-07 10:43:35 -04:00
/***/ 13 :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"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
var unsupportedIterableToArray = _ _webpack _require _ _ ( 29 ) ;
// 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 */ ] ) ( ) ;
}
/***/ } ) ,
2020-07-07 12:08:28 -04:00
/***/ 130 :
2020-01-03 08:17:24 -05:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
2020-06-26 09:33:47 -04:00
/* harmony import */ var _babel _runtime _helpers _esm _defineProperty _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 5 ) ;
/* harmony import */ var _babel _runtime _helpers _esm _objectWithoutProperties _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( 14 ) ;
/* 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 _ _ ) ;
2020-01-03 08:17:24 -05:00
2020-03-23 19:40:19 -04:00
2020-01-03 08:17:24 -05:00
2020-06-26 09:33:47 -04: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 ; }
2020-03-23 19:40:19 -04:00
2020-06-26 09:33:47 -04:00
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 ; }
2020-01-03 08:17:24 -05:00
2020-06-26 09:33:47 -04:00
/ * *
* WordPress dependencies
* /
// Disable reason: JSDoc linter doesn't seem to parse the union (`&`) correctly.
2020-01-03 08:17:24 -05:00
2020-06-26 09:33:47 -04:00
/* eslint-disable jsdoc/valid-types */
2020-01-03 08:17:24 -05:00
2020-06-26 09:33:47 -04:00
/** @typedef {{icon: JSX.Element, size?: number} & import('react').ComponentPropsWithoutRef<'SVG'>} IconProps */
2020-01-03 08:17:24 -05:00
2020-06-26 09:33:47 -04:00
/* eslint-enable jsdoc/valid-types */
2020-03-23 19:40:19 -04:00
2020-06-26 09:33:47 -04: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 ) ) ;
2020-01-03 08:17:24 -05:00
}
2020-06-26 09:33:47 -04:00
/* harmony default export */ _ _webpack _exports _ _ [ "a" ] = ( Icon ) ;
2020-01-03 08:17:24 -05:00
/***/ } ) ,
2020-06-26 09:33:47 -04:00
/***/ 14 :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2020-01-03 08:17:24 -05:00
2020-06-26 09:33:47 -04:00
"use strict" ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _objectWithoutProperties ; } ) ;
2020-07-07 10:43:35 -04:00
/* harmony import */ var _objectWithoutPropertiesLoose _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 41 ) ;
2020-06-26 09:33:47 -04:00
function _objectWithoutProperties ( source , excluded ) {
if ( source == null ) return { } ;
var target = Object ( _objectWithoutPropertiesLoose _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ /* default */ "a" ] ) ( source , excluded ) ;
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 08:17:24 -05:00
/***/ } ) ,
2020-07-07 10:43:35 -04:00
/***/ 17 :
2020-06-26 09:33:47 -04:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
2020-06-29 07:50:29 -04:00
// EXPORTS
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return /* binding */ _toConsumableArray ; } ) ;
2020-06-26 09:33:47 -04:00
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
var arrayLikeToArray = _ _webpack _require _ _ ( 26 ) ;
// 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
var iterableToArray = _ _webpack _require _ _ ( 35 ) ;
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
2020-07-07 10:43:35 -04:00
var unsupportedIterableToArray = _ _webpack _require _ _ ( 29 ) ;
2020-06-26 09:33:47 -04: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 ( ) ;
}
/***/ } ) ,
/***/ 2 :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = this [ "lodash" ] ; } ( ) ) ;
/***/ } ) ,
2020-01-08 06:57:23 -05:00
/***/ 23 :
2020-01-03 08:17:24 -05:00
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = this [ "regeneratorRuntime" ] ; } ( ) ) ;
/***/ } ) ,
2020-07-07 12:08:28 -04:00
/***/ 256 :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = this [ "wp" ] [ "editPost" ] ; } ( ) ) ;
/***/ } ) ,
2020-06-26 09:33:47 -04:00
/***/ 26 :
2020-03-23 19:40:19 -04: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 ;
}
/***/ } ) ,
2020-07-07 12:08:28 -04:00
/***/ 281 :
2020-06-26 09:33:47 -04: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 _ _ ( 6 ) ;
/* 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 ) ;
/***/ } ) ,
2020-07-07 12:08:28 -04:00
/***/ 282 :
2020-06-26 09:33:47 -04: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 _ _ ( 6 ) ;
/* 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-07-07 10:43:35 -04:00
/***/ } ) ,
/***/ 29 :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _unsupportedIterableToArray ; } ) ;
/* harmony import */ var _arrayLikeToArray _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 26 ) ;
function _unsupportedIterableToArray ( o , minLen ) {
if ( ! o ) return ;
if ( typeof o === "string" ) return Object ( _arrayLikeToArray _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ /* default */ "a" ] ) ( 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 Object ( _arrayLikeToArray _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ /* default */ "a" ] ) ( o , minLen ) ;
}
2020-03-23 19:40:19 -04:00
/***/ } ) ,
2020-01-03 08:17:24 -05:00
/***/ 3 :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = this [ "wp" ] [ "components" ] ; } ( ) ) ;
/***/ } ) ,
2020-07-07 10:43:35 -04:00
/***/ 30 :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = this [ "wp" ] [ "url" ] ; } ( ) ) ;
/***/ } ) ,
2020-03-23 19:40:19 -04:00
/***/ 35 :
2020-01-03 08:17:24 -05: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-23 19:40:19 -04:00
if ( typeof Symbol !== "undefined" && Symbol . iterator in Object ( iter ) ) return Array . from ( iter ) ;
2020-01-03 08:17:24 -05:00
}
/***/ } ) ,
2020-06-26 09:33:47 -04:00
/***/ 36 :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = this [ "wp" ] [ "dataControls" ] ; } ( ) ) ;
/***/ } ) ,
2020-03-23 19:40:19 -04:00
/***/ 38 :
2020-01-08 06:57:23 -05: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-23 19:40:19 -04:00
/***/ 39 :
2020-01-08 06:57:23 -05: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-23 19:40:19 -04: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 06:57:23 -05:00
}
/***/ } ) ,
2020-02-06 16:03:31 -05:00
/***/ 4 :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = this [ "wp" ] [ "data" ] ; } ( ) ) ;
/***/ } ) ,
2020-07-07 10:43:35 -04:00
/***/ 41 :
2020-06-26 09:33:47 -04:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2020-02-06 16:03:31 -05:00
2020-06-26 09:33:47 -04: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 16:03:31 -05:00
/***/ } ) ,
2020-07-07 12:08:28 -04:00
/***/ 439 :
2020-01-03 08:17:24 -05:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
2020-06-29 07:50:29 -04:00
// ESM COMPAT FLAG
2020-01-03 08:17:24 -05:00
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
2020-06-29 07:50:29 -04:00
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-directory/build-module/store/selectors.js
2020-01-03 08:17:24 -05:00
var selectors _namespaceObject = { } ;
_ _webpack _require _ _ . r ( selectors _namespaceObject ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "isRequestingDownloadableBlocks" , function ( ) { return isRequestingDownloadableBlocks ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "getDownloadableBlocks" , function ( ) { return selectors _getDownloadableBlocks ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "getInstalledBlockTypes" , function ( ) { return getInstalledBlockTypes ; } ) ;
2020-06-26 09:33:47 -04:00
_ _webpack _require _ _ . d ( selectors _namespaceObject , "getNewBlockTypes" , function ( ) { return getNewBlockTypes ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "getUnusedBlockTypes" , function ( ) { return getUnusedBlockTypes ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "isInstalling" , function ( ) { return isInstalling ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "getErrorNotices" , function ( ) { return getErrorNotices ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "getErrorNoticeForBlock" , function ( ) { return getErrorNoticeForBlock ; } ) ;
2020-06-29 07:50:29 -04:00
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-directory/build-module/store/actions.js
2020-01-03 08:17:24 -05: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 09:33:47 -04:00
_ _webpack _require _ _ . d ( actions _namespaceObject , "installBlockType" , function ( ) { return actions _installBlockType ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "uninstallBlockType" , function ( ) { return actions _uninstallBlockType ; } ) ;
2020-01-03 08:17:24 -05:00
_ _webpack _require _ _ . d ( actions _namespaceObject , "addInstalledBlockType" , function ( ) { return addInstalledBlockType ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "removeInstalledBlockType" , function ( ) { return removeInstalledBlockType ; } ) ;
2020-06-26 09:33:47 -04: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 ; } ) ;
2020-07-07 10:43:35 -04:00
// EXTERNAL MODULE: external {"this":["wp","notices"]}
var external _this _wp _notices _ = _ _webpack _require _ _ ( 92 ) ;
2020-06-26 09:33:47 -04:00
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
var defineProperty = _ _webpack _require _ _ ( 5 ) ;
2020-01-03 08:17:24 -05:00
// EXTERNAL MODULE: external {"this":["wp","data"]}
var external _this _wp _data _ = _ _webpack _require _ _ ( 4 ) ;
2020-06-26 09:33:47 -04:00
// EXTERNAL MODULE: external {"this":["wp","dataControls"]}
var external _this _wp _dataControls _ = _ _webpack _require _ _ ( 36 ) ;
2020-01-03 08:17:24 -05:00
2020-06-26 09:33:47 -04:00
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
2020-07-07 10:43:35 -04:00
var toConsumableArray = _ _webpack _require _ _ ( 17 ) ;
// EXTERNAL MODULE: external {"this":"lodash"}
var external _this _lodash _ = _ _webpack _require _ _ ( 2 ) ;
2020-01-03 08:17:24 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/reducer.js
2020-02-06 16:03:31 -05: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 08:17:24 -05:00
2020-07-07 10:43:35 -04:00
/ * *
* External dependencies
* /
2020-01-03 08:17:24 -05:00
/ * *
* WordPress dependencies
* /
2020-07-07 10:43:35 -04:00
2020-01-03 08:17:24 -05: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 09:33:47 -04:00
var state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
2020-01-03 08:17:24 -05:00
var action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
switch ( action . type ) {
case 'FETCH_DOWNLOADABLE_BLOCKS' :
2020-06-26 09:33:47 -04:00
return _objectSpread ( { } , state , Object ( defineProperty [ "a" /* default */ ] ) ( { } , action . filterValue , {
isRequesting : true
} ) ) ;
2020-01-03 08:17:24 -05:00
case 'RECEIVE_DOWNLOADABLE_BLOCKS' :
2020-06-26 09:33:47 -04:00
return _objectSpread ( { } , state , Object ( defineProperty [ "a" /* default */ ] ) ( { } , action . filterValue , {
results : action . downloadableBlocks ,
isRequesting : false
} ) ) ;
2020-02-06 16:03:31 -05:00
}
2020-01-03 08:17:24 -05:00
2020-02-06 16:03:31 -05: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 09:33:47 -04:00
installedBlockTypes : [ ] ,
isInstalling : { }
2020-02-06 16:03:31 -05:00
} ;
var action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2020-01-03 08:17:24 -05:00
2020-02-06 16:03:31 -05:00
switch ( action . type ) {
2020-01-03 08:17:24 -05:00
case 'ADD_INSTALLED_BLOCK_TYPE' :
2020-02-06 16:03:31 -05:00
return _objectSpread ( { } , state , {
2020-01-03 08:17:24 -05:00
installedBlockTypes : [ ] . concat ( Object ( toConsumableArray [ "a" /* default */ ] ) ( state . installedBlockTypes ) , [ action . item ] )
} ) ;
case 'REMOVE_INSTALLED_BLOCK_TYPE' :
2020-02-06 16:03:31 -05:00
return _objectSpread ( { } , state , {
2020-01-03 08:17:24 -05:00
installedBlockTypes : state . installedBlockTypes . filter ( function ( blockType ) {
return blockType . name !== action . item . name ;
} )
} ) ;
2020-06-26 09:33:47 -04:00
case 'SET_INSTALLING_BLOCK' :
return _objectSpread ( { } , state , {
isInstalling : _objectSpread ( { } , state . isInstalling , Object ( defineProperty [ "a" /* default */ ] ) ( { } , action . blockId , action . isInstalling ) )
} ) ;
2020-01-03 08:17:24 -05:00
}
return state ;
} ;
2020-06-26 09:33:47 -04: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-07-07 10:43:35 -04:00
return _objectSpread ( { } , state , Object ( defineProperty [ "a" /* default */ ] ) ( { } , action . blockId , {
message : action . message ,
isFatal : action . isFatal
} ) ) ;
case 'CLEAR_ERROR_NOTICE' :
return Object ( external _this _lodash _ [ "omit" ] ) ( state , action . blockId ) ;
2020-06-26 09:33:47 -04:00
}
return state ;
} ;
2020-01-03 08:17:24 -05:00
/* harmony default export */ var reducer = ( Object ( external _this _wp _data _ [ "combineReducers" ] ) ( {
2020-02-06 16:03:31 -05:00
downloadableBlocks : reducer _downloadableBlocks ,
blockManagement : reducer _blockManagement ,
2020-06-26 09:33:47 -04:00
errorNotices : reducer _errorNotices
2020-01-03 08:17:24 -05:00
} ) ) ;
2020-06-26 09:33:47 -04: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 08:17:24 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/selectors.js
2020-06-26 09:33:47 -04:00
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2020-01-03 08:17:24 -05:00
/ * *
* Returns true if application is requesting for downloadable blocks .
*
2020-06-26 09:33:47 -04:00
* @ param { Object } state Global application state .
* @ param { string } filterValue Search string .
*
2020-01-03 08:17:24 -05:00
*
* @ return { Array } Downloadable blocks
* /
2020-06-26 09:33:47 -04:00
function isRequestingDownloadableBlocks ( state , filterValue ) {
if ( ! state . downloadableBlocks [ filterValue ] || ! state . downloadableBlocks [ filterValue ] . isRequesting ) {
return false ;
}
return state . downloadableBlocks [ filterValue ] . isRequesting ;
2020-01-03 08:17:24 -05:00
}
/ * *
* Returns the available uninstalled blocks
*
* @ param { Object } state Global application state .
* @ param { string } filterValue Search string .
*
* @ return { Array } Downloadable blocks
* /
function selectors _getDownloadableBlocks ( state , filterValue ) {
2020-06-26 09:33:47 -04:00
if ( ! state . downloadableBlocks [ filterValue ] || ! state . downloadableBlocks [ filterValue ] . results ) {
2020-01-03 08:17:24 -05:00
return [ ] ;
}
2020-06-26 09:33:47 -04:00
return state . downloadableBlocks [ filterValue ] . results ;
2020-01-03 08:17:24 -05:00
}
/ * *
* Returns the block types that have been installed on the server .
*
* @ param { Object } state Global application state .
*
* @ return { Array } Block type items .
* /
function getInstalledBlockTypes ( state ) {
2020-02-06 16:03:31 -05:00
return state . blockManagement . installedBlockTypes ;
2020-01-03 08:17:24 -05:00
}
/ * *
2020-06-26 09:33:47 -04: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 08:17:24 -05:00
* /
2020-06-26 09:33:47 -04:00
var getNewBlockTypes = Object ( external _this _wp _data _ [ "createRegistrySelector" ] ) ( function ( select ) {
return function ( state ) {
var usedBlockTree = select ( 'core/block-editor' ) . getBlocks ( ) ;
var installedBlockTypes = getInstalledBlockTypes ( state ) ;
var newBlockTypes = [ ] ;
installedBlockTypes . forEach ( function ( blockType ) {
if ( hasBlockType ( blockType , usedBlockTree ) ) {
newBlockTypes . push ( blockType ) ;
}
} ) ;
return newBlockTypes ;
} ;
} ) ;
2020-01-03 08:17:24 -05:00
/ * *
2020-06-26 09:33:47 -04: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 08:17:24 -05:00
* /
2020-06-26 09:33:47 -04:00
var getUnusedBlockTypes = Object ( external _this _wp _data _ [ "createRegistrySelector" ] ) ( function ( select ) {
return function ( state ) {
var usedBlockTree = select ( 'core/block-editor' ) . getBlocks ( ) ;
var installedBlockTypes = getInstalledBlockTypes ( state ) ;
var newBlockTypes = [ ] ;
installedBlockTypes . forEach ( function ( blockType ) {
if ( ! hasBlockType ( blockType , usedBlockTree ) ) {
newBlockTypes . push ( blockType ) ;
}
} ) ;
return newBlockTypes ;
} ;
} ) ;
2020-01-03 08:17:24 -05:00
/ * *
2020-06-26 09:33:47 -04:00
* Returns true if application is calling install endpoint .
2020-01-03 08:17:24 -05:00
*
2020-06-26 09:33:47 -04:00
* @ param { Object } state Global application state .
* @ param { string } blockId Id of the block .
2020-01-03 08:17:24 -05:00
*
2020-06-26 09:33:47 -04:00
* @ return { boolean } Whether its currently installing
2020-01-03 08:17:24 -05:00
* /
2020-06-26 09:33:47 -04:00
function isInstalling ( state , blockId ) {
return state . blockManagement . isInstalling [ blockId ] || false ;
2020-01-03 08:17:24 -05:00
}
/ * *
2020-06-26 09:33:47 -04:00
* Returns the error notices
2020-01-03 08:17:24 -05:00
*
2020-06-26 09:33:47 -04:00
* @ param { Object } state Global application state .
2020-01-03 08:17:24 -05:00
*
2020-06-26 09:33:47 -04:00
* @ return { Object } Object with error notices .
2020-01-03 08:17:24 -05:00
* /
2020-06-26 09:33:47 -04:00
function getErrorNotices ( state ) {
return state . errorNotices ;
2020-01-03 08:17:24 -05:00
}
/ * *
2020-06-26 09:33:47 -04:00
* Returns the error notice for a given block .
2020-01-03 08:17:24 -05:00
*
2020-06-26 09:33:47 -04:00
* @ param { Object } state Global application state .
* @ param { string } blockId The ID of the block plugin . eg : my - block
2020-01-03 08:17:24 -05:00
*
2020-06-26 09:33:47 -04:00
* @ return { string | boolean } The error text , or false if no error .
2020-01-03 08:17:24 -05:00
* /
2020-06-26 09:33:47 -04:00
function getErrorNoticeForBlock ( state , blockId ) {
2020-07-07 10:43:35 -04:00
return state . errorNotices [ blockId ] ;
2020-01-03 08:17:24 -05:00
}
2020-06-26 09:33:47 -04:00
// EXTERNAL MODULE: external {"this":"regeneratorRuntime"}
var external _this _regeneratorRuntime _ = _ _webpack _require _ _ ( 23 ) ;
var external _this _regeneratorRuntime _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( external _this _regeneratorRuntime _ ) ;
// EXTERNAL MODULE: external {"this":["wp","i18n"]}
var external _this _wp _i18n _ = _ _webpack _require _ _ ( 1 ) ;
2020-07-07 10:43:35 -04:00
// EXTERNAL MODULE: external {"this":["wp","url"]}
var external _this _wp _url _ = _ _webpack _require _ _ ( 30 ) ;
2020-06-26 09:33:47 -04:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/controls.js
2020-07-07 10:43:35 -04:00
/ * *
* WordPress dependencies
* /
2020-01-03 08:17:24 -05:00
/ * *
2020-06-26 09:33:47 -04:00
* Loads a JavaScript file .
*
* @ param { string } asset The url for this file .
2020-01-03 08:17:24 -05:00
*
2020-06-26 09:33:47 -04:00
* @ return { Promise } Promise which will resolve when the asset is loaded .
2020-01-03 08:17:24 -05:00
* /
2020-07-07 10:43:35 -04:00
var controls _loadScript = function loadScript ( asset ) {
if ( ! asset || ! /\.js$/ . test ( Object ( external _this _wp _url _ [ "getPath" ] ) ( asset ) ) ) {
2020-06-26 09:33:47 -04:00
return Promise . reject ( new Error ( 'No script found.' ) ) ;
2020-01-03 08:17:24 -05:00
}
2020-06-26 09:33:47 -04:00
return new Promise ( function ( resolve , reject ) {
var existing = document . querySelector ( "script[src=\"" . concat ( asset , "\"]" ) ) ;
2020-01-03 08:17:24 -05:00
2020-06-26 09:33:47 -04:00
if ( existing ) {
existing . parentNode . removeChild ( existing ) ;
}
var script = document . createElement ( 'script' ) ;
script . src = asset ;
script . onload = function ( ) {
return resolve ( true ) ;
} ;
2020-01-03 08:17:24 -05:00
2020-06-26 09:33:47 -04:00
script . onerror = function ( ) {
return reject ( new Error ( 'Error loading script.' ) ) ;
} ;
document . body . appendChild ( script ) ;
} ) ;
2020-01-03 08:17:24 -05:00
} ;
/ * *
2020-06-26 09:33:47 -04:00
* Loads a CSS file .
2020-01-03 08:17:24 -05:00
*
2020-06-26 09:33:47 -04:00
* @ param { string } asset The url for this file .
*
* @ return { Promise } Promise which will resolve when the asset is added .
2020-01-03 08:17:24 -05:00
* /
2020-07-07 10:43:35 -04:00
var controls _loadStyle = function loadStyle ( asset ) {
if ( ! asset || ! /\.css$/ . test ( Object ( external _this _wp _url _ [ "getPath" ] ) ( asset ) ) ) {
2020-06-26 09:33:47 -04:00
return Promise . reject ( new Error ( 'No style found.' ) ) ;
2020-01-03 08:17:24 -05:00
}
2020-06-26 09:33:47 -04:00
return new Promise ( function ( resolve , reject ) {
var link = document . createElement ( 'link' ) ;
link . rel = 'stylesheet' ;
link . href = asset ;
link . onload = function ( ) {
return resolve ( true ) ;
} ;
link . onerror = function ( ) {
return reject ( new Error ( 'Error loading style.' ) ) ;
} ;
document . body . appendChild ( link ) ;
} ) ;
2020-01-03 08:17:24 -05:00
} ;
/ * *
* Load the asset files for a block
*
2020-06-26 09:33:47 -04:00
* @ param { Array } assets A collection of URLs for the assets .
2020-01-03 08:17:24 -05:00
*
* @ return { Object } Control descriptor .
* /
function loadAssets ( assets ) {
2020-06-26 09:33:47 -04:00
return {
type : 'LOAD_ASSETS' ,
assets : assets
} ;
2020-01-03 08:17:24 -05:00
}
var controls = {
2020-06-26 09:33:47 -04:00
LOAD _ASSETS : function LOAD _ASSETS ( _ref ) {
var assets = _ref . assets ;
var scripts = assets . map ( function ( asset ) {
2020-07-07 10:43:35 -04:00
return Object ( external _this _wp _url _ [ "getPath" ] ) ( asset ) . match ( /\.js$/ ) !== null ? controls _loadScript ( asset ) : controls _loadStyle ( asset ) ;
2020-01-03 08:17:24 -05:00
} ) ;
2020-06-26 09:33:47 -04:00
return Promise . all ( scripts ) ;
2020-01-03 08:17:24 -05:00
}
} ;
/* harmony default export */ var store _controls = ( controls ) ;
2020-07-07 10:43:35 -04: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 08:17:24 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/actions.js
2020-06-26 09:33:47 -04:00
var _marked = /*#__PURE__*/ external _this _regeneratorRuntime _default . a . mark ( actions _installBlockType ) ,
_marked2 = /*#__PURE__*/ external _this _regeneratorRuntime _default . a . mark ( actions _uninstallBlockType ) ;
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 08:17:24 -05:00
/ * *
* WordPress dependencies
* /
2020-06-26 09:33:47 -04:00
2020-01-03 08:17:24 -05:00
/ * *
* Internal dependencies
* /
2020-07-07 10:43:35 -04:00
2020-01-03 08:17:24 -05:00
/ * *
2020-06-26 09:33:47 -04:00
* Returns an action object used in signalling that the downloadable blocks
* have been requested and is loading .
*
* @ param { string } filterValue Search string .
2020-01-03 08:17:24 -05:00
*
* @ return { Object } Action object .
* /
2020-06-26 09:33:47 -04:00
function fetchDownloadableBlocks ( filterValue ) {
2020-01-03 08:17:24 -05:00
return {
2020-06-26 09:33:47 -04:00
type : 'FETCH_DOWNLOADABLE_BLOCKS' ,
filterValue : filterValue
2020-01-03 08:17:24 -05:00
} ;
}
/ * *
2020-06-26 09:33:47 -04:00
* Returns an action object used in signalling that the downloadable blocks
* have been updated .
2020-01-03 08:17:24 -05:00
*
2020-06-26 09:33:47 -04:00
* @ param { Array } downloadableBlocks Downloadable blocks .
* @ param { string } filterValue Search string .
2020-01-03 08:17:24 -05:00
*
* @ return { Object } Action object .
* /
function receiveDownloadableBlocks ( downloadableBlocks , filterValue ) {
return {
type : 'RECEIVE_DOWNLOADABLE_BLOCKS' ,
downloadableBlocks : downloadableBlocks ,
filterValue : filterValue
} ;
}
/ * *
2020-06-26 09:33:47 -04:00
* Action triggered to install a block plugin .
*
* @ param { Object } block The block item returned by search .
2020-01-03 08:17:24 -05:00
*
2020-06-26 09:33:47 -04:00
* @ return { boolean } Whether the block was successfully installed & loaded .
2020-01-03 08:17:24 -05:00
* /
2020-06-26 09:33:47 -04:00
function actions _installBlockType ( block ) {
2020-07-07 10:43:35 -04:00
var id , assets , success , url , links , response , registeredBlocks , message , isFatal , fatalAPIErrors ;
2020-06-26 09:33:47 -04:00
return external _this _regeneratorRuntime _default . a . wrap ( function installBlockType$ ( _context ) {
2020-01-03 08:17:24 -05:00
while ( 1 ) {
switch ( _context . prev = _context . next ) {
case 0 :
2020-06-26 09:33:47 -04:00
id = block . id , assets = block . assets ;
success = false ;
_context . next = 4 ;
return clearErrorNotice ( id ) ;
case 4 :
_context . prev = 4 ;
2020-01-03 08:17:24 -05:00
2020-06-26 09:33:47 -04:00
if ( ! ( ! Array . isArray ( assets ) || ! assets . length ) ) {
_context . next = 7 ;
2020-01-03 08:17:24 -05:00
break ;
}
2020-06-26 09:33:47 -04:00
throw new Error ( Object ( external _this _wp _i18n _ [ "__" ] ) ( 'Block has no assets.' ) ) ;
2020-01-03 08:17:24 -05:00
2020-06-26 09:33:47 -04:00
case 7 :
_context . next = 9 ;
return setIsInstalling ( block . id , true ) ;
2020-01-03 08:17:24 -05:00
2020-06-26 09:33:47 -04:00
case 9 :
2020-07-07 10:43:35 -04:00
// If we have a wp:plugin link, the plugin is installed but inactive.
url = getPluginUrl ( block ) ;
links = { } ;
if ( ! url ) {
_context . next = 16 ;
break ;
}
_context . next = 14 ;
return Object ( external _this _wp _dataControls _ [ "apiFetch" ] ) ( {
url : url ,
data : {
status : 'active'
} ,
method : 'PUT'
} ) ;
case 14 :
_context . next = 20 ;
break ;
case 16 :
_context . next = 18 ;
2020-06-26 09:33:47 -04:00
return Object ( external _this _wp _dataControls _ [ "apiFetch" ] ) ( {
2020-07-07 10:43:35 -04:00
path : 'wp/v2/plugins' ,
2020-06-26 09:33:47 -04:00
data : {
slug : block . id ,
status : 'active'
} ,
method : 'POST'
} ) ;
2020-01-03 08:17:24 -05:00
2020-07-07 10:43:35 -04:00
case 18 :
2020-06-26 09:33:47 -04:00
response = _context . sent ;
2020-07-07 10:43:35 -04:00
// Add the `self` link for newly-installed blocks.
links = response . _links ;
case 20 :
_context . next = 22 ;
2020-06-26 09:33:47 -04:00
return addInstalledBlockType ( actions _objectSpread ( { } , block , {
2020-07-07 10:43:35 -04:00
links : actions _objectSpread ( { } , block . links , { } , links )
2020-06-26 09:33:47 -04:00
} ) ) ;
2020-01-03 08:17:24 -05:00
2020-07-07 10:43:35 -04:00
case 22 :
_context . next = 24 ;
2020-06-26 09:33:47 -04:00
return loadAssets ( assets ) ;
2020-01-03 08:17:24 -05:00
2020-07-07 10:43:35 -04:00
case 24 :
_context . next = 26 ;
2020-06-26 09:33:47 -04:00
return Object ( external _this _wp _dataControls _ [ "select" ] ) ( 'core/blocks' , 'getBlockTypes' ) ;
2020-01-03 08:17:24 -05:00
2020-07-07 10:43:35 -04:00
case 26 :
2020-06-26 09:33:47 -04:00
registeredBlocks = _context . sent ;
2020-01-03 08:17:24 -05:00
2020-07-07 10:43:35 -04:00
if ( ! ( ! registeredBlocks . length || ! registeredBlocks . filter ( function ( i ) {
return i . name === block . name ;
} ) . length ) ) {
_context . next = 29 ;
2020-01-03 08:17:24 -05:00
break ;
}
2020-07-07 10:43:35 -04:00
throw new Error ( Object ( external _this _wp _i18n _ [ "__" ] ) ( 'Error registering block. Try reloading the page.' ) ) ;
2020-01-03 08:17:24 -05:00
2020-07-07 10:43:35 -04:00
case 29 :
2020-06-26 09:33:47 -04:00
success = true ;
2020-07-07 10:43:35 -04:00
_context . next = 40 ;
2020-01-03 08:17:24 -05:00
break ;
2020-07-07 10:43:35 -04:00
case 32 :
_context . prev = 32 ;
2020-06-26 09:33:47 -04:00
_context . t0 = _context [ "catch" ] ( 4 ) ;
2020-07-07 10:43:35 -04:00
message = _context . t0 . message || Object ( external _this _wp _i18n _ [ "__" ] ) ( 'An error occurred.' ) ; // Errors we throw are fatal
2020-01-03 08:17:24 -05:00
2020-07-07 10:43:35 -04:00
isFatal = _context . t0 instanceof Error ; // Specific API errors that are fatal
fatalAPIErrors = {
folder _exists : Object ( external _this _wp _i18n _ [ "__" ] ) ( 'This block is already installed. Try reloading the page.' ) ,
unable _to _connect _to _filesystem : Object ( external _this _wp _i18n _ [ "__" ] ) ( 'Error installing block. You can reload the page and try again.' )
} ;
if ( fatalAPIErrors [ _context . t0 . code ] ) {
isFatal = true ;
message = fatalAPIErrors [ _context . t0 . code ] ;
}
_context . next = 40 ;
return setErrorNotice ( id , message , isFatal ) ;
case 40 :
_context . next = 42 ;
2020-06-26 09:33:47 -04:00
return setIsInstalling ( block . id , false ) ;
2020-07-07 10:43:35 -04:00
case 42 :
2020-06-26 09:33:47 -04:00
return _context . abrupt ( "return" , success ) ;
2020-07-07 10:43:35 -04:00
case 43 :
2020-01-03 08:17:24 -05:00
case "end" :
2020-06-26 09:33:47 -04:00
return _context . stop ( ) ;
2020-01-03 08:17:24 -05:00
}
}
2020-07-07 10:43:35 -04:00
} , _marked , null , [ [ 4 , 32 ] ] ) ;
2020-01-03 08:17:24 -05:00
}
/ * *
* Action triggered to uninstall a block plugin .
*
2020-06-26 09:33:47 -04:00
* @ param { Object } block The blockType object .
2020-01-03 08:17:24 -05:00
* /
2020-06-26 09:33:47 -04:00
function actions _uninstallBlockType ( block ) {
return external _this _regeneratorRuntime _default . a . wrap ( function uninstallBlockType$ ( _context2 ) {
2020-01-03 08:17:24 -05:00
while ( 1 ) {
2020-06-26 09:33:47 -04:00
switch ( _context2 . prev = _context2 . next ) {
2020-01-03 08:17:24 -05:00
case 0 :
2020-06-26 09:33:47 -04:00
_context2 . prev = 0 ;
_context2 . next = 3 ;
return Object ( external _this _wp _dataControls _ [ "apiFetch" ] ) ( {
2020-07-07 10:43:35 -04:00
url : getPluginUrl ( block ) ,
2020-01-03 08:17:24 -05:00
data : {
2020-06-26 09:33:47 -04:00
status : 'inactive'
2020-01-03 08:17:24 -05:00
} ,
2020-06-26 09:33:47 -04:00
method : 'PUT'
} ) ;
2020-01-03 08:17:24 -05:00
2020-06-26 09:33:47 -04:00
case 3 :
_context2 . next = 5 ;
return Object ( external _this _wp _dataControls _ [ "apiFetch" ] ) ( {
2020-07-07 10:43:35 -04:00
url : getPluginUrl ( block ) ,
2020-06-26 09:33:47 -04:00
method : 'DELETE'
2020-01-03 08:17:24 -05:00
} ) ;
2020-06-26 09:33:47 -04:00
case 5 :
_context2 . next = 7 ;
return removeInstalledBlockType ( block ) ;
case 7 :
_context2 . next = 13 ;
2020-01-03 08:17:24 -05:00
break ;
2020-06-26 09:33:47 -04:00
case 9 :
_context2 . prev = 9 ;
_context2 . t0 = _context2 [ "catch" ] ( 0 ) ;
_context2 . next = 13 ;
return Object ( external _this _wp _dataControls _ [ "dispatch" ] ) ( 'core/notices' , 'createErrorNotice' , _context2 . t0 . message || Object ( external _this _wp _i18n _ [ "__" ] ) ( 'An error occurred.' ) ) ;
2020-01-03 08:17:24 -05:00
2020-06-26 09:33:47 -04:00
case 13 :
2020-01-03 08:17:24 -05:00
case "end" :
2020-06-26 09:33:47 -04:00
return _context2 . stop ( ) ;
2020-01-03 08:17:24 -05:00
}
}
2020-06-26 09:33:47 -04:00
} , _marked2 , null , [ [ 0 , 9 ] ] ) ;
2020-01-03 08:17:24 -05:00
}
/ * *
* Returns an action object used to add a newly installed block type .
*
2020-06-26 09:33:47 -04:00
* @ param { Object } item The block item with the block id and name .
2020-01-03 08:17:24 -05:00
*
* @ return { Object } Action object .
* /
function addInstalledBlockType ( item ) {
return {
type : 'ADD_INSTALLED_BLOCK_TYPE' ,
item : item
} ;
}
/ * *
* Returns an action object used to remove a newly installed block type .
*
* @ 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 09:33:47 -04:00
/ * *
* Returns an action object used to indicate install in progress
*
* @ param { string } blockId
* @ param { boolean } isInstalling
*
* @ return { Object } Action object .
* /
function setIsInstalling ( blockId , isInstalling ) {
return {
type : 'SET_INSTALLING_BLOCK' ,
blockId : blockId ,
isInstalling : isInstalling
} ;
}
/ * *
* Sets an error notice string to be displayed to the user
*
* @ param { string } blockId The ID of the block plugin . eg : my - block
2020-07-07 10:43:35 -04:00
* @ param { string } message The message shown in the notice .
* @ param { boolean } isFatal Whether the user can recover from the error
2020-06-26 09:33:47 -04:00
*
* @ return { Object } Action object .
* /
2020-07-07 10:43:35 -04:00
function setErrorNotice ( blockId , message ) {
var isFatal = arguments . length > 2 && arguments [ 2 ] !== undefined ? arguments [ 2 ] : false ;
2020-06-26 09:33:47 -04:00
return {
type : 'SET_ERROR_NOTICE' ,
blockId : blockId ,
2020-07-07 10:43:35 -04:00
message : message ,
isFatal : isFatal
2020-06-26 09:33:47 -04:00
} ;
}
/ * *
* Sets the error notice to empty for specific block
*
* @ param { string } blockId The ID of the block plugin . eg : my - block
*
* @ return { Object } Action object .
* /
function clearErrorNotice ( blockId ) {
return {
2020-07-07 10:43:35 -04:00
type : 'CLEAR_ERROR_NOTICE' ,
blockId : blockId
2020-06-26 09:33:47 -04:00
} ;
}
2020-01-03 08:17:24 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/resolvers.js
/ * *
* External dependencies
* /
/ * *
2020-06-26 09:33:47 -04:00
* WordPress dependencies
2020-01-03 08:17:24 -05:00
* /
2020-06-26 09:33:47 -04:00
/ * *
* Internal dependencies
* /
2020-01-03 08:17:24 -05:00
/* harmony default export */ var resolvers = ( {
2020-06-26 09:33:47 -04:00
getDownloadableBlocks : /*#__PURE__*/ external _this _regeneratorRuntime _default . a . mark ( function getDownloadableBlocks ( filterValue ) {
2020-01-03 08:17:24 -05:00
var results , blocks ;
return external _this _regeneratorRuntime _default . a . wrap ( function getDownloadableBlocks$ ( _context ) {
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 ;
2020-06-26 09:33:47 -04:00
return Object ( external _this _wp _dataControls _ [ "apiFetch" ] ) ( {
2020-07-07 10:43:35 -04:00
path : "wp/v2/block-directory/search?term=" . concat ( filterValue )
2020-01-03 08:17:24 -05:00
} ) ;
case 7 :
results = _context . sent ;
blocks = results . map ( function ( result ) {
return Object ( external _this _lodash _ [ "mapKeys" ] ) ( result , function ( value , key ) {
return Object ( external _this _lodash _ [ "camelCase" ] ) ( key ) ;
} ) ;
} ) ;
_context . next = 11 ;
return receiveDownloadableBlocks ( blocks , filterValue ) ;
case 11 :
2020-07-07 10:43:35 -04:00
_context . next = 15 ;
2020-01-03 08:17:24 -05:00
break ;
case 13 :
_context . prev = 13 ;
_context . t0 = _context [ "catch" ] ( 2 ) ;
2020-07-07 10:43:35 -04:00
case 15 :
2020-01-03 08:17:24 -05: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 09:33:47 -04: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 08:17:24 -05:00
/ * *
* WordPress dependencies
* /
2020-06-26 09:33:47 -04:00
2020-01-03 08:17:24 -05:00
/ * *
* Internal dependencies
* /
/ * *
* Module Constants
* /
var MODULE _KEY = 'core/block-directory' ;
/ * *
* Block editor data store configuration .
*
* @ see https : //github.com/WordPress/gutenberg/blob/master/packages/data/README.md#registerStore
*
* @ type { Object }
* /
var storeConfig = {
reducer : reducer ,
selectors : selectors _namespaceObject ,
actions : actions _namespaceObject ,
2020-06-26 09:33:47 -04:00
controls : store _objectSpread ( { } , external _this _wp _dataControls _ [ "controls" ] , { } , store _controls ) ,
2020-01-03 08:17:24 -05:00
resolvers : resolvers
} ;
var store = Object ( external _this _wp _data _ [ "registerStore" ] ) ( MODULE _KEY , storeConfig ) ;
/* harmony default export */ var build _module _store = ( store ) ;
// EXTERNAL MODULE: external {"this":["wp","element"]}
var external _this _wp _element _ = _ _webpack _require _ _ ( 0 ) ;
2020-01-08 06:57:23 -05:00
// EXTERNAL MODULE: external {"this":["wp","plugins"]}
2020-06-26 09:33:47 -04:00
var external _this _wp _plugins _ = _ _webpack _require _ _ ( 63 ) ;
// EXTERNAL MODULE: external {"this":["wp","blocks"]}
2020-07-07 10:43:35 -04:00
var external _this _wp _blocks _ = _ _webpack _require _ _ ( 10 ) ;
2020-06-26 09:33:47 -04:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/auto-block-uninstaller/index.js
/ * *
* WordPress dependencies
* /
function AutoBlockUninstaller ( ) {
var _useDispatch = Object ( external _this _wp _data _ [ "useDispatch" ] ) ( 'core/block-directory' ) ,
uninstallBlockType = _useDispatch . uninstallBlockType ;
var shouldRemoveBlockTypes = Object ( external _this _wp _data _ [ "useSelect" ] ) ( function ( select ) {
var _select = select ( 'core/editor' ) ,
isAutosavingPost = _select . isAutosavingPost ,
isSavingPost = _select . isSavingPost ;
return isSavingPost ( ) && ! isAutosavingPost ( ) ;
2020-07-07 10:43:35 -04:00
} , [ ] ) ;
2020-06-26 09:33:47 -04:00
var unusedBlockTypes = Object ( external _this _wp _data _ [ "useSelect" ] ) ( function ( select ) {
return select ( 'core/block-directory' ) . getUnusedBlockTypes ( ) ;
2020-07-07 10:43:35 -04:00
} , [ ] ) ;
2020-06-26 09:33:47 -04:00
Object ( external _this _wp _element _ [ "useEffect" ] ) ( function ( ) {
if ( shouldRemoveBlockTypes && unusedBlockTypes . length ) {
unusedBlockTypes . forEach ( function ( blockType ) {
uninstallBlockType ( blockType ) ;
Object ( external _this _wp _blocks _ [ "unregisterBlockType" ] ) ( blockType . name ) ;
} ) ;
}
} , [ shouldRemoveBlockTypes ] ) ;
return null ;
}
2020-01-08 06:57:23 -05:00
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
2020-07-07 10:43:35 -04:00
var slicedToArray = _ _webpack _require _ _ ( 13 ) ;
2020-01-08 06:57:23 -05:00
// EXTERNAL MODULE: external {"this":["wp","blockEditor"]}
2020-06-26 09:33:47 -04:00
var external _this _wp _blockEditor _ = _ _webpack _require _ _ ( 7 ) ;
2020-01-08 06:57:23 -05:00
2020-01-03 08:17:24 -05:00
// EXTERNAL MODULE: external {"this":["wp","compose"]}
2020-06-26 09:33:47 -04:00
var external _this _wp _compose _ = _ _webpack _require _ _ ( 9 ) ;
2020-01-03 08:17:24 -05:00
// EXTERNAL MODULE: external {"this":["wp","components"]}
var external _this _wp _components _ = _ _webpack _require _ _ ( 3 ) ;
2020-06-26 09:33:47 -04: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 ;
return Object ( external _this _wp _element _ [ "createElement" ] ) ( external _this _wp _element _ [ "Fragment" ] , null , Object ( external _this _wp _element _ [ "createElement" ] ) ( "span" , {
className : "block-directory-downloadable-block-author-info__content-author"
} , Object ( external _this _wp _i18n _ [ "sprintf" ] ) (
/* translators: %s: author name. */
Object ( external _this _wp _i18n _ [ "__" ] ) ( 'Authored by %s' ) , author ) ) , Object ( external _this _wp _element _ [ "createElement" ] ) ( "span" , {
className : "block-directory-downloadable-block-author-info__content"
} , authorBlockRating > 0 ? Object ( external _this _wp _i18n _ [ "sprintf" ] ) (
/* translators: 1: number of blocks. 2: average rating. */
Object ( external _this _wp _i18n _ [ "_n" ] ) ( 'This author has %1$d block, with an average rating of %2$d.' , 'This author has %1$d blocks, with an average rating of %2$d.' , authorBlockCount ) , authorBlockCount , authorBlockRating ) : Object ( external _this _wp _i18n _ [ "sprintf" ] ) (
/* translators: 1: number of blocks. */
Object ( external _this _wp _i18n _ [ "_n" ] ) ( 'This author has %1$d block.' , 'This author has %1$d blocks.' , authorBlockCount ) , authorBlockCount ) ) ) ;
}
/* harmony default export */ var downloadable _block _author _info = ( DownloadableBlockAuthorInfo ) ;
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js
2020-07-07 12:08:28 -04:00
var build _module _icon = _ _webpack _require _ _ ( 130 ) ;
2020-06-26 09:33:47 -04:00
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/star-filled.js
2020-07-07 12:08:28 -04:00
var star _filled = _ _webpack _require _ _ ( 281 ) ;
2020-06-26 09:33:47 -04:00
// EXTERNAL MODULE: external {"this":["wp","primitives"]}
var external _this _wp _primitives _ = _ _webpack _require _ _ ( 6 ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/star-half.js
/ * *
* WordPress dependencies
* /
var starHalf = Object ( external _this _wp _element _ [ "createElement" ] ) ( external _this _wp _primitives _ [ "SVG" ] , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
} , Object ( external _this _wp _element _ [ "createElement" ] ) ( external _this _wp _primitives _ [ "Path" ] , {
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
2020-07-07 12:08:28 -04:00
var star _empty = _ _webpack _require _ _ ( 282 ) ;
2020-06-26 09:33:47 -04:00
2020-01-03 08:17:24 -05: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 ) ;
return Object ( external _this _wp _element _ [ "createElement" ] ) ( "div" , {
2020-06-26 09:33:47 -04:00
"aria-label" : Object ( external _this _wp _i18n _ [ "sprintf" ] ) (
/* translators: %s: number of stars. */
Object ( external _this _wp _i18n _ [ "__" ] ) ( '%s out of 5 stars' ) , stars )
2020-01-03 08:17:24 -05:00
} , Object ( external _this _lodash _ [ "times" ] ) ( fullStarCount , function ( i ) {
2020-06-26 09:33:47 -04:00
return Object ( external _this _wp _element _ [ "createElement" ] ) ( build _module _icon [ "a" /* default */ ] , {
2020-01-03 08:17:24 -05:00
key : "full_stars_" . concat ( i ) ,
2020-06-26 09:33:47 -04:00
icon : star _filled [ "a" /* default */ ] ,
2020-01-03 08:17:24 -05:00
size : 16
} ) ;
} ) , Object ( external _this _lodash _ [ "times" ] ) ( halfStarCount , function ( i ) {
2020-06-26 09:33:47 -04:00
return Object ( external _this _wp _element _ [ "createElement" ] ) ( build _module _icon [ "a" /* default */ ] , {
2020-01-03 08:17:24 -05:00
key : "half_stars_" . concat ( i ) ,
2020-06-26 09:33:47 -04:00
icon : star _half ,
2020-01-03 08:17:24 -05:00
size : 16
} ) ;
} ) , Object ( external _this _lodash _ [ "times" ] ) ( emptyStarCount , function ( i ) {
2020-06-26 09:33:47 -04:00
return Object ( external _this _wp _element _ [ "createElement" ] ) ( build _module _icon [ "a" /* default */ ] , {
2020-01-03 08:17:24 -05:00
key : "empty_stars_" . concat ( i ) ,
2020-06-26 09:33:47 -04:00
icon : star _empty [ "a" /* default */ ] ,
2020-01-03 08:17:24 -05: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 ;
return Object ( external _this _wp _element _ [ "createElement" ] ) ( "div" , {
className : "block-directory-block-ratings"
} , Object ( external _this _wp _element _ [ "createElement" ] ) ( block _ratings _stars , {
rating : rating
} ) , Object ( external _this _wp _element _ [ "createElement" ] ) ( "span" , {
className : "block-directory-block-ratings__rating-count" ,
2020-06-26 09:33:47 -04:00
"aria-label" : Object ( external _this _wp _i18n _ [ "sprintf" ] ) ( // translators: %d: number of ratings (number).
Object ( external _this _wp _i18n _ [ "_n" ] ) ( '%d total rating' , '%d total ratings' , ratingCount ) , ratingCount )
2020-01-03 08:17:24 -05:00
} , "(" , ratingCount , ")" ) ) ;
} ;
/* harmony default export */ var block _ratings = ( block _ratings _BlockRatings ) ;
2020-06-26 09:33:47 -04: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 ;
return Object ( external _this _wp _element _ [ "createElement" ] ) ( "div" , {
className : "block-directory-downloadable-block-icon"
2020-07-07 10:43:35 -04:00
} , icon . match ( /\.(jpeg|jpg|gif|png|svg)(?:\?.*)?$/ ) !== null ? Object ( external _this _wp _element _ [ "createElement" ] ) ( "img" , {
2020-06-26 09:33:47 -04:00
src : icon ,
alt : Object ( external _this _wp _i18n _ [ "sprintf" ] ) ( // translators: %s: Name of the plugin e.g: "Akismet".
Object ( external _this _wp _i18n _ [ "__" ] ) ( '%s block icon' ) , title )
} ) : Object ( external _this _wp _element _ [ "createElement" ] ) ( external _this _wp _blockEditor _ [ "BlockIcon" ] , {
icon : icon ,
showColors : true
} ) ) ;
}
/* harmony default export */ var downloadable _block _icon = ( DownloadableBlockIcon ) ;
2020-01-03 08:17:24 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-header/index.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
function DownloadableBlockHeader ( _ref ) {
var icon = _ref . icon ,
title = _ref . title ,
rating = _ref . rating ,
ratingCount = _ref . ratingCount ,
2020-07-07 10:43:35 -04: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 08:17:24 -05:00
_onClick = _ref . onClick ;
return Object ( external _this _wp _element _ [ "createElement" ] ) ( "div" , {
className : "block-directory-downloadable-block-header__row"
2020-06-26 09:33:47 -04:00
} , Object ( external _this _wp _element _ [ "createElement" ] ) ( downloadable _block _icon , {
2020-01-03 08:17:24 -05:00
icon : icon ,
2020-06-26 09:33:47 -04:00
title : title
} ) , Object ( external _this _wp _element _ [ "createElement" ] ) ( "div" , {
2020-01-03 08:17:24 -05:00
className : "block-directory-downloadable-block-header__column"
2020-06-26 09:33:47 -04:00
} , Object ( external _this _wp _element _ [ "createElement" ] ) ( "h2" , {
2020-01-03 08:17:24 -05:00
className : "block-directory-downloadable-block-header__title"
} , title ) , Object ( external _this _wp _element _ [ "createElement" ] ) ( block _ratings , {
rating : rating ,
ratingCount : ratingCount
} ) ) , Object ( external _this _wp _element _ [ "createElement" ] ) ( external _this _wp _components _ [ "Button" ] , {
2020-06-26 09:33:47 -04:00
isSecondary : true ,
isBusy : isLoading ,
2020-07-07 10:43:35 -04:00
disabled : isLoading || ! isInstallable ,
2020-01-03 08:17:24 -05:00
onClick : function onClick ( event ) {
event . preventDefault ( ) ;
2020-07-07 10:43:35 -04:00
if ( ! isLoading && isInstallable ) {
2020-06-26 09:33:47 -04:00
_onClick ( ) ;
}
2020-01-03 08:17:24 -05:00
}
2020-06-26 09:33:47 -04:00
} , isLoading ? Object ( external _this _wp _i18n _ [ "__" ] ) ( 'Adding…' ) : Object ( external _this _wp _i18n _ [ "__" ] ) ( 'Add block' ) ) ) ;
2020-01-03 08:17:24 -05:00
}
/* harmony default export */ var downloadable _block _header = ( DownloadableBlockHeader ) ;
2020-06-26 09:33:47 -04:00
// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chart-line.js
2020-01-03 08:17:24 -05:00
/ * *
* WordPress dependencies
* /
2020-06-26 09:33:47 -04:00
var chartLine = Object ( external _this _wp _element _ [ "createElement" ] ) ( external _this _wp _primitives _ [ "SVG" ] , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "-2 -2 24 24"
} , Object ( external _this _wp _element _ [ "createElement" ] ) ( external _this _wp _primitives _ [ "Path" ] , {
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 17:33:27 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/update.js
/ * *
* WordPress dependencies
* /
var update = Object ( external _this _wp _element _ [ "createElement" ] ) ( external _this _wp _primitives _ [ "SVG" ] , {
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "-2 -2 24 24"
} , Object ( external _this _wp _element _ [ "createElement" ] ) ( external _this _wp _primitives _ [ "Path" ] , {
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 08:17:24 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-info/index.js
/ * *
* WordPress dependencies
* /
function DownloadableBlockInfo ( _ref ) {
var description = _ref . description ,
activeInstalls = _ref . activeInstalls ,
humanizedUpdated = _ref . humanizedUpdated ;
return Object ( external _this _wp _element _ [ "createElement" ] ) ( external _this _wp _element _ [ "Fragment" ] , null , Object ( external _this _wp _element _ [ "createElement" ] ) ( "p" , {
className : "block-directory-downloadable-block-info__content"
} , description ) , Object ( external _this _wp _element _ [ "createElement" ] ) ( "div" , {
2020-06-26 09:33:47 -04:00
className : "block-directory-downloadable-block-info__meta"
} , Object ( external _this _wp _element _ [ "createElement" ] ) ( build _module _icon [ "a" /* default */ ] , {
className : "block-directory-downloadable-block-info__icon" ,
icon : chart _line
} ) , Object ( external _this _wp _i18n _ [ "sprintf" ] ) (
/* translators: %s: number of active installations. */
Object ( external _this _wp _i18n _ [ "_n" ] ) ( '%d active installation' , '%d active installations' , activeInstalls ) , activeInstalls ) ) , Object ( external _this _wp _element _ [ "createElement" ] ) ( "div" , {
className : "block-directory-downloadable-block-info__meta"
} , Object ( external _this _wp _element _ [ "createElement" ] ) ( build _module _icon [ "a" /* default */ ] , {
className : "block-directory-downloadable-block-info__icon" ,
2020-02-10 17:33:27 -05:00
icon : library _update
2020-02-06 16:03:31 -05:00
} ) , // translators: %s: Humanized date of last update e.g: "2 months ago".
2020-06-26 09:33:47 -04:00
Object ( external _this _wp _i18n _ [ "sprintf" ] ) ( Object ( external _this _wp _i18n _ [ "__" ] ) ( 'Updated %s' ) , humanizedUpdated ) ) ) ;
2020-01-03 08:17:24 -05:00
}
/* harmony default export */ var downloadable _block _info = ( DownloadableBlockInfo ) ;
2020-06-26 09:33:47 -04:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-notice/index.js
/ * *
* WordPress dependencies
* /
var downloadable _block _notice _DownloadableBlockNotice = function DownloadableBlockNotice ( _ref ) {
var block = _ref . block ,
_onClick = _ref . onClick ;
var errorNotice = Object ( external _this _wp _data _ [ "useSelect" ] ) ( function ( select ) {
return select ( 'core/block-directory' ) . getErrorNoticeForBlock ( block . id ) ;
} , [ block ] ) ;
if ( ! errorNotice ) {
return null ;
}
return Object ( external _this _wp _element _ [ "createElement" ] ) ( external _this _wp _components _ [ "Notice" ] , {
status : "error" ,
isDismissible : false ,
className : "block-directory-downloadable-block-notice"
} , Object ( external _this _wp _element _ [ "createElement" ] ) ( "div" , {
className : "block-directory-downloadable-block-notice__content"
2020-07-07 10:43:35 -04:00
} , errorNotice . message ) , Object ( external _this _wp _element _ [ "createElement" ] ) ( external _this _wp _components _ [ "Button" ] , {
2020-06-26 09:33:47 -04:00
isSmall : true ,
isPrimary : true ,
onClick : function onClick ( ) {
2020-07-07 10:43:35 -04:00
if ( errorNotice . isFatal ) {
window . location . reload ( ) ;
return false ;
}
2020-06-26 09:33:47 -04:00
_onClick ( block ) ;
}
2020-07-07 10:43:35 -04:00
} , errorNotice . isFatal ? Object ( external _this _wp _i18n _ [ "__" ] ) ( 'Reload' ) : Object ( external _this _wp _i18n _ [ "__" ] ) ( 'Retry' ) ) ) ;
2020-06-26 09:33:47 -04:00
} ;
/* harmony default export */ var downloadable _block _notice = ( downloadable _block _notice _DownloadableBlockNotice ) ;
2020-01-03 08:17:24 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-list-item/index.js
2020-06-26 09:33:47 -04:00
/ * *
* WordPress dependencies
* /
2020-01-03 08:17:24 -05:00
/ * *
* Internal dependencies
* /
2020-06-26 09:33:47 -04:00
2020-01-03 08:17:24 -05:00
function DownloadableBlockListItem ( _ref ) {
var item = _ref . item ,
onClick = _ref . onClick ;
2020-07-07 10:43:35 -04:00
var _useSelect = Object ( external _this _wp _data _ [ "useSelect" ] ) ( function ( select ) {
var _select = select ( 'core/block-directory' ) ,
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 08:17:24 -05: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 ;
return Object ( external _this _wp _element _ [ "createElement" ] ) ( "li" , {
className : "block-directory-downloadable-block-list-item"
} , Object ( external _this _wp _element _ [ "createElement" ] ) ( "article" , {
className : "block-directory-downloadable-block-list-item__panel"
} , Object ( external _this _wp _element _ [ "createElement" ] ) ( "header" , {
className : "block-directory-downloadable-block-list-item__header"
} , Object ( external _this _wp _element _ [ "createElement" ] ) ( downloadable _block _header , {
icon : icon ,
onClick : onClick ,
title : title ,
rating : rating ,
2020-06-26 09:33:47 -04:00
ratingCount : ratingCount ,
2020-07-07 10:43:35 -04:00
isLoading : isLoading ,
isInstallable : isInstallable
2020-01-03 08:17:24 -05:00
} ) ) , Object ( external _this _wp _element _ [ "createElement" ] ) ( "section" , {
className : "block-directory-downloadable-block-list-item__body"
2020-06-26 09:33:47 -04:00
} , Object ( external _this _wp _element _ [ "createElement" ] ) ( downloadable _block _notice , {
onClick : onClick ,
block : item
} ) , Object ( external _this _wp _element _ [ "createElement" ] ) ( downloadable _block _info , {
2020-01-03 08:17:24 -05:00
activeInstalls : activeInstalls ,
description : description ,
humanizedUpdated : humanizedUpdated
} ) ) , Object ( external _this _wp _element _ [ "createElement" ] ) ( "footer" , {
className : "block-directory-downloadable-block-list-item__footer"
} , Object ( external _this _wp _element _ [ "createElement" ] ) ( downloadable _block _author _info , {
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
* /
/ * *
* Internal dependencies
* /
function DownloadableBlocksList ( _ref ) {
var items = _ref . items ,
_ref$onHover = _ref . onHover ,
onHover = _ref$onHover === void 0 ? external _this _lodash _ [ "noop" ] : _ref$onHover ,
2020-06-26 09:33:47 -04:00
onSelect = _ref . onSelect ;
var _useDispatch = Object ( external _this _wp _data _ [ "useDispatch" ] ) ( 'core/block-directory' ) ,
installBlockType = _useDispatch . installBlockType ;
if ( ! items . length ) {
return null ;
}
2020-01-03 08:17:24 -05: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 */
Object ( external _this _wp _element _ [ "createElement" ] ) ( "ul" , {
role : "list" ,
className : "block-directory-downloadable-blocks-list"
2020-06-26 09:33:47 -04:00
} , items . map ( function ( item ) {
return Object ( external _this _wp _element _ [ "createElement" ] ) ( DownloadableBlockListItem , {
2020-01-03 08:17:24 -05:00
key : item . id ,
onClick : function onClick ( ) {
2020-06-26 09:33:47 -04:00
installBlockType ( item ) . then ( function ( success ) {
if ( success ) {
onSelect ( item ) ;
}
} ) ;
2020-01-03 08:17:24 -05:00
onHover ( null ) ;
} ,
item : item
} ) ;
2020-06-26 09:33:47 -04:00
} ) )
2020-01-03 08:17:24 -05:00
/* eslint-enable jsx-a11y/no-redundant-roles */
) ;
}
2020-06-26 09:33:47 -04:00
/* harmony default export */ var downloadable _blocks _list = ( DownloadableBlocksList ) ;
2020-01-03 08:17:24 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-blocks-panel/index.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
function DownloadableBlocksPanel ( _ref ) {
var downloadableItems = _ref . downloadableItems ,
onSelect = _ref . onSelect ,
onHover = _ref . onHover ,
hasPermission = _ref . hasPermission ,
isLoading = _ref . isLoading ,
isWaiting = _ref . isWaiting ,
debouncedSpeak = _ref . debouncedSpeak ;
2020-07-07 10:43:35 -04:00
if ( false === hasPermission ) {
2020-01-03 08:17:24 -05:00
debouncedSpeak ( Object ( external _this _wp _i18n _ [ "__" ] ) ( 'No blocks found in your library. Please contact your site administrator to install new blocks.' ) ) ;
return Object ( external _this _wp _element _ [ "createElement" ] ) ( "p" , {
className : "block-directory-downloadable-blocks-panel__description has-no-results"
} , Object ( external _this _wp _i18n _ [ "__" ] ) ( 'No blocks found in your library.' ) , Object ( external _this _wp _element _ [ "createElement" ] ) ( "br" , null ) , Object ( external _this _wp _i18n _ [ "__" ] ) ( 'Please contact your site administrator to install new blocks.' ) ) ;
}
2020-07-07 10:43:35 -04:00
if ( typeof hasPermission === 'undefined' || isLoading || isWaiting ) {
2020-01-03 08:17:24 -05:00
return Object ( external _this _wp _element _ [ "createElement" ] ) ( "p" , {
className : "block-directory-downloadable-blocks-panel__description has-no-results"
} , Object ( external _this _wp _element _ [ "createElement" ] ) ( external _this _wp _components _ [ "Spinner" ] , null ) ) ;
}
if ( ! downloadableItems . length ) {
return Object ( external _this _wp _element _ [ "createElement" ] ) ( "p" , {
className : "block-directory-downloadable-blocks-panel__description has-no-results"
} , Object ( external _this _wp _i18n _ [ "__" ] ) ( 'No blocks found in your library.' ) ) ;
}
2020-06-26 09:33:47 -04:00
var resultsFoundMessage = Object ( external _this _wp _i18n _ [ "sprintf" ] ) (
/* translators: %s: number of available blocks. */
Object ( external _this _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 08:17:24 -05:00
debouncedSpeak ( resultsFoundMessage ) ;
return Object ( external _this _wp _element _ [ "createElement" ] ) ( external _this _wp _element _ [ "Fragment" ] , null , Object ( external _this _wp _element _ [ "createElement" ] ) ( "p" , {
className : "block-directory-downloadable-blocks-panel__description"
} , Object ( external _this _wp _i18n _ [ "__" ] ) ( 'No blocks found in your library. These blocks can be downloaded and installed:' ) ) , Object ( external _this _wp _element _ [ "createElement" ] ) ( downloadable _blocks _list , {
items : downloadableItems ,
onSelect : onSelect ,
onHover : onHover
} ) ) ;
}
/* harmony default export */ var downloadable _blocks _panel = ( Object ( external _this _wp _compose _ [ "compose" ] ) ( [ external _this _wp _components _ [ "withSpokenMessages" ] , Object ( external _this _wp _data _ [ "withSelect" ] ) ( function ( select , _ref2 ) {
var filterValue = _ref2 . filterValue ;
var _select = select ( 'core/block-directory' ) ,
getDownloadableBlocks = _select . getDownloadableBlocks ,
isRequestingDownloadableBlocks = _select . isRequestingDownloadableBlocks ;
2020-07-07 10:43:35 -04:00
var hasPermission = select ( 'core' ) . canUser ( 'read' , 'block-directory/search' ) ;
2020-01-03 08:17:24 -05:00
var downloadableItems = hasPermission ? getDownloadableBlocks ( filterValue ) : [ ] ;
2020-06-26 09:33:47 -04:00
var isLoading = isRequestingDownloadableBlocks ( filterValue ) ;
2020-01-03 08:17:24 -05:00
return {
downloadableItems : downloadableItems ,
hasPermission : hasPermission ,
isLoading : isLoading
} ;
} ) ] ) ( DownloadableBlocksPanel ) ) ;
2020-01-08 06:57:23 -05: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 ( ) {
var _useState = Object ( external _this _wp _element _ [ "useState" ] ) ( '' ) ,
_useState2 = Object ( slicedToArray [ "a" /* default */ ] ) ( _useState , 2 ) ,
debouncedFilterValue = _useState2 [ 0 ] ,
setFilterValue = _useState2 [ 1 ] ;
var debouncedSetFilterValue = Object ( external _this _lodash _ [ "debounce" ] ) ( setFilterValue , 400 ) ;
return Object ( external _this _wp _element _ [ "createElement" ] ) ( external _this _wp _blockEditor _ [ "__experimentalInserterMenuExtension" ] , null , function ( _ref ) {
var onSelect = _ref . onSelect ,
onHover = _ref . onHover ,
filterValue = _ref . filterValue ,
hasItems = _ref . hasItems ;
if ( hasItems || ! filterValue ) {
return null ;
}
if ( debouncedFilterValue !== filterValue ) {
debouncedSetFilterValue ( filterValue ) ;
}
return Object ( external _this _wp _element _ [ "createElement" ] ) ( downloadable _blocks _panel , {
onSelect : onSelect ,
onHover : onHover ,
filterValue : debouncedFilterValue ,
isWaiting : filterValue !== debouncedFilterValue
} ) ;
} ) ;
}
/* harmony default export */ var inserter _menu _downloadable _blocks _panel = ( InserterMenuDownloadableBlocksPanel ) ;
2020-06-26 09:33:47 -04:00
// EXTERNAL MODULE: external {"this":["wp","editPost"]}
2020-07-07 12:08:28 -04:00
var external _this _wp _editPost _ = _ _webpack _require _ _ ( 256 ) ;
2020-06-26 09:33:47 -04: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 ;
}
return Object ( external _this _wp _element _ [ "createElement" ] ) ( "ul" , {
className : "block-directory-compact-list"
} , items . map ( function ( _ref2 ) {
var icon = _ref2 . icon ,
id = _ref2 . id ,
title = _ref2 . title ,
author = _ref2 . author ;
return Object ( external _this _wp _element _ [ "createElement" ] ) ( "li" , {
key : id ,
className : "block-directory-compact-list__item"
} , Object ( external _this _wp _element _ [ "createElement" ] ) ( downloadable _block _icon , {
icon : icon ,
title : title
} ) , Object ( external _this _wp _element _ [ "createElement" ] ) ( "div" , {
className : "block-directory-compact-list__item-details"
} , Object ( external _this _wp _element _ [ "createElement" ] ) ( "div" , {
className : "block-directory-compact-list__item-title"
} , title ) , Object ( external _this _wp _element _ [ "createElement" ] ) ( "div" , {
className : "block-directory-compact-list__item-author"
} , Object ( external _this _wp _i18n _ [ "sprintf" ] ) (
/* translators: %s: Name of the block author. */
Object ( external _this _wp _i18n _ [ "__" ] ) ( 'By %s' ) , author ) ) ) ) ;
} ) ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/installed-blocks-pre-publish-panel/index.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
function InstalledBlocksPrePublishPanel ( ) {
var newBlockTypes = Object ( external _this _wp _data _ [ "useSelect" ] ) ( function ( select ) {
return select ( 'core/block-directory' ) . getNewBlockTypes ( ) ;
2020-07-07 10:43:35 -04:00
} , [ ] ) ;
2020-06-26 09:33:47 -04:00
if ( ! newBlockTypes . length ) {
return null ;
}
return Object ( external _this _wp _element _ [ "createElement" ] ) ( external _this _wp _editPost _ [ "PluginPrePublishPanel" ] , {
icon : "block-default" ,
title : Object ( external _this _wp _i18n _ [ "sprintf" ] ) ( // translators: %d: number of blocks (number).
Object ( external _this _wp _i18n _ [ "_n" ] ) ( 'Added: %d block' , 'Added: %d blocks' , newBlockTypes . length ) , newBlockTypes . length ) ,
initialOpen : true
} , Object ( external _this _wp _element _ [ "createElement" ] ) ( "p" , {
className : "installed-blocks-pre-publish-panel__copy"
} , Object ( external _this _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 _this _wp _element _ [ "createElement" ] ) ( CompactList , {
items : newBlockTypes
} ) ) ;
}
2020-01-08 06:57:23 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/index.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2020-06-26 09:33:47 -04:00
2020-01-08 06:57:23 -05:00
Object ( external _this _wp _plugins _ [ "registerPlugin" ] ) ( 'block-directory' , {
render : function render ( ) {
2020-06-26 09:33:47 -04:00
return Object ( external _this _wp _element _ [ "createElement" ] ) ( external _this _wp _element _ [ "Fragment" ] , null , Object ( external _this _wp _element _ [ "createElement" ] ) ( AutoBlockUninstaller , null ) , Object ( external _this _wp _element _ [ "createElement" ] ) ( inserter _menu _downloadable _blocks _panel , null ) , Object ( external _this _wp _element _ [ "createElement" ] ) ( InstalledBlocksPrePublishPanel , null ) ) ;
2020-01-08 06:57:23 -05:00
}
} ) ;
2020-01-03 08:17:24 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/index.js
2020-07-07 10:43:35 -04:00
/ * *
* WordPress dependencies
* /
2020-01-03 08:17:24 -05:00
/ * *
* Internal dependencies
* /
2020-07-07 10:43:35 -04:00
2020-01-08 06:57:23 -05:00
/***/ } ) ,
/***/ 5 :
2020-02-06 16:03:31 -05:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2020-01-03 08:17:24 -05:00
2020-02-06 16:03:31 -05:00
"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 ;
}
2020-01-03 08:17:24 -05:00
/***/ } ) ,
2020-06-26 09:33:47 -04:00
/***/ 6 :
2020-01-22 17:06:21 -05:00
/***/ ( function ( module , exports ) {
2020-06-26 09:33:47 -04:00
( function ( ) { module . exports = this [ "wp" ] [ "primitives" ] ; } ( ) ) ;
2020-01-22 17:06:21 -05:00
/***/ } ) ,
2020-06-26 09:33:47 -04:00
/***/ 63 :
2020-02-06 16:03:31 -05:00
/***/ ( function ( module , exports ) {
2020-01-03 08:17:24 -05:00
2020-06-26 09:33:47 -04:00
( function ( ) { module . exports = this [ "wp" ] [ "plugins" ] ; } ( ) ) ;
2020-01-03 08:17:24 -05:00
/***/ } ) ,
2020-06-26 09:33:47 -04:00
/***/ 7 :
2020-01-03 08:17:24 -05:00
/***/ ( function ( module , exports ) {
2020-06-26 09:33:47 -04:00
( function ( ) { module . exports = this [ "wp" ] [ "blockEditor" ] ; } ( ) ) ;
2020-01-03 08:17:24 -05:00
/***/ } ) ,
/***/ 9 :
2020-02-06 16:03:31 -05:00
/***/ ( function ( module , exports ) {
2020-01-08 06:57:23 -05:00
2020-06-26 09:33:47 -04:00
( function ( ) { module . exports = this [ "wp" ] [ "compose" ] ; } ( ) ) ;
2020-01-03 08:17:24 -05:00
2020-07-07 10:43:35 -04:00
/***/ } ) ,
/***/ 92 :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = this [ "wp" ] [ "notices" ] ; } ( ) ) ;
2020-01-03 08:17:24 -05:00
/***/ } )
/******/ } ) ;