@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.
Files changed (110) hide show
  1. package/build/components/auto-block-uninstaller/index.js +37 -31
  2. package/build/components/auto-block-uninstaller/index.js.map +7 -1
  3. package/build/components/block-ratings/index.js +40 -22
  4. package/build/components/block-ratings/index.js.map +7 -1
  5. package/build/components/block-ratings/stars.js +66 -40
  6. package/build/components/block-ratings/stars.js.map +7 -1
  7. package/build/components/compact-list/index.js +47 -46
  8. package/build/components/compact-list/index.js.map +7 -1
  9. package/build/components/downloadable-block-icon/index.js +28 -26
  10. package/build/components/downloadable-block-icon/index.js.map +7 -1
  11. package/build/components/downloadable-block-list-item/index.js +113 -127
  12. package/build/components/downloadable-block-list-item/index.js.map +7 -1
  13. package/build/components/downloadable-block-notice/index.js +41 -31
  14. package/build/components/downloadable-block-notice/index.js.map +7 -1
  15. package/build/components/downloadable-blocks-list/index.js +72 -56
  16. package/build/components/downloadable-blocks-list/index.js.map +7 -1
  17. package/build/components/downloadable-blocks-panel/index.js +108 -95
  18. package/build/components/downloadable-blocks-panel/index.js.map +7 -1
  19. package/build/components/downloadable-blocks-panel/inserter-panel.js +52 -38
  20. package/build/components/downloadable-blocks-panel/inserter-panel.js.map +7 -1
  21. package/build/components/downloadable-blocks-panel/no-results.js +37 -30
  22. package/build/components/downloadable-blocks-panel/no-results.js.map +7 -1
  23. package/build/index.js +27 -12
  24. package/build/index.js.map +7 -1
  25. package/build/lock-unlock.js +31 -15
  26. package/build/lock-unlock.js.map +7 -1
  27. package/build/plugins/get-install-missing/index.js +123 -102
  28. package/build/plugins/get-install-missing/index.js.map +7 -1
  29. package/build/plugins/get-install-missing/install-button.js +68 -50
  30. package/build/plugins/get-install-missing/install-button.js.map +7 -1
  31. package/build/plugins/index.js +46 -29
  32. package/build/plugins/index.js.map +7 -1
  33. package/build/plugins/inserter-menu-downloadable-blocks-panel/index.js +55 -42
  34. package/build/plugins/inserter-menu-downloadable-blocks-panel/index.js.map +7 -1
  35. package/build/plugins/installed-blocks-pre-publish-panel/index.js +65 -34
  36. package/build/plugins/installed-blocks-pre-publish-panel/index.js.map +7 -1
  37. package/build/store/actions.js +142 -188
  38. package/build/store/actions.js.map +7 -1
  39. package/build/store/index.js +48 -46
  40. package/build/store/index.js.map +7 -1
  41. package/build/store/load-assets.js +48 -55
  42. package/build/store/load-assets.js.map +7 -1
  43. package/build/store/reducer.js +48 -54
  44. package/build/store/reducer.js.map +7 -1
  45. package/build/store/resolvers.js +52 -31
  46. package/build/store/resolvers.js.map +7 -1
  47. package/build/store/selectors.js +100 -127
  48. package/build/store/selectors.js.map +7 -1
  49. package/build/store/utils/get-plugin-url.js +23 -14
  50. package/build/store/utils/get-plugin-url.js.map +7 -1
  51. package/build-module/components/auto-block-uninstaller/index.js +18 -24
  52. package/build-module/components/auto-block-uninstaller/index.js.map +7 -1
  53. package/build-module/components/block-ratings/index.js +9 -15
  54. package/build-module/components/block-ratings/index.js.map +7 -1
  55. package/build-module/components/block-ratings/stars.js +48 -34
  56. package/build-module/components/block-ratings/stars.js.map +7 -1
  57. package/build-module/components/compact-list/index.js +19 -39
  58. package/build-module/components/compact-list/index.js.map +7 -1
  59. package/build-module/components/downloadable-block-icon/index.js +10 -20
  60. package/build-module/components/downloadable-block-icon/index.js.map +7 -1
  61. package/build-module/components/downloadable-block-list-item/index.js +89 -120
  62. package/build-module/components/downloadable-block-list-item/index.js.map +7 -1
  63. package/build-module/components/downloadable-block-notice/index.js +19 -24
  64. package/build-module/components/downloadable-block-notice/index.js.map +7 -1
  65. package/build-module/components/downloadable-blocks-list/index.js +44 -49
  66. package/build-module/components/downloadable-blocks-list/index.js.map +7 -1
  67. package/build-module/components/downloadable-blocks-panel/index.js +81 -89
  68. package/build-module/components/downloadable-blocks-panel/index.js.map +7 -1
  69. package/build-module/components/downloadable-blocks-panel/inserter-panel.js +33 -31
  70. package/build-module/components/downloadable-blocks-panel/inserter-panel.js.map +7 -1
  71. package/build-module/components/downloadable-blocks-panel/no-results.js +19 -24
  72. package/build-module/components/downloadable-blocks-panel/no-results.js.map +7 -1
  73. package/build-module/index.js +6 -6
  74. package/build-module/index.js.map +7 -1
  75. package/build-module/lock-unlock.js +8 -7
  76. package/build-module/lock-unlock.js.map +7 -1
  77. package/build-module/plugins/get-install-missing/index.js +99 -95
  78. package/build-module/plugins/get-install-missing/index.js.map +7 -1
  79. package/build-module/plugins/get-install-missing/install-button.js +50 -44
  80. package/build-module/plugins/get-install-missing/install-button.js.map +7 -1
  81. package/build-module/plugins/index.js +24 -25
  82. package/build-module/plugins/index.js.map +7 -1
  83. package/build-module/plugins/inserter-menu-downloadable-blocks-panel/index.js +26 -34
  84. package/build-module/plugins/inserter-menu-downloadable-blocks-panel/index.js.map +7 -1
  85. package/build-module/plugins/installed-blocks-pre-publish-panel/index.js +38 -28
  86. package/build-module/plugins/installed-blocks-pre-publish-panel/index.js.map +7 -1
  87. package/build-module/store/actions.js +100 -168
  88. package/build-module/store/actions.js.map +7 -1
  89. package/build-module/store/index.js +13 -36
  90. package/build-module/store/index.js.map +7 -1
  91. package/build-module/store/load-assets.js +15 -47
  92. package/build-module/store/load-assets.js.map +7 -1
  93. package/build-module/store/reducer.js +27 -49
  94. package/build-module/store/reducer.js.map +7 -1
  95. package/build-module/store/resolvers.js +16 -19
  96. package/build-module/store/resolvers.js.map +7 -1
  97. package/build-module/store/selectors.js +77 -121
  98. package/build-module/store/selectors.js.map +7 -1
  99. package/build-module/store/utils/get-plugin-url.js +6 -10
  100. package/build-module/store/utils/get-plugin-url.js.map +7 -1
  101. package/build-style/style-rtl.css +9 -142
  102. package/build-style/style.css +9 -142
  103. package/package.json +28 -21
  104. package/src/components/block-ratings/style.scss +2 -0
  105. package/src/components/compact-list/style.scss +3 -0
  106. package/src/components/downloadable-block-icon/style.scss +3 -0
  107. package/src/components/downloadable-block-list-item/style.scss +4 -0
  108. package/src/components/downloadable-block-notice/style.scss +3 -0
  109. package/src/components/downloadable-blocks-panel/style.scss +3 -1
  110. package/src/style.scss +8 -7
@@ -1,104 +1,108 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { __, sprintf } from '@wordpress/i18n';
5
- import { Button } from '@wordpress/components';
6
- import { createBlock } from '@wordpress/blocks';
7
- import { RawHTML } from '@wordpress/element';
8
- import { useDispatch, useSelect } from '@wordpress/data';
9
- import { store as coreStore } from '@wordpress/core-data';
10
- import { Warning, useBlockProps, store as blockEditorStore } from '@wordpress/block-editor';
11
-
12
- /**
13
- * Internal dependencies
14
- */
15
- import InstallButton from './install-button';
16
- import { store as blockDirectoryStore } from '../../store';
17
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
18
- const getInstallMissing = OriginalComponent => props => {
19
- const {
20
- originalName
21
- } = props.attributes;
22
- // Disable reason: This is a valid component, but it's mistaken for a callback.
23
- // eslint-disable-next-line react-hooks/rules-of-hooks
24
- const {
25
- block,
26
- hasPermission
27
- } = useSelect(select => {
28
- const {
29
- getDownloadableBlocks
30
- } = select(blockDirectoryStore);
31
- const blocks = getDownloadableBlocks('block:' + originalName).filter(({
32
- name
33
- }) => originalName === name);
34
- return {
35
- hasPermission: select(coreStore).canUser('read', 'block-directory/search'),
36
- block: blocks.length && blocks[0]
37
- };
38
- }, [originalName]);
39
-
40
- // The user can't install blocks, or the block isn't available for download.
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { __, sprintf } from "@wordpress/i18n";
3
+ import { Button } from "@wordpress/components";
4
+ import { createBlock } from "@wordpress/blocks";
5
+ import { RawHTML } from "@wordpress/element";
6
+ import { useDispatch, useSelect } from "@wordpress/data";
7
+ import { store as coreStore } from "@wordpress/core-data";
8
+ import {
9
+ Warning,
10
+ useBlockProps,
11
+ store as blockEditorStore
12
+ } from "@wordpress/block-editor";
13
+ import InstallButton from "./install-button";
14
+ import { store as blockDirectoryStore } from "../../store";
15
+ const getInstallMissing = (OriginalComponent) => (props) => {
16
+ const { originalName } = props.attributes;
17
+ const { block, hasPermission } = useSelect(
18
+ (select) => {
19
+ const { getDownloadableBlocks } = select(blockDirectoryStore);
20
+ const blocks = getDownloadableBlocks(
21
+ "block:" + originalName
22
+ ).filter(({ name }) => originalName === name);
23
+ return {
24
+ hasPermission: select(coreStore).canUser(
25
+ "read",
26
+ "block-directory/search"
27
+ ),
28
+ block: blocks.length && blocks[0]
29
+ };
30
+ },
31
+ [originalName]
32
+ );
41
33
  if (!hasPermission || !block) {
42
- return /*#__PURE__*/_jsx(OriginalComponent, {
43
- ...props
44
- });
34
+ return /* @__PURE__ */ jsx(OriginalComponent, { ...props });
45
35
  }
46
- return /*#__PURE__*/_jsx(ModifiedWarning, {
47
- ...props,
48
- originalBlock: block
49
- });
36
+ return /* @__PURE__ */ jsx(ModifiedWarning, { ...props, originalBlock: block });
50
37
  };
51
- const ModifiedWarning = ({
52
- originalBlock,
53
- ...props
54
- }) => {
55
- const {
56
- originalName,
57
- originalUndelimitedContent,
58
- clientId
59
- } = props.attributes;
60
- const {
61
- replaceBlock
62
- } = useDispatch(blockEditorStore);
38
+ const ModifiedWarning = ({ originalBlock, ...props }) => {
39
+ const { originalName, originalUndelimitedContent, clientId } = props.attributes;
40
+ const { replaceBlock } = useDispatch(blockEditorStore);
63
41
  const convertToHTML = () => {
64
- replaceBlock(props.clientId, createBlock('core/html', {
65
- content: originalUndelimitedContent
66
- }));
42
+ replaceBlock(
43
+ props.clientId,
44
+ createBlock("core/html", {
45
+ content: originalUndelimitedContent
46
+ })
47
+ );
67
48
  };
68
49
  const hasContent = !!originalUndelimitedContent;
69
- const hasHTMLBlock = useSelect(select => {
70
- const {
71
- canInsertBlockType,
72
- getBlockRootClientId
73
- } = select(blockEditorStore);
74
- return canInsertBlockType('core/html', getBlockRootClientId(clientId));
75
- }, [clientId]);
76
- let messageHTML = sprintf(/* translators: %s: block name */
77
- __('Your site doesn’t include support for the %s block. You can try installing the block or remove it entirely.'), originalBlock.title || originalName);
78
- const actions = [/*#__PURE__*/_jsx(InstallButton, {
79
- block: originalBlock,
80
- attributes: props.attributes,
81
- clientId: props.clientId
82
- }, "install")];
50
+ const hasHTMLBlock = useSelect(
51
+ (select) => {
52
+ const { canInsertBlockType, getBlockRootClientId } = select(blockEditorStore);
53
+ return canInsertBlockType(
54
+ "core/html",
55
+ getBlockRootClientId(clientId)
56
+ );
57
+ },
58
+ [clientId]
59
+ );
60
+ let messageHTML = sprintf(
61
+ /* translators: %s: block name */
62
+ __(
63
+ "Your site doesn\u2019t include support for the %s block. You can try installing the block or remove it entirely."
64
+ ),
65
+ originalBlock.title || originalName
66
+ );
67
+ const actions = [
68
+ /* @__PURE__ */ jsx(
69
+ InstallButton,
70
+ {
71
+ block: originalBlock,
72
+ attributes: props.attributes,
73
+ clientId: props.clientId
74
+ },
75
+ "install"
76
+ )
77
+ ];
83
78
  if (hasContent && hasHTMLBlock) {
84
- messageHTML = sprintf(/* translators: %s: block name */
85
- __('Your site doesn’t include support for the %s block. You can try installing the block, convert it to a Custom HTML block, or remove it entirely.'), originalBlock.title || originalName);
86
- actions.push(/*#__PURE__*/_jsx(Button, {
87
- __next40pxDefaultSize: true,
88
- onClick: convertToHTML,
89
- variant: "tertiary",
90
- children: __('Keep as HTML')
91
- }, "convert"));
79
+ messageHTML = sprintf(
80
+ /* translators: %s: block name */
81
+ __(
82
+ "Your site doesn\u2019t include support for the %s block. You can try installing the block, convert it to a Custom HTML block, or remove it entirely."
83
+ ),
84
+ originalBlock.title || originalName
85
+ );
86
+ actions.push(
87
+ /* @__PURE__ */ jsx(
88
+ Button,
89
+ {
90
+ __next40pxDefaultSize: true,
91
+ onClick: convertToHTML,
92
+ variant: "tertiary",
93
+ children: __("Keep as HTML")
94
+ },
95
+ "convert"
96
+ )
97
+ );
92
98
  }
93
- return /*#__PURE__*/_jsxs("div", {
94
- ...useBlockProps(),
95
- children: [/*#__PURE__*/_jsx(Warning, {
96
- actions: actions,
97
- children: messageHTML
98
- }), /*#__PURE__*/_jsx(RawHTML, {
99
- children: originalUndelimitedContent
100
- })]
101
- });
99
+ return /* @__PURE__ */ jsxs("div", { ...useBlockProps(), children: [
100
+ /* @__PURE__ */ jsx(Warning, { actions, children: messageHTML }),
101
+ /* @__PURE__ */ jsx(RawHTML, { children: originalUndelimitedContent })
102
+ ] });
102
103
  };
103
- export default getInstallMissing;
104
- //# sourceMappingURL=index.js.map
104
+ var get_install_missing_default = getInstallMissing;
105
+ export {
106
+ get_install_missing_default as default
107
+ };
108
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["__","sprintf","Button","createBlock","RawHTML","useDispatch","useSelect","store","coreStore","Warning","useBlockProps","blockEditorStore","InstallButton","blockDirectoryStore","jsx","_jsx","jsxs","_jsxs","getInstallMissing","OriginalComponent","props","originalName","attributes","block","hasPermission","select","getDownloadableBlocks","blocks","filter","name","canUser","length","ModifiedWarning","originalBlock","originalUndelimitedContent","clientId","replaceBlock","convertToHTML","content","hasContent","hasHTMLBlock","canInsertBlockType","getBlockRootClientId","messageHTML","title","actions","push","__next40pxDefaultSize","onClick","variant","children"],"sources":["@wordpress/block-directory/src/plugins/get-install-missing/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { createBlock } from '@wordpress/blocks';\nimport { RawHTML } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tWarning,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport InstallButton from './install-button';\nimport { store as blockDirectoryStore } from '../../store';\n\nconst getInstallMissing = ( OriginalComponent ) => ( props ) => {\n\tconst { originalName } = props.attributes;\n\t// Disable reason: This is a valid component, but it's mistaken for a callback.\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tconst { block, hasPermission } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getDownloadableBlocks } = select( blockDirectoryStore );\n\t\t\tconst blocks = getDownloadableBlocks(\n\t\t\t\t'block:' + originalName\n\t\t\t).filter( ( { name } ) => originalName === name );\n\t\t\treturn {\n\t\t\t\thasPermission: select( coreStore ).canUser(\n\t\t\t\t\t'read',\n\t\t\t\t\t'block-directory/search'\n\t\t\t\t),\n\t\t\t\tblock: blocks.length && blocks[ 0 ],\n\t\t\t};\n\t\t},\n\t\t[ originalName ]\n\t);\n\n\t// The user can't install blocks, or the block isn't available for download.\n\tif ( ! hasPermission || ! block ) {\n\t\treturn <OriginalComponent { ...props } />;\n\t}\n\n\treturn <ModifiedWarning { ...props } originalBlock={ block } />;\n};\n\nconst ModifiedWarning = ( { originalBlock, ...props } ) => {\n\tconst { originalName, originalUndelimitedContent, clientId } =\n\t\tprops.attributes;\n\tconst { replaceBlock } = useDispatch( blockEditorStore );\n\tconst convertToHTML = () => {\n\t\treplaceBlock(\n\t\t\tprops.clientId,\n\t\t\tcreateBlock( 'core/html', {\n\t\t\t\tcontent: originalUndelimitedContent,\n\t\t\t} )\n\t\t);\n\t};\n\n\tconst hasContent = !! originalUndelimitedContent;\n\tconst hasHTMLBlock = useSelect(\n\t\t( select ) => {\n\t\t\tconst { canInsertBlockType, getBlockRootClientId } =\n\t\t\t\tselect( blockEditorStore );\n\n\t\t\treturn canInsertBlockType(\n\t\t\t\t'core/html',\n\t\t\t\tgetBlockRootClientId( clientId )\n\t\t\t);\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tlet messageHTML = sprintf(\n\t\t/* translators: %s: block name */\n\t\t__(\n\t\t\t'Your site doesn’t include support for the %s block. You can try installing the block or remove it entirely.'\n\t\t),\n\t\toriginalBlock.title || originalName\n\t);\n\tconst actions = [\n\t\t<InstallButton\n\t\t\tkey=\"install\"\n\t\t\tblock={ originalBlock }\n\t\t\tattributes={ props.attributes }\n\t\t\tclientId={ props.clientId }\n\t\t/>,\n\t];\n\n\tif ( hasContent && hasHTMLBlock ) {\n\t\tmessageHTML = sprintf(\n\t\t\t/* translators: %s: block name */\n\t\t\t__(\n\t\t\t\t'Your site doesn’t include support for the %s block. You can try installing the block, convert it to a Custom HTML block, or remove it entirely.'\n\t\t\t),\n\t\t\toriginalBlock.title || originalName\n\t\t);\n\t\tactions.push(\n\t\t\t<Button\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tkey=\"convert\"\n\t\t\t\tonClick={ convertToHTML }\n\t\t\t\tvariant=\"tertiary\"\n\t\t\t>\n\t\t\t\t{ __( 'Keep as HTML' ) }\n\t\t\t</Button>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div { ...useBlockProps() }>\n\t\t\t<Warning actions={ actions }>{ messageHTML }</Warning>\n\t\t\t<RawHTML>{ originalUndelimitedContent }</RawHTML>\n\t\t</div>\n\t);\n};\n\nexport default getInstallMissing;\n"],"mappings":"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","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/plugins/get-install-missing/index.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { createBlock } from '@wordpress/blocks';\nimport { RawHTML } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tWarning,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport InstallButton from './install-button';\nimport { store as blockDirectoryStore } from '../../store';\n\nconst getInstallMissing = ( OriginalComponent ) => ( props ) => {\n\tconst { originalName } = props.attributes;\n\t// Disable reason: This is a valid component, but it's mistaken for a callback.\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tconst { block, hasPermission } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getDownloadableBlocks } = select( blockDirectoryStore );\n\t\t\tconst blocks = getDownloadableBlocks(\n\t\t\t\t'block:' + originalName\n\t\t\t).filter( ( { name } ) => originalName === name );\n\t\t\treturn {\n\t\t\t\thasPermission: select( coreStore ).canUser(\n\t\t\t\t\t'read',\n\t\t\t\t\t'block-directory/search'\n\t\t\t\t),\n\t\t\t\tblock: blocks.length && blocks[ 0 ],\n\t\t\t};\n\t\t},\n\t\t[ originalName ]\n\t);\n\n\t// The user can't install blocks, or the block isn't available for download.\n\tif ( ! hasPermission || ! block ) {\n\t\treturn <OriginalComponent { ...props } />;\n\t}\n\n\treturn <ModifiedWarning { ...props } originalBlock={ block } />;\n};\n\nconst ModifiedWarning = ( { originalBlock, ...props } ) => {\n\tconst { originalName, originalUndelimitedContent, clientId } =\n\t\tprops.attributes;\n\tconst { replaceBlock } = useDispatch( blockEditorStore );\n\tconst convertToHTML = () => {\n\t\treplaceBlock(\n\t\t\tprops.clientId,\n\t\t\tcreateBlock( 'core/html', {\n\t\t\t\tcontent: originalUndelimitedContent,\n\t\t\t} )\n\t\t);\n\t};\n\n\tconst hasContent = !! originalUndelimitedContent;\n\tconst hasHTMLBlock = useSelect(\n\t\t( select ) => {\n\t\t\tconst { canInsertBlockType, getBlockRootClientId } =\n\t\t\t\tselect( blockEditorStore );\n\n\t\t\treturn canInsertBlockType(\n\t\t\t\t'core/html',\n\t\t\t\tgetBlockRootClientId( clientId )\n\t\t\t);\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tlet messageHTML = sprintf(\n\t\t/* translators: %s: block name */\n\t\t__(\n\t\t\t'Your site doesn\u2019t include support for the %s block. You can try installing the block or remove it entirely.'\n\t\t),\n\t\toriginalBlock.title || originalName\n\t);\n\tconst actions = [\n\t\t<InstallButton\n\t\t\tkey=\"install\"\n\t\t\tblock={ originalBlock }\n\t\t\tattributes={ props.attributes }\n\t\t\tclientId={ props.clientId }\n\t\t/>,\n\t];\n\n\tif ( hasContent && hasHTMLBlock ) {\n\t\tmessageHTML = sprintf(\n\t\t\t/* translators: %s: block name */\n\t\t\t__(\n\t\t\t\t'Your site doesn\u2019t include support for the %s block. You can try installing the block, convert it to a Custom HTML block, or remove it entirely.'\n\t\t\t),\n\t\t\toriginalBlock.title || originalName\n\t\t);\n\t\tactions.push(\n\t\t\t<Button\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tkey=\"convert\"\n\t\t\t\tonClick={ convertToHTML }\n\t\t\t\tvariant=\"tertiary\"\n\t\t\t>\n\t\t\t\t{ __( 'Keep as HTML' ) }\n\t\t\t</Button>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div { ...useBlockProps() }>\n\t\t\t<Warning actions={ actions }>{ messageHTML }</Warning>\n\t\t\t<RawHTML>{ originalUndelimitedContent }</RawHTML>\n\t\t</div>\n\t);\n};\n\nexport default getInstallMissing;\n"],
5
+ "mappings": "AA4CS,cAsEP,YAtEO;AAzCT,SAAS,IAAI,eAAe;AAC5B,SAAS,cAAc;AACvB,SAAS,mBAAmB;AAC5B,SAAS,eAAe;AACxB,SAAS,aAAa,iBAAiB;AACvC,SAAS,SAAS,iBAAiB;AACnC;AAAA,EACC;AAAA,EACA;AAAA,EACA,SAAS;AAAA,OACH;AAKP,OAAO,mBAAmB;AAC1B,SAAS,SAAS,2BAA2B;AAE7C,MAAM,oBAAoB,CAAE,sBAAuB,CAAE,UAAW;AAC/D,QAAM,EAAE,aAAa,IAAI,MAAM;AAG/B,QAAM,EAAE,OAAO,cAAc,IAAI;AAAA,IAChC,CAAE,WAAY;AACb,YAAM,EAAE,sBAAsB,IAAI,OAAQ,mBAAoB;AAC9D,YAAM,SAAS;AAAA,QACd,WAAW;AAAA,MACZ,EAAE,OAAQ,CAAE,EAAE,KAAK,MAAO,iBAAiB,IAAK;AAChD,aAAO;AAAA,QACN,eAAe,OAAQ,SAAU,EAAE;AAAA,UAClC;AAAA,UACA;AAAA,QACD;AAAA,QACA,OAAO,OAAO,UAAU,OAAQ,CAAE;AAAA,MACnC;AAAA,IACD;AAAA,IACA,CAAE,YAAa;AAAA,EAChB;AAGA,MAAK,CAAE,iBAAiB,CAAE,OAAQ;AACjC,WAAO,oBAAC,qBAAoB,GAAG,OAAQ;AAAA,EACxC;AAEA,SAAO,oBAAC,mBAAkB,GAAG,OAAQ,eAAgB,OAAQ;AAC9D;AAEA,MAAM,kBAAkB,CAAE,EAAE,eAAe,GAAG,MAAM,MAAO;AAC1D,QAAM,EAAE,cAAc,4BAA4B,SAAS,IAC1D,MAAM;AACP,QAAM,EAAE,aAAa,IAAI,YAAa,gBAAiB;AACvD,QAAM,gBAAgB,MAAM;AAC3B;AAAA,MACC,MAAM;AAAA,MACN,YAAa,aAAa;AAAA,QACzB,SAAS;AAAA,MACV,CAAE;AAAA,IACH;AAAA,EACD;AAEA,QAAM,aAAa,CAAC,CAAE;AACtB,QAAM,eAAe;AAAA,IACpB,CAAE,WAAY;AACb,YAAM,EAAE,oBAAoB,qBAAqB,IAChD,OAAQ,gBAAiB;AAE1B,aAAO;AAAA,QACN;AAAA,QACA,qBAAsB,QAAS;AAAA,MAChC;AAAA,IACD;AAAA,IACA,CAAE,QAAS;AAAA,EACZ;AAEA,MAAI,cAAc;AAAA;AAAA,IAEjB;AAAA,MACC;AAAA,IACD;AAAA,IACA,cAAc,SAAS;AAAA,EACxB;AACA,QAAM,UAAU;AAAA,IACf;AAAA,MAAC;AAAA;AAAA,QAEA,OAAQ;AAAA,QACR,YAAa,MAAM;AAAA,QACnB,UAAW,MAAM;AAAA;AAAA,MAHb;AAAA,IAIL;AAAA,EACD;AAEA,MAAK,cAAc,cAAe;AACjC,kBAAc;AAAA;AAAA,MAEb;AAAA,QACC;AAAA,MACD;AAAA,MACA,cAAc,SAAS;AAAA,IACxB;AACA,YAAQ;AAAA,MACP;AAAA,QAAC;AAAA;AAAA,UACA,uBAAqB;AAAA,UAErB,SAAU;AAAA,UACV,SAAQ;AAAA,UAEN,aAAI,cAAe;AAAA;AAAA,QAJjB;AAAA,MAKL;AAAA,IACD;AAAA,EACD;AAEA,SACC,qBAAC,SAAM,GAAG,cAAc,GACvB;AAAA,wBAAC,WAAQ,SAAsB,uBAAa;AAAA,IAC5C,oBAAC,WAAU,sCAA4B;AAAA,KACxC;AAEF;AAEA,IAAO,8BAAQ;",
6
+ "names": []
7
+ }
@@ -1,46 +1,52 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { __, sprintf } from '@wordpress/i18n';
5
- import { Button } from '@wordpress/components';
6
- import { createBlock, getBlockType, parse } from '@wordpress/blocks';
7
- import { useSelect, useDispatch } from '@wordpress/data';
8
- import { store as blockEditorStore } from '@wordpress/block-editor';
9
-
10
- /**
11
- * Internal dependencies
12
- */
13
- import { store as blockDirectoryStore } from '../../store';
14
- import { jsx as _jsx } from "react/jsx-runtime";
15
- export default function InstallButton({
16
- attributes,
17
- block,
18
- clientId
19
- }) {
20
- const isInstallingBlock = useSelect(select => select(blockDirectoryStore).isInstalling(block.id), [block.id]);
21
- const {
22
- installBlockType
23
- } = useDispatch(blockDirectoryStore);
24
- const {
25
- replaceBlock
26
- } = useDispatch(blockEditorStore);
27
- return /*#__PURE__*/_jsx(Button, {
28
- __next40pxDefaultSize: true,
29
- onClick: () => installBlockType(block).then(success => {
30
- if (success) {
31
- const blockType = getBlockType(block.name);
32
- const [originalBlock] = parse(attributes.originalContent);
33
- if (originalBlock && blockType) {
34
- replaceBlock(clientId, createBlock(blockType.name, originalBlock.attributes, originalBlock.innerBlocks));
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { __, sprintf } from "@wordpress/i18n";
3
+ import { Button } from "@wordpress/components";
4
+ import { createBlock, getBlockType, parse } from "@wordpress/blocks";
5
+ import { useSelect, useDispatch } from "@wordpress/data";
6
+ import { store as blockEditorStore } from "@wordpress/block-editor";
7
+ import { store as blockDirectoryStore } from "../../store";
8
+ function InstallButton({ attributes, block, clientId }) {
9
+ const isInstallingBlock = useSelect(
10
+ (select) => select(blockDirectoryStore).isInstalling(block.id),
11
+ [block.id]
12
+ );
13
+ const { installBlockType } = useDispatch(blockDirectoryStore);
14
+ const { replaceBlock } = useDispatch(blockEditorStore);
15
+ return /* @__PURE__ */ jsx(
16
+ Button,
17
+ {
18
+ __next40pxDefaultSize: true,
19
+ onClick: () => installBlockType(block).then((success) => {
20
+ if (success) {
21
+ const blockType = getBlockType(block.name);
22
+ const [originalBlock] = parse(
23
+ attributes.originalContent
24
+ );
25
+ if (originalBlock && blockType) {
26
+ replaceBlock(
27
+ clientId,
28
+ createBlock(
29
+ blockType.name,
30
+ originalBlock.attributes,
31
+ originalBlock.innerBlocks
32
+ )
33
+ );
34
+ }
35
35
  }
36
- }
37
- }),
38
- accessibleWhenDisabled: true,
39
- disabled: isInstallingBlock,
40
- isBusy: isInstallingBlock,
41
- variant: "primary",
42
- children: sprintf(/* translators: %s: block name */
43
- __('Install %s'), block.title)
44
- });
36
+ }),
37
+ accessibleWhenDisabled: true,
38
+ disabled: isInstallingBlock,
39
+ isBusy: isInstallingBlock,
40
+ variant: "primary",
41
+ children: sprintf(
42
+ /* translators: %s: block name */
43
+ __("Install %s"),
44
+ block.title
45
+ )
46
+ }
47
+ );
45
48
  }
46
- //# sourceMappingURL=install-button.js.map
49
+ export {
50
+ InstallButton as default
51
+ };
52
+ //# sourceMappingURL=install-button.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["__","sprintf","Button","createBlock","getBlockType","parse","useSelect","useDispatch","store","blockEditorStore","blockDirectoryStore","jsx","_jsx","InstallButton","attributes","block","clientId","isInstallingBlock","select","isInstalling","id","installBlockType","replaceBlock","__next40pxDefaultSize","onClick","then","success","blockType","name","originalBlock","originalContent","innerBlocks","accessibleWhenDisabled","disabled","isBusy","variant","children","title"],"sources":["@wordpress/block-directory/src/plugins/get-install-missing/install-button.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { createBlock, getBlockType, parse } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { store as blockDirectoryStore } from '../../store';\n\nexport default function InstallButton( { attributes, block, clientId } ) {\n\tconst isInstallingBlock = useSelect(\n\t\t( select ) => select( blockDirectoryStore ).isInstalling( block.id ),\n\t\t[ block.id ]\n\t);\n\tconst { installBlockType } = useDispatch( blockDirectoryStore );\n\tconst { replaceBlock } = useDispatch( blockEditorStore );\n\n\treturn (\n\t\t<Button\n\t\t\t__next40pxDefaultSize\n\t\t\tonClick={ () =>\n\t\t\t\tinstallBlockType( block ).then( ( success ) => {\n\t\t\t\t\tif ( success ) {\n\t\t\t\t\t\tconst blockType = getBlockType( block.name );\n\t\t\t\t\t\tconst [ originalBlock ] = parse(\n\t\t\t\t\t\t\tattributes.originalContent\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( originalBlock && blockType ) {\n\t\t\t\t\t\t\treplaceBlock(\n\t\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t\t\t\tblockType.name,\n\t\t\t\t\t\t\t\t\toriginalBlock.attributes,\n\t\t\t\t\t\t\t\t\toriginalBlock.innerBlocks\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} )\n\t\t\t}\n\t\t\taccessibleWhenDisabled\n\t\t\tdisabled={ isInstallingBlock }\n\t\t\tisBusy={ isInstallingBlock }\n\t\t\tvariant=\"primary\"\n\t\t>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: %s: block name */\n\t\t\t\t__( 'Install %s' ),\n\t\t\t\tblock.title\n\t\t\t) }\n\t\t</Button>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,WAAW,EAAEC,YAAY,EAAEC,KAAK,QAAQ,mBAAmB;AACpE,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;;AAEnE;AACA;AACA;AACA,SAASD,KAAK,IAAIE,mBAAmB,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3D,eAAe,SAASC,aAAaA,CAAE;EAAEC,UAAU;EAAEC,KAAK;EAAEC;AAAS,CAAC,EAAG;EACxE,MAAMC,iBAAiB,GAAGX,SAAS,CAChCY,MAAM,IAAMA,MAAM,CAAER,mBAAoB,CAAC,CAACS,YAAY,CAAEJ,KAAK,CAACK,EAAG,CAAC,EACpE,CAAEL,KAAK,CAACK,EAAE,CACX,CAAC;EACD,MAAM;IAAEC;EAAiB,CAAC,GAAGd,WAAW,CAAEG,mBAAoB,CAAC;EAC/D,MAAM;IAAEY;EAAa,CAAC,GAAGf,WAAW,CAAEE,gBAAiB,CAAC;EAExD,oBACCG,IAAA,CAACV,MAAM;IACNqB,qBAAqB;IACrBC,OAAO,EAAGA,CAAA,KACTH,gBAAgB,CAAEN,KAAM,CAAC,CAACU,IAAI,CAAIC,OAAO,IAAM;MAC9C,IAAKA,OAAO,EAAG;QACd,MAAMC,SAAS,GAAGvB,YAAY,CAAEW,KAAK,CAACa,IAAK,CAAC;QAC5C,MAAM,CAAEC,aAAa,CAAE,GAAGxB,KAAK,CAC9BS,UAAU,CAACgB,eACZ,CAAC;QACD,IAAKD,aAAa,IAAIF,SAAS,EAAG;UACjCL,YAAY,CACXN,QAAQ,EACRb,WAAW,CACVwB,SAAS,CAACC,IAAI,EACdC,aAAa,CAACf,UAAU,EACxBe,aAAa,CAACE,WACf,CACD,CAAC;QACF;MACD;IACD,CAAE,CACF;IACDC,sBAAsB;IACtBC,QAAQ,EAAGhB,iBAAmB;IAC9BiB,MAAM,EAAGjB,iBAAmB;IAC5BkB,OAAO,EAAC,SAAS;IAAAC,QAAA,EAEfnC,OAAO,CACR;IACAD,EAAE,CAAE,YAAa,CAAC,EAClBe,KAAK,CAACsB,KACP;EAAC,CACM,CAAC;AAEX","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/plugins/get-install-missing/install-button.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { createBlock, getBlockType, parse } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { store as blockDirectoryStore } from '../../store';\n\nexport default function InstallButton( { attributes, block, clientId } ) {\n\tconst isInstallingBlock = useSelect(\n\t\t( select ) => select( blockDirectoryStore ).isInstalling( block.id ),\n\t\t[ block.id ]\n\t);\n\tconst { installBlockType } = useDispatch( blockDirectoryStore );\n\tconst { replaceBlock } = useDispatch( blockEditorStore );\n\n\treturn (\n\t\t<Button\n\t\t\t__next40pxDefaultSize\n\t\t\tonClick={ () =>\n\t\t\t\tinstallBlockType( block ).then( ( success ) => {\n\t\t\t\t\tif ( success ) {\n\t\t\t\t\t\tconst blockType = getBlockType( block.name );\n\t\t\t\t\t\tconst [ originalBlock ] = parse(\n\t\t\t\t\t\t\tattributes.originalContent\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( originalBlock && blockType ) {\n\t\t\t\t\t\t\treplaceBlock(\n\t\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t\t\t\tblockType.name,\n\t\t\t\t\t\t\t\t\toriginalBlock.attributes,\n\t\t\t\t\t\t\t\t\toriginalBlock.innerBlocks\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} )\n\t\t\t}\n\t\t\taccessibleWhenDisabled\n\t\t\tdisabled={ isInstallingBlock }\n\t\t\tisBusy={ isInstallingBlock }\n\t\t\tvariant=\"primary\"\n\t\t>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: %s: block name */\n\t\t\t\t__( 'Install %s' ),\n\t\t\t\tblock.title\n\t\t\t) }\n\t\t</Button>\n\t);\n}\n"],
5
+ "mappings": "AAuBE;AApBF,SAAS,IAAI,eAAe;AAC5B,SAAS,cAAc;AACvB,SAAS,aAAa,cAAc,aAAa;AACjD,SAAS,WAAW,mBAAmB;AACvC,SAAS,SAAS,wBAAwB;AAK1C,SAAS,SAAS,2BAA2B;AAE9B,SAAR,cAAgC,EAAE,YAAY,OAAO,SAAS,GAAI;AACxE,QAAM,oBAAoB;AAAA,IACzB,CAAE,WAAY,OAAQ,mBAAoB,EAAE,aAAc,MAAM,EAAG;AAAA,IACnE,CAAE,MAAM,EAAG;AAAA,EACZ;AACA,QAAM,EAAE,iBAAiB,IAAI,YAAa,mBAAoB;AAC9D,QAAM,EAAE,aAAa,IAAI,YAAa,gBAAiB;AAEvD,SACC;AAAA,IAAC;AAAA;AAAA,MACA,uBAAqB;AAAA,MACrB,SAAU,MACT,iBAAkB,KAAM,EAAE,KAAM,CAAE,YAAa;AAC9C,YAAK,SAAU;AACd,gBAAM,YAAY,aAAc,MAAM,IAAK;AAC3C,gBAAM,CAAE,aAAc,IAAI;AAAA,YACzB,WAAW;AAAA,UACZ;AACA,cAAK,iBAAiB,WAAY;AACjC;AAAA,cACC;AAAA,cACA;AAAA,gBACC,UAAU;AAAA,gBACV,cAAc;AAAA,gBACd,cAAc;AAAA,cACf;AAAA,YACD;AAAA,UACD;AAAA,QACD;AAAA,MACD,CAAE;AAAA,MAEH,wBAAsB;AAAA,MACtB,UAAW;AAAA,MACX,QAAS;AAAA,MACT,SAAQ;AAAA,MAEN;AAAA;AAAA,QAED,GAAI,YAAa;AAAA,QACjB,MAAM;AAAA,MACP;AAAA;AAAA,EACD;AAEF;",
6
+ "names": []
7
+ }
@@ -1,32 +1,31 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { registerPlugin } from '@wordpress/plugins';
5
- import { addFilter } from '@wordpress/hooks';
6
-
7
- /**
8
- * Internal dependencies
9
- */
10
- import AutoBlockUninstaller from '../components/auto-block-uninstaller';
11
- import InserterMenuDownloadableBlocksPanel from './inserter-menu-downloadable-blocks-panel';
12
- import InstalledBlocksPrePublishPanel from './installed-blocks-pre-publish-panel';
13
- import getInstallMissing from './get-install-missing';
14
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
15
- registerPlugin('block-directory', {
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import { registerPlugin } from "@wordpress/plugins";
3
+ import { addFilter } from "@wordpress/hooks";
4
+ import AutoBlockUninstaller from "../components/auto-block-uninstaller";
5
+ import InserterMenuDownloadableBlocksPanel from "./inserter-menu-downloadable-blocks-panel";
6
+ import InstalledBlocksPrePublishPanel from "./installed-blocks-pre-publish-panel";
7
+ import getInstallMissing from "./get-install-missing";
8
+ registerPlugin("block-directory", {
16
9
  // The icon is explicitly set to undefined to prevent PluginPrePublishPanel
17
10
  // from rendering the fallback icon pluginIcon.
18
- icon: undefined,
11
+ icon: void 0,
19
12
  render() {
20
- return /*#__PURE__*/_jsxs(_Fragment, {
21
- children: [/*#__PURE__*/_jsx(AutoBlockUninstaller, {}), /*#__PURE__*/_jsx(InserterMenuDownloadableBlocksPanel, {}), /*#__PURE__*/_jsx(InstalledBlocksPrePublishPanel, {})]
22
- });
13
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
14
+ /* @__PURE__ */ jsx(AutoBlockUninstaller, {}),
15
+ /* @__PURE__ */ jsx(InserterMenuDownloadableBlocksPanel, {}),
16
+ /* @__PURE__ */ jsx(InstalledBlocksPrePublishPanel, {})
17
+ ] });
23
18
  }
24
19
  });
25
- addFilter('blocks.registerBlockType', 'block-directory/fallback', (settings, name) => {
26
- if (name !== 'core/missing') {
20
+ addFilter(
21
+ "blocks.registerBlockType",
22
+ "block-directory/fallback",
23
+ (settings, name) => {
24
+ if (name !== "core/missing") {
25
+ return settings;
26
+ }
27
+ settings.edit = getInstallMissing(settings.edit);
27
28
  return settings;
28
29
  }
29
- settings.edit = getInstallMissing(settings.edit);
30
- return settings;
31
- });
32
- //# sourceMappingURL=index.js.map
30
+ );
31
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["registerPlugin","addFilter","AutoBlockUninstaller","InserterMenuDownloadableBlocksPanel","InstalledBlocksPrePublishPanel","getInstallMissing","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","icon","undefined","render","children","settings","name","edit"],"sources":["@wordpress/block-directory/src/plugins/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { registerPlugin } from '@wordpress/plugins';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport AutoBlockUninstaller from '../components/auto-block-uninstaller';\nimport InserterMenuDownloadableBlocksPanel from './inserter-menu-downloadable-blocks-panel';\nimport InstalledBlocksPrePublishPanel from './installed-blocks-pre-publish-panel';\nimport getInstallMissing from './get-install-missing';\n\nregisterPlugin( 'block-directory', {\n\t// The icon is explicitly set to undefined to prevent PluginPrePublishPanel\n\t// from rendering the fallback icon pluginIcon.\n\ticon: undefined,\n\trender() {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<AutoBlockUninstaller />\n\t\t\t\t<InserterMenuDownloadableBlocksPanel />\n\t\t\t\t<InstalledBlocksPrePublishPanel />\n\t\t\t</>\n\t\t);\n\t},\n} );\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'block-directory/fallback',\n\t( settings, name ) => {\n\t\tif ( name !== 'core/missing' ) {\n\t\t\treturn settings;\n\t\t}\n\t\tsettings.edit = getInstallMissing( settings.edit );\n\n\t\treturn settings;\n\t}\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,cAAc,QAAQ,oBAAoB;AACnD,SAASC,SAAS,QAAQ,kBAAkB;;AAE5C;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,sCAAsC;AACvE,OAAOC,mCAAmC,MAAM,2CAA2C;AAC3F,OAAOC,8BAA8B,MAAM,sCAAsC;AACjF,OAAOC,iBAAiB,MAAM,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAEtDX,cAAc,CAAE,iBAAiB,EAAE;EAClC;EACA;EACAY,IAAI,EAAEC,SAAS;EACfC,MAAMA,CAAA,EAAG;IACR,oBACCH,KAAA,CAAAF,SAAA;MAAAM,QAAA,gBACCR,IAAA,CAACL,oBAAoB,IAAE,CAAC,eACxBK,IAAA,CAACJ,mCAAmC,IAAE,CAAC,eACvCI,IAAA,CAACH,8BAA8B,IAAE,CAAC;IAAA,CACjC,CAAC;EAEL;AACD,CAAE,CAAC;AAEHH,SAAS,CACR,0BAA0B,EAC1B,0BAA0B,EAC1B,CAAEe,QAAQ,EAAEC,IAAI,KAAM;EACrB,IAAKA,IAAI,KAAK,cAAc,EAAG;IAC9B,OAAOD,QAAQ;EAChB;EACAA,QAAQ,CAACE,IAAI,GAAGb,iBAAiB,CAAEW,QAAQ,CAACE,IAAK,CAAC;EAElD,OAAOF,QAAQ;AAChB,CACD,CAAC","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/plugins/index.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { registerPlugin } from '@wordpress/plugins';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport AutoBlockUninstaller from '../components/auto-block-uninstaller';\nimport InserterMenuDownloadableBlocksPanel from './inserter-menu-downloadable-blocks-panel';\nimport InstalledBlocksPrePublishPanel from './installed-blocks-pre-publish-panel';\nimport getInstallMissing from './get-install-missing';\n\nregisterPlugin( 'block-directory', {\n\t// The icon is explicitly set to undefined to prevent PluginPrePublishPanel\n\t// from rendering the fallback icon pluginIcon.\n\ticon: undefined,\n\trender() {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<AutoBlockUninstaller />\n\t\t\t\t<InserterMenuDownloadableBlocksPanel />\n\t\t\t\t<InstalledBlocksPrePublishPanel />\n\t\t\t</>\n\t\t);\n\t},\n} );\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'block-directory/fallback',\n\t( settings, name ) => {\n\t\tif ( name !== 'core/missing' ) {\n\t\t\treturn settings;\n\t\t}\n\t\tsettings.edit = getInstallMissing( settings.edit );\n\n\t\treturn settings;\n\t}\n);\n"],
5
+ "mappings": "AAoBG,mBACC,KADD;AAjBH,SAAS,sBAAsB;AAC/B,SAAS,iBAAiB;AAK1B,OAAO,0BAA0B;AACjC,OAAO,yCAAyC;AAChD,OAAO,oCAAoC;AAC3C,OAAO,uBAAuB;AAE9B,eAAgB,mBAAmB;AAAA;AAAA;AAAA,EAGlC,MAAM;AAAA,EACN,SAAS;AACR,WACC,iCACC;AAAA,0BAAC,wBAAqB;AAAA,MACtB,oBAAC,uCAAoC;AAAA,MACrC,oBAAC,kCAA+B;AAAA,OACjC;AAAA,EAEF;AACD,CAAE;AAEF;AAAA,EACC;AAAA,EACA;AAAA,EACA,CAAE,UAAU,SAAU;AACrB,QAAK,SAAS,gBAAiB;AAC9B,aAAO;AAAA,IACR;AACA,aAAS,OAAO,kBAAmB,SAAS,IAAK;AAEjD,WAAO;AAAA,EACR;AACD;",
6
+ "names": []
7
+ }
@@ -1,40 +1,32 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { __unstableInserterMenuExtension } from '@wordpress/block-editor';
5
- import { debounce } from '@wordpress/compose';
6
- import { useState } from '@wordpress/element';
7
-
8
- /**
9
- * Internal dependencies
10
- */
11
- import DownloadableBlocksPanel from '../../components/downloadable-blocks-panel';
12
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { __unstableInserterMenuExtension } from "@wordpress/block-editor";
3
+ import { debounce } from "@wordpress/compose";
4
+ import { useState } from "@wordpress/element";
5
+ import DownloadableBlocksPanel from "../../components/downloadable-blocks-panel";
13
6
  function InserterMenuDownloadableBlocksPanel() {
14
- const [debouncedFilterValue, setFilterValue] = useState('');
7
+ const [debouncedFilterValue, setFilterValue] = useState("");
15
8
  const debouncedSetFilterValue = debounce(setFilterValue, 400);
16
- return /*#__PURE__*/_jsx(__unstableInserterMenuExtension, {
17
- children: ({
18
- onSelect,
19
- onHover,
20
- filterValue,
21
- hasItems
22
- }) => {
23
- if (debouncedFilterValue !== filterValue) {
24
- debouncedSetFilterValue(filterValue);
25
- }
26
- if (!debouncedFilterValue) {
27
- return null;
28
- }
29
- return /*#__PURE__*/_jsx(DownloadableBlocksPanel, {
30
- onSelect: onSelect,
31
- onHover: onHover,
9
+ return /* @__PURE__ */ jsx(__unstableInserterMenuExtension, { children: ({ onSelect, onHover, filterValue, hasItems }) => {
10
+ if (debouncedFilterValue !== filterValue) {
11
+ debouncedSetFilterValue(filterValue);
12
+ }
13
+ if (!debouncedFilterValue) {
14
+ return null;
15
+ }
16
+ return /* @__PURE__ */ jsx(
17
+ DownloadableBlocksPanel,
18
+ {
19
+ onSelect,
20
+ onHover,
32
21
  filterValue: debouncedFilterValue,
33
22
  hasLocalBlocks: hasItems,
34
23
  isTyping: filterValue !== debouncedFilterValue
35
- });
36
- }
37
- });
24
+ }
25
+ );
26
+ } });
38
27
  }
39
- export default InserterMenuDownloadableBlocksPanel;
40
- //# sourceMappingURL=index.js.map
28
+ var inserter_menu_downloadable_blocks_panel_default = InserterMenuDownloadableBlocksPanel;
29
+ export {
30
+ inserter_menu_downloadable_blocks_panel_default as default
31
+ };
32
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["__unstableInserterMenuExtension","debounce","useState","DownloadableBlocksPanel","jsx","_jsx","InserterMenuDownloadableBlocksPanel","debouncedFilterValue","setFilterValue","debouncedSetFilterValue","children","onSelect","onHover","filterValue","hasItems","hasLocalBlocks","isTyping"],"sources":["@wordpress/block-directory/src/plugins/inserter-menu-downloadable-blocks-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __unstableInserterMenuExtension } from '@wordpress/block-editor';\nimport { debounce } from '@wordpress/compose';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport DownloadableBlocksPanel from '../../components/downloadable-blocks-panel';\n\nfunction InserterMenuDownloadableBlocksPanel() {\n\tconst [ debouncedFilterValue, setFilterValue ] = useState( '' );\n\tconst debouncedSetFilterValue = debounce( setFilterValue, 400 );\n\n\treturn (\n\t\t<__unstableInserterMenuExtension>\n\t\t\t{ ( { onSelect, onHover, filterValue, hasItems } ) => {\n\t\t\t\tif ( debouncedFilterValue !== filterValue ) {\n\t\t\t\t\tdebouncedSetFilterValue( filterValue );\n\t\t\t\t}\n\n\t\t\t\tif ( ! debouncedFilterValue ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\t<DownloadableBlocksPanel\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\tfilterValue={ debouncedFilterValue }\n\t\t\t\t\t\thasLocalBlocks={ hasItems }\n\t\t\t\t\t\tisTyping={ filterValue !== debouncedFilterValue }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} }\n\t\t</__unstableInserterMenuExtension>\n\t);\n}\n\nexport default InserterMenuDownloadableBlocksPanel;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,+BAA+B,QAAQ,yBAAyB;AACzE,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,QAAQ,QAAQ,oBAAoB;;AAE7C;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,4CAA4C;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEjF,SAASC,mCAAmCA,CAAA,EAAG;EAC9C,MAAM,CAAEC,oBAAoB,EAAEC,cAAc,CAAE,GAAGN,QAAQ,CAAE,EAAG,CAAC;EAC/D,MAAMO,uBAAuB,GAAGR,QAAQ,CAAEO,cAAc,EAAE,GAAI,CAAC;EAE/D,oBACCH,IAAA,CAACL,+BAA+B;IAAAU,QAAA,EAC7BA,CAAE;MAAEC,QAAQ;MAAEC,OAAO;MAAEC,WAAW;MAAEC;IAAS,CAAC,KAAM;MACrD,IAAKP,oBAAoB,KAAKM,WAAW,EAAG;QAC3CJ,uBAAuB,CAAEI,WAAY,CAAC;MACvC;MAEA,IAAK,CAAEN,oBAAoB,EAAG;QAC7B,OAAO,IAAI;MACZ;MAEA,oBACCF,IAAA,CAACF,uBAAuB;QACvBQ,QAAQ,EAAGA,QAAU;QACrBC,OAAO,EAAGA,OAAS;QACnBC,WAAW,EAAGN,oBAAsB;QACpCQ,cAAc,EAAGD,QAAU;QAC3BE,QAAQ,EAAGH,WAAW,KAAKN;MAAsB,CACjD,CAAC;IAEJ;EAAC,CAC+B,CAAC;AAEpC;AAEA,eAAeD,mCAAmC","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/plugins/inserter-menu-downloadable-blocks-panel/index.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __unstableInserterMenuExtension } from '@wordpress/block-editor';\nimport { debounce } from '@wordpress/compose';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport DownloadableBlocksPanel from '../../components/downloadable-blocks-panel';\n\nfunction InserterMenuDownloadableBlocksPanel() {\n\tconst [ debouncedFilterValue, setFilterValue ] = useState( '' );\n\tconst debouncedSetFilterValue = debounce( setFilterValue, 400 );\n\n\treturn (\n\t\t<__unstableInserterMenuExtension>\n\t\t\t{ ( { onSelect, onHover, filterValue, hasItems } ) => {\n\t\t\t\tif ( debouncedFilterValue !== filterValue ) {\n\t\t\t\t\tdebouncedSetFilterValue( filterValue );\n\t\t\t\t}\n\n\t\t\t\tif ( ! debouncedFilterValue ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\t<DownloadableBlocksPanel\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\tfilterValue={ debouncedFilterValue }\n\t\t\t\t\t\thasLocalBlocks={ hasItems }\n\t\t\t\t\t\tisTyping={ filterValue !== debouncedFilterValue }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} }\n\t\t</__unstableInserterMenuExtension>\n\t);\n}\n\nexport default InserterMenuDownloadableBlocksPanel;\n"],
5
+ "mappings": "AA4BK;AAzBL,SAAS,uCAAuC;AAChD,SAAS,gBAAgB;AACzB,SAAS,gBAAgB;AAKzB,OAAO,6BAA6B;AAEpC,SAAS,sCAAsC;AAC9C,QAAM,CAAE,sBAAsB,cAAe,IAAI,SAAU,EAAG;AAC9D,QAAM,0BAA0B,SAAU,gBAAgB,GAAI;AAE9D,SACC,oBAAC,mCACE,WAAE,EAAE,UAAU,SAAS,aAAa,SAAS,MAAO;AACrD,QAAK,yBAAyB,aAAc;AAC3C,8BAAyB,WAAY;AAAA,IACtC;AAEA,QAAK,CAAE,sBAAuB;AAC7B,aAAO;AAAA,IACR;AAEA,WACC;AAAA,MAAC;AAAA;AAAA,QACA;AAAA,QACA;AAAA,QACA,aAAc;AAAA,QACd,gBAAiB;AAAA,QACjB,UAAW,gBAAgB;AAAA;AAAA,IAC5B;AAAA,EAEF,GACD;AAEF;AAEA,IAAO,kDAAQ;",
6
+ "names": []
7
+ }
@@ -1,32 +1,42 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { _n, sprintf } from '@wordpress/i18n';
5
- import { useSelect } from '@wordpress/data';
6
- import { PluginPrePublishPanel } from '@wordpress/editor';
7
-
8
- /**
9
- * Internal dependencies
10
- */
11
- import CompactList from '../../components/compact-list';
12
- import { store as blockDirectoryStore } from '../../store';
13
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
- export default function InstalledBlocksPrePublishPanel() {
15
- const newBlockTypes = useSelect(select => select(blockDirectoryStore).getNewBlockTypes(), []);
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { _n, sprintf } from "@wordpress/i18n";
3
+ import { useSelect } from "@wordpress/data";
4
+ import { PluginPrePublishPanel } from "@wordpress/editor";
5
+ import CompactList from "../../components/compact-list";
6
+ import { store as blockDirectoryStore } from "../../store";
7
+ function InstalledBlocksPrePublishPanel() {
8
+ const newBlockTypes = useSelect(
9
+ (select) => select(blockDirectoryStore).getNewBlockTypes(),
10
+ []
11
+ );
16
12
  if (!newBlockTypes.length) {
17
13
  return null;
18
14
  }
19
- return /*#__PURE__*/_jsxs(PluginPrePublishPanel, {
20
- title: sprintf(
21
- // translators: %d: number of blocks (number).
22
- _n('Added: %d block', 'Added: %d blocks', newBlockTypes.length), newBlockTypes.length),
23
- initialOpen: true,
24
- children: [/*#__PURE__*/_jsx("p", {
25
- className: "installed-blocks-pre-publish-panel__copy",
26
- children: _n('The following block has been added to your site.', 'The following blocks have been added to your site.', newBlockTypes.length)
27
- }), /*#__PURE__*/_jsx(CompactList, {
28
- items: newBlockTypes
29
- })]
30
- });
15
+ return /* @__PURE__ */ jsxs(
16
+ PluginPrePublishPanel,
17
+ {
18
+ title: sprintf(
19
+ // translators: %d: number of blocks (number).
20
+ _n(
21
+ "Added: %d block",
22
+ "Added: %d blocks",
23
+ newBlockTypes.length
24
+ ),
25
+ newBlockTypes.length
26
+ ),
27
+ initialOpen: true,
28
+ children: [
29
+ /* @__PURE__ */ jsx("p", { className: "installed-blocks-pre-publish-panel__copy", children: _n(
30
+ "The following block has been added to your site.",
31
+ "The following blocks have been added to your site.",
32
+ newBlockTypes.length
33
+ ) }),
34
+ /* @__PURE__ */ jsx(CompactList, { items: newBlockTypes })
35
+ ]
36
+ }
37
+ );
31
38
  }
32
- //# sourceMappingURL=index.js.map
39
+ export {
40
+ InstalledBlocksPrePublishPanel as default
41
+ };
42
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["_n","sprintf","useSelect","PluginPrePublishPanel","CompactList","store","blockDirectoryStore","jsx","_jsx","jsxs","_jsxs","InstalledBlocksPrePublishPanel","newBlockTypes","select","getNewBlockTypes","length","title","initialOpen","children","className","items"],"sources":["@wordpress/block-directory/src/plugins/installed-blocks-pre-publish-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _n, sprintf } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { PluginPrePublishPanel } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport CompactList from '../../components/compact-list';\nimport { store as blockDirectoryStore } from '../../store';\n\nexport default function InstalledBlocksPrePublishPanel() {\n\tconst newBlockTypes = useSelect(\n\t\t( select ) => select( blockDirectoryStore ).getNewBlockTypes(),\n\t\t[]\n\t);\n\n\tif ( ! newBlockTypes.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PluginPrePublishPanel\n\t\t\ttitle={ sprintf(\n\t\t\t\t// translators: %d: number of blocks (number).\n\t\t\t\t_n(\n\t\t\t\t\t'Added: %d block',\n\t\t\t\t\t'Added: %d blocks',\n\t\t\t\t\tnewBlockTypes.length\n\t\t\t\t),\n\t\t\t\tnewBlockTypes.length\n\t\t\t) }\n\t\t\tinitialOpen\n\t\t>\n\t\t\t<p className=\"installed-blocks-pre-publish-panel__copy\">\n\t\t\t\t{ _n(\n\t\t\t\t\t'The following block has been added to your site.',\n\t\t\t\t\t'The following blocks have been added to your site.',\n\t\t\t\t\tnewBlockTypes.length\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<CompactList items={ newBlockTypes } />\n\t\t</PluginPrePublishPanel>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,qBAAqB,QAAQ,mBAAmB;;AAEzD;AACA;AACA;AACA,OAAOC,WAAW,MAAM,+BAA+B;AACvD,SAASC,KAAK,IAAIC,mBAAmB,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE3D,eAAe,SAASC,8BAA8BA,CAAA,EAAG;EACxD,MAAMC,aAAa,GAAGV,SAAS,CAC5BW,MAAM,IAAMA,MAAM,CAAEP,mBAAoB,CAAC,CAACQ,gBAAgB,CAAC,CAAC,EAC9D,EACD,CAAC;EAED,IAAK,CAAEF,aAAa,CAACG,MAAM,EAAG;IAC7B,OAAO,IAAI;EACZ;EAEA,oBACCL,KAAA,CAACP,qBAAqB;IACrBa,KAAK,EAAGf,OAAO;IACd;IACAD,EAAE,CACD,iBAAiB,EACjB,kBAAkB,EAClBY,aAAa,CAACG,MACf,CAAC,EACDH,aAAa,CAACG,MACf,CAAG;IACHE,WAAW;IAAAC,QAAA,gBAEXV,IAAA;MAAGW,SAAS,EAAC,0CAA0C;MAAAD,QAAA,EACpDlB,EAAE,CACH,kDAAkD,EAClD,oDAAoD,EACpDY,aAAa,CAACG,MACf;IAAC,CACC,CAAC,eACJP,IAAA,CAACJ,WAAW;MAACgB,KAAK,EAAGR;IAAe,CAAE,CAAC;EAAA,CACjB,CAAC;AAE1B","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/plugins/installed-blocks-pre-publish-panel/index.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { _n, sprintf } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { PluginPrePublishPanel } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport CompactList from '../../components/compact-list';\nimport { store as blockDirectoryStore } from '../../store';\n\nexport default function InstalledBlocksPrePublishPanel() {\n\tconst newBlockTypes = useSelect(\n\t\t( select ) => select( blockDirectoryStore ).getNewBlockTypes(),\n\t\t[]\n\t);\n\n\tif ( ! newBlockTypes.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PluginPrePublishPanel\n\t\t\ttitle={ sprintf(\n\t\t\t\t// translators: %d: number of blocks (number).\n\t\t\t\t_n(\n\t\t\t\t\t'Added: %d block',\n\t\t\t\t\t'Added: %d blocks',\n\t\t\t\t\tnewBlockTypes.length\n\t\t\t\t),\n\t\t\t\tnewBlockTypes.length\n\t\t\t) }\n\t\t\tinitialOpen\n\t\t>\n\t\t\t<p className=\"installed-blocks-pre-publish-panel__copy\">\n\t\t\t\t{ _n(\n\t\t\t\t\t'The following block has been added to your site.',\n\t\t\t\t\t'The following blocks have been added to your site.',\n\t\t\t\t\tnewBlockTypes.length\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<CompactList items={ newBlockTypes } />\n\t\t</PluginPrePublishPanel>\n\t);\n}\n"],
5
+ "mappings": "AAwBE,SAYC,KAZD;AArBF,SAAS,IAAI,eAAe;AAC5B,SAAS,iBAAiB;AAC1B,SAAS,6BAA6B;AAKtC,OAAO,iBAAiB;AACxB,SAAS,SAAS,2BAA2B;AAE9B,SAAR,iCAAkD;AACxD,QAAM,gBAAgB;AAAA,IACrB,CAAE,WAAY,OAAQ,mBAAoB,EAAE,iBAAiB;AAAA,IAC7D,CAAC;AAAA,EACF;AAEA,MAAK,CAAE,cAAc,QAAS;AAC7B,WAAO;AAAA,EACR;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,OAAQ;AAAA;AAAA,QAEP;AAAA,UACC;AAAA,UACA;AAAA,UACA,cAAc;AAAA,QACf;AAAA,QACA,cAAc;AAAA,MACf;AAAA,MACA,aAAW;AAAA,MAEX;AAAA,4BAAC,OAAE,WAAU,4CACV;AAAA,UACD;AAAA,UACA;AAAA,UACA,cAAc;AAAA,QACf,GACD;AAAA,QACA,oBAAC,eAAY,OAAQ,eAAgB;AAAA;AAAA;AAAA,EACtC;AAEF;",
6
+ "names": []
7
+ }