@wordpress/block-directory 3.19.0 → 4.0.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 +8 -0
- package/build/plugins/installed-blocks-pre-publish-panel/index.js +8 -9
- package/build/plugins/installed-blocks-pre-publish-panel/index.js.map +1 -1
- package/build-module/plugins/installed-blocks-pre-publish-panel/index.js +8 -2
- package/build-module/plugins/installed-blocks-pre-publish-panel/index.js.map +1 -1
- package/build-style/style-rtl.css +15 -0
- package/build-style/style.css +15 -0
- package/package.json +22 -22
- package/src/plugins/installed-blocks-pre-publish-panel/index.js +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 4.0.0 (2022-12-14)
|
|
6
|
+
|
|
7
|
+
### Breaking Changes
|
|
8
|
+
|
|
9
|
+
- Updated dependencies to require React 18 ([45235](https://github.com/WordPress/gutenberg/pull/45235))
|
|
10
|
+
|
|
11
|
+
## 3.20.0 (2022-11-16)
|
|
12
|
+
|
|
5
13
|
## 3.19.0 (2022-11-02)
|
|
6
14
|
|
|
7
15
|
## 3.18.0 (2022-10-19)
|
|
@@ -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
|
-
|
|
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)(
|
|
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;;
|
|
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","
|
|
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
|
*/
|
|
@@ -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/build-style/style.css
CHANGED
|
@@ -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
|
*/
|
|
@@ -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
|
+
"version": "4.0.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.
|
|
30
|
-
"@wordpress/api-fetch": "^6.
|
|
31
|
-
"@wordpress/block-editor": "^
|
|
32
|
-
"@wordpress/blocks": "^
|
|
33
|
-
"@wordpress/components": "^
|
|
34
|
-
"@wordpress/compose": "^
|
|
35
|
-
"@wordpress/core-data": "^
|
|
36
|
-
"@wordpress/data": "^
|
|
37
|
-
"@wordpress/edit-post": "^
|
|
38
|
-
"@wordpress/editor": "^
|
|
39
|
-
"@wordpress/element": "^
|
|
40
|
-
"@wordpress/hooks": "^3.
|
|
41
|
-
"@wordpress/html-entities": "^3.
|
|
42
|
-
"@wordpress/i18n": "^4.
|
|
43
|
-
"@wordpress/icons": "^9.
|
|
44
|
-
"@wordpress/notices": "^3.
|
|
45
|
-
"@wordpress/plugins": "^
|
|
46
|
-
"@wordpress/url": "^3.
|
|
29
|
+
"@wordpress/a11y": "^3.23.0",
|
|
30
|
+
"@wordpress/api-fetch": "^6.20.0",
|
|
31
|
+
"@wordpress/block-editor": "^11.0.0",
|
|
32
|
+
"@wordpress/blocks": "^12.0.0",
|
|
33
|
+
"@wordpress/components": "^23.0.0",
|
|
34
|
+
"@wordpress/compose": "^6.0.0",
|
|
35
|
+
"@wordpress/core-data": "^6.0.0",
|
|
36
|
+
"@wordpress/data": "^8.0.0",
|
|
37
|
+
"@wordpress/edit-post": "^7.0.0",
|
|
38
|
+
"@wordpress/editor": "^13.0.0",
|
|
39
|
+
"@wordpress/element": "^5.0.0",
|
|
40
|
+
"@wordpress/hooks": "^3.23.0",
|
|
41
|
+
"@wordpress/html-entities": "^3.23.0",
|
|
42
|
+
"@wordpress/i18n": "^4.23.0",
|
|
43
|
+
"@wordpress/icons": "^9.14.0",
|
|
44
|
+
"@wordpress/notices": "^3.23.0",
|
|
45
|
+
"@wordpress/plugins": "^5.0.0",
|
|
46
|
+
"@wordpress/url": "^3.24.0",
|
|
47
47
|
"change-case": "^4.1.2"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"react": "^
|
|
51
|
-
"react-dom": "^
|
|
50
|
+
"react": "^18.0.0",
|
|
51
|
+
"react-dom": "^18.0.0"
|
|
52
52
|
},
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "1eb65aabe6738097f4c062e78f69ae8f05879848"
|
|
57
57
|
}
|
|
@@ -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(),
|