| @@ -1,32 +1,32 @@ | ||
| 1 | -/******/ (function() { // webpackBootstrap | |
| 1 | +/******/ (() => { // webpackBootstrap | |
| 2 | 2 | /******/ "use strict"; |
| 3 | 3 | /******/ var __webpack_modules__ = ({ |
| 4 | 4 | |
| 5 | -/***/ "@wordpress/api-fetch": | |
| 5 | +/***/ "@wordpress/api-fetch" | |
| 6 | 6 | /*!**********************************!*\ |
| 7 | 7 | !*** external ["wp","apiFetch"] ***! |
| 8 | 8 | \**********************************/ |
| 9 | -/***/ (function(module) { | |
| 9 | +(module) { | |
| 10 | 10 | |
| 11 | 11 | module.exports = window["wp"]["apiFetch"]; |
| 12 | 12 | |
| 13 | -/***/ }) | |
| 13 | +/***/ } | |
| 14 | 14 | |
| 15 | 15 | /******/ }); |
| 16 | 16 | /************************************************************************/ |
| 17 | 17 | /******/ // The module cache |
| 18 | -/******/ var __webpack_module_cache__ = {}; | |
| 18 | +/******/ const __webpack_module_cache__ = {}; | |
| 19 | 19 | /******/ |
| 20 | 20 | /******/ // The require function |
| 21 | 21 | /******/ function __webpack_require__(moduleId) { |
| 22 | 22 | /******/ // Check if module is in cache |
| 23 | -/******/ var cachedModule = __webpack_module_cache__[moduleId]; | |
| 23 | +/******/ const cachedModule = __webpack_module_cache__[moduleId]; | |
| 24 | 24 | /******/ if (cachedModule !== undefined) { |
| 25 | 25 | /******/ return cachedModule.exports; |
| 26 | 26 | /******/ } |
| 27 | 27 | /******/ // Create a new module (and put it into the cache) |
| 28 | -/******/ var module = __webpack_module_cache__[moduleId] = { | |
| 28 | +/******/ const module = __webpack_module_cache__[moduleId] = { | |
| 29 | 29 | /******/ // no module.id needed |
| 30 | 30 | /******/ // no module.loaded needed |
| 31 | 31 | /******/ exports: {} |
| 32 | 32 | /******/ }; |
| @@ -31,8 +31,14 @@ | ||
| 31 | 31 | /******/ exports: {} |
| 32 | 32 | /******/ }; |
| 33 | 33 | /******/ |
| 34 | 34 | /******/ // Execute the module function |
| 35 | +/******/ if (!(moduleId in __webpack_modules__)) { | |
| 36 | +/******/ delete __webpack_module_cache__[moduleId]; | |
| 37 | +/******/ const e = new Error("Cannot find module '" + moduleId + "'"); | |
| 38 | +/******/ e.code = 'MODULE_NOT_FOUND'; | |
| 39 | +/******/ throw e; | |
| 40 | +/******/ } | |
| 35 | 41 | /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); |
| 36 | 42 | /******/ |
| 37 | 43 | /******/ // Return the exports of the module |
| 38 | 44 | /******/ return module.exports; |
| @@ -39,70 +45,83 @@ | ||
| 39 | 45 | /******/ } |
| 40 | 46 | /******/ |
| 41 | 47 | /************************************************************************/ |
| 42 | 48 | /******/ /* webpack/runtime/compat get default export */ |
| 43 | -/******/ !function() { | |
| 49 | +/******/ (() => { | |
| 44 | 50 | /******/ // getDefaultExport function for compatibility with non-harmony modules |
| 45 | -/******/ __webpack_require__.n = function(module) { | |
| 46 | -/******/ var getter = module && module.__esModule ? | |
| 47 | -/******/ function() { return module['default']; } : | |
| 48 | -/******/ function() { return module; }; | |
| 51 | +/******/ __webpack_require__.n = (module) => { | |
| 52 | +/******/ const getter = module && module.__esModule ? | |
| 53 | +/******/ () => (module['default']) : | |
| 54 | +/******/ () => (module); | |
| 49 | 55 | /******/ __webpack_require__.d(getter, { a: getter }); |
| 50 | 56 | /******/ return getter; |
| 51 | 57 | /******/ }; |
| 52 | -/******/ }(); | |
| 58 | +/******/ })(); | |
| 53 | 59 | /******/ |
| 54 | 60 | /******/ /* webpack/runtime/define property getters */ |
| 55 | -/******/ !function() { | |
| 56 | -/******/ // define getter functions for harmony exports | |
| 57 | -/******/ __webpack_require__.d = function(exports, definition) { | |
| 58 | -/******/ for(var key in definition) { | |
| 59 | -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { | |
| 60 | -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); | |
| 61 | +/******/ (() => { | |
| 62 | +/******/ // define getter/value functions for harmony exports | |
| 63 | +/******/ __webpack_require__.d = (exports, definition) => { | |
| 64 | +/******/ if(Array.isArray(definition)) { | |
| 65 | +/******/ var i = 0; | |
| 66 | +/******/ while(i < definition.length) { | |
| 67 | +/******/ var key = definition[i++]; | |
| 68 | +/******/ var binding = definition[i++]; | |
| 69 | +/******/ if(!__webpack_require__.o(exports, key)) { | |
| 70 | +/******/ if(binding === 0) { | |
| 71 | +/******/ Object.defineProperty(exports, key, { enumerable: true, value: definition[i++] }); | |
| 72 | +/******/ } else { | |
| 73 | +/******/ Object.defineProperty(exports, key, { enumerable: true, get: binding }); | |
| 74 | +/******/ } | |
| 75 | +/******/ } else if(binding === 0) { i++; } | |
| 61 | 76 | /******/ } |
| 77 | +/******/ } else { | |
| 78 | +/******/ for(var key in definition) { | |
| 79 | +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { | |
| 80 | +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); | |
| 81 | +/******/ } | |
| 82 | +/******/ } | |
| 62 | 83 | /******/ } |
| 63 | 84 | /******/ }; |
| 64 | -/******/ }(); | |
| 85 | +/******/ })(); | |
| 65 | 86 | /******/ |
| 66 | 87 | /******/ /* webpack/runtime/hasOwnProperty shorthand */ |
| 67 | -/******/ !function() { | |
| 68 | -/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } | |
| 69 | -/******/ }(); | |
| 88 | +/******/ (() => { | |
| 89 | +/******/ __webpack_require__.o = (obj, prop) => (Object.hasOwn(obj, prop)) | |
| 90 | +/******/ })(); | |
| 70 | 91 | /******/ |
| 71 | 92 | /******/ /* webpack/runtime/make namespace object */ |
| 72 | -/******/ !function() { | |
| 93 | +/******/ (() => { | |
| 73 | 94 | /******/ // define __esModule on exports |
| 74 | -/******/ __webpack_require__.r = function(exports) { | |
| 75 | -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { | |
| 95 | +/******/ __webpack_require__.r = (exports) => { | |
| 96 | +/******/ if(Symbol.toStringTag) { | |
| 76 | 97 | /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
| 77 | 98 | /******/ } |
| 78 | 99 | /******/ Object.defineProperty(exports, '__esModule', { value: true }); |
| 79 | 100 | /******/ }; |
| 80 | -/******/ }(); | |
| 101 | +/******/ })(); | |
| 81 | 102 | /******/ |
| 82 | 103 | /************************************************************************/ |
| 83 | -var __webpack_exports__ = {}; | |
| 84 | -// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. | |
| 85 | -!function() { | |
| 104 | +let __webpack_exports__ = {}; | |
| 105 | +// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk. | |
| 106 | +(() => { | |
| 86 | 107 | /*!*********************************************!*\ |
| 87 | 108 | !*** ./assets/src/apps/js/data-controls.js ***! |
| 88 | 109 | \*********************************************/ |
| 89 | 110 | __webpack_require__.r(__webpack_exports__); |
| 90 | 111 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 91 | -/* harmony export */ "apiFetch": function() { return /* binding */ apiFetch; }, | |
| 92 | -/* harmony export */ "controls": function() { return /* binding */ controls; }, | |
| 93 | -/* harmony export */ "dispatch": function() { return /* binding */ dispatch; }, | |
| 94 | -/* harmony export */ "select": function() { return /* binding */ select; } | |
| 112 | +/* harmony export */ apiFetch: () => (/* binding */ apiFetch), | |
| 113 | +/* harmony export */ controls: () => (/* binding */ controls), | |
| 114 | +/* harmony export */ dispatch: () => (/* binding */ dispatch), | |
| 115 | +/* harmony export */ select: () => (/* binding */ select) | |
| 95 | 116 | /* harmony export */ }); |
| 96 | 117 | /* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch"); |
| 97 | 118 | /* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0__); |
| 98 | 119 | |
| 99 | - | |
| 100 | 120 | const createRegistryControl = function createRegistryControl(registryControl) { |
| 101 | 121 | registryControl.isRegistryControl = true; |
| 102 | 122 | return registryControl; |
| 103 | 123 | }; |
| 104 | - | |
| 105 | 124 | const apiFetch = request => { |
| 106 | 125 | return { |
| 107 | 126 | type: 'API_FETCH', |
| 108 | 127 | request |
| @@ -107,13 +126,9 @@ | ||
| 107 | 126 | type: 'API_FETCH', |
| 108 | 127 | request |
| 109 | 128 | }; |
| 110 | 129 | }; |
| 111 | -function select(storeKey, selectorName) { | |
| 112 | - for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { | |
| 113 | - args[_key - 2] = arguments[_key]; | |
| 114 | - } | |
| 115 | - | |
| 130 | +function select(storeKey, selectorName, ...args) { | |
| 116 | 131 | return { |
| 117 | 132 | type: 'SELECT', |
| 118 | 133 | storeKey, |
| 119 | 134 | selectorName, |
| @@ -119,13 +134,9 @@ | ||
| 119 | 134 | selectorName, |
| 120 | 135 | args |
| 121 | 136 | }; |
| 122 | 137 | } |
| 123 | -function dispatch(storeKey, actionName) { | |
| 124 | - for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { | |
| 125 | - args[_key2 - 2] = arguments[_key2]; | |
| 126 | - } | |
| 127 | - | |
| 138 | +function dispatch(storeKey, actionName, ...args) { | |
| 128 | 139 | return { |
| 129 | 140 | type: 'DISPATCH', |
| 130 | 141 | storeKey, |
| 131 | 142 | actionName, |
| @@ -131,26 +142,20 @@ | ||
| 131 | 142 | actionName, |
| 132 | 143 | args |
| 133 | 144 | }; |
| 134 | 145 | } |
| 135 | - | |
| 136 | -const resolveSelect = (registry, _ref) => { | |
| 137 | - let { | |
| 138 | - storeKey, | |
| 139 | - selectorName, | |
| 140 | - args | |
| 141 | - } = _ref; | |
| 146 | +const resolveSelect = (registry, { | |
| 147 | + storeKey, | |
| 148 | + selectorName, | |
| 149 | + args | |
| 150 | +}) => { | |
| 142 | 151 | return new Promise(resolve => { |
| 143 | 152 | const hasFinished = () => registry.select('').hasFinishedResolution(storeKey, selectorName, args); |
| 144 | - | |
| 145 | 153 | const getResult = () => registry.select(storeKey)[selectorName].apply(null, args); |
| 146 | - | |
| 147 | 154 | const result = getResult(); |
| 148 | - | |
| 149 | 155 | if (hasFinished()) { |
| 150 | 156 | return resolve(result); |
| 151 | 157 | } |
| 152 | - | |
| 153 | 158 | const unsubscribe = registry.subscribe(() => { |
| 154 | 159 | if (hasFinished()) { |
| 155 | 160 | unsubscribe(); |
| 156 | 161 | resolve(getResult()); |
| @@ -157,23 +162,19 @@ | ||
| 157 | 162 | } |
| 158 | 163 | }); |
| 159 | 164 | }); |
| 160 | 165 | }; |
| 161 | - | |
| 162 | 166 | const controls = { |
| 163 | - API_FETCH(_ref2) { | |
| 164 | - let { | |
| 165 | - request | |
| 166 | - } = _ref2; | |
| 167 | + API_FETCH({ | |
| 168 | + request | |
| 169 | + }) { | |
| 167 | 170 | return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default()(request); |
| 168 | 171 | }, |
| 169 | - | |
| 170 | - SELECT: createRegistryControl(registry => _ref3 => { | |
| 171 | - let { | |
| 172 | - storeKey, | |
| 173 | - selectorName, | |
| 174 | - args | |
| 175 | - } = _ref3; | |
| 172 | + SELECT: createRegistryControl(registry => ({ | |
| 173 | + storeKey, | |
| 174 | + selectorName, | |
| 175 | + args | |
| 176 | + }) => { | |
| 176 | 177 | return registry.select(storeKey)[selectorName].hasResolver ? resolveSelect(registry, { |
| 177 | 178 | storeKey, |
| 178 | 179 | selectorName, |
| 179 | 180 | args |
| @@ -178,18 +179,18 @@ | ||
| 178 | 179 | selectorName, |
| 179 | 180 | args |
| 180 | 181 | }) : registry.select(storeKey)[selectorName](...args); |
| 181 | 182 | }), |
| 182 | - DISPATCH: createRegistryControl(registry => _ref4 => { | |
| 183 | - let { | |
| 184 | - storeKey, | |
| 185 | - actionName, | |
| 186 | - args | |
| 187 | - } = _ref4; | |
| 183 | + DISPATCH: createRegistryControl(registry => ({ | |
| 184 | + storeKey, | |
| 185 | + actionName, | |
| 186 | + args | |
| 187 | + }) => { | |
| 188 | 188 | return registry.dispatch(storeKey)[actionName](...args); |
| 189 | 189 | }) |
| 190 | 190 | }; |
| 191 | -}(); | |
| 191 | +})(); | |
| 192 | + | |
| 192 | 193 | (window.LP = window.LP || {}).dataControls = __webpack_exports__; |
| 193 | 194 | /******/ })() |
| 194 | 195 | ; |
| 195 | 196 | //# sourceMappingURL=data-controls.js.map |