@wordpress/block-directory 6.0.0 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +23 -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 +15 -20
- 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/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,129 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, {
|
|
3
|
+
__esModule: { value: true },
|
|
4
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
5
|
+
});
|
|
6
|
+
// \0rolldown/runtime.js
|
|
1
7
|
var __create = Object.create;
|
|
2
8
|
var __defProp = Object.defineProperty;
|
|
3
9
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
10
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
11
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
12
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
13
|
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
15
|
+
key = keys[i];
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: ((k) => from[k]).bind(null, key),
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
18
22
|
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
24
|
+
value: mod,
|
|
25
|
+
enumerable: true
|
|
26
|
+
}) : target, mod));
|
|
27
|
+
let _wordpress_i18n = require("@wordpress/i18n");
|
|
28
|
+
let _wordpress_components = require("@wordpress/components");
|
|
29
|
+
let _wordpress_core_data = require("@wordpress/core-data");
|
|
30
|
+
let _wordpress_data = require("@wordpress/data");
|
|
31
|
+
let _wordpress_blocks = require("@wordpress/blocks");
|
|
32
|
+
let ___downloadable_blocks_list_index_jsx = require("../downloadable-blocks-list/index.cjs");
|
|
33
|
+
___downloadable_blocks_list_index_jsx = __toESM(___downloadable_blocks_list_index_jsx);
|
|
34
|
+
let __inserter_panel_jsx = require("./inserter-panel.cjs");
|
|
35
|
+
__inserter_panel_jsx = __toESM(__inserter_panel_jsx);
|
|
36
|
+
let __no_results_jsx = require("./no-results.cjs");
|
|
37
|
+
__no_results_jsx = __toESM(__no_results_jsx);
|
|
38
|
+
let ______store_index_js = require("../../store/index.cjs");
|
|
39
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
29
40
|
// packages/block-directory/src/components/downloadable-blocks-panel/index.jsx
|
|
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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
return {
|
|
78
|
-
hasPermission,
|
|
79
|
-
downloadableBlocks,
|
|
80
|
-
isLoading: isRequestingDownloadableBlocks(filterValue)
|
|
81
|
-
};
|
|
82
|
-
},
|
|
83
|
-
[filterValue]
|
|
84
|
-
);
|
|
85
|
-
function DownloadableBlocksPanel({
|
|
86
|
-
onSelect,
|
|
87
|
-
onHover,
|
|
88
|
-
hasLocalBlocks,
|
|
89
|
-
isTyping,
|
|
90
|
-
filterValue
|
|
91
|
-
}) {
|
|
92
|
-
const { hasPermission, downloadableBlocks, isLoading } = useDownloadableBlocks(filterValue);
|
|
93
|
-
if (hasPermission === void 0 || isLoading || isTyping) {
|
|
94
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
95
|
-
hasPermission && !hasLocalBlocks && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
96
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "block-directory-downloadable-blocks-panel__no-local", children: (0, import_i18n.__)(
|
|
97
|
-
"No results available from your installed blocks."
|
|
98
|
-
) }),
|
|
99
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "block-editor-inserter__quick-inserter-separator" })
|
|
100
|
-
] }),
|
|
101
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "block-directory-downloadable-blocks-panel has-blocks-loading", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Spinner, {}) })
|
|
102
|
-
] });
|
|
103
|
-
}
|
|
104
|
-
if (false === hasPermission) {
|
|
105
|
-
if (!hasLocalBlocks) {
|
|
106
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_no_results.default, {});
|
|
107
|
-
}
|
|
108
|
-
return null;
|
|
109
|
-
}
|
|
110
|
-
if (downloadableBlocks.length === 0) {
|
|
111
|
-
return hasLocalBlocks ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_no_results.default, {});
|
|
112
|
-
}
|
|
113
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
114
|
-
import_inserter_panel.default,
|
|
115
|
-
{
|
|
116
|
-
downloadableItems: downloadableBlocks,
|
|
117
|
-
hasLocalBlocks,
|
|
118
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
119
|
-
import_downloadable_blocks_list.default,
|
|
120
|
-
{
|
|
121
|
-
items: downloadableBlocks,
|
|
122
|
-
onSelect,
|
|
123
|
-
onHover
|
|
124
|
-
}
|
|
125
|
-
)
|
|
126
|
-
}
|
|
127
|
-
);
|
|
41
|
+
const EMPTY_ARRAY = [];
|
|
42
|
+
const useDownloadableBlocks = (filterValue) => (0, _wordpress_data.useSelect)((select) => {
|
|
43
|
+
const { getDownloadableBlocks, isRequestingDownloadableBlocks, getInstalledBlockTypes } = select(______store_index_js.store);
|
|
44
|
+
const hasPermission = select(_wordpress_core_data.store).canUser("read", "block-directory/search");
|
|
45
|
+
let downloadableBlocks = EMPTY_ARRAY;
|
|
46
|
+
if (hasPermission) {
|
|
47
|
+
downloadableBlocks = getDownloadableBlocks(filterValue);
|
|
48
|
+
const installedBlockTypes = getInstalledBlockTypes();
|
|
49
|
+
const installableBlocks = downloadableBlocks.filter(({ name }) => {
|
|
50
|
+
const isJustInstalled = installedBlockTypes.some((blockType) => blockType.name === name);
|
|
51
|
+
const isPreviouslyInstalled = (0, _wordpress_blocks.getBlockType)(name);
|
|
52
|
+
return isJustInstalled || !isPreviouslyInstalled;
|
|
53
|
+
});
|
|
54
|
+
if (installableBlocks.length !== downloadableBlocks.length) downloadableBlocks = installableBlocks;
|
|
55
|
+
if (downloadableBlocks.length === 0) downloadableBlocks = EMPTY_ARRAY;
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
hasPermission,
|
|
59
|
+
downloadableBlocks,
|
|
60
|
+
isLoading: isRequestingDownloadableBlocks(filterValue)
|
|
61
|
+
};
|
|
62
|
+
}, [filterValue]);
|
|
63
|
+
function DownloadableBlocksPanel({ onSelect, onHover, hasLocalBlocks, isTyping, filterValue }) {
|
|
64
|
+
const { hasPermission, downloadableBlocks, isLoading } = useDownloadableBlocks(filterValue);
|
|
65
|
+
if (hasPermission === void 0 || isLoading || isTyping) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [hasPermission && !hasLocalBlocks && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
66
|
+
className: "block-directory-downloadable-blocks-panel__no-local",
|
|
67
|
+
children: (0, _wordpress_i18n.__)("No results available from your installed blocks.")
|
|
68
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "block-editor-inserter__quick-inserter-separator" })] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
69
|
+
className: "block-directory-downloadable-blocks-panel has-blocks-loading",
|
|
70
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_components.Spinner, {})
|
|
71
|
+
})] });
|
|
72
|
+
if (false === hasPermission) {
|
|
73
|
+
if (!hasLocalBlocks) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__no_results_jsx.default, {});
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
if (downloadableBlocks.length === 0) return hasLocalBlocks ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__no_results_jsx.default, {});
|
|
77
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__inserter_panel_jsx.default, {
|
|
78
|
+
downloadableItems: downloadableBlocks,
|
|
79
|
+
hasLocalBlocks,
|
|
80
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(___downloadable_blocks_list_index_jsx.default, {
|
|
81
|
+
items: downloadableBlocks,
|
|
82
|
+
onSelect,
|
|
83
|
+
onHover
|
|
84
|
+
})
|
|
85
|
+
});
|
|
128
86
|
}
|
|
129
|
-
|
|
87
|
+
exports.default = DownloadableBlocksPanel;
|
|
88
|
+
|
|
89
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/downloadable-blocks-panel/index.jsx"],
|
|
4
|
-
"sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { Spinner as WCSpinner } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { getBlockType } from '@wordpress/blocks';\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<WCSpinner />\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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AACnB,wBAAqC;AACrC,uBAAmC;AACnC,kBAA0B;AAC1B,oBAA6B;AAC7B,sCAAmC;AACnC,4BAA4C;AAC5C,wBAAwC;AACxC,mBAA6C;AAwExC;AAtEL,IAAM,cAAc,CAAC;AAErB,IAAM,wBAAwB,CAAE,oBAC/B;AAAA,EACC,CAAE,WAAY;AACb,UAAM;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IACD,IAAI,OAAQ,aAAAA,KAAoB;AAEhC,UAAM,gBAAgB,OAAQ,iBAAAC,KAAU,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,4BAAwB,4BAAc,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,4EACG;AAAA,uBAAiB,CAAE,kBACpB,4EACC;AAAA,oDAAC,OAAE,WAAU,uDACV;AAAA,UACD;AAAA,QACD,GACD;AAAA,QACA,4CAAC,SAAI,WAAU,mDAAkD;AAAA,SAClE;AAAA,MAED,4CAAC,SAAI,WAAU,gEACd,sDAAC,kBAAAC,SAAA,EAAU,GACZ;AAAA,OACD;AAAA,EAEF;AAEA,MAAK,UAAU,eAAgB;AAC9B,QAAK,CAAE,gBAAiB;AACvB,aAAO,4CAAC,kBAAAC,SAAA,EAA4B;AAAA,IACrC;AAEA,WAAO;AAAA,EACR;AAEA,MAAK,mBAAmB,WAAW,GAAI;AACtC,WAAO,iBAAiB,OAAO,4CAAC,kBAAAA,SAAA,EAA4B;AAAA,EAC7D;AAEA,SACC;AAAA,IAAC,sBAAAC;AAAA,IAAA;AAAA,MACA,mBAAoB;AAAA,MACpB;AAAA,MAEA;AAAA,QAAC,gCAAAC;AAAA,QAAA;AAAA,UACA,OAAQ;AAAA,UACR;AAAA,UACA;AAAA;AAAA,MACD;AAAA;AAAA,EACD;AAEF;",
|
|
6
|
-
"names": ["blockDirectoryStore", "coreStore", "WCSpinner", "DownloadableBlocksNoResults", "DownloadableBlocksInserterPanel", "DownloadableBlocksList"]
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["useSelect","blockDirectoryStore","coreStore","getBlockType","__","WCSpinner","DownloadableBlocksNoResults","DownloadableBlocksInserterPanel","DownloadableBlocksList"],"sources":["../../../src/components/downloadable-blocks-panel/index.jsx"],"sourcesContent":["import { __ } from '@wordpress/i18n';\nimport { Spinner as WCSpinner } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { getBlockType } from '@wordpress/blocks';\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<WCSpinner />\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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,MAAM,cAAc,CAAC;AAErB,MAAM,yBAA0B,iBAAA,GAC/BA,gBAAAA,UAAAA,EACG,WAAY;CACb,MAAM,EACL,uBACA,gCACA,2BACG,OAAQC,qBAAAA,KAAoB;CAEhC,MAAM,gBAAgB,OAAQC,qBAAAA,KAAU,CAAC,CAAC,QACzC,QACA,wBACD;CAEA,IAAI,qBAAqB;CACzB,IAAK,eAAgB;EACpB,qBAAqB,sBAAuB,WAAY;EAGxD,MAAM,sBAAsB,uBAAuB;EACnD,MAAM,oBAAoB,mBAAmB,QAC1C,EAAE,WAAY;GAKf,MAAM,kBAAkB,oBAAoB,MACzC,cAAe,UAAU,SAAS,IACrC;GACA,MAAM,yBAAA,GAAwBC,kBAAAA,aAAAA,CAAc,IAAK;GACjD,OAAO,mBAAmB,CAAE;EAC7B,CACD;EAGA,IAAK,kBAAkB,WAAW,mBAAmB,QACpD,qBAAqB;EAItB,IAAK,mBAAmB,WAAW,GAClC,qBAAqB;CAEvB;CAEA,OAAO;EACN;EACA;EACA,WAAW,+BAAgC,WAAY;CACxD;AACD,GACA,CAAE,WAAY,CACf;AAED,SAAwB,wBAAyB,EAChD,UACA,SACA,gBACA,UACA,eACG;CACH,MAAM,EAAE,eAAe,oBAAoB,cAC1C,sBAAuB,WAAY;CAEpC,IAAK,kBAAkB,KAAA,KAAa,aAAa,UAChD,OACC,iBAAA,GAAA,kBAAA,KAAA,CAAA,kBAAA,UAAA,EAAA,UAAA,CACG,iBAAiB,CAAE,kBACpB,iBAAA,GAAA,kBAAA,KAAA,CAAA,kBAAA,UAAA,EAAA,UAAA,CACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;EAAG,WAAU;EACVC,WAAAA,GAAAA,gBAAAA,GAAAA,CACD,kDACD;CACE,CAAA,GACH,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD,EAAK,WAAU,kDAAmD,CAAA,CACjE,EAAA,CAAA,GAEH,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EAAK,WAAU;EACd,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,SAAD,CAAY,CAAA;CACR,CAAA,CACJ,EAAA,CAAA;CAIJ,IAAK,UAAU,eAAgB;EAC9B,IAAK,CAAE,gBACN,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACC,iBAAAA,SAAD,CAA8B,CAAA;EAGtC,OAAO;CACR;CAEA,IAAK,mBAAmB,WAAW,GAClC,OAAO,iBAAiB,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACA,iBAAAA,SAAD,CAA8B,CAAA;CAG9D,OACC,iBAAA,GAAA,kBAAA,IAAA,CAACC,qBAAAA,SAAD;EACC,mBAAoB;EACH;EAEjB,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,sCAAAA,SAAD;GACC,OAAQ;GACG;GACD;EACV,CAAA;CAC+B,CAAA;AAEnC"}
|
|
@@ -1,63 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// packages/block-directory/src/components/downloadable-blocks-panel/inserter-panel.jsx
|
|
20
|
-
var inserter_panel_exports = {};
|
|
21
|
-
__export(inserter_panel_exports, {
|
|
22
|
-
default: () => inserter_panel_default
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, {
|
|
3
|
+
__esModule: { value: true },
|
|
4
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
23
5
|
});
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
function DownloadableBlocksInserterPanel({
|
|
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
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "block-directory-downloadable-blocks-panel__description", children: (0, import_i18n.__)(
|
|
55
|
-
"Select a block to install and add it to your post."
|
|
56
|
-
) })
|
|
57
|
-
] }),
|
|
58
|
-
children
|
|
59
|
-
] })
|
|
60
|
-
] });
|
|
6
|
+
let _wordpress_i18n = require("@wordpress/i18n");
|
|
7
|
+
let _wordpress_element = require("@wordpress/element");
|
|
8
|
+
let _wordpress_a11y = require("@wordpress/a11y");
|
|
9
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
|
+
// packages/block-directory/src/components/downloadable-blocks-panel/inserter-panel.jsx
|
|
11
|
+
function DownloadableBlocksInserterPanel({ children, downloadableItems, hasLocalBlocks }) {
|
|
12
|
+
const count = downloadableItems.length;
|
|
13
|
+
(0, _wordpress_element.useEffect)(() => {
|
|
14
|
+
(0, _wordpress_a11y.speak)((0, _wordpress_i18n.sprintf)((0, _wordpress_i18n._n)("%d additional block is available to install.", "%d additional blocks are available to install.", count), count));
|
|
15
|
+
}, [count]);
|
|
16
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
17
|
+
!hasLocalBlocks && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
18
|
+
className: "block-directory-downloadable-blocks-panel__no-local",
|
|
19
|
+
children: (0, _wordpress_i18n.__)("No results available from your installed blocks.")
|
|
20
|
+
}),
|
|
21
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "block-editor-inserter__quick-inserter-separator" }),
|
|
22
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
23
|
+
className: "block-directory-downloadable-blocks-panel",
|
|
24
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
25
|
+
className: "block-directory-downloadable-blocks-panel__header",
|
|
26
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
|
|
27
|
+
className: "block-directory-downloadable-blocks-panel__title",
|
|
28
|
+
children: (0, _wordpress_i18n.__)("Available to install")
|
|
29
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
30
|
+
className: "block-directory-downloadable-blocks-panel__description",
|
|
31
|
+
children: (0, _wordpress_i18n.__)("Select a block to install and add it to your post.")
|
|
32
|
+
})]
|
|
33
|
+
}), children]
|
|
34
|
+
})
|
|
35
|
+
] });
|
|
61
36
|
}
|
|
62
|
-
|
|
63
|
-
|
|
37
|
+
exports.default = DownloadableBlocksInserterPanel;
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=inserter-panel.cjs.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/downloadable-blocks-panel/inserter-panel.jsx"],
|
|
4
|
-
"sourcesContent": ["import { __, _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": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAgC;AAChC,qBAA0B;AAC1B,kBAAsB;AAuBpB;AArBF,SAAS,gCAAiC;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,QAAQ,kBAAkB;AAChC,gCAAW,MAAM;AAChB;AAAA,UACC;AAAA;AAAA,YAEC;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA,QACD;AAAA,QACA;AAAA,MACD;AAAA,IACD;AAAA,EACD,GAAG,CAAE,KAAM,CAAE;AAEb,SACC,4EACG;AAAA,KAAE,kBACH,4CAAC,OAAE,WAAU,uDACV,8BAAI,kDAAmD,GAC1D;AAAA,IAGD,4CAAC,SAAI,WAAU,mDAAkD;AAAA,IAEjE,6CAAC,SAAI,WAAU,6CACd;AAAA,mDAAC,SAAI,WAAU,qDACd;AAAA,oDAAC,QAAG,WAAU,oDACX,8BAAI,sBAAuB,GAC9B;AAAA,QACA,4CAAC,OAAE,WAAU,0DACV;AAAA,UACD;AAAA,QACD,GACD;AAAA,SACD;AAAA,MACE;AAAA,OACH;AAAA,KACD;AAEF;AAEA,IAAO,yBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"inserter-panel.cjs","names":["sprintf","_n","__"],"sources":["../../../src/components/downloadable-blocks-panel/inserter-panel.jsx"],"sourcesContent":["import { __, _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"],"mappings":";;;;;;;;;;AAIA,SAAS,gCAAiC,EACzC,UACA,mBACA,kBACG;CACH,MAAM,QAAQ,kBAAkB;CAChC,CAAA,GAAA,mBAAA,UAAA,OAAiB;EAChB,CAAA,GAAA,gBAAA,MAAA,EAAA,GACCA,gBAAAA,QAAAA,EAAAA,GAECC,gBAAAA,GAAAA,CACC,gDACA,kDACA,KACD,GACA,KACD,CACD;CACD,GAAG,CAAE,KAAM,CAAE;CAEb,OACC,iBAAA,GAAA,kBAAA,KAAA,CAAA,kBAAA,UAAA,EAAA,UAAA;EACG,CAAE,kBACH,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;GAAG,WAAU;GACVC,WAAAA,GAAAA,gBAAAA,GAAAA,CAAI,kDAAmD;EACvD,CAAA;EAGJ,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD,EAAK,WAAU,kDAAmD,CAAA;EAElE,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACC,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,MAAD;KAAI,WAAU;KACXA,WAAAA,GAAAA,gBAAAA,GAAAA,CAAI,sBAAuB;IAC1B,CAAA,GACJ,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;KAAG,WAAU;KACVA,WAAAA,GAAAA,gBAAAA,GAAAA,CACD,oDACD;IACE,CAAA,CACC;GACH,CAAA,GAAA,QACE;;CACJ,EAAA,CAAA;AAEJ"}
|
|
@@ -1,49 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// packages/block-directory/src/components/downloadable-blocks-panel/no-results.jsx
|
|
20
|
-
var no_results_exports = {};
|
|
21
|
-
__export(no_results_exports, {
|
|
22
|
-
default: () => no_results_default
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, {
|
|
3
|
+
__esModule: { value: true },
|
|
4
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
23
5
|
});
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
6
|
+
let _wordpress_i18n = require("@wordpress/i18n");
|
|
7
|
+
let _wordpress_icons = require("@wordpress/icons");
|
|
8
|
+
let _wordpress_ui = require("@wordpress/ui");
|
|
9
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
|
+
// packages/block-directory/src/components/downloadable-blocks-panel/no-results.jsx
|
|
29
11
|
function DownloadableBlocksNoResults() {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
] }) })
|
|
46
|
-
] });
|
|
12
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
13
|
+
className: "block-editor-inserter__no-results",
|
|
14
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: (0, _wordpress_i18n.__)("No results found.") })
|
|
15
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
16
|
+
className: "block-editor-inserter__tips",
|
|
17
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_wordpress_ui.Notice.Root, {
|
|
18
|
+
intent: "info",
|
|
19
|
+
icon: _wordpress_icons.tip,
|
|
20
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_ui.Notice.Description, { children: (0, _wordpress_i18n.__)("Interested in creating your own block?") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_ui.Notice.Actions, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_wordpress_ui.Notice.ActionLink, {
|
|
21
|
+
href: "https://developer.wordpress.org/block-editor/",
|
|
22
|
+
openInNewTab: true,
|
|
23
|
+
children: [(0, _wordpress_i18n.__)("Get started here"), "."]
|
|
24
|
+
}) })]
|
|
25
|
+
})
|
|
26
|
+
})] });
|
|
47
27
|
}
|
|
48
|
-
|
|
49
|
-
|
|
28
|
+
exports.default = DownloadableBlocksNoResults;
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=no-results.cjs.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/downloadable-blocks-panel/no-results.jsx"],
|
|
4
|
-
"sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { tip } from '@wordpress/icons';\nimport { Notice } from '@wordpress/ui';\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<Notice.Root intent=\"info\" icon={ tip }>\n\t\t\t\t\t<Notice.Description>\n\t\t\t\t\t\t{ __( 'Interested in creating your own block?' ) }\n\t\t\t\t\t</Notice.Description>\n\t\t\t\t\t<Notice.Actions>\n\t\t\t\t\t\t<Notice.ActionLink\n\t\t\t\t\t\t\thref=\"https://developer.wordpress.org/block-editor/\"\n\t\t\t\t\t\t\topenInNewTab\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Get started here' ) }.\n\t\t\t\t\t\t</Notice.ActionLink>\n\t\t\t\t\t</Notice.Actions>\n\t\t\t\t</Notice.Root>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default DownloadableBlocksNoResults;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AACnB,mBAAoB;AACpB,gBAAuB;AAIrB;AAFF,SAAS,8BAA8B;AACtC,SACC,4EACC;AAAA,gDAAC,SAAI,WAAU,qCACd,sDAAC,OAAI,8BAAI,mBAAoB,GAAG,GACjC;AAAA,IACA,4CAAC,SAAI,WAAU,+BACd,uDAAC,iBAAO,MAAP,EAAY,QAAO,QAAO,MAAO,kBACjC;AAAA,kDAAC,iBAAO,aAAP,EACE,8BAAI,wCAAyC,GAChD;AAAA,MACA,4CAAC,iBAAO,SAAP,EACA;AAAA,QAAC,iBAAO;AAAA,QAAP;AAAA,UACA,MAAK;AAAA,UACL,cAAY;AAAA,UAEV;AAAA,gCAAI,kBAAmB;AAAA,YAAG;AAAA;AAAA;AAAA,MAC7B,GACD;AAAA,OACD,GACD;AAAA,KACD;AAEF;AAEA,IAAO,qBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"no-results.cjs","names":["__","Notice","tip"],"sources":["../../../src/components/downloadable-blocks-panel/no-results.jsx"],"sourcesContent":["import { __ } from '@wordpress/i18n';\nimport { tip } from '@wordpress/icons';\nimport { Notice } from '@wordpress/ui';\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<Notice.Root intent=\"info\" icon={ tip }>\n\t\t\t\t\t<Notice.Description>\n\t\t\t\t\t\t{ __( 'Interested in creating your own block?' ) }\n\t\t\t\t\t</Notice.Description>\n\t\t\t\t\t<Notice.Actions>\n\t\t\t\t\t\t<Notice.ActionLink\n\t\t\t\t\t\t\thref=\"https://developer.wordpress.org/block-editor/\"\n\t\t\t\t\t\t\topenInNewTab\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Get started here' ) }.\n\t\t\t\t\t\t</Notice.ActionLink>\n\t\t\t\t\t</Notice.Actions>\n\t\t\t\t</Notice.Root>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default DownloadableBlocksNoResults;\n"],"mappings":";;;;;;;;;;AAIA,SAAS,8BAA8B;CACtC,OACC,iBAAA,GAAA,kBAAA,KAAA,CAAA,kBAAA,UAAA,EAAA,UAAA,CACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EAAK,WAAU;EACd,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD,EAAA,WAAA,GAAKA,gBAAAA,GAAAA,CAAI,mBAAoB,EAAM,CAAA;CAC/B,CAAA,GACL,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EAAK,WAAU;EACd,UAAA,iBAAA,GAAA,kBAAA,KAAA,CAACC,cAAAA,OAAO,MAAR;GAAa,QAAO;GAAO,MAAOC,iBAAAA;GAAlC,UAAA,CACC,iBAAA,GAAA,kBAAA,IAAA,CAACD,cAAAA,OAAO,aAAR,EAAA,WAAA,GACGD,gBAAAA,GAAAA,CAAI,wCAAyC,EAC5B,CAAA,GACpB,iBAAA,GAAA,kBAAA,IAAA,CAACC,cAAAA,OAAO,SAAR,EAAA,UACC,iBAAA,GAAA,kBAAA,KAAA,CAACA,cAAAA,OAAO,YAAR;IACC,MAAK;IACL,cAAA;IAFD,UAAA,EAAA,GAIGD,gBAAAA,GAAAA,CAAI,kBAAmB,GAAG,GACV;GACJ,CAAA,EAAA,CAAA,CACJ;;CACT,CAAA,CACJ,EAAA,CAAA;AAEJ"}
|
package/build/index.cjs
CHANGED
|
@@ -1,31 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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/index.js
|
|
20
|
-
var index_exports = {};
|
|
21
|
-
__export(index_exports, {
|
|
22
|
-
store: () => import_store.store
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, {
|
|
3
|
+
__esModule: { value: true },
|
|
4
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
23
5
|
});
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
6
|
+
require("./plugins/index.cjs");
|
|
7
|
+
let __store_index_js = require("./store/index.cjs");
|
|
8
|
+
Object.defineProperty(exports, "store", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function() {
|
|
11
|
+
return __store_index_js.store;
|
|
12
|
+
}
|
|
30
13
|
});
|
|
31
|
-
//# sourceMappingURL=index.cjs.map
|