@wordpress/widgets 3.0.0 → 3.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 +2 -0
- package/build/index.js +7 -1
- package/build/index.js.map +1 -1
- package/build-module/index.js +7 -1
- package/build-module/index.js.map +1 -1
- package/build-style/style-rtl.css +3 -3
- package/build-style/style.css +3 -3
- package/package.json +13 -13
- package/src/index.js +12 -2
package/CHANGELOG.md
CHANGED
package/build/index.js
CHANGED
|
@@ -73,9 +73,11 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
73
73
|
* Note that for the block to be useful, any scripts required by a widget must
|
|
74
74
|
* be loaded into the page.
|
|
75
75
|
*
|
|
76
|
+
* @param {Object} supports Block support settings.
|
|
76
77
|
* @see https://developer.wordpress.org/block-editor/how-to-guides/widgets/legacy-widget-block/
|
|
77
78
|
*/
|
|
78
79
|
function registerLegacyWidgetBlock() {
|
|
80
|
+
let supports = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
79
81
|
const {
|
|
80
82
|
metadata,
|
|
81
83
|
settings,
|
|
@@ -84,7 +86,11 @@ function registerLegacyWidgetBlock() {
|
|
|
84
86
|
(0, _blocks.registerBlockType)({
|
|
85
87
|
name,
|
|
86
88
|
...metadata
|
|
87
|
-
}, settings
|
|
89
|
+
}, { ...settings,
|
|
90
|
+
supports: { ...settings.supports,
|
|
91
|
+
...supports
|
|
92
|
+
}
|
|
93
|
+
});
|
|
88
94
|
}
|
|
89
95
|
/**
|
|
90
96
|
* Registers the Widget Group block.
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/widgets/src/index.js"],"names":["registerLegacyWidgetBlock","metadata","settings","name","legacyWidget","registerWidgetGroupBlock","widgetGroup"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAGA;;AAKA;;AACA;;AAEA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;
|
|
1
|
+
{"version":3,"sources":["@wordpress/widgets/src/index.js"],"names":["registerLegacyWidgetBlock","supports","metadata","settings","name","legacyWidget","registerWidgetGroupBlock","widgetGroup"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAGA;;AAKA;;AACA;;AAEA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAiCA;;;;;;AA7CA;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,yBAAT,GAAoD;AAAA,MAAhBC,QAAgB,uEAAL,EAAK;AAC1D,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,QAAZ;AAAsBC,IAAAA;AAAtB,MAA+BC,YAArC;AACA,iCACC;AAAED,IAAAA,IAAF;AAAQ,OAAGF;AAAX,GADD,EAEC,EACC,GAAGC,QADJ;AAECF,IAAAA,QAAQ,EAAE,EACT,GAAGE,QAAQ,CAACF,QADH;AAET,SAAGA;AAFM;AAFX,GAFD;AAUA;AAED;AACA;AACA;;;AACO,SAASK,wBAAT,GAAoC;AAC1C,QAAM;AAAEJ,IAAAA,QAAF;AAAYC,IAAAA,QAAZ;AAAsBC,IAAAA;AAAtB,MAA+BG,WAArC;AACA,iCAAmB;AAAEH,IAAAA,IAAF;AAAQ,OAAGF;AAAX,GAAnB,EAA0CC,QAA1C;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { registerBlockType } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport * as legacyWidget from './blocks/legacy-widget';\nimport * as widgetGroup from './blocks/widget-group';\n\nexport * from './components';\nexport * from './utils';\n\n/**\n * Registers the Legacy Widget block.\n *\n * Note that for the block to be useful, any scripts required by a widget must\n * be loaded into the page.\n *\n * @param {Object} supports Block support settings.\n * @see https://developer.wordpress.org/block-editor/how-to-guides/widgets/legacy-widget-block/\n */\nexport function registerLegacyWidgetBlock( supports = {} ) {\n\tconst { metadata, settings, name } = legacyWidget;\n\tregisterBlockType(\n\t\t{ name, ...metadata },\n\t\t{\n\t\t\t...settings,\n\t\t\tsupports: {\n\t\t\t\t...settings.supports,\n\t\t\t\t...supports,\n\t\t\t},\n\t\t}\n\t);\n}\n\n/**\n * Registers the Widget Group block.\n */\nexport function registerWidgetGroupBlock() {\n\tconst { metadata, settings, name } = widgetGroup;\n\tregisterBlockType( { name, ...metadata }, settings );\n}\n\nexport { default as registerLegacyWidgetVariations } from './register-legacy-widget-variations';\n"]}
|
package/build-module/index.js
CHANGED
|
@@ -16,10 +16,12 @@ export * from './utils';
|
|
|
16
16
|
* Note that for the block to be useful, any scripts required by a widget must
|
|
17
17
|
* be loaded into the page.
|
|
18
18
|
*
|
|
19
|
+
* @param {Object} supports Block support settings.
|
|
19
20
|
* @see https://developer.wordpress.org/block-editor/how-to-guides/widgets/legacy-widget-block/
|
|
20
21
|
*/
|
|
21
22
|
|
|
22
23
|
export function registerLegacyWidgetBlock() {
|
|
24
|
+
let supports = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
23
25
|
const {
|
|
24
26
|
metadata,
|
|
25
27
|
settings,
|
|
@@ -28,7 +30,11 @@ export function registerLegacyWidgetBlock() {
|
|
|
28
30
|
registerBlockType({
|
|
29
31
|
name,
|
|
30
32
|
...metadata
|
|
31
|
-
}, settings
|
|
33
|
+
}, { ...settings,
|
|
34
|
+
supports: { ...settings.supports,
|
|
35
|
+
...supports
|
|
36
|
+
}
|
|
37
|
+
});
|
|
32
38
|
}
|
|
33
39
|
/**
|
|
34
40
|
* Registers the Widget Group block.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/widgets/src/index.js"],"names":["registerBlockType","legacyWidget","widgetGroup","registerLegacyWidgetBlock","metadata","settings","name","registerWidgetGroupBlock","default","registerLegacyWidgetVariations"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,iBAAT,QAAkC,mBAAlC;AAEA;AACA;AACA;;AACA,OAAO,KAAKC,YAAZ,MAA8B,wBAA9B;AACA,OAAO,KAAKC,WAAZ,MAA6B,uBAA7B;AAEA,cAAc,cAAd;AACA,cAAc,SAAd;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,yBAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/widgets/src/index.js"],"names":["registerBlockType","legacyWidget","widgetGroup","registerLegacyWidgetBlock","supports","metadata","settings","name","registerWidgetGroupBlock","default","registerLegacyWidgetVariations"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,iBAAT,QAAkC,mBAAlC;AAEA;AACA;AACA;;AACA,OAAO,KAAKC,YAAZ,MAA8B,wBAA9B;AACA,OAAO,KAAKC,WAAZ,MAA6B,uBAA7B;AAEA,cAAc,cAAd;AACA,cAAc,SAAd;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,yBAAT,GAAoD;AAAA,MAAhBC,QAAgB,uEAAL,EAAK;AAC1D,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,QAAZ;AAAsBC,IAAAA;AAAtB,MAA+BN,YAArC;AACAD,EAAAA,iBAAiB,CAChB;AAAEO,IAAAA,IAAF;AAAQ,OAAGF;AAAX,GADgB,EAEhB,EACC,GAAGC,QADJ;AAECF,IAAAA,QAAQ,EAAE,EACT,GAAGE,QAAQ,CAACF,QADH;AAET,SAAGA;AAFM;AAFX,GAFgB,CAAjB;AAUA;AAED;AACA;AACA;;AACA,OAAO,SAASI,wBAAT,GAAoC;AAC1C,QAAM;AAAEH,IAAAA,QAAF;AAAYC,IAAAA,QAAZ;AAAsBC,IAAAA;AAAtB,MAA+BL,WAArC;AACAF,EAAAA,iBAAiB,CAAE;AAAEO,IAAAA,IAAF;AAAQ,OAAGF;AAAX,GAAF,EAAyBC,QAAzB,CAAjB;AACA;AAED,SAASG,OAAO,IAAIC,8BAApB,QAA0D,qCAA1D","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { registerBlockType } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport * as legacyWidget from './blocks/legacy-widget';\nimport * as widgetGroup from './blocks/widget-group';\n\nexport * from './components';\nexport * from './utils';\n\n/**\n * Registers the Legacy Widget block.\n *\n * Note that for the block to be useful, any scripts required by a widget must\n * be loaded into the page.\n *\n * @param {Object} supports Block support settings.\n * @see https://developer.wordpress.org/block-editor/how-to-guides/widgets/legacy-widget-block/\n */\nexport function registerLegacyWidgetBlock( supports = {} ) {\n\tconst { metadata, settings, name } = legacyWidget;\n\tregisterBlockType(\n\t\t{ name, ...metadata },\n\t\t{\n\t\t\t...settings,\n\t\t\tsupports: {\n\t\t\t\t...settings.supports,\n\t\t\t\t...supports,\n\t\t\t},\n\t\t}\n\t);\n}\n\n/**\n * Registers the Widget Group block.\n */\nexport function registerWidgetGroupBlock() {\n\tconst { metadata, settings, name } = widgetGroup;\n\tregisterBlockType( { name, ...metadata }, settings );\n}\n\nexport { default as registerLegacyWidgetVariations } from './register-legacy-widget-variations';\n"]}
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
* @param {string} hex - the hexadecimal value to convert
|
|
59
59
|
* @return {string} comma separated rgb values
|
|
60
60
|
*/
|
|
61
|
-
/**
|
|
62
|
-
* Breakpoint mixins
|
|
63
|
-
*/
|
|
64
61
|
/**
|
|
65
62
|
* Long content fade mixin
|
|
66
63
|
*
|
|
67
64
|
* Creates a fading overlay to signify that the content is longer
|
|
68
65
|
* than the space allows.
|
|
69
66
|
*/
|
|
67
|
+
/**
|
|
68
|
+
* Breakpoint mixins
|
|
69
|
+
*/
|
|
70
70
|
/**
|
|
71
71
|
* Focus styles.
|
|
72
72
|
*/
|
package/build-style/style.css
CHANGED
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
* @param {string} hex - the hexadecimal value to convert
|
|
59
59
|
* @return {string} comma separated rgb values
|
|
60
60
|
*/
|
|
61
|
-
/**
|
|
62
|
-
* Breakpoint mixins
|
|
63
|
-
*/
|
|
64
61
|
/**
|
|
65
62
|
* Long content fade mixin
|
|
66
63
|
*
|
|
67
64
|
* Creates a fading overlay to signify that the content is longer
|
|
68
65
|
* than the space allows.
|
|
69
66
|
*/
|
|
67
|
+
/**
|
|
68
|
+
* Breakpoint mixins
|
|
69
|
+
*/
|
|
70
70
|
/**
|
|
71
71
|
* Focus styles.
|
|
72
72
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/widgets",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "Functionality used by the widgets block editor in the Widgets screen and the Customizer.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -21,17 +21,17 @@
|
|
|
21
21
|
"react-native": "src/index",
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@babel/runtime": "^7.16.0",
|
|
24
|
-
"@wordpress/api-fetch": "^6.
|
|
25
|
-
"@wordpress/block-editor": "^11.
|
|
26
|
-
"@wordpress/blocks": "^12.
|
|
27
|
-
"@wordpress/components": "^23.
|
|
28
|
-
"@wordpress/compose": "^6.
|
|
29
|
-
"@wordpress/core-data": "^6.
|
|
30
|
-
"@wordpress/data": "^8.
|
|
31
|
-
"@wordpress/element": "^5.
|
|
32
|
-
"@wordpress/i18n": "^4.
|
|
33
|
-
"@wordpress/icons": "^9.
|
|
34
|
-
"@wordpress/notices": "^3.
|
|
24
|
+
"@wordpress/api-fetch": "^6.21.0",
|
|
25
|
+
"@wordpress/block-editor": "^11.1.0",
|
|
26
|
+
"@wordpress/blocks": "^12.1.0",
|
|
27
|
+
"@wordpress/components": "^23.1.0",
|
|
28
|
+
"@wordpress/compose": "^6.1.0",
|
|
29
|
+
"@wordpress/core-data": "^6.1.0",
|
|
30
|
+
"@wordpress/data": "^8.1.0",
|
|
31
|
+
"@wordpress/element": "^5.1.0",
|
|
32
|
+
"@wordpress/i18n": "^4.24.0",
|
|
33
|
+
"@wordpress/icons": "^9.15.0",
|
|
34
|
+
"@wordpress/notices": "^3.24.0",
|
|
35
35
|
"classnames": "^2.3.1"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "200bee7b06b15f6fa655e25b6ab69cbd6b49a357"
|
|
45
45
|
}
|
package/src/index.js
CHANGED
|
@@ -18,11 +18,21 @@ export * from './utils';
|
|
|
18
18
|
* Note that for the block to be useful, any scripts required by a widget must
|
|
19
19
|
* be loaded into the page.
|
|
20
20
|
*
|
|
21
|
+
* @param {Object} supports Block support settings.
|
|
21
22
|
* @see https://developer.wordpress.org/block-editor/how-to-guides/widgets/legacy-widget-block/
|
|
22
23
|
*/
|
|
23
|
-
export function registerLegacyWidgetBlock() {
|
|
24
|
+
export function registerLegacyWidgetBlock( supports = {} ) {
|
|
24
25
|
const { metadata, settings, name } = legacyWidget;
|
|
25
|
-
registerBlockType(
|
|
26
|
+
registerBlockType(
|
|
27
|
+
{ name, ...metadata },
|
|
28
|
+
{
|
|
29
|
+
...settings,
|
|
30
|
+
supports: {
|
|
31
|
+
...settings.supports,
|
|
32
|
+
...supports,
|
|
33
|
+
},
|
|
34
|
+
}
|
|
35
|
+
);
|
|
26
36
|
}
|
|
27
37
|
|
|
28
38
|
/**
|