@wordpress/block-directory 6.0.0 → 6.2.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.cjs +26 -47
- package/build/components/auto-block-uninstaller/index.cjs.map +1 -7
- package/build/components/block-ratings/index.cjs +28 -34
- package/build/components/block-ratings/index.cjs.map +1 -7
- package/build/components/block-ratings/stars.cjs +35 -71
- package/build/components/block-ratings/stars.cjs.map +1 -7
- package/build/components/compact-list/index.cjs +45 -43
- package/build/components/compact-list/index.cjs.map +1 -7
- package/build/components/downloadable-block-icon/index.cjs +20 -29
- package/build/components/downloadable-block-icon/index.cjs.map +1 -7
- package/build/components/downloadable-block-list-item/index.cjs +95 -161
- package/build/components/downloadable-block-list-item/index.cjs.map +1 -7
- package/build/components/downloadable-block-notice/index.cjs +22 -46
- package/build/components/downloadable-block-notice/index.cjs.map +1 -7
- package/build/components/downloadable-blocks-list/index.cjs +50 -70
- package/build/components/downloadable-blocks-list/index.cjs.map +1 -7
- package/build/components/downloadable-blocks-panel/index.cjs +79 -119
- package/build/components/downloadable-blocks-panel/index.cjs.map +1 -7
- package/build/components/downloadable-blocks-panel/inserter-panel.cjs +37 -61
- package/build/components/downloadable-blocks-panel/inserter-panel.cjs.map +1 -7
- package/build/components/downloadable-blocks-panel/no-results.cjs +27 -46
- package/build/components/downloadable-blocks-panel/no-results.cjs.map +1 -7
- package/build/index.cjs +11 -29
- package/build/plugins/get-install-missing/index.cjs +80 -122
- package/build/plugins/get-install-missing/index.cjs.map +1 -7
- package/build/plugins/get-install-missing/install-button.cjs +33 -70
- package/build/plugins/get-install-missing/install-button.cjs.map +1 -7
- package/build/plugins/index.cjs +45 -45
- package/build/plugins/index.cjs.map +1 -7
- package/build/plugins/inserter-menu-downloadable-blocks-panel/index.cjs +40 -52
- package/build/plugins/inserter-menu-downloadable-blocks-panel/index.cjs.map +1 -7
- package/build/plugins/installed-blocks-pre-publish-panel/index.cjs +38 -62
- package/build/plugins/installed-blocks-pre-publish-panel/index.cjs.map +1 -7
- package/build/store/actions.cjs +233 -205
- package/build/store/actions.cjs.map +1 -7
- package/build/store/index.cjs +56 -45
- package/build/store/index.cjs.map +1 -7
- package/build/store/load-assets.cjs +62 -63
- package/build/store/load-assets.cjs.map +1 -7
- package/build/store/reducer.cjs +90 -101
- package/build/store/reducer.cjs.map +1 -7
- package/build/store/resolvers.cjs +34 -54
- package/build/store/resolvers.cjs.map +1 -7
- package/build/store/selectors.cjs +111 -107
- package/build/store/selectors.cjs.map +1 -7
- package/build/store/utils/get-plugin-url.cjs +19 -32
- package/build/store/utils/get-plugin-url.cjs.map +1 -7
- package/build-module/components/auto-block-uninstaller/index.mjs +19 -25
- package/build-module/components/auto-block-uninstaller/index.mjs.map +1 -7
- package/build-module/components/block-ratings/index.mjs +8 -8
- package/build-module/components/block-ratings/index.mjs.map +1 -7
- package/build-module/components/block-ratings/stars.mjs +28 -49
- package/build-module/components/block-ratings/stars.mjs.map +1 -7
- package/build-module/components/compact-list/index.mjs +24 -19
- package/build-module/components/compact-list/index.mjs.map +1 -7
- package/build-module/components/downloadable-block-icon/index.mjs +14 -8
- package/build-module/components/downloadable-block-icon/index.mjs.map +1 -7
- package/build-module/components/downloadable-block-list-item/index.mjs +64 -130
- package/build-module/components/downloadable-block-list-item/index.mjs.map +1 -7
- package/build-module/components/downloadable-block-notice/index.mjs +16 -22
- package/build-module/components/downloadable-block-notice/index.mjs.map +1 -7
- package/build-module/components/downloadable-blocks-list/index.mjs +26 -43
- package/build-module/components/downloadable-blocks-list/index.mjs.map +1 -7
- package/build-module/components/downloadable-blocks-panel/index.mjs +52 -91
- package/build-module/components/downloadable-blocks-panel/index.mjs.map +1 -7
- package/build-module/components/downloadable-blocks-panel/inserter-panel.mjs +29 -38
- package/build-module/components/downloadable-blocks-panel/inserter-panel.mjs.map +1 -7
- package/build-module/components/downloadable-blocks-panel/no-results.mjs +19 -23
- package/build-module/components/downloadable-blocks-panel/no-results.mjs.map +1 -7
- package/build-module/index.mjs +1 -6
- package/build-module/plugins/get-install-missing/index.mjs +55 -98
- package/build-module/plugins/get-install-missing/index.mjs.map +1 -7
- package/build-module/plugins/get-install-missing/install-button.mjs +25 -47
- package/build-module/plugins/get-install-missing/install-button.mjs.map +1 -7
- package/build-module/plugins/index.mjs +16 -23
- package/build-module/plugins/index.mjs.map +1 -7
- package/build-module/plugins/inserter-menu-downloadable-blocks-panel/index.mjs +17 -26
- package/build-module/plugins/inserter-menu-downloadable-blocks-panel/index.mjs.map +1 -7
- package/build-module/plugins/installed-blocks-pre-publish-panel/index.mjs +15 -36
- package/build-module/plugins/installed-blocks-pre-publish-panel/index.mjs.map +1 -7
- package/build-module/store/actions.mjs +201 -170
- package/build-module/store/actions.mjs.map +1 -7
- package/build-module/store/index.mjs +28 -13
- package/build-module/store/index.mjs.map +1 -7
- package/build-module/store/load-assets.mjs +42 -36
- package/build-module/store/load-assets.mjs.map +1 -7
- package/build-module/store/reducer.mjs +81 -74
- package/build-module/store/reducer.mjs.map +1 -7
- package/build-module/store/resolvers.mjs +13 -26
- package/build-module/store/resolvers.mjs.map +1 -7
- package/build-module/store/selectors.mjs +99 -76
- package/build-module/store/selectors.mjs.map +1 -7
- package/build-module/store/utils/get-plugin-url.mjs +14 -12
- package/build-module/store/utils/get-plugin-url.mjs.map +1 -7
- package/build-style/style-rtl.css +6 -12
- package/build-style/style.css +6 -12
- package/package.json +22 -23
- package/src/components/downloadable-block-list-item/style.scss +6 -6
- package/src/components/downloadable-block-notice/index.jsx +0 -4
- package/build/index.cjs.map +0 -7
- package/build/lock-unlock.cjs +0 -36
- package/build/lock-unlock.cjs.map +0 -7
- package/build-module/index.mjs.map +0 -7
- package/build-module/lock-unlock.mjs +0 -11
- package/build-module/lock-unlock.mjs.map +0 -7
- package/src/lock-unlock.js +0 -7
|
@@ -1,89 +1,112 @@
|
|
|
1
|
+
import { createRegistrySelector, createSelector } from "@wordpress/data";
|
|
2
|
+
import { store } from "@wordpress/block-editor";
|
|
1
3
|
// packages/block-directory/src/store/selectors.js
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
const EMPTY_ARRAY = [];
|
|
5
|
+
/**
|
|
6
|
+
* Returns true if application is requesting for downloadable blocks.
|
|
7
|
+
*
|
|
8
|
+
* @param {Object} state Global application state.
|
|
9
|
+
* @param {string} filterValue Search string.
|
|
10
|
+
*
|
|
11
|
+
* @return {boolean} Whether a request is in progress for the blocks list.
|
|
12
|
+
*/
|
|
5
13
|
function isRequestingDownloadableBlocks(state, filterValue) {
|
|
6
|
-
|
|
14
|
+
return state.downloadableBlocks[filterValue]?.isRequesting ?? false;
|
|
7
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Returns the available uninstalled blocks.
|
|
18
|
+
*
|
|
19
|
+
* @param {Object} state Global application state.
|
|
20
|
+
* @param {string} filterValue Search string.
|
|
21
|
+
*
|
|
22
|
+
* @return {Array} Downloadable blocks.
|
|
23
|
+
*/
|
|
8
24
|
function getDownloadableBlocks(state, filterValue) {
|
|
9
|
-
|
|
25
|
+
return state.downloadableBlocks[filterValue]?.results ?? EMPTY_ARRAY;
|
|
10
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Returns the block types that have been installed on the server in this
|
|
29
|
+
* session.
|
|
30
|
+
*
|
|
31
|
+
* @param {Object} state Global application state.
|
|
32
|
+
*
|
|
33
|
+
* @return {Array} Block type items
|
|
34
|
+
*/
|
|
11
35
|
function getInstalledBlockTypes(state) {
|
|
12
|
-
|
|
36
|
+
return state.blockManagement.installedBlockTypes;
|
|
13
37
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return unusedBlockTypes.length > 0 ? unusedBlockTypes : EMPTY_ARRAY;
|
|
63
|
-
},
|
|
64
|
-
(state) => [
|
|
65
|
-
getInstalledBlockTypes(state),
|
|
66
|
-
select(blockEditorStore).getClientIdsWithDescendants()
|
|
67
|
-
]
|
|
68
|
-
)
|
|
69
|
-
);
|
|
38
|
+
/**
|
|
39
|
+
* Returns block types that have been installed on the server and used in the
|
|
40
|
+
* current post.
|
|
41
|
+
*
|
|
42
|
+
* @param {Object} state Global application state.
|
|
43
|
+
*
|
|
44
|
+
* @return {Array} Block type items.
|
|
45
|
+
*/
|
|
46
|
+
const getNewBlockTypes = createRegistrySelector((select) => createSelector((state) => {
|
|
47
|
+
const installedBlockTypes = getInstalledBlockTypes(state);
|
|
48
|
+
if (!installedBlockTypes.length) return EMPTY_ARRAY;
|
|
49
|
+
const { getBlockName, getClientIdsWithDescendants } = select(store);
|
|
50
|
+
const installedBlockNames = installedBlockTypes.map((blockType) => blockType.name);
|
|
51
|
+
const foundBlockNames = getClientIdsWithDescendants().flatMap((clientId) => {
|
|
52
|
+
const blockName = getBlockName(clientId);
|
|
53
|
+
return installedBlockNames.includes(blockName) ? blockName : [];
|
|
54
|
+
});
|
|
55
|
+
const newBlockTypes = installedBlockTypes.filter((blockType) => foundBlockNames.includes(blockType.name));
|
|
56
|
+
return newBlockTypes.length > 0 ? newBlockTypes : EMPTY_ARRAY;
|
|
57
|
+
}, (state) => [getInstalledBlockTypes(state), select(store).getClientIdsWithDescendants()]));
|
|
58
|
+
/**
|
|
59
|
+
* Returns the block types that have been installed on the server but are not
|
|
60
|
+
* used in the current post.
|
|
61
|
+
*
|
|
62
|
+
* @param {Object} state Global application state.
|
|
63
|
+
*
|
|
64
|
+
* @return {Array} Block type items.
|
|
65
|
+
*/
|
|
66
|
+
const getUnusedBlockTypes = createRegistrySelector((select) => createSelector((state) => {
|
|
67
|
+
const installedBlockTypes = getInstalledBlockTypes(state);
|
|
68
|
+
if (!installedBlockTypes.length) return EMPTY_ARRAY;
|
|
69
|
+
const { getBlockName, getClientIdsWithDescendants } = select(store);
|
|
70
|
+
const installedBlockNames = installedBlockTypes.map((blockType) => blockType.name);
|
|
71
|
+
const foundBlockNames = getClientIdsWithDescendants().flatMap((clientId) => {
|
|
72
|
+
const blockName = getBlockName(clientId);
|
|
73
|
+
return installedBlockNames.includes(blockName) ? blockName : [];
|
|
74
|
+
});
|
|
75
|
+
const unusedBlockTypes = installedBlockTypes.filter((blockType) => !foundBlockNames.includes(blockType.name));
|
|
76
|
+
return unusedBlockTypes.length > 0 ? unusedBlockTypes : EMPTY_ARRAY;
|
|
77
|
+
}, (state) => [getInstalledBlockTypes(state), select(store).getClientIdsWithDescendants()]));
|
|
78
|
+
/**
|
|
79
|
+
* Returns true if a block plugin install is in progress.
|
|
80
|
+
*
|
|
81
|
+
* @param {Object} state Global application state.
|
|
82
|
+
* @param {string} blockId Id of the block.
|
|
83
|
+
*
|
|
84
|
+
* @return {boolean} Whether this block is currently being installed.
|
|
85
|
+
*/
|
|
70
86
|
function isInstalling(state, blockId) {
|
|
71
|
-
|
|
87
|
+
return state.blockManagement.isInstalling[blockId] || false;
|
|
72
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* Returns all block error notices.
|
|
91
|
+
*
|
|
92
|
+
* @param {Object} state Global application state.
|
|
93
|
+
*
|
|
94
|
+
* @return {Object} Object with error notices.
|
|
95
|
+
*/
|
|
73
96
|
function getErrorNotices(state) {
|
|
74
|
-
|
|
97
|
+
return state.errorNotices;
|
|
75
98
|
}
|
|
99
|
+
/**
|
|
100
|
+
* Returns the error notice for a given block.
|
|
101
|
+
*
|
|
102
|
+
* @param {Object} state Global application state.
|
|
103
|
+
* @param {string} blockId The ID of the block plugin. eg: my-block
|
|
104
|
+
*
|
|
105
|
+
* @return {string|boolean} The error text, or false if no error.
|
|
106
|
+
*/
|
|
76
107
|
function getErrorNoticeForBlock(state, blockId) {
|
|
77
|
-
|
|
108
|
+
return state.errorNotices[blockId];
|
|
78
109
|
}
|
|
79
|
-
export {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
getErrorNotices,
|
|
83
|
-
getInstalledBlockTypes,
|
|
84
|
-
getNewBlockTypes,
|
|
85
|
-
getUnusedBlockTypes,
|
|
86
|
-
isInstalling,
|
|
87
|
-
isRequestingDownloadableBlocks
|
|
88
|
-
};
|
|
89
|
-
//# sourceMappingURL=selectors.mjs.map
|
|
110
|
+
export { getDownloadableBlocks, getErrorNoticeForBlock, getErrorNotices, getInstalledBlockTypes, getNewBlockTypes, getUnusedBlockTypes, isInstalling, isRequestingDownloadableBlocks };
|
|
111
|
+
|
|
112
|
+
//# sourceMappingURL=selectors.mjs.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/store/selectors.js"],
|
|
4
|
-
"sourcesContent": ["import { 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,SAAS,gBAAgB,8BAA8B;AACvD,SAAS,SAAS,wBAAwB;AAE1C,IAAM,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,IAAM,mBAAmB;AAAA,EAAwB,CAAE,WACzD;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,gBAAiB;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,gBAAiB,EAAE,4BAA4B;AAAA,IACxD;AAAA,EACD;AACD;AAUO,IAAM,sBAAsB;AAAA,EAAwB,CAAE,WAC5D;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,gBAAiB;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,gBAAiB,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": []
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"selectors.mjs","names":["blockEditorStore"],"sources":["../../src/store/selectors.js"],"sourcesContent":["import { 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"],"mappings":";;;AAGA,MAAM,cAAc,CAAC;;;;;;;;;AAUrB,SAAgB,+BAAgC,OAAO,aAAc;CACpE,OAAO,MAAM,mBAAoB,YAAa,EAAE,gBAAgB;AACjE;;;;;;;;;AAUA,SAAgB,sBAAuB,OAAO,aAAc;CAC3D,OAAO,MAAM,mBAAoB,YAAa,EAAE,WAAW;AAC5D;;;;;;;;;AAUA,SAAgB,uBAAwB,OAAQ;CAC/C,OAAO,MAAM,gBAAgB;AAC9B;;;;;;;;;AAUA,MAAa,mBAAmB,wBAA0B,WACzD,gBACG,UAAW;CACZ,MAAM,sBAAsB,uBAAwB,KAAM;CAC1D,IAAK,CAAE,oBAAoB,QAC1B,OAAO;CAGR,MAAM,EAAE,cAAc,gCACrB,OAAQA,KAAiB;CAC1B,MAAM,sBAAsB,oBAAoB,KAC7C,cAAe,UAAU,IAC5B;CACA,MAAM,kBAAkB,4BAA4B,CAAC,CAAC,SACnD,aAAc;EACf,MAAM,YAAY,aAAc,QAAS;EACzC,OAAO,oBAAoB,SAAU,SAAU,IAC5C,YACA,CAAC;CACL,CACD;CACA,MAAM,gBAAgB,oBAAoB,QAAU,cACnD,gBAAgB,SAAU,UAAU,IAAK,CAC1C;CAEA,OAAO,cAAc,SAAS,IAAI,gBAAgB;AACnD,IACE,UAAW,CACZ,uBAAwB,KAAM,GAC9B,OAAQA,KAAiB,CAAC,CAAC,4BAA4B,CACxD,CACD,CACD;;;;;;;;;AAUA,MAAa,sBAAsB,wBAA0B,WAC5D,gBACG,UAAW;CACZ,MAAM,sBAAsB,uBAAwB,KAAM;CAC1D,IAAK,CAAE,oBAAoB,QAC1B,OAAO;CAGR,MAAM,EAAE,cAAc,gCACrB,OAAQA,KAAiB;CAC1B,MAAM,sBAAsB,oBAAoB,KAC7C,cAAe,UAAU,IAC5B;CACA,MAAM,kBAAkB,4BAA4B,CAAC,CAAC,SACnD,aAAc;EACf,MAAM,YAAY,aAAc,QAAS;EACzC,OAAO,oBAAoB,SAAU,SAAU,IAC5C,YACA,CAAC;CACL,CACD;CACA,MAAM,mBAAmB,oBAAoB,QAC1C,cAAe,CAAE,gBAAgB,SAAU,UAAU,IAAK,CAC7D;CAEA,OAAO,iBAAiB,SAAS,IAAI,mBAAmB;AACzD,IACE,UAAW,CACZ,uBAAwB,KAAM,GAC9B,OAAQA,KAAiB,CAAC,CAAC,4BAA4B,CACxD,CACD,CACD;;;;;;;;;AAUA,SAAgB,aAAc,OAAO,SAAU;CAC9C,OAAO,MAAM,gBAAgB,aAAc,YAAa;AACzD;;;;;;;;AASA,SAAgB,gBAAiB,OAAQ;CACxC,OAAO,MAAM;AACd;;;;;;;;;AAUA,SAAgB,uBAAwB,OAAO,SAAU;CACxD,OAAO,MAAM,aAAc;AAC5B"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
// packages/block-directory/src/store/utils/get-plugin-url.js
|
|
2
|
+
/**
|
|
3
|
+
* Get the plugin's direct API link out of a block-directory response.
|
|
4
|
+
*
|
|
5
|
+
* @param {Object} block The block object
|
|
6
|
+
*
|
|
7
|
+
* @return {string} The plugin URL, if exists.
|
|
8
|
+
*/
|
|
2
9
|
function getPluginUrl(block) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
if (link && link.length) {
|
|
8
|
-
return link[0].href;
|
|
9
|
-
}
|
|
10
|
-
return false;
|
|
10
|
+
if (!block) return false;
|
|
11
|
+
const link = block.links["wp:plugin"] || block.links.self;
|
|
12
|
+
if (link && link.length) return link[0].href;
|
|
13
|
+
return false;
|
|
11
14
|
}
|
|
12
|
-
export {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
//# sourceMappingURL=get-plugin-url.mjs.map
|
|
15
|
+
export { getPluginUrl as default };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=get-plugin-url.mjs.map
|
|
@@ -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": ";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
|
+
{"version":3,"file":"get-plugin-url.mjs","names":[],"sources":["../../../src/store/utils/get-plugin-url.js"],"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"],"mappings":";;;;;;;;AAOA,SAAwB,aAAc,OAAQ;CAC7C,IAAK,CAAE,OACN,OAAO;CAER,MAAM,OAAO,MAAM,MAAO,gBAAiB,MAAM,MAAM;CACvD,IAAK,QAAQ,KAAK,QACjB,OAAO,KAAM,EAAG,CAAC;CAElB,OAAO;AACR"}
|
|
@@ -187,26 +187,20 @@ body.admin-color-fresh {
|
|
|
187
187
|
appearance: none;
|
|
188
188
|
background: none;
|
|
189
189
|
border: 0;
|
|
190
|
+
border-radius: var(--wpds-border-radius-sm, 2px);
|
|
190
191
|
text-align: right;
|
|
191
|
-
|
|
192
|
-
@media not (prefers-reduced-motion) {
|
|
193
|
-
.block-directory-downloadable-block-list-item {
|
|
194
|
-
transition: box-shadow 0.1s linear;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
.block-directory-downloadable-block-list-item {
|
|
192
|
+
scroll-margin: 4px;
|
|
198
193
|
position: relative;
|
|
199
194
|
}
|
|
200
195
|
.block-directory-downloadable-block-list-item:not([aria-disabled=true]) {
|
|
201
196
|
cursor: var(--wpds-cursor-control, pointer);
|
|
202
197
|
}
|
|
203
|
-
.block-directory-downloadable-block-list-item:hover {
|
|
204
|
-
|
|
205
|
-
outline: 2px solid transparent;
|
|
198
|
+
.block-directory-downloadable-block-list-item:hover:not([aria-disabled=true]) {
|
|
199
|
+
background-color: var(--wpds-color-background-interactive-neutral-weak-active, #ececec);
|
|
206
200
|
}
|
|
207
201
|
.block-directory-downloadable-block-list-item[data-focus-visible] {
|
|
208
|
-
|
|
209
|
-
outline:
|
|
202
|
+
outline: var(--wpds-border-width-focus, var(--wp-admin-border-width-focus, 2px)) solid var(--focus-color, var(--wpds-color-stroke-focus, var(--wp-admin-theme-color, #3858e9)));
|
|
203
|
+
outline-offset: var(--wpds-border-width-focus, var(--wp-admin-border-width-focus, 2px));
|
|
210
204
|
}
|
|
211
205
|
.block-directory-downloadable-block-list-item.is-installing .block-directory-downloadable-block-list-item__author {
|
|
212
206
|
display: none;
|
package/build-style/style.css
CHANGED
|
@@ -187,26 +187,20 @@ body.admin-color-fresh {
|
|
|
187
187
|
appearance: none;
|
|
188
188
|
background: none;
|
|
189
189
|
border: 0;
|
|
190
|
+
border-radius: var(--wpds-border-radius-sm, 2px);
|
|
190
191
|
text-align: left;
|
|
191
|
-
|
|
192
|
-
@media not (prefers-reduced-motion) {
|
|
193
|
-
.block-directory-downloadable-block-list-item {
|
|
194
|
-
transition: box-shadow 0.1s linear;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
.block-directory-downloadable-block-list-item {
|
|
192
|
+
scroll-margin: 4px;
|
|
198
193
|
position: relative;
|
|
199
194
|
}
|
|
200
195
|
.block-directory-downloadable-block-list-item:not([aria-disabled=true]) {
|
|
201
196
|
cursor: var(--wpds-cursor-control, pointer);
|
|
202
197
|
}
|
|
203
|
-
.block-directory-downloadable-block-list-item:hover {
|
|
204
|
-
|
|
205
|
-
outline: 2px solid transparent;
|
|
198
|
+
.block-directory-downloadable-block-list-item:hover:not([aria-disabled=true]) {
|
|
199
|
+
background-color: var(--wpds-color-background-interactive-neutral-weak-active, #ececec);
|
|
206
200
|
}
|
|
207
201
|
.block-directory-downloadable-block-list-item[data-focus-visible] {
|
|
208
|
-
|
|
209
|
-
outline:
|
|
202
|
+
outline: var(--wpds-border-width-focus, var(--wp-admin-border-width-focus, 2px)) solid var(--focus-color, var(--wpds-color-stroke-focus, var(--wp-admin-theme-color, #3858e9)));
|
|
203
|
+
outline-offset: var(--wpds-border-width-focus, var(--wp-admin-border-width-focus, 2px));
|
|
210
204
|
}
|
|
211
205
|
.block-directory-downloadable-block-list-item.is-installing .block-directory-downloadable-block-list-item__author {
|
|
212
206
|
display: none;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-directory",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.2.0",
|
|
4
4
|
"description": "Extend editor with block directory features to search, download and install blocks.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -39,26 +39,25 @@
|
|
|
39
39
|
},
|
|
40
40
|
"wpScript": true,
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@wordpress/a11y": "^5.
|
|
43
|
-
"@wordpress/api-fetch": "^8.
|
|
44
|
-
"@wordpress/base-styles": "^
|
|
45
|
-
"@wordpress/block-editor": "^
|
|
46
|
-
"@wordpress/blocks": "^17.
|
|
47
|
-
"@wordpress/components": "^
|
|
48
|
-
"@wordpress/compose": "^9.
|
|
49
|
-
"@wordpress/core-data": "^9.
|
|
50
|
-
"@wordpress/data": "^11.
|
|
51
|
-
"@wordpress/editor": "^16.
|
|
52
|
-
"@wordpress/element": "^10.
|
|
53
|
-
"@wordpress/hooks": "^5.
|
|
54
|
-
"@wordpress/html-entities": "^5.
|
|
55
|
-
"@wordpress/i18n": "^7.
|
|
56
|
-
"@wordpress/icons": "^
|
|
57
|
-
"@wordpress/notices": "^6.
|
|
58
|
-
"@wordpress/plugins": "^8.
|
|
59
|
-
"@wordpress/
|
|
60
|
-
"@wordpress/
|
|
61
|
-
"@wordpress/url": "^5.0.0",
|
|
42
|
+
"@wordpress/a11y": "^5.2.0",
|
|
43
|
+
"@wordpress/api-fetch": "^8.2.0",
|
|
44
|
+
"@wordpress/base-styles": "^15.1.0",
|
|
45
|
+
"@wordpress/block-editor": "^20.1.0",
|
|
46
|
+
"@wordpress/blocks": "^17.2.0",
|
|
47
|
+
"@wordpress/components": "^45.0.0",
|
|
48
|
+
"@wordpress/compose": "^9.2.0",
|
|
49
|
+
"@wordpress/core-data": "^9.2.0",
|
|
50
|
+
"@wordpress/data": "^11.2.0",
|
|
51
|
+
"@wordpress/editor": "^16.2.0",
|
|
52
|
+
"@wordpress/element": "^10.2.0",
|
|
53
|
+
"@wordpress/hooks": "^5.2.0",
|
|
54
|
+
"@wordpress/html-entities": "^5.2.0",
|
|
55
|
+
"@wordpress/i18n": "^7.2.0",
|
|
56
|
+
"@wordpress/icons": "^21.0.0",
|
|
57
|
+
"@wordpress/notices": "^6.2.0",
|
|
58
|
+
"@wordpress/plugins": "^8.2.0",
|
|
59
|
+
"@wordpress/ui": "^0.27.0",
|
|
60
|
+
"@wordpress/url": "^5.2.0",
|
|
62
61
|
"change-case": "^4.1.2",
|
|
63
62
|
"clsx": "^2.1.1"
|
|
64
63
|
},
|
|
@@ -67,7 +66,7 @@
|
|
|
67
66
|
"@testing-library/react": "^16.3.3",
|
|
68
67
|
"@testing-library/user-event": "^14.6.8",
|
|
69
68
|
"deep-freeze": "^0.0.1",
|
|
70
|
-
"vitest": "^5.0
|
|
69
|
+
"vitest": "^5.1.0"
|
|
71
70
|
},
|
|
72
71
|
"peerDependencies": {
|
|
73
72
|
"react": "^18 || ^19",
|
|
@@ -76,5 +75,5 @@
|
|
|
76
75
|
"publishConfig": {
|
|
77
76
|
"access": "public"
|
|
78
77
|
},
|
|
79
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "1000cdf1dffd5b5e69f75cc4360aa76db8252264"
|
|
80
79
|
}
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
appearance: none;
|
|
19
19
|
background: none;
|
|
20
20
|
border: 0;
|
|
21
|
+
border-radius: var(--wpds-border-radius-sm);
|
|
21
22
|
text-align: left;
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
24
|
+
// Keep the focus ring visible when keyboard navigation scrolls an item into view.
|
|
25
|
+
scroll-margin: $grid-unit-05;
|
|
26
26
|
|
|
27
27
|
// The item contains absolutely positioned items.
|
|
28
28
|
// Set `position: relative` on the parent to prevent overflow issues
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
cursor: var(--wpds-cursor-control);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
&:hover {
|
|
39
|
-
|
|
38
|
+
&:hover:not([aria-disabled="true"]) {
|
|
39
|
+
background-color: var(--wpds-color-background-interactive-neutral-weak-active);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
&[data-focus-visible] {
|
|
43
|
-
@include
|
|
43
|
+
@include outset-ring__focus();
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
&.is-installing {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { __ } from '@wordpress/i18n';
|
|
2
1
|
import { useSelect } from '@wordpress/data';
|
|
3
2
|
import { store as blockDirectoryStore } from '../../store';
|
|
4
3
|
|
|
@@ -17,9 +16,6 @@ export const DownloadableBlockNotice = ( { block } ) => {
|
|
|
17
16
|
<div className="block-directory-downloadable-block-notice">
|
|
18
17
|
<div className="block-directory-downloadable-block-notice__content">
|
|
19
18
|
{ errorNotice.message }
|
|
20
|
-
{ errorNotice.isFatal
|
|
21
|
-
? ' ' + __( 'Try reloading the page.' )
|
|
22
|
-
: null }
|
|
23
19
|
</div>
|
|
24
20
|
</div>
|
|
25
21
|
);
|
package/build/index.cjs.map
DELETED
package/build/lock-unlock.cjs
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
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/lock-unlock.js
|
|
20
|
-
var lock_unlock_exports = {};
|
|
21
|
-
__export(lock_unlock_exports, {
|
|
22
|
-
lock: () => lock,
|
|
23
|
-
unlock: () => unlock
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(lock_unlock_exports);
|
|
26
|
-
var import_private_apis = require("@wordpress/private-apis");
|
|
27
|
-
var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
|
|
28
|
-
"I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
|
|
29
|
-
"@wordpress/block-directory"
|
|
30
|
-
);
|
|
31
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
-
0 && (module.exports = {
|
|
33
|
-
lock,
|
|
34
|
-
unlock
|
|
35
|
-
});
|
|
36
|
-
//# sourceMappingURL=lock-unlock.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/lock-unlock.js"],
|
|
4
|
-
"sourcesContent": ["import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.',\n\t\t'@wordpress/block-directory'\n\t);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAiE;AAE1D,IAAM,EAAE,MAAM,OAAO,QAC3B;AAAA,EACC;AAAA,EACA;AACD;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// packages/block-directory/src/lock-unlock.js
|
|
2
|
-
import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from "@wordpress/private-apis";
|
|
3
|
-
var { lock, unlock } = __dangerousOptInToUnstableAPIsOnlyForCoreModules(
|
|
4
|
-
"I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
|
|
5
|
-
"@wordpress/block-directory"
|
|
6
|
-
);
|
|
7
|
-
export {
|
|
8
|
-
lock,
|
|
9
|
-
unlock
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=lock-unlock.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/lock-unlock.js"],
|
|
4
|
-
"sourcesContent": ["import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.',\n\t\t'@wordpress/block-directory'\n\t);\n"],
|
|
5
|
-
"mappings": ";AAAA,SAAS,wDAAwD;AAE1D,IAAM,EAAE,MAAM,OAAO,IAC3B;AAAA,EACC;AAAA,EACA;AACD;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/src/lock-unlock.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';
|
|
2
|
-
|
|
3
|
-
export const { lock, unlock } =
|
|
4
|
-
__dangerousOptInToUnstableAPIsOnlyForCoreModules(
|
|
5
|
-
'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.',
|
|
6
|
-
'@wordpress/block-directory'
|
|
7
|
-
);
|