88 __webpack_require__.r(resolvers_namespaceObject); |
88 __webpack_require__.r(resolvers_namespaceObject); |
89 __webpack_require__.d(resolvers_namespaceObject, { |
89 __webpack_require__.d(resolvers_namespaceObject, { |
90 getDownloadableBlocks: () => (resolvers_getDownloadableBlocks) |
90 getDownloadableBlocks: () => (resolvers_getDownloadableBlocks) |
91 }); |
91 }); |
92 |
92 |
93 ;// CONCATENATED MODULE: external ["wp","plugins"] |
93 ;// external ["wp","plugins"] |
94 const external_wp_plugins_namespaceObject = window["wp"]["plugins"]; |
94 const external_wp_plugins_namespaceObject = window["wp"]["plugins"]; |
95 ;// CONCATENATED MODULE: external ["wp","hooks"] |
95 ;// external ["wp","hooks"] |
96 const external_wp_hooks_namespaceObject = window["wp"]["hooks"]; |
96 const external_wp_hooks_namespaceObject = window["wp"]["hooks"]; |
97 ;// CONCATENATED MODULE: external ["wp","blocks"] |
97 ;// external ["wp","blocks"] |
98 const external_wp_blocks_namespaceObject = window["wp"]["blocks"]; |
98 const external_wp_blocks_namespaceObject = window["wp"]["blocks"]; |
99 ;// CONCATENATED MODULE: external ["wp","data"] |
99 ;// external ["wp","data"] |
100 const external_wp_data_namespaceObject = window["wp"]["data"]; |
100 const external_wp_data_namespaceObject = window["wp"]["data"]; |
101 ;// CONCATENATED MODULE: external ["wp","element"] |
101 ;// external ["wp","element"] |
102 const external_wp_element_namespaceObject = window["wp"]["element"]; |
102 const external_wp_element_namespaceObject = window["wp"]["element"]; |
103 ;// CONCATENATED MODULE: external ["wp","editor"] |
103 ;// external ["wp","editor"] |
104 const external_wp_editor_namespaceObject = window["wp"]["editor"]; |
104 const external_wp_editor_namespaceObject = window["wp"]["editor"]; |
105 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/reducer.js |
105 ;// ./node_modules/@wordpress/block-directory/build-module/store/reducer.js |
106 /** |
106 /** |
107 * WordPress dependencies |
107 * WordPress dependencies |
108 */ |
108 */ |
109 |
109 |
110 |
110 |
203 downloadableBlocks, |
203 downloadableBlocks, |
204 blockManagement, |
204 blockManagement, |
205 errorNotices |
205 errorNotices |
206 })); |
206 })); |
207 |
207 |
208 ;// CONCATENATED MODULE: external ["wp","blockEditor"] |
208 ;// external ["wp","blockEditor"] |
209 const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"]; |
209 const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"]; |
210 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/utils/has-block-type.js |
210 ;// ./node_modules/@wordpress/block-directory/build-module/store/selectors.js |
211 /** |
211 /** |
212 * Check if a block list contains a specific block type. Recursively searches |
212 * WordPress dependencies |
213 * through `innerBlocks` if they exist. |
213 */ |
214 * |
214 |
215 * @param {Object} blockType A block object to search for. |
215 |
216 * @param {Object[]} blocks The list of blocks to look through. |
216 const EMPTY_ARRAY = []; |
217 * |
|
218 * @return {boolean} Whether the blockType is found. |
|
219 */ |
|
220 function hasBlockType(blockType, blocks = []) { |
|
221 if (!blocks.length) { |
|
222 return false; |
|
223 } |
|
224 if (blocks.some(({ |
|
225 name |
|
226 }) => name === blockType.name)) { |
|
227 return true; |
|
228 } |
|
229 for (let i = 0; i < blocks.length; i++) { |
|
230 if (hasBlockType(blockType, blocks[i].innerBlocks)) { |
|
231 return true; |
|
232 } |
|
233 } |
|
234 return false; |
|
235 } |
|
236 |
|
237 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/selectors.js |
|
238 /** |
|
239 * WordPress dependencies |
|
240 */ |
|
241 |
|
242 |
|
243 |
|
244 /** |
|
245 * Internal dependencies |
|
246 */ |
|
247 |
|
248 |
217 |
249 /** |
218 /** |
250 * Returns true if application is requesting for downloadable blocks. |
219 * Returns true if application is requesting for downloadable blocks. |
251 * |
220 * |
252 * @param {Object} state Global application state. |
221 * @param {Object} state Global application state. |
290 * |
259 * |
291 * @param {Object} state Global application state. |
260 * @param {Object} state Global application state. |
292 * |
261 * |
293 * @return {Array} Block type items. |
262 * @return {Array} Block type items. |
294 */ |
263 */ |
295 const getNewBlockTypes = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => { |
264 const getNewBlockTypes = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (0,external_wp_data_namespaceObject.createSelector)(state => { |
296 const usedBlockTree = select(external_wp_blockEditor_namespaceObject.store).getBlocks(); |
|
297 const installedBlockTypes = getInstalledBlockTypes(state); |
265 const installedBlockTypes = getInstalledBlockTypes(state); |
298 return installedBlockTypes.filter(blockType => hasBlockType(blockType, usedBlockTree)); |
266 if (!installedBlockTypes.length) { |
299 }); |
267 return EMPTY_ARRAY; |
|
268 } |
|
269 const { |
|
270 getBlockName, |
|
271 getClientIdsWithDescendants |
|
272 } = select(external_wp_blockEditor_namespaceObject.store); |
|
273 const installedBlockNames = installedBlockTypes.map(blockType => blockType.name); |
|
274 const foundBlockNames = getClientIdsWithDescendants().flatMap(clientId => { |
|
275 const blockName = getBlockName(clientId); |
|
276 return installedBlockNames.includes(blockName) ? blockName : []; |
|
277 }); |
|
278 const newBlockTypes = installedBlockTypes.filter(blockType => foundBlockNames.includes(blockType.name)); |
|
279 return newBlockTypes.length > 0 ? newBlockTypes : EMPTY_ARRAY; |
|
280 }, state => [getInstalledBlockTypes(state), select(external_wp_blockEditor_namespaceObject.store).getClientIdsWithDescendants()])); |
300 |
281 |
301 /** |
282 /** |
302 * Returns the block types that have been installed on the server but are not |
283 * Returns the block types that have been installed on the server but are not |
303 * used in the current post. |
284 * used in the current post. |
304 * |
285 * |
305 * @param {Object} state Global application state. |
286 * @param {Object} state Global application state. |
306 * |
287 * |
307 * @return {Array} Block type items. |
288 * @return {Array} Block type items. |
308 */ |
289 */ |
309 const getUnusedBlockTypes = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => { |
290 const getUnusedBlockTypes = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (0,external_wp_data_namespaceObject.createSelector)(state => { |
310 const usedBlockTree = select(external_wp_blockEditor_namespaceObject.store).getBlocks(); |
|
311 const installedBlockTypes = getInstalledBlockTypes(state); |
291 const installedBlockTypes = getInstalledBlockTypes(state); |
312 return installedBlockTypes.filter(blockType => !hasBlockType(blockType, usedBlockTree)); |
292 if (!installedBlockTypes.length) { |
313 }); |
293 return EMPTY_ARRAY; |
|
294 } |
|
295 const { |
|
296 getBlockName, |
|
297 getClientIdsWithDescendants |
|
298 } = select(external_wp_blockEditor_namespaceObject.store); |
|
299 const installedBlockNames = installedBlockTypes.map(blockType => blockType.name); |
|
300 const foundBlockNames = getClientIdsWithDescendants().flatMap(clientId => { |
|
301 const blockName = getBlockName(clientId); |
|
302 return installedBlockNames.includes(blockName) ? blockName : []; |
|
303 }); |
|
304 const unusedBlockTypes = installedBlockTypes.filter(blockType => !foundBlockNames.includes(blockType.name)); |
|
305 return unusedBlockTypes.length > 0 ? unusedBlockTypes : EMPTY_ARRAY; |
|
306 }, state => [getInstalledBlockTypes(state), select(external_wp_blockEditor_namespaceObject.store).getClientIdsWithDescendants()])); |
314 |
307 |
315 /** |
308 /** |
316 * Returns true if a block plugin install is in progress. |
309 * Returns true if a block plugin install is in progress. |
317 * |
310 * |
318 * @param {Object} state Global application state. |
311 * @param {Object} state Global application state. |
345 */ |
338 */ |
346 function getErrorNoticeForBlock(state, blockId) { |
339 function getErrorNoticeForBlock(state, blockId) { |
347 return state.errorNotices[blockId]; |
340 return state.errorNotices[blockId]; |
348 } |
341 } |
349 |
342 |
350 ;// CONCATENATED MODULE: external ["wp","i18n"] |
343 ;// external ["wp","i18n"] |
351 const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; |
344 const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; |
352 ;// CONCATENATED MODULE: external ["wp","apiFetch"] |
345 ;// external ["wp","apiFetch"] |
353 const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"]; |
346 const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"]; |
354 var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject); |
347 var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject); |
355 ;// CONCATENATED MODULE: external ["wp","notices"] |
348 ;// external ["wp","notices"] |
356 const external_wp_notices_namespaceObject = window["wp"]["notices"]; |
349 const external_wp_notices_namespaceObject = window["wp"]["notices"]; |
357 ;// CONCATENATED MODULE: external ["wp","url"] |
350 ;// external ["wp","url"] |
358 const external_wp_url_namespaceObject = window["wp"]["url"]; |
351 const external_wp_url_namespaceObject = window["wp"]["url"]; |
359 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/load-assets.js |
352 ;// ./node_modules/@wordpress/block-directory/build-module/store/load-assets.js |
360 /** |
353 /** |
361 * WordPress dependencies |
354 * WordPress dependencies |
362 */ |
355 */ |
363 |
356 |
364 |
357 |
718 INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM |
711 INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM |
719 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR |
712 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR |
720 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
713 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
721 PERFORMANCE OF THIS SOFTWARE. |
714 PERFORMANCE OF THIS SOFTWARE. |
722 ***************************************************************************** */ |
715 ***************************************************************************** */ |
723 /* global Reflect, Promise, SuppressedError, Symbol */ |
716 /* global Reflect, Promise, SuppressedError, Symbol, Iterator */ |
724 |
717 |
725 var extendStatics = function(d, b) { |
718 var extendStatics = function(d, b) { |
726 extendStatics = Object.setPrototypeOf || |
719 extendStatics = Object.setPrototypeOf || |
727 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || |
720 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || |
728 function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; |
721 function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; |
829 step((generator = generator.apply(thisArg, _arguments || [])).next()); |
822 step((generator = generator.apply(thisArg, _arguments || [])).next()); |
830 }); |
823 }); |
831 } |
824 } |
832 |
825 |
833 function __generator(thisArg, body) { |
826 function __generator(thisArg, body) { |
834 var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; |
827 var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); |
835 return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; |
828 return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; |
836 function verb(n) { return function (v) { return step([n, v]); }; } |
829 function verb(n) { return function (v) { return step([n, v]); }; } |
837 function step(op) { |
830 function step(op) { |
838 if (f) throw new TypeError("Generator is already executing."); |
831 if (f) throw new TypeError("Generator is already executing."); |
839 while (g && (g = 0, op[0] && (_ = 0)), _) try { |
832 while (g && (g = 0, op[0] && (_ = 0)), _) try { |
840 if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; |
833 if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; |
934 } |
927 } |
935 |
928 |
936 function __asyncGenerator(thisArg, _arguments, generator) { |
929 function __asyncGenerator(thisArg, _arguments, generator) { |
937 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); |
930 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); |
938 var g = generator.apply(thisArg, _arguments || []), i, q = []; |
931 var g = generator.apply(thisArg, _arguments || []), i, q = []; |
939 return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; |
932 return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; |
940 function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } |
933 function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } |
|
934 function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } |
941 function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } |
935 function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } |
942 function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } |
936 function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } |
943 function fulfill(value) { resume("next", value); } |
937 function fulfill(value) { resume("next", value); } |
944 function reject(value) { resume("throw", value); } |
938 function reject(value) { resume("throw", value); } |
945 function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } |
939 function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } |
1001 } |
1004 } |
1002 |
1005 |
1003 function __addDisposableResource(env, value, async) { |
1006 function __addDisposableResource(env, value, async) { |
1004 if (value !== null && value !== void 0) { |
1007 if (value !== null && value !== void 0) { |
1005 if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); |
1008 if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); |
1006 var dispose; |
1009 var dispose, inner; |
1007 if (async) { |
1010 if (async) { |
1008 if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); |
1011 if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); |
1009 dispose = value[Symbol.asyncDispose]; |
1012 dispose = value[Symbol.asyncDispose]; |
1010 } |
1013 } |
1011 if (dispose === void 0) { |
1014 if (dispose === void 0) { |
1012 if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); |
1015 if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); |
1013 dispose = value[Symbol.dispose]; |
1016 dispose = value[Symbol.dispose]; |
|
1017 if (async) inner = dispose; |
1014 } |
1018 } |
1015 if (typeof dispose !== "function") throw new TypeError("Object not disposable."); |
1019 if (typeof dispose !== "function") throw new TypeError("Object not disposable."); |
|
1020 if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; |
1016 env.stack.push({ value: value, dispose: dispose, async: async }); |
1021 env.stack.push({ value: value, dispose: dispose, async: async }); |
1017 } |
1022 } |
1018 else if (async) { |
1023 else if (async) { |
1019 env.stack.push({ async: true }); |
1024 env.stack.push({ async: true }); |
1020 } |
1025 } |
1029 function __disposeResources(env) { |
1034 function __disposeResources(env) { |
1030 function fail(e) { |
1035 function fail(e) { |
1031 env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; |
1036 env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; |
1032 env.hasError = true; |
1037 env.hasError = true; |
1033 } |
1038 } |
|
1039 var r, s = 0; |
1034 function next() { |
1040 function next() { |
1035 while (env.stack.length) { |
1041 while (r = env.stack.pop()) { |
1036 var rec = env.stack.pop(); |
|
1037 try { |
1042 try { |
1038 var result = rec.dispose && rec.dispose.call(rec.value); |
1043 if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); |
1039 if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); |
1044 if (r.dispose) { |
|
1045 var result = r.dispose.call(r.value); |
|
1046 if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); |
|
1047 } |
|
1048 else s |= 1; |
1040 } |
1049 } |
1041 catch (e) { |
1050 catch (e) { |
1042 fail(e); |
1051 fail(e); |
1043 } |
1052 } |
1044 } |
1053 } |
|
1054 if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); |
1045 if (env.hasError) throw env.error; |
1055 if (env.hasError) throw env.error; |
1046 } |
1056 } |
1047 return next(); |
1057 return next(); |
|
1058 } |
|
1059 |
|
1060 function __rewriteRelativeImportExtension(path, preserveJsx) { |
|
1061 if (typeof path === "string" && /^\.\.?\//.test(path)) { |
|
1062 return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) { |
|
1063 return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js"); |
|
1064 }); |
|
1065 } |
|
1066 return path; |
1048 } |
1067 } |
1049 |
1068 |
1050 /* harmony default export */ const tslib_es6 = ({ |
1069 /* harmony default export */ const tslib_es6 = ({ |
1051 __extends, |
1070 __extends, |
1052 __assign, |
1071 __assign, |
1053 __rest, |
1072 __rest, |
1054 __decorate, |
1073 __decorate, |
1055 __param, |
1074 __param, |
|
1075 __esDecorate, |
|
1076 __runInitializers, |
|
1077 __propKey, |
|
1078 __setFunctionName, |
1056 __metadata, |
1079 __metadata, |
1057 __awaiter, |
1080 __awaiter, |
1058 __generator, |
1081 __generator, |
1059 __createBinding, |
1082 __createBinding, |
1060 __exportStar, |
1083 __exportStar, |
1303 } |
1329 } |
1304 }, [shouldRemoveBlockTypes]); |
1330 }, [shouldRemoveBlockTypes]); |
1305 return null; |
1331 return null; |
1306 } |
1332 } |
1307 |
1333 |
1308 ;// CONCATENATED MODULE: external ["wp","compose"] |
1334 ;// external ["wp","compose"] |
1309 const external_wp_compose_namespaceObject = window["wp"]["compose"]; |
1335 const external_wp_compose_namespaceObject = window["wp"]["compose"]; |
1310 ;// CONCATENATED MODULE: external ["wp","components"] |
1336 ;// external ["wp","components"] |
1311 const external_wp_components_namespaceObject = window["wp"]["components"]; |
1337 const external_wp_components_namespaceObject = window["wp"]["components"]; |
1312 ;// CONCATENATED MODULE: external ["wp","coreData"] |
1338 ;// external ["wp","coreData"] |
1313 const external_wp_coreData_namespaceObject = window["wp"]["coreData"]; |
1339 const external_wp_coreData_namespaceObject = window["wp"]["coreData"]; |
1314 ;// CONCATENATED MODULE: external ["wp","htmlEntities"] |
1340 ;// ./node_modules/clsx/dist/clsx.mjs |
|
1341 function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f)}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}/* harmony default export */ const dist_clsx = (clsx); |
|
1342 ;// external ["wp","htmlEntities"] |
1315 const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"]; |
1343 const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"]; |
1316 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js |
1344 ;// ./node_modules/@wordpress/icons/build-module/icon/index.js |
1317 /** |
1345 /** |
1318 * WordPress dependencies |
1346 * WordPress dependencies |
1319 */ |
1347 */ |
1320 |
1348 |
1321 |
1349 |
1410 const stars = Math.round(rating / 0.5) * 0.5; |
1437 const stars = Math.round(rating / 0.5) * 0.5; |
1411 const fullStarCount = Math.floor(rating); |
1438 const fullStarCount = Math.floor(rating); |
1412 const halfStarCount = Math.ceil(rating - fullStarCount); |
1439 const halfStarCount = Math.ceil(rating - fullStarCount); |
1413 const emptyStarCount = 5 - (fullStarCount + halfStarCount); |
1440 const emptyStarCount = 5 - (fullStarCount + halfStarCount); |
1414 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", { |
1441 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", { |
1415 "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: number of stars. */ |
1442 "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: number of stars. */ |
1416 (0,external_wp_i18n_namespaceObject.__)('%s out of 5 stars'), stars), |
1443 (0,external_wp_i18n_namespaceObject.__)('%s out of 5 stars'), stars), |
1417 children: [Array.from({ |
1444 children: [Array.from({ |
1418 length: fullStarCount |
1445 length: fullStarCount |
1419 }).map((_, i) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(icon, { |
1446 }).map((_, i) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(icon, { |
1420 className: "block-directory-block-ratings__star-full", |
1447 className: "block-directory-block-ratings__star-full", |
1553 isInstalled, |
1566 isInstalled, |
1554 isInstalling |
1567 isInstalling |
1555 }) { |
1568 }) { |
1556 const stars = Math.round(rating / 0.5) * 0.5; |
1569 const stars = Math.round(rating / 0.5) * 0.5; |
1557 if (!isInstalled && hasNotice) { |
1570 if (!isInstalled && hasNotice) { |
1558 /* translators: %1$s: block title */ |
1571 /* translators: %s: block title */ |
1559 return (0,external_wp_i18n_namespaceObject.sprintf)('Retry installing %s.', (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)); |
1572 return (0,external_wp_i18n_namespaceObject.sprintf)('Retry installing %s.', (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)); |
1560 } |
1573 } |
1561 if (isInstalled) { |
1574 if (isInstalled) { |
1562 /* translators: %1$s: block title */ |
1575 /* translators: %s: block title */ |
1563 return (0,external_wp_i18n_namespaceObject.sprintf)('Add %s.', (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)); |
1576 return (0,external_wp_i18n_namespaceObject.sprintf)('Add %s.', (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)); |
1564 } |
1577 } |
1565 if (isInstalling) { |
1578 if (isInstalling) { |
1566 /* translators: %1$s: block title */ |
1579 /* translators: %s: block title */ |
1567 return (0,external_wp_i18n_namespaceObject.sprintf)('Installing %s.', (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)); |
1580 return (0,external_wp_i18n_namespaceObject.sprintf)('Installing %s.', (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)); |
1568 } |
1581 } |
1569 |
1582 |
1570 // No ratings yet, just use the title. |
1583 // No ratings yet, just use the title. |
1571 if (ratingCount < 1) { |
1584 if (ratingCount < 1) { |
1572 /* translators: %1$s: block title */ |
1585 /* translators: %s: block title */ |
1573 return (0,external_wp_i18n_namespaceObject.sprintf)('Install %s.', (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)); |
1586 return (0,external_wp_i18n_namespaceObject.sprintf)('Install %s.', (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)); |
1574 } |
1587 } |
1575 return (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %1$s: block title, %2$s: average rating, %3$s: total ratings count. */ |
1588 return (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: block title, 2: average rating, 3: total ratings count. */ |
1576 (0,external_wp_i18n_namespaceObject._n)('Install %1$s. %2$s stars with %3$s review.', 'Install %1$s. %2$s stars with %3$s reviews.', ratingCount), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title), stars, ratingCount); |
1589 (0,external_wp_i18n_namespaceObject._n)('Install %1$s. %2$s stars with %3$s review.', 'Install %1$s. %2$s stars with %3$s reviews.', ratingCount), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title), stars, ratingCount); |
1577 } |
1590 } |
1578 function DownloadableBlockListItem({ |
1591 function DownloadableBlockListItem({ |
1579 composite, |
|
1580 item, |
1592 item, |
1581 onClick |
1593 onClick |
1582 }) { |
1594 }) { |
1583 const { |
1595 const { |
1584 author, |
1596 author, |
1610 if (isInstalled) { |
1622 if (isInstalled) { |
1611 statusText = (0,external_wp_i18n_namespaceObject.__)('Installed!'); |
1623 statusText = (0,external_wp_i18n_namespaceObject.__)('Installed!'); |
1612 } else if (isInstalling) { |
1624 } else if (isInstalling) { |
1613 statusText = (0,external_wp_i18n_namespaceObject.__)('Installing…'); |
1625 statusText = (0,external_wp_i18n_namespaceObject.__)('Installing…'); |
1614 } |
1626 } |
1615 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(CompositeItem, { |
1627 const itemLabel = getDownloadableBlockLabel(item, { |
1616 render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { |
1628 hasNotice, |
1617 __experimentalIsFocusable: true, |
1629 isInstalled, |
1618 type: "button", |
1630 isInstalling |
1619 role: "option", |
1631 }); |
1620 className: "block-directory-downloadable-block-list-item", |
1632 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Tooltip, { |
1621 isBusy: isInstalling, |
1633 placement: "top", |
|
1634 text: itemLabel, |
|
1635 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Composite.Item, { |
|
1636 className: dist_clsx('block-directory-downloadable-block-list-item', isInstalling && 'is-installing'), |
|
1637 accessibleWhenDisabled: true, |
|
1638 disabled: isInstalling || !isInstallable, |
1622 onClick: event => { |
1639 onClick: event => { |
1623 event.preventDefault(); |
1640 event.preventDefault(); |
1624 onClick(); |
1641 onClick(); |
1625 }, |
1642 }, |
1626 label: getDownloadableBlockLabel(item, { |
1643 "aria-label": itemLabel, |
1627 hasNotice, |
1644 type: "button", |
1628 isInstalled, |
1645 role: "option", |
1629 isInstalling |
1646 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { |
1630 }), |
1647 className: "block-directory-downloadable-block-list-item__icon", |
1631 showTooltip: true, |
1648 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(downloadable_block_icon, { |
1632 tooltipPosition: "top center" |
1649 icon: icon, |
1633 }), |
1650 title: title |
1634 store: composite, |
1651 }), isInstalling ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { |
1635 disabled: isInstalling || !isInstallable, |
1652 className: "block-directory-downloadable-block-list-item__spinner", |
1636 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { |
1653 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) |
1637 className: "block-directory-downloadable-block-list-item__icon", |
1654 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_ratings, { |
1638 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(downloadable_block_icon, { |
1655 rating: rating |
1639 icon: icon, |
1656 })] |
1640 title: title |
1657 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", { |
1641 }), isInstalling ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { |
1658 className: "block-directory-downloadable-block-list-item__details", |
1642 className: "block-directory-downloadable-block-list-item__spinner", |
1659 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { |
1643 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) |
1660 className: "block-directory-downloadable-block-list-item__title", |
1644 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_ratings, { |
1661 children: (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: block title. 2: author name. */ |
1645 rating: rating |
1662 (0,external_wp_i18n_namespaceObject.__)('%1$s <span>by %2$s</span>'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title), author), { |
1646 })] |
1663 span: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { |
1647 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", { |
1664 className: "block-directory-downloadable-block-list-item__author" |
1648 className: "block-directory-downloadable-block-list-item__details", |
1665 }) |
1649 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { |
|
1650 className: "block-directory-downloadable-block-list-item__title", |
|
1651 children: (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %1$s: block title, %2$s: author name. */ |
|
1652 (0,external_wp_i18n_namespaceObject.__)('%1$s <span>by %2$s</span>'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title), author), { |
|
1653 span: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { |
|
1654 className: "block-directory-downloadable-block-list-item__author" |
|
1655 }) |
1666 }) |
1656 }) |
1667 }), hasNotice ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(downloadable_block_notice, { |
1657 }), hasNotice ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(downloadable_block_notice, { |
1668 block: item |
1658 block: item |
1669 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
1659 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
1670 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { |
1660 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { |
1671 className: "block-directory-downloadable-block-list-item__desc", |
1661 className: "block-directory-downloadable-block-list-item__desc", |
1672 children: !!statusText ? statusText : (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(description) |
1662 children: !!statusText ? statusText : (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(description) |
1673 }), isInstallable && !(isInstalled || isInstalling) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { |
1663 }), isInstallable && !(isInstalled || isInstalling) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { |
1674 children: (0,external_wp_i18n_namespaceObject.__)('Install block') |
1664 children: (0,external_wp_i18n_namespaceObject.__)('Install block') |
1675 })] |
1665 })] |
1676 })] |
1666 })] |
1677 })] |
1667 })] |
1678 }) |
1668 }); |
1679 }); |
1669 } |
1680 } |
1670 /* harmony default export */ const downloadable_block_list_item = (DownloadableBlockListItem); |
1681 /* harmony default export */ const downloadable_block_list_item = (DownloadableBlockListItem); |
1671 |
1682 |
1672 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-blocks-list/index.js |
1683 ;// ./node_modules/@wordpress/block-directory/build-module/components/downloadable-blocks-list/index.js |
1673 /** |
1684 /** |
1674 * WordPress dependencies |
1685 * WordPress dependencies |
1675 */ |
1686 */ |
1676 |
1687 |
1677 |
1688 |
1682 * Internal dependencies |
1693 * Internal dependencies |
1683 */ |
1694 */ |
1684 |
1695 |
1685 |
1696 |
1686 |
1697 |
1687 |
|
1688 const { |
|
1689 CompositeV2: Composite, |
|
1690 useCompositeStoreV2: useCompositeStore |
|
1691 } = unlock(external_wp_components_namespaceObject.privateApis); |
|
1692 const noop = () => {}; |
1698 const noop = () => {}; |
1693 function DownloadableBlocksList({ |
1699 function DownloadableBlocksList({ |
1694 items, |
1700 items, |
1695 onHover = noop, |
1701 onHover = noop, |
1696 onSelect |
1702 onSelect |
1697 }) { |
1703 }) { |
1698 const composite = useCompositeStore(); |
|
1699 const { |
1704 const { |
1700 installBlockType |
1705 installBlockType |
1701 } = (0,external_wp_data_namespaceObject.useDispatch)(store); |
1706 } = (0,external_wp_data_namespaceObject.useDispatch)(store); |
1702 if (!items.length) { |
1707 if (!items.length) { |
1703 return null; |
1708 return null; |
1704 } |
1709 } |
1705 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Composite, { |
1710 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Composite, { |
1706 store: composite, |
|
1707 role: "listbox", |
1711 role: "listbox", |
1708 className: "block-directory-downloadable-blocks-list", |
1712 className: "block-directory-downloadable-blocks-list", |
1709 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Blocks available for install'), |
1713 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Blocks available for install'), |
1710 children: items.map(item => { |
1714 children: items.map(item => { |
1711 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(downloadable_block_list_item, { |
1715 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(downloadable_block_list_item, { |
1712 composite: composite, |
|
1713 onClick: () => { |
1716 onClick: () => { |
1714 // Check if the block is registered (`getBlockType` |
1717 // Check if the block is registered (`getBlockType` |
1715 // will return an object). If so, insert the block. |
1718 // will return an object). If so, insert the block. |
1716 // This prevents installing existing plugins. |
1719 // This prevents installing existing plugins. |
1717 if ((0,external_wp_blocks_namespaceObject.getBlockType)(item.name)) { |
1720 if ((0,external_wp_blocks_namespaceObject.getBlockType)(item.name)) { |
1750 downloadableItems, |
1751 downloadableItems, |
1751 hasLocalBlocks |
1752 hasLocalBlocks |
1752 }) { |
1753 }) { |
1753 const count = downloadableItems.length; |
1754 const count = downloadableItems.length; |
1754 (0,external_wp_element_namespaceObject.useEffect)(() => { |
1755 (0,external_wp_element_namespaceObject.useEffect)(() => { |
1755 (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %d: number of available blocks. */ |
1756 (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %d: number of available blocks. */ |
1756 (0,external_wp_i18n_namespaceObject._n)('%d additional block is available to install.', '%d additional blocks are available to install.', count), count)); |
1757 (0,external_wp_i18n_namespaceObject._n)('%d additional block is available to install.', '%d additional blocks are available to install.', count), count)); |
1757 }, [count]); |
1758 }, [count]); |
1758 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
1759 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
1759 children: [!hasLocalBlocks && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { |
1760 children: [!hasLocalBlocks && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { |
1760 className: "block-directory-downloadable-blocks-panel__no-local", |
1761 className: "block-directory-downloadable-blocks-panel__no-local", |
1776 })] |
1777 })] |
1777 }); |
1778 }); |
1778 } |
1779 } |
1779 /* harmony default export */ const inserter_panel = (DownloadableBlocksInserterPanel); |
1780 /* harmony default export */ const inserter_panel = (DownloadableBlocksInserterPanel); |
1780 |
1781 |
1781 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/block-default.js |
1782 ;// ./node_modules/@wordpress/block-directory/build-module/components/downloadable-blocks-panel/no-results.js |
1782 /** |
1783 /** |
1783 * WordPress dependencies |
1784 * WordPress dependencies |
1784 */ |
1785 */ |
1785 |
|
1786 |
|
1787 const blockDefault = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { |
|
1788 xmlns: "http://www.w3.org/2000/svg", |
|
1789 viewBox: "0 0 24 24", |
|
1790 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { |
|
1791 d: "M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z" |
|
1792 }) |
|
1793 }); |
|
1794 /* harmony default export */ const block_default = (blockDefault); |
|
1795 |
|
1796 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-blocks-panel/no-results.js |
|
1797 /** |
|
1798 * WordPress dependencies |
|
1799 */ |
|
1800 |
|
1801 |
|
1802 |
|
1803 |
1786 |
1804 |
1787 |
1805 |
1788 |
1806 function DownloadableBlocksNoResults() { |
1789 function DownloadableBlocksNoResults() { |
1807 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
1790 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
1808 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { |
1791 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { |
1809 className: "block-editor-inserter__no-results", |
1792 className: "block-editor-inserter__no-results", |
1810 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(icon, { |
1793 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { |
1811 className: "block-editor-inserter__no-results-icon", |
|
1812 icon: block_default |
|
1813 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { |
|
1814 children: (0,external_wp_i18n_namespaceObject.__)('No results found.') |
1794 children: (0,external_wp_i18n_namespaceObject.__)('No results found.') |
1815 })] |
1795 }) |
1816 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { |
1796 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { |
1817 className: "block-editor-inserter__tips", |
1797 className: "block-editor-inserter__tips", |
1818 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Tip, { |
1798 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Tip, { |
1819 children: [(0,external_wp_i18n_namespaceObject.__)('Interested in creating your own block?'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("br", {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.ExternalLink, { |
1799 children: [(0,external_wp_i18n_namespaceObject.__)('Interested in creating your own block?'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("br", {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.ExternalLink, { |
1820 href: "https://developer.wordpress.org/block-editor/", |
1800 href: "https://developer.wordpress.org/block-editor/", |
2011 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { |
1988 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { |
2012 className: "block-directory-compact-list__item-title", |
1989 className: "block-directory-compact-list__item-title", |
2013 children: title |
1990 children: title |
2014 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { |
1991 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { |
2015 className: "block-directory-compact-list__item-author", |
1992 className: "block-directory-compact-list__item-author", |
2016 children: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: Name of the block author. */ |
1993 children: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Name of the block author. */ |
2017 (0,external_wp_i18n_namespaceObject.__)('By %s'), author) |
1994 (0,external_wp_i18n_namespaceObject.__)('By %s'), author) |
2018 })] |
1995 })] |
2019 })] |
1996 })] |
2020 }, id)) |
1997 }, id)) |
2021 }); |
1998 }); |
2022 } |
1999 } |
2023 |
2000 |
2024 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/installed-blocks-pre-publish-panel/index.js |
2001 ;// ./node_modules/@wordpress/block-directory/build-module/plugins/installed-blocks-pre-publish-panel/index.js |
2025 var _window$wp$editor; |
|
2026 /** |
2002 /** |
2027 * WordPress dependencies |
2003 * WordPress dependencies |
2028 */ |
2004 */ |
2029 |
2005 |
2030 |
2006 |
2034 * Internal dependencies |
2010 * Internal dependencies |
2035 */ |
2011 */ |
2036 |
2012 |
2037 |
2013 |
2038 |
2014 |
2039 // We shouldn't import the editor package directly |
|
2040 // because it would include the wp-editor in all pages loading the block-directory script. |
|
2041 |
|
2042 |
|
2043 const { |
|
2044 PluginPrePublishPanel |
|
2045 } = (_window$wp$editor = window?.wp?.editor) !== null && _window$wp$editor !== void 0 ? _window$wp$editor : {}; |
|
2046 function InstalledBlocksPrePublishPanel() { |
2015 function InstalledBlocksPrePublishPanel() { |
2047 const newBlockTypes = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getNewBlockTypes(), []); |
2016 const newBlockTypes = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getNewBlockTypes(), []); |
2048 if (!newBlockTypes.length) { |
2017 if (!newBlockTypes.length) { |
2049 return null; |
2018 return null; |
2050 } |
2019 } |
2051 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(PluginPrePublishPanel, { |
2020 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_editor_namespaceObject.PluginPrePublishPanel, { |
2052 icon: block_default, |
|
2053 title: (0,external_wp_i18n_namespaceObject.sprintf)( |
2021 title: (0,external_wp_i18n_namespaceObject.sprintf)( |
2054 // translators: %d: number of blocks (number). |
2022 // translators: %d: number of blocks (number). |
2055 (0,external_wp_i18n_namespaceObject._n)('Added: %d block', 'Added: %d blocks', newBlockTypes.length), newBlockTypes.length), |
2023 (0,external_wp_i18n_namespaceObject._n)('Added: %d block', 'Added: %d blocks', newBlockTypes.length), newBlockTypes.length), |
2056 initialOpen: true, |
2024 initialOpen: true, |
2057 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { |
2025 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { |
2089 } = (0,external_wp_data_namespaceObject.useDispatch)(store); |
2057 } = (0,external_wp_data_namespaceObject.useDispatch)(store); |
2090 const { |
2058 const { |
2091 replaceBlock |
2059 replaceBlock |
2092 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); |
2060 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); |
2093 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { |
2061 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { |
|
2062 __next40pxDefaultSize: true, |
2094 onClick: () => installBlockType(block).then(success => { |
2063 onClick: () => installBlockType(block).then(success => { |
2095 if (success) { |
2064 if (success) { |
2096 const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(block.name); |
2065 const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(block.name); |
2097 const [originalBlock] = (0,external_wp_blocks_namespaceObject.parse)(attributes.originalContent); |
2066 const [originalBlock] = (0,external_wp_blocks_namespaceObject.parse)(attributes.originalContent); |
2098 if (originalBlock && blockType) { |
2067 if (originalBlock && blockType) { |
2099 replaceBlock(clientId, (0,external_wp_blocks_namespaceObject.createBlock)(blockType.name, originalBlock.attributes, originalBlock.innerBlocks)); |
2068 replaceBlock(clientId, (0,external_wp_blocks_namespaceObject.createBlock)(blockType.name, originalBlock.attributes, originalBlock.innerBlocks)); |
2100 } |
2069 } |
2101 } |
2070 } |
2102 }), |
2071 }), |
2103 __experimentalIsFocusable: true, |
2072 accessibleWhenDisabled: true, |
2104 disabled: isInstallingBlock, |
2073 disabled: isInstallingBlock, |
2105 isBusy: isInstallingBlock, |
2074 isBusy: isInstallingBlock, |
2106 variant: "primary", |
2075 variant: "primary", |
2107 children: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: block name */ |
2076 children: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: block name */ |
2108 (0,external_wp_i18n_namespaceObject.__)('Install %s'), block.title) |
2077 (0,external_wp_i18n_namespaceObject.__)('Install %s'), block.title) |
2109 }); |
2078 }); |
2110 } |
2079 } |
2111 |
2080 |
2112 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/get-install-missing/index.js |
2081 ;// ./node_modules/@wordpress/block-directory/build-module/plugins/get-install-missing/index.js |
2113 /** |
2082 /** |
2114 * WordPress dependencies |
2083 * WordPress dependencies |
2115 */ |
2084 */ |
2116 |
2085 |
2117 |
2086 |
2184 canInsertBlockType, |
2152 canInsertBlockType, |
2185 getBlockRootClientId |
2153 getBlockRootClientId |
2186 } = select(external_wp_blockEditor_namespaceObject.store); |
2154 } = select(external_wp_blockEditor_namespaceObject.store); |
2187 return canInsertBlockType('core/html', getBlockRootClientId(clientId)); |
2155 return canInsertBlockType('core/html', getBlockRootClientId(clientId)); |
2188 }, [clientId]); |
2156 }, [clientId]); |
2189 let messageHTML = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: block name */ |
2157 let messageHTML = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: block name */ |
2190 (0,external_wp_i18n_namespaceObject.__)('Your site doesn’t include support for the %s block. You can try installing the block or remove it entirely.'), originalBlock.title || originalName); |
2158 (0,external_wp_i18n_namespaceObject.__)('Your site doesn’t include support for the %s block. You can try installing the block or remove it entirely.'), originalBlock.title || originalName); |
2191 const actions = [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InstallButton, { |
2159 const actions = [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InstallButton, { |
2192 block: originalBlock, |
2160 block: originalBlock, |
2193 attributes: props.attributes, |
2161 attributes: props.attributes, |
2194 clientId: props.clientId |
2162 clientId: props.clientId |
2195 }, "install")]; |
2163 }, "install")]; |
2196 if (hasContent && hasHTMLBlock) { |
2164 if (hasContent && hasHTMLBlock) { |
2197 messageHTML = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: block name */ |
2165 messageHTML = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: block name */ |
2198 (0,external_wp_i18n_namespaceObject.__)('Your site doesn’t include support for the %s block. You can try installing the block, convert it to a Custom HTML block, or remove it entirely.'), originalBlock.title || originalName); |
2166 (0,external_wp_i18n_namespaceObject.__)('Your site doesn’t include support for the %s block. You can try installing the block, convert it to a Custom HTML block, or remove it entirely.'), originalBlock.title || originalName); |
2199 actions.push( /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { |
2167 actions.push(/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { |
|
2168 __next40pxDefaultSize: true, |
2200 onClick: convertToHTML, |
2169 onClick: convertToHTML, |
2201 variant: "tertiary", |
2170 variant: "tertiary", |
2202 children: (0,external_wp_i18n_namespaceObject.__)('Keep as HTML') |
2171 children: (0,external_wp_i18n_namespaceObject.__)('Keep as HTML') |
2203 }, "convert")); |
2172 }, "convert")); |
2204 } |
2173 } |