@wordpress/block-directory 3.20.0 → 4.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/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 4.1.0 (2023-01-02)
6
+
7
+ ## 4.0.0 (2022-12-14)
8
+
9
+ ### Breaking Changes
10
+
11
+ - Updated dependencies to require React 18 ([45235](https://github.com/WordPress/gutenberg/pull/45235))
12
+
5
13
  ## 3.20.0 (2022-11-16)
6
14
 
7
15
  ## 3.19.0 (2022-11-02)
@@ -11,8 +11,6 @@ var _element = require("@wordpress/element");
11
11
 
12
12
  var _i18n = require("@wordpress/i18n");
13
13
 
14
- var _editPost = require("@wordpress/edit-post");
15
-
16
14
  var _data = require("@wordpress/data");
17
15
 
18
16
  var _icons = require("@wordpress/icons");
@@ -21,13 +19,14 @@ var _compactList = _interopRequireDefault(require("../../components/compact-list
21
19
 
22
20
  var _store = require("../../store");
23
21
 
24
- /**
25
- * WordPress dependencies
26
- */
22
+ var _window$wp$editPost, _window, _window$wp;
23
+
24
+ // We shouldn't import the edit-post package directly
25
+ // because it would include the wp-edit-post in all pages loading the block-directory script.
26
+ const {
27
+ PluginPrePublishPanel
28
+ } = (_window$wp$editPost = (_window = window) === null || _window === void 0 ? void 0 : (_window$wp = _window.wp) === null || _window$wp === void 0 ? void 0 : _window$wp.editPost) !== null && _window$wp$editPost !== void 0 ? _window$wp$editPost : {};
27
29
 
28
- /**
29
- * Internal dependencies
30
- */
31
30
  function InstalledBlocksPrePublishPanel() {
32
31
  const newBlockTypes = (0, _data.useSelect)(select => select(_store.store).getNewBlockTypes(), []);
33
32
 
@@ -35,7 +34,7 @@ function InstalledBlocksPrePublishPanel() {
35
34
  return null;
36
35
  }
37
36
 
38
- return (0, _element.createElement)(_editPost.PluginPrePublishPanel, {
37
+ return (0, _element.createElement)(PluginPrePublishPanel, {
39
38
  icon: _icons.blockDefault,
40
39
  title: (0, _i18n.sprintf)( // translators: %d: number of blocks (number).
41
40
  (0, _i18n._n)('Added: %d block', 'Added: %d blocks', newBlockTypes.length), newBlockTypes.length),
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-directory/src/plugins/installed-blocks-pre-publish-panel/index.js"],"names":["InstalledBlocksPrePublishPanel","newBlockTypes","select","blockDirectoryStore","getNewBlockTypes","length","blockDefault"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAZA;AACA;AACA;;AAMA;AACA;AACA;AAIe,SAASA,8BAAT,GAA0C;AACxD,QAAMC,aAAa,GAAG,qBACnBC,MAAF,IAAcA,MAAM,CAAEC,YAAF,CAAN,CAA8BC,gBAA9B,EADO,EAErB,EAFqB,CAAtB;;AAKA,MAAK,CAAEH,aAAa,CAACI,MAArB,EAA8B;AAC7B,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,+BAAD;AACC,IAAA,IAAI,EAAGC,mBADR;AAEC,IAAA,KAAK,EAAG,oBACP;AACA,kBACC,iBADD,EAEC,kBAFD,EAGCL,aAAa,CAACI,MAHf,CAFO,EAOPJ,aAAa,CAACI,MAPP,CAFT;AAWC,IAAA,WAAW,EAAG;AAXf,KAaC;AAAG,IAAA,SAAS,EAAC;AAAb,KACG,cACD,kDADC,EAED,oDAFC,EAGDJ,aAAa,CAACI,MAHb,CADH,CAbD,EAoBC,4BAAC,oBAAD;AAAa,IAAA,KAAK,EAAGJ;AAArB,IApBD,CADD;AAwBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _n, sprintf } from '@wordpress/i18n';\nimport { PluginPrePublishPanel } from '@wordpress/edit-post';\nimport { useSelect } from '@wordpress/data';\nimport { blockDefault } from '@wordpress/icons';\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\ticon={ blockDefault }\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={ true }\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"]}
1
+ {"version":3,"sources":["@wordpress/block-directory/src/plugins/installed-blocks-pre-publish-panel/index.js"],"names":["PluginPrePublishPanel","window","wp","editPost","InstalledBlocksPrePublishPanel","newBlockTypes","select","blockDirectoryStore","getNewBlockTypes","length","blockDefault"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AACA;;;;AAEA;AACA;AACA,MAAM;AAAEA,EAAAA;AAAF,sCAA4BC,MAA5B,0DAA4B,QAAQC,EAApC,+CAA4B,WAAYC,QAAxC,qEAAoD,EAA1D;;AAEe,SAASC,8BAAT,GAA0C;AACxD,QAAMC,aAAa,GAAG,qBACnBC,MAAF,IAAcA,MAAM,CAAEC,YAAF,CAAN,CAA8BC,gBAA9B,EADO,EAErB,EAFqB,CAAtB;;AAKA,MAAK,CAAEH,aAAa,CAACI,MAArB,EAA8B;AAC7B,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,qBAAD;AACC,IAAA,IAAI,EAAGC,mBADR;AAEC,IAAA,KAAK,EAAG,oBACP;AACA,kBACC,iBADD,EAEC,kBAFD,EAGCL,aAAa,CAACI,MAHf,CAFO,EAOPJ,aAAa,CAACI,MAPP,CAFT;AAWC,IAAA,WAAW,EAAG;AAXf,KAaC;AAAG,IAAA,SAAS,EAAC;AAAb,KACG,cACD,kDADC,EAED,oDAFC,EAGDJ,aAAa,CAACI,MAHb,CADH,CAbD,EAoBC,4BAAC,oBAAD;AAAa,IAAA,KAAK,EAAGJ;AAArB,IApBD,CADD;AAwBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _n, sprintf } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { blockDefault } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport CompactList from '../../components/compact-list';\nimport { store as blockDirectoryStore } from '../../store';\n\n// We shouldn't import the edit-post package directly\n// because it would include the wp-edit-post in all pages loading the block-directory script.\nconst { PluginPrePublishPanel } = window?.wp?.editPost ?? {};\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\ticon={ blockDefault }\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={ true }\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"]}
@@ -1,10 +1,11 @@
1
+ var _window$wp$editPost, _window, _window$wp;
2
+
1
3
  import { createElement } from "@wordpress/element";
2
4
 
3
5
  /**
4
6
  * WordPress dependencies
5
7
  */
6
8
  import { _n, sprintf } from '@wordpress/i18n';
7
- import { PluginPrePublishPanel } from '@wordpress/edit-post';
8
9
  import { useSelect } from '@wordpress/data';
9
10
  import { blockDefault } from '@wordpress/icons';
10
11
  /**
@@ -12,7 +13,12 @@ import { blockDefault } from '@wordpress/icons';
12
13
  */
13
14
 
14
15
  import CompactList from '../../components/compact-list';
15
- import { store as blockDirectoryStore } from '../../store';
16
+ import { store as blockDirectoryStore } from '../../store'; // We shouldn't import the edit-post package directly
17
+ // because it would include the wp-edit-post in all pages loading the block-directory script.
18
+
19
+ const {
20
+ PluginPrePublishPanel
21
+ } = (_window$wp$editPost = (_window = window) === null || _window === void 0 ? void 0 : (_window$wp = _window.wp) === null || _window$wp === void 0 ? void 0 : _window$wp.editPost) !== null && _window$wp$editPost !== void 0 ? _window$wp$editPost : {};
16
22
  export default function InstalledBlocksPrePublishPanel() {
17
23
  const newBlockTypes = useSelect(select => select(blockDirectoryStore).getNewBlockTypes(), []);
18
24
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-directory/src/plugins/installed-blocks-pre-publish-panel/index.js"],"names":["_n","sprintf","PluginPrePublishPanel","useSelect","blockDefault","CompactList","store","blockDirectoryStore","InstalledBlocksPrePublishPanel","newBlockTypes","select","getNewBlockTypes","length"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,qBAAT,QAAsC,sBAAtC;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,YAAT,QAA6B,kBAA7B;AAEA;AACA;AACA;;AACA,OAAOC,WAAP,MAAwB,+BAAxB;AACA,SAASC,KAAK,IAAIC,mBAAlB,QAA6C,aAA7C;AAEA,eAAe,SAASC,8BAAT,GAA0C;AACxD,QAAMC,aAAa,GAAGN,SAAS,CAC5BO,MAAF,IAAcA,MAAM,CAAEH,mBAAF,CAAN,CAA8BI,gBAA9B,EADgB,EAE9B,EAF8B,CAA/B;;AAKA,MAAK,CAAEF,aAAa,CAACG,MAArB,EAA8B;AAC7B,WAAO,IAAP;AACA;;AAED,SACC,cAAC,qBAAD;AACC,IAAA,IAAI,EAAGR,YADR;AAEC,IAAA,KAAK,EAAGH,OAAO,EACd;AACAD,IAAAA,EAAE,CACD,iBADC,EAED,kBAFC,EAGDS,aAAa,CAACG,MAHb,CAFY,EAOdH,aAAa,CAACG,MAPA,CAFhB;AAWC,IAAA,WAAW,EAAG;AAXf,KAaC;AAAG,IAAA,SAAS,EAAC;AAAb,KACGZ,EAAE,CACH,kDADG,EAEH,oDAFG,EAGHS,aAAa,CAACG,MAHX,CADL,CAbD,EAoBC,cAAC,WAAD;AAAa,IAAA,KAAK,EAAGH;AAArB,IApBD,CADD;AAwBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _n, sprintf } from '@wordpress/i18n';\nimport { PluginPrePublishPanel } from '@wordpress/edit-post';\nimport { useSelect } from '@wordpress/data';\nimport { blockDefault } from '@wordpress/icons';\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\ticon={ blockDefault }\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={ true }\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"]}
1
+ {"version":3,"sources":["@wordpress/block-directory/src/plugins/installed-blocks-pre-publish-panel/index.js"],"names":["_n","sprintf","useSelect","blockDefault","CompactList","store","blockDirectoryStore","PluginPrePublishPanel","window","wp","editPost","InstalledBlocksPrePublishPanel","newBlockTypes","select","getNewBlockTypes","length"],"mappings":";;;;AAAA;AACA;AACA;AACA,SAASA,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,YAAT,QAA6B,kBAA7B;AAEA;AACA;AACA;;AACA,OAAOC,WAAP,MAAwB,+BAAxB;AACA,SAASC,KAAK,IAAIC,mBAAlB,QAA6C,aAA7C,C,CAEA;AACA;;AACA,MAAM;AAAEC,EAAAA;AAAF,sCAA4BC,MAA5B,0DAA4B,QAAQC,EAApC,+CAA4B,WAAYC,QAAxC,qEAAoD,EAA1D;AAEA,eAAe,SAASC,8BAAT,GAA0C;AACxD,QAAMC,aAAa,GAAGV,SAAS,CAC5BW,MAAF,IAAcA,MAAM,CAAEP,mBAAF,CAAN,CAA8BQ,gBAA9B,EADgB,EAE9B,EAF8B,CAA/B;;AAKA,MAAK,CAAEF,aAAa,CAACG,MAArB,EAA8B;AAC7B,WAAO,IAAP;AACA;;AAED,SACC,cAAC,qBAAD;AACC,IAAA,IAAI,EAAGZ,YADR;AAEC,IAAA,KAAK,EAAGF,OAAO,EACd;AACAD,IAAAA,EAAE,CACD,iBADC,EAED,kBAFC,EAGDY,aAAa,CAACG,MAHb,CAFY,EAOdH,aAAa,CAACG,MAPA,CAFhB;AAWC,IAAA,WAAW,EAAG;AAXf,KAaC;AAAG,IAAA,SAAS,EAAC;AAAb,KACGf,EAAE,CACH,kDADG,EAEH,oDAFG,EAGHY,aAAa,CAACG,MAHX,CADL,CAbD,EAoBC,cAAC,WAAD;AAAa,IAAA,KAAK,EAAGH;AAArB,IApBD,CADD;AAwBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _n, sprintf } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { blockDefault } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport CompactList from '../../components/compact-list';\nimport { store as blockDirectoryStore } from '../../store';\n\n// We shouldn't import the edit-post package directly\n// because it would include the wp-edit-post in all pages loading the block-directory script.\nconst { PluginPrePublishPanel } = window?.wp?.editPost ?? {};\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\ticon={ blockDefault }\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={ true }\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"]}
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Converts a hex value into the rgb equivalent.
3
+ *
4
+ * @param {string} hex - the hexadecimal value to convert
5
+ * @return {string} comma separated rgb values
6
+ */
1
7
  /**
2
8
  * Colors
3
9
  */
@@ -11,6 +17,12 @@
11
17
  * Don't add to this sheet unless you're pretty sure the value will be reused in many places.
12
18
  * For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
13
19
  */
20
+ /**
21
+ * Converts a hex value into the rgb equivalent.
22
+ *
23
+ * @param {string} hex - the hexadecimal value to convert
24
+ * @return {string} comma separated rgb values
25
+ */
14
26
  /**
15
27
  * Colors
16
28
  */
@@ -46,15 +58,15 @@
46
58
  * @param {string} hex - the hexadecimal value to convert
47
59
  * @return {string} comma separated rgb values
48
60
  */
49
- /**
50
- * Breakpoint mixins
51
- */
52
61
  /**
53
62
  * Long content fade mixin
54
63
  *
55
64
  * Creates a fading overlay to signify that the content is longer
56
65
  * than the space allows.
57
66
  */
67
+ /**
68
+ * Breakpoint mixins
69
+ */
58
70
  /**
59
71
  * Focus styles.
60
72
  */
@@ -82,6 +94,8 @@
82
94
  --wp-admin-theme-color-darker-20: #005a87;
83
95
  --wp-admin-theme-color-darker-20--rgb: 0, 90, 135;
84
96
  --wp-admin-border-width-focus: 2px;
97
+ --wp-block-synced-color: #7a00df;
98
+ --wp-block-synced-color--rgb: 122, 0, 223;
85
99
  }
86
100
  @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
87
101
  :root {
@@ -153,6 +167,7 @@
153
167
  .block-directory-downloadable-block-list-item.is-busy .block-directory-downloadable-block-list-item__author {
154
168
  border: 0;
155
169
  clip: rect(1px, 1px, 1px, 1px);
170
+ -webkit-clip-path: inset(50%);
156
171
  clip-path: inset(50%);
157
172
  height: 1px;
158
173
  margin: -1px;
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Converts a hex value into the rgb equivalent.
3
+ *
4
+ * @param {string} hex - the hexadecimal value to convert
5
+ * @return {string} comma separated rgb values
6
+ */
1
7
  /**
2
8
  * Colors
3
9
  */
@@ -11,6 +17,12 @@
11
17
  * Don't add to this sheet unless you're pretty sure the value will be reused in many places.
12
18
  * For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
13
19
  */
20
+ /**
21
+ * Converts a hex value into the rgb equivalent.
22
+ *
23
+ * @param {string} hex - the hexadecimal value to convert
24
+ * @return {string} comma separated rgb values
25
+ */
14
26
  /**
15
27
  * Colors
16
28
  */
@@ -46,15 +58,15 @@
46
58
  * @param {string} hex - the hexadecimal value to convert
47
59
  * @return {string} comma separated rgb values
48
60
  */
49
- /**
50
- * Breakpoint mixins
51
- */
52
61
  /**
53
62
  * Long content fade mixin
54
63
  *
55
64
  * Creates a fading overlay to signify that the content is longer
56
65
  * than the space allows.
57
66
  */
67
+ /**
68
+ * Breakpoint mixins
69
+ */
58
70
  /**
59
71
  * Focus styles.
60
72
  */
@@ -82,6 +94,8 @@
82
94
  --wp-admin-theme-color-darker-20: #005a87;
83
95
  --wp-admin-theme-color-darker-20--rgb: 0, 90, 135;
84
96
  --wp-admin-border-width-focus: 2px;
97
+ --wp-block-synced-color: #7a00df;
98
+ --wp-block-synced-color--rgb: 122, 0, 223;
85
99
  }
86
100
  @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
87
101
  :root {
@@ -153,6 +167,7 @@
153
167
  .block-directory-downloadable-block-list-item.is-busy .block-directory-downloadable-block-list-item__author {
154
168
  border: 0;
155
169
  clip: rect(1px, 1px, 1px, 1px);
170
+ -webkit-clip-path: inset(50%);
156
171
  clip-path: inset(50%);
157
172
  height: 1px;
158
173
  margin: -1px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-directory",
3
- "version": "3.20.0",
3
+ "version": "4.1.0",
4
4
  "description": "Extend editor with block directory features to search, download and install blocks.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -26,32 +26,32 @@
26
26
  "react-native": "src/index",
27
27
  "dependencies": {
28
28
  "@babel/runtime": "^7.16.0",
29
- "@wordpress/a11y": "^3.22.0",
30
- "@wordpress/api-fetch": "^6.19.0",
31
- "@wordpress/block-editor": "^10.5.0",
32
- "@wordpress/blocks": "^11.21.0",
33
- "@wordpress/components": "^22.1.0",
34
- "@wordpress/compose": "^5.20.0",
35
- "@wordpress/core-data": "^5.5.0",
36
- "@wordpress/data": "^7.6.0",
37
- "@wordpress/edit-post": "^6.19.0",
38
- "@wordpress/editor": "^12.21.0",
39
- "@wordpress/element": "^4.20.0",
40
- "@wordpress/hooks": "^3.22.0",
41
- "@wordpress/html-entities": "^3.22.0",
42
- "@wordpress/i18n": "^4.22.0",
43
- "@wordpress/icons": "^9.13.0",
44
- "@wordpress/notices": "^3.22.0",
45
- "@wordpress/plugins": "^4.20.0",
46
- "@wordpress/url": "^3.23.0",
29
+ "@wordpress/a11y": "^3.24.0",
30
+ "@wordpress/api-fetch": "^6.21.0",
31
+ "@wordpress/block-editor": "^11.1.0",
32
+ "@wordpress/blocks": "^12.1.0",
33
+ "@wordpress/components": "^23.1.0",
34
+ "@wordpress/compose": "^6.1.0",
35
+ "@wordpress/core-data": "^6.1.0",
36
+ "@wordpress/data": "^8.1.0",
37
+ "@wordpress/edit-post": "^7.1.0",
38
+ "@wordpress/editor": "^13.1.0",
39
+ "@wordpress/element": "^5.1.0",
40
+ "@wordpress/hooks": "^3.24.0",
41
+ "@wordpress/html-entities": "^3.24.0",
42
+ "@wordpress/i18n": "^4.24.0",
43
+ "@wordpress/icons": "^9.15.0",
44
+ "@wordpress/notices": "^3.24.0",
45
+ "@wordpress/plugins": "^5.1.0",
46
+ "@wordpress/url": "^3.25.0",
47
47
  "change-case": "^4.1.2"
48
48
  },
49
49
  "peerDependencies": {
50
- "react": "^17.0.0",
51
- "react-dom": "^17.0.0"
50
+ "react": "^18.0.0",
51
+ "react-dom": "^18.0.0"
52
52
  },
53
53
  "publishConfig": {
54
54
  "access": "public"
55
55
  },
56
- "gitHead": "7ac04f446242452d3cb24372f9ca58f0cae97715"
56
+ "gitHead": "200bee7b06b15f6fa655e25b6ab69cbd6b49a357"
57
57
  }
@@ -15,6 +15,8 @@ import { useSelect } from '@wordpress/data';
15
15
  import DownloadableBlockListItem from '../';
16
16
  import { plugin } from '../../test/fixtures';
17
17
 
18
+ jest.useFakeTimers();
19
+
18
20
  jest.mock( '@wordpress/data/src/components/use-select', () => {
19
21
  // This allows us to tweak the returned value on each test.
20
22
  const mock = jest.fn();
@@ -2,7 +2,6 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { _n, sprintf } from '@wordpress/i18n';
5
- import { PluginPrePublishPanel } from '@wordpress/edit-post';
6
5
  import { useSelect } from '@wordpress/data';
7
6
  import { blockDefault } from '@wordpress/icons';
8
7
 
@@ -12,6 +11,10 @@ import { blockDefault } from '@wordpress/icons';
12
11
  import CompactList from '../../components/compact-list';
13
12
  import { store as blockDirectoryStore } from '../../store';
14
13
 
14
+ // We shouldn't import the edit-post package directly
15
+ // because it would include the wp-edit-post in all pages loading the block-directory script.
16
+ const { PluginPrePublishPanel } = window?.wp?.editPost ?? {};
17
+
15
18
  export default function InstalledBlocksPrePublishPanel() {
16
19
  const newBlockTypes = useSelect(
17
20
  ( select ) => select( blockDirectoryStore ).getNewBlockTypes(),