@wordpress/widgets 4.37.0 → 4.37.1-next.06ee73755.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 +0 -2
- package/LICENSE.md +1 -1
- package/build/blocks/legacy-widget/edit/{control.js → control.cjs} +1 -1
- package/build/blocks/legacy-widget/edit/{convert-to-blocks-button.js → convert-to-blocks-button.cjs} +1 -1
- package/build/blocks/legacy-widget/edit/{form.js → form.cjs} +2 -2
- package/build/blocks/legacy-widget/edit/{index.js → index.cjs} +7 -7
- package/build/blocks/legacy-widget/edit/{inspector-card.js → inspector-card.cjs} +1 -1
- package/build/blocks/legacy-widget/edit/{no-preview.js → no-preview.cjs} +1 -1
- package/build/blocks/legacy-widget/edit/{preview.js → preview.cjs} +1 -1
- package/build/blocks/legacy-widget/edit/{widget-type-selector.js → widget-type-selector.cjs} +1 -2
- package/build/blocks/legacy-widget/edit/{widget-type-selector.js.map → widget-type-selector.cjs.map} +2 -2
- package/build/blocks/legacy-widget/{index.js → index.cjs} +3 -3
- package/build/blocks/legacy-widget/{transforms.js → transforms.cjs} +1 -1
- package/build/blocks/widget-group/{deprecated.js → deprecated.cjs} +1 -1
- package/build/blocks/widget-group/{edit.js → edit.cjs} +4 -4
- package/build/blocks/widget-group/{edit.js.map → edit.cjs.map} +2 -2
- package/build/blocks/widget-group/{index.js → index.cjs} +4 -4
- package/build/blocks/widget-group/{save.js → save.cjs} +1 -1
- package/build/components/{index.js → index.cjs} +2 -2
- package/build/components/move-to-widget-area/{index.js → index.cjs} +1 -1
- package/build/{index.js → index.cjs} +8 -8
- package/build/{index.js.map → index.cjs.map} +1 -1
- package/build/{register-legacy-widget-variations.js → register-legacy-widget-variations.cjs} +1 -1
- package/build/{utils.js → utils.cjs} +1 -1
- package/build-module/blocks/legacy-widget/edit/{control.js → control.mjs} +1 -1
- package/build-module/blocks/legacy-widget/edit/{convert-to-blocks-button.js → convert-to-blocks-button.mjs} +1 -1
- package/build-module/blocks/legacy-widget/edit/{form.js → form.mjs} +2 -2
- package/build-module/blocks/legacy-widget/edit/{index.js → index.mjs} +7 -7
- package/build-module/blocks/legacy-widget/edit/{inspector-card.js → inspector-card.mjs} +1 -1
- package/build-module/blocks/legacy-widget/edit/{no-preview.js → no-preview.mjs} +1 -1
- package/build-module/blocks/legacy-widget/edit/{preview.js → preview.mjs} +1 -1
- package/build-module/blocks/legacy-widget/edit/{widget-type-selector.js → widget-type-selector.mjs} +1 -2
- package/build-module/blocks/legacy-widget/edit/{widget-type-selector.js.map → widget-type-selector.mjs.map} +2 -2
- package/build-module/blocks/legacy-widget/{index.js → index.mjs} +3 -3
- package/build-module/blocks/legacy-widget/{transforms.js → transforms.mjs} +1 -1
- package/build-module/blocks/widget-group/{deprecated.js → deprecated.mjs} +1 -1
- package/build-module/blocks/widget-group/{edit.js → edit.mjs} +4 -4
- package/build-module/blocks/widget-group/{edit.js.map → edit.mjs.map} +2 -2
- package/build-module/blocks/widget-group/{index.js → index.mjs} +4 -4
- package/build-module/blocks/widget-group/{save.js → save.mjs} +1 -1
- package/build-module/components/index.mjs +6 -0
- package/build-module/components/move-to-widget-area/{index.js → index.mjs} +1 -1
- package/build-module/{index.js → index.mjs} +6 -6
- package/build-module/{register-legacy-widget-variations.js → register-legacy-widget-variations.mjs} +1 -1
- package/build-module/{utils.js → utils.mjs} +1 -1
- package/build-style/style-rtl.css +4 -10
- package/build-style/style.css +4 -10
- package/package.json +26 -18
- package/src/blocks/legacy-widget/edit/widget-type-selector.js +0 -1
- package/src/blocks/widget-group/edit.js +3 -3
- package/src/blocks/widget-group/editor.scss +0 -11
- package/build-module/components/index.js +0 -6
- /package/build/blocks/legacy-widget/edit/{control.js.map → control.cjs.map} +0 -0
- /package/build/blocks/legacy-widget/edit/{convert-to-blocks-button.js.map → convert-to-blocks-button.cjs.map} +0 -0
- /package/build/blocks/legacy-widget/edit/{form.js.map → form.cjs.map} +0 -0
- /package/build/blocks/legacy-widget/edit/{index.js.map → index.cjs.map} +0 -0
- /package/build/blocks/legacy-widget/edit/{inspector-card.js.map → inspector-card.cjs.map} +0 -0
- /package/build/blocks/legacy-widget/edit/{no-preview.js.map → no-preview.cjs.map} +0 -0
- /package/build/blocks/legacy-widget/edit/{preview.js.map → preview.cjs.map} +0 -0
- /package/build/blocks/legacy-widget/{index.js.map → index.cjs.map} +0 -0
- /package/build/blocks/legacy-widget/{transforms.js.map → transforms.cjs.map} +0 -0
- /package/build/blocks/widget-group/{deprecated.js.map → deprecated.cjs.map} +0 -0
- /package/build/blocks/widget-group/{index.js.map → index.cjs.map} +0 -0
- /package/build/blocks/widget-group/{save.js.map → save.cjs.map} +0 -0
- /package/build/components/{index.js.map → index.cjs.map} +0 -0
- /package/build/components/move-to-widget-area/{index.js.map → index.cjs.map} +0 -0
- /package/build/{register-legacy-widget-variations.js.map → register-legacy-widget-variations.cjs.map} +0 -0
- /package/build/{utils.js.map → utils.cjs.map} +0 -0
- /package/build-module/blocks/legacy-widget/edit/{control.js.map → control.mjs.map} +0 -0
- /package/build-module/blocks/legacy-widget/edit/{convert-to-blocks-button.js.map → convert-to-blocks-button.mjs.map} +0 -0
- /package/build-module/blocks/legacy-widget/edit/{form.js.map → form.mjs.map} +0 -0
- /package/build-module/blocks/legacy-widget/edit/{index.js.map → index.mjs.map} +0 -0
- /package/build-module/blocks/legacy-widget/edit/{inspector-card.js.map → inspector-card.mjs.map} +0 -0
- /package/build-module/blocks/legacy-widget/edit/{no-preview.js.map → no-preview.mjs.map} +0 -0
- /package/build-module/blocks/legacy-widget/edit/{preview.js.map → preview.mjs.map} +0 -0
- /package/build-module/blocks/legacy-widget/{index.js.map → index.mjs.map} +0 -0
- /package/build-module/blocks/legacy-widget/{transforms.js.map → transforms.mjs.map} +0 -0
- /package/build-module/blocks/widget-group/{deprecated.js.map → deprecated.mjs.map} +0 -0
- /package/build-module/blocks/widget-group/{index.js.map → index.mjs.map} +0 -0
- /package/build-module/blocks/widget-group/{save.js.map → save.mjs.map} +0 -0
- /package/build-module/components/{index.js.map → index.mjs.map} +0 -0
- /package/build-module/components/move-to-widget-area/{index.js.map → index.mjs.map} +0 -0
- /package/build-module/{index.js.map → index.mjs.map} +0 -0
- /package/build-module/{register-legacy-widget-variations.js.map → register-legacy-widget-variations.mjs.map} +0 -0
- /package/build-module/{utils.js.map → utils.mjs.map} +0 -0
package/CHANGELOG.md
CHANGED
package/LICENSE.md
CHANGED
|
@@ -39,7 +39,7 @@ var import_notices = require("@wordpress/notices");
|
|
|
39
39
|
var import_i18n = require("@wordpress/i18n");
|
|
40
40
|
var import_components = require("@wordpress/components");
|
|
41
41
|
var import_compose = require("@wordpress/compose");
|
|
42
|
-
var import_control = __toESM(require("./control"));
|
|
42
|
+
var import_control = __toESM(require("./control.cjs"));
|
|
43
43
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
44
44
|
function Form({
|
|
45
45
|
title,
|
|
@@ -143,4 +143,4 @@ function Form({
|
|
|
143
143
|
}
|
|
144
144
|
);
|
|
145
145
|
}
|
|
146
|
-
//# sourceMappingURL=form.
|
|
146
|
+
//# sourceMappingURL=form.cjs.map
|
|
@@ -39,12 +39,12 @@ var import_icons = require("@wordpress/icons");
|
|
|
39
39
|
var import_i18n = require("@wordpress/i18n");
|
|
40
40
|
var import_element = require("@wordpress/element");
|
|
41
41
|
var import_core_data = require("@wordpress/core-data");
|
|
42
|
-
var import_widget_type_selector = __toESM(require("./widget-type-selector"));
|
|
43
|
-
var import_inspector_card = __toESM(require("./inspector-card"));
|
|
44
|
-
var import_form = __toESM(require("./form"));
|
|
45
|
-
var import_preview = __toESM(require("./preview"));
|
|
46
|
-
var import_no_preview = __toESM(require("./no-preview"));
|
|
47
|
-
var import_convert_to_blocks_button = __toESM(require("./convert-to-blocks-button"));
|
|
42
|
+
var import_widget_type_selector = __toESM(require("./widget-type-selector.cjs"));
|
|
43
|
+
var import_inspector_card = __toESM(require("./inspector-card.cjs"));
|
|
44
|
+
var import_form = __toESM(require("./form.cjs"));
|
|
45
|
+
var import_preview = __toESM(require("./preview.cjs"));
|
|
46
|
+
var import_no_preview = __toESM(require("./no-preview.cjs"));
|
|
47
|
+
var import_convert_to_blocks_button = __toESM(require("./convert-to-blocks-button.cjs"));
|
|
48
48
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
49
49
|
function Edit(props) {
|
|
50
50
|
const { id, idBase } = props.attributes;
|
|
@@ -161,4 +161,4 @@ function NotEmpty({
|
|
|
161
161
|
] })
|
|
162
162
|
] });
|
|
163
163
|
}
|
|
164
|
-
//# sourceMappingURL=index.
|
|
164
|
+
//# sourceMappingURL=index.cjs.map
|
package/build/blocks/legacy-widget/edit/{widget-type-selector.js → widget-type-selector.cjs}
RENAMED
|
@@ -43,7 +43,6 @@ function WidgetTypeSelector({ selectedId, onSelect }) {
|
|
|
43
43
|
import_components.SelectControl,
|
|
44
44
|
{
|
|
45
45
|
__next40pxDefaultSize: true,
|
|
46
|
-
__nextHasNoMarginBottom: true,
|
|
47
46
|
label: (0, import_i18n.__)("Legacy widget"),
|
|
48
47
|
value: selectedId ?? "",
|
|
49
48
|
options: [
|
|
@@ -69,4 +68,4 @@ function WidgetTypeSelector({ selectedId, onSelect }) {
|
|
|
69
68
|
}
|
|
70
69
|
);
|
|
71
70
|
}
|
|
72
|
-
//# sourceMappingURL=widget-type-selector.
|
|
71
|
+
//# sourceMappingURL=widget-type-selector.cjs.map
|
package/build/blocks/legacy-widget/edit/{widget-type-selector.js.map → widget-type-selector.cjs.map}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/blocks/legacy-widget/edit/widget-type-selector.js"],
|
|
4
|
-
"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\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAAuC;AACvC,kBAAmB;AACnB,kBAA0B;AAC1B,uBAAmC;AACnC,0BAA0C;AAajC;AAXM,SAAR,mBAAqC,EAAE,YAAY,SAAS,GAAI;AACtE,QAAM,kBAAc,uBAAW,CAAE,WAAY;AAC5C,UAAM,YACL,OAAQ,oBAAAA,KAAiB,EAAE,YAAY,GACpC,0CAA0C,CAAC;AAC/C,WAAO,OAAQ,iBAAAC,KAAU,EACvB,eAAgB,EAAE,UAAU,GAAG,CAAE,GAChC,OAAQ,CAAE,eAAgB,CAAE,UAAU,SAAU,WAAW,EAAG,CAAE;AAAA,EACpE,GAAG,CAAC,CAAE;AAEN,MAAK,CAAE,aAAc;AACpB,WAAO,4CAAC,6BAAQ;AAAA,EACjB;AAEA,MAAK,YAAY,WAAW,GAAI;AAC/B,eAAO,gBAAI,iCAAkC;AAAA,EAC9C;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,uBAAqB;AAAA,MACrB,
|
|
4
|
+
"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\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"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAAuC;AACvC,kBAAmB;AACnB,kBAA0B;AAC1B,uBAAmC;AACnC,0BAA0C;AAajC;AAXM,SAAR,mBAAqC,EAAE,YAAY,SAAS,GAAI;AACtE,QAAM,kBAAc,uBAAW,CAAE,WAAY;AAC5C,UAAM,YACL,OAAQ,oBAAAA,KAAiB,EAAE,YAAY,GACpC,0CAA0C,CAAC;AAC/C,WAAO,OAAQ,iBAAAC,KAAU,EACvB,eAAgB,EAAE,UAAU,GAAG,CAAE,GAChC,OAAQ,CAAE,eAAgB,CAAE,UAAU,SAAU,WAAW,EAAG,CAAE;AAAA,EACpE,GAAG,CAAC,CAAE;AAEN,MAAK,CAAE,aAAc;AACpB,WAAO,4CAAC,6BAAQ;AAAA,EACjB;AAEA,MAAK,YAAY,WAAW,GAAI;AAC/B,eAAO,gBAAI,iCAAkC;AAAA,EAC9C;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,uBAAqB;AAAA,MACrB,WAAQ,gBAAI,eAAgB;AAAA,MAC5B,OAAQ,cAAc;AAAA,MACtB,SAAU;AAAA,QACT,EAAE,OAAO,IAAI,WAAO,gBAAI,eAAgB,EAAE;AAAA,QAC1C,GAAG,YAAY,IAAK,CAAE,gBAAkB;AAAA,UACvC,OAAO,WAAW;AAAA,UAClB,OAAO,WAAW;AAAA,QACnB,EAAI;AAAA,MACL;AAAA,MACA,UAAW,CAAE,UAAW;AACvB,YAAK,OAAQ;AACZ,gBAAM,WAAW,YAAY;AAAA,YAC5B,CAAE,eAAgB,WAAW,OAAO;AAAA,UACrC;AACA,mBAAU;AAAA,YACT,YAAY,SAAS;AAAA,YACrB,SAAS,SAAS;AAAA,UACnB,CAAE;AAAA,QACH,OAAO;AACN,mBAAU,EAAE,YAAY,KAAK,CAAE;AAAA,QAChC;AAAA,MACD;AAAA;AAAA,EACD;AAEF;",
|
|
6
6
|
"names": ["blockEditorStore", "coreStore"]
|
|
7
7
|
}
|
|
@@ -36,8 +36,8 @@ __export(legacy_widget_exports, {
|
|
|
36
36
|
module.exports = __toCommonJS(legacy_widget_exports);
|
|
37
37
|
var import_icons = require("@wordpress/icons");
|
|
38
38
|
var import_block = __toESM(require("./block.json"));
|
|
39
|
-
var import_edit = __toESM(require("./edit"));
|
|
40
|
-
var import_transforms = __toESM(require("./transforms"));
|
|
39
|
+
var import_edit = __toESM(require("./edit/index.cjs"));
|
|
40
|
+
var import_transforms = __toESM(require("./transforms.cjs"));
|
|
41
41
|
var { name } = import_block.default;
|
|
42
42
|
var settings = {
|
|
43
43
|
icon: import_icons.widget,
|
|
@@ -50,4 +50,4 @@ var settings = {
|
|
|
50
50
|
name,
|
|
51
51
|
settings
|
|
52
52
|
});
|
|
53
|
-
//# sourceMappingURL=index.
|
|
53
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -30,11 +30,11 @@ var import_data = require("@wordpress/data");
|
|
|
30
30
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
31
31
|
function Edit(props) {
|
|
32
32
|
const { clientId } = props;
|
|
33
|
-
const
|
|
34
|
-
(select) => select(import_block_editor.store).
|
|
33
|
+
const hasInnerBlocks = (0, import_data.useSelect)(
|
|
34
|
+
(select) => select(import_block_editor.store).getBlockCount(clientId) > 0,
|
|
35
35
|
[clientId]
|
|
36
36
|
);
|
|
37
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...(0, import_block_editor.useBlockProps)({ className: "widget" }), children:
|
|
37
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...(0, import_block_editor.useBlockProps)({ className: "widget" }), children: !hasInnerBlocks ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PlaceholderContent, { ...props }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PreviewContent, { ...props }) });
|
|
38
38
|
}
|
|
39
39
|
function PlaceholderContent({ clientId }) {
|
|
40
40
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
@@ -67,4 +67,4 @@ function PreviewContent({ attributes, setAttributes }) {
|
|
|
67
67
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.InnerBlocks, {})
|
|
68
68
|
] });
|
|
69
69
|
}
|
|
70
|
-
//# sourceMappingURL=edit.
|
|
70
|
+
//# sourceMappingURL=edit.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/blocks/widget-group/edit.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tuseBlockProps,\n\tBlockIcon,\n\tButtonBlockAppender,\n\tInnerBlocks,\n\tstore as blockEditorStore,\n\tRichText,\n} from '@wordpress/block-editor';\nimport { Placeholder } from '@wordpress/components';\nimport { group as groupIcon } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\n\nexport default function Edit( props ) {\n\tconst { clientId } = props;\n\tconst
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAOO;AACP,wBAA4B;AAC5B,mBAAmC;AACnC,kBAAmB;AACnB,kBAA0B;AAYtB;AAVW,SAAR,KAAuB,OAAQ;AACrC,QAAM,EAAE,SAAS,IAAI;AACrB,QAAM,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tuseBlockProps,\n\tBlockIcon,\n\tButtonBlockAppender,\n\tInnerBlocks,\n\tstore as blockEditorStore,\n\tRichText,\n} from '@wordpress/block-editor';\nimport { Placeholder } from '@wordpress/components';\nimport { group as groupIcon } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\n\nexport default function Edit( props ) {\n\tconst { clientId } = props;\n\tconst hasInnerBlocks = useSelect(\n\t\t( select ) => select( blockEditorStore ).getBlockCount( clientId ) > 0,\n\t\t[ clientId ]\n\t);\n\n\treturn (\n\t\t<div { ...useBlockProps( { className: 'widget' } ) }>\n\t\t\t{ ! hasInnerBlocks ? (\n\t\t\t\t<PlaceholderContent { ...props } />\n\t\t\t) : (\n\t\t\t\t<PreviewContent { ...props } />\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nfunction PlaceholderContent( { clientId } ) {\n\treturn (\n\t\t<>\n\t\t\t<Placeholder\n\t\t\t\tclassName=\"wp-block-widget-group__placeholder\"\n\t\t\t\ticon={ <BlockIcon icon={ groupIcon } /> }\n\t\t\t\tlabel={ __( 'Widget Group' ) }\n\t\t\t>\n\t\t\t\t<ButtonBlockAppender rootClientId={ clientId } />\n\t\t\t</Placeholder>\n\t\t\t<InnerBlocks renderAppender={ false } />\n\t\t</>\n\t);\n}\n\nfunction PreviewContent( { attributes, setAttributes } ) {\n\treturn (\n\t\t<>\n\t\t\t<RichText\n\t\t\t\ttagName=\"h2\"\n\t\t\t\tidentifier=\"title\"\n\t\t\t\tclassName=\"widget-title\"\n\t\t\t\tallowedFormats={ [] }\n\t\t\t\tplaceholder={ __( 'Title' ) }\n\t\t\t\tvalue={ attributes.title ?? '' }\n\t\t\t\tonChange={ ( title ) => setAttributes( { title } ) }\n\t\t\t/>\n\t\t\t<InnerBlocks />\n\t\t</>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAOO;AACP,wBAA4B;AAC5B,mBAAmC;AACnC,kBAAmB;AACnB,kBAA0B;AAYtB;AAVW,SAAR,KAAuB,OAAQ;AACrC,QAAM,EAAE,SAAS,IAAI;AACrB,QAAM,qBAAiB;AAAA,IACtB,CAAE,WAAY,OAAQ,oBAAAA,KAAiB,EAAE,cAAe,QAAS,IAAI;AAAA,IACrE,CAAE,QAAS;AAAA,EACZ;AAEA,SACC,4CAAC,SAAM,OAAG,mCAAe,EAAE,WAAW,SAAS,CAAE,GAC9C,WAAE,iBACH,4CAAC,sBAAqB,GAAG,OAAQ,IAEjC,4CAAC,kBAAiB,GAAG,OAAQ,GAE/B;AAEF;AAEA,SAAS,mBAAoB,EAAE,SAAS,GAAI;AAC3C,SACC,4EACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,WAAU;AAAA,QACV,MAAO,4CAAC,iCAAU,MAAO,aAAAC,OAAY;AAAA,QACrC,WAAQ,gBAAI,cAAe;AAAA,QAE3B,sDAAC,2CAAoB,cAAe,UAAW;AAAA;AAAA,IAChD;AAAA,IACA,4CAAC,mCAAY,gBAAiB,OAAQ;AAAA,KACvC;AAEF;AAEA,SAAS,eAAgB,EAAE,YAAY,cAAc,GAAI;AACxD,SACC,4EACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,SAAQ;AAAA,QACR,YAAW;AAAA,QACX,WAAU;AAAA,QACV,gBAAiB,CAAC;AAAA,QAClB,iBAAc,gBAAI,OAAQ;AAAA,QAC1B,OAAQ,WAAW,SAAS;AAAA,QAC5B,UAAW,CAAE,UAAW,cAAe,EAAE,MAAM,CAAE;AAAA;AAAA,IAClD;AAAA,IACA,4CAAC,mCAAY;AAAA,KACd;AAEF;",
|
|
6
6
|
"names": ["blockEditorStore", "groupIcon"]
|
|
7
7
|
}
|
|
@@ -38,9 +38,9 @@ var import_i18n = require("@wordpress/i18n");
|
|
|
38
38
|
var import_blocks = require("@wordpress/blocks");
|
|
39
39
|
var import_icons = require("@wordpress/icons");
|
|
40
40
|
var import_block = __toESM(require("./block.json"));
|
|
41
|
-
var import_edit = __toESM(require("./edit"));
|
|
42
|
-
var import_save = __toESM(require("./save"));
|
|
43
|
-
var import_deprecated = __toESM(require("./deprecated"));
|
|
41
|
+
var import_edit = __toESM(require("./edit.cjs"));
|
|
42
|
+
var import_save = __toESM(require("./save.cjs"));
|
|
43
|
+
var import_deprecated = __toESM(require("./deprecated.cjs"));
|
|
44
44
|
var { name } = import_block.default;
|
|
45
45
|
var settings = {
|
|
46
46
|
title: (0, import_i18n.__)("Widget Group"),
|
|
@@ -97,4 +97,4 @@ var settings = {
|
|
|
97
97
|
name,
|
|
98
98
|
settings
|
|
99
99
|
});
|
|
100
|
-
//# sourceMappingURL=index.
|
|
100
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -37,4 +37,4 @@ function save({ attributes }) {
|
|
|
37
37
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "wp-widget-group__inner-blocks", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.InnerBlocks.Content, {}) })
|
|
38
38
|
] });
|
|
39
39
|
}
|
|
40
|
-
//# sourceMappingURL=save.
|
|
40
|
+
//# sourceMappingURL=save.cjs.map
|
|
@@ -32,9 +32,9 @@ __export(components_exports, {
|
|
|
32
32
|
MoveToWidgetArea: () => import_move_to_widget_area.default
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(components_exports);
|
|
35
|
-
var import_move_to_widget_area = __toESM(require("./move-to-widget-area"));
|
|
35
|
+
var import_move_to_widget_area = __toESM(require("./move-to-widget-area/index.cjs"));
|
|
36
36
|
// Annotate the CommonJS export names for ESM import in node:
|
|
37
37
|
0 && (module.exports = {
|
|
38
38
|
MoveToWidgetArea
|
|
39
39
|
});
|
|
40
|
-
//# sourceMappingURL=index.
|
|
40
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -36,11 +36,11 @@ __export(index_exports, {
|
|
|
36
36
|
});
|
|
37
37
|
module.exports = __toCommonJS(index_exports);
|
|
38
38
|
var import_blocks = require("@wordpress/blocks");
|
|
39
|
-
var legacyWidget = __toESM(require("./blocks/legacy-widget"));
|
|
40
|
-
var widgetGroup = __toESM(require("./blocks/widget-group"));
|
|
41
|
-
__reExport(index_exports, require("./components"), module.exports);
|
|
42
|
-
__reExport(index_exports, require("./utils"), module.exports);
|
|
43
|
-
var import_register_legacy_widget_variations = __toESM(require("./register-legacy-widget-variations"));
|
|
39
|
+
var legacyWidget = __toESM(require("./blocks/legacy-widget/index.cjs"));
|
|
40
|
+
var widgetGroup = __toESM(require("./blocks/widget-group/index.cjs"));
|
|
41
|
+
__reExport(index_exports, require("./components/index.cjs"), module.exports);
|
|
42
|
+
__reExport(index_exports, require("./utils.cjs"), module.exports);
|
|
43
|
+
var import_register_legacy_widget_variations = __toESM(require("./register-legacy-widget-variations.cjs"));
|
|
44
44
|
function registerLegacyWidgetBlock(supports = {}) {
|
|
45
45
|
const { metadata, settings, name } = legacyWidget;
|
|
46
46
|
(0, import_blocks.registerBlockType)(
|
|
@@ -72,7 +72,7 @@ function registerWidgetGroupBlock(supports = {}) {
|
|
|
72
72
|
registerLegacyWidgetBlock,
|
|
73
73
|
registerLegacyWidgetVariations,
|
|
74
74
|
registerWidgetGroupBlock,
|
|
75
|
-
...require("./components"),
|
|
76
|
-
...require("./utils")
|
|
75
|
+
...require("./components/index.cjs"),
|
|
76
|
+
...require("./utils.cjs")
|
|
77
77
|
});
|
|
78
|
-
//# sourceMappingURL=index.
|
|
78
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.js"],
|
|
4
4
|
"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 *\n * @param {Object} supports Block support settings.\n */\nexport function registerWidgetGroupBlock( supports = {} ) {\n\tconst { metadata, settings, name } = widgetGroup;\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\nexport { default as registerLegacyWidgetVariations } from './register-legacy-widget-variations';\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAkC;AAKlC,mBAA8B;AAC9B,kBAA6B;AAE7B,0BAAc,
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAkC;AAKlC,mBAA8B;AAC9B,kBAA6B;AAE7B,0BAAc,mCAXd;AAYA,0BAAc,wBAZd;AAwDA,+CAA0D;AAjCnD,SAAS,0BAA2B,WAAW,CAAC,GAAI;AAC1D,QAAM,EAAE,UAAU,UAAU,KAAK,IAAI;AACrC;AAAA,IACC,EAAE,MAAM,GAAG,SAAS;AAAA,IACpB;AAAA,MACC,GAAG;AAAA,MACH,UAAU;AAAA,QACT,GAAG,SAAS;AAAA,QACZ,GAAG;AAAA,MACJ;AAAA,IACD;AAAA,EACD;AACD;AAOO,SAAS,yBAA0B,WAAW,CAAC,GAAI;AACzD,QAAM,EAAE,UAAU,UAAU,KAAK,IAAI;AACrC;AAAA,IACC,EAAE,MAAM,GAAG,SAAS;AAAA,IACpB;AAAA,MACC,GAAG;AAAA,MACH,UAAU;AAAA,QACT,GAAG,SAAS;AAAA,QACZ,GAAG;AAAA,MACJ;AAAA,IACD;AAAA,EACD;AACD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -6,7 +6,7 @@ import { store as noticesStore } from "@wordpress/notices";
|
|
|
6
6
|
import { __, sprintf } from "@wordpress/i18n";
|
|
7
7
|
import { Popover } from "@wordpress/components";
|
|
8
8
|
import { useViewportMatch } from "@wordpress/compose";
|
|
9
|
-
import Control from "./control";
|
|
9
|
+
import Control from "./control.mjs";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
function Form({
|
|
12
12
|
title,
|
|
@@ -113,4 +113,4 @@ function Form({
|
|
|
113
113
|
export {
|
|
114
114
|
Form as default
|
|
115
115
|
};
|
|
116
|
-
//# sourceMappingURL=form.
|
|
116
|
+
//# sourceMappingURL=form.mjs.map
|
|
@@ -11,12 +11,12 @@ import { brush as brushIcon } from "@wordpress/icons";
|
|
|
11
11
|
import { __ } from "@wordpress/i18n";
|
|
12
12
|
import { useState, useCallback } from "@wordpress/element";
|
|
13
13
|
import { useEntityRecord } from "@wordpress/core-data";
|
|
14
|
-
import WidgetTypeSelector from "./widget-type-selector";
|
|
15
|
-
import InspectorCard from "./inspector-card";
|
|
16
|
-
import Form from "./form";
|
|
17
|
-
import Preview from "./preview";
|
|
18
|
-
import NoPreview from "./no-preview";
|
|
19
|
-
import ConvertToBlocksButton from "./convert-to-blocks-button";
|
|
14
|
+
import WidgetTypeSelector from "./widget-type-selector.mjs";
|
|
15
|
+
import InspectorCard from "./inspector-card.mjs";
|
|
16
|
+
import Form from "./form.mjs";
|
|
17
|
+
import Preview from "./preview.mjs";
|
|
18
|
+
import NoPreview from "./no-preview.mjs";
|
|
19
|
+
import ConvertToBlocksButton from "./convert-to-blocks-button.mjs";
|
|
20
20
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
21
21
|
function Edit(props) {
|
|
22
22
|
const { id, idBase } = props.attributes;
|
|
@@ -136,4 +136,4 @@ function NotEmpty({
|
|
|
136
136
|
export {
|
|
137
137
|
Edit as default
|
|
138
138
|
};
|
|
139
|
-
//# sourceMappingURL=index.
|
|
139
|
+
//# sourceMappingURL=index.mjs.map
|
package/build-module/blocks/legacy-widget/edit/{widget-type-selector.js → widget-type-selector.mjs}
RENAMED
|
@@ -20,7 +20,6 @@ function WidgetTypeSelector({ selectedId, onSelect }) {
|
|
|
20
20
|
SelectControl,
|
|
21
21
|
{
|
|
22
22
|
__next40pxDefaultSize: true,
|
|
23
|
-
__nextHasNoMarginBottom: true,
|
|
24
23
|
label: __("Legacy widget"),
|
|
25
24
|
value: selectedId ?? "",
|
|
26
25
|
options: [
|
|
@@ -49,4 +48,4 @@ function WidgetTypeSelector({ selectedId, onSelect }) {
|
|
|
49
48
|
export {
|
|
50
49
|
WidgetTypeSelector as default
|
|
51
50
|
};
|
|
52
|
-
//# sourceMappingURL=widget-type-selector.
|
|
51
|
+
//# sourceMappingURL=widget-type-selector.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/blocks/legacy-widget/edit/widget-type-selector.js"],
|
|
4
|
-
"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\
|
|
5
|
-
"mappings": ";AAGA,SAAS,SAAS,qBAAqB;AACvC,SAAS,UAAU;AACnB,SAAS,iBAAiB;AAC1B,SAAS,SAAS,iBAAiB;AACnC,SAAS,SAAS,wBAAwB;AAajC;AAXM,SAAR,mBAAqC,EAAE,YAAY,SAAS,GAAI;AACtE,QAAM,cAAc,UAAW,CAAE,WAAY;AAC5C,UAAM,YACL,OAAQ,gBAAiB,EAAE,YAAY,GACpC,0CAA0C,CAAC;AAC/C,WAAO,OAAQ,SAAU,EACvB,eAAgB,EAAE,UAAU,GAAG,CAAE,GAChC,OAAQ,CAAE,eAAgB,CAAE,UAAU,SAAU,WAAW,EAAG,CAAE;AAAA,EACpE,GAAG,CAAC,CAAE;AAEN,MAAK,CAAE,aAAc;AACpB,WAAO,oBAAC,WAAQ;AAAA,EACjB;AAEA,MAAK,YAAY,WAAW,GAAI;AAC/B,WAAO,GAAI,iCAAkC;AAAA,EAC9C;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,uBAAqB;AAAA,MACrB,
|
|
4
|
+
"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\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"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,SAAS,qBAAqB;AACvC,SAAS,UAAU;AACnB,SAAS,iBAAiB;AAC1B,SAAS,SAAS,iBAAiB;AACnC,SAAS,SAAS,wBAAwB;AAajC;AAXM,SAAR,mBAAqC,EAAE,YAAY,SAAS,GAAI;AACtE,QAAM,cAAc,UAAW,CAAE,WAAY;AAC5C,UAAM,YACL,OAAQ,gBAAiB,EAAE,YAAY,GACpC,0CAA0C,CAAC;AAC/C,WAAO,OAAQ,SAAU,EACvB,eAAgB,EAAE,UAAU,GAAG,CAAE,GAChC,OAAQ,CAAE,eAAgB,CAAE,UAAU,SAAU,WAAW,EAAG,CAAE;AAAA,EACpE,GAAG,CAAC,CAAE;AAEN,MAAK,CAAE,aAAc;AACpB,WAAO,oBAAC,WAAQ;AAAA,EACjB;AAEA,MAAK,YAAY,WAAW,GAAI;AAC/B,WAAO,GAAI,iCAAkC;AAAA,EAC9C;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,uBAAqB;AAAA,MACrB,OAAQ,GAAI,eAAgB;AAAA,MAC5B,OAAQ,cAAc;AAAA,MACtB,SAAU;AAAA,QACT,EAAE,OAAO,IAAI,OAAO,GAAI,eAAgB,EAAE;AAAA,QAC1C,GAAG,YAAY,IAAK,CAAE,gBAAkB;AAAA,UACvC,OAAO,WAAW;AAAA,UAClB,OAAO,WAAW;AAAA,QACnB,EAAI;AAAA,MACL;AAAA,MACA,UAAW,CAAE,UAAW;AACvB,YAAK,OAAQ;AACZ,gBAAM,WAAW,YAAY;AAAA,YAC5B,CAAE,eAAgB,WAAW,OAAO;AAAA,UACrC;AACA,mBAAU;AAAA,YACT,YAAY,SAAS;AAAA,YACrB,SAAS,SAAS;AAAA,UACnB,CAAE;AAAA,QACH,OAAO;AACN,mBAAU,EAAE,YAAY,KAAK,CAAE;AAAA,QAChC;AAAA,MACD;AAAA;AAAA,EACD;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// packages/widgets/src/blocks/legacy-widget/index.js
|
|
2
2
|
import { widget as icon } from "@wordpress/icons";
|
|
3
3
|
import metadata from "./block.json";
|
|
4
|
-
import edit from "./edit";
|
|
5
|
-
import transforms from "./transforms";
|
|
4
|
+
import edit from "./edit/index.mjs";
|
|
5
|
+
import transforms from "./transforms.mjs";
|
|
6
6
|
var { name } = metadata;
|
|
7
7
|
var settings = {
|
|
8
8
|
icon,
|
|
@@ -14,4 +14,4 @@ export {
|
|
|
14
14
|
name,
|
|
15
15
|
settings
|
|
16
16
|
};
|
|
17
|
-
//# sourceMappingURL=index.
|
|
17
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -14,11 +14,11 @@ import { useSelect } from "@wordpress/data";
|
|
|
14
14
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
15
15
|
function Edit(props) {
|
|
16
16
|
const { clientId } = props;
|
|
17
|
-
const
|
|
18
|
-
(select) => select(blockEditorStore).
|
|
17
|
+
const hasInnerBlocks = useSelect(
|
|
18
|
+
(select) => select(blockEditorStore).getBlockCount(clientId) > 0,
|
|
19
19
|
[clientId]
|
|
20
20
|
);
|
|
21
|
-
return /* @__PURE__ */ jsx("div", { ...useBlockProps({ className: "widget" }), children:
|
|
21
|
+
return /* @__PURE__ */ jsx("div", { ...useBlockProps({ className: "widget" }), children: !hasInnerBlocks ? /* @__PURE__ */ jsx(PlaceholderContent, { ...props }) : /* @__PURE__ */ jsx(PreviewContent, { ...props }) });
|
|
22
22
|
}
|
|
23
23
|
function PlaceholderContent({ clientId }) {
|
|
24
24
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -54,4 +54,4 @@ function PreviewContent({ attributes, setAttributes }) {
|
|
|
54
54
|
export {
|
|
55
55
|
Edit as default
|
|
56
56
|
};
|
|
57
|
-
//# sourceMappingURL=edit.
|
|
57
|
+
//# sourceMappingURL=edit.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/blocks/widget-group/edit.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tuseBlockProps,\n\tBlockIcon,\n\tButtonBlockAppender,\n\tInnerBlocks,\n\tstore as blockEditorStore,\n\tRichText,\n} from '@wordpress/block-editor';\nimport { Placeholder } from '@wordpress/components';\nimport { group as groupIcon } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\n\nexport default function Edit( props ) {\n\tconst { clientId } = props;\n\tconst
|
|
5
|
-
"mappings": ";AAGA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT;AAAA,OACM;AACP,SAAS,mBAAmB;AAC5B,SAAS,SAAS,iBAAiB;AACnC,SAAS,UAAU;AACnB,SAAS,iBAAiB;AAYtB,SAUF,UAVE,KAUF,YAVE;AAVW,SAAR,KAAuB,OAAQ;AACrC,QAAM,EAAE,SAAS,IAAI;AACrB,QAAM,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tuseBlockProps,\n\tBlockIcon,\n\tButtonBlockAppender,\n\tInnerBlocks,\n\tstore as blockEditorStore,\n\tRichText,\n} from '@wordpress/block-editor';\nimport { Placeholder } from '@wordpress/components';\nimport { group as groupIcon } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\n\nexport default function Edit( props ) {\n\tconst { clientId } = props;\n\tconst hasInnerBlocks = useSelect(\n\t\t( select ) => select( blockEditorStore ).getBlockCount( clientId ) > 0,\n\t\t[ clientId ]\n\t);\n\n\treturn (\n\t\t<div { ...useBlockProps( { className: 'widget' } ) }>\n\t\t\t{ ! hasInnerBlocks ? (\n\t\t\t\t<PlaceholderContent { ...props } />\n\t\t\t) : (\n\t\t\t\t<PreviewContent { ...props } />\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nfunction PlaceholderContent( { clientId } ) {\n\treturn (\n\t\t<>\n\t\t\t<Placeholder\n\t\t\t\tclassName=\"wp-block-widget-group__placeholder\"\n\t\t\t\ticon={ <BlockIcon icon={ groupIcon } /> }\n\t\t\t\tlabel={ __( 'Widget Group' ) }\n\t\t\t>\n\t\t\t\t<ButtonBlockAppender rootClientId={ clientId } />\n\t\t\t</Placeholder>\n\t\t\t<InnerBlocks renderAppender={ false } />\n\t\t</>\n\t);\n}\n\nfunction PreviewContent( { attributes, setAttributes } ) {\n\treturn (\n\t\t<>\n\t\t\t<RichText\n\t\t\t\ttagName=\"h2\"\n\t\t\t\tidentifier=\"title\"\n\t\t\t\tclassName=\"widget-title\"\n\t\t\t\tallowedFormats={ [] }\n\t\t\t\tplaceholder={ __( 'Title' ) }\n\t\t\t\tvalue={ attributes.title ?? '' }\n\t\t\t\tonChange={ ( title ) => setAttributes( { title } ) }\n\t\t\t/>\n\t\t\t<InnerBlocks />\n\t\t</>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";AAGA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT;AAAA,OACM;AACP,SAAS,mBAAmB;AAC5B,SAAS,SAAS,iBAAiB;AACnC,SAAS,UAAU;AACnB,SAAS,iBAAiB;AAYtB,SAUF,UAVE,KAUF,YAVE;AAVW,SAAR,KAAuB,OAAQ;AACrC,QAAM,EAAE,SAAS,IAAI;AACrB,QAAM,iBAAiB;AAAA,IACtB,CAAE,WAAY,OAAQ,gBAAiB,EAAE,cAAe,QAAS,IAAI;AAAA,IACrE,CAAE,QAAS;AAAA,EACZ;AAEA,SACC,oBAAC,SAAM,GAAG,cAAe,EAAE,WAAW,SAAS,CAAE,GAC9C,WAAE,iBACH,oBAAC,sBAAqB,GAAG,OAAQ,IAEjC,oBAAC,kBAAiB,GAAG,OAAQ,GAE/B;AAEF;AAEA,SAAS,mBAAoB,EAAE,SAAS,GAAI;AAC3C,SACC,iCACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,WAAU;AAAA,QACV,MAAO,oBAAC,aAAU,MAAO,WAAY;AAAA,QACrC,OAAQ,GAAI,cAAe;AAAA,QAE3B,8BAAC,uBAAoB,cAAe,UAAW;AAAA;AAAA,IAChD;AAAA,IACA,oBAAC,eAAY,gBAAiB,OAAQ;AAAA,KACvC;AAEF;AAEA,SAAS,eAAgB,EAAE,YAAY,cAAc,GAAI;AACxD,SACC,iCACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,SAAQ;AAAA,QACR,YAAW;AAAA,QACX,WAAU;AAAA,QACV,gBAAiB,CAAC;AAAA,QAClB,aAAc,GAAI,OAAQ;AAAA,QAC1B,OAAQ,WAAW,SAAS;AAAA,QAC5B,UAAW,CAAE,UAAW,cAAe,EAAE,MAAM,CAAE;AAAA;AAAA,IAClD;AAAA,IACA,oBAAC,eAAY;AAAA,KACd;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -3,9 +3,9 @@ import { __ } from "@wordpress/i18n";
|
|
|
3
3
|
import { createBlock } from "@wordpress/blocks";
|
|
4
4
|
import { group as icon } from "@wordpress/icons";
|
|
5
5
|
import metadata from "./block.json";
|
|
6
|
-
import edit from "./edit";
|
|
7
|
-
import save from "./save";
|
|
8
|
-
import deprecated from "./deprecated";
|
|
6
|
+
import edit from "./edit.mjs";
|
|
7
|
+
import save from "./save.mjs";
|
|
8
|
+
import deprecated from "./deprecated.mjs";
|
|
9
9
|
var { name } = metadata;
|
|
10
10
|
var settings = {
|
|
11
11
|
title: __("Widget Group"),
|
|
@@ -61,4 +61,4 @@ export {
|
|
|
61
61
|
name,
|
|
62
62
|
settings
|
|
63
63
|
};
|
|
64
|
-
//# sourceMappingURL=index.
|
|
64
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// packages/widgets/src/index.js
|
|
2
2
|
import { registerBlockType } from "@wordpress/blocks";
|
|
3
|
-
import * as legacyWidget from "./blocks/legacy-widget";
|
|
4
|
-
import * as widgetGroup from "./blocks/widget-group";
|
|
5
|
-
export * from "./components";
|
|
6
|
-
export * from "./utils";
|
|
7
|
-
import { default as default2 } from "./register-legacy-widget-variations";
|
|
3
|
+
import * as legacyWidget from "./blocks/legacy-widget/index.mjs";
|
|
4
|
+
import * as widgetGroup from "./blocks/widget-group/index.mjs";
|
|
5
|
+
export * from "./components/index.mjs";
|
|
6
|
+
export * from "./utils.mjs";
|
|
7
|
+
import { default as default2 } from "./register-legacy-widget-variations.mjs";
|
|
8
8
|
function registerLegacyWidgetBlock(supports = {}) {
|
|
9
9
|
const { metadata, settings, name } = legacyWidget;
|
|
10
10
|
registerBlockType(
|
|
@@ -36,4 +36,4 @@ export {
|
|
|
36
36
|
default2 as registerLegacyWidgetVariations,
|
|
37
37
|
registerWidgetGroupBlock
|
|
38
38
|
};
|
|
39
|
-
//# sourceMappingURL=index.
|
|
39
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -83,6 +83,10 @@
|
|
|
83
83
|
/**
|
|
84
84
|
* Reset the WP Admin page styles for Gutenberg-like pages.
|
|
85
85
|
*/
|
|
86
|
+
/**
|
|
87
|
+
* Creates a checkerboard pattern background to indicate transparency.
|
|
88
|
+
* @param {String} $size - The size of the squares in the checkerboard pattern. Default is 12px.
|
|
89
|
+
*/
|
|
86
90
|
:root {
|
|
87
91
|
--wp-block-synced-color: #7a00df;
|
|
88
92
|
--wp-block-synced-color--rgb: 122, 0, 223;
|
|
@@ -248,16 +252,6 @@
|
|
|
248
252
|
min-width: 400px;
|
|
249
253
|
}
|
|
250
254
|
|
|
251
|
-
.wp-block-widget-group.has-child-selected::after {
|
|
252
|
-
border-radius: 2px;
|
|
253
|
-
border: 1px solid var(--wp-admin-theme-color);
|
|
254
|
-
bottom: 0;
|
|
255
|
-
content: "";
|
|
256
|
-
right: 0;
|
|
257
|
-
position: absolute;
|
|
258
|
-
left: 0;
|
|
259
|
-
top: 0;
|
|
260
|
-
}
|
|
261
255
|
.wp-block-widget-group .widget-title {
|
|
262
256
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
|
263
257
|
font-size: 18px;
|
package/build-style/style.css
CHANGED
|
@@ -83,6 +83,10 @@
|
|
|
83
83
|
/**
|
|
84
84
|
* Reset the WP Admin page styles for Gutenberg-like pages.
|
|
85
85
|
*/
|
|
86
|
+
/**
|
|
87
|
+
* Creates a checkerboard pattern background to indicate transparency.
|
|
88
|
+
* @param {String} $size - The size of the squares in the checkerboard pattern. Default is 12px.
|
|
89
|
+
*/
|
|
86
90
|
:root {
|
|
87
91
|
--wp-block-synced-color: #7a00df;
|
|
88
92
|
--wp-block-synced-color--rgb: 122, 0, 223;
|
|
@@ -248,16 +252,6 @@
|
|
|
248
252
|
min-width: 400px;
|
|
249
253
|
}
|
|
250
254
|
|
|
251
|
-
.wp-block-widget-group.has-child-selected::after {
|
|
252
|
-
border-radius: 2px;
|
|
253
|
-
border: 1px solid var(--wp-admin-theme-color);
|
|
254
|
-
bottom: 0;
|
|
255
|
-
content: "";
|
|
256
|
-
left: 0;
|
|
257
|
-
position: absolute;
|
|
258
|
-
right: 0;
|
|
259
|
-
top: 0;
|
|
260
|
-
}
|
|
261
255
|
.wp-block-widget-group .widget-title {
|
|
262
256
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
|
263
257
|
font-size: 18px;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/widgets",
|
|
3
|
-
"version": "4.37.0",
|
|
3
|
+
"version": "4.37.1-next.06ee73755.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",
|
|
@@ -20,12 +20,20 @@
|
|
|
20
20
|
"node": ">=18.12.0",
|
|
21
21
|
"npm": ">=8.19.2"
|
|
22
22
|
},
|
|
23
|
-
"
|
|
24
|
-
|
|
23
|
+
"files": [
|
|
24
|
+
"src",
|
|
25
|
+
"build",
|
|
26
|
+
"build-module",
|
|
27
|
+
"build-style",
|
|
28
|
+
"build-types",
|
|
29
|
+
"*.md"
|
|
30
|
+
],
|
|
31
|
+
"main": "build/index.cjs",
|
|
32
|
+
"module": "build-module/index.mjs",
|
|
25
33
|
"exports": {
|
|
26
34
|
".": {
|
|
27
|
-
"import": "./build-module/index.
|
|
28
|
-
"require": "./build/index.
|
|
35
|
+
"import": "./build-module/index.mjs",
|
|
36
|
+
"require": "./build/index.cjs"
|
|
29
37
|
},
|
|
30
38
|
"./package.json": "./package.json"
|
|
31
39
|
},
|
|
@@ -56,18 +64,18 @@
|
|
|
56
64
|
}
|
|
57
65
|
},
|
|
58
66
|
"dependencies": {
|
|
59
|
-
"@wordpress/api-fetch": "^7.37.0",
|
|
60
|
-
"@wordpress/base-styles": "^6.13.0",
|
|
61
|
-
"@wordpress/block-editor": "^15.10.0",
|
|
62
|
-
"@wordpress/blocks": "^15.10.0",
|
|
63
|
-
"@wordpress/components": "^
|
|
64
|
-
"@wordpress/compose": "^7.37.0",
|
|
65
|
-
"@wordpress/core-data": "^7.37.0",
|
|
66
|
-
"@wordpress/data": "^10.37.0",
|
|
67
|
-
"@wordpress/element": "^6.37.0",
|
|
68
|
-
"@wordpress/i18n": "^6.10.0",
|
|
69
|
-
"@wordpress/icons": "^11.4.0",
|
|
70
|
-
"@wordpress/notices": "^5.37.0",
|
|
67
|
+
"@wordpress/api-fetch": "^7.37.1-next.06ee73755.0",
|
|
68
|
+
"@wordpress/base-styles": "^6.13.2-next.06ee73755.0",
|
|
69
|
+
"@wordpress/block-editor": "^15.10.1-next.06ee73755.0",
|
|
70
|
+
"@wordpress/blocks": "^15.10.1-next.06ee73755.0",
|
|
71
|
+
"@wordpress/components": "^32.0.1-next.06ee73755.0",
|
|
72
|
+
"@wordpress/compose": "^7.37.1-next.06ee73755.0",
|
|
73
|
+
"@wordpress/core-data": "^7.37.1-next.06ee73755.0",
|
|
74
|
+
"@wordpress/data": "^10.37.1-next.06ee73755.0",
|
|
75
|
+
"@wordpress/element": "^6.37.1-next.06ee73755.0",
|
|
76
|
+
"@wordpress/i18n": "^6.10.1-next.06ee73755.0",
|
|
77
|
+
"@wordpress/icons": "^11.4.1-next.06ee73755.0",
|
|
78
|
+
"@wordpress/notices": "^5.37.1-next.06ee73755.0",
|
|
71
79
|
"clsx": "^2.1.1"
|
|
72
80
|
},
|
|
73
81
|
"peerDependencies": {
|
|
@@ -77,5 +85,5 @@
|
|
|
77
85
|
"publishConfig": {
|
|
78
86
|
"access": "public"
|
|
79
87
|
},
|
|
80
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "fd315436f44683a993d5f053789b5279d95b2872"
|
|
81
89
|
}
|
|
@@ -16,14 +16,14 @@ import { useSelect } from '@wordpress/data';
|
|
|
16
16
|
|
|
17
17
|
export default function Edit( props ) {
|
|
18
18
|
const { clientId } = props;
|
|
19
|
-
const
|
|
20
|
-
( select ) => select( blockEditorStore ).
|
|
19
|
+
const hasInnerBlocks = useSelect(
|
|
20
|
+
( select ) => select( blockEditorStore ).getBlockCount( clientId ) > 0,
|
|
21
21
|
[ clientId ]
|
|
22
22
|
);
|
|
23
23
|
|
|
24
24
|
return (
|
|
25
25
|
<div { ...useBlockProps( { className: 'widget' } ) }>
|
|
26
|
-
{
|
|
26
|
+
{ ! hasInnerBlocks ? (
|
|
27
27
|
<PlaceholderContent { ...props } />
|
|
28
28
|
) : (
|
|
29
29
|
<PreviewContent { ...props } />
|
|
@@ -2,17 +2,6 @@
|
|
|
2
2
|
@use "@wordpress/base-styles/variables" as *;
|
|
3
3
|
|
|
4
4
|
.wp-block-widget-group {
|
|
5
|
-
&.has-child-selected::after {
|
|
6
|
-
border-radius: $radius-small;
|
|
7
|
-
border: $border-width solid var(--wp-admin-theme-color);
|
|
8
|
-
bottom: 0;
|
|
9
|
-
content: "";
|
|
10
|
-
left: 0;
|
|
11
|
-
position: absolute;
|
|
12
|
-
right: 0;
|
|
13
|
-
top: 0;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
5
|
.widget-title {
|
|
17
6
|
font-family: $default-font;
|
|
18
7
|
font-size: 18px;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/build-module/blocks/legacy-widget/edit/{inspector-card.js.map → inspector-card.mjs.map}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|