@wordpress/widgets 4.6.0 → 4.7.1-next.5368f64a9.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/blocks/legacy-widget/edit/widget-type-selector.js +3 -5
- package/build/blocks/legacy-widget/edit/widget-type-selector.js.map +1 -1
- package/build-module/blocks/legacy-widget/edit/widget-type-selector.js +3 -5
- package/build-module/blocks/legacy-widget/edit/widget-type-selector.js.map +1 -1
- package/package.json +13 -13
- package/src/blocks/legacy-widget/edit/widget-type-selector.js +2 -3
- package/src/blocks/legacy-widget/editor.scss +2 -2
- package/src/blocks/widget-group/editor.scss +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -31,12 +31,10 @@ function WidgetTypeSelector({
|
|
|
31
31
|
if (widgetTypes.length === 0) {
|
|
32
32
|
return (0, _i18n.__)('There are no widgets available.');
|
|
33
33
|
}
|
|
34
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SelectControl
|
|
35
|
-
|
|
36
|
-
, {
|
|
37
|
-
__next40pxDefaultSize: false,
|
|
34
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SelectControl, {
|
|
35
|
+
__next40pxDefaultSize: true,
|
|
38
36
|
__nextHasNoMarginBottom: true,
|
|
39
|
-
label: (0, _i18n.__)('
|
|
37
|
+
label: (0, _i18n.__)('Legacy widget'),
|
|
40
38
|
value: selectedId !== null && selectedId !== void 0 ? selectedId : '',
|
|
41
39
|
options: [{
|
|
42
40
|
value: '',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","_data","_coreData","_blockEditor","_jsxRuntime","WidgetTypeSelector","selectedId","onSelect","widgetTypes","useSelect","select","_select$getSettings$w","hiddenIds","blockEditorStore","getSettings","widgetTypesToHideFromLegacyWidgetBlock","coreStore","getWidgetTypes","per_page","filter","widgetType","includes","id","jsx","Spinner","length","__","SelectControl","__next40pxDefaultSize","__nextHasNoMarginBottom","label","value","options","map","name","onChange","selected","find","isMulti","is_multi"],"sources":["@wordpress/widgets/src/blocks/legacy-widget/edit/widget-type-selector.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Spinner, SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nexport default function WidgetTypeSelector( { selectedId, onSelect } ) {\n\tconst widgetTypes = useSelect( ( select ) => {\n\t\tconst hiddenIds =\n\t\t\tselect( blockEditorStore ).getSettings()\n\t\t\t\t?.widgetTypesToHideFromLegacyWidgetBlock ?? [];\n\t\treturn select( coreStore )\n\t\t\t.getWidgetTypes( { per_page: -1 } )\n\t\t\t?.filter( ( widgetType ) => ! hiddenIds.includes( widgetType.id ) );\n\t}, [] );\n\n\tif ( ! widgetTypes ) {\n\t\treturn <Spinner />;\n\t}\n\n\tif ( widgetTypes.length === 0 ) {\n\t\treturn __( 'There are no widgets available.' );\n\t}\n\n\treturn (\n\t\t<SelectControl\n\t\t\
|
|
1
|
+
{"version":3,"names":["_components","require","_i18n","_data","_coreData","_blockEditor","_jsxRuntime","WidgetTypeSelector","selectedId","onSelect","widgetTypes","useSelect","select","_select$getSettings$w","hiddenIds","blockEditorStore","getSettings","widgetTypesToHideFromLegacyWidgetBlock","coreStore","getWidgetTypes","per_page","filter","widgetType","includes","id","jsx","Spinner","length","__","SelectControl","__next40pxDefaultSize","__nextHasNoMarginBottom","label","value","options","map","name","onChange","selected","find","isMulti","is_multi"],"sources":["@wordpress/widgets/src/blocks/legacy-widget/edit/widget-type-selector.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Spinner, SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nexport default function WidgetTypeSelector( { selectedId, onSelect } ) {\n\tconst widgetTypes = useSelect( ( select ) => {\n\t\tconst hiddenIds =\n\t\t\tselect( blockEditorStore ).getSettings()\n\t\t\t\t?.widgetTypesToHideFromLegacyWidgetBlock ?? [];\n\t\treturn select( coreStore )\n\t\t\t.getWidgetTypes( { per_page: -1 } )\n\t\t\t?.filter( ( widgetType ) => ! hiddenIds.includes( widgetType.id ) );\n\t}, [] );\n\n\tif ( ! widgetTypes ) {\n\t\treturn <Spinner />;\n\t}\n\n\tif ( widgetTypes.length === 0 ) {\n\t\treturn __( 'There are no widgets available.' );\n\t}\n\n\treturn (\n\t\t<SelectControl\n\t\t\t__next40pxDefaultSize\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ __( 'Legacy widget' ) }\n\t\t\tvalue={ selectedId ?? '' }\n\t\t\toptions={ [\n\t\t\t\t{ value: '', label: __( 'Select widget' ) },\n\t\t\t\t...widgetTypes.map( ( widgetType ) => ( {\n\t\t\t\t\tvalue: widgetType.id,\n\t\t\t\t\tlabel: widgetType.name,\n\t\t\t\t} ) ),\n\t\t\t] }\n\t\t\tonChange={ ( value ) => {\n\t\t\t\tif ( value ) {\n\t\t\t\t\tconst selected = widgetTypes.find(\n\t\t\t\t\t\t( widgetType ) => widgetType.id === value\n\t\t\t\t\t);\n\t\t\t\t\tonSelect( {\n\t\t\t\t\t\tselectedId: selected.id,\n\t\t\t\t\t\tisMulti: selected.is_multi,\n\t\t\t\t\t} );\n\t\t\t\t} else {\n\t\t\t\t\tonSelect( { selectedId: null } );\n\t\t\t\t}\n\t\t\t} }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAAoE,IAAAK,WAAA,GAAAL,OAAA;AAPpE;AACA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CACH;IACHC,QAAQ,EAAKJ,KAAK,IAAM;MACvB,IAAKA,KAAK,EAAG;QACZ,MAAMK,QAAQ,GAAG5B,WAAW,CAAC6B,IAAI,CAC9BjB,UAAU,IAAMA,UAAU,CAACE,EAAE,KAAKS,KACrC,CAAC;QACDxB,QAAQ,CAAE;UACTD,UAAU,EAAE8B,QAAQ,CAACd,EAAE;UACvBgB,OAAO,EAAEF,QAAQ,CAACG;QACnB,CAAE,CAAC;MACJ,CAAC,MAAM;QACNhC,QAAQ,CAAE;UAAED,UAAU,EAAE;QAAK,CAAE,CAAC;MACjC;IACD;EAAG,CACH,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -24,12 +24,10 @@ export default function WidgetTypeSelector({
|
|
|
24
24
|
if (widgetTypes.length === 0) {
|
|
25
25
|
return __('There are no widgets available.');
|
|
26
26
|
}
|
|
27
|
-
return /*#__PURE__*/_jsx(SelectControl
|
|
28
|
-
|
|
29
|
-
, {
|
|
30
|
-
__next40pxDefaultSize: false,
|
|
27
|
+
return /*#__PURE__*/_jsx(SelectControl, {
|
|
28
|
+
__next40pxDefaultSize: true,
|
|
31
29
|
__nextHasNoMarginBottom: true,
|
|
32
|
-
label: __('
|
|
30
|
+
label: __('Legacy widget'),
|
|
33
31
|
value: selectedId !== null && selectedId !== void 0 ? selectedId : '',
|
|
34
32
|
options: [{
|
|
35
33
|
value: '',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Spinner","SelectControl","__","useSelect","store","coreStore","blockEditorStore","jsx","_jsx","WidgetTypeSelector","selectedId","onSelect","widgetTypes","select","_select$getSettings$w","hiddenIds","getSettings","widgetTypesToHideFromLegacyWidgetBlock","getWidgetTypes","per_page","filter","widgetType","includes","id","length","__next40pxDefaultSize","__nextHasNoMarginBottom","label","value","options","map","name","onChange","selected","find","isMulti","is_multi"],"sources":["@wordpress/widgets/src/blocks/legacy-widget/edit/widget-type-selector.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Spinner, SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nexport default function WidgetTypeSelector( { selectedId, onSelect } ) {\n\tconst widgetTypes = useSelect( ( select ) => {\n\t\tconst hiddenIds =\n\t\t\tselect( blockEditorStore ).getSettings()\n\t\t\t\t?.widgetTypesToHideFromLegacyWidgetBlock ?? [];\n\t\treturn select( coreStore )\n\t\t\t.getWidgetTypes( { per_page: -1 } )\n\t\t\t?.filter( ( widgetType ) => ! hiddenIds.includes( widgetType.id ) );\n\t}, [] );\n\n\tif ( ! widgetTypes ) {\n\t\treturn <Spinner />;\n\t}\n\n\tif ( widgetTypes.length === 0 ) {\n\t\treturn __( 'There are no widgets available.' );\n\t}\n\n\treturn (\n\t\t<SelectControl\n\t\t\
|
|
1
|
+
{"version":3,"names":["Spinner","SelectControl","__","useSelect","store","coreStore","blockEditorStore","jsx","_jsx","WidgetTypeSelector","selectedId","onSelect","widgetTypes","select","_select$getSettings$w","hiddenIds","getSettings","widgetTypesToHideFromLegacyWidgetBlock","getWidgetTypes","per_page","filter","widgetType","includes","id","length","__next40pxDefaultSize","__nextHasNoMarginBottom","label","value","options","map","name","onChange","selected","find","isMulti","is_multi"],"sources":["@wordpress/widgets/src/blocks/legacy-widget/edit/widget-type-selector.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Spinner, SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nexport default function WidgetTypeSelector( { selectedId, onSelect } ) {\n\tconst widgetTypes = useSelect( ( select ) => {\n\t\tconst hiddenIds =\n\t\t\tselect( blockEditorStore ).getSettings()\n\t\t\t\t?.widgetTypesToHideFromLegacyWidgetBlock ?? [];\n\t\treturn select( coreStore )\n\t\t\t.getWidgetTypes( { per_page: -1 } )\n\t\t\t?.filter( ( widgetType ) => ! hiddenIds.includes( widgetType.id ) );\n\t}, [] );\n\n\tif ( ! widgetTypes ) {\n\t\treturn <Spinner />;\n\t}\n\n\tif ( widgetTypes.length === 0 ) {\n\t\treturn __( 'There are no widgets available.' );\n\t}\n\n\treturn (\n\t\t<SelectControl\n\t\t\t__next40pxDefaultSize\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ __( 'Legacy widget' ) }\n\t\t\tvalue={ selectedId ?? '' }\n\t\t\toptions={ [\n\t\t\t\t{ value: '', label: __( 'Select widget' ) },\n\t\t\t\t...widgetTypes.map( ( widgetType ) => ( {\n\t\t\t\t\tvalue: widgetType.id,\n\t\t\t\t\tlabel: widgetType.name,\n\t\t\t\t} ) ),\n\t\t\t] }\n\t\t\tonChange={ ( value ) => {\n\t\t\t\tif ( value ) {\n\t\t\t\t\tconst selected = widgetTypes.find(\n\t\t\t\t\t\t( widgetType ) => widgetType.id === value\n\t\t\t\t\t);\n\t\t\t\t\tonSelect( {\n\t\t\t\t\t\tselectedId: selected.id,\n\t\t\t\t\t\tisMulti: selected.is_multi,\n\t\t\t\t\t} );\n\t\t\t\t} else {\n\t\t\t\t\tonSelect( { selectedId: null } );\n\t\t\t\t}\n\t\t\t} }\n\t\t/>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,EAAEC,aAAa,QAAQ,uBAAuB;AAC9D,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASD,KAAK,IAAIE,gBAAgB,QAAQ,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEpE,eAAe,SAASC,kBAAkBA,CAAE;EAAEC,UAAU;EAAEC;AAAS,CAAC,EAAG;EACtE,MAAMC,WAAW,GAAGT,SAAS,CAAIU,MAAM,IAAM;IAAA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E;UACvBY,OAAO,EAAEF,QAAQ,CAACG;QACnB,CAAE,CAAC;MACJ,CAAC,MAAM;QACNzB,QAAQ,CAAE;UAAED,UAAU,EAAE;QAAK,CAAE,CAAC;MACjC;IACD;EAAG,CACH,CAAC;AAEJ","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/widgets",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.7.1-next.5368f64a9.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",
|
|
@@ -25,17 +25,17 @@
|
|
|
25
25
|
"react-native": "src/index",
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@babel/runtime": "^7.16.0",
|
|
28
|
-
"@wordpress/api-fetch": "^7.
|
|
29
|
-
"@wordpress/block-editor": "^14.1.0",
|
|
30
|
-
"@wordpress/blocks": "^13.
|
|
31
|
-
"@wordpress/components": "^28.
|
|
32
|
-
"@wordpress/compose": "^7.
|
|
33
|
-
"@wordpress/core-data": "^7.
|
|
34
|
-
"@wordpress/data": "^10.
|
|
35
|
-
"@wordpress/element": "^6.
|
|
36
|
-
"@wordpress/i18n": "^5.
|
|
37
|
-
"@wordpress/icons": "^10.
|
|
38
|
-
"@wordpress/notices": "^5.
|
|
28
|
+
"@wordpress/api-fetch": "^7.7.1-next.5368f64a9.0",
|
|
29
|
+
"@wordpress/block-editor": "^14.2.1-next.5368f64a9.0",
|
|
30
|
+
"@wordpress/blocks": "^13.7.1-next.5368f64a9.0",
|
|
31
|
+
"@wordpress/components": "^28.8.1-next.5368f64a9.0",
|
|
32
|
+
"@wordpress/compose": "^7.8.1-next.5368f64a9.0",
|
|
33
|
+
"@wordpress/core-data": "^7.7.1-next.5368f64a9.0",
|
|
34
|
+
"@wordpress/data": "^10.7.1-next.5368f64a9.0",
|
|
35
|
+
"@wordpress/element": "^6.7.1-next.5368f64a9.0",
|
|
36
|
+
"@wordpress/i18n": "^5.7.1-next.5368f64a9.0",
|
|
37
|
+
"@wordpress/icons": "^10.7.1-next.5368f64a9.0",
|
|
38
|
+
"@wordpress/notices": "^5.7.1-next.5368f64a9.0",
|
|
39
39
|
"clsx": "^2.1.1"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "24934a1f5251bbee15045d1fd953d9c5650317cd"
|
|
49
49
|
}
|
|
@@ -27,10 +27,9 @@ export default function WidgetTypeSelector( { selectedId, onSelect } ) {
|
|
|
27
27
|
|
|
28
28
|
return (
|
|
29
29
|
<SelectControl
|
|
30
|
-
|
|
31
|
-
__next40pxDefaultSize={ false }
|
|
30
|
+
__next40pxDefaultSize
|
|
32
31
|
__nextHasNoMarginBottom
|
|
33
|
-
label={ __( '
|
|
32
|
+
label={ __( 'Legacy widget' ) }
|
|
34
33
|
value={ selectedId ?? '' }
|
|
35
34
|
options={ [
|
|
36
35
|
{ value: '', label: __( 'Select widget' ) },
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
display: flow-root;
|
|
4
4
|
}
|
|
5
5
|
background: $white;
|
|
6
|
-
border-radius: $radius-
|
|
6
|
+
border-radius: $radius-small;
|
|
7
7
|
border: $border-width solid $gray-900;
|
|
8
8
|
padding: $grid-unit-15 - $border-width;
|
|
9
9
|
max-height: calc(100vh - #{ $border-width } - #{ $border-width });
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
cursor: pointer;
|
|
96
96
|
|
|
97
97
|
&:hover::after {
|
|
98
|
-
border-radius: $radius-
|
|
98
|
+
border-radius: $radius-small;
|
|
99
99
|
border: $border-width solid $gray-600;
|
|
100
100
|
bottom: 0;
|
|
101
101
|
content: "";
|