|
1 this["wp"] = this["wp"] || {}; this["wp"]["blockDirectory"] = |
|
2 /******/ (function(modules) { // webpackBootstrap |
|
3 /******/ // The module cache |
|
4 /******/ var installedModules = {}; |
|
5 /******/ |
|
6 /******/ // The require function |
|
7 /******/ function __webpack_require__(moduleId) { |
|
8 /******/ |
|
9 /******/ // Check if module is in cache |
|
10 /******/ if(installedModules[moduleId]) { |
|
11 /******/ return installedModules[moduleId].exports; |
|
12 /******/ } |
|
13 /******/ // Create a new module (and put it into the cache) |
|
14 /******/ var module = installedModules[moduleId] = { |
|
15 /******/ i: moduleId, |
|
16 /******/ l: false, |
|
17 /******/ exports: {} |
|
18 /******/ }; |
|
19 /******/ |
|
20 /******/ // Execute the module function |
|
21 /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); |
|
22 /******/ |
|
23 /******/ // Flag the module as loaded |
|
24 /******/ module.l = true; |
|
25 /******/ |
|
26 /******/ // Return the exports of the module |
|
27 /******/ return module.exports; |
|
28 /******/ } |
|
29 /******/ |
|
30 /******/ |
|
31 /******/ // expose the modules object (__webpack_modules__) |
|
32 /******/ __webpack_require__.m = modules; |
|
33 /******/ |
|
34 /******/ // expose the module cache |
|
35 /******/ __webpack_require__.c = installedModules; |
|
36 /******/ |
|
37 /******/ // define getter function for harmony exports |
|
38 /******/ __webpack_require__.d = function(exports, name, getter) { |
|
39 /******/ if(!__webpack_require__.o(exports, name)) { |
|
40 /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); |
|
41 /******/ } |
|
42 /******/ }; |
|
43 /******/ |
|
44 /******/ // define __esModule on exports |
|
45 /******/ __webpack_require__.r = function(exports) { |
|
46 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
|
47 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
|
48 /******/ } |
|
49 /******/ Object.defineProperty(exports, '__esModule', { value: true }); |
|
50 /******/ }; |
|
51 /******/ |
|
52 /******/ // create a fake namespace object |
|
53 /******/ // mode & 1: value is a module id, require it |
|
54 /******/ // mode & 2: merge all properties of value into the ns |
|
55 /******/ // mode & 4: return value when already ns object |
|
56 /******/ // mode & 8|1: behave like require |
|
57 /******/ __webpack_require__.t = function(value, mode) { |
|
58 /******/ if(mode & 1) value = __webpack_require__(value); |
|
59 /******/ if(mode & 8) return value; |
|
60 /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; |
|
61 /******/ var ns = Object.create(null); |
|
62 /******/ __webpack_require__.r(ns); |
|
63 /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); |
|
64 /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); |
|
65 /******/ return ns; |
|
66 /******/ }; |
|
67 /******/ |
|
68 /******/ // getDefaultExport function for compatibility with non-harmony modules |
|
69 /******/ __webpack_require__.n = function(module) { |
|
70 /******/ var getter = module && module.__esModule ? |
|
71 /******/ function getDefault() { return module['default']; } : |
|
72 /******/ function getModuleExports() { return module; }; |
|
73 /******/ __webpack_require__.d(getter, 'a', getter); |
|
74 /******/ return getter; |
|
75 /******/ }; |
|
76 /******/ |
|
77 /******/ // Object.prototype.hasOwnProperty.call |
|
78 /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; |
|
79 /******/ |
|
80 /******/ // __webpack_public_path__ |
|
81 /******/ __webpack_require__.p = ""; |
|
82 /******/ |
|
83 /******/ |
|
84 /******/ // Load entry module and return exports |
|
85 /******/ return __webpack_require__(__webpack_require__.s = 443); |
|
86 /******/ }) |
|
87 /************************************************************************/ |
|
88 /******/ ({ |
|
89 |
|
90 /***/ 0: |
|
91 /***/ (function(module, exports) { |
|
92 |
|
93 (function() { module.exports = this["wp"]["element"]; }()); |
|
94 |
|
95 /***/ }), |
|
96 |
|
97 /***/ 1: |
|
98 /***/ (function(module, exports) { |
|
99 |
|
100 (function() { module.exports = this["wp"]["i18n"]; }()); |
|
101 |
|
102 /***/ }), |
|
103 |
|
104 /***/ 10: |
|
105 /***/ (function(module, exports) { |
|
106 |
|
107 (function() { module.exports = this["wp"]["blocks"]; }()); |
|
108 |
|
109 /***/ }), |
|
110 |
|
111 /***/ 100: |
|
112 /***/ (function(module, exports) { |
|
113 |
|
114 (function() { module.exports = this["wp"]["notices"]; }()); |
|
115 |
|
116 /***/ }), |
|
117 |
|
118 /***/ 137: |
|
119 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
120 |
|
121 "use strict"; |
|
122 /* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5); |
|
123 /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15); |
|
124 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0); |
|
125 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); |
|
126 |
|
127 |
|
128 |
|
129 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; } |
|
130 |
|
131 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; } |
|
132 |
|
133 /** |
|
134 * WordPress dependencies |
|
135 */ |
|
136 // Disable reason: JSDoc linter doesn't seem to parse the union (`&`) correctly. |
|
137 |
|
138 /* eslint-disable jsdoc/valid-types */ |
|
139 |
|
140 /** @typedef {{icon: JSX.Element, size?: number} & import('react').ComponentPropsWithoutRef<'SVG'>} IconProps */ |
|
141 |
|
142 /* eslint-enable jsdoc/valid-types */ |
|
143 |
|
144 /** |
|
145 * Return an SVG icon. |
|
146 * |
|
147 * @param {IconProps} props icon is the SVG component to render |
|
148 * size is a number specifiying the icon size in pixels |
|
149 * Other props will be passed to wrapped SVG component |
|
150 * |
|
151 * @return {JSX.Element} Icon component |
|
152 */ |
|
153 |
|
154 function Icon(_ref) { |
|
155 var icon = _ref.icon, |
|
156 _ref$size = _ref.size, |
|
157 size = _ref$size === void 0 ? 24 : _ref$size, |
|
158 props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(_ref, ["icon", "size"]); |
|
159 |
|
160 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["cloneElement"])(icon, _objectSpread({ |
|
161 width: size, |
|
162 height: size |
|
163 }, props)); |
|
164 } |
|
165 |
|
166 /* harmony default export */ __webpack_exports__["a"] = (Icon); |
|
167 |
|
168 |
|
169 /***/ }), |
|
170 |
|
171 /***/ 14: |
|
172 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
173 |
|
174 "use strict"; |
|
175 |
|
176 // EXPORTS |
|
177 __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _slicedToArray; }); |
|
178 |
|
179 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js |
|
180 var arrayWithHoles = __webpack_require__(38); |
|
181 |
|
182 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js |
|
183 function _iterableToArrayLimit(arr, i) { |
|
184 if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; |
|
185 var _arr = []; |
|
186 var _n = true; |
|
187 var _d = false; |
|
188 var _e = undefined; |
|
189 |
|
190 try { |
|
191 for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { |
|
192 _arr.push(_s.value); |
|
193 |
|
194 if (i && _arr.length === i) break; |
|
195 } |
|
196 } catch (err) { |
|
197 _d = true; |
|
198 _e = err; |
|
199 } finally { |
|
200 try { |
|
201 if (!_n && _i["return"] != null) _i["return"](); |
|
202 } finally { |
|
203 if (_d) throw _e; |
|
204 } |
|
205 } |
|
206 |
|
207 return _arr; |
|
208 } |
|
209 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js |
|
210 var unsupportedIterableToArray = __webpack_require__(29); |
|
211 |
|
212 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js |
|
213 var nonIterableRest = __webpack_require__(39); |
|
214 |
|
215 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js |
|
216 |
|
217 |
|
218 |
|
219 |
|
220 function _slicedToArray(arr, i) { |
|
221 return Object(arrayWithHoles["a" /* default */])(arr) || _iterableToArrayLimit(arr, i) || Object(unsupportedIterableToArray["a" /* default */])(arr, i) || Object(nonIterableRest["a" /* default */])(); |
|
222 } |
|
223 |
|
224 /***/ }), |
|
225 |
|
226 /***/ 15: |
|
227 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
228 |
|
229 "use strict"; |
|
230 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutProperties; }); |
|
231 /* harmony import */ var _objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(41); |
|
232 |
|
233 function _objectWithoutProperties(source, excluded) { |
|
234 if (source == null) return {}; |
|
235 var target = Object(_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(source, excluded); |
|
236 var key, i; |
|
237 |
|
238 if (Object.getOwnPropertySymbols) { |
|
239 var sourceSymbolKeys = Object.getOwnPropertySymbols(source); |
|
240 |
|
241 for (i = 0; i < sourceSymbolKeys.length; i++) { |
|
242 key = sourceSymbolKeys[i]; |
|
243 if (excluded.indexOf(key) >= 0) continue; |
|
244 if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; |
|
245 target[key] = source[key]; |
|
246 } |
|
247 } |
|
248 |
|
249 return target; |
|
250 } |
|
251 |
|
252 /***/ }), |
|
253 |
|
254 /***/ 18: |
|
255 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
256 |
|
257 "use strict"; |
|
258 |
|
259 // EXPORTS |
|
260 __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _toConsumableArray; }); |
|
261 |
|
262 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js |
|
263 var arrayLikeToArray = __webpack_require__(26); |
|
264 |
|
265 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js |
|
266 |
|
267 function _arrayWithoutHoles(arr) { |
|
268 if (Array.isArray(arr)) return Object(arrayLikeToArray["a" /* default */])(arr); |
|
269 } |
|
270 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js |
|
271 var iterableToArray = __webpack_require__(35); |
|
272 |
|
273 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js |
|
274 var unsupportedIterableToArray = __webpack_require__(29); |
|
275 |
|
276 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js |
|
277 function _nonIterableSpread() { |
|
278 throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); |
|
279 } |
|
280 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js |
|
281 |
|
282 |
|
283 |
|
284 |
|
285 function _toConsumableArray(arr) { |
|
286 return _arrayWithoutHoles(arr) || Object(iterableToArray["a" /* default */])(arr) || Object(unsupportedIterableToArray["a" /* default */])(arr) || _nonIterableSpread(); |
|
287 } |
|
288 |
|
289 /***/ }), |
|
290 |
|
291 /***/ 2: |
|
292 /***/ (function(module, exports) { |
|
293 |
|
294 (function() { module.exports = this["lodash"]; }()); |
|
295 |
|
296 /***/ }), |
|
297 |
|
298 /***/ 24: |
|
299 /***/ (function(module, exports) { |
|
300 |
|
301 (function() { module.exports = this["regeneratorRuntime"]; }()); |
|
302 |
|
303 /***/ }), |
|
304 |
|
305 /***/ 26: |
|
306 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
307 |
|
308 "use strict"; |
|
309 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayLikeToArray; }); |
|
310 function _arrayLikeToArray(arr, len) { |
|
311 if (len == null || len > arr.length) len = arr.length; |
|
312 |
|
313 for (var i = 0, arr2 = new Array(len); i < len; i++) { |
|
314 arr2[i] = arr[i]; |
|
315 } |
|
316 |
|
317 return arr2; |
|
318 } |
|
319 |
|
320 /***/ }), |
|
321 |
|
322 /***/ 262: |
|
323 /***/ (function(module, exports) { |
|
324 |
|
325 (function() { module.exports = this["wp"]["editPost"]; }()); |
|
326 |
|
327 /***/ }), |
|
328 |
|
329 /***/ 285: |
|
330 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
331 |
|
332 "use strict"; |
|
333 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); |
|
334 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); |
|
335 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6); |
|
336 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); |
|
337 |
|
338 |
|
339 /** |
|
340 * WordPress dependencies |
|
341 */ |
|
342 |
|
343 var starFilled = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { |
|
344 xmlns: "http://www.w3.org/2000/svg", |
|
345 viewBox: "0 0 24 24" |
|
346 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { |
|
347 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" |
|
348 })); |
|
349 /* harmony default export */ __webpack_exports__["a"] = (starFilled); |
|
350 |
|
351 |
|
352 /***/ }), |
|
353 |
|
354 /***/ 286: |
|
355 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
356 |
|
357 "use strict"; |
|
358 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); |
|
359 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); |
|
360 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6); |
|
361 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); |
|
362 |
|
363 |
|
364 /** |
|
365 * WordPress dependencies |
|
366 */ |
|
367 |
|
368 var starEmpty = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { |
|
369 xmlns: "http://www.w3.org/2000/svg", |
|
370 viewBox: "0 0 24 24" |
|
371 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { |
|
372 fillRule: "evenodd", |
|
373 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", |
|
374 clipRule: "evenodd" |
|
375 })); |
|
376 /* harmony default export */ __webpack_exports__["a"] = (starEmpty); |
|
377 |
|
378 |
|
379 /***/ }), |
|
380 |
|
381 /***/ 29: |
|
382 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
383 |
|
384 "use strict"; |
|
385 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _unsupportedIterableToArray; }); |
|
386 /* harmony import */ var _arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26); |
|
387 |
|
388 function _unsupportedIterableToArray(o, minLen) { |
|
389 if (!o) return; |
|
390 if (typeof o === "string") return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen); |
|
391 var n = Object.prototype.toString.call(o).slice(8, -1); |
|
392 if (n === "Object" && o.constructor) n = o.constructor.name; |
|
393 if (n === "Map" || n === "Set") return Array.from(o); |
|
394 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen); |
|
395 } |
|
396 |
|
397 /***/ }), |
|
398 |
|
399 /***/ 3: |
|
400 /***/ (function(module, exports) { |
|
401 |
|
402 (function() { module.exports = this["wp"]["components"]; }()); |
|
403 |
|
404 /***/ }), |
|
405 |
|
406 /***/ 35: |
|
407 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
408 |
|
409 "use strict"; |
|
410 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _iterableToArray; }); |
|
411 function _iterableToArray(iter) { |
|
412 if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); |
|
413 } |
|
414 |
|
415 /***/ }), |
|
416 |
|
417 /***/ 36: |
|
418 /***/ (function(module, exports) { |
|
419 |
|
420 (function() { module.exports = this["wp"]["dataControls"]; }()); |
|
421 |
|
422 /***/ }), |
|
423 |
|
424 /***/ 38: |
|
425 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
426 |
|
427 "use strict"; |
|
428 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayWithHoles; }); |
|
429 function _arrayWithHoles(arr) { |
|
430 if (Array.isArray(arr)) return arr; |
|
431 } |
|
432 |
|
433 /***/ }), |
|
434 |
|
435 /***/ 39: |
|
436 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
437 |
|
438 "use strict"; |
|
439 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _nonIterableRest; }); |
|
440 function _nonIterableRest() { |
|
441 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); |
|
442 } |
|
443 |
|
444 /***/ }), |
|
445 |
|
446 /***/ 4: |
|
447 /***/ (function(module, exports) { |
|
448 |
|
449 (function() { module.exports = this["wp"]["data"]; }()); |
|
450 |
|
451 /***/ }), |
|
452 |
|
453 /***/ 41: |
|
454 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
455 |
|
456 "use strict"; |
|
457 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutPropertiesLoose; }); |
|
458 function _objectWithoutPropertiesLoose(source, excluded) { |
|
459 if (source == null) return {}; |
|
460 var target = {}; |
|
461 var sourceKeys = Object.keys(source); |
|
462 var key, i; |
|
463 |
|
464 for (i = 0; i < sourceKeys.length; i++) { |
|
465 key = sourceKeys[i]; |
|
466 if (excluded.indexOf(key) >= 0) continue; |
|
467 target[key] = source[key]; |
|
468 } |
|
469 |
|
470 return target; |
|
471 } |
|
472 |
|
473 /***/ }), |
|
474 |
|
475 /***/ 443: |
|
476 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
477 |
|
478 "use strict"; |
|
479 // ESM COMPAT FLAG |
|
480 __webpack_require__.r(__webpack_exports__); |
|
481 |
|
482 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-directory/build-module/store/selectors.js |
|
483 var selectors_namespaceObject = {}; |
|
484 __webpack_require__.r(selectors_namespaceObject); |
|
485 __webpack_require__.d(selectors_namespaceObject, "isRequestingDownloadableBlocks", function() { return isRequestingDownloadableBlocks; }); |
|
486 __webpack_require__.d(selectors_namespaceObject, "getDownloadableBlocks", function() { return selectors_getDownloadableBlocks; }); |
|
487 __webpack_require__.d(selectors_namespaceObject, "getInstalledBlockTypes", function() { return getInstalledBlockTypes; }); |
|
488 __webpack_require__.d(selectors_namespaceObject, "getNewBlockTypes", function() { return getNewBlockTypes; }); |
|
489 __webpack_require__.d(selectors_namespaceObject, "getUnusedBlockTypes", function() { return getUnusedBlockTypes; }); |
|
490 __webpack_require__.d(selectors_namespaceObject, "isInstalling", function() { return isInstalling; }); |
|
491 __webpack_require__.d(selectors_namespaceObject, "getErrorNotices", function() { return getErrorNotices; }); |
|
492 __webpack_require__.d(selectors_namespaceObject, "getErrorNoticeForBlock", function() { return getErrorNoticeForBlock; }); |
|
493 |
|
494 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-directory/build-module/store/actions.js |
|
495 var actions_namespaceObject = {}; |
|
496 __webpack_require__.r(actions_namespaceObject); |
|
497 __webpack_require__.d(actions_namespaceObject, "fetchDownloadableBlocks", function() { return fetchDownloadableBlocks; }); |
|
498 __webpack_require__.d(actions_namespaceObject, "receiveDownloadableBlocks", function() { return receiveDownloadableBlocks; }); |
|
499 __webpack_require__.d(actions_namespaceObject, "installBlockType", function() { return actions_installBlockType; }); |
|
500 __webpack_require__.d(actions_namespaceObject, "uninstallBlockType", function() { return actions_uninstallBlockType; }); |
|
501 __webpack_require__.d(actions_namespaceObject, "addInstalledBlockType", function() { return addInstalledBlockType; }); |
|
502 __webpack_require__.d(actions_namespaceObject, "removeInstalledBlockType", function() { return removeInstalledBlockType; }); |
|
503 __webpack_require__.d(actions_namespaceObject, "setIsInstalling", function() { return setIsInstalling; }); |
|
504 __webpack_require__.d(actions_namespaceObject, "setErrorNotice", function() { return setErrorNotice; }); |
|
505 __webpack_require__.d(actions_namespaceObject, "clearErrorNotice", function() { return clearErrorNotice; }); |
|
506 |
|
507 // EXTERNAL MODULE: external {"this":["wp","notices"]} |
|
508 var external_this_wp_notices_ = __webpack_require__(100); |
|
509 |
|
510 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js |
|
511 var defineProperty = __webpack_require__(5); |
|
512 |
|
513 // EXTERNAL MODULE: external {"this":["wp","data"]} |
|
514 var external_this_wp_data_ = __webpack_require__(4); |
|
515 |
|
516 // EXTERNAL MODULE: external {"this":["wp","dataControls"]} |
|
517 var external_this_wp_dataControls_ = __webpack_require__(36); |
|
518 |
|
519 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules |
|
520 var toConsumableArray = __webpack_require__(18); |
|
521 |
|
522 // EXTERNAL MODULE: external {"this":"lodash"} |
|
523 var external_this_lodash_ = __webpack_require__(2); |
|
524 |
|
525 // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/reducer.js |
|
526 |
|
527 |
|
528 |
|
529 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; } |
|
530 |
|
531 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; } |
|
532 |
|
533 /** |
|
534 * External dependencies |
|
535 */ |
|
536 |
|
537 /** |
|
538 * WordPress dependencies |
|
539 */ |
|
540 |
|
541 |
|
542 /** |
|
543 * Reducer returning an array of downloadable blocks. |
|
544 * |
|
545 * @param {Object} state Current state. |
|
546 * @param {Object} action Dispatched action. |
|
547 * |
|
548 * @return {Object} Updated state. |
|
549 */ |
|
550 |
|
551 var reducer_downloadableBlocks = function downloadableBlocks() { |
|
552 var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
|
553 var action = arguments.length > 1 ? arguments[1] : undefined; |
|
554 |
|
555 switch (action.type) { |
|
556 case 'FETCH_DOWNLOADABLE_BLOCKS': |
|
557 return _objectSpread({}, state, Object(defineProperty["a" /* default */])({}, action.filterValue, { |
|
558 isRequesting: true |
|
559 })); |
|
560 |
|
561 case 'RECEIVE_DOWNLOADABLE_BLOCKS': |
|
562 return _objectSpread({}, state, Object(defineProperty["a" /* default */])({}, action.filterValue, { |
|
563 results: action.downloadableBlocks, |
|
564 isRequesting: false |
|
565 })); |
|
566 } |
|
567 |
|
568 return state; |
|
569 }; |
|
570 /** |
|
571 * Reducer managing the installation and deletion of blocks. |
|
572 * |
|
573 * @param {Object} state Current state. |
|
574 * @param {Object} action Dispatched action. |
|
575 * |
|
576 * @return {Object} Updated state. |
|
577 */ |
|
578 |
|
579 var reducer_blockManagement = function blockManagement() { |
|
580 var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { |
|
581 installedBlockTypes: [], |
|
582 isInstalling: {} |
|
583 }; |
|
584 var action = arguments.length > 1 ? arguments[1] : undefined; |
|
585 |
|
586 switch (action.type) { |
|
587 case 'ADD_INSTALLED_BLOCK_TYPE': |
|
588 return _objectSpread({}, state, { |
|
589 installedBlockTypes: [].concat(Object(toConsumableArray["a" /* default */])(state.installedBlockTypes), [action.item]) |
|
590 }); |
|
591 |
|
592 case 'REMOVE_INSTALLED_BLOCK_TYPE': |
|
593 return _objectSpread({}, state, { |
|
594 installedBlockTypes: state.installedBlockTypes.filter(function (blockType) { |
|
595 return blockType.name !== action.item.name; |
|
596 }) |
|
597 }); |
|
598 |
|
599 case 'SET_INSTALLING_BLOCK': |
|
600 return _objectSpread({}, state, { |
|
601 isInstalling: _objectSpread({}, state.isInstalling, Object(defineProperty["a" /* default */])({}, action.blockId, action.isInstalling)) |
|
602 }); |
|
603 } |
|
604 |
|
605 return state; |
|
606 }; |
|
607 /** |
|
608 * Reducer returning an object of error notices. |
|
609 * |
|
610 * @param {Object} state Current state. |
|
611 * @param {Object} action Dispatched action. |
|
612 * |
|
613 * @return {Object} Updated state. |
|
614 */ |
|
615 |
|
616 var reducer_errorNotices = function errorNotices() { |
|
617 var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
|
618 var action = arguments.length > 1 ? arguments[1] : undefined; |
|
619 |
|
620 switch (action.type) { |
|
621 case 'SET_ERROR_NOTICE': |
|
622 return _objectSpread({}, state, Object(defineProperty["a" /* default */])({}, action.blockId, { |
|
623 message: action.message, |
|
624 isFatal: action.isFatal |
|
625 })); |
|
626 |
|
627 case 'CLEAR_ERROR_NOTICE': |
|
628 return Object(external_this_lodash_["omit"])(state, action.blockId); |
|
629 } |
|
630 |
|
631 return state; |
|
632 }; |
|
633 /* harmony default export */ var reducer = (Object(external_this_wp_data_["combineReducers"])({ |
|
634 downloadableBlocks: reducer_downloadableBlocks, |
|
635 blockManagement: reducer_blockManagement, |
|
636 errorNotices: reducer_errorNotices |
|
637 })); |
|
638 |
|
639 // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/utils/has-block-type.js |
|
640 /** |
|
641 * Check if a block list contains a specific block type. Recursively searches |
|
642 * through `innerBlocks` if they exist. |
|
643 * |
|
644 * @param {Object} blockType A block object to search for. |
|
645 * @param {Object[]} blocks The list of blocks to look through. |
|
646 * |
|
647 * @return {boolean} Whether the blockType is found. |
|
648 */ |
|
649 function hasBlockType(blockType) { |
|
650 var blocks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; |
|
651 |
|
652 if (!blocks.length) { |
|
653 return false; |
|
654 } |
|
655 |
|
656 if (blocks.some(function (_ref) { |
|
657 var name = _ref.name; |
|
658 return name === blockType.name; |
|
659 })) { |
|
660 return true; |
|
661 } |
|
662 |
|
663 for (var i = 0; i < blocks.length; i++) { |
|
664 if (hasBlockType(blockType, blocks[i].innerBlocks)) { |
|
665 return true; |
|
666 } |
|
667 } |
|
668 |
|
669 return false; |
|
670 } |
|
671 |
|
672 // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/selectors.js |
|
673 /** |
|
674 * WordPress dependencies |
|
675 */ |
|
676 |
|
677 /** |
|
678 * Internal dependencies |
|
679 */ |
|
680 |
|
681 |
|
682 /** |
|
683 * Returns true if application is requesting for downloadable blocks. |
|
684 * |
|
685 * @param {Object} state Global application state. |
|
686 * @param {string} filterValue Search string. |
|
687 * |
|
688 * |
|
689 * @return {Array} Downloadable blocks |
|
690 */ |
|
691 |
|
692 function isRequestingDownloadableBlocks(state, filterValue) { |
|
693 if (!state.downloadableBlocks[filterValue] || !state.downloadableBlocks[filterValue].isRequesting) { |
|
694 return false; |
|
695 } |
|
696 |
|
697 return state.downloadableBlocks[filterValue].isRequesting; |
|
698 } |
|
699 /** |
|
700 * Returns the available uninstalled blocks |
|
701 * |
|
702 * @param {Object} state Global application state. |
|
703 * @param {string} filterValue Search string. |
|
704 * |
|
705 * @return {Array} Downloadable blocks |
|
706 */ |
|
707 |
|
708 function selectors_getDownloadableBlocks(state, filterValue) { |
|
709 if (!state.downloadableBlocks[filterValue] || !state.downloadableBlocks[filterValue].results) { |
|
710 return []; |
|
711 } |
|
712 |
|
713 return state.downloadableBlocks[filterValue].results; |
|
714 } |
|
715 /** |
|
716 * Returns the block types that have been installed on the server. |
|
717 * |
|
718 * @param {Object} state Global application state. |
|
719 * |
|
720 * @return {Array} Block type items. |
|
721 */ |
|
722 |
|
723 function getInstalledBlockTypes(state) { |
|
724 return state.blockManagement.installedBlockTypes; |
|
725 } |
|
726 /** |
|
727 * Returns block types that have been installed on the server and used in the |
|
728 * current post. |
|
729 * |
|
730 * @param {Object} state Global application state. |
|
731 * |
|
732 * @return {Array} Block type items. |
|
733 */ |
|
734 |
|
735 var getNewBlockTypes = Object(external_this_wp_data_["createRegistrySelector"])(function (select) { |
|
736 return function (state) { |
|
737 var usedBlockTree = select('core/block-editor').getBlocks(); |
|
738 var installedBlockTypes = getInstalledBlockTypes(state); |
|
739 var newBlockTypes = []; |
|
740 installedBlockTypes.forEach(function (blockType) { |
|
741 if (hasBlockType(blockType, usedBlockTree)) { |
|
742 newBlockTypes.push(blockType); |
|
743 } |
|
744 }); |
|
745 return newBlockTypes; |
|
746 }; |
|
747 }); |
|
748 /** |
|
749 * Returns the block types that have been installed on the server but are not |
|
750 * used in the current post. |
|
751 * |
|
752 * @param {Object} state Global application state. |
|
753 * |
|
754 * @return {Array} Block type items. |
|
755 */ |
|
756 |
|
757 var getUnusedBlockTypes = Object(external_this_wp_data_["createRegistrySelector"])(function (select) { |
|
758 return function (state) { |
|
759 var usedBlockTree = select('core/block-editor').getBlocks(); |
|
760 var installedBlockTypes = getInstalledBlockTypes(state); |
|
761 var newBlockTypes = []; |
|
762 installedBlockTypes.forEach(function (blockType) { |
|
763 if (!hasBlockType(blockType, usedBlockTree)) { |
|
764 newBlockTypes.push(blockType); |
|
765 } |
|
766 }); |
|
767 return newBlockTypes; |
|
768 }; |
|
769 }); |
|
770 /** |
|
771 * Returns true if application is calling install endpoint. |
|
772 * |
|
773 * @param {Object} state Global application state. |
|
774 * @param {string} blockId Id of the block. |
|
775 * |
|
776 * @return {boolean} Whether its currently installing |
|
777 */ |
|
778 |
|
779 function isInstalling(state, blockId) { |
|
780 return state.blockManagement.isInstalling[blockId] || false; |
|
781 } |
|
782 /** |
|
783 * Returns the error notices |
|
784 * |
|
785 * @param {Object} state Global application state. |
|
786 * |
|
787 * @return {Object} Object with error notices. |
|
788 */ |
|
789 |
|
790 function getErrorNotices(state) { |
|
791 return state.errorNotices; |
|
792 } |
|
793 /** |
|
794 * Returns the error notice for a given block. |
|
795 * |
|
796 * @param {Object} state Global application state. |
|
797 * @param {string} blockId The ID of the block plugin. eg: my-block |
|
798 * |
|
799 * @return {string|boolean} The error text, or false if no error. |
|
800 */ |
|
801 |
|
802 function getErrorNoticeForBlock(state, blockId) { |
|
803 return state.errorNotices[blockId]; |
|
804 } |
|
805 |
|
806 // EXTERNAL MODULE: external {"this":"regeneratorRuntime"} |
|
807 var external_this_regeneratorRuntime_ = __webpack_require__(24); |
|
808 var external_this_regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(external_this_regeneratorRuntime_); |
|
809 |
|
810 // EXTERNAL MODULE: external {"this":["wp","i18n"]} |
|
811 var external_this_wp_i18n_ = __webpack_require__(1); |
|
812 |
|
813 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js |
|
814 var asyncToGenerator = __webpack_require__(50); |
|
815 |
|
816 // EXTERNAL MODULE: external {"this":["wp","apiFetch"]} |
|
817 var external_this_wp_apiFetch_ = __webpack_require__(45); |
|
818 var external_this_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_this_wp_apiFetch_); |
|
819 |
|
820 // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/controls.js |
|
821 |
|
822 |
|
823 |
|
824 /** |
|
825 * WordPress dependencies |
|
826 */ |
|
827 |
|
828 /** |
|
829 * Load an asset for a block. |
|
830 * |
|
831 * This function returns a Promise that will resolve once the asset is loaded, |
|
832 * or in the case of Stylesheets and Inline Javascript, will resolve immediately. |
|
833 * |
|
834 * @param {HTMLElement} el A HTML Element asset to inject. |
|
835 * |
|
836 * @return {Promise} Promise which will resolve when the asset is loaded. |
|
837 */ |
|
838 |
|
839 var loadAsset = function loadAsset(el) { |
|
840 return new Promise(function (resolve, reject) { |
|
841 /* |
|
842 * Reconstruct the passed element, this is required as inserting the Node directly |
|
843 * won't always fire the required onload events, even if the asset wasn't already loaded. |
|
844 */ |
|
845 var newNode = document.createElement(el.nodeName); |
|
846 ['id', 'rel', 'src', 'href', 'type'].forEach(function (attr) { |
|
847 if (el[attr]) { |
|
848 newNode[attr] = el[attr]; |
|
849 } |
|
850 }); // Append inline <script> contents. |
|
851 |
|
852 if (el.innerHTML) { |
|
853 newNode.appendChild(document.createTextNode(el.innerHTML)); |
|
854 } |
|
855 |
|
856 newNode.onload = function () { |
|
857 return resolve(true); |
|
858 }; |
|
859 |
|
860 newNode.onerror = function () { |
|
861 return reject(new Error('Error loading asset.')); |
|
862 }; |
|
863 |
|
864 document.body.appendChild(newNode); // Resolve Stylesheets and Inline JavaScript immediately. |
|
865 |
|
866 if ('link' === newNode.nodeName.toLowerCase() || 'script' === newNode.nodeName.toLowerCase() && !newNode.src) { |
|
867 resolve(); |
|
868 } |
|
869 }); |
|
870 }; |
|
871 /** |
|
872 * Load the asset files for a block |
|
873 * |
|
874 * @param {Array} assets A collection of URLs for the assets. |
|
875 * |
|
876 * @return {Object} Control descriptor. |
|
877 */ |
|
878 |
|
879 function loadAssets(assets) { |
|
880 return { |
|
881 type: 'LOAD_ASSETS', |
|
882 assets: assets |
|
883 }; |
|
884 } |
|
885 var controls = { |
|
886 LOAD_ASSETS: function LOAD_ASSETS() { |
|
887 /* |
|
888 * Fetch the current URL (post-new.php, or post.php?post=1&action=edit) and compare the |
|
889 * Javascript and CSS assets loaded between the pages. This imports the required assets |
|
890 * for the block into the current page while not requiring that we know them up-front. |
|
891 * In the future this can be improved by reliance upon block.json and/or a script-loader |
|
892 * dependancy API. |
|
893 */ |
|
894 return external_this_wp_apiFetch_default()({ |
|
895 url: document.location.href, |
|
896 parse: false |
|
897 }).then(function (response) { |
|
898 return response.text(); |
|
899 }).then(function (data) { |
|
900 var doc = new window.DOMParser().parseFromString(data, 'text/html'); |
|
901 var newAssets = Array.from(doc.querySelectorAll('link[rel="stylesheet"],script')).filter(function (asset) { |
|
902 return asset.id && !document.getElementById(asset.id); |
|
903 }); |
|
904 return new Promise( /*#__PURE__*/function () { |
|
905 var _ref = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/external_this_regeneratorRuntime_default.a.mark(function _callee(resolve, reject) { |
|
906 var i; |
|
907 return external_this_regeneratorRuntime_default.a.wrap(function _callee$(_context) { |
|
908 while (1) { |
|
909 switch (_context.prev = _context.next) { |
|
910 case 0: |
|
911 _context.t0 = external_this_regeneratorRuntime_default.a.keys(newAssets); |
|
912 |
|
913 case 1: |
|
914 if ((_context.t1 = _context.t0()).done) { |
|
915 _context.next = 13; |
|
916 break; |
|
917 } |
|
918 |
|
919 i = _context.t1.value; |
|
920 _context.prev = 3; |
|
921 _context.next = 6; |
|
922 return loadAsset(newAssets[i]); |
|
923 |
|
924 case 6: |
|
925 _context.next = 11; |
|
926 break; |
|
927 |
|
928 case 8: |
|
929 _context.prev = 8; |
|
930 _context.t2 = _context["catch"](3); |
|
931 reject(_context.t2); |
|
932 |
|
933 case 11: |
|
934 _context.next = 1; |
|
935 break; |
|
936 |
|
937 case 13: |
|
938 resolve(); |
|
939 |
|
940 case 14: |
|
941 case "end": |
|
942 return _context.stop(); |
|
943 } |
|
944 } |
|
945 }, _callee, null, [[3, 8]]); |
|
946 })); |
|
947 |
|
948 return function (_x, _x2) { |
|
949 return _ref.apply(this, arguments); |
|
950 }; |
|
951 }()); |
|
952 }); |
|
953 } |
|
954 }; |
|
955 /* harmony default export */ var store_controls = (controls); |
|
956 |
|
957 // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/utils/get-plugin-url.js |
|
958 /** |
|
959 * Get the plugin's direct API link out of a block-directory response. |
|
960 * |
|
961 * @param {Object} block The block object |
|
962 * |
|
963 * @return {string} The plugin URL, if exists. |
|
964 */ |
|
965 function getPluginUrl(block) { |
|
966 if (!block) { |
|
967 return false; |
|
968 } |
|
969 |
|
970 var link = block.links['wp:plugin'] || block.links.self; |
|
971 |
|
972 if (link && link.length) { |
|
973 return link[0].href; |
|
974 } |
|
975 |
|
976 return false; |
|
977 } |
|
978 |
|
979 // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/actions.js |
|
980 |
|
981 |
|
982 |
|
983 var _marked = /*#__PURE__*/external_this_regeneratorRuntime_default.a.mark(actions_installBlockType), |
|
984 _marked2 = /*#__PURE__*/external_this_regeneratorRuntime_default.a.mark(actions_uninstallBlockType); |
|
985 |
|
986 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; } |
|
987 |
|
988 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; } |
|
989 |
|
990 /** |
|
991 * WordPress dependencies |
|
992 */ |
|
993 |
|
994 |
|
995 /** |
|
996 * Internal dependencies |
|
997 */ |
|
998 |
|
999 |
|
1000 |
|
1001 /** |
|
1002 * Returns an action object used in signalling that the downloadable blocks |
|
1003 * have been requested and is loading. |
|
1004 * |
|
1005 * @param {string} filterValue Search string. |
|
1006 * |
|
1007 * @return {Object} Action object. |
|
1008 */ |
|
1009 |
|
1010 function fetchDownloadableBlocks(filterValue) { |
|
1011 return { |
|
1012 type: 'FETCH_DOWNLOADABLE_BLOCKS', |
|
1013 filterValue: filterValue |
|
1014 }; |
|
1015 } |
|
1016 /** |
|
1017 * Returns an action object used in signalling that the downloadable blocks |
|
1018 * have been updated. |
|
1019 * |
|
1020 * @param {Array} downloadableBlocks Downloadable blocks. |
|
1021 * @param {string} filterValue Search string. |
|
1022 * |
|
1023 * @return {Object} Action object. |
|
1024 */ |
|
1025 |
|
1026 function receiveDownloadableBlocks(downloadableBlocks, filterValue) { |
|
1027 return { |
|
1028 type: 'RECEIVE_DOWNLOADABLE_BLOCKS', |
|
1029 downloadableBlocks: downloadableBlocks, |
|
1030 filterValue: filterValue |
|
1031 }; |
|
1032 } |
|
1033 /** |
|
1034 * Action triggered to install a block plugin. |
|
1035 * |
|
1036 * @param {Object} block The block item returned by search. |
|
1037 * |
|
1038 * @return {boolean} Whether the block was successfully installed & loaded. |
|
1039 */ |
|
1040 |
|
1041 function actions_installBlockType(block) { |
|
1042 var id, assets, success, url, links, response, registeredBlocks, message, isFatal, fatalAPIErrors; |
|
1043 return external_this_regeneratorRuntime_default.a.wrap(function installBlockType$(_context) { |
|
1044 while (1) { |
|
1045 switch (_context.prev = _context.next) { |
|
1046 case 0: |
|
1047 id = block.id, assets = block.assets; |
|
1048 success = false; |
|
1049 _context.next = 4; |
|
1050 return clearErrorNotice(id); |
|
1051 |
|
1052 case 4: |
|
1053 _context.prev = 4; |
|
1054 _context.next = 7; |
|
1055 return setIsInstalling(block.id, true); |
|
1056 |
|
1057 case 7: |
|
1058 // If we have a wp:plugin link, the plugin is installed but inactive. |
|
1059 url = getPluginUrl(block); |
|
1060 links = {}; |
|
1061 |
|
1062 if (!url) { |
|
1063 _context.next = 14; |
|
1064 break; |
|
1065 } |
|
1066 |
|
1067 _context.next = 12; |
|
1068 return Object(external_this_wp_dataControls_["apiFetch"])({ |
|
1069 url: url, |
|
1070 data: { |
|
1071 status: 'active' |
|
1072 }, |
|
1073 method: 'PUT' |
|
1074 }); |
|
1075 |
|
1076 case 12: |
|
1077 _context.next = 18; |
|
1078 break; |
|
1079 |
|
1080 case 14: |
|
1081 _context.next = 16; |
|
1082 return Object(external_this_wp_dataControls_["apiFetch"])({ |
|
1083 path: 'wp/v2/plugins', |
|
1084 data: { |
|
1085 slug: block.id, |
|
1086 status: 'active' |
|
1087 }, |
|
1088 method: 'POST' |
|
1089 }); |
|
1090 |
|
1091 case 16: |
|
1092 response = _context.sent; |
|
1093 // Add the `self` link for newly-installed blocks. |
|
1094 links = response._links; |
|
1095 |
|
1096 case 18: |
|
1097 _context.next = 20; |
|
1098 return addInstalledBlockType(actions_objectSpread({}, block, { |
|
1099 links: actions_objectSpread({}, block.links, {}, links) |
|
1100 })); |
|
1101 |
|
1102 case 20: |
|
1103 _context.next = 22; |
|
1104 return loadAssets(assets); |
|
1105 |
|
1106 case 22: |
|
1107 _context.next = 24; |
|
1108 return Object(external_this_wp_dataControls_["select"])('core/blocks', 'getBlockTypes'); |
|
1109 |
|
1110 case 24: |
|
1111 registeredBlocks = _context.sent; |
|
1112 |
|
1113 if (!(!registeredBlocks.length || !registeredBlocks.filter(function (i) { |
|
1114 return i.name === block.name; |
|
1115 }).length)) { |
|
1116 _context.next = 27; |
|
1117 break; |
|
1118 } |
|
1119 |
|
1120 throw new Error(Object(external_this_wp_i18n_["__"])('Error registering block. Try reloading the page.')); |
|
1121 |
|
1122 case 27: |
|
1123 success = true; |
|
1124 _context.next = 38; |
|
1125 break; |
|
1126 |
|
1127 case 30: |
|
1128 _context.prev = 30; |
|
1129 _context.t0 = _context["catch"](4); |
|
1130 message = _context.t0.message || Object(external_this_wp_i18n_["__"])('An error occurred.'); // Errors we throw are fatal |
|
1131 |
|
1132 isFatal = _context.t0 instanceof Error; // Specific API errors that are fatal |
|
1133 |
|
1134 fatalAPIErrors = { |
|
1135 folder_exists: Object(external_this_wp_i18n_["__"])('This block is already installed. Try reloading the page.'), |
|
1136 unable_to_connect_to_filesystem: Object(external_this_wp_i18n_["__"])('Error installing block. You can reload the page and try again.') |
|
1137 }; |
|
1138 |
|
1139 if (fatalAPIErrors[_context.t0.code]) { |
|
1140 isFatal = true; |
|
1141 message = fatalAPIErrors[_context.t0.code]; |
|
1142 } |
|
1143 |
|
1144 _context.next = 38; |
|
1145 return setErrorNotice(id, message, isFatal); |
|
1146 |
|
1147 case 38: |
|
1148 _context.next = 40; |
|
1149 return setIsInstalling(block.id, false); |
|
1150 |
|
1151 case 40: |
|
1152 return _context.abrupt("return", success); |
|
1153 |
|
1154 case 41: |
|
1155 case "end": |
|
1156 return _context.stop(); |
|
1157 } |
|
1158 } |
|
1159 }, _marked, null, [[4, 30]]); |
|
1160 } |
|
1161 /** |
|
1162 * Action triggered to uninstall a block plugin. |
|
1163 * |
|
1164 * @param {Object} block The blockType object. |
|
1165 */ |
|
1166 |
|
1167 function actions_uninstallBlockType(block) { |
|
1168 return external_this_regeneratorRuntime_default.a.wrap(function uninstallBlockType$(_context2) { |
|
1169 while (1) { |
|
1170 switch (_context2.prev = _context2.next) { |
|
1171 case 0: |
|
1172 _context2.prev = 0; |
|
1173 _context2.next = 3; |
|
1174 return Object(external_this_wp_dataControls_["apiFetch"])({ |
|
1175 url: getPluginUrl(block), |
|
1176 data: { |
|
1177 status: 'inactive' |
|
1178 }, |
|
1179 method: 'PUT' |
|
1180 }); |
|
1181 |
|
1182 case 3: |
|
1183 _context2.next = 5; |
|
1184 return Object(external_this_wp_dataControls_["apiFetch"])({ |
|
1185 url: getPluginUrl(block), |
|
1186 method: 'DELETE' |
|
1187 }); |
|
1188 |
|
1189 case 5: |
|
1190 _context2.next = 7; |
|
1191 return removeInstalledBlockType(block); |
|
1192 |
|
1193 case 7: |
|
1194 _context2.next = 13; |
|
1195 break; |
|
1196 |
|
1197 case 9: |
|
1198 _context2.prev = 9; |
|
1199 _context2.t0 = _context2["catch"](0); |
|
1200 _context2.next = 13; |
|
1201 return Object(external_this_wp_dataControls_["dispatch"])('core/notices', 'createErrorNotice', _context2.t0.message || Object(external_this_wp_i18n_["__"])('An error occurred.')); |
|
1202 |
|
1203 case 13: |
|
1204 case "end": |
|
1205 return _context2.stop(); |
|
1206 } |
|
1207 } |
|
1208 }, _marked2, null, [[0, 9]]); |
|
1209 } |
|
1210 /** |
|
1211 * Returns an action object used to add a newly installed block type. |
|
1212 * |
|
1213 * @param {Object} item The block item with the block id and name. |
|
1214 * |
|
1215 * @return {Object} Action object. |
|
1216 */ |
|
1217 |
|
1218 function addInstalledBlockType(item) { |
|
1219 return { |
|
1220 type: 'ADD_INSTALLED_BLOCK_TYPE', |
|
1221 item: item |
|
1222 }; |
|
1223 } |
|
1224 /** |
|
1225 * Returns an action object used to remove a newly installed block type. |
|
1226 * |
|
1227 * @param {string} item The block item with the block id and name. |
|
1228 * |
|
1229 * @return {Object} Action object. |
|
1230 */ |
|
1231 |
|
1232 function removeInstalledBlockType(item) { |
|
1233 return { |
|
1234 type: 'REMOVE_INSTALLED_BLOCK_TYPE', |
|
1235 item: item |
|
1236 }; |
|
1237 } |
|
1238 /** |
|
1239 * Returns an action object used to indicate install in progress |
|
1240 * |
|
1241 * @param {string} blockId |
|
1242 * @param {boolean} isInstalling |
|
1243 * |
|
1244 * @return {Object} Action object. |
|
1245 */ |
|
1246 |
|
1247 function setIsInstalling(blockId, isInstalling) { |
|
1248 return { |
|
1249 type: 'SET_INSTALLING_BLOCK', |
|
1250 blockId: blockId, |
|
1251 isInstalling: isInstalling |
|
1252 }; |
|
1253 } |
|
1254 /** |
|
1255 * Sets an error notice string to be displayed to the user |
|
1256 * |
|
1257 * @param {string} blockId The ID of the block plugin. eg: my-block |
|
1258 * @param {string} message The message shown in the notice. |
|
1259 * @param {boolean} isFatal Whether the user can recover from the error |
|
1260 * |
|
1261 * @return {Object} Action object. |
|
1262 */ |
|
1263 |
|
1264 function setErrorNotice(blockId, message) { |
|
1265 var isFatal = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; |
|
1266 return { |
|
1267 type: 'SET_ERROR_NOTICE', |
|
1268 blockId: blockId, |
|
1269 message: message, |
|
1270 isFatal: isFatal |
|
1271 }; |
|
1272 } |
|
1273 /** |
|
1274 * Sets the error notice to empty for specific block |
|
1275 * |
|
1276 * @param {string} blockId The ID of the block plugin. eg: my-block |
|
1277 * |
|
1278 * @return {Object} Action object. |
|
1279 */ |
|
1280 |
|
1281 function clearErrorNotice(blockId) { |
|
1282 return { |
|
1283 type: 'CLEAR_ERROR_NOTICE', |
|
1284 blockId: blockId |
|
1285 }; |
|
1286 } |
|
1287 |
|
1288 // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/resolvers.js |
|
1289 |
|
1290 |
|
1291 /** |
|
1292 * External dependencies |
|
1293 */ |
|
1294 |
|
1295 /** |
|
1296 * WordPress dependencies |
|
1297 */ |
|
1298 |
|
1299 |
|
1300 /** |
|
1301 * Internal dependencies |
|
1302 */ |
|
1303 |
|
1304 |
|
1305 /* harmony default export */ var resolvers = ({ |
|
1306 getDownloadableBlocks: /*#__PURE__*/external_this_regeneratorRuntime_default.a.mark(function getDownloadableBlocks(filterValue) { |
|
1307 var results, blocks; |
|
1308 return external_this_regeneratorRuntime_default.a.wrap(function getDownloadableBlocks$(_context) { |
|
1309 while (1) { |
|
1310 switch (_context.prev = _context.next) { |
|
1311 case 0: |
|
1312 if (filterValue) { |
|
1313 _context.next = 2; |
|
1314 break; |
|
1315 } |
|
1316 |
|
1317 return _context.abrupt("return"); |
|
1318 |
|
1319 case 2: |
|
1320 _context.prev = 2; |
|
1321 _context.next = 5; |
|
1322 return fetchDownloadableBlocks(filterValue); |
|
1323 |
|
1324 case 5: |
|
1325 _context.next = 7; |
|
1326 return Object(external_this_wp_dataControls_["apiFetch"])({ |
|
1327 path: "wp/v2/block-directory/search?term=".concat(filterValue) |
|
1328 }); |
|
1329 |
|
1330 case 7: |
|
1331 results = _context.sent; |
|
1332 blocks = results.map(function (result) { |
|
1333 return Object(external_this_lodash_["mapKeys"])(result, function (value, key) { |
|
1334 return Object(external_this_lodash_["camelCase"])(key); |
|
1335 }); |
|
1336 }); |
|
1337 _context.next = 11; |
|
1338 return receiveDownloadableBlocks(blocks, filterValue); |
|
1339 |
|
1340 case 11: |
|
1341 _context.next = 15; |
|
1342 break; |
|
1343 |
|
1344 case 13: |
|
1345 _context.prev = 13; |
|
1346 _context.t0 = _context["catch"](2); |
|
1347 |
|
1348 case 15: |
|
1349 case "end": |
|
1350 return _context.stop(); |
|
1351 } |
|
1352 } |
|
1353 }, getDownloadableBlocks, null, [[2, 13]]); |
|
1354 }) |
|
1355 }); |
|
1356 |
|
1357 // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/index.js |
|
1358 |
|
1359 |
|
1360 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; } |
|
1361 |
|
1362 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; } |
|
1363 |
|
1364 /** |
|
1365 * WordPress dependencies |
|
1366 */ |
|
1367 |
|
1368 |
|
1369 /** |
|
1370 * Internal dependencies |
|
1371 */ |
|
1372 |
|
1373 |
|
1374 |
|
1375 |
|
1376 |
|
1377 |
|
1378 /** |
|
1379 * Module Constants |
|
1380 */ |
|
1381 |
|
1382 var MODULE_KEY = 'core/block-directory'; |
|
1383 /** |
|
1384 * Block editor data store configuration. |
|
1385 * |
|
1386 * @see https://github.com/WordPress/gutenberg/blob/master/packages/data/README.md#registerStore |
|
1387 * |
|
1388 * @type {Object} |
|
1389 */ |
|
1390 |
|
1391 var storeConfig = { |
|
1392 reducer: reducer, |
|
1393 selectors: selectors_namespaceObject, |
|
1394 actions: actions_namespaceObject, |
|
1395 controls: store_objectSpread({}, external_this_wp_dataControls_["controls"], {}, store_controls), |
|
1396 resolvers: resolvers |
|
1397 }; |
|
1398 var store = Object(external_this_wp_data_["registerStore"])(MODULE_KEY, storeConfig); |
|
1399 /* harmony default export */ var build_module_store = (store); |
|
1400 |
|
1401 // EXTERNAL MODULE: external {"this":["wp","element"]} |
|
1402 var external_this_wp_element_ = __webpack_require__(0); |
|
1403 |
|
1404 // EXTERNAL MODULE: external {"this":["wp","plugins"]} |
|
1405 var external_this_wp_plugins_ = __webpack_require__(76); |
|
1406 |
|
1407 // EXTERNAL MODULE: external {"this":["wp","blocks"]} |
|
1408 var external_this_wp_blocks_ = __webpack_require__(10); |
|
1409 |
|
1410 // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/auto-block-uninstaller/index.js |
|
1411 /** |
|
1412 * WordPress dependencies |
|
1413 */ |
|
1414 |
|
1415 |
|
1416 |
|
1417 function AutoBlockUninstaller() { |
|
1418 var _useDispatch = Object(external_this_wp_data_["useDispatch"])('core/block-directory'), |
|
1419 uninstallBlockType = _useDispatch.uninstallBlockType; |
|
1420 |
|
1421 var shouldRemoveBlockTypes = Object(external_this_wp_data_["useSelect"])(function (select) { |
|
1422 var _select = select('core/editor'), |
|
1423 isAutosavingPost = _select.isAutosavingPost, |
|
1424 isSavingPost = _select.isSavingPost; |
|
1425 |
|
1426 return isSavingPost() && !isAutosavingPost(); |
|
1427 }, []); |
|
1428 var unusedBlockTypes = Object(external_this_wp_data_["useSelect"])(function (select) { |
|
1429 return select('core/block-directory').getUnusedBlockTypes(); |
|
1430 }, []); |
|
1431 Object(external_this_wp_element_["useEffect"])(function () { |
|
1432 if (shouldRemoveBlockTypes && unusedBlockTypes.length) { |
|
1433 unusedBlockTypes.forEach(function (blockType) { |
|
1434 uninstallBlockType(blockType); |
|
1435 Object(external_this_wp_blocks_["unregisterBlockType"])(blockType.name); |
|
1436 }); |
|
1437 } |
|
1438 }, [shouldRemoveBlockTypes]); |
|
1439 return null; |
|
1440 } |
|
1441 |
|
1442 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules |
|
1443 var slicedToArray = __webpack_require__(14); |
|
1444 |
|
1445 // EXTERNAL MODULE: external {"this":["wp","blockEditor"]} |
|
1446 var external_this_wp_blockEditor_ = __webpack_require__(7); |
|
1447 |
|
1448 // EXTERNAL MODULE: external {"this":["wp","compose"]} |
|
1449 var external_this_wp_compose_ = __webpack_require__(9); |
|
1450 |
|
1451 // EXTERNAL MODULE: external {"this":["wp","components"]} |
|
1452 var external_this_wp_components_ = __webpack_require__(3); |
|
1453 |
|
1454 // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-author-info/index.js |
|
1455 |
|
1456 |
|
1457 /** |
|
1458 * WordPress dependencies |
|
1459 */ |
|
1460 |
|
1461 |
|
1462 |
|
1463 function DownloadableBlockAuthorInfo(_ref) { |
|
1464 var author = _ref.author, |
|
1465 authorBlockCount = _ref.authorBlockCount, |
|
1466 authorBlockRating = _ref.authorBlockRating; |
|
1467 return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])("span", { |
|
1468 className: "block-directory-downloadable-block-author-info__content-author" |
|
1469 }, Object(external_this_wp_i18n_["sprintf"])( |
|
1470 /* translators: %s: author name. */ |
|
1471 Object(external_this_wp_i18n_["__"])('Authored by %s'), author)), Object(external_this_wp_element_["createElement"])("span", { |
|
1472 className: "block-directory-downloadable-block-author-info__content" |
|
1473 }, authorBlockRating > 0 ? Object(external_this_wp_i18n_["sprintf"])( |
|
1474 /* translators: 1: number of blocks. 2: average rating. */ |
|
1475 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"])( |
|
1476 /* translators: 1: number of blocks. */ |
|
1477 Object(external_this_wp_i18n_["_n"])('This author has %1$d block.', 'This author has %1$d blocks.', authorBlockCount), authorBlockCount))); |
|
1478 } |
|
1479 |
|
1480 /* harmony default export */ var downloadable_block_author_info = (DownloadableBlockAuthorInfo); |
|
1481 |
|
1482 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js |
|
1483 var build_module_icon = __webpack_require__(137); |
|
1484 |
|
1485 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/star-filled.js |
|
1486 var star_filled = __webpack_require__(285); |
|
1487 |
|
1488 // EXTERNAL MODULE: external {"this":["wp","primitives"]} |
|
1489 var external_this_wp_primitives_ = __webpack_require__(6); |
|
1490 |
|
1491 // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/star-half.js |
|
1492 |
|
1493 |
|
1494 /** |
|
1495 * WordPress dependencies |
|
1496 */ |
|
1497 |
|
1498 var starHalf = Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["SVG"], { |
|
1499 xmlns: "http://www.w3.org/2000/svg", |
|
1500 viewBox: "0 0 24 24" |
|
1501 }, Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["Path"], { |
|
1502 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" |
|
1503 })); |
|
1504 /* harmony default export */ var star_half = (starHalf); |
|
1505 |
|
1506 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/star-empty.js |
|
1507 var star_empty = __webpack_require__(286); |
|
1508 |
|
1509 // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/block-ratings/stars.js |
|
1510 |
|
1511 |
|
1512 /** |
|
1513 * External dependencies |
|
1514 */ |
|
1515 |
|
1516 /** |
|
1517 * WordPress dependencies |
|
1518 */ |
|
1519 |
|
1520 |
|
1521 |
|
1522 |
|
1523 function Stars(_ref) { |
|
1524 var rating = _ref.rating; |
|
1525 var stars = Math.round(rating / 0.5) * 0.5; |
|
1526 var fullStarCount = Math.floor(rating); |
|
1527 var halfStarCount = Math.ceil(rating - fullStarCount); |
|
1528 var emptyStarCount = 5 - (fullStarCount + halfStarCount); |
|
1529 return Object(external_this_wp_element_["createElement"])("div", { |
|
1530 "aria-label": Object(external_this_wp_i18n_["sprintf"])( |
|
1531 /* translators: %s: number of stars. */ |
|
1532 Object(external_this_wp_i18n_["__"])('%s out of 5 stars'), stars) |
|
1533 }, Object(external_this_lodash_["times"])(fullStarCount, function (i) { |
|
1534 return Object(external_this_wp_element_["createElement"])(build_module_icon["a" /* default */], { |
|
1535 key: "full_stars_".concat(i), |
|
1536 icon: star_filled["a" /* default */], |
|
1537 size: 16 |
|
1538 }); |
|
1539 }), Object(external_this_lodash_["times"])(halfStarCount, function (i) { |
|
1540 return Object(external_this_wp_element_["createElement"])(build_module_icon["a" /* default */], { |
|
1541 key: "half_stars_".concat(i), |
|
1542 icon: star_half, |
|
1543 size: 16 |
|
1544 }); |
|
1545 }), Object(external_this_lodash_["times"])(emptyStarCount, function (i) { |
|
1546 return Object(external_this_wp_element_["createElement"])(build_module_icon["a" /* default */], { |
|
1547 key: "empty_stars_".concat(i), |
|
1548 icon: star_empty["a" /* default */], |
|
1549 size: 16 |
|
1550 }); |
|
1551 })); |
|
1552 } |
|
1553 |
|
1554 /* harmony default export */ var block_ratings_stars = (Stars); |
|
1555 |
|
1556 // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/block-ratings/index.js |
|
1557 |
|
1558 |
|
1559 /** |
|
1560 * WordPress dependencies |
|
1561 */ |
|
1562 |
|
1563 /** |
|
1564 * Internal dependencies |
|
1565 */ |
|
1566 |
|
1567 |
|
1568 var block_ratings_BlockRatings = function BlockRatings(_ref) { |
|
1569 var rating = _ref.rating, |
|
1570 ratingCount = _ref.ratingCount; |
|
1571 return Object(external_this_wp_element_["createElement"])("div", { |
|
1572 className: "block-directory-block-ratings" |
|
1573 }, Object(external_this_wp_element_["createElement"])(block_ratings_stars, { |
|
1574 rating: rating |
|
1575 }), Object(external_this_wp_element_["createElement"])("span", { |
|
1576 className: "block-directory-block-ratings__rating-count", |
|
1577 "aria-label": Object(external_this_wp_i18n_["sprintf"])( // translators: %d: number of ratings (number). |
|
1578 Object(external_this_wp_i18n_["_n"])('%d total rating', '%d total ratings', ratingCount), ratingCount) |
|
1579 }, "(", ratingCount, ")")); |
|
1580 }; |
|
1581 /* harmony default export */ var block_ratings = (block_ratings_BlockRatings); |
|
1582 |
|
1583 // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-icon/index.js |
|
1584 |
|
1585 |
|
1586 /** |
|
1587 * WordPress dependencies |
|
1588 */ |
|
1589 |
|
1590 |
|
1591 |
|
1592 function DownloadableBlockIcon(_ref) { |
|
1593 var icon = _ref.icon, |
|
1594 title = _ref.title; |
|
1595 return Object(external_this_wp_element_["createElement"])("div", { |
|
1596 className: "block-directory-downloadable-block-icon" |
|
1597 }, icon.match(/\.(jpeg|jpg|gif|png|svg)(?:\?.*)?$/) !== null ? Object(external_this_wp_element_["createElement"])("img", { |
|
1598 src: icon, |
|
1599 alt: Object(external_this_wp_i18n_["sprintf"])( // translators: %s: Name of the plugin e.g: "Akismet". |
|
1600 Object(external_this_wp_i18n_["__"])('%s block icon'), title) |
|
1601 }) : Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["BlockIcon"], { |
|
1602 icon: icon, |
|
1603 showColors: true |
|
1604 })); |
|
1605 } |
|
1606 |
|
1607 /* harmony default export */ var downloadable_block_icon = (DownloadableBlockIcon); |
|
1608 |
|
1609 // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-header/index.js |
|
1610 |
|
1611 |
|
1612 /** |
|
1613 * WordPress dependencies |
|
1614 */ |
|
1615 |
|
1616 |
|
1617 /** |
|
1618 * Internal dependencies |
|
1619 */ |
|
1620 |
|
1621 |
|
1622 |
|
1623 |
|
1624 function DownloadableBlockHeader(_ref) { |
|
1625 var icon = _ref.icon, |
|
1626 title = _ref.title, |
|
1627 rating = _ref.rating, |
|
1628 ratingCount = _ref.ratingCount, |
|
1629 _ref$isLoading = _ref.isLoading, |
|
1630 isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading, |
|
1631 _ref$isInstallable = _ref.isInstallable, |
|
1632 isInstallable = _ref$isInstallable === void 0 ? true : _ref$isInstallable, |
|
1633 _onClick = _ref.onClick; |
|
1634 return Object(external_this_wp_element_["createElement"])("div", { |
|
1635 className: "block-directory-downloadable-block-header__row" |
|
1636 }, Object(external_this_wp_element_["createElement"])(downloadable_block_icon, { |
|
1637 icon: icon, |
|
1638 title: title |
|
1639 }), Object(external_this_wp_element_["createElement"])("div", { |
|
1640 className: "block-directory-downloadable-block-header__column" |
|
1641 }, Object(external_this_wp_element_["createElement"])("h2", { |
|
1642 className: "block-directory-downloadable-block-header__title" |
|
1643 }, title), Object(external_this_wp_element_["createElement"])(block_ratings, { |
|
1644 rating: rating, |
|
1645 ratingCount: ratingCount |
|
1646 })), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Button"], { |
|
1647 isSecondary: true, |
|
1648 isBusy: isLoading, |
|
1649 disabled: isLoading || !isInstallable, |
|
1650 onClick: function onClick(event) { |
|
1651 event.preventDefault(); |
|
1652 |
|
1653 if (!isLoading && isInstallable) { |
|
1654 _onClick(); |
|
1655 } |
|
1656 } |
|
1657 }, isLoading ? Object(external_this_wp_i18n_["__"])('Adding…') : Object(external_this_wp_i18n_["__"])('Add block'))); |
|
1658 } |
|
1659 |
|
1660 /* harmony default export */ var downloadable_block_header = (DownloadableBlockHeader); |
|
1661 |
|
1662 // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chart-line.js |
|
1663 |
|
1664 |
|
1665 /** |
|
1666 * WordPress dependencies |
|
1667 */ |
|
1668 |
|
1669 var chartLine = Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["SVG"], { |
|
1670 xmlns: "http://www.w3.org/2000/svg", |
|
1671 viewBox: "-2 -2 24 24" |
|
1672 }, Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["Path"], { |
|
1673 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" |
|
1674 })); |
|
1675 /* harmony default export */ var chart_line = (chartLine); |
|
1676 |
|
1677 // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/update.js |
|
1678 |
|
1679 |
|
1680 /** |
|
1681 * WordPress dependencies |
|
1682 */ |
|
1683 |
|
1684 var update = Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["SVG"], { |
|
1685 xmlns: "http://www.w3.org/2000/svg", |
|
1686 viewBox: "-2 -2 24 24" |
|
1687 }, Object(external_this_wp_element_["createElement"])(external_this_wp_primitives_["Path"], { |
|
1688 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" |
|
1689 })); |
|
1690 /* harmony default export */ var library_update = (update); |
|
1691 |
|
1692 // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-info/index.js |
|
1693 |
|
1694 |
|
1695 /** |
|
1696 * WordPress dependencies |
|
1697 */ |
|
1698 |
|
1699 |
|
1700 |
|
1701 |
|
1702 function DownloadableBlockInfo(_ref) { |
|
1703 var description = _ref.description, |
|
1704 activeInstalls = _ref.activeInstalls, |
|
1705 humanizedUpdated = _ref.humanizedUpdated; |
|
1706 return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])("p", { |
|
1707 className: "block-directory-downloadable-block-info__content" |
|
1708 }, description), Object(external_this_wp_element_["createElement"])("div", { |
|
1709 className: "block-directory-downloadable-block-info__meta" |
|
1710 }, Object(external_this_wp_element_["createElement"])(build_module_icon["a" /* default */], { |
|
1711 className: "block-directory-downloadable-block-info__icon", |
|
1712 icon: chart_line |
|
1713 }), Object(external_this_wp_i18n_["sprintf"])( |
|
1714 /* translators: %s: number of active installations. */ |
|
1715 Object(external_this_wp_i18n_["_n"])('%d active installation', '%d active installations', activeInstalls), activeInstalls)), Object(external_this_wp_element_["createElement"])("div", { |
|
1716 className: "block-directory-downloadable-block-info__meta" |
|
1717 }, Object(external_this_wp_element_["createElement"])(build_module_icon["a" /* default */], { |
|
1718 className: "block-directory-downloadable-block-info__icon", |
|
1719 icon: library_update |
|
1720 }), // translators: %s: Humanized date of last update e.g: "2 months ago". |
|
1721 Object(external_this_wp_i18n_["sprintf"])(Object(external_this_wp_i18n_["__"])('Updated %s'), humanizedUpdated))); |
|
1722 } |
|
1723 |
|
1724 /* harmony default export */ var downloadable_block_info = (DownloadableBlockInfo); |
|
1725 |
|
1726 // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-notice/index.js |
|
1727 |
|
1728 |
|
1729 /** |
|
1730 * WordPress dependencies |
|
1731 */ |
|
1732 |
|
1733 |
|
1734 |
|
1735 var downloadable_block_notice_DownloadableBlockNotice = function DownloadableBlockNotice(_ref) { |
|
1736 var block = _ref.block, |
|
1737 _onClick = _ref.onClick; |
|
1738 var errorNotice = Object(external_this_wp_data_["useSelect"])(function (select) { |
|
1739 return select('core/block-directory').getErrorNoticeForBlock(block.id); |
|
1740 }, [block]); |
|
1741 |
|
1742 if (!errorNotice) { |
|
1743 return null; |
|
1744 } |
|
1745 |
|
1746 return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Notice"], { |
|
1747 status: "error", |
|
1748 isDismissible: false, |
|
1749 className: "block-directory-downloadable-block-notice" |
|
1750 }, Object(external_this_wp_element_["createElement"])("div", { |
|
1751 className: "block-directory-downloadable-block-notice__content" |
|
1752 }, errorNotice.message), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Button"], { |
|
1753 isSmall: true, |
|
1754 isPrimary: true, |
|
1755 onClick: function onClick() { |
|
1756 if (errorNotice.isFatal) { |
|
1757 window.location.reload(); |
|
1758 return false; |
|
1759 } |
|
1760 |
|
1761 _onClick(block); |
|
1762 } |
|
1763 }, errorNotice.isFatal ? Object(external_this_wp_i18n_["__"])('Reload') : Object(external_this_wp_i18n_["__"])('Retry'))); |
|
1764 }; |
|
1765 /* harmony default export */ var downloadable_block_notice = (downloadable_block_notice_DownloadableBlockNotice); |
|
1766 |
|
1767 // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-list-item/index.js |
|
1768 |
|
1769 |
|
1770 /** |
|
1771 * WordPress dependencies |
|
1772 */ |
|
1773 |
|
1774 /** |
|
1775 * Internal dependencies |
|
1776 */ |
|
1777 |
|
1778 |
|
1779 |
|
1780 |
|
1781 |
|
1782 function DownloadableBlockListItem(_ref) { |
|
1783 var item = _ref.item, |
|
1784 onClick = _ref.onClick; |
|
1785 |
|
1786 var _useSelect = Object(external_this_wp_data_["useSelect"])(function (select) { |
|
1787 var _select = select('core/block-directory'), |
|
1788 isInstalling = _select.isInstalling, |
|
1789 getErrorNoticeForBlock = _select.getErrorNoticeForBlock; |
|
1790 |
|
1791 var notice = getErrorNoticeForBlock(item.id); |
|
1792 var hasFatal = notice && notice.isFatal; |
|
1793 return { |
|
1794 isLoading: isInstalling(item.id), |
|
1795 isInstallable: !hasFatal |
|
1796 }; |
|
1797 }, [item]), |
|
1798 isLoading = _useSelect.isLoading, |
|
1799 isInstallable = _useSelect.isInstallable; |
|
1800 |
|
1801 var icon = item.icon, |
|
1802 title = item.title, |
|
1803 description = item.description, |
|
1804 rating = item.rating, |
|
1805 activeInstalls = item.activeInstalls, |
|
1806 ratingCount = item.ratingCount, |
|
1807 author = item.author, |
|
1808 humanizedUpdated = item.humanizedUpdated, |
|
1809 authorBlockCount = item.authorBlockCount, |
|
1810 authorBlockRating = item.authorBlockRating; |
|
1811 return Object(external_this_wp_element_["createElement"])("li", { |
|
1812 className: "block-directory-downloadable-block-list-item" |
|
1813 }, Object(external_this_wp_element_["createElement"])("article", { |
|
1814 className: "block-directory-downloadable-block-list-item__panel" |
|
1815 }, Object(external_this_wp_element_["createElement"])("header", { |
|
1816 className: "block-directory-downloadable-block-list-item__header" |
|
1817 }, Object(external_this_wp_element_["createElement"])(downloadable_block_header, { |
|
1818 icon: icon, |
|
1819 onClick: onClick, |
|
1820 title: title, |
|
1821 rating: rating, |
|
1822 ratingCount: ratingCount, |
|
1823 isLoading: isLoading, |
|
1824 isInstallable: isInstallable |
|
1825 })), Object(external_this_wp_element_["createElement"])("section", { |
|
1826 className: "block-directory-downloadable-block-list-item__body" |
|
1827 }, Object(external_this_wp_element_["createElement"])(downloadable_block_notice, { |
|
1828 onClick: onClick, |
|
1829 block: item |
|
1830 }), Object(external_this_wp_element_["createElement"])(downloadable_block_info, { |
|
1831 activeInstalls: activeInstalls, |
|
1832 description: description, |
|
1833 humanizedUpdated: humanizedUpdated |
|
1834 })), Object(external_this_wp_element_["createElement"])("footer", { |
|
1835 className: "block-directory-downloadable-block-list-item__footer" |
|
1836 }, Object(external_this_wp_element_["createElement"])(downloadable_block_author_info, { |
|
1837 author: author, |
|
1838 authorBlockCount: authorBlockCount, |
|
1839 authorBlockRating: authorBlockRating |
|
1840 })))); |
|
1841 } |
|
1842 |
|
1843 // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-blocks-list/index.js |
|
1844 |
|
1845 |
|
1846 /** |
|
1847 * External dependencies |
|
1848 */ |
|
1849 |
|
1850 /** |
|
1851 * WordPress dependencies |
|
1852 */ |
|
1853 |
|
1854 |
|
1855 /** |
|
1856 * Internal dependencies |
|
1857 */ |
|
1858 |
|
1859 |
|
1860 |
|
1861 function DownloadableBlocksList(_ref) { |
|
1862 var items = _ref.items, |
|
1863 _ref$onHover = _ref.onHover, |
|
1864 onHover = _ref$onHover === void 0 ? external_this_lodash_["noop"] : _ref$onHover, |
|
1865 onSelect = _ref.onSelect; |
|
1866 |
|
1867 var _useDispatch = Object(external_this_wp_data_["useDispatch"])('core/block-directory'), |
|
1868 installBlockType = _useDispatch.installBlockType; |
|
1869 |
|
1870 if (!items.length) { |
|
1871 return null; |
|
1872 } |
|
1873 |
|
1874 return ( |
|
1875 /* |
|
1876 * Disable reason: The `list` ARIA role is redundant but |
|
1877 * Safari+VoiceOver won't announce the list otherwise. |
|
1878 */ |
|
1879 |
|
1880 /* eslint-disable jsx-a11y/no-redundant-roles */ |
|
1881 Object(external_this_wp_element_["createElement"])("ul", { |
|
1882 role: "list", |
|
1883 className: "block-directory-downloadable-blocks-list" |
|
1884 }, items.map(function (item) { |
|
1885 return Object(external_this_wp_element_["createElement"])(DownloadableBlockListItem, { |
|
1886 key: item.id, |
|
1887 onClick: function onClick() { |
|
1888 installBlockType(item).then(function (success) { |
|
1889 if (success) { |
|
1890 onSelect(item); |
|
1891 } |
|
1892 }); |
|
1893 onHover(null); |
|
1894 }, |
|
1895 item: item |
|
1896 }); |
|
1897 })) |
|
1898 /* eslint-enable jsx-a11y/no-redundant-roles */ |
|
1899 |
|
1900 ); |
|
1901 } |
|
1902 |
|
1903 /* harmony default export */ var downloadable_blocks_list = (DownloadableBlocksList); |
|
1904 |
|
1905 // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-blocks-panel/index.js |
|
1906 |
|
1907 |
|
1908 /** |
|
1909 * WordPress dependencies |
|
1910 */ |
|
1911 |
|
1912 |
|
1913 |
|
1914 |
|
1915 |
|
1916 /** |
|
1917 * Internal dependencies |
|
1918 */ |
|
1919 |
|
1920 |
|
1921 |
|
1922 function DownloadableBlocksPanel(_ref) { |
|
1923 var downloadableItems = _ref.downloadableItems, |
|
1924 onSelect = _ref.onSelect, |
|
1925 onHover = _ref.onHover, |
|
1926 hasPermission = _ref.hasPermission, |
|
1927 isLoading = _ref.isLoading, |
|
1928 isWaiting = _ref.isWaiting, |
|
1929 debouncedSpeak = _ref.debouncedSpeak; |
|
1930 |
|
1931 if (false === hasPermission) { |
|
1932 debouncedSpeak(Object(external_this_wp_i18n_["__"])('No blocks found in your library.')); |
|
1933 return Object(external_this_wp_element_["createElement"])("p", { |
|
1934 className: "block-directory-downloadable-blocks-panel__description has-no-results" |
|
1935 }, Object(external_this_wp_i18n_["__"])('No blocks found in your library.')); |
|
1936 } |
|
1937 |
|
1938 if (typeof hasPermission === 'undefined' || isLoading || isWaiting) { |
|
1939 return Object(external_this_wp_element_["createElement"])("p", { |
|
1940 className: "block-directory-downloadable-blocks-panel__description has-no-results" |
|
1941 }, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Spinner"], null)); |
|
1942 } |
|
1943 |
|
1944 if (!downloadableItems.length) { |
|
1945 return Object(external_this_wp_element_["createElement"])("p", { |
|
1946 className: "block-directory-downloadable-blocks-panel__description has-no-results" |
|
1947 }, Object(external_this_wp_i18n_["__"])('No blocks found in your library.')); |
|
1948 } |
|
1949 |
|
1950 var resultsFoundMessage = Object(external_this_wp_i18n_["sprintf"])( |
|
1951 /* translators: %s: number of available blocks. */ |
|
1952 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); |
|
1953 debouncedSpeak(resultsFoundMessage); |
|
1954 return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])("p", { |
|
1955 className: "block-directory-downloadable-blocks-panel__description" |
|
1956 }, 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, { |
|
1957 items: downloadableItems, |
|
1958 onSelect: onSelect, |
|
1959 onHover: onHover |
|
1960 })); |
|
1961 } |
|
1962 |
|
1963 /* 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) { |
|
1964 var filterValue = _ref2.filterValue; |
|
1965 |
|
1966 var _select = select('core/block-directory'), |
|
1967 getDownloadableBlocks = _select.getDownloadableBlocks, |
|
1968 isRequestingDownloadableBlocks = _select.isRequestingDownloadableBlocks; |
|
1969 |
|
1970 var hasPermission = select('core').canUser('read', 'block-directory/search'); |
|
1971 var downloadableItems = hasPermission ? getDownloadableBlocks(filterValue) : []; |
|
1972 var isLoading = isRequestingDownloadableBlocks(filterValue); |
|
1973 return { |
|
1974 downloadableItems: downloadableItems, |
|
1975 hasPermission: hasPermission, |
|
1976 isLoading: isLoading |
|
1977 }; |
|
1978 })])(DownloadableBlocksPanel)); |
|
1979 |
|
1980 // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/inserter-menu-downloadable-blocks-panel/index.js |
|
1981 |
|
1982 |
|
1983 |
|
1984 /** |
|
1985 * External dependencies |
|
1986 */ |
|
1987 |
|
1988 /** |
|
1989 * WordPress dependencies |
|
1990 */ |
|
1991 |
|
1992 |
|
1993 |
|
1994 /** |
|
1995 * Internal dependencies |
|
1996 */ |
|
1997 |
|
1998 |
|
1999 |
|
2000 function InserterMenuDownloadableBlocksPanel() { |
|
2001 var _useState = Object(external_this_wp_element_["useState"])(''), |
|
2002 _useState2 = Object(slicedToArray["a" /* default */])(_useState, 2), |
|
2003 debouncedFilterValue = _useState2[0], |
|
2004 setFilterValue = _useState2[1]; |
|
2005 |
|
2006 var debouncedSetFilterValue = Object(external_this_lodash_["debounce"])(setFilterValue, 400); |
|
2007 return Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["__experimentalInserterMenuExtension"], null, function (_ref) { |
|
2008 var onSelect = _ref.onSelect, |
|
2009 onHover = _ref.onHover, |
|
2010 filterValue = _ref.filterValue, |
|
2011 hasItems = _ref.hasItems; |
|
2012 |
|
2013 if (hasItems || !filterValue) { |
|
2014 return null; |
|
2015 } |
|
2016 |
|
2017 if (debouncedFilterValue !== filterValue) { |
|
2018 debouncedSetFilterValue(filterValue); |
|
2019 } |
|
2020 |
|
2021 return Object(external_this_wp_element_["createElement"])(downloadable_blocks_panel, { |
|
2022 onSelect: onSelect, |
|
2023 onHover: onHover, |
|
2024 filterValue: debouncedFilterValue, |
|
2025 isWaiting: filterValue !== debouncedFilterValue |
|
2026 }); |
|
2027 }); |
|
2028 } |
|
2029 |
|
2030 /* harmony default export */ var inserter_menu_downloadable_blocks_panel = (InserterMenuDownloadableBlocksPanel); |
|
2031 |
|
2032 // EXTERNAL MODULE: external {"this":["wp","editPost"]} |
|
2033 var external_this_wp_editPost_ = __webpack_require__(262); |
|
2034 |
|
2035 // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/compact-list/index.js |
|
2036 |
|
2037 |
|
2038 /** |
|
2039 * WordPress dependencies |
|
2040 */ |
|
2041 |
|
2042 /** |
|
2043 * Internal dependencies |
|
2044 */ |
|
2045 |
|
2046 |
|
2047 function CompactList(_ref) { |
|
2048 var items = _ref.items; |
|
2049 |
|
2050 if (!items.length) { |
|
2051 return null; |
|
2052 } |
|
2053 |
|
2054 return Object(external_this_wp_element_["createElement"])("ul", { |
|
2055 className: "block-directory-compact-list" |
|
2056 }, items.map(function (_ref2) { |
|
2057 var icon = _ref2.icon, |
|
2058 id = _ref2.id, |
|
2059 title = _ref2.title, |
|
2060 author = _ref2.author; |
|
2061 return Object(external_this_wp_element_["createElement"])("li", { |
|
2062 key: id, |
|
2063 className: "block-directory-compact-list__item" |
|
2064 }, Object(external_this_wp_element_["createElement"])(downloadable_block_icon, { |
|
2065 icon: icon, |
|
2066 title: title |
|
2067 }), Object(external_this_wp_element_["createElement"])("div", { |
|
2068 className: "block-directory-compact-list__item-details" |
|
2069 }, Object(external_this_wp_element_["createElement"])("div", { |
|
2070 className: "block-directory-compact-list__item-title" |
|
2071 }, title), Object(external_this_wp_element_["createElement"])("div", { |
|
2072 className: "block-directory-compact-list__item-author" |
|
2073 }, Object(external_this_wp_i18n_["sprintf"])( |
|
2074 /* translators: %s: Name of the block author. */ |
|
2075 Object(external_this_wp_i18n_["__"])('By %s'), author)))); |
|
2076 })); |
|
2077 } |
|
2078 |
|
2079 // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/installed-blocks-pre-publish-panel/index.js |
|
2080 |
|
2081 |
|
2082 /** |
|
2083 * WordPress dependencies |
|
2084 */ |
|
2085 |
|
2086 |
|
2087 |
|
2088 /** |
|
2089 * Internal dependencies |
|
2090 */ |
|
2091 |
|
2092 |
|
2093 function InstalledBlocksPrePublishPanel() { |
|
2094 var newBlockTypes = Object(external_this_wp_data_["useSelect"])(function (select) { |
|
2095 return select('core/block-directory').getNewBlockTypes(); |
|
2096 }, []); |
|
2097 |
|
2098 if (!newBlockTypes.length) { |
|
2099 return null; |
|
2100 } |
|
2101 |
|
2102 return Object(external_this_wp_element_["createElement"])(external_this_wp_editPost_["PluginPrePublishPanel"], { |
|
2103 icon: "block-default", |
|
2104 title: Object(external_this_wp_i18n_["sprintf"])( // translators: %d: number of blocks (number). |
|
2105 Object(external_this_wp_i18n_["_n"])('Added: %d block', 'Added: %d blocks', newBlockTypes.length), newBlockTypes.length), |
|
2106 initialOpen: true |
|
2107 }, Object(external_this_wp_element_["createElement"])("p", { |
|
2108 className: "installed-blocks-pre-publish-panel__copy" |
|
2109 }, 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, { |
|
2110 items: newBlockTypes |
|
2111 })); |
|
2112 } |
|
2113 |
|
2114 // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/index.js |
|
2115 |
|
2116 |
|
2117 /** |
|
2118 * WordPress dependencies |
|
2119 */ |
|
2120 |
|
2121 /** |
|
2122 * Internal dependencies |
|
2123 */ |
|
2124 |
|
2125 |
|
2126 |
|
2127 |
|
2128 Object(external_this_wp_plugins_["registerPlugin"])('block-directory', { |
|
2129 render: function render() { |
|
2130 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)); |
|
2131 } |
|
2132 }); |
|
2133 |
|
2134 // CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/index.js |
|
2135 /** |
|
2136 * WordPress dependencies |
|
2137 */ |
|
2138 |
|
2139 /** |
|
2140 * Internal dependencies |
|
2141 */ |
|
2142 |
|
2143 |
|
2144 |
|
2145 |
|
2146 |
|
2147 /***/ }), |
|
2148 |
|
2149 /***/ 45: |
|
2150 /***/ (function(module, exports) { |
|
2151 |
|
2152 (function() { module.exports = this["wp"]["apiFetch"]; }()); |
|
2153 |
|
2154 /***/ }), |
|
2155 |
|
2156 /***/ 5: |
|
2157 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
2158 |
|
2159 "use strict"; |
|
2160 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; }); |
|
2161 function _defineProperty(obj, key, value) { |
|
2162 if (key in obj) { |
|
2163 Object.defineProperty(obj, key, { |
|
2164 value: value, |
|
2165 enumerable: true, |
|
2166 configurable: true, |
|
2167 writable: true |
|
2168 }); |
|
2169 } else { |
|
2170 obj[key] = value; |
|
2171 } |
|
2172 |
|
2173 return obj; |
|
2174 } |
|
2175 |
|
2176 /***/ }), |
|
2177 |
|
2178 /***/ 50: |
|
2179 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
2180 |
|
2181 "use strict"; |
|
2182 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _asyncToGenerator; }); |
|
2183 function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { |
|
2184 try { |
|
2185 var info = gen[key](arg); |
|
2186 var value = info.value; |
|
2187 } catch (error) { |
|
2188 reject(error); |
|
2189 return; |
|
2190 } |
|
2191 |
|
2192 if (info.done) { |
|
2193 resolve(value); |
|
2194 } else { |
|
2195 Promise.resolve(value).then(_next, _throw); |
|
2196 } |
|
2197 } |
|
2198 |
|
2199 function _asyncToGenerator(fn) { |
|
2200 return function () { |
|
2201 var self = this, |
|
2202 args = arguments; |
|
2203 return new Promise(function (resolve, reject) { |
|
2204 var gen = fn.apply(self, args); |
|
2205 |
|
2206 function _next(value) { |
|
2207 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); |
|
2208 } |
|
2209 |
|
2210 function _throw(err) { |
|
2211 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); |
|
2212 } |
|
2213 |
|
2214 _next(undefined); |
|
2215 }); |
|
2216 }; |
|
2217 } |
|
2218 |
|
2219 /***/ }), |
|
2220 |
|
2221 /***/ 6: |
|
2222 /***/ (function(module, exports) { |
|
2223 |
|
2224 (function() { module.exports = this["wp"]["primitives"]; }()); |
|
2225 |
|
2226 /***/ }), |
|
2227 |
|
2228 /***/ 7: |
|
2229 /***/ (function(module, exports) { |
|
2230 |
|
2231 (function() { module.exports = this["wp"]["blockEditor"]; }()); |
|
2232 |
|
2233 /***/ }), |
|
2234 |
|
2235 /***/ 76: |
|
2236 /***/ (function(module, exports) { |
|
2237 |
|
2238 (function() { module.exports = this["wp"]["plugins"]; }()); |
|
2239 |
|
2240 /***/ }), |
|
2241 |
|
2242 /***/ 9: |
|
2243 /***/ (function(module, exports) { |
|
2244 |
|
2245 (function() { module.exports = this["wp"]["compose"]; }()); |
|
2246 |
|
2247 /***/ }) |
|
2248 |
|
2249 /******/ }); |