80 /******/ // __webpack_public_path__ |
80 /******/ // __webpack_public_path__ |
81 /******/ __webpack_require__.p = ""; |
81 /******/ __webpack_require__.p = ""; |
82 /******/ |
82 /******/ |
83 /******/ |
83 /******/ |
84 /******/ // Load entry module and return exports |
84 /******/ // Load entry module and return exports |
85 /******/ return __webpack_require__(__webpack_require__.s = 461); |
85 /******/ return __webpack_require__(__webpack_require__.s = "ey5A"); |
86 /******/ }) |
86 /******/ }) |
87 /************************************************************************/ |
87 /************************************************************************/ |
88 /******/ ({ |
88 /******/ ({ |
89 |
89 |
90 /***/ 0: |
90 /***/ "4eJC": |
|
91 /***/ (function(module, exports, __webpack_require__) { |
|
92 |
|
93 /** |
|
94 * Memize options object. |
|
95 * |
|
96 * @typedef MemizeOptions |
|
97 * |
|
98 * @property {number} [maxSize] Maximum size of the cache. |
|
99 */ |
|
100 |
|
101 /** |
|
102 * Internal cache entry. |
|
103 * |
|
104 * @typedef MemizeCacheNode |
|
105 * |
|
106 * @property {?MemizeCacheNode|undefined} [prev] Previous node. |
|
107 * @property {?MemizeCacheNode|undefined} [next] Next node. |
|
108 * @property {Array<*>} args Function arguments for cache |
|
109 * entry. |
|
110 * @property {*} val Function result. |
|
111 */ |
|
112 |
|
113 /** |
|
114 * Properties of the enhanced function for controlling cache. |
|
115 * |
|
116 * @typedef MemizeMemoizedFunction |
|
117 * |
|
118 * @property {()=>void} clear Clear the cache. |
|
119 */ |
|
120 |
|
121 /** |
|
122 * Accepts a function to be memoized, and returns a new memoized function, with |
|
123 * optional options. |
|
124 * |
|
125 * @template {Function} F |
|
126 * |
|
127 * @param {F} fn Function to memoize. |
|
128 * @param {MemizeOptions} [options] Options object. |
|
129 * |
|
130 * @return {F & MemizeMemoizedFunction} Memoized function. |
|
131 */ |
|
132 function memize( fn, options ) { |
|
133 var size = 0; |
|
134 |
|
135 /** @type {?MemizeCacheNode|undefined} */ |
|
136 var head; |
|
137 |
|
138 /** @type {?MemizeCacheNode|undefined} */ |
|
139 var tail; |
|
140 |
|
141 options = options || {}; |
|
142 |
|
143 function memoized( /* ...args */ ) { |
|
144 var node = head, |
|
145 len = arguments.length, |
|
146 args, i; |
|
147 |
|
148 searchCache: while ( node ) { |
|
149 // Perform a shallow equality test to confirm that whether the node |
|
150 // under test is a candidate for the arguments passed. Two arrays |
|
151 // are shallowly equal if their length matches and each entry is |
|
152 // strictly equal between the two sets. Avoid abstracting to a |
|
153 // function which could incur an arguments leaking deoptimization. |
|
154 |
|
155 // Check whether node arguments match arguments length |
|
156 if ( node.args.length !== arguments.length ) { |
|
157 node = node.next; |
|
158 continue; |
|
159 } |
|
160 |
|
161 // Check whether node arguments match arguments values |
|
162 for ( i = 0; i < len; i++ ) { |
|
163 if ( node.args[ i ] !== arguments[ i ] ) { |
|
164 node = node.next; |
|
165 continue searchCache; |
|
166 } |
|
167 } |
|
168 |
|
169 // At this point we can assume we've found a match |
|
170 |
|
171 // Surface matched node to head if not already |
|
172 if ( node !== head ) { |
|
173 // As tail, shift to previous. Must only shift if not also |
|
174 // head, since if both head and tail, there is no previous. |
|
175 if ( node === tail ) { |
|
176 tail = node.prev; |
|
177 } |
|
178 |
|
179 // Adjust siblings to point to each other. If node was tail, |
|
180 // this also handles new tail's empty `next` assignment. |
|
181 /** @type {MemizeCacheNode} */ ( node.prev ).next = node.next; |
|
182 if ( node.next ) { |
|
183 node.next.prev = node.prev; |
|
184 } |
|
185 |
|
186 node.next = head; |
|
187 node.prev = null; |
|
188 /** @type {MemizeCacheNode} */ ( head ).prev = node; |
|
189 head = node; |
|
190 } |
|
191 |
|
192 // Return immediately |
|
193 return node.val; |
|
194 } |
|
195 |
|
196 // No cached value found. Continue to insertion phase: |
|
197 |
|
198 // Create a copy of arguments (avoid leaking deoptimization) |
|
199 args = new Array( len ); |
|
200 for ( i = 0; i < len; i++ ) { |
|
201 args[ i ] = arguments[ i ]; |
|
202 } |
|
203 |
|
204 node = { |
|
205 args: args, |
|
206 |
|
207 // Generate the result from original function |
|
208 val: fn.apply( null, args ), |
|
209 }; |
|
210 |
|
211 // Don't need to check whether node is already head, since it would |
|
212 // have been returned above already if it was |
|
213 |
|
214 // Shift existing head down list |
|
215 if ( head ) { |
|
216 head.prev = node; |
|
217 node.next = head; |
|
218 } else { |
|
219 // If no head, follows that there's no tail (at initial or reset) |
|
220 tail = node; |
|
221 } |
|
222 |
|
223 // Trim tail if we're reached max size and are pending cache insertion |
|
224 if ( size === /** @type {MemizeOptions} */ ( options ).maxSize ) { |
|
225 tail = /** @type {MemizeCacheNode} */ ( tail ).prev; |
|
226 /** @type {MemizeCacheNode} */ ( tail ).next = null; |
|
227 } else { |
|
228 size++; |
|
229 } |
|
230 |
|
231 head = node; |
|
232 |
|
233 return node.val; |
|
234 } |
|
235 |
|
236 memoized.clear = function() { |
|
237 head = null; |
|
238 tail = null; |
|
239 size = 0; |
|
240 }; |
|
241 |
|
242 if ( false ) {} |
|
243 |
|
244 // Ignore reason: There's not a clear solution to create an intersection of |
|
245 // the function with additional properties, where the goal is to retain the |
|
246 // function signature of the incoming argument and add control properties |
|
247 // on the return value. |
|
248 |
|
249 // @ts-ignore |
|
250 return memoized; |
|
251 } |
|
252 |
|
253 module.exports = memize; |
|
254 |
|
255 |
|
256 /***/ }), |
|
257 |
|
258 /***/ "GRId": |
91 /***/ (function(module, exports) { |
259 /***/ (function(module, exports) { |
92 |
260 |
93 (function() { module.exports = this["wp"]["element"]; }()); |
261 (function() { module.exports = window["wp"]["element"]; }()); |
94 |
262 |
95 /***/ }), |
263 /***/ }), |
96 |
264 |
97 /***/ 12: |
265 /***/ "K9lf": |
98 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
266 /***/ (function(module, exports) { |
99 |
267 |
100 "use strict"; |
268 (function() { module.exports = window["wp"]["compose"]; }()); |
101 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _assertThisInitialized; }); |
|
102 function _assertThisInitialized(self) { |
|
103 if (self === void 0) { |
|
104 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); |
|
105 } |
|
106 |
|
107 return self; |
|
108 } |
|
109 |
269 |
110 /***/ }), |
270 /***/ }), |
111 |
271 |
112 /***/ 16: |
272 /***/ "Tqx9": |
113 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
273 /***/ (function(module, exports) { |
114 |
274 |
115 "use strict"; |
275 (function() { module.exports = window["wp"]["primitives"]; }()); |
116 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _getPrototypeOf; }); |
|
117 function _getPrototypeOf(o) { |
|
118 _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { |
|
119 return o.__proto__ || Object.getPrototypeOf(o); |
|
120 }; |
|
121 return _getPrototypeOf(o); |
|
122 } |
|
123 |
276 |
124 /***/ }), |
277 /***/ }), |
125 |
278 |
126 /***/ 19: |
279 /***/ "YLtl": |
127 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
280 /***/ (function(module, exports) { |
128 |
281 |
129 "use strict"; |
282 (function() { module.exports = window["lodash"]; }()); |
130 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _createClass; }); |
|
131 function _defineProperties(target, props) { |
|
132 for (var i = 0; i < props.length; i++) { |
|
133 var descriptor = props[i]; |
|
134 descriptor.enumerable = descriptor.enumerable || false; |
|
135 descriptor.configurable = true; |
|
136 if ("value" in descriptor) descriptor.writable = true; |
|
137 Object.defineProperty(target, descriptor.key, descriptor); |
|
138 } |
|
139 } |
|
140 |
|
141 function _createClass(Constructor, protoProps, staticProps) { |
|
142 if (protoProps) _defineProperties(Constructor.prototype, protoProps); |
|
143 if (staticProps) _defineProperties(Constructor, staticProps); |
|
144 return Constructor; |
|
145 } |
|
146 |
283 |
147 /***/ }), |
284 /***/ }), |
148 |
285 |
149 /***/ 2: |
286 /***/ "ey5A": |
150 /***/ (function(module, exports) { |
|
151 |
|
152 (function() { module.exports = this["lodash"]; }()); |
|
153 |
|
154 /***/ }), |
|
155 |
|
156 /***/ 20: |
|
157 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
158 |
|
159 "use strict"; |
|
160 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _classCallCheck; }); |
|
161 function _classCallCheck(instance, Constructor) { |
|
162 if (!(instance instanceof Constructor)) { |
|
163 throw new TypeError("Cannot call a class as a function"); |
|
164 } |
|
165 } |
|
166 |
|
167 /***/ }), |
|
168 |
|
169 /***/ 22: |
|
170 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
171 |
|
172 "use strict"; |
|
173 |
|
174 // EXPORTS |
|
175 __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _inherits; }); |
|
176 |
|
177 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js |
|
178 function _setPrototypeOf(o, p) { |
|
179 _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { |
|
180 o.__proto__ = p; |
|
181 return o; |
|
182 }; |
|
183 |
|
184 return _setPrototypeOf(o, p); |
|
185 } |
|
186 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js |
|
187 |
|
188 function _inherits(subClass, superClass) { |
|
189 if (typeof superClass !== "function" && superClass !== null) { |
|
190 throw new TypeError("Super expression must either be null or a function"); |
|
191 } |
|
192 |
|
193 subClass.prototype = Object.create(superClass && superClass.prototype, { |
|
194 constructor: { |
|
195 value: subClass, |
|
196 writable: true, |
|
197 configurable: true |
|
198 } |
|
199 }); |
|
200 if (superClass) _setPrototypeOf(subClass, superClass); |
|
201 } |
|
202 |
|
203 /***/ }), |
|
204 |
|
205 /***/ 23: |
|
206 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
207 |
|
208 "use strict"; |
|
209 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _possibleConstructorReturn; }); |
|
210 /* harmony import */ var _helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(40); |
|
211 /* harmony import */ var _assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12); |
|
212 |
|
213 |
|
214 function _possibleConstructorReturn(self, call) { |
|
215 if (call && (Object(_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(call) === "object" || typeof call === "function")) { |
|
216 return call; |
|
217 } |
|
218 |
|
219 return Object(_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(self); |
|
220 } |
|
221 |
|
222 /***/ }), |
|
223 |
|
224 /***/ 32: |
|
225 /***/ (function(module, exports) { |
|
226 |
|
227 (function() { module.exports = this["wp"]["hooks"]; }()); |
|
228 |
|
229 /***/ }), |
|
230 |
|
231 /***/ 40: |
|
232 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
233 |
|
234 "use strict"; |
|
235 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _typeof; }); |
|
236 function _typeof(obj) { |
|
237 "@babel/helpers - typeof"; |
|
238 |
|
239 if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { |
|
240 _typeof = function _typeof(obj) { |
|
241 return typeof obj; |
|
242 }; |
|
243 } else { |
|
244 _typeof = function _typeof(obj) { |
|
245 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; |
|
246 }; |
|
247 } |
|
248 |
|
249 return _typeof(obj); |
|
250 } |
|
251 |
|
252 /***/ }), |
|
253 |
|
254 /***/ 420: |
|
255 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
256 |
|
257 "use strict"; |
|
258 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); |
|
259 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); |
|
260 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6); |
|
261 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); |
|
262 |
|
263 |
|
264 /** |
|
265 * WordPress dependencies |
|
266 */ |
|
267 |
|
268 var plugins = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { |
|
269 xmlns: "http://www.w3.org/2000/svg", |
|
270 viewBox: "0 0 24 24" |
|
271 }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { |
|
272 d: "M10.5 4v4h3V4H15v4h1.5a1 1 0 011 1v4l-3 4v2a1 1 0 01-1 1h-3a1 1 0 01-1-1v-2l-3-4V9a1 1 0 011-1H9V4h1.5zm.5 12.5v2h2v-2l3-4v-3H8v3l3 4z" |
|
273 })); |
|
274 /* harmony default export */ __webpack_exports__["a"] = (plugins); |
|
275 |
|
276 |
|
277 /***/ }), |
|
278 |
|
279 /***/ 461: |
|
280 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
287 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
281 |
288 |
282 "use strict"; |
289 "use strict"; |
283 // ESM COMPAT FLAG |
290 // ESM COMPAT FLAG |
284 __webpack_require__.r(__webpack_exports__); |
291 __webpack_require__.r(__webpack_exports__); |
285 |
292 |
286 // EXPORTS |
293 // EXPORTS |
287 __webpack_require__.d(__webpack_exports__, "PluginArea", function() { return /* reexport */ plugin_area; }); |
294 __webpack_require__.d(__webpack_exports__, "PluginArea", function() { return /* reexport */ plugin_area; }); |
288 __webpack_require__.d(__webpack_exports__, "withPluginContext", function() { return /* reexport */ plugin_context_withPluginContext; }); |
295 __webpack_require__.d(__webpack_exports__, "withPluginContext", function() { return /* reexport */ withPluginContext; }); |
289 __webpack_require__.d(__webpack_exports__, "registerPlugin", function() { return /* reexport */ registerPlugin; }); |
296 __webpack_require__.d(__webpack_exports__, "registerPlugin", function() { return /* reexport */ registerPlugin; }); |
290 __webpack_require__.d(__webpack_exports__, "unregisterPlugin", function() { return /* reexport */ unregisterPlugin; }); |
297 __webpack_require__.d(__webpack_exports__, "unregisterPlugin", function() { return /* reexport */ unregisterPlugin; }); |
291 __webpack_require__.d(__webpack_exports__, "getPlugin", function() { return /* reexport */ getPlugin; }); |
298 __webpack_require__.d(__webpack_exports__, "getPlugin", function() { return /* reexport */ getPlugin; }); |
292 __webpack_require__.d(__webpack_exports__, "getPlugins", function() { return /* reexport */ getPlugins; }); |
299 __webpack_require__.d(__webpack_exports__, "getPlugins", function() { return /* reexport */ getPlugins; }); |
293 |
300 |
294 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js |
301 // EXTERNAL MODULE: external ["wp","element"] |
295 var classCallCheck = __webpack_require__(20); |
302 var external_wp_element_ = __webpack_require__("GRId"); |
296 |
303 |
297 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js |
304 // EXTERNAL MODULE: external "lodash" |
298 var createClass = __webpack_require__(19); |
305 var external_lodash_ = __webpack_require__("YLtl"); |
299 |
306 |
300 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js |
307 // EXTERNAL MODULE: ./node_modules/memize/index.js |
301 var assertThisInitialized = __webpack_require__(12); |
308 var memize = __webpack_require__("4eJC"); |
302 |
309 var memize_default = /*#__PURE__*/__webpack_require__.n(memize); |
303 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js |
310 |
304 var possibleConstructorReturn = __webpack_require__(23); |
311 // EXTERNAL MODULE: external ["wp","hooks"] |
305 |
312 var external_wp_hooks_ = __webpack_require__("g56x"); |
306 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js |
|
307 var getPrototypeOf = __webpack_require__(16); |
|
308 |
|
309 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js + 1 modules |
|
310 var inherits = __webpack_require__(22); |
|
311 |
|
312 // EXTERNAL MODULE: external {"this":["wp","element"]} |
|
313 var external_this_wp_element_ = __webpack_require__(0); |
|
314 |
|
315 // EXTERNAL MODULE: external {"this":"lodash"} |
|
316 var external_this_lodash_ = __webpack_require__(2); |
|
317 |
|
318 // EXTERNAL MODULE: external {"this":["wp","hooks"]} |
|
319 var external_this_wp_hooks_ = __webpack_require__(32); |
|
320 |
313 |
321 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js |
314 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js |
322 var esm_extends = __webpack_require__(8); |
315 var esm_extends = __webpack_require__("wx14"); |
323 |
316 |
324 // EXTERNAL MODULE: external {"this":["wp","compose"]} |
317 // EXTERNAL MODULE: external ["wp","compose"] |
325 var external_this_wp_compose_ = __webpack_require__(9); |
318 var external_wp_compose_ = __webpack_require__("K9lf"); |
326 |
319 |
327 // CONCATENATED MODULE: ./node_modules/@wordpress/plugins/build-module/components/plugin-context/index.js |
320 // CONCATENATED MODULE: ./node_modules/@wordpress/plugins/build-module/components/plugin-context/index.js |
328 |
321 |
329 |
322 |
330 |
323 |
331 /** |
324 /** |
332 * WordPress dependencies |
325 * WordPress dependencies |
333 */ |
326 */ |
334 |
327 |
335 |
328 |
336 |
329 const { |
337 var _createContext = Object(external_this_wp_element_["createContext"])({ |
330 Consumer, |
|
331 Provider |
|
332 } = Object(external_wp_element_["createContext"])({ |
338 name: null, |
333 name: null, |
339 icon: null |
334 icon: null |
340 }), |
335 }); |
341 Consumer = _createContext.Consumer, |
|
342 Provider = _createContext.Provider; |
|
343 |
|
344 |
336 |
345 /** |
337 /** |
346 * A Higher Order Component used to inject Plugin context to the |
338 * A Higher Order Component used to inject Plugin context to the |
347 * wrapped component. |
339 * wrapped component. |
348 * |
340 * |
351 * merge with the component's own props. |
343 * merge with the component's own props. |
352 * |
344 * |
353 * @return {WPComponent} Enhanced component with injected context as props. |
345 * @return {WPComponent} Enhanced component with injected context as props. |
354 */ |
346 */ |
355 |
347 |
356 var plugin_context_withPluginContext = function withPluginContext(mapContextToProps) { |
348 const withPluginContext = mapContextToProps => Object(external_wp_compose_["createHigherOrderComponent"])(OriginalComponent => { |
357 return Object(external_this_wp_compose_["createHigherOrderComponent"])(function (OriginalComponent) { |
349 return props => Object(external_wp_element_["createElement"])(Consumer, null, context => Object(external_wp_element_["createElement"])(OriginalComponent, Object(esm_extends["a" /* default */])({}, props, mapContextToProps(context, props)))); |
358 return function (props) { |
350 }, 'withPluginContext'); |
359 return Object(external_this_wp_element_["createElement"])(Consumer, null, function (context) { |
351 |
360 return Object(external_this_wp_element_["createElement"])(OriginalComponent, Object(esm_extends["a" /* default */])({}, props, mapContextToProps(context, props))); |
352 // EXTERNAL MODULE: external ["wp","primitives"] |
361 }); |
353 var external_wp_primitives_ = __webpack_require__("Tqx9"); |
362 }; |
354 |
363 }, 'withPluginContext'); |
355 // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/plugins.js |
364 }; |
356 |
365 |
357 |
366 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js |
358 /** |
367 var defineProperty = __webpack_require__(5); |
359 * WordPress dependencies |
368 |
360 */ |
369 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js |
361 |
370 var esm_typeof = __webpack_require__(40); |
362 const plugins = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], { |
371 |
363 xmlns: "http://www.w3.org/2000/svg", |
372 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/plugins.js |
364 viewBox: "0 0 24 24" |
373 var plugins = __webpack_require__(420); |
365 }, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], { |
|
366 d: "M10.5 4v4h3V4H15v4h1.5a1 1 0 011 1v4l-3 4v2a1 1 0 01-1 1h-3a1 1 0 01-1-1v-2l-3-4V9a1 1 0 011-1H9V4h1.5zm.5 12.5v2h2v-2l3-4v-3H8v3l3 4z" |
|
367 })); |
|
368 /* harmony default export */ var library_plugins = (plugins); |
374 |
369 |
375 // CONCATENATED MODULE: ./node_modules/@wordpress/plugins/build-module/api/index.js |
370 // CONCATENATED MODULE: ./node_modules/@wordpress/plugins/build-module/api/index.js |
376 |
|
377 |
|
378 |
|
379 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; } |
|
380 |
|
381 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; } |
|
382 |
|
383 /* eslint no-console: [ 'error', { allow: [ 'error' ] } ] */ |
371 /* eslint no-console: [ 'error', { allow: [ 'error' ] } ] */ |
384 |
372 |
385 /** |
373 /** |
386 * WordPress dependencies |
374 * WordPress dependencies |
387 */ |
375 */ |
485 * ); |
473 * ); |
486 * |
474 * |
487 * registerPlugin( 'plugin-name', { |
475 * registerPlugin( 'plugin-name', { |
488 * icon: more, |
476 * icon: more, |
489 * render: Component, |
477 * render: Component, |
|
478 * scope: 'my-page', |
490 * } ); |
479 * } ); |
491 * ``` |
480 * ``` |
492 * |
481 * |
493 * @return {WPPlugin} The final plugin settings object. |
482 * @return {WPPlugin} The final plugin settings object. |
494 */ |
483 */ |
495 |
484 |
496 function registerPlugin(name, settings) { |
485 function registerPlugin(name, settings) { |
497 if (Object(esm_typeof["a" /* default */])(settings) !== 'object') { |
486 if (typeof settings !== 'object') { |
498 console.error('No settings object provided!'); |
487 console.error('No settings object provided!'); |
499 return null; |
488 return null; |
500 } |
489 } |
501 |
490 |
502 if (typeof name !== 'string') { |
491 if (typeof name !== 'string') { |
503 console.error('Plugin names must be strings.'); |
492 console.error('Plugin name must be string.'); |
504 return null; |
493 return null; |
505 } |
494 } |
506 |
495 |
507 if (!/^[a-z][a-z0-9-]*$/.test(name)) { |
496 if (!/^[a-z][a-z0-9-]*$/.test(name)) { |
508 console.error('Plugin names must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-plugin".'); |
497 console.error('Plugin name must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-plugin".'); |
509 return null; |
498 return null; |
510 } |
499 } |
511 |
500 |
512 if (api_plugins[name]) { |
501 if (api_plugins[name]) { |
513 console.error("Plugin \"".concat(name, "\" is already registered.")); |
502 console.error(`Plugin "${name}" is already registered.`); |
514 } |
503 } |
515 |
504 |
516 settings = Object(external_this_wp_hooks_["applyFilters"])('plugins.registerPlugin', settings, name); |
505 settings = Object(external_wp_hooks_["applyFilters"])('plugins.registerPlugin', settings, name); |
517 |
506 const { |
518 if (!Object(external_this_lodash_["isFunction"])(settings.render)) { |
507 render, |
|
508 scope |
|
509 } = settings; |
|
510 |
|
511 if (!Object(external_lodash_["isFunction"])(render)) { |
519 console.error('The "render" property must be specified and must be a valid function.'); |
512 console.error('The "render" property must be specified and must be a valid function.'); |
520 return null; |
513 return null; |
521 } |
514 } |
522 |
515 |
523 api_plugins[name] = _objectSpread({ |
516 if (scope) { |
524 name: name, |
517 if (typeof scope !== 'string') { |
525 icon: plugins["a" /* default */] |
518 console.error('Plugin scope must be string.'); |
526 }, settings); |
519 return null; |
527 Object(external_this_wp_hooks_["doAction"])('plugins.pluginRegistered', settings, name); |
520 } |
|
521 |
|
522 if (!/^[a-z][a-z0-9-]*$/.test(scope)) { |
|
523 console.error('Plugin scope must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-page".'); |
|
524 return null; |
|
525 } |
|
526 } |
|
527 |
|
528 api_plugins[name] = { |
|
529 name, |
|
530 icon: library_plugins, |
|
531 ...settings |
|
532 }; |
|
533 Object(external_wp_hooks_["doAction"])('plugins.pluginRegistered', settings, name); |
528 return settings; |
534 return settings; |
529 } |
535 } |
530 /** |
536 /** |
531 * Unregisters a plugin by name. |
537 * Unregisters a plugin by name. |
532 * |
538 * |
533 * @param {string} name Plugin name. |
539 * @param {string} name Plugin name. |
534 * |
540 * |
535 * @example |
541 * @example |
536 * <caption>ES5</caption> |
|
537 * ```js |
542 * ```js |
538 * // Using ES5 syntax |
543 * // Using ES5 syntax |
539 * var unregisterPlugin = wp.plugins.unregisterPlugin; |
544 * var unregisterPlugin = wp.plugins.unregisterPlugin; |
540 * |
545 * |
541 * unregisterPlugin( 'plugin-name' ); |
546 * unregisterPlugin( 'plugin-name' ); |
542 * ``` |
547 * ``` |
543 * |
548 * |
544 * @example |
549 * @example |
545 * <caption>ESNext</caption> |
|
546 * ```js |
550 * ```js |
547 * // Using ESNext syntax |
551 * // Using ESNext syntax |
548 * import { unregisterPlugin } from '@wordpress/plugins'; |
552 * import { unregisterPlugin } from '@wordpress/plugins'; |
549 * |
553 * |
550 * unregisterPlugin( 'plugin-name' ); |
554 * unregisterPlugin( 'plugin-name' ); |
617 |
615 |
618 /** |
616 /** |
619 * A component that renders all plugin fills in a hidden div. |
617 * A component that renders all plugin fills in a hidden div. |
620 * |
618 * |
621 * @example |
619 * @example |
622 * <caption>ES5</caption> |
|
623 * ```js |
620 * ```js |
624 * // Using ES5 syntax |
621 * // Using ES5 syntax |
625 * var el = wp.element.createElement; |
622 * var el = wp.element.createElement; |
626 * var PluginArea = wp.plugins.PluginArea; |
623 * var PluginArea = wp.plugins.PluginArea; |
627 * |
624 * |
628 * function Layout() { |
625 * function Layout() { |
629 * return el( |
626 * return el( |
630 * 'div', |
627 * 'div', |
631 * {}, |
628 * { scope: 'my-page' }, |
632 * 'Content of the page', |
629 * 'Content of the page', |
633 * PluginArea |
630 * PluginArea |
634 * ); |
631 * ); |
635 * } |
632 * } |
636 * ``` |
633 * ``` |
637 * |
634 * |
638 * @example |
635 * @example |
639 * <caption>ESNext</caption> |
|
640 * ```js |
636 * ```js |
641 * // Using ESNext syntax |
637 * // Using ESNext syntax |
642 * import { PluginArea } from '@wordpress/plugins'; |
638 * import { PluginArea } from '@wordpress/plugins'; |
643 * |
639 * |
644 * const Layout = () => ( |
640 * const Layout = () => ( |
645 * <div> |
641 * <div> |
646 * Content of the page |
642 * Content of the page |
647 * <PluginArea /> |
643 * <PluginArea scope="my-page" /> |
648 * </div> |
644 * </div> |
649 * ); |
645 * ); |
650 * ``` |
646 * ``` |
651 * |
647 * |
652 * @return {WPComponent} The component to be rendered. |
648 * @return {WPComponent} The component to be rendered. |
653 */ |
649 */ |
654 |
650 |
655 var plugin_area_PluginArea = /*#__PURE__*/function (_Component) { |
651 class plugin_area_PluginArea extends external_wp_element_["Component"] { |
656 Object(inherits["a" /* default */])(PluginArea, _Component); |
652 constructor() { |
657 |
653 super(...arguments); |
658 var _super = _createSuper(PluginArea); |
654 this.setPlugins = this.setPlugins.bind(this); |
659 |
655 this.memoizedContext = memize_default()((name, icon) => { |
660 function PluginArea() { |
|
661 var _this; |
|
662 |
|
663 Object(classCallCheck["a" /* default */])(this, PluginArea); |
|
664 |
|
665 _this = _super.apply(this, arguments); |
|
666 _this.setPlugins = _this.setPlugins.bind(Object(assertThisInitialized["a" /* default */])(_this)); |
|
667 _this.state = _this.getCurrentPluginsState(); |
|
668 return _this; |
|
669 } |
|
670 |
|
671 Object(createClass["a" /* default */])(PluginArea, [{ |
|
672 key: "getCurrentPluginsState", |
|
673 value: function getCurrentPluginsState() { |
|
674 return { |
656 return { |
675 plugins: Object(external_this_lodash_["map"])(getPlugins(), function (_ref) { |
657 name, |
676 var icon = _ref.icon, |
658 icon |
677 name = _ref.name, |
|
678 render = _ref.render; |
|
679 return { |
|
680 Plugin: render, |
|
681 context: { |
|
682 name: name, |
|
683 icon: icon |
|
684 } |
|
685 }; |
|
686 }) |
|
687 }; |
659 }; |
688 } |
660 }); |
689 }, { |
661 this.state = this.getCurrentPluginsState(); |
690 key: "componentDidMount", |
662 } |
691 value: function componentDidMount() { |
663 |
692 Object(external_this_wp_hooks_["addAction"])('plugins.pluginRegistered', 'core/plugins/plugin-area/plugins-registered', this.setPlugins); |
664 getCurrentPluginsState() { |
693 Object(external_this_wp_hooks_["addAction"])('plugins.pluginUnregistered', 'core/plugins/plugin-area/plugins-unregistered', this.setPlugins); |
665 return { |
694 } |
666 plugins: Object(external_lodash_["map"])(getPlugins(this.props.scope), ({ |
695 }, { |
667 icon, |
696 key: "componentWillUnmount", |
668 name, |
697 value: function componentWillUnmount() { |
669 render |
698 Object(external_this_wp_hooks_["removeAction"])('plugins.pluginRegistered', 'core/plugins/plugin-area/plugins-registered'); |
670 }) => { |
699 Object(external_this_wp_hooks_["removeAction"])('plugins.pluginUnregistered', 'core/plugins/plugin-area/plugins-unregistered'); |
671 return { |
700 } |
672 Plugin: render, |
701 }, { |
673 context: this.memoizedContext(name, icon) |
702 key: "setPlugins", |
674 }; |
703 value: function setPlugins() { |
675 }) |
704 this.setState(this.getCurrentPluginsState); |
676 }; |
705 } |
677 } |
706 }, { |
678 |
707 key: "render", |
679 componentDidMount() { |
708 value: function render() { |
680 Object(external_wp_hooks_["addAction"])('plugins.pluginRegistered', 'core/plugins/plugin-area/plugins-registered', this.setPlugins); |
709 return Object(external_this_wp_element_["createElement"])("div", { |
681 Object(external_wp_hooks_["addAction"])('plugins.pluginUnregistered', 'core/plugins/plugin-area/plugins-unregistered', this.setPlugins); |
710 style: { |
682 } |
711 display: 'none' |
683 |
712 } |
684 componentWillUnmount() { |
713 }, Object(external_this_lodash_["map"])(this.state.plugins, function (_ref2) { |
685 Object(external_wp_hooks_["removeAction"])('plugins.pluginRegistered', 'core/plugins/plugin-area/plugins-registered'); |
714 var context = _ref2.context, |
686 Object(external_wp_hooks_["removeAction"])('plugins.pluginUnregistered', 'core/plugins/plugin-area/plugins-unregistered'); |
715 Plugin = _ref2.Plugin; |
687 } |
716 return Object(external_this_wp_element_["createElement"])(Provider, { |
688 |
717 key: context.name, |
689 setPlugins() { |
718 value: context |
690 this.setState(this.getCurrentPluginsState); |
719 }, Object(external_this_wp_element_["createElement"])(Plugin, null)); |
691 } |
720 })); |
692 |
721 } |
693 render() { |
722 }]); |
694 return Object(external_wp_element_["createElement"])("div", { |
723 |
695 style: { |
724 return PluginArea; |
696 display: 'none' |
725 }(external_this_wp_element_["Component"]); |
697 } |
|
698 }, Object(external_lodash_["map"])(this.state.plugins, ({ |
|
699 context, |
|
700 Plugin |
|
701 }) => Object(external_wp_element_["createElement"])(Provider, { |
|
702 key: context.name, |
|
703 value: context |
|
704 }, Object(external_wp_element_["createElement"])(Plugin, null)))); |
|
705 } |
|
706 |
|
707 } |
726 |
708 |
727 /* harmony default export */ var plugin_area = (plugin_area_PluginArea); |
709 /* harmony default export */ var plugin_area = (plugin_area_PluginArea); |
728 |
710 |
729 // CONCATENATED MODULE: ./node_modules/@wordpress/plugins/build-module/components/index.js |
711 // CONCATENATED MODULE: ./node_modules/@wordpress/plugins/build-module/components/index.js |
730 |
712 |