@wordpress/block-directory 5.32.0 → 5.32.1-next.b8c8708f3.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
package/build/store/selectors.js
CHANGED
|
@@ -1,145 +1,118 @@
|
|
|
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 selectors_exports = {};
|
|
19
|
+
__export(selectors_exports, {
|
|
20
|
+
getDownloadableBlocks: () => getDownloadableBlocks,
|
|
21
|
+
getErrorNoticeForBlock: () => getErrorNoticeForBlock,
|
|
22
|
+
getErrorNotices: () => getErrorNotices,
|
|
23
|
+
getInstalledBlockTypes: () => getInstalledBlockTypes,
|
|
24
|
+
getNewBlockTypes: () => getNewBlockTypes,
|
|
25
|
+
getUnusedBlockTypes: () => getUnusedBlockTypes,
|
|
26
|
+
isInstalling: () => isInstalling,
|
|
27
|
+
isRequestingDownloadableBlocks: () => isRequestingDownloadableBlocks
|
|
5
28
|
});
|
|
6
|
-
exports
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
exports.getInstalledBlockTypes = getInstalledBlockTypes;
|
|
10
|
-
exports.getUnusedBlockTypes = exports.getNewBlockTypes = void 0;
|
|
11
|
-
exports.isInstalling = isInstalling;
|
|
12
|
-
exports.isRequestingDownloadableBlocks = isRequestingDownloadableBlocks;
|
|
13
|
-
var _data = require("@wordpress/data");
|
|
14
|
-
var _blockEditor = require("@wordpress/block-editor");
|
|
15
|
-
/**
|
|
16
|
-
* WordPress dependencies
|
|
17
|
-
*/
|
|
18
|
-
|
|
29
|
+
module.exports = __toCommonJS(selectors_exports);
|
|
30
|
+
var import_data = require("@wordpress/data");
|
|
31
|
+
var import_block_editor = require("@wordpress/block-editor");
|
|
19
32
|
const EMPTY_ARRAY = [];
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Returns true if application is requesting for downloadable blocks.
|
|
23
|
-
*
|
|
24
|
-
* @param {Object} state Global application state.
|
|
25
|
-
* @param {string} filterValue Search string.
|
|
26
|
-
*
|
|
27
|
-
* @return {boolean} Whether a request is in progress for the blocks list.
|
|
28
|
-
*/
|
|
29
33
|
function isRequestingDownloadableBlocks(state, filterValue) {
|
|
30
|
-
|
|
31
|
-
return (_state$downloadableBl = state.downloadableBlocks[filterValue]?.isRequesting) !== null && _state$downloadableBl !== void 0 ? _state$downloadableBl : false;
|
|
34
|
+
return state.downloadableBlocks[filterValue]?.isRequesting ?? false;
|
|
32
35
|
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Returns the available uninstalled blocks.
|
|
36
|
-
*
|
|
37
|
-
* @param {Object} state Global application state.
|
|
38
|
-
* @param {string} filterValue Search string.
|
|
39
|
-
*
|
|
40
|
-
* @return {Array} Downloadable blocks.
|
|
41
|
-
*/
|
|
42
36
|
function getDownloadableBlocks(state, filterValue) {
|
|
43
|
-
|
|
44
|
-
return (_state$downloadableBl2 = state.downloadableBlocks[filterValue]?.results) !== null && _state$downloadableBl2 !== void 0 ? _state$downloadableBl2 : EMPTY_ARRAY;
|
|
37
|
+
return state.downloadableBlocks[filterValue]?.results ?? EMPTY_ARRAY;
|
|
45
38
|
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Returns the block types that have been installed on the server in this
|
|
49
|
-
* session.
|
|
50
|
-
*
|
|
51
|
-
* @param {Object} state Global application state.
|
|
52
|
-
*
|
|
53
|
-
* @return {Array} Block type items
|
|
54
|
-
*/
|
|
55
39
|
function getInstalledBlockTypes(state) {
|
|
56
40
|
return state.blockManagement.installedBlockTypes;
|
|
57
41
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
* @param {Object} state Global application state.
|
|
115
|
-
* @param {string} blockId Id of the block.
|
|
116
|
-
*
|
|
117
|
-
* @return {boolean} Whether this block is currently being installed.
|
|
118
|
-
*/
|
|
42
|
+
const getNewBlockTypes = (0, import_data.createRegistrySelector)(
|
|
43
|
+
(select) => (0, import_data.createSelector)(
|
|
44
|
+
(state) => {
|
|
45
|
+
const installedBlockTypes = getInstalledBlockTypes(state);
|
|
46
|
+
if (!installedBlockTypes.length) {
|
|
47
|
+
return EMPTY_ARRAY;
|
|
48
|
+
}
|
|
49
|
+
const { getBlockName, getClientIdsWithDescendants } = select(import_block_editor.store);
|
|
50
|
+
const installedBlockNames = installedBlockTypes.map(
|
|
51
|
+
(blockType) => blockType.name
|
|
52
|
+
);
|
|
53
|
+
const foundBlockNames = getClientIdsWithDescendants().flatMap(
|
|
54
|
+
(clientId) => {
|
|
55
|
+
const blockName = getBlockName(clientId);
|
|
56
|
+
return installedBlockNames.includes(blockName) ? blockName : [];
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
const newBlockTypes = installedBlockTypes.filter(
|
|
60
|
+
(blockType) => foundBlockNames.includes(blockType.name)
|
|
61
|
+
);
|
|
62
|
+
return newBlockTypes.length > 0 ? newBlockTypes : EMPTY_ARRAY;
|
|
63
|
+
},
|
|
64
|
+
(state) => [
|
|
65
|
+
getInstalledBlockTypes(state),
|
|
66
|
+
select(import_block_editor.store).getClientIdsWithDescendants()
|
|
67
|
+
]
|
|
68
|
+
)
|
|
69
|
+
);
|
|
70
|
+
const getUnusedBlockTypes = (0, import_data.createRegistrySelector)(
|
|
71
|
+
(select) => (0, import_data.createSelector)(
|
|
72
|
+
(state) => {
|
|
73
|
+
const installedBlockTypes = getInstalledBlockTypes(state);
|
|
74
|
+
if (!installedBlockTypes.length) {
|
|
75
|
+
return EMPTY_ARRAY;
|
|
76
|
+
}
|
|
77
|
+
const { getBlockName, getClientIdsWithDescendants } = select(import_block_editor.store);
|
|
78
|
+
const installedBlockNames = installedBlockTypes.map(
|
|
79
|
+
(blockType) => blockType.name
|
|
80
|
+
);
|
|
81
|
+
const foundBlockNames = getClientIdsWithDescendants().flatMap(
|
|
82
|
+
(clientId) => {
|
|
83
|
+
const blockName = getBlockName(clientId);
|
|
84
|
+
return installedBlockNames.includes(blockName) ? blockName : [];
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
const unusedBlockTypes = installedBlockTypes.filter(
|
|
88
|
+
(blockType) => !foundBlockNames.includes(blockType.name)
|
|
89
|
+
);
|
|
90
|
+
return unusedBlockTypes.length > 0 ? unusedBlockTypes : EMPTY_ARRAY;
|
|
91
|
+
},
|
|
92
|
+
(state) => [
|
|
93
|
+
getInstalledBlockTypes(state),
|
|
94
|
+
select(import_block_editor.store).getClientIdsWithDescendants()
|
|
95
|
+
]
|
|
96
|
+
)
|
|
97
|
+
);
|
|
119
98
|
function isInstalling(state, blockId) {
|
|
120
99
|
return state.blockManagement.isInstalling[blockId] || false;
|
|
121
100
|
}
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Returns all block error notices.
|
|
125
|
-
*
|
|
126
|
-
* @param {Object} state Global application state.
|
|
127
|
-
*
|
|
128
|
-
* @return {Object} Object with error notices.
|
|
129
|
-
*/
|
|
130
101
|
function getErrorNotices(state) {
|
|
131
102
|
return state.errorNotices;
|
|
132
103
|
}
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* Returns the error notice for a given block.
|
|
136
|
-
*
|
|
137
|
-
* @param {Object} state Global application state.
|
|
138
|
-
* @param {string} blockId The ID of the block plugin. eg: my-block
|
|
139
|
-
*
|
|
140
|
-
* @return {string|boolean} The error text, or false if no error.
|
|
141
|
-
*/
|
|
142
104
|
function getErrorNoticeForBlock(state, blockId) {
|
|
143
105
|
return state.errorNotices[blockId];
|
|
144
106
|
}
|
|
145
|
-
|
|
107
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
108
|
+
0 && (module.exports = {
|
|
109
|
+
getDownloadableBlocks,
|
|
110
|
+
getErrorNoticeForBlock,
|
|
111
|
+
getErrorNotices,
|
|
112
|
+
getInstalledBlockTypes,
|
|
113
|
+
getNewBlockTypes,
|
|
114
|
+
getUnusedBlockTypes,
|
|
115
|
+
isInstalling,
|
|
116
|
+
isRequestingDownloadableBlocks
|
|
117
|
+
});
|
|
118
|
+
//# sourceMappingURL=selectors.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/store/selectors.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createSelector, createRegistrySelector } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nconst EMPTY_ARRAY = [];\n\n/**\n * Returns true if application is requesting for downloadable blocks.\n *\n * @param {Object} state Global application state.\n * @param {string} filterValue Search string.\n *\n * @return {boolean} Whether a request is in progress for the blocks list.\n */\nexport function isRequestingDownloadableBlocks( state, filterValue ) {\n\treturn state.downloadableBlocks[ filterValue ]?.isRequesting ?? false;\n}\n\n/**\n * Returns the available uninstalled blocks.\n *\n * @param {Object} state Global application state.\n * @param {string} filterValue Search string.\n *\n * @return {Array} Downloadable blocks.\n */\nexport function getDownloadableBlocks( state, filterValue ) {\n\treturn state.downloadableBlocks[ filterValue ]?.results ?? EMPTY_ARRAY;\n}\n\n/**\n * Returns the block types that have been installed on the server in this\n * session.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} Block type items\n */\nexport function getInstalledBlockTypes( state ) {\n\treturn state.blockManagement.installedBlockTypes;\n}\n\n/**\n * Returns block types that have been installed on the server and used in the\n * current post.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} Block type items.\n */\nexport const getNewBlockTypes = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state ) => {\n\t\t\tconst installedBlockTypes = getInstalledBlockTypes( state );\n\t\t\tif ( ! installedBlockTypes.length ) {\n\t\t\t\treturn EMPTY_ARRAY;\n\t\t\t}\n\n\t\t\tconst { getBlockName, getClientIdsWithDescendants } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst installedBlockNames = installedBlockTypes.map(\n\t\t\t\t( blockType ) => blockType.name\n\t\t\t);\n\t\t\tconst foundBlockNames = getClientIdsWithDescendants().flatMap(\n\t\t\t\t( clientId ) => {\n\t\t\t\t\tconst blockName = getBlockName( clientId );\n\t\t\t\t\treturn installedBlockNames.includes( blockName )\n\t\t\t\t\t\t? blockName\n\t\t\t\t\t\t: [];\n\t\t\t\t}\n\t\t\t);\n\t\t\tconst newBlockTypes = installedBlockTypes.filter( ( blockType ) =>\n\t\t\t\tfoundBlockNames.includes( blockType.name )\n\t\t\t);\n\n\t\t\treturn newBlockTypes.length > 0 ? newBlockTypes : EMPTY_ARRAY;\n\t\t},\n\t\t( state ) => [\n\t\t\tgetInstalledBlockTypes( state ),\n\t\t\tselect( blockEditorStore ).getClientIdsWithDescendants(),\n\t\t]\n\t)\n);\n\n/**\n * Returns the block types that have been installed on the server but are not\n * used in the current post.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} Block type items.\n */\nexport const getUnusedBlockTypes = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state ) => {\n\t\t\tconst installedBlockTypes = getInstalledBlockTypes( state );\n\t\t\tif ( ! installedBlockTypes.length ) {\n\t\t\t\treturn EMPTY_ARRAY;\n\t\t\t}\n\n\t\t\tconst { getBlockName, getClientIdsWithDescendants } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst installedBlockNames = installedBlockTypes.map(\n\t\t\t\t( blockType ) => blockType.name\n\t\t\t);\n\t\t\tconst foundBlockNames = getClientIdsWithDescendants().flatMap(\n\t\t\t\t( clientId ) => {\n\t\t\t\t\tconst blockName = getBlockName( clientId );\n\t\t\t\t\treturn installedBlockNames.includes( blockName )\n\t\t\t\t\t\t? blockName\n\t\t\t\t\t\t: [];\n\t\t\t\t}\n\t\t\t);\n\t\t\tconst unusedBlockTypes = installedBlockTypes.filter(\n\t\t\t\t( blockType ) => ! foundBlockNames.includes( blockType.name )\n\t\t\t);\n\n\t\t\treturn unusedBlockTypes.length > 0 ? unusedBlockTypes : EMPTY_ARRAY;\n\t\t},\n\t\t( state ) => [\n\t\t\tgetInstalledBlockTypes( state ),\n\t\t\tselect( blockEditorStore ).getClientIdsWithDescendants(),\n\t\t]\n\t)\n);\n\n/**\n * Returns true if a block plugin install is in progress.\n *\n * @param {Object} state Global application state.\n * @param {string} blockId Id of the block.\n *\n * @return {boolean} Whether this block is currently being installed.\n */\nexport function isInstalling( state, blockId ) {\n\treturn state.blockManagement.isInstalling[ blockId ] || false;\n}\n\n/**\n * Returns all block error notices.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Object with error notices.\n */\nexport function getErrorNotices( state ) {\n\treturn state.errorNotices;\n}\n\n/**\n * Returns the error notice for a given block.\n *\n * @param {Object} state Global application state.\n * @param {string} blockId The ID of the block plugin. eg: my-block\n *\n * @return {string|boolean} The error text, or false if no error.\n */\nexport function getErrorNoticeForBlock( state, blockId ) {\n\treturn state.errorNotices[ blockId ];\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAuD;AACvD,0BAA0C;AAE1C,MAAM,cAAc,CAAC;AAUd,SAAS,+BAAgC,OAAO,aAAc;AACpE,SAAO,MAAM,mBAAoB,WAAY,GAAG,gBAAgB;AACjE;AAUO,SAAS,sBAAuB,OAAO,aAAc;AAC3D,SAAO,MAAM,mBAAoB,WAAY,GAAG,WAAW;AAC5D;AAUO,SAAS,uBAAwB,OAAQ;AAC/C,SAAO,MAAM,gBAAgB;AAC9B;AAUO,MAAM,uBAAmB;AAAA,EAAwB,CAAE,eACzD;AAAA,IACC,CAAE,UAAW;AACZ,YAAM,sBAAsB,uBAAwB,KAAM;AAC1D,UAAK,CAAE,oBAAoB,QAAS;AACnC,eAAO;AAAA,MACR;AAEA,YAAM,EAAE,cAAc,4BAA4B,IACjD,OAAQ,oBAAAA,KAAiB;AAC1B,YAAM,sBAAsB,oBAAoB;AAAA,QAC/C,CAAE,cAAe,UAAU;AAAA,MAC5B;AACA,YAAM,kBAAkB,4BAA4B,EAAE;AAAA,QACrD,CAAE,aAAc;AACf,gBAAM,YAAY,aAAc,QAAS;AACzC,iBAAO,oBAAoB,SAAU,SAAU,IAC5C,YACA,CAAC;AAAA,QACL;AAAA,MACD;AACA,YAAM,gBAAgB,oBAAoB;AAAA,QAAQ,CAAE,cACnD,gBAAgB,SAAU,UAAU,IAAK;AAAA,MAC1C;AAEA,aAAO,cAAc,SAAS,IAAI,gBAAgB;AAAA,IACnD;AAAA,IACA,CAAE,UAAW;AAAA,MACZ,uBAAwB,KAAM;AAAA,MAC9B,OAAQ,oBAAAA,KAAiB,EAAE,4BAA4B;AAAA,IACxD;AAAA,EACD;AACD;AAUO,MAAM,0BAAsB;AAAA,EAAwB,CAAE,eAC5D;AAAA,IACC,CAAE,UAAW;AACZ,YAAM,sBAAsB,uBAAwB,KAAM;AAC1D,UAAK,CAAE,oBAAoB,QAAS;AACnC,eAAO;AAAA,MACR;AAEA,YAAM,EAAE,cAAc,4BAA4B,IACjD,OAAQ,oBAAAA,KAAiB;AAC1B,YAAM,sBAAsB,oBAAoB;AAAA,QAC/C,CAAE,cAAe,UAAU;AAAA,MAC5B;AACA,YAAM,kBAAkB,4BAA4B,EAAE;AAAA,QACrD,CAAE,aAAc;AACf,gBAAM,YAAY,aAAc,QAAS;AACzC,iBAAO,oBAAoB,SAAU,SAAU,IAC5C,YACA,CAAC;AAAA,QACL;AAAA,MACD;AACA,YAAM,mBAAmB,oBAAoB;AAAA,QAC5C,CAAE,cAAe,CAAE,gBAAgB,SAAU,UAAU,IAAK;AAAA,MAC7D;AAEA,aAAO,iBAAiB,SAAS,IAAI,mBAAmB;AAAA,IACzD;AAAA,IACA,CAAE,UAAW;AAAA,MACZ,uBAAwB,KAAM;AAAA,MAC9B,OAAQ,oBAAAA,KAAiB,EAAE,4BAA4B;AAAA,IACxD;AAAA,EACD;AACD;AAUO,SAAS,aAAc,OAAO,SAAU;AAC9C,SAAO,MAAM,gBAAgB,aAAc,OAAQ,KAAK;AACzD;AASO,SAAS,gBAAiB,OAAQ;AACxC,SAAO,MAAM;AACd;AAUO,SAAS,uBAAwB,OAAO,SAAU;AACxD,SAAO,MAAM,aAAc,OAAQ;AACpC;",
|
|
6
|
+
"names": ["blockEditorStore"]
|
|
7
|
+
}
|
|
@@ -1,24 +1,33 @@
|
|
|
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 get_plugin_url_exports = {};
|
|
19
|
+
__export(get_plugin_url_exports, {
|
|
20
|
+
default: () => getPluginUrl
|
|
5
21
|
});
|
|
6
|
-
exports
|
|
7
|
-
/**
|
|
8
|
-
* Get the plugin's direct API link out of a block-directory response.
|
|
9
|
-
*
|
|
10
|
-
* @param {Object} block The block object
|
|
11
|
-
*
|
|
12
|
-
* @return {string} The plugin URL, if exists.
|
|
13
|
-
*/
|
|
22
|
+
module.exports = __toCommonJS(get_plugin_url_exports);
|
|
14
23
|
function getPluginUrl(block) {
|
|
15
24
|
if (!block) {
|
|
16
25
|
return false;
|
|
17
26
|
}
|
|
18
|
-
const link = block.links[
|
|
27
|
+
const link = block.links["wp:plugin"] || block.links.self;
|
|
19
28
|
if (link && link.length) {
|
|
20
29
|
return link[0].href;
|
|
21
30
|
}
|
|
22
31
|
return false;
|
|
23
32
|
}
|
|
24
|
-
//# sourceMappingURL=get-plugin-url.js.map
|
|
33
|
+
//# sourceMappingURL=get-plugin-url.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/store/utils/get-plugin-url.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * Get the plugin's direct API link out of a block-directory response.\n *\n * @param {Object} block The block object\n *\n * @return {string} The plugin URL, if exists.\n */\nexport default function getPluginUrl( block ) {\n\tif ( ! block ) {\n\t\treturn false;\n\t}\n\tconst link = block.links[ 'wp:plugin' ] || block.links.self;\n\tif ( link && link.length ) {\n\t\treturn link[ 0 ].href;\n\t}\n\treturn false;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOe,SAAR,aAA+B,OAAQ;AAC7C,MAAK,CAAE,OAAQ;AACd,WAAO;AAAA,EACR;AACA,QAAM,OAAO,MAAM,MAAO,WAAY,KAAK,MAAM,MAAM;AACvD,MAAK,QAAQ,KAAK,QAAS;AAC1B,WAAO,KAAM,CAAE,EAAE;AAAA,EAClB;AACA,SAAO;AACR;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,30 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
* Internal dependencies
|
|
11
|
-
*/
|
|
12
|
-
import { store as blockDirectoryStore } from '../../store';
|
|
13
|
-
export default function AutoBlockUninstaller() {
|
|
14
|
-
const {
|
|
15
|
-
uninstallBlockType
|
|
16
|
-
} = useDispatch(blockDirectoryStore);
|
|
17
|
-
const shouldRemoveBlockTypes = useSelect(select => {
|
|
18
|
-
const {
|
|
19
|
-
isAutosavingPost,
|
|
20
|
-
isSavingPost
|
|
21
|
-
} = select(editorStore);
|
|
1
|
+
import { unregisterBlockType } from "@wordpress/blocks";
|
|
2
|
+
import { useDispatch, useSelect } from "@wordpress/data";
|
|
3
|
+
import { useEffect } from "@wordpress/element";
|
|
4
|
+
import { store as editorStore } from "@wordpress/editor";
|
|
5
|
+
import { store as blockDirectoryStore } from "../../store";
|
|
6
|
+
function AutoBlockUninstaller() {
|
|
7
|
+
const { uninstallBlockType } = useDispatch(blockDirectoryStore);
|
|
8
|
+
const shouldRemoveBlockTypes = useSelect((select) => {
|
|
9
|
+
const { isAutosavingPost, isSavingPost } = select(editorStore);
|
|
22
10
|
return isSavingPost() && !isAutosavingPost();
|
|
23
11
|
}, []);
|
|
24
|
-
const unusedBlockTypes = useSelect(
|
|
12
|
+
const unusedBlockTypes = useSelect(
|
|
13
|
+
(select) => select(blockDirectoryStore).getUnusedBlockTypes(),
|
|
14
|
+
[]
|
|
15
|
+
);
|
|
25
16
|
useEffect(() => {
|
|
26
17
|
if (shouldRemoveBlockTypes && unusedBlockTypes.length) {
|
|
27
|
-
unusedBlockTypes.forEach(blockType => {
|
|
18
|
+
unusedBlockTypes.forEach((blockType) => {
|
|
28
19
|
uninstallBlockType(blockType);
|
|
29
20
|
unregisterBlockType(blockType.name);
|
|
30
21
|
});
|
|
@@ -32,4 +23,7 @@ export default function AutoBlockUninstaller() {
|
|
|
32
23
|
}, [shouldRemoveBlockTypes]);
|
|
33
24
|
return null;
|
|
34
25
|
}
|
|
35
|
-
|
|
26
|
+
export {
|
|
27
|
+
AutoBlockUninstaller as default
|
|
28
|
+
};
|
|
29
|
+
//# 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": "AAGA,SAAS,2BAA2B;AACpC,SAAS,aAAa,iBAAiB;AACvC,SAAS,iBAAiB;AAC1B,SAAS,SAAS,mBAAmB;AAKrC,SAAS,SAAS,2BAA2B;AAE9B,SAAR,uBAAwC;AAC9C,QAAM,EAAE,mBAAmB,IAAI,YAAa,mBAAoB;AAEhE,QAAM,yBAAyB,UAAW,CAAE,WAAY;AACvD,UAAM,EAAE,kBAAkB,aAAa,IAAI,OAAQ,WAAY;AAC/D,WAAO,aAAa,KAAK,CAAE,iBAAiB;AAAA,EAC7C,GAAG,CAAC,CAAE;AAEN,QAAM,mBAAmB;AAAA,IACxB,CAAE,WAAY,OAAQ,mBAAoB,EAAE,oBAAoB;AAAA,IAChE,CAAC;AAAA,EACF;AAEA,YAAW,MAAM;AAChB,QAAK,0BAA0B,iBAAiB,QAAS;AACxD,uBAAiB,QAAS,CAAE,cAAe;AAC1C,2BAAoB,SAAU;AAC9B,4BAAqB,UAAU,IAAK;AAAA,MACrC,CAAE;AAAA,IACH;AAAA,EACD,GAAG,CAAE,sBAAuB,CAAE;AAE9B,SAAO;AACR;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
children: /*#__PURE__*/_jsx(Stars, {
|
|
11
|
-
rating: rating
|
|
12
|
-
})
|
|
13
|
-
});
|
|
14
|
-
export default BlockRatings;
|
|
15
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import Stars from "./stars";
|
|
3
|
+
const BlockRatings = ({ rating }) => /* @__PURE__ */ jsx("span", { className: "block-directory-block-ratings", children: /* @__PURE__ */ jsx(Stars, { rating }) });
|
|
4
|
+
var block_ratings_default = BlockRatings;
|
|
5
|
+
export {
|
|
6
|
+
BlockRatings,
|
|
7
|
+
block_ratings_default as default
|
|
8
|
+
};
|
|
9
|
+
//# 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": "AAOE;AAJF,OAAO,WAAW;AAEX,MAAM,eAAe,CAAE,EAAE,OAAO,MACtC,oBAAC,UAAK,WAAU,iCACf,8BAAC,SAAM,QAAkB,GAC1B;AAGD,IAAO,wBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,39 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { Icon, starEmpty, starFilled, starHalf } from '@wordpress/icons';
|
|
6
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
-
function Stars({
|
|
8
|
-
rating
|
|
9
|
-
}) {
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { __, sprintf } from "@wordpress/i18n";
|
|
3
|
+
import { Icon, starEmpty, starFilled, starHalf } from "@wordpress/icons";
|
|
4
|
+
function Stars({ rating }) {
|
|
10
5
|
const stars = Math.round(rating / 0.5) * 0.5;
|
|
11
6
|
const fullStarCount = Math.floor(rating);
|
|
12
7
|
const halfStarCount = Math.ceil(rating - fullStarCount);
|
|
13
8
|
const emptyStarCount = 5 - (fullStarCount + halfStarCount);
|
|
14
|
-
return
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
9
|
+
return /* @__PURE__ */ jsxs(
|
|
10
|
+
"span",
|
|
11
|
+
{
|
|
12
|
+
"aria-label": sprintf(
|
|
13
|
+
/* translators: %s: number of stars. */
|
|
14
|
+
__("%s out of 5 stars"),
|
|
15
|
+
stars
|
|
16
|
+
),
|
|
17
|
+
children: [
|
|
18
|
+
Array.from({ length: fullStarCount }).map((_, i) => /* @__PURE__ */ jsx(
|
|
19
|
+
Icon,
|
|
20
|
+
{
|
|
21
|
+
className: "block-directory-block-ratings__star-full",
|
|
22
|
+
icon: starFilled,
|
|
23
|
+
size: 16
|
|
24
|
+
},
|
|
25
|
+
`full_stars_${i}`
|
|
26
|
+
)),
|
|
27
|
+
Array.from({ length: halfStarCount }).map((_, i) => /* @__PURE__ */ jsx(
|
|
28
|
+
Icon,
|
|
29
|
+
{
|
|
30
|
+
className: "block-directory-block-ratings__star-half-full",
|
|
31
|
+
icon: starHalf,
|
|
32
|
+
size: 16
|
|
33
|
+
},
|
|
34
|
+
`half_stars_${i}`
|
|
35
|
+
)),
|
|
36
|
+
Array.from({ length: emptyStarCount }).map((_, i) => /* @__PURE__ */ jsx(
|
|
37
|
+
Icon,
|
|
38
|
+
{
|
|
39
|
+
className: "block-directory-block-ratings__star-empty",
|
|
40
|
+
icon: starEmpty,
|
|
41
|
+
size: 16
|
|
42
|
+
},
|
|
43
|
+
`empty_stars_${i}`
|
|
44
|
+
))
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
);
|
|
37
48
|
}
|
|
38
|
-
|
|
39
|
-
|
|
49
|
+
var stars_default = Stars;
|
|
50
|
+
export {
|
|
51
|
+
stars_default as default
|
|
52
|
+
};
|
|
53
|
+
//# 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": "AAcE,SAQE,KARF;AAXF,SAAS,IAAI,eAAe;AAC5B,SAAS,MAAM,WAAW,YAAY,gBAAgB;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,cAAa;AAAA;AAAA,QAEZ,GAAI,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,43 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Internal dependencies
|
|
8
|
-
*/
|
|
9
|
-
import DownloadableBlockIcon from '../downloadable-block-icon';
|
|
10
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
-
export default function CompactList({
|
|
12
|
-
items
|
|
13
|
-
}) {
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { __, sprintf } from "@wordpress/i18n";
|
|
3
|
+
import DownloadableBlockIcon from "../downloadable-block-icon";
|
|
4
|
+
function CompactList({ items }) {
|
|
14
5
|
if (!items.length) {
|
|
15
6
|
return null;
|
|
16
7
|
}
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
children:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
title: title
|
|
29
|
-
}), /*#__PURE__*/_jsxs("div", {
|
|
30
|
-
className: "block-directory-compact-list__item-details",
|
|
31
|
-
children: [/*#__PURE__*/_jsx("div", {
|
|
32
|
-
className: "block-directory-compact-list__item-title",
|
|
33
|
-
children: title
|
|
34
|
-
}), /*#__PURE__*/_jsx("div", {
|
|
35
|
-
className: "block-directory-compact-list__item-author",
|
|
36
|
-
children: sprintf(/* translators: %s: Name of the block author. */
|
|
37
|
-
__('By %s'), author)
|
|
38
|
-
})]
|
|
39
|
-
})]
|
|
40
|
-
}, id))
|
|
41
|
-
});
|
|
8
|
+
return /* @__PURE__ */ jsx("ul", { className: "block-directory-compact-list", children: items.map(({ icon, id, title, author }) => /* @__PURE__ */ jsxs("li", { className: "block-directory-compact-list__item", children: [
|
|
9
|
+
/* @__PURE__ */ jsx(DownloadableBlockIcon, { icon, title }),
|
|
10
|
+
/* @__PURE__ */ jsxs("div", { className: "block-directory-compact-list__item-details", children: [
|
|
11
|
+
/* @__PURE__ */ jsx("div", { className: "block-directory-compact-list__item-title", children: title }),
|
|
12
|
+
/* @__PURE__ */ jsx("div", { className: "block-directory-compact-list__item-author", children: sprintf(
|
|
13
|
+
/* translators: %s: Name of the block author. */
|
|
14
|
+
__("By %s"),
|
|
15
|
+
author
|
|
16
|
+
) })
|
|
17
|
+
] })
|
|
18
|
+
] }, id)) });
|
|
42
19
|
}
|
|
43
|
-
|
|
20
|
+
export {
|
|
21
|
+
CompactList as default
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=index.js.map
|