@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
|
@@ -1,106 +1,98 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
* Internal dependencies
|
|
12
|
-
*/
|
|
13
|
-
import DownloadableBlocksList from '../downloadable-blocks-list';
|
|
14
|
-
import DownloadableBlocksInserterPanel from './inserter-panel';
|
|
15
|
-
import DownloadableBlocksNoResults from './no-results';
|
|
16
|
-
import { store as blockDirectoryStore } from '../../store';
|
|
17
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { __ } from "@wordpress/i18n";
|
|
3
|
+
import { Spinner } from "@wordpress/components";
|
|
4
|
+
import { store as coreStore } from "@wordpress/core-data";
|
|
5
|
+
import { useSelect } from "@wordpress/data";
|
|
6
|
+
import { getBlockType } from "@wordpress/blocks";
|
|
7
|
+
import DownloadableBlocksList from "../downloadable-blocks-list";
|
|
8
|
+
import DownloadableBlocksInserterPanel from "./inserter-panel";
|
|
9
|
+
import DownloadableBlocksNoResults from "./no-results";
|
|
10
|
+
import { store as blockDirectoryStore } from "../../store";
|
|
18
11
|
const EMPTY_ARRAY = [];
|
|
19
|
-
const useDownloadableBlocks = filterValue => useSelect(
|
|
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
|
-
downloadableBlocks
|
|
12
|
+
const useDownloadableBlocks = (filterValue) => useSelect(
|
|
13
|
+
(select) => {
|
|
14
|
+
const {
|
|
15
|
+
getDownloadableBlocks,
|
|
16
|
+
isRequestingDownloadableBlocks,
|
|
17
|
+
getInstalledBlockTypes
|
|
18
|
+
} = select(blockDirectoryStore);
|
|
19
|
+
const hasPermission = select(coreStore).canUser(
|
|
20
|
+
"read",
|
|
21
|
+
"block-directory/search"
|
|
22
|
+
);
|
|
23
|
+
let downloadableBlocks = EMPTY_ARRAY;
|
|
24
|
+
if (hasPermission) {
|
|
25
|
+
downloadableBlocks = getDownloadableBlocks(filterValue);
|
|
26
|
+
const installedBlockTypes = getInstalledBlockTypes();
|
|
27
|
+
const installableBlocks = downloadableBlocks.filter(
|
|
28
|
+
({ name }) => {
|
|
29
|
+
const isJustInstalled = installedBlockTypes.some(
|
|
30
|
+
(blockType) => blockType.name === name
|
|
31
|
+
);
|
|
32
|
+
const isPreviouslyInstalled = getBlockType(name);
|
|
33
|
+
return isJustInstalled || !isPreviouslyInstalled;
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
if (installableBlocks.length !== downloadableBlocks.length) {
|
|
37
|
+
downloadableBlocks = installableBlocks;
|
|
38
|
+
}
|
|
39
|
+
if (downloadableBlocks.length === 0) {
|
|
40
|
+
downloadableBlocks = EMPTY_ARRAY;
|
|
41
|
+
}
|
|
47
42
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
isLoading: isRequestingDownloadableBlocks(filterValue)
|
|
58
|
-
};
|
|
59
|
-
}, [filterValue]);
|
|
60
|
-
export default function DownloadableBlocksPanel({
|
|
43
|
+
return {
|
|
44
|
+
hasPermission,
|
|
45
|
+
downloadableBlocks,
|
|
46
|
+
isLoading: isRequestingDownloadableBlocks(filterValue)
|
|
47
|
+
};
|
|
48
|
+
},
|
|
49
|
+
[filterValue]
|
|
50
|
+
);
|
|
51
|
+
function DownloadableBlocksPanel({
|
|
61
52
|
onSelect,
|
|
62
53
|
onHover,
|
|
63
54
|
hasLocalBlocks,
|
|
64
55
|
isTyping,
|
|
65
56
|
filterValue
|
|
66
57
|
}) {
|
|
67
|
-
const {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}), /*#__PURE__*/_jsx("div", {
|
|
79
|
-
className: "block-editor-inserter__quick-inserter-separator"
|
|
80
|
-
})]
|
|
81
|
-
}), /*#__PURE__*/_jsx("div", {
|
|
82
|
-
className: "block-directory-downloadable-blocks-panel has-blocks-loading",
|
|
83
|
-
children: /*#__PURE__*/_jsx(Spinner, {})
|
|
84
|
-
})]
|
|
85
|
-
});
|
|
58
|
+
const { hasPermission, downloadableBlocks, isLoading } = useDownloadableBlocks(filterValue);
|
|
59
|
+
if (hasPermission === void 0 || isLoading || isTyping) {
|
|
60
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
61
|
+
hasPermission && !hasLocalBlocks && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
62
|
+
/* @__PURE__ */ jsx("p", { className: "block-directory-downloadable-blocks-panel__no-local", children: __(
|
|
63
|
+
"No results available from your installed blocks."
|
|
64
|
+
) }),
|
|
65
|
+
/* @__PURE__ */ jsx("div", { className: "block-editor-inserter__quick-inserter-separator" })
|
|
66
|
+
] }),
|
|
67
|
+
/* @__PURE__ */ jsx("div", { className: "block-directory-downloadable-blocks-panel has-blocks-loading", children: /* @__PURE__ */ jsx(Spinner, {}) })
|
|
68
|
+
] });
|
|
86
69
|
}
|
|
87
70
|
if (false === hasPermission) {
|
|
88
71
|
if (!hasLocalBlocks) {
|
|
89
|
-
return
|
|
72
|
+
return /* @__PURE__ */ jsx(DownloadableBlocksNoResults, {});
|
|
90
73
|
}
|
|
91
74
|
return null;
|
|
92
75
|
}
|
|
93
76
|
if (downloadableBlocks.length === 0) {
|
|
94
|
-
return hasLocalBlocks ? null :
|
|
77
|
+
return hasLocalBlocks ? null : /* @__PURE__ */ jsx(DownloadableBlocksNoResults, {});
|
|
95
78
|
}
|
|
96
|
-
return
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
79
|
+
return /* @__PURE__ */ jsx(
|
|
80
|
+
DownloadableBlocksInserterPanel,
|
|
81
|
+
{
|
|
82
|
+
downloadableItems: downloadableBlocks,
|
|
83
|
+
hasLocalBlocks,
|
|
84
|
+
children: /* @__PURE__ */ jsx(
|
|
85
|
+
DownloadableBlocksList,
|
|
86
|
+
{
|
|
87
|
+
items: downloadableBlocks,
|
|
88
|
+
onSelect,
|
|
89
|
+
onHover
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
}
|
|
93
|
+
);
|
|
105
94
|
}
|
|
106
|
-
|
|
95
|
+
export {
|
|
96
|
+
DownloadableBlocksPanel as default
|
|
97
|
+
};
|
|
98
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/downloadable-blocks-panel/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Spinner } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { getBlockType } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport DownloadableBlocksList from '../downloadable-blocks-list';\nimport DownloadableBlocksInserterPanel from './inserter-panel';\nimport DownloadableBlocksNoResults from './no-results';\nimport { store as blockDirectoryStore } from '../../store';\n\nconst EMPTY_ARRAY = [];\n\nconst useDownloadableBlocks = ( filterValue ) =>\n\tuseSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetDownloadableBlocks,\n\t\t\t\tisRequestingDownloadableBlocks,\n\t\t\t\tgetInstalledBlockTypes,\n\t\t\t} = select( blockDirectoryStore );\n\n\t\t\tconst hasPermission = select( coreStore ).canUser(\n\t\t\t\t'read',\n\t\t\t\t'block-directory/search'\n\t\t\t);\n\n\t\t\tlet downloadableBlocks = EMPTY_ARRAY;\n\t\t\tif ( hasPermission ) {\n\t\t\t\tdownloadableBlocks = getDownloadableBlocks( filterValue );\n\n\t\t\t\t// Filter out blocks that are already installed.\n\t\t\t\tconst installedBlockTypes = getInstalledBlockTypes();\n\t\t\t\tconst installableBlocks = downloadableBlocks.filter(\n\t\t\t\t\t( { name } ) => {\n\t\t\t\t\t\t// Check if the block has just been installed, in which case it\n\t\t\t\t\t\t// should still show in the list to avoid suddenly disappearing.\n\t\t\t\t\t\t// `installedBlockTypes` only returns blocks stored in state\n\t\t\t\t\t\t// immediately after installation, not all installed blocks.\n\t\t\t\t\t\tconst isJustInstalled = installedBlockTypes.some(\n\t\t\t\t\t\t\t( blockType ) => blockType.name === name\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst isPreviouslyInstalled = getBlockType( name );\n\t\t\t\t\t\treturn isJustInstalled || ! isPreviouslyInstalled;\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\t// Keep identity of the `downloadableBlocks` array if nothing was filtered out\n\t\t\t\tif ( installableBlocks.length !== downloadableBlocks.length ) {\n\t\t\t\t\tdownloadableBlocks = installableBlocks;\n\t\t\t\t}\n\n\t\t\t\t// Return identical empty array when there are no blocks\n\t\t\t\tif ( downloadableBlocks.length === 0 ) {\n\t\t\t\t\tdownloadableBlocks = EMPTY_ARRAY;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\thasPermission,\n\t\t\t\tdownloadableBlocks,\n\t\t\t\tisLoading: isRequestingDownloadableBlocks( filterValue ),\n\t\t\t};\n\t\t},\n\t\t[ filterValue ]\n\t);\n\nexport default function DownloadableBlocksPanel( {\n\tonSelect,\n\tonHover,\n\thasLocalBlocks,\n\tisTyping,\n\tfilterValue,\n} ) {\n\tconst { hasPermission, downloadableBlocks, isLoading } =\n\t\tuseDownloadableBlocks( filterValue );\n\n\tif ( hasPermission === undefined || isLoading || isTyping ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ hasPermission && ! hasLocalBlocks && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<p className=\"block-directory-downloadable-blocks-panel__no-local\">\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'No results available from your installed blocks.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<div className=\"block-editor-inserter__quick-inserter-separator\" />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t<div className=\"block-directory-downloadable-blocks-panel has-blocks-loading\">\n\t\t\t\t\t<Spinner />\n\t\t\t\t</div>\n\t\t\t</>\n\t\t);\n\t}\n\n\tif ( false === hasPermission ) {\n\t\tif ( ! hasLocalBlocks ) {\n\t\t\treturn <DownloadableBlocksNoResults />;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tif ( downloadableBlocks.length === 0 ) {\n\t\treturn hasLocalBlocks ? null : <DownloadableBlocksNoResults />;\n\t}\n\n\treturn (\n\t\t<DownloadableBlocksInserterPanel\n\t\t\tdownloadableItems={ downloadableBlocks }\n\t\t\thasLocalBlocks={ hasLocalBlocks }\n\t\t>\n\t\t\t<DownloadableBlocksList\n\t\t\t\titems={ downloadableBlocks }\n\t\t\t\tonSelect={ onSelect }\n\t\t\t\tonHover={ onHover }\n\t\t\t/>\n\t\t</DownloadableBlocksInserterPanel>\n\t);\n}\n"],
|
|
5
|
+
"mappings": "AAuFK,mBACC,KADD;AApFL,SAAS,UAAU;AACnB,SAAS,eAAe;AACxB,SAAS,SAAS,iBAAiB;AACnC,SAAS,iBAAiB;AAC1B,SAAS,oBAAoB;AAK7B,OAAO,4BAA4B;AACnC,OAAO,qCAAqC;AAC5C,OAAO,iCAAiC;AACxC,SAAS,SAAS,2BAA2B;AAE7C,MAAM,cAAc,CAAC;AAErB,MAAM,wBAAwB,CAAE,gBAC/B;AAAA,EACC,CAAE,WAAY;AACb,UAAM;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IACD,IAAI,OAAQ,mBAAoB;AAEhC,UAAM,gBAAgB,OAAQ,SAAU,EAAE;AAAA,MACzC;AAAA,MACA;AAAA,IACD;AAEA,QAAI,qBAAqB;AACzB,QAAK,eAAgB;AACpB,2BAAqB,sBAAuB,WAAY;AAGxD,YAAM,sBAAsB,uBAAuB;AACnD,YAAM,oBAAoB,mBAAmB;AAAA,QAC5C,CAAE,EAAE,KAAK,MAAO;AAKf,gBAAM,kBAAkB,oBAAoB;AAAA,YAC3C,CAAE,cAAe,UAAU,SAAS;AAAA,UACrC;AACA,gBAAM,wBAAwB,aAAc,IAAK;AACjD,iBAAO,mBAAmB,CAAE;AAAA,QAC7B;AAAA,MACD;AAGA,UAAK,kBAAkB,WAAW,mBAAmB,QAAS;AAC7D,6BAAqB;AAAA,MACtB;AAGA,UAAK,mBAAmB,WAAW,GAAI;AACtC,6BAAqB;AAAA,MACtB;AAAA,IACD;AAEA,WAAO;AAAA,MACN;AAAA,MACA;AAAA,MACA,WAAW,+BAAgC,WAAY;AAAA,IACxD;AAAA,EACD;AAAA,EACA,CAAE,WAAY;AACf;AAEc,SAAR,wBAA0C;AAAA,EAChD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,EAAE,eAAe,oBAAoB,UAAU,IACpD,sBAAuB,WAAY;AAEpC,MAAK,kBAAkB,UAAa,aAAa,UAAW;AAC3D,WACC,iCACG;AAAA,uBAAiB,CAAE,kBACpB,iCACC;AAAA,4BAAC,OAAE,WAAU,uDACV;AAAA,UACD;AAAA,QACD,GACD;AAAA,QACA,oBAAC,SAAI,WAAU,mDAAkD;AAAA,SAClE;AAAA,MAED,oBAAC,SAAI,WAAU,gEACd,8BAAC,WAAQ,GACV;AAAA,OACD;AAAA,EAEF;AAEA,MAAK,UAAU,eAAgB;AAC9B,QAAK,CAAE,gBAAiB;AACvB,aAAO,oBAAC,+BAA4B;AAAA,IACrC;AAEA,WAAO;AAAA,EACR;AAEA,MAAK,mBAAmB,WAAW,GAAI;AACtC,WAAO,iBAAiB,OAAO,oBAAC,+BAA4B;AAAA,EAC7D;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,mBAAoB;AAAA,MACpB;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACA,OAAQ;AAAA,UACR;AAAA,UACA;AAAA;AAAA,MACD;AAAA;AAAA,EACD;AAEF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import { useEffect } from '@wordpress/element';
|
|
6
|
-
import { speak } from '@wordpress/a11y';
|
|
7
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { __, _n, sprintf } from "@wordpress/i18n";
|
|
3
|
+
import { useEffect } from "@wordpress/element";
|
|
4
|
+
import { speak } from "@wordpress/a11y";
|
|
8
5
|
function DownloadableBlocksInserterPanel({
|
|
9
6
|
children,
|
|
10
7
|
downloadableItems,
|
|
@@ -12,29 +9,34 @@ function DownloadableBlocksInserterPanel({
|
|
|
12
9
|
}) {
|
|
13
10
|
const count = downloadableItems.length;
|
|
14
11
|
useEffect(() => {
|
|
15
|
-
speak(
|
|
16
|
-
|
|
12
|
+
speak(
|
|
13
|
+
sprintf(
|
|
14
|
+
/* translators: %d: number of available blocks. */
|
|
15
|
+
_n(
|
|
16
|
+
"%d additional block is available to install.",
|
|
17
|
+
"%d additional blocks are available to install.",
|
|
18
|
+
count
|
|
19
|
+
),
|
|
20
|
+
count
|
|
21
|
+
)
|
|
22
|
+
);
|
|
17
23
|
}, [count]);
|
|
18
|
-
return
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}), /*#__PURE__*/_jsx("p", {
|
|
32
|
-
className: "block-directory-downloadable-blocks-panel__description",
|
|
33
|
-
children: __('Select a block to install and add it to your post.')
|
|
34
|
-
})]
|
|
35
|
-
}), children]
|
|
36
|
-
})]
|
|
37
|
-
});
|
|
24
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
25
|
+
!hasLocalBlocks && /* @__PURE__ */ jsx("p", { className: "block-directory-downloadable-blocks-panel__no-local", children: __("No results available from your installed blocks.") }),
|
|
26
|
+
/* @__PURE__ */ jsx("div", { className: "block-editor-inserter__quick-inserter-separator" }),
|
|
27
|
+
/* @__PURE__ */ jsxs("div", { className: "block-directory-downloadable-blocks-panel", children: [
|
|
28
|
+
/* @__PURE__ */ jsxs("div", { className: "block-directory-downloadable-blocks-panel__header", children: [
|
|
29
|
+
/* @__PURE__ */ jsx("h2", { className: "block-directory-downloadable-blocks-panel__title", children: __("Available to install") }),
|
|
30
|
+
/* @__PURE__ */ jsx("p", { className: "block-directory-downloadable-blocks-panel__description", children: __(
|
|
31
|
+
"Select a block to install and add it to your post."
|
|
32
|
+
) })
|
|
33
|
+
] }),
|
|
34
|
+
children
|
|
35
|
+
] })
|
|
36
|
+
] });
|
|
38
37
|
}
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
var inserter_panel_default = DownloadableBlocksInserterPanel;
|
|
39
|
+
export {
|
|
40
|
+
inserter_panel_default as default
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=inserter-panel.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/downloadable-blocks-panel/inserter-panel.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\nimport { speak } from '@wordpress/a11y';\n\nfunction DownloadableBlocksInserterPanel( {\n\tchildren,\n\tdownloadableItems,\n\thasLocalBlocks,\n} ) {\n\tconst count = downloadableItems.length;\n\tuseEffect( () => {\n\t\tspeak(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %d: number of available blocks. */\n\t\t\t\t_n(\n\t\t\t\t\t'%d additional block is available to install.',\n\t\t\t\t\t'%d additional blocks are available to install.',\n\t\t\t\t\tcount\n\t\t\t\t),\n\t\t\t\tcount\n\t\t\t)\n\t\t);\n\t}, [ count ] );\n\n\treturn (\n\t\t<>\n\t\t\t{ ! hasLocalBlocks && (\n\t\t\t\t<p className=\"block-directory-downloadable-blocks-panel__no-local\">\n\t\t\t\t\t{ __( 'No results available from your installed blocks.' ) }\n\t\t\t\t</p>\n\t\t\t) }\n\n\t\t\t<div className=\"block-editor-inserter__quick-inserter-separator\" />\n\n\t\t\t<div className=\"block-directory-downloadable-blocks-panel\">\n\t\t\t\t<div className=\"block-directory-downloadable-blocks-panel__header\">\n\t\t\t\t\t<h2 className=\"block-directory-downloadable-blocks-panel__title\">\n\t\t\t\t\t\t{ __( 'Available to install' ) }\n\t\t\t\t\t</h2>\n\t\t\t\t\t<p className=\"block-directory-downloadable-blocks-panel__description\">\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Select a block to install and add it to your post.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default DownloadableBlocksInserterPanel;\n"],
|
|
5
|
+
"mappings": "AA4BE,mBAEE,KAQA,YAVF;AAzBF,SAAS,IAAI,IAAI,eAAe;AAChC,SAAS,iBAAiB;AAC1B,SAAS,aAAa;AAEtB,SAAS,gCAAiC;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,QAAQ,kBAAkB;AAChC,YAAW,MAAM;AAChB;AAAA,MACC;AAAA;AAAA,QAEC;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA,QACD;AAAA,QACA;AAAA,MACD;AAAA,IACD;AAAA,EACD,GAAG,CAAE,KAAM,CAAE;AAEb,SACC,iCACG;AAAA,KAAE,kBACH,oBAAC,OAAE,WAAU,uDACV,aAAI,kDAAmD,GAC1D;AAAA,IAGD,oBAAC,SAAI,WAAU,mDAAkD;AAAA,IAEjE,qBAAC,SAAI,WAAU,6CACd;AAAA,2BAAC,SAAI,WAAU,qDACd;AAAA,4BAAC,QAAG,WAAU,oDACX,aAAI,sBAAuB,GAC9B;AAAA,QACA,oBAAC,OAAE,WAAU,0DACV;AAAA,UACD;AAAA,QACD,GACD;AAAA,SACD;AAAA,MACE;AAAA,OACH;AAAA,KACD;AAEF;AAEA,IAAO,yBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,26 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { __ } from '@wordpress/i18n';
|
|
5
|
-
import { Tip, ExternalLink } from '@wordpress/components';
|
|
6
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { __ } from "@wordpress/i18n";
|
|
3
|
+
import { Tip, ExternalLink } from "@wordpress/components";
|
|
7
4
|
function DownloadableBlocksNoResults() {
|
|
8
|
-
return
|
|
9
|
-
children:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
children: [__('Get started here'), "."]
|
|
20
|
-
})]
|
|
21
|
-
})
|
|
22
|
-
})]
|
|
23
|
-
});
|
|
5
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6
|
+
/* @__PURE__ */ jsx("div", { className: "block-editor-inserter__no-results", children: /* @__PURE__ */ jsx("p", { children: __("No results found.") }) }),
|
|
7
|
+
/* @__PURE__ */ jsx("div", { className: "block-editor-inserter__tips", children: /* @__PURE__ */ jsxs(Tip, { children: [
|
|
8
|
+
__("Interested in creating your own block?"),
|
|
9
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
10
|
+
/* @__PURE__ */ jsxs(ExternalLink, { href: "https://developer.wordpress.org/block-editor/", children: [
|
|
11
|
+
__("Get started here"),
|
|
12
|
+
"."
|
|
13
|
+
] })
|
|
14
|
+
] }) })
|
|
15
|
+
] });
|
|
24
16
|
}
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
var no_results_default = DownloadableBlocksNoResults;
|
|
18
|
+
export {
|
|
19
|
+
no_results_default as default
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=no-results.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/downloadable-blocks-panel/no-results.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Tip, ExternalLink } from '@wordpress/components';\n\nfunction DownloadableBlocksNoResults() {\n\treturn (\n\t\t<>\n\t\t\t<div className=\"block-editor-inserter__no-results\">\n\t\t\t\t<p>{ __( 'No results found.' ) }</p>\n\t\t\t</div>\n\t\t\t<div className=\"block-editor-inserter__tips\">\n\t\t\t\t<Tip>\n\t\t\t\t\t{ __( 'Interested in creating your own block?' ) }\n\t\t\t\t\t<br />\n\t\t\t\t\t<ExternalLink href=\"https://developer.wordpress.org/block-editor/\">\n\t\t\t\t\t\t{ __( 'Get started here' ) }.\n\t\t\t\t\t</ExternalLink>\n\t\t\t\t</Tip>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default DownloadableBlocksNoResults;\n"],
|
|
5
|
+
"mappings": "AAQE,mBAEE,KAMC,YARH;AALF,SAAS,UAAU;AACnB,SAAS,KAAK,oBAAoB;AAElC,SAAS,8BAA8B;AACtC,SACC,iCACC;AAAA,wBAAC,SAAI,WAAU,qCACd,8BAAC,OAAI,aAAI,mBAAoB,GAAG,GACjC;AAAA,IACA,oBAAC,SAAI,WAAU,+BACd,+BAAC,OACE;AAAA,SAAI,wCAAyC;AAAA,MAC/C,oBAAC,QAAG;AAAA,MACJ,qBAAC,gBAAa,MAAK,iDAChB;AAAA,WAAI,kBAAmB;AAAA,QAAG;AAAA,SAC7B;AAAA,OACD,GACD;AAAA,KACD;AAEF;AAEA,IAAO,qBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/build-module/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import "./plugins";
|
|
2
|
+
import { store } from "./store";
|
|
3
|
+
export {
|
|
4
|
+
store
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport './plugins';\n\nexport { store } from './store';\n"],
|
|
5
|
+
"mappings": "AAGA,OAAO;AAEP,SAAS,aAAa;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from "@wordpress/private-apis";
|
|
2
|
+
const { lock, unlock } = __dangerousOptInToUnstableAPIsOnlyForCoreModules(
|
|
3
|
+
"I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
|
|
4
|
+
"@wordpress/block-directory"
|
|
5
|
+
);
|
|
6
|
+
export {
|
|
6
7
|
lock,
|
|
7
8
|
unlock
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=lock-unlock.js.map
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=lock-unlock.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/lock-unlock.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __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": "AAGA,SAAS,wDAAwD;AAE1D,MAAM,EAAE,MAAM,OAAO,IAC3B;AAAA,EACC;AAAA,EACA;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|