@wordpress/block-directory 5.32.0 → 5.32.1-next.ff1cebbba.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.
- package/build/components/auto-block-uninstaller/index.js +37 -31
- package/build/components/auto-block-uninstaller/index.js.map +7 -1
- package/build/components/block-ratings/index.js +40 -22
- package/build/components/block-ratings/index.js.map +7 -1
- package/build/components/block-ratings/stars.js +66 -40
- package/build/components/block-ratings/stars.js.map +7 -1
- package/build/components/compact-list/index.js +47 -46
- package/build/components/compact-list/index.js.map +7 -1
- package/build/components/downloadable-block-icon/index.js +28 -26
- package/build/components/downloadable-block-icon/index.js.map +7 -1
- package/build/components/downloadable-block-list-item/index.js +113 -127
- package/build/components/downloadable-block-list-item/index.js.map +7 -1
- package/build/components/downloadable-block-notice/index.js +41 -31
- package/build/components/downloadable-block-notice/index.js.map +7 -1
- package/build/components/downloadable-blocks-list/index.js +72 -56
- package/build/components/downloadable-blocks-list/index.js.map +7 -1
- package/build/components/downloadable-blocks-panel/index.js +108 -95
- package/build/components/downloadable-blocks-panel/index.js.map +7 -1
- package/build/components/downloadable-blocks-panel/inserter-panel.js +52 -38
- package/build/components/downloadable-blocks-panel/inserter-panel.js.map +7 -1
- package/build/components/downloadable-blocks-panel/no-results.js +37 -30
- package/build/components/downloadable-blocks-panel/no-results.js.map +7 -1
- package/build/index.js +27 -12
- package/build/index.js.map +7 -1
- package/build/lock-unlock.js +31 -15
- package/build/lock-unlock.js.map +7 -1
- package/build/plugins/get-install-missing/index.js +123 -102
- package/build/plugins/get-install-missing/index.js.map +7 -1
- package/build/plugins/get-install-missing/install-button.js +68 -50
- package/build/plugins/get-install-missing/install-button.js.map +7 -1
- package/build/plugins/index.js +46 -29
- package/build/plugins/index.js.map +7 -1
- package/build/plugins/inserter-menu-downloadable-blocks-panel/index.js +55 -42
- package/build/plugins/inserter-menu-downloadable-blocks-panel/index.js.map +7 -1
- package/build/plugins/installed-blocks-pre-publish-panel/index.js +65 -34
- package/build/plugins/installed-blocks-pre-publish-panel/index.js.map +7 -1
- package/build/store/actions.js +142 -188
- package/build/store/actions.js.map +7 -1
- package/build/store/index.js +48 -46
- package/build/store/index.js.map +7 -1
- package/build/store/load-assets.js +48 -55
- package/build/store/load-assets.js.map +7 -1
- package/build/store/reducer.js +48 -54
- package/build/store/reducer.js.map +7 -1
- package/build/store/resolvers.js +52 -31
- package/build/store/resolvers.js.map +7 -1
- package/build/store/selectors.js +100 -127
- package/build/store/selectors.js.map +7 -1
- package/build/store/utils/get-plugin-url.js +23 -14
- package/build/store/utils/get-plugin-url.js.map +7 -1
- package/build-module/components/auto-block-uninstaller/index.js +18 -24
- package/build-module/components/auto-block-uninstaller/index.js.map +7 -1
- package/build-module/components/block-ratings/index.js +9 -15
- package/build-module/components/block-ratings/index.js.map +7 -1
- package/build-module/components/block-ratings/stars.js +48 -34
- package/build-module/components/block-ratings/stars.js.map +7 -1
- package/build-module/components/compact-list/index.js +19 -39
- package/build-module/components/compact-list/index.js.map +7 -1
- package/build-module/components/downloadable-block-icon/index.js +10 -20
- package/build-module/components/downloadable-block-icon/index.js.map +7 -1
- package/build-module/components/downloadable-block-list-item/index.js +89 -120
- package/build-module/components/downloadable-block-list-item/index.js.map +7 -1
- package/build-module/components/downloadable-block-notice/index.js +19 -24
- package/build-module/components/downloadable-block-notice/index.js.map +7 -1
- package/build-module/components/downloadable-blocks-list/index.js +44 -49
- package/build-module/components/downloadable-blocks-list/index.js.map +7 -1
- package/build-module/components/downloadable-blocks-panel/index.js +81 -89
- package/build-module/components/downloadable-blocks-panel/index.js.map +7 -1
- package/build-module/components/downloadable-blocks-panel/inserter-panel.js +33 -31
- package/build-module/components/downloadable-blocks-panel/inserter-panel.js.map +7 -1
- package/build-module/components/downloadable-blocks-panel/no-results.js +19 -24
- package/build-module/components/downloadable-blocks-panel/no-results.js.map +7 -1
- package/build-module/index.js +6 -6
- package/build-module/index.js.map +7 -1
- package/build-module/lock-unlock.js +8 -7
- package/build-module/lock-unlock.js.map +7 -1
- package/build-module/plugins/get-install-missing/index.js +99 -95
- package/build-module/plugins/get-install-missing/index.js.map +7 -1
- package/build-module/plugins/get-install-missing/install-button.js +50 -44
- package/build-module/plugins/get-install-missing/install-button.js.map +7 -1
- package/build-module/plugins/index.js +24 -25
- package/build-module/plugins/index.js.map +7 -1
- package/build-module/plugins/inserter-menu-downloadable-blocks-panel/index.js +26 -34
- package/build-module/plugins/inserter-menu-downloadable-blocks-panel/index.js.map +7 -1
- package/build-module/plugins/installed-blocks-pre-publish-panel/index.js +38 -28
- package/build-module/plugins/installed-blocks-pre-publish-panel/index.js.map +7 -1
- package/build-module/store/actions.js +100 -168
- package/build-module/store/actions.js.map +7 -1
- package/build-module/store/index.js +13 -36
- package/build-module/store/index.js.map +7 -1
- package/build-module/store/load-assets.js +15 -47
- package/build-module/store/load-assets.js.map +7 -1
- package/build-module/store/reducer.js +27 -49
- package/build-module/store/reducer.js.map +7 -1
- package/build-module/store/resolvers.js +16 -19
- package/build-module/store/resolvers.js.map +7 -1
- package/build-module/store/selectors.js +77 -121
- package/build-module/store/selectors.js.map +7 -1
- package/build-module/store/utils/get-plugin-url.js +6 -10
- package/build-module/store/utils/get-plugin-url.js.map +7 -1
- package/build-style/style-rtl.css +9 -142
- package/build-style/style.css +9 -142
- package/package.json +28 -21
- package/src/components/block-ratings/style.scss +2 -0
- package/src/components/compact-list/style.scss +3 -0
- package/src/components/downloadable-block-icon/style.scss +3 -0
- package/src/components/downloadable-block-list-item/style.scss +4 -0
- package/src/components/downloadable-block-notice/style.scss +3 -0
- package/src/components/downloadable-blocks-panel/style.scss +3 -1
- package/src/style.scss +8 -7
|
@@ -1,42 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
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
|
+
var auto_block_uninstaller_exports = {};
|
|
19
|
+
__export(auto_block_uninstaller_exports, {
|
|
20
|
+
default: () => AutoBlockUninstaller
|
|
5
21
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
/**
|
|
13
|
-
* WordPress dependencies
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Internal dependencies
|
|
18
|
-
*/
|
|
19
|
-
|
|
22
|
+
module.exports = __toCommonJS(auto_block_uninstaller_exports);
|
|
23
|
+
var import_blocks = require("@wordpress/blocks");
|
|
24
|
+
var import_data = require("@wordpress/data");
|
|
25
|
+
var import_element = require("@wordpress/element");
|
|
26
|
+
var import_editor = require("@wordpress/editor");
|
|
27
|
+
var import_store = require("../../store");
|
|
20
28
|
function AutoBlockUninstaller() {
|
|
21
|
-
const {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const shouldRemoveBlockTypes = (0, _data.useSelect)(select => {
|
|
25
|
-
const {
|
|
26
|
-
isAutosavingPost,
|
|
27
|
-
isSavingPost
|
|
28
|
-
} = select(_editor.store);
|
|
29
|
+
const { uninstallBlockType } = (0, import_data.useDispatch)(import_store.store);
|
|
30
|
+
const shouldRemoveBlockTypes = (0, import_data.useSelect)((select) => {
|
|
31
|
+
const { isAutosavingPost, isSavingPost } = select(import_editor.store);
|
|
29
32
|
return isSavingPost() && !isAutosavingPost();
|
|
30
33
|
}, []);
|
|
31
|
-
const unusedBlockTypes = (0,
|
|
32
|
-
|
|
34
|
+
const unusedBlockTypes = (0, import_data.useSelect)(
|
|
35
|
+
(select) => select(import_store.store).getUnusedBlockTypes(),
|
|
36
|
+
[]
|
|
37
|
+
);
|
|
38
|
+
(0, import_element.useEffect)(() => {
|
|
33
39
|
if (shouldRemoveBlockTypes && unusedBlockTypes.length) {
|
|
34
|
-
unusedBlockTypes.forEach(blockType => {
|
|
40
|
+
unusedBlockTypes.forEach((blockType) => {
|
|
35
41
|
uninstallBlockType(blockType);
|
|
36
|
-
(0,
|
|
42
|
+
(0, import_blocks.unregisterBlockType)(blockType.name);
|
|
37
43
|
});
|
|
38
44
|
}
|
|
39
45
|
}, [shouldRemoveBlockTypes]);
|
|
40
46
|
return null;
|
|
41
47
|
}
|
|
42
|
-
//# sourceMappingURL=index.js.map
|
|
48
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/auto-block-uninstaller/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { unregisterBlockType } from '@wordpress/blocks';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\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;AAGA,oBAAoC;AACpC,kBAAuC;AACvC,qBAA0B;AAC1B,oBAAqC;AAKrC,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,24 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
Object.
|
|
5
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
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
|
+
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;
|
|
18
|
+
};
|
|
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
|
+
var block_ratings_exports = {};
|
|
29
|
+
__export(block_ratings_exports, {
|
|
30
|
+
BlockRatings: () => BlockRatings,
|
|
31
|
+
default: () => block_ratings_default
|
|
6
32
|
});
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
rating
|
|
16
|
-
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
17
|
-
className: "block-directory-block-ratings",
|
|
18
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_stars.default, {
|
|
19
|
-
rating: rating
|
|
20
|
-
})
|
|
33
|
+
module.exports = __toCommonJS(block_ratings_exports);
|
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
+
var import_stars = __toESM(require("./stars"));
|
|
36
|
+
const 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 }) });
|
|
37
|
+
var block_ratings_default = BlockRatings;
|
|
38
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
39
|
+
0 && (module.exports = {
|
|
40
|
+
BlockRatings
|
|
21
41
|
});
|
|
22
|
-
|
|
23
|
-
var _default = exports.default = BlockRatings;
|
|
24
|
-
//# sourceMappingURL=index.js.map
|
|
42
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/block-ratings/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport 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;AAOE;AAJF,mBAAkB;AAEX,MAAM,eAAe,CAAE,EAAE,OAAO,MACtC,4CAAC,UAAK,WAAU,iCACf,sDAAC,aAAAA,SAAA,EAAM,QAAkB,GAC1B;AAGD,IAAO,wBAAQ;",
|
|
6
|
+
"names": ["Stars"]
|
|
7
|
+
}
|
|
@@ -1,46 +1,72 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
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
|
+
var stars_exports = {};
|
|
19
|
+
__export(stars_exports, {
|
|
20
|
+
default: () => stars_default
|
|
5
21
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
* WordPress dependencies
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
function Stars({
|
|
15
|
-
rating
|
|
16
|
-
}) {
|
|
22
|
+
module.exports = __toCommonJS(stars_exports);
|
|
23
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
24
|
+
var import_i18n = require("@wordpress/i18n");
|
|
25
|
+
var import_icons = require("@wordpress/icons");
|
|
26
|
+
function Stars({ rating }) {
|
|
17
27
|
const stars = Math.round(rating / 0.5) * 0.5;
|
|
18
28
|
const fullStarCount = Math.floor(rating);
|
|
19
29
|
const halfStarCount = Math.ceil(rating - fullStarCount);
|
|
20
30
|
const emptyStarCount = 5 - (fullStarCount + halfStarCount);
|
|
21
|
-
return
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
31
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
32
|
+
"span",
|
|
33
|
+
{
|
|
34
|
+
"aria-label": (0, import_i18n.sprintf)(
|
|
35
|
+
/* translators: %s: number of stars. */
|
|
36
|
+
(0, import_i18n.__)("%s out of 5 stars"),
|
|
37
|
+
stars
|
|
38
|
+
),
|
|
39
|
+
children: [
|
|
40
|
+
Array.from({ length: fullStarCount }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
41
|
+
import_icons.Icon,
|
|
42
|
+
{
|
|
43
|
+
className: "block-directory-block-ratings__star-full",
|
|
44
|
+
icon: import_icons.starFilled,
|
|
45
|
+
size: 16
|
|
46
|
+
},
|
|
47
|
+
`full_stars_${i}`
|
|
48
|
+
)),
|
|
49
|
+
Array.from({ length: halfStarCount }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
50
|
+
import_icons.Icon,
|
|
51
|
+
{
|
|
52
|
+
className: "block-directory-block-ratings__star-half-full",
|
|
53
|
+
icon: import_icons.starHalf,
|
|
54
|
+
size: 16
|
|
55
|
+
},
|
|
56
|
+
`half_stars_${i}`
|
|
57
|
+
)),
|
|
58
|
+
Array.from({ length: emptyStarCount }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
59
|
+
import_icons.Icon,
|
|
60
|
+
{
|
|
61
|
+
className: "block-directory-block-ratings__star-empty",
|
|
62
|
+
icon: import_icons.starEmpty,
|
|
63
|
+
size: 16
|
|
64
|
+
},
|
|
65
|
+
`empty_stars_${i}`
|
|
66
|
+
))
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
);
|
|
44
70
|
}
|
|
45
|
-
var
|
|
46
|
-
//# sourceMappingURL=stars.js.map
|
|
71
|
+
var stars_default = Stars;
|
|
72
|
+
//# sourceMappingURL=stars.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/block-ratings/stars.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, 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;AAcE;AAXF,kBAA4B;AAC5B,mBAAsD;AAEtD,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,51 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
Object.
|
|
5
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
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
|
+
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;
|
|
18
|
+
};
|
|
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
|
+
var compact_list_exports = {};
|
|
29
|
+
__export(compact_list_exports, {
|
|
30
|
+
default: () => CompactList
|
|
6
31
|
});
|
|
7
|
-
exports
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
* WordPress dependencies
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Internal dependencies
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
function CompactList({
|
|
20
|
-
items
|
|
21
|
-
}) {
|
|
32
|
+
module.exports = __toCommonJS(compact_list_exports);
|
|
33
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
34
|
+
var import_i18n = require("@wordpress/i18n");
|
|
35
|
+
var import_downloadable_block_icon = __toESM(require("../downloadable-block-icon"));
|
|
36
|
+
function CompactList({ items }) {
|
|
22
37
|
if (!items.length) {
|
|
23
38
|
return null;
|
|
24
39
|
}
|
|
25
|
-
return
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
title: title
|
|
37
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
38
|
-
className: "block-directory-compact-list__item-details",
|
|
39
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
40
|
-
className: "block-directory-compact-list__item-title",
|
|
41
|
-
children: title
|
|
42
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
43
|
-
className: "block-directory-compact-list__item-author",
|
|
44
|
-
children: (0, _i18n.sprintf)(/* translators: %s: Name of the block author. */
|
|
45
|
-
(0, _i18n.__)('By %s'), author)
|
|
46
|
-
})]
|
|
47
|
-
})]
|
|
48
|
-
}, id))
|
|
49
|
-
});
|
|
40
|
+
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: [
|
|
41
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_downloadable_block_icon.default, { icon, title }),
|
|
42
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "block-directory-compact-list__item-details", children: [
|
|
43
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "block-directory-compact-list__item-title", children: title }),
|
|
44
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "block-directory-compact-list__item-author", children: (0, import_i18n.sprintf)(
|
|
45
|
+
/* translators: %s: Name of the block author. */
|
|
46
|
+
(0, import_i18n.__)("By %s"),
|
|
47
|
+
author
|
|
48
|
+
) })
|
|
49
|
+
] })
|
|
50
|
+
] }, id)) });
|
|
50
51
|
}
|
|
51
|
-
//# sourceMappingURL=index.js.map
|
|
52
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/compact-list/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\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;AAmBK;AAhBL,kBAA4B;AAK5B,qCAAkC;AAEnB,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,28 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
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
|
+
var downloadable_block_icon_exports = {};
|
|
19
|
+
__export(downloadable_block_icon_exports, {
|
|
20
|
+
default: () => downloadable_block_icon_default
|
|
5
21
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
function DownloadableBlockIcon({
|
|
14
|
-
icon
|
|
15
|
-
}) {
|
|
16
|
-
const className = 'block-directory-downloadable-block-icon';
|
|
17
|
-
return icon.match(/\.(jpeg|jpg|gif|png|svg)(?:\?.*)?$/) !== null ? /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
18
|
-
className: className,
|
|
19
|
-
src: icon,
|
|
20
|
-
alt: ""
|
|
21
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BlockIcon, {
|
|
22
|
-
className: className,
|
|
23
|
-
icon: icon,
|
|
24
|
-
showColors: true
|
|
25
|
-
});
|
|
22
|
+
module.exports = __toCommonJS(downloadable_block_icon_exports);
|
|
23
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
24
|
+
var import_block_editor = require("@wordpress/block-editor");
|
|
25
|
+
function DownloadableBlockIcon({ icon }) {
|
|
26
|
+
const className = "block-directory-downloadable-block-icon";
|
|
27
|
+
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 });
|
|
26
28
|
}
|
|
27
|
-
var
|
|
28
|
-
//# sourceMappingURL=index.js.map
|
|
29
|
+
var downloadable_block_icon_default = DownloadableBlockIcon;
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/downloadable-block-icon/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { 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;AAQE;AALF,0BAA0B;AAE1B,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
|
+
}
|