2019-09-19 11:19:18 -04:00
this [ "wp" ] = this [ "wp" ] || { } ; this [ "wp" ] [ "dataControls" ] =
/******/ ( 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-08-04 10:04:32 -04:00
/******/ return _ _webpack _require _ _ ( _ _webpack _require _ _ . s = 413 ) ;
2019-09-19 11:19:18 -04:00
/******/ } )
/************************************************************************/
/******/ ( {
2020-07-21 08:14:37 -04:00
/***/ 18 :
2019-09-19 11:19:18 -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-03-23 19:40:19 -04:00
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
2020-06-26 09:33:47 -04:00
var arrayLikeToArray = _ _webpack _require _ _ ( 26 ) ;
2020-03-23 19:40:19 -04:00
2019-09-19 11:19:18 -04:00
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
2020-03-23 19:40:19 -04:00
function _arrayWithoutHoles ( arr ) {
if ( Array . isArray ( arr ) ) return Object ( arrayLikeToArray [ "a" /* default */ ] ) ( arr ) ;
2019-09-19 11:19:18 -04:00
}
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
2020-03-23 19:40:19 -04:00
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 ) ;
2019-09-19 11:19:18 -04:00
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
function _nonIterableSpread ( ) {
2020-03-23 19:40:19 -04:00
throw new TypeError ( "Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method." ) ;
2019-09-19 11:19:18 -04:00
}
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
2020-03-23 19:40:19 -04:00
2019-09-19 11:19:18 -04:00
function _toConsumableArray ( arr ) {
2020-03-23 19:40:19 -04:00
return _arrayWithoutHoles ( arr ) || Object ( iterableToArray [ "a" /* default */ ] ) ( arr ) || Object ( unsupportedIterableToArray [ "a" /* default */ ] ) ( arr ) || _nonIterableSpread ( ) ;
}
/***/ } ) ,
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 10:43:35 -04:00
/***/ 29 :
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 _unsupportedIterableToArray ; } ) ;
2020-06-26 09:33:47 -04:00
/* harmony import */ var _arrayLikeToArray _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 26 ) ;
2020-03-23 19:40:19 -04:00
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 ;
2020-06-26 09:33:47 -04:00
if ( n === "Map" || n === "Set" ) return Array . from ( o ) ;
2020-03-23 19:40:19 -04:00
if ( n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/ . test ( n ) ) return Object ( _arrayLikeToArray _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ /* default */ "a" ] ) ( o , minLen ) ;
2019-09-19 11:19:18 -04:00
}
/***/ } ) ,
2020-03-23 19:40:19 -04:00
/***/ 35 :
2019-10-15 12:17:12 -04: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 ) ;
2019-10-15 12:17:12 -04:00
}
/***/ } ) ,
2020-06-26 09:33:47 -04:00
/***/ 4 :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = this [ "wp" ] [ "data" ] ; } ( ) ) ;
/***/ } ) ,
2020-08-04 10:04:32 -04:00
/***/ 413 :
2019-09-19 11:19:18 -04:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "apiFetch" , function ( ) { return apiFetch ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "select" , function ( ) { return select ; } ) ;
2020-06-26 09:33:47 -04:00
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "__unstableSyncSelect" , function ( ) { return _ _unstableSyncSelect ; } ) ;
2019-09-19 11:19:18 -04:00
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "dispatch" , function ( ) { return dispatch ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "controls" , function ( ) { return controls ; } ) ;
2020-07-21 08:14:37 -04:00
/* harmony import */ var _babel _runtime _helpers _esm _toConsumableArray _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 18 ) ;
2020-06-26 09:33:47 -04:00
/* harmony import */ var _wordpress _api _fetch _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( 45 ) ;
2019-09-19 11:19:18 -04:00
/* harmony import */ var _wordpress _api _fetch _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _api _fetch _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
/* harmony import */ var _wordpress _data _ _WEBPACK _IMPORTED _MODULE _2 _ _ = _ _webpack _require _ _ ( 4 ) ;
/* harmony import */ var _wordpress _data _ _WEBPACK _IMPORTED _MODULE _2 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _wordpress _data _ _WEBPACK _IMPORTED _MODULE _2 _ _ ) ;
/ * *
* WordPress dependencies
* /
/ * *
* Dispatches a control action for triggering an api fetch call .
*
* @ param { Object } request Arguments for the fetch request .
*
* @ example
* ` ` ` js
* import { apiFetch } from '@wordpress/data-controls' ;
*
* // Action generator using apiFetch
2020-01-08 06:57:23 -05:00
* export function * myAction ( ) {
* const path = '/v2/my-api/items' ;
* const items = yield apiFetch ( { path } ) ;
* // do something with the items.
2019-09-19 11:19:18 -04:00
* }
* ` ` `
*
* @ return { Object } The control descriptor .
* /
var apiFetch = function apiFetch ( request ) {
return {
type : 'API_FETCH' ,
request : request
} ;
} ;
/ * *
* Dispatches a control action for triggering a registry select .
*
* Note : when this control action is handled , it automatically considers
* selectors that may have a resolver . It will await and return the resolved
* value when the selector has not been resolved yet .
*
* @ param { string } storeKey The key for the store the selector belongs to
* @ param { string } selectorName The name of the selector
* @ param { Array } args Arguments for the select .
*
* @ example
* ` ` ` js
* import { select } from '@wordpress/data-controls' ;
*
* // Action generator using select
2020-01-08 06:57:23 -05:00
* export function * myAction ( ) {
* const isSidebarOpened = yield select ( 'core/edit-post' , 'isEditorSideBarOpened' ) ;
* // do stuff with the result from the select.
2019-09-19 11:19:18 -04:00
* }
* ` ` `
*
* @ return { Object } The control descriptor .
* /
function select ( storeKey , selectorName ) {
for ( var _len = arguments . length , args = new Array ( _len > 2 ? _len - 2 : 0 ) , _key = 2 ; _key < _len ; _key ++ ) {
args [ _key - 2 ] = arguments [ _key ] ;
}
return {
type : 'SELECT' ,
storeKey : storeKey ,
selectorName : selectorName ,
args : args
} ;
}
2020-06-26 09:33:47 -04:00
/ * *
* Dispatches a control action for triggering a registry select .
*
* Note : This functions like the ` select ` control , but does not wait
* for resolvers .
*
* @ param { string } storeKey The key for the store the selector belongs to .
* @ param { string } selectorName The name of the selector .
* @ param { Array } args Arguments for the select .
*
* @ example
* ` ` ` js
* import { _ _unstableSyncSelect } from '@wordpress/data-controls' ;
*
* // Action generator using `__unstableSyncSelect`.
* export function * myAction ( ) {
* const isEditorSideBarOpened = yield _ _unstableSyncSelect ( 'core/edit-post' , 'isEditorSideBarOpened' ) ;
* // Do stuff with the result from the `__unstableSyncSelect`.
* }
* ` ` `
*
* @ return { Object } The control descriptor .
* /
function _ _unstableSyncSelect ( storeKey , selectorName ) {
for ( var _len2 = arguments . length , args = new Array ( _len2 > 2 ? _len2 - 2 : 0 ) , _key2 = 2 ; _key2 < _len2 ; _key2 ++ ) {
args [ _key2 - 2 ] = arguments [ _key2 ] ;
}
return {
type : 'SYNC_SELECT' ,
storeKey : storeKey ,
selectorName : selectorName ,
args : args
} ;
}
2019-09-19 11:19:18 -04:00
/ * *
* Dispatches a control action for triggering a registry dispatch .
*
* @ param { string } storeKey The key for the store the action belongs to
* @ param { string } actionName The name of the action to dispatch
* @ param { Array } args Arguments for the dispatch action .
*
* @ example
* ` ` ` js
* import { dispatch } from '@wordpress/data-controls' ;
*
* // Action generator using dispatch
2020-01-08 06:57:23 -05:00
* export function * myAction ( ) {
* yield dispatch ( 'core/edit-post' , 'togglePublishSidebar' ) ;
* // do some other things.
2019-09-19 11:19:18 -04:00
* }
* ` ` `
*
* @ return { Object } The control descriptor .
* /
function dispatch ( storeKey , actionName ) {
2020-06-26 09:33:47 -04:00
for ( var _len3 = arguments . length , args = new Array ( _len3 > 2 ? _len3 - 2 : 0 ) , _key3 = 2 ; _key3 < _len3 ; _key3 ++ ) {
args [ _key3 - 2 ] = arguments [ _key3 ] ;
2019-09-19 11:19:18 -04:00
}
return {
type : 'DISPATCH' ,
storeKey : storeKey ,
actionName : actionName ,
args : args
} ;
}
/ * *
* The default export is what you use to register the controls with your custom
* store .
*
* @ example
* ` ` ` js
* // WordPress dependencies
* import { controls } from '@wordpress/data-controls' ;
* import { registerStore } from '@wordpress/data' ;
*
* // Internal dependencies
* import reducer from './reducer' ;
* import * as selectors from './selectors' ;
* import * as actions from './actions' ;
* import * as resolvers from './resolvers' ;
*
2020-01-08 06:57:23 -05:00
* registerStore ( 'my-custom-store' , {
2019-09-19 11:19:18 -04:00
* reducer ,
* controls ,
* actions ,
* selectors ,
* resolvers ,
* } ) ;
* ` ` `
*
* @ return { Object } An object for registering the default controls with the
* store .
* /
var controls = {
2020-01-08 06:57:23 -05:00
API _FETCH : function API _FETCH ( _ref ) {
var request = _ref . request ;
2019-09-19 11:19:18 -04:00
return _wordpress _api _fetch _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default ( ) ( request ) ;
} ,
SELECT : Object ( _wordpress _data _ _WEBPACK _IMPORTED _MODULE _2 _ _ [ "createRegistryControl" ] ) ( function ( registry ) {
2020-01-08 06:57:23 -05:00
return function ( _ref2 ) {
var _registry ;
2019-09-19 11:19:18 -04:00
2020-01-08 06:57:23 -05:00
var storeKey = _ref2 . storeKey ,
selectorName = _ref2 . selectorName ,
args = _ref2 . args ;
return ( _registry = registry [ registry . select ( storeKey ) [ selectorName ] . hasResolver ? '__experimentalResolveSelect' : 'select' ] ( storeKey ) ) [ selectorName ] . apply ( _registry , Object ( _babel _runtime _helpers _esm _toConsumableArray _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ /* default */ "a" ] ) ( args ) ) ;
2019-09-19 11:19:18 -04:00
} ;
} ) ,
2020-06-26 09:33:47 -04:00
SYNC _SELECT : Object ( _wordpress _data _ _WEBPACK _IMPORTED _MODULE _2 _ _ [ "createRegistryControl" ] ) ( function ( registry ) {
2020-01-08 06:57:23 -05:00
return function ( _ref3 ) {
2020-06-26 09:33:47 -04:00
var _registry$select ;
2019-09-19 11:19:18 -04:00
2020-01-08 06:57:23 -05:00
var storeKey = _ref3 . storeKey ,
2020-06-26 09:33:47 -04:00
selectorName = _ref3 . selectorName ,
2020-01-08 06:57:23 -05:00
args = _ref3 . args ;
2020-06-26 09:33:47 -04:00
return ( _registry$select = registry . select ( storeKey ) ) [ selectorName ] . apply ( _registry$select , Object ( _babel _runtime _helpers _esm _toConsumableArray _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ /* default */ "a" ] ) ( args ) ) ;
} ;
} ) ,
DISPATCH : Object ( _wordpress _data _ _WEBPACK _IMPORTED _MODULE _2 _ _ [ "createRegistryControl" ] ) ( function ( registry ) {
return function ( _ref4 ) {
var _registry$dispatch ;
var storeKey = _ref4 . storeKey ,
actionName = _ref4 . actionName ,
args = _ref4 . args ;
2019-09-19 11:19:18 -04:00
return ( _registry$dispatch = registry . dispatch ( storeKey ) ) [ actionName ] . apply ( _registry$dispatch , Object ( _babel _runtime _helpers _esm _toConsumableArray _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ /* default */ "a" ] ) ( args ) ) ;
} ;
} )
} ;
2019-10-15 11:37:08 -04:00
/***/ } ) ,
2020-06-26 09:33:47 -04:00
/***/ 45 :
2019-09-19 11:19:18 -04:00
/***/ ( function ( module , exports ) {
2020-02-06 16:03:31 -05:00
( function ( ) { module . exports = this [ "wp" ] [ "apiFetch" ] ; } ( ) ) ;
2019-09-19 11:19:18 -04:00
/***/ } )
/******/ } ) ;