@wordpress/block-directory 6.0.0 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/build/components/auto-block-uninstaller/index.cjs +26 -47
  2. package/build/components/auto-block-uninstaller/index.cjs.map +1 -7
  3. package/build/components/block-ratings/index.cjs +28 -34
  4. package/build/components/block-ratings/index.cjs.map +1 -7
  5. package/build/components/block-ratings/stars.cjs +35 -71
  6. package/build/components/block-ratings/stars.cjs.map +1 -7
  7. package/build/components/compact-list/index.cjs +45 -43
  8. package/build/components/compact-list/index.cjs.map +1 -7
  9. package/build/components/downloadable-block-icon/index.cjs +20 -29
  10. package/build/components/downloadable-block-icon/index.cjs.map +1 -7
  11. package/build/components/downloadable-block-list-item/index.cjs +95 -161
  12. package/build/components/downloadable-block-list-item/index.cjs.map +1 -7
  13. package/build/components/downloadable-block-notice/index.cjs +23 -46
  14. package/build/components/downloadable-block-notice/index.cjs.map +1 -7
  15. package/build/components/downloadable-blocks-list/index.cjs +50 -70
  16. package/build/components/downloadable-blocks-list/index.cjs.map +1 -7
  17. package/build/components/downloadable-blocks-panel/index.cjs +79 -119
  18. package/build/components/downloadable-blocks-panel/index.cjs.map +1 -7
  19. package/build/components/downloadable-blocks-panel/inserter-panel.cjs +37 -61
  20. package/build/components/downloadable-blocks-panel/inserter-panel.cjs.map +1 -7
  21. package/build/components/downloadable-blocks-panel/no-results.cjs +27 -46
  22. package/build/components/downloadable-blocks-panel/no-results.cjs.map +1 -7
  23. package/build/index.cjs +11 -29
  24. package/build/plugins/get-install-missing/index.cjs +80 -122
  25. package/build/plugins/get-install-missing/index.cjs.map +1 -7
  26. package/build/plugins/get-install-missing/install-button.cjs +33 -70
  27. package/build/plugins/get-install-missing/install-button.cjs.map +1 -7
  28. package/build/plugins/index.cjs +45 -45
  29. package/build/plugins/index.cjs.map +1 -7
  30. package/build/plugins/inserter-menu-downloadable-blocks-panel/index.cjs +40 -52
  31. package/build/plugins/inserter-menu-downloadable-blocks-panel/index.cjs.map +1 -7
  32. package/build/plugins/installed-blocks-pre-publish-panel/index.cjs +38 -62
  33. package/build/plugins/installed-blocks-pre-publish-panel/index.cjs.map +1 -7
  34. package/build/store/actions.cjs +233 -205
  35. package/build/store/actions.cjs.map +1 -7
  36. package/build/store/index.cjs +56 -45
  37. package/build/store/index.cjs.map +1 -7
  38. package/build/store/load-assets.cjs +62 -63
  39. package/build/store/load-assets.cjs.map +1 -7
  40. package/build/store/reducer.cjs +90 -101
  41. package/build/store/reducer.cjs.map +1 -7
  42. package/build/store/resolvers.cjs +34 -54
  43. package/build/store/resolvers.cjs.map +1 -7
  44. package/build/store/selectors.cjs +111 -107
  45. package/build/store/selectors.cjs.map +1 -7
  46. package/build/store/utils/get-plugin-url.cjs +19 -32
  47. package/build/store/utils/get-plugin-url.cjs.map +1 -7
  48. package/build-module/components/auto-block-uninstaller/index.mjs +19 -25
  49. package/build-module/components/auto-block-uninstaller/index.mjs.map +1 -7
  50. package/build-module/components/block-ratings/index.mjs +8 -8
  51. package/build-module/components/block-ratings/index.mjs.map +1 -7
  52. package/build-module/components/block-ratings/stars.mjs +28 -49
  53. package/build-module/components/block-ratings/stars.mjs.map +1 -7
  54. package/build-module/components/compact-list/index.mjs +24 -19
  55. package/build-module/components/compact-list/index.mjs.map +1 -7
  56. package/build-module/components/downloadable-block-icon/index.mjs +14 -8
  57. package/build-module/components/downloadable-block-icon/index.mjs.map +1 -7
  58. package/build-module/components/downloadable-block-list-item/index.mjs +64 -130
  59. package/build-module/components/downloadable-block-list-item/index.mjs.map +1 -7
  60. package/build-module/components/downloadable-block-notice/index.mjs +15 -20
  61. package/build-module/components/downloadable-block-notice/index.mjs.map +1 -7
  62. package/build-module/components/downloadable-blocks-list/index.mjs +26 -43
  63. package/build-module/components/downloadable-blocks-list/index.mjs.map +1 -7
  64. package/build-module/components/downloadable-blocks-panel/index.mjs +52 -91
  65. package/build-module/components/downloadable-blocks-panel/index.mjs.map +1 -7
  66. package/build-module/components/downloadable-blocks-panel/inserter-panel.mjs +29 -38
  67. package/build-module/components/downloadable-blocks-panel/inserter-panel.mjs.map +1 -7
  68. package/build-module/components/downloadable-blocks-panel/no-results.mjs +19 -23
  69. package/build-module/components/downloadable-blocks-panel/no-results.mjs.map +1 -7
  70. package/build-module/index.mjs +1 -6
  71. package/build-module/plugins/get-install-missing/index.mjs +55 -98
  72. package/build-module/plugins/get-install-missing/index.mjs.map +1 -7
  73. package/build-module/plugins/get-install-missing/install-button.mjs +25 -47
  74. package/build-module/plugins/get-install-missing/install-button.mjs.map +1 -7
  75. package/build-module/plugins/index.mjs +16 -23
  76. package/build-module/plugins/index.mjs.map +1 -7
  77. package/build-module/plugins/inserter-menu-downloadable-blocks-panel/index.mjs +17 -26
  78. package/build-module/plugins/inserter-menu-downloadable-blocks-panel/index.mjs.map +1 -7
  79. package/build-module/plugins/installed-blocks-pre-publish-panel/index.mjs +15 -36
  80. package/build-module/plugins/installed-blocks-pre-publish-panel/index.mjs.map +1 -7
  81. package/build-module/store/actions.mjs +201 -170
  82. package/build-module/store/actions.mjs.map +1 -7
  83. package/build-module/store/index.mjs +28 -13
  84. package/build-module/store/index.mjs.map +1 -7
  85. package/build-module/store/load-assets.mjs +42 -36
  86. package/build-module/store/load-assets.mjs.map +1 -7
  87. package/build-module/store/reducer.mjs +81 -74
  88. package/build-module/store/reducer.mjs.map +1 -7
  89. package/build-module/store/resolvers.mjs +13 -26
  90. package/build-module/store/resolvers.mjs.map +1 -7
  91. package/build-module/store/selectors.mjs +99 -76
  92. package/build-module/store/selectors.mjs.map +1 -7
  93. package/build-module/store/utils/get-plugin-url.mjs +14 -12
  94. package/build-module/store/utils/get-plugin-url.mjs.map +1 -7
  95. package/build-style/style-rtl.css +6 -12
  96. package/build-style/style.css +6 -12
  97. package/package.json +22 -23
  98. package/src/components/downloadable-block-list-item/style.scss +6 -6
  99. package/build/index.cjs.map +0 -7
  100. package/build/lock-unlock.cjs +0 -36
  101. package/build/lock-unlock.cjs.map +0 -7
  102. package/build-module/index.mjs.map +0 -7
  103. package/build-module/lock-unlock.mjs +0 -11
  104. package/build-module/lock-unlock.mjs.map +0 -7
  105. package/src/lock-unlock.js +0 -7
@@ -1,50 +1,29 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // packages/block-directory/src/components/auto-block-uninstaller/index.js
20
- var auto_block_uninstaller_exports = {};
21
- __export(auto_block_uninstaller_exports, {
22
- default: () => AutoBlockUninstaller
1
+ "use strict";
2
+ Object.defineProperties(exports, {
3
+ __esModule: { value: true },
4
+ [Symbol.toStringTag]: { value: "Module" }
23
5
  });
24
- module.exports = __toCommonJS(auto_block_uninstaller_exports);
25
- var import_blocks = require("@wordpress/blocks");
26
- var import_data = require("@wordpress/data");
27
- var import_element = require("@wordpress/element");
28
- var import_editor = require("@wordpress/editor");
29
- var import_store = require("../../store/index.cjs");
6
+ let _wordpress_blocks = require("@wordpress/blocks");
7
+ let _wordpress_data = require("@wordpress/data");
8
+ let _wordpress_element = require("@wordpress/element");
9
+ let _wordpress_editor = require("@wordpress/editor");
10
+ let ______store_index_js = require("../../store/index.cjs");
11
+ // packages/block-directory/src/components/auto-block-uninstaller/index.js
30
12
  function AutoBlockUninstaller() {
31
- const { uninstallBlockType } = (0, import_data.useDispatch)(import_store.store);
32
- const shouldRemoveBlockTypes = (0, import_data.useSelect)((select) => {
33
- const { isAutosavingPost, isSavingPost } = select(import_editor.store);
34
- return isSavingPost() && !isAutosavingPost();
35
- }, []);
36
- const unusedBlockTypes = (0, import_data.useSelect)(
37
- (select) => select(import_store.store).getUnusedBlockTypes(),
38
- []
39
- );
40
- (0, import_element.useEffect)(() => {
41
- if (shouldRemoveBlockTypes && unusedBlockTypes.length) {
42
- unusedBlockTypes.forEach((blockType) => {
43
- uninstallBlockType(blockType);
44
- (0, import_blocks.unregisterBlockType)(blockType.name);
45
- });
46
- }
47
- }, [shouldRemoveBlockTypes]);
48
- return null;
13
+ const { uninstallBlockType } = (0, _wordpress_data.useDispatch)(______store_index_js.store);
14
+ const shouldRemoveBlockTypes = (0, _wordpress_data.useSelect)((select) => {
15
+ const { isAutosavingPost, isSavingPost } = select(_wordpress_editor.store);
16
+ return isSavingPost() && !isAutosavingPost();
17
+ }, []);
18
+ const unusedBlockTypes = (0, _wordpress_data.useSelect)((select) => select(______store_index_js.store).getUnusedBlockTypes(), []);
19
+ (0, _wordpress_element.useEffect)(() => {
20
+ if (shouldRemoveBlockTypes && unusedBlockTypes.length) unusedBlockTypes.forEach((blockType) => {
21
+ uninstallBlockType(blockType);
22
+ (0, _wordpress_blocks.unregisterBlockType)(blockType.name);
23
+ });
24
+ }, [shouldRemoveBlockTypes]);
25
+ return null;
49
26
  }
50
- //# sourceMappingURL=index.cjs.map
27
+ exports.default = AutoBlockUninstaller;
28
+
29
+ //# sourceMappingURL=index.cjs.map
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/auto-block-uninstaller/index.js"],
4
- "sourcesContent": ["import { unregisterBlockType } from '@wordpress/blocks';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as blockDirectoryStore } from '../../store';\n\nexport default function AutoBlockUninstaller() {\n\tconst { uninstallBlockType } = useDispatch( blockDirectoryStore );\n\n\tconst shouldRemoveBlockTypes = useSelect( ( select ) => {\n\t\tconst { isAutosavingPost, isSavingPost } = select( editorStore );\n\t\treturn isSavingPost() && ! isAutosavingPost();\n\t}, [] );\n\n\tconst unusedBlockTypes = useSelect(\n\t\t( select ) => select( blockDirectoryStore ).getUnusedBlockTypes(),\n\t\t[]\n\t);\n\n\tuseEffect( () => {\n\t\tif ( shouldRemoveBlockTypes && unusedBlockTypes.length ) {\n\t\t\tunusedBlockTypes.forEach( ( blockType ) => {\n\t\t\t\tuninstallBlockType( blockType );\n\t\t\t\tunregisterBlockType( blockType.name );\n\t\t\t} );\n\t\t}\n\t}, [ shouldRemoveBlockTypes ] );\n\n\treturn null;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAoC;AACpC,kBAAuC;AACvC,qBAA0B;AAC1B,oBAAqC;AACrC,mBAA6C;AAE9B,SAAR,uBAAwC;AAC9C,QAAM,EAAE,mBAAmB,QAAI,yBAAa,aAAAA,KAAoB;AAEhE,QAAM,6BAAyB,uBAAW,CAAE,WAAY;AACvD,UAAM,EAAE,kBAAkB,aAAa,IAAI,OAAQ,cAAAC,KAAY;AAC/D,WAAO,aAAa,KAAK,CAAE,iBAAiB;AAAA,EAC7C,GAAG,CAAC,CAAE;AAEN,QAAM,uBAAmB;AAAA,IACxB,CAAE,WAAY,OAAQ,aAAAD,KAAoB,EAAE,oBAAoB;AAAA,IAChE,CAAC;AAAA,EACF;AAEA,gCAAW,MAAM;AAChB,QAAK,0BAA0B,iBAAiB,QAAS;AACxD,uBAAiB,QAAS,CAAE,cAAe;AAC1C,2BAAoB,SAAU;AAC9B,+CAAqB,UAAU,IAAK;AAAA,MACrC,CAAE;AAAA,IACH;AAAA,EACD,GAAG,CAAE,sBAAuB,CAAE;AAE9B,SAAO;AACR;",
6
- "names": ["blockDirectoryStore", "editorStore"]
7
- }
1
+ {"version":3,"file":"index.cjs","names":["useDispatch","blockDirectoryStore","useSelect","editorStore"],"sources":["../../../src/components/auto-block-uninstaller/index.js"],"sourcesContent":["import { unregisterBlockType } from '@wordpress/blocks';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as blockDirectoryStore } from '../../store';\n\nexport default function AutoBlockUninstaller() {\n\tconst { uninstallBlockType } = useDispatch( blockDirectoryStore );\n\n\tconst shouldRemoveBlockTypes = useSelect( ( select ) => {\n\t\tconst { isAutosavingPost, isSavingPost } = select( editorStore );\n\t\treturn isSavingPost() && ! isAutosavingPost();\n\t}, [] );\n\n\tconst unusedBlockTypes = useSelect(\n\t\t( select ) => select( blockDirectoryStore ).getUnusedBlockTypes(),\n\t\t[]\n\t);\n\n\tuseEffect( () => {\n\t\tif ( shouldRemoveBlockTypes && unusedBlockTypes.length ) {\n\t\t\tunusedBlockTypes.forEach( ( blockType ) => {\n\t\t\t\tuninstallBlockType( blockType );\n\t\t\t\tunregisterBlockType( blockType.name );\n\t\t\t} );\n\t\t}\n\t}, [ shouldRemoveBlockTypes ] );\n\n\treturn null;\n}\n"],"mappings":";;;;;;;;;;;AAMA,SAAwB,uBAAuB;CAC9C,MAAM,EAAE,wBAAA,GAAuBA,gBAAAA,YAAAA,CAAaC,qBAAAA,KAAoB;CAEhE,MAAM,0BAAA,GAAyBC,gBAAAA,UAAAA,EAAa,WAAY;EACvD,MAAM,EAAE,kBAAkB,iBAAiB,OAAQC,kBAAAA,KAAY;EAC/D,OAAO,aAAa,KAAK,CAAE,iBAAiB;CAC7C,GAAG,CAAC,CAAE;CAEN,MAAM,oBAAA,GAAmBD,gBAAAA,UAAAA,EACtB,WAAY,OAAQD,qBAAAA,KAAoB,CAAC,CAAC,oBAAoB,GAChE,CAAC,CACF;CAEA,CAAA,GAAA,mBAAA,UAAA,OAAiB;EAChB,IAAK,0BAA0B,iBAAiB,QAC/C,iBAAiB,SAAW,cAAe;GAC1C,mBAAoB,SAAU;GAC9B,CAAA,GAAA,kBAAA,oBAAA,CAAqB,UAAU,IAAK;EACrC,CAAE;CAEJ,GAAG,CAAE,sBAAuB,CAAE;CAE9B,OAAO;AACR"}
@@ -1,44 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, {
3
+ __esModule: { value: true },
4
+ [Symbol.toStringTag]: { value: "Module" }
5
+ });
6
+ // \0rolldown/runtime.js
1
7
  var __create = Object.create;
2
8
  var __defProp = Object.defineProperty;
3
9
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
10
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
11
  var __getProtoOf = Object.getPrototypeOf;
6
12
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
13
  var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
14
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
15
+ key = keys[i];
16
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
+ get: ((k) => from[k]).bind(null, key),
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ }
21
+ return to;
18
22
  };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
24
+ value: mod,
25
+ enumerable: true
26
+ }) : target, mod));
27
+ let __stars_jsx = require("./stars.cjs");
28
+ __stars_jsx = __toESM(__stars_jsx);
29
+ let react_jsx_runtime = require("react/jsx-runtime");
29
30
  // packages/block-directory/src/components/block-ratings/index.jsx
30
- var block_ratings_exports = {};
31
- __export(block_ratings_exports, {
32
- BlockRatings: () => BlockRatings,
33
- default: () => block_ratings_default
31
+ const BlockRatings = ({ rating }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
32
+ className: "block-directory-block-ratings",
33
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__stars_jsx.default, { rating })
34
34
  });
35
- module.exports = __toCommonJS(block_ratings_exports);
36
- var import_stars = __toESM(require("./stars.cjs"));
37
- var import_jsx_runtime = require("react/jsx-runtime");
38
- var BlockRatings = ({ rating }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "block-directory-block-ratings", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stars.default, { rating }) });
39
- var block_ratings_default = BlockRatings;
40
- // Annotate the CommonJS export names for ESM import in node:
41
- 0 && (module.exports = {
42
- BlockRatings
43
- });
44
- //# sourceMappingURL=index.cjs.map
35
+ exports.BlockRatings = BlockRatings;
36
+ exports.default = BlockRatings;
37
+
38
+ //# sourceMappingURL=index.cjs.map
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/block-ratings/index.jsx"],
4
- "sourcesContent": ["import Stars from './stars';\n\nexport const BlockRatings = ( { rating } ) => (\n\t<span className=\"block-directory-block-ratings\">\n\t\t<Stars rating={ rating } />\n\t</span>\n);\n\nexport default BlockRatings;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAIhB;AAFK,IAAM,eAAe,CAAE,EAAE,OAAO,MACtC,4CAAC,UAAK,WAAU,iCACf,sDAAC,aAAAA,SAAA,EAAM,QAAkB,GAC1B;AAGD,IAAO,wBAAQ;",
6
- "names": ["Stars"]
7
- }
1
+ {"version":3,"file":"index.cjs","names":["Stars"],"sources":["../../../src/components/block-ratings/index.jsx"],"sourcesContent":["import Stars from './stars';\n\nexport const BlockRatings = ( { rating } ) => (\n\t<span className=\"block-directory-block-ratings\">\n\t\t<Stars rating={ rating } />\n\t</span>\n);\n\nexport default BlockRatings;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAAa,gBAAiB,EAAE,aAC/B,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;CAAM,WAAU;CACf,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACA,YAAAA,SAAD,EAAgB,OAAU,CAAA;AACrB,CAAA"}
@@ -1,74 +1,38 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // packages/block-directory/src/components/block-ratings/stars.jsx
20
- var stars_exports = {};
21
- __export(stars_exports, {
22
- default: () => stars_default
1
+ "use strict";
2
+ Object.defineProperties(exports, {
3
+ __esModule: { value: true },
4
+ [Symbol.toStringTag]: { value: "Module" }
23
5
  });
24
- module.exports = __toCommonJS(stars_exports);
25
- var import_i18n = require("@wordpress/i18n");
26
- var import_icons = require("@wordpress/icons");
27
- var import_jsx_runtime = require("react/jsx-runtime");
6
+ let _wordpress_i18n = require("@wordpress/i18n");
7
+ let _wordpress_icons = require("@wordpress/icons");
8
+ let react_jsx_runtime = require("react/jsx-runtime");
9
+ // packages/block-directory/src/components/block-ratings/stars.jsx
28
10
  function Stars({ rating }) {
29
- const stars = Math.round(rating / 0.5) * 0.5;
30
- const fullStarCount = Math.floor(rating);
31
- const halfStarCount = Math.ceil(rating - fullStarCount);
32
- const emptyStarCount = 5 - (fullStarCount + halfStarCount);
33
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
34
- "span",
35
- {
36
- "aria-label": (0, import_i18n.sprintf)(
37
- /* translators: %s: number of stars. */
38
- (0, import_i18n.__)("%s out of 5 stars"),
39
- stars
40
- ),
41
- children: [
42
- Array.from({ length: fullStarCount }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
43
- import_icons.Icon,
44
- {
45
- className: "block-directory-block-ratings__star-full",
46
- icon: import_icons.starFilled,
47
- size: 16
48
- },
49
- `full_stars_${i}`
50
- )),
51
- Array.from({ length: halfStarCount }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
52
- import_icons.Icon,
53
- {
54
- className: "block-directory-block-ratings__star-half-full",
55
- icon: import_icons.starHalf,
56
- size: 16
57
- },
58
- `half_stars_${i}`
59
- )),
60
- Array.from({ length: emptyStarCount }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
61
- import_icons.Icon,
62
- {
63
- className: "block-directory-block-ratings__star-empty",
64
- icon: import_icons.starEmpty,
65
- size: 16
66
- },
67
- `empty_stars_${i}`
68
- ))
69
- ]
70
- }
71
- );
11
+ const stars = Math.round(rating / .5) * .5;
12
+ const fullStarCount = Math.floor(rating);
13
+ const halfStarCount = Math.ceil(rating - fullStarCount);
14
+ const emptyStarCount = 5 - (fullStarCount + halfStarCount);
15
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
16
+ "aria-label": (0, _wordpress_i18n.sprintf)((0, _wordpress_i18n.__)("%s out of 5 stars"), stars),
17
+ children: [
18
+ Array.from({ length: fullStarCount }).map((_, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_icons.Icon, {
19
+ className: "block-directory-block-ratings__star-full",
20
+ icon: _wordpress_icons.starFilled,
21
+ size: 16
22
+ }, `full_stars_${i}`)),
23
+ Array.from({ length: halfStarCount }).map((_, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_icons.Icon, {
24
+ className: "block-directory-block-ratings__star-half-full",
25
+ icon: _wordpress_icons.starHalf,
26
+ size: 16
27
+ }, `half_stars_${i}`)),
28
+ Array.from({ length: emptyStarCount }).map((_, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_icons.Icon, {
29
+ className: "block-directory-block-ratings__star-empty",
30
+ icon: _wordpress_icons.starEmpty,
31
+ size: 16
32
+ }, `empty_stars_${i}`))
33
+ ]
34
+ });
72
35
  }
73
- var stars_default = Stars;
74
- //# sourceMappingURL=stars.cjs.map
36
+ exports.default = Stars;
37
+
38
+ //# sourceMappingURL=stars.cjs.map
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/block-ratings/stars.jsx"],
4
- "sourcesContent": ["import { __, sprintf } from '@wordpress/i18n';\nimport { Icon, starEmpty, starFilled, starHalf } from '@wordpress/icons';\n\nfunction Stars( { rating } ) {\n\tconst stars = Math.round( rating / 0.5 ) * 0.5;\n\n\tconst fullStarCount = Math.floor( rating );\n\tconst halfStarCount = Math.ceil( rating - fullStarCount );\n\tconst emptyStarCount = 5 - ( fullStarCount + halfStarCount );\n\n\treturn (\n\t\t<span\n\t\t\taria-label={ sprintf(\n\t\t\t\t/* translators: %s: number of stars. */\n\t\t\t\t__( '%s out of 5 stars' ),\n\t\t\t\tstars\n\t\t\t) }\n\t\t>\n\t\t\t{ Array.from( { length: fullStarCount } ).map( ( _, i ) => (\n\t\t\t\t<Icon\n\t\t\t\t\tkey={ `full_stars_${ i }` }\n\t\t\t\t\tclassName=\"block-directory-block-ratings__star-full\"\n\t\t\t\t\ticon={ starFilled }\n\t\t\t\t\tsize={ 16 }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t\t{ Array.from( { length: halfStarCount } ).map( ( _, i ) => (\n\t\t\t\t<Icon\n\t\t\t\t\tkey={ `half_stars_${ i }` }\n\t\t\t\t\tclassName=\"block-directory-block-ratings__star-half-full\"\n\t\t\t\t\ticon={ starHalf }\n\t\t\t\t\tsize={ 16 }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t\t{ Array.from( { length: emptyStarCount } ).map( ( _, i ) => (\n\t\t\t\t<Icon\n\t\t\t\t\tkey={ `empty_stars_${ i }` }\n\t\t\t\t\tclassName=\"block-directory-block-ratings__star-empty\"\n\t\t\t\t\ticon={ starEmpty }\n\t\t\t\t\tsize={ 16 }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</span>\n\t);\n}\n\nexport default Stars;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA4B;AAC5B,mBAAsD;AAUpD;AARF,SAAS,MAAO,EAAE,OAAO,GAAI;AAC5B,QAAM,QAAQ,KAAK,MAAO,SAAS,GAAI,IAAI;AAE3C,QAAM,gBAAgB,KAAK,MAAO,MAAO;AACzC,QAAM,gBAAgB,KAAK,KAAM,SAAS,aAAc;AACxD,QAAM,iBAAiB,KAAM,gBAAgB;AAE7C,SACC;AAAA,IAAC;AAAA;AAAA,MACA,kBAAa;AAAA;AAAA,YAEZ,gBAAI,mBAAoB;AAAA,QACxB;AAAA,MACD;AAAA,MAEE;AAAA,cAAM,KAAM,EAAE,QAAQ,cAAc,CAAE,EAAE,IAAK,CAAE,GAAG,MACnD;AAAA,UAAC;AAAA;AAAA,YAEA,WAAU;AAAA,YACV,MAAO;AAAA,YACP,MAAO;AAAA;AAAA,UAHD,cAAe,CAAE;AAAA,QAIxB,CACC;AAAA,QACA,MAAM,KAAM,EAAE,QAAQ,cAAc,CAAE,EAAE,IAAK,CAAE,GAAG,MACnD;AAAA,UAAC;AAAA;AAAA,YAEA,WAAU;AAAA,YACV,MAAO;AAAA,YACP,MAAO;AAAA;AAAA,UAHD,cAAe,CAAE;AAAA,QAIxB,CACC;AAAA,QACA,MAAM,KAAM,EAAE,QAAQ,eAAe,CAAE,EAAE,IAAK,CAAE,GAAG,MACpD;AAAA,UAAC;AAAA;AAAA,YAEA,WAAU;AAAA,YACV,MAAO;AAAA,YACP,MAAO;AAAA;AAAA,UAHD,eAAgB,CAAE;AAAA,QAIzB,CACC;AAAA;AAAA;AAAA,EACH;AAEF;AAEA,IAAO,gBAAQ;",
6
- "names": []
7
- }
1
+ {"version":3,"file":"stars.cjs","names":["sprintf","__","Icon","starFilled","starHalf","starEmpty"],"sources":["../../../src/components/block-ratings/stars.jsx"],"sourcesContent":["import { __, sprintf } from '@wordpress/i18n';\nimport { Icon, starEmpty, starFilled, starHalf } from '@wordpress/icons';\n\nfunction Stars( { rating } ) {\n\tconst stars = Math.round( rating / 0.5 ) * 0.5;\n\n\tconst fullStarCount = Math.floor( rating );\n\tconst halfStarCount = Math.ceil( rating - fullStarCount );\n\tconst emptyStarCount = 5 - ( fullStarCount + halfStarCount );\n\n\treturn (\n\t\t<span\n\t\t\taria-label={ sprintf(\n\t\t\t\t/* translators: %s: number of stars. */\n\t\t\t\t__( '%s out of 5 stars' ),\n\t\t\t\tstars\n\t\t\t) }\n\t\t>\n\t\t\t{ Array.from( { length: fullStarCount } ).map( ( _, i ) => (\n\t\t\t\t<Icon\n\t\t\t\t\tkey={ `full_stars_${ i }` }\n\t\t\t\t\tclassName=\"block-directory-block-ratings__star-full\"\n\t\t\t\t\ticon={ starFilled }\n\t\t\t\t\tsize={ 16 }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t\t{ Array.from( { length: halfStarCount } ).map( ( _, i ) => (\n\t\t\t\t<Icon\n\t\t\t\t\tkey={ `half_stars_${ i }` }\n\t\t\t\t\tclassName=\"block-directory-block-ratings__star-half-full\"\n\t\t\t\t\ticon={ starHalf }\n\t\t\t\t\tsize={ 16 }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t\t{ Array.from( { length: emptyStarCount } ).map( ( _, i ) => (\n\t\t\t\t<Icon\n\t\t\t\t\tkey={ `empty_stars_${ i }` }\n\t\t\t\t\tclassName=\"block-directory-block-ratings__star-empty\"\n\t\t\t\t\ticon={ starEmpty }\n\t\t\t\t\tsize={ 16 }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</span>\n\t);\n}\n\nexport default Stars;\n"],"mappings":";;;;;;;;;AAGA,SAAS,MAAO,EAAE,UAAW;CAC5B,MAAM,QAAQ,KAAK,MAAO,SAAS,EAAI,IAAI;CAE3C,MAAM,gBAAgB,KAAK,MAAO,MAAO;CACzC,MAAM,gBAAgB,KAAK,KAAM,SAAS,aAAc;CACxD,MAAM,iBAAiB,KAAM,gBAAgB;CAE7C,OACC,iBAAA,GAAA,kBAAA,KAAA,CAAC,QAAD;EACC,eAAA,GAAaA,gBAAAA,QAAAA,EAAAA,GAEZC,gBAAAA,GAAAA,CAAI,mBAAoB,GACxB,KACD;EALD,UAAA;GAOG,MAAM,KAAM,EAAE,QAAQ,cAAc,CAAE,CAAC,CAAC,KAAO,GAAG,MACnD,iBAAA,GAAA,kBAAA,IAAA,CAACC,iBAAAA,MAAD;IAEC,WAAU;IACV,MAAOC,iBAAAA;IACP,MAAO;GACP,GAJM,cAAe,GAIrB,CACA;GACA,MAAM,KAAM,EAAE,QAAQ,cAAc,CAAE,CAAC,CAAC,KAAO,GAAG,MACnD,iBAAA,GAAA,kBAAA,IAAA,CAACD,iBAAAA,MAAD;IAEC,WAAU;IACV,MAAOE,iBAAAA;IACP,MAAO;GACP,GAJM,cAAe,GAIrB,CACA;GACA,MAAM,KAAM,EAAE,QAAQ,eAAe,CAAE,CAAC,CAAC,KAAO,GAAG,MACpD,iBAAA,GAAA,kBAAA,IAAA,CAACF,iBAAAA,MAAD;IAEC,WAAU;IACV,MAAOG,iBAAAA;IACP,MAAO;GACP,GAJM,eAAgB,GAItB,CACA;EACG;;AAER"}
@@ -1,54 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, {
3
+ __esModule: { value: true },
4
+ [Symbol.toStringTag]: { value: "Module" }
5
+ });
6
+ // \0rolldown/runtime.js
1
7
  var __create = Object.create;
2
8
  var __defProp = Object.defineProperty;
3
9
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
10
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
11
  var __getProtoOf = Object.getPrototypeOf;
6
12
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
13
  var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
14
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
15
+ key = keys[i];
16
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
+ get: ((k) => from[k]).bind(null, key),
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ }
21
+ return to;
18
22
  };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
24
+ value: mod,
25
+ enumerable: true
26
+ }) : target, mod));
27
+ let _wordpress_i18n = require("@wordpress/i18n");
28
+ let ___downloadable_block_icon_index_jsx = require("../downloadable-block-icon/index.cjs");
29
+ ___downloadable_block_icon_index_jsx = __toESM(___downloadable_block_icon_index_jsx);
30
+ let react_jsx_runtime = require("react/jsx-runtime");
29
31
  // packages/block-directory/src/components/compact-list/index.jsx
30
- var compact_list_exports = {};
31
- __export(compact_list_exports, {
32
- default: () => CompactList
33
- });
34
- module.exports = __toCommonJS(compact_list_exports);
35
- var import_i18n = require("@wordpress/i18n");
36
- var import_downloadable_block_icon = __toESM(require("../downloadable-block-icon/index.cjs"));
37
- var import_jsx_runtime = require("react/jsx-runtime");
38
32
  function CompactList({ items }) {
39
- if (!items.length) {
40
- return null;
41
- }
42
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { className: "block-directory-compact-list", children: items.map(({ icon, id, title, author }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("li", { className: "block-directory-compact-list__item", children: [
43
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_downloadable_block_icon.default, { icon, title }),
44
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "block-directory-compact-list__item-details", children: [
45
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "block-directory-compact-list__item-title", children: title }),
46
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "block-directory-compact-list__item-author", children: (0, import_i18n.sprintf)(
47
- /* translators: %s: Name of the block author. */
48
- (0, import_i18n.__)("By %s"),
49
- author
50
- ) })
51
- ] })
52
- ] }, id)) });
33
+ if (!items.length) return null;
34
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
35
+ className: "block-directory-compact-list",
36
+ children: items.map(({ icon, id, title, author }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
37
+ className: "block-directory-compact-list__item",
38
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(___downloadable_block_icon_index_jsx.default, {
39
+ icon,
40
+ title
41
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
42
+ className: "block-directory-compact-list__item-details",
43
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
44
+ className: "block-directory-compact-list__item-title",
45
+ children: title
46
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
47
+ className: "block-directory-compact-list__item-author",
48
+ children: (0, _wordpress_i18n.sprintf)((0, _wordpress_i18n.__)("By %s"), author)
49
+ })]
50
+ })]
51
+ }, id))
52
+ });
53
53
  }
54
- //# sourceMappingURL=index.cjs.map
54
+ exports.default = CompactList;
55
+
56
+ //# sourceMappingURL=index.cjs.map
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/compact-list/index.jsx"],
4
- "sourcesContent": ["import { __, sprintf } from '@wordpress/i18n';\nimport DownloadableBlockIcon from '../downloadable-block-icon';\n\nexport default function CompactList( { items } ) {\n\tif ( ! items.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ul className=\"block-directory-compact-list\">\n\t\t\t{ items.map( ( { icon, id, title, author } ) => (\n\t\t\t\t<li key={ id } className=\"block-directory-compact-list__item\">\n\t\t\t\t\t<DownloadableBlockIcon icon={ icon } title={ title } />\n\n\t\t\t\t\t<div className=\"block-directory-compact-list__item-details\">\n\t\t\t\t\t\t<div className=\"block-directory-compact-list__item-title\">\n\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className=\"block-directory-compact-list__item-author\">\n\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: Name of the block author. */\n\t\t\t\t\t\t\t\t__( 'By %s' ),\n\t\t\t\t\t\t\t\tauthor\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t) ) }\n\t\t</ul>\n\t);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA4B;AAC5B,qCAAkC;AAW7B;AATU,SAAR,YAA8B,EAAE,MAAM,GAAI;AAChD,MAAK,CAAE,MAAM,QAAS;AACrB,WAAO;AAAA,EACR;AAEA,SACC,4CAAC,QAAG,WAAU,gCACX,gBAAM,IAAK,CAAE,EAAE,MAAM,IAAI,OAAO,OAAO,MACxC,6CAAC,QAAc,WAAU,sCACxB;AAAA,gDAAC,+BAAAA,SAAA,EAAsB,MAAc,OAAgB;AAAA,IAErD,6CAAC,SAAI,WAAU,8CACd;AAAA,kDAAC,SAAI,WAAU,4CACZ,iBACH;AAAA,MACA,4CAAC,SAAI,WAAU,6CACZ;AAAA;AAAA,YAED,gBAAI,OAAQ;AAAA,QACZ;AAAA,MACD,GACD;AAAA,OACD;AAAA,OAdS,EAeV,CACC,GACH;AAEF;",
6
- "names": ["DownloadableBlockIcon"]
7
- }
1
+ {"version":3,"file":"index.cjs","names":["DownloadableBlockIcon","sprintf","__"],"sources":["../../../src/components/compact-list/index.jsx"],"sourcesContent":["import { __, sprintf } from '@wordpress/i18n';\nimport DownloadableBlockIcon from '../downloadable-block-icon';\n\nexport default function CompactList( { items } ) {\n\tif ( ! items.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ul className=\"block-directory-compact-list\">\n\t\t\t{ items.map( ( { icon, id, title, author } ) => (\n\t\t\t\t<li key={ id } className=\"block-directory-compact-list__item\">\n\t\t\t\t\t<DownloadableBlockIcon icon={ icon } title={ title } />\n\n\t\t\t\t\t<div className=\"block-directory-compact-list__item-details\">\n\t\t\t\t\t\t<div className=\"block-directory-compact-list__item-title\">\n\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className=\"block-directory-compact-list__item-author\">\n\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: Name of the block author. */\n\t\t\t\t\t\t\t\t__( 'By %s' ),\n\t\t\t\t\t\t\t\tauthor\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t) ) }\n\t\t</ul>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,SAAwB,YAAa,EAAE,SAAU;CAChD,IAAK,CAAE,MAAM,QACZ,OAAO;CAGR,OACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,MAAD;EAAI,WAAU;EACX,UAAA,MAAM,KAAO,EAAE,MAAM,IAAI,OAAO,aACjC,iBAAA,GAAA,kBAAA,KAAA,CAAC,MAAD;GAAe,WAAU;GAAzB,UAAA,CACC,iBAAA,GAAA,kBAAA,IAAA,CAACA,qCAAAA,SAAD;IAA8B;IAAe;GAAS,CAAA,GAEtD,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;KAAK,WAAU;KACZ,UAAA;IACE,CAAA,GACL,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;KAAK,WAAU;KACZC,WAAAA,GAAAA,gBAAAA,QAAAA,EAAAA,GAEDC,gBAAAA,GAAAA,CAAI,OAAQ,GACZ,MACD;IACI,CAAA,CACD;GACF,CAAA,CAAA;EAfM,GAAA,EAeN,CACH;CACC,CAAA;AAEN"}
@@ -1,32 +1,23 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // packages/block-directory/src/components/downloadable-block-icon/index.jsx
20
- var downloadable_block_icon_exports = {};
21
- __export(downloadable_block_icon_exports, {
22
- default: () => downloadable_block_icon_default
1
+ "use strict";
2
+ Object.defineProperties(exports, {
3
+ __esModule: { value: true },
4
+ [Symbol.toStringTag]: { value: "Module" }
23
5
  });
24
- module.exports = __toCommonJS(downloadable_block_icon_exports);
25
- var import_block_editor = require("@wordpress/block-editor");
26
- var import_jsx_runtime = require("react/jsx-runtime");
6
+ let _wordpress_block_editor = require("@wordpress/block-editor");
7
+ let react_jsx_runtime = require("react/jsx-runtime");
8
+ // packages/block-directory/src/components/downloadable-block-icon/index.jsx
27
9
  function DownloadableBlockIcon({ icon }) {
28
- const className = "block-directory-downloadable-block-icon";
29
- return icon.match(/\.(jpeg|jpg|gif|png|svg)(?:\?.*)?$/) !== null ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { className, src: icon, alt: "" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.BlockIcon, { className, icon, showColors: true });
10
+ const className = "block-directory-downloadable-block-icon";
11
+ return icon.match(/\.(jpeg|jpg|gif|png|svg)(?:\?.*)?$/) !== null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
12
+ className,
13
+ src: icon,
14
+ alt: ""
15
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_block_editor.BlockIcon, {
16
+ className,
17
+ icon,
18
+ showColors: true
19
+ });
30
20
  }
31
- var downloadable_block_icon_default = DownloadableBlockIcon;
32
- //# sourceMappingURL=index.cjs.map
21
+ exports.default = DownloadableBlockIcon;
22
+
23
+ //# sourceMappingURL=index.cjs.map
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/downloadable-block-icon/index.jsx"],
4
- "sourcesContent": ["import { BlockIcon } from '@wordpress/block-editor';\n\nfunction DownloadableBlockIcon( { icon } ) {\n\tconst className = 'block-directory-downloadable-block-icon';\n\treturn icon.match( /\\.(jpeg|jpg|gif|png|svg)(?:\\?.*)?$/ ) !== null ? (\n\t\t<img className={ className } src={ icon } alt=\"\" />\n\t) : (\n\t\t<BlockIcon className={ className } icon={ icon } showColors />\n\t);\n}\n\nexport default DownloadableBlockIcon;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA0B;AAKxB;AAHF,SAAS,sBAAuB,EAAE,KAAK,GAAI;AAC1C,QAAM,YAAY;AAClB,SAAO,KAAK,MAAO,oCAAqC,MAAM,OAC7D,4CAAC,SAAI,WAAwB,KAAM,MAAO,KAAI,IAAG,IAEjD,4CAAC,iCAAU,WAAwB,MAAc,YAAU,MAAC;AAE9D;AAEA,IAAO,kCAAQ;",
6
- "names": []
7
- }
1
+ {"version":3,"file":"index.cjs","names":["BlockIcon"],"sources":["../../../src/components/downloadable-block-icon/index.jsx"],"sourcesContent":["import { BlockIcon } from '@wordpress/block-editor';\n\nfunction DownloadableBlockIcon( { icon } ) {\n\tconst className = 'block-directory-downloadable-block-icon';\n\treturn icon.match( /\\.(jpeg|jpg|gif|png|svg)(?:\\?.*)?$/ ) !== null ? (\n\t\t<img className={ className } src={ icon } alt=\"\" />\n\t) : (\n\t\t<BlockIcon className={ className } icon={ icon } showColors />\n\t);\n}\n\nexport default DownloadableBlockIcon;\n"],"mappings":";;;;;;;;AAEA,SAAS,sBAAuB,EAAE,QAAS;CAC1C,MAAM,YAAY;CAClB,OAAO,KAAK,MAAO,oCAAqC,MAAM,OAC7D,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EAAiB;EAAY,KAAM;EAAO,KAAI;CAAI,CAAA,IAElD,iBAAA,GAAA,kBAAA,IAAA,CAACA,wBAAAA,WAAD;EAAuB;EAAmB;EAAO,YAAA;CAAY,CAAA;AAE/D"}