@wordpress/customize-widgets 6.0.0 → 6.2.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/build/components/block-appender/index.cjs +24 -41
- package/build/components/block-appender/index.cjs.map +1 -7
- package/build/components/block-inspector-button/index.cjs +24 -52
- package/build/components/block-inspector-button/index.cjs.map +1 -7
- package/build/components/customize-widgets/index.cjs +76 -97
- package/build/components/customize-widgets/index.cjs.map +1 -7
- package/build/components/customize-widgets/use-clear-selected-block.cjs +58 -67
- package/build/components/customize-widgets/use-clear-selected-block.cjs.map +1 -7
- package/build/components/error-boundary/index.cjs +115 -155
- package/build/components/error-boundary/index.cjs.map +1 -7
- package/build/components/focus-control/index.cjs +44 -84
- package/build/components/focus-control/index.cjs.map +1 -7
- package/build/components/focus-control/use-blocks-focus-control.cjs +28 -49
- package/build/components/focus-control/use-blocks-focus-control.cjs.map +1 -7
- package/build/components/header/index.cjs +84 -122
- package/build/components/header/index.cjs.map +1 -7
- package/build/components/inserter/index.cjs +43 -78
- package/build/components/inserter/index.cjs.map +1 -7
- package/build/components/inserter/use-inserter.cjs +22 -54
- package/build/components/inserter/use-inserter.cjs.map +1 -7
- package/build/components/keyboard-shortcut-help-modal/config.cjs +88 -85
- package/build/components/keyboard-shortcut-help-modal/config.cjs.map +1 -7
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.cjs +40 -57
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.cjs.map +1 -7
- package/build/components/keyboard-shortcut-help-modal/index.cjs +103 -165
- package/build/components/keyboard-shortcut-help-modal/index.cjs.map +1 -7
- package/build/components/keyboard-shortcut-help-modal/shortcut.cjs +38 -76
- package/build/components/keyboard-shortcut-help-modal/shortcut.cjs.map +1 -7
- package/build/components/keyboard-shortcuts/index.cjs +70 -100
- package/build/components/keyboard-shortcuts/index.cjs.map +1 -7
- package/build/components/more-menu/index.cjs +102 -151
- package/build/components/more-menu/index.cjs.map +1 -7
- package/build/components/sidebar-block-editor/index.cjs +122 -155
- package/build/components/sidebar-block-editor/index.cjs.map +1 -7
- package/build/components/sidebar-block-editor/sidebar-adapter.cjs +207 -270
- package/build/components/sidebar-block-editor/sidebar-adapter.cjs.map +1 -7
- package/build/components/sidebar-block-editor/sidebar-editor-provider.cjs +40 -50
- package/build/components/sidebar-block-editor/sidebar-editor-provider.cjs.map +1 -7
- package/build/components/sidebar-block-editor/use-sidebar-block-editor.cjs +75 -110
- package/build/components/sidebar-block-editor/use-sidebar-block-editor.cjs.map +1 -7
- package/build/components/sidebar-controls/index.cjs +27 -53
- package/build/components/sidebar-controls/index.cjs.map +1 -7
- package/build/components/welcome-guide/index.cjs +70 -94
- package/build/components/welcome-guide/index.cjs.map +1 -7
- package/build/controls/inserter-outer-section.cjs +68 -110
- package/build/controls/inserter-outer-section.cjs.map +1 -7
- package/build/controls/inspector-section.cjs +57 -90
- package/build/controls/inspector-section.cjs.map +1 -7
- package/build/controls/sidebar-control.cjs +55 -69
- package/build/controls/sidebar-control.cjs.map +1 -7
- package/build/controls/sidebar-section.cjs +79 -103
- package/build/controls/sidebar-section.cjs.map +1 -7
- package/build/filters/index.cjs +8 -5
- package/build/filters/move-to-sidebar.cjs +62 -78
- package/build/filters/move-to-sidebar.cjs.map +1 -7
- package/build/filters/replace-media-upload.cjs +11 -9
- package/build/filters/replace-media-upload.cjs.map +1 -7
- package/build/filters/wide-widget-display.cjs +20 -20
- package/build/filters/wide-widget-display.cjs.map +1 -7
- package/build/index.cjs +84 -91
- package/build/index.cjs.map +1 -7
- package/build/lock-unlock.cjs +10 -35
- package/build/lock-unlock.cjs.map +1 -7
- package/build/store/actions.cjs +49 -32
- package/build/store/actions.cjs.map +1 -7
- package/build/store/constants.cjs +12 -29
- package/build/store/constants.cjs.map +1 -7
- package/build/store/index.cjs +49 -41
- package/build/store/index.cjs.map +1 -7
- package/build/store/reducer.cjs +20 -33
- package/build/store/reducer.cjs.map +1 -7
- package/build/store/selectors.cjs +47 -38
- package/build/store/selectors.cjs.map +1 -7
- package/build/utils.cjs +81 -108
- package/build/utils.cjs.map +1 -7
- package/build-module/components/block-appender/index.mjs +18 -23
- package/build-module/components/block-appender/index.mjs.map +1 -7
- package/build-module/components/block-inspector-button/index.mjs +15 -28
- package/build-module/components/block-inspector-button/index.mjs.map +1 -7
- package/build-module/components/customize-widgets/index.mjs +45 -73
- package/build-module/components/customize-widgets/index.mjs.map +1 -7
- package/build-module/components/customize-widgets/use-clear-selected-block.mjs +52 -46
- package/build-module/components/customize-widgets/use-clear-selected-block.mjs.map +1 -7
- package/build-module/components/error-boundary/index.mjs +104 -129
- package/build-module/components/error-boundary/index.mjs.map +1 -7
- package/build-module/components/focus-control/index.mjs +37 -66
- package/build-module/components/focus-control/index.mjs.map +1 -7
- package/build-module/components/focus-control/use-blocks-focus-control.mjs +21 -27
- package/build-module/components/focus-control/use-blocks-focus-control.mjs.map +1 -7
- package/build-module/components/header/index.mjs +55 -92
- package/build-module/components/header/index.mjs.map +1 -7
- package/build-module/components/inserter/index.mjs +33 -53
- package/build-module/components/inserter/index.mjs.map +1 -7
- package/build-module/components/inserter/use-inserter.mjs +17 -34
- package/build-module/components/inserter/use-inserter.mjs.map +1 -7
- package/build-module/components/keyboard-shortcut-help-modal/config.mjs +83 -61
- package/build-module/components/keyboard-shortcut-help-modal/config.mjs.map +1 -7
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.mjs +19 -33
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.mjs.map +1 -7
- package/build-module/components/keyboard-shortcut-help-modal/index.mjs +75 -139
- package/build-module/components/keyboard-shortcut-help-modal/index.mjs.map +1 -7
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.mjs +32 -55
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.mjs.map +1 -7
- package/build-module/components/keyboard-shortcuts/index.mjs +62 -79
- package/build-module/components/keyboard-shortcuts/index.mjs.map +1 -7
- package/build-module/components/more-menu/index.mjs +75 -128
- package/build-module/components/more-menu/index.mjs.map +1 -7
- package/build-module/components/sidebar-block-editor/index.mjs +86 -128
- package/build-module/components/sidebar-block-editor/index.mjs.map +1 -7
- package/build-module/components/sidebar-block-editor/sidebar-adapter.mjs +202 -250
- package/build-module/components/sidebar-block-editor/sidebar-adapter.mjs.map +1 -7
- package/build-module/components/sidebar-block-editor/sidebar-editor-provider.mjs +17 -25
- package/build-module/components/sidebar-block-editor/sidebar-editor-provider.mjs.map +1 -7
- package/build-module/components/sidebar-block-editor/use-sidebar-block-editor.mjs +54 -86
- package/build-module/components/sidebar-block-editor/use-sidebar-block-editor.mjs.map +1 -7
- package/build-module/components/sidebar-controls/index.mjs +19 -27
- package/build-module/components/sidebar-controls/index.mjs.map +1 -7
- package/build-module/components/welcome-guide/index.mjs +62 -71
- package/build-module/components/welcome-guide/index.mjs.map +1 -7
- package/build-module/controls/inserter-outer-section.mjs +61 -88
- package/build-module/controls/inserter-outer-section.mjs.map +1 -7
- package/build-module/controls/inspector-section.mjs +52 -70
- package/build-module/controls/inspector-section.mjs.map +1 -7
- package/build-module/controls/sidebar-control.mjs +33 -45
- package/build-module/controls/sidebar-control.mjs.map +1 -7
- package/build-module/controls/sidebar-section.mjs +59 -80
- package/build-module/controls/sidebar-section.mjs.map +1 -7
- package/build-module/filters/index.mjs +0 -2
- package/build-module/filters/move-to-sidebar.mjs +52 -79
- package/build-module/filters/move-to-sidebar.mjs.map +1 -7
- package/build-module/filters/replace-media-upload.mjs +5 -8
- package/build-module/filters/replace-media-upload.mjs.map +1 -7
- package/build-module/filters/wide-widget-display.mjs +13 -18
- package/build-module/filters/wide-widget-display.mjs.map +1 -7
- package/build-module/index.mjs +53 -71
- package/build-module/index.mjs.map +1 -7
- package/build-module/lock-unlock.mjs +5 -10
- package/build-module/lock-unlock.mjs.map +1 -7
- package/build-module/store/actions.mjs +44 -8
- package/build-module/store/actions.mjs.map +1 -7
- package/build-module/store/constants.mjs +7 -5
- package/build-module/store/constants.mjs.map +1 -7
- package/build-module/store/index.mjs +15 -11
- package/build-module/store/index.mjs.map +1 -7
- package/build-module/store/reducer.mjs +15 -13
- package/build-module/store/reducer.mjs.map +1 -7
- package/build-module/store/selectors.mjs +41 -13
- package/build-module/store/selectors.mjs.map +1 -7
- package/build-module/utils.mjs +74 -82
- package/build-module/utils.mjs.map +1 -7
- package/build-style/style-rtl.css +23 -5
- package/build-style/style.css +23 -5
- package/package.json +27 -27
- package/src/components/customize-widgets/index.jsx +2 -2
- package/src/components/error-boundary/index.jsx +2 -2
- package/src/components/header/style.scss +16 -5
- package/src/components/inserter/style.scss +8 -0
- package/src/components/keyboard-shortcut-help-modal/shortcut.jsx +1 -0
- package/src/components/keyboard-shortcut-help-modal/style.scss +1 -1
- package/src/components/more-menu/index.jsx +0 -1
- package/src/components/welcome-guide/index.jsx +6 -2
- package/build/filters/index.cjs.map +0 -7
- package/build-module/filters/index.mjs.map +0 -7
|
@@ -1,21 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, {
|
|
3
|
+
__esModule: { value: true },
|
|
4
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
5
|
+
});
|
|
6
|
+
let _wordpress_compose = require("@wordpress/compose");
|
|
7
|
+
let _wordpress_hooks = require("@wordpress/hooks");
|
|
8
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
1
9
|
// packages/customize-widgets/src/filters/wide-widget-display.jsx
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"withWideWidgetDisplay"
|
|
15
|
-
);
|
|
16
|
-
(0, import_hooks.addFilter)(
|
|
17
|
-
"editor.BlockEdit",
|
|
18
|
-
"core/customize-widgets/wide-widget-display",
|
|
19
|
-
withWideWidgetDisplay
|
|
20
|
-
);
|
|
21
|
-
//# sourceMappingURL=wide-widget-display.cjs.map
|
|
10
|
+
const { wp } = window;
|
|
11
|
+
const withWideWidgetDisplay = (0, _wordpress_compose.createHigherOrderComponent)((BlockEdit) => (props) => {
|
|
12
|
+
const { idBase } = props.attributes;
|
|
13
|
+
const isWide = wp.customize.Widgets.data.availableWidgets.find((widget) => widget.id_base === idBase)?.is_wide ?? false;
|
|
14
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BlockEdit, {
|
|
15
|
+
...props,
|
|
16
|
+
isWide
|
|
17
|
+
}, "edit");
|
|
18
|
+
}, "withWideWidgetDisplay");
|
|
19
|
+
(0, _wordpress_hooks.addFilter)("editor.BlockEdit", "core/customize-widgets/wide-widget-display", withWideWidgetDisplay);
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=wide-widget-display.cjs.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/filters/wide-widget-display.jsx"],
|
|
4
|
-
"sourcesContent": ["import { createHigherOrderComponent } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\n\nconst { wp } = window;\n\nconst withWideWidgetDisplay = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst { idBase } = props.attributes;\n\t\tconst isWide =\n\t\t\twp.customize.Widgets.data.availableWidgets.find(\n\t\t\t\t( widget ) => widget.id_base === idBase\n\t\t\t)?.is_wide ?? false;\n\n\t\treturn <BlockEdit key=\"edit\" { ...props } isWide={ isWide } />;\n\t},\n\t'withWideWidgetDisplay'\n);\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/customize-widgets/wide-widget-display',\n\twithWideWidgetDisplay\n);\n"],
|
|
5
|
-
"mappings": ";AAAA,qBAA2C;AAC3C,mBAA0B;AAYjB;AAVT,IAAM,EAAE,GAAG,IAAI;AAEf,IAAM,4BAAwB;AAAA,EAC7B,CAAE,cAAe,CAAE,UAAW;AAC7B,UAAM,EAAE,OAAO,IAAI,MAAM;AACzB,UAAM,SACL,GAAG,UAAU,QAAQ,KAAK,iBAAiB;AAAA,MAC1C,CAAE,WAAY,OAAO,YAAY;AAAA,IAClC,GAAG,WAAW;AAEf,WAAO,4CAAC,aAAuB,GAAG,OAAQ,UAApB,MAAsC;AAAA,EAC7D;AAAA,EACA;AACD;AAAA,IAEA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AACD;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"wide-widget-display.cjs","names":["createHigherOrderComponent","addFilter"],"sources":["../../src/filters/wide-widget-display.jsx"],"sourcesContent":["import { createHigherOrderComponent } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\n\nconst { wp } = window;\n\nconst withWideWidgetDisplay = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst { idBase } = props.attributes;\n\t\tconst isWide =\n\t\t\twp.customize.Widgets.data.availableWidgets.find(\n\t\t\t\t( widget ) => widget.id_base === idBase\n\t\t\t)?.is_wide ?? false;\n\n\t\treturn <BlockEdit key=\"edit\" { ...props } isWide={ isWide } />;\n\t},\n\t'withWideWidgetDisplay'\n);\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/customize-widgets/wide-widget-display',\n\twithWideWidgetDisplay\n);\n"],"mappings":";;;;;;;;;AAGA,MAAM,EAAE,OAAO;AAEf,MAAM,yBAAA,GAAwBA,mBAAAA,2BAAAA,EAC3B,eAAiB,UAAW;CAC7B,MAAM,EAAE,WAAW,MAAM;CACzB,MAAM,SACL,GAAG,UAAU,QAAQ,KAAK,iBAAiB,MACxC,WAAY,OAAO,YAAY,MAClC,CAAC,EAAE,WAAW;CAEf,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EAAsB,GAAK;EAAiB;CAAU,GAAvC,MAAuC;AAC9D,GACA,uBACD;CAEAC,GAAAA,iBAAAA,UAAAA,CACC,oBACA,8CACA,qBACD"}
|
package/build/index.cjs
CHANGED
|
@@ -1,104 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, {
|
|
3
|
+
__esModule: { value: true },
|
|
4
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
5
|
+
});
|
|
6
|
+
// \0rolldown/runtime.js
|
|
1
7
|
var __create = Object.create;
|
|
2
8
|
var __defProp = Object.defineProperty;
|
|
3
9
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
10
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
11
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
12
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
13
|
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
15
|
+
key = keys[i];
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: ((k) => from[k]).bind(null, key),
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
18
22
|
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
24
|
+
value: mod,
|
|
25
|
+
enumerable: true
|
|
26
|
+
}) : target, mod));
|
|
27
|
+
let _wordpress_element = require("@wordpress/element");
|
|
28
|
+
let _wordpress_block_library = require("@wordpress/block-library");
|
|
29
|
+
let _wordpress_widgets = require("@wordpress/widgets");
|
|
30
|
+
let _wordpress_blocks = require("@wordpress/blocks");
|
|
31
|
+
let _wordpress_data = require("@wordpress/data");
|
|
32
|
+
let _wordpress_preferences = require("@wordpress/preferences");
|
|
33
|
+
let __components_customize_widgets_index_jsx = require("./components/customize-widgets/index.cjs");
|
|
34
|
+
__components_customize_widgets_index_jsx = __toESM(__components_customize_widgets_index_jsx);
|
|
35
|
+
let __controls_sidebar_section_js = require("./controls/sidebar-section.cjs");
|
|
36
|
+
__controls_sidebar_section_js = __toESM(__controls_sidebar_section_js);
|
|
37
|
+
let __controls_sidebar_control_js = require("./controls/sidebar-control.cjs");
|
|
38
|
+
__controls_sidebar_control_js = __toESM(__controls_sidebar_control_js);
|
|
39
|
+
require("./filters/index.cjs");
|
|
40
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
41
|
+
let __store_index_js = require("./store/index.cjs");
|
|
29
42
|
// packages/customize-widgets/src/index.jsx
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
var import_element = require("@wordpress/element");
|
|
37
|
-
var import_block_library = require("@wordpress/block-library");
|
|
38
|
-
var import_widgets = require("@wordpress/widgets");
|
|
39
|
-
var import_blocks = require("@wordpress/blocks");
|
|
40
|
-
var import_data = require("@wordpress/data");
|
|
41
|
-
var import_preferences = require("@wordpress/preferences");
|
|
42
|
-
var import_customize_widgets = __toESM(require("./components/customize-widgets/index.cjs"));
|
|
43
|
-
var import_sidebar_section = __toESM(require("./controls/sidebar-section.cjs"));
|
|
44
|
-
var import_sidebar_control = __toESM(require("./controls/sidebar-control.cjs"));
|
|
45
|
-
var import_filters = require("./filters/index.cjs");
|
|
46
|
-
var import_store = require("./store/index.cjs");
|
|
47
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
48
|
-
var { wp } = window;
|
|
49
|
-
var DISABLED_BLOCKS = [
|
|
50
|
-
"core/more",
|
|
51
|
-
"core/block",
|
|
52
|
-
"core/freeform",
|
|
53
|
-
"core/template-part"
|
|
43
|
+
const { wp } = window;
|
|
44
|
+
const DISABLED_BLOCKS = [
|
|
45
|
+
"core/more",
|
|
46
|
+
"core/block",
|
|
47
|
+
"core/freeform",
|
|
48
|
+
"core/template-part"
|
|
54
49
|
];
|
|
55
|
-
|
|
50
|
+
const ENABLE_EXPERIMENTAL_FSE_BLOCKS = false;
|
|
51
|
+
/**
|
|
52
|
+
* Initializes the widgets block editor in the customizer.
|
|
53
|
+
*
|
|
54
|
+
* @param {string} editorName The editor name.
|
|
55
|
+
* @param {Object} blockEditorSettings Block editor settings.
|
|
56
|
+
*/
|
|
56
57
|
function initialize(editorName, blockEditorSettings) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
(0, import_element.createRoot)(container).render(
|
|
88
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_element.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
89
|
-
import_customize_widgets.default,
|
|
90
|
-
{
|
|
91
|
-
api: wp.customize,
|
|
92
|
-
sidebarControls,
|
|
93
|
-
blockEditorSettings
|
|
94
|
-
}
|
|
95
|
-
) })
|
|
96
|
-
);
|
|
97
|
-
});
|
|
58
|
+
(0, _wordpress_data.dispatch)(_wordpress_preferences.store).setDefaults("core/customize-widgets", {
|
|
59
|
+
fixedToolbar: false,
|
|
60
|
+
welcomeGuide: true
|
|
61
|
+
});
|
|
62
|
+
(0, _wordpress_data.dispatch)(_wordpress_blocks.store).reapplyBlockTypeFilters();
|
|
63
|
+
const coreBlocks = (0, _wordpress_block_library.__experimentalGetCoreBlocks)().filter((block) => {
|
|
64
|
+
return !(DISABLED_BLOCKS.includes(block.name) || block.name.startsWith("core/post") || block.name.startsWith("core/query") || block.name.startsWith("core/site") || block.name.startsWith("core/navigation") || block.name.startsWith("core/term"));
|
|
65
|
+
});
|
|
66
|
+
(0, _wordpress_block_library.registerCoreBlocks)(coreBlocks);
|
|
67
|
+
(0, _wordpress_widgets.registerLegacyWidgetBlock)();
|
|
68
|
+
if (globalThis.IS_GUTENBERG_PLUGIN) (0, _wordpress_block_library.__experimentalRegisterExperimentalCoreBlocks)({ enableFSEBlocks: ENABLE_EXPERIMENTAL_FSE_BLOCKS });
|
|
69
|
+
(0, _wordpress_widgets.registerLegacyWidgetVariations)(blockEditorSettings);
|
|
70
|
+
(0, _wordpress_widgets.registerWidgetGroupBlock)();
|
|
71
|
+
(0, _wordpress_blocks.setFreeformContentHandlerName)("core/html");
|
|
72
|
+
const SidebarControl = (0, __controls_sidebar_control_js.default)(blockEditorSettings);
|
|
73
|
+
wp.customize.sectionConstructor.sidebar = (0, __controls_sidebar_section_js.default)();
|
|
74
|
+
wp.customize.controlConstructor.sidebar_block_editor = SidebarControl;
|
|
75
|
+
const container = document.createElement("div");
|
|
76
|
+
document.body.appendChild(container);
|
|
77
|
+
wp.customize.bind("ready", () => {
|
|
78
|
+
const sidebarControls = [];
|
|
79
|
+
wp.customize.control.each((control) => {
|
|
80
|
+
if (control instanceof SidebarControl) sidebarControls.push(control);
|
|
81
|
+
});
|
|
82
|
+
(0, _wordpress_element.createRoot)(container).render(/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_element.StrictMode, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__components_customize_widgets_index_jsx.default, {
|
|
83
|
+
api: wp.customize,
|
|
84
|
+
sidebarControls,
|
|
85
|
+
blockEditorSettings
|
|
86
|
+
}) }));
|
|
87
|
+
});
|
|
98
88
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
89
|
+
exports.initialize = initialize;
|
|
90
|
+
Object.defineProperty(exports, "store", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function() {
|
|
93
|
+
return __store_index_js.store;
|
|
94
|
+
}
|
|
103
95
|
});
|
|
104
|
-
|
|
96
|
+
|
|
97
|
+
//# sourceMappingURL=index.cjs.map
|
package/build/index.cjs.map
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/index.jsx"],
|
|
4
|
-
"sourcesContent": ["import { createRoot, StrictMode } from '@wordpress/element';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterLegacyWidgetVariations,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\nimport {\n\tsetFreeformContentHandlerName,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { dispatch } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport CustomizeWidgets from './components/customize-widgets';\nimport getSidebarSection from './controls/sidebar-section';\nimport getSidebarControl from './controls/sidebar-control';\nimport './filters';\n\nconst { wp } = window;\n\nconst DISABLED_BLOCKS = [\n\t'core/more',\n\t'core/block',\n\t'core/freeform',\n\t'core/template-part',\n];\nconst ENABLE_EXPERIMENTAL_FSE_BLOCKS = false;\n\n/**\n * Initializes the widgets block editor in the customizer.\n *\n * @param {string} editorName The editor name.\n * @param {Object} blockEditorSettings Block editor settings.\n */\nexport function initialize( editorName, blockEditorSettings ) {\n\tdispatch( preferencesStore ).setDefaults( 'core/customize-widgets', {\n\t\tfixedToolbar: false,\n\t\twelcomeGuide: true,\n\t} );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\tconst coreBlocks = __experimentalGetCoreBlocks().filter( ( block ) => {\n\t\treturn ! (\n\t\t\tDISABLED_BLOCKS.includes( block.name ) ||\n\t\t\tblock.name.startsWith( 'core/post' ) ||\n\t\t\tblock.name.startsWith( 'core/query' ) ||\n\t\t\tblock.name.startsWith( 'core/site' ) ||\n\t\t\tblock.name.startsWith( 'core/navigation' ) ||\n\t\t\tblock.name.startsWith( 'core/term' )\n\t\t);\n\t} );\n\tregisterCoreBlocks( coreBlocks );\n\tregisterLegacyWidgetBlock();\n\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: ENABLE_EXPERIMENTAL_FSE_BLOCKS,\n\t\t} );\n\t}\n\tregisterLegacyWidgetVariations( blockEditorSettings );\n\tregisterWidgetGroupBlock();\n\n\t// As we are unregistering `core/freeform` to avoid the Classic block, we must\n\t// replace it with something as the default freeform content handler. Failure to\n\t// do this will result in errors in the default block parser.\n\t// see: https://github.com/WordPress/gutenberg/issues/33097\n\tsetFreeformContentHandlerName( 'core/html' );\n\n\tconst SidebarControl = getSidebarControl( blockEditorSettings );\n\n\twp.customize.sectionConstructor.sidebar = getSidebarSection();\n\twp.customize.controlConstructor.sidebar_block_editor = SidebarControl;\n\n\tconst container = document.createElement( 'div' );\n\tdocument.body.appendChild( container );\n\n\twp.customize.bind( 'ready', () => {\n\t\tconst sidebarControls = [];\n\t\twp.customize.control.each( ( control ) => {\n\t\t\tif ( control instanceof SidebarControl ) {\n\t\t\t\tsidebarControls.push( control );\n\t\t\t}\n\t\t} );\n\n\t\tcreateRoot( container ).render(\n\t\t\t<StrictMode>\n\t\t\t\t<CustomizeWidgets\n\t\t\t\t\tapi={ wp.customize }\n\t\t\t\t\tsidebarControls={ sidebarControls }\n\t\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t\t/>\n\t\t\t</StrictMode>\n\t\t);\n\t} );\n}\nexport { store } from './store';\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAuC;AACvC,2BAIO;AACP,qBAIO;AACP,oBAGO;AACP,kBAAyB;AACzB,yBAA0C;AAC1C,+BAA6B;AAC7B,6BAA8B;AAC9B,6BAA8B;AAC9B,qBAAO;AA8EP,mBAAsB;AATlB;AAnEJ,IAAM,EAAE,GAAG,IAAI;AAEf,IAAM,kBAAkB;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AACA,IAAM,iCAAiC;AAQhC,SAAS,WAAY,YAAY,qBAAsB;AAC7D,4BAAU,mBAAAA,KAAiB,EAAE,YAAa,0BAA0B;AAAA,IACnE,cAAc;AAAA,IACd,cAAc;AAAA,EACf,CAAE;AAEF,4BAAU,cAAAC,KAAY,EAAE,wBAAwB;AAChD,QAAM,iBAAa,kDAA4B,EAAE,OAAQ,CAAE,UAAW;AACrE,WAAO,EACN,gBAAgB,SAAU,MAAM,IAAK,KACrC,MAAM,KAAK,WAAY,WAAY,KACnC,MAAM,KAAK,WAAY,YAAa,KACpC,MAAM,KAAK,WAAY,WAAY,KACnC,MAAM,KAAK,WAAY,iBAAkB,KACzC,MAAM,KAAK,WAAY,WAAY;AAAA,EAErC,CAAE;AACF,+CAAoB,UAAW;AAC/B,gDAA0B;AAC1B,MAAK,WAAW,qBAAsB;AACrC,2EAA8C;AAAA,MAC7C,iBAAiB;AAAA,IAClB,CAAE;AAAA,EACH;AACA,qDAAgC,mBAAoB;AACpD,+CAAyB;AAMzB,mDAA+B,WAAY;AAE3C,QAAM,qBAAiB,uBAAAC,SAAmB,mBAAoB;AAE9D,KAAG,UAAU,mBAAmB,cAAU,uBAAAC,SAAkB;AAC5D,KAAG,UAAU,mBAAmB,uBAAuB;AAEvD,QAAM,YAAY,SAAS,cAAe,KAAM;AAChD,WAAS,KAAK,YAAa,SAAU;AAErC,KAAG,UAAU,KAAM,SAAS,MAAM;AACjC,UAAM,kBAAkB,CAAC;AACzB,OAAG,UAAU,QAAQ,KAAM,CAAE,YAAa;AACzC,UAAK,mBAAmB,gBAAiB;AACxC,wBAAgB,KAAM,OAAQ;AAAA,MAC/B;AAAA,IACD,CAAE;AAEF,mCAAY,SAAU,EAAE;AAAA,MACvB,4CAAC,6BACA;AAAA,QAAC,yBAAAC;AAAA,QAAA;AAAA,UACA,KAAM,GAAG;AAAA,UACT;AAAA,UACA;AAAA;AAAA,MACD,GACD;AAAA,IACD;AAAA,EACD,CAAE;AACH;",
|
|
6
|
-
"names": ["preferencesStore", "blocksStore", "getSidebarControl", "getSidebarSection", "CustomizeWidgets"]
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["preferencesStore","blocksStore","__experimentalGetCoreBlocks","getSidebarControl","getSidebarSection","StrictMode","CustomizeWidgets"],"sources":["../src/index.jsx"],"sourcesContent":["import { createRoot, StrictMode } from '@wordpress/element';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterLegacyWidgetVariations,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\nimport {\n\tsetFreeformContentHandlerName,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { dispatch } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport CustomizeWidgets from './components/customize-widgets';\nimport getSidebarSection from './controls/sidebar-section';\nimport getSidebarControl from './controls/sidebar-control';\nimport './filters';\n\nconst { wp } = window;\n\nconst DISABLED_BLOCKS = [\n\t'core/more',\n\t'core/block',\n\t'core/freeform',\n\t'core/template-part',\n];\nconst ENABLE_EXPERIMENTAL_FSE_BLOCKS = false;\n\n/**\n * Initializes the widgets block editor in the customizer.\n *\n * @param {string} editorName The editor name.\n * @param {Object} blockEditorSettings Block editor settings.\n */\nexport function initialize( editorName, blockEditorSettings ) {\n\tdispatch( preferencesStore ).setDefaults( 'core/customize-widgets', {\n\t\tfixedToolbar: false,\n\t\twelcomeGuide: true,\n\t} );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\tconst coreBlocks = __experimentalGetCoreBlocks().filter( ( block ) => {\n\t\treturn ! (\n\t\t\tDISABLED_BLOCKS.includes( block.name ) ||\n\t\t\tblock.name.startsWith( 'core/post' ) ||\n\t\t\tblock.name.startsWith( 'core/query' ) ||\n\t\t\tblock.name.startsWith( 'core/site' ) ||\n\t\t\tblock.name.startsWith( 'core/navigation' ) ||\n\t\t\tblock.name.startsWith( 'core/term' )\n\t\t);\n\t} );\n\tregisterCoreBlocks( coreBlocks );\n\tregisterLegacyWidgetBlock();\n\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: ENABLE_EXPERIMENTAL_FSE_BLOCKS,\n\t\t} );\n\t}\n\tregisterLegacyWidgetVariations( blockEditorSettings );\n\tregisterWidgetGroupBlock();\n\n\t// As we are unregistering `core/freeform` to avoid the Classic block, we must\n\t// replace it with something as the default freeform content handler. Failure to\n\t// do this will result in errors in the default block parser.\n\t// see: https://github.com/WordPress/gutenberg/issues/33097\n\tsetFreeformContentHandlerName( 'core/html' );\n\n\tconst SidebarControl = getSidebarControl( blockEditorSettings );\n\n\twp.customize.sectionConstructor.sidebar = getSidebarSection();\n\twp.customize.controlConstructor.sidebar_block_editor = SidebarControl;\n\n\tconst container = document.createElement( 'div' );\n\tdocument.body.appendChild( container );\n\n\twp.customize.bind( 'ready', () => {\n\t\tconst sidebarControls = [];\n\t\twp.customize.control.each( ( control ) => {\n\t\t\tif ( control instanceof SidebarControl ) {\n\t\t\t\tsidebarControls.push( control );\n\t\t\t}\n\t\t} );\n\n\t\tcreateRoot( container ).render(\n\t\t\t<StrictMode>\n\t\t\t\t<CustomizeWidgets\n\t\t\t\t\tapi={ wp.customize }\n\t\t\t\t\tsidebarControls={ sidebarControls }\n\t\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t\t/>\n\t\t\t</StrictMode>\n\t\t);\n\t} );\n}\nexport { store } from './store';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,MAAM,EAAE,OAAO;AAEf,MAAM,kBAAkB;CACvB;CACA;CACA;CACA;AACD;AACA,MAAM,iCAAiC;;;;;;;AAQvC,SAAgB,WAAY,YAAY,qBAAsB;CAC7D,CAAA,GAAA,gBAAA,SAAA,CAAUA,uBAAAA,KAAiB,CAAC,CAAC,YAAa,0BAA0B;EACnE,cAAc;EACd,cAAc;CACf,CAAE;CAEF,CAAA,GAAA,gBAAA,SAAA,CAAUC,kBAAAA,KAAY,CAAC,CAAC,wBAAwB;CAChD,MAAM,cAAA,GAAaC,yBAAAA,4BAAAA,CAA4B,CAAC,CAAC,QAAU,UAAW;EACrE,OAAO,EACN,gBAAgB,SAAU,MAAM,IAAK,KACrC,MAAM,KAAK,WAAY,WAAY,KACnC,MAAM,KAAK,WAAY,YAAa,KACpC,MAAM,KAAK,WAAY,WAAY,KACnC,MAAM,KAAK,WAAY,iBAAkB,KACzC,MAAM,KAAK,WAAY,WAAY;CAErC,CAAE;CACF,CAAA,GAAA,yBAAA,mBAAA,CAAoB,UAAW;CAC/B,CAAA,GAAA,mBAAA,0BAAA,CAA0B;CAC1B,IAAK,WAAW,qBACf,CAAA,GAAA,yBAAA,6CAAA,CAA8C,EAC7C,iBAAiB,+BAClB,CAAE;CAEH,CAAA,GAAA,mBAAA,+BAAA,CAAgC,mBAAoB;CACpD,CAAA,GAAA,mBAAA,yBAAA,CAAyB;CAMzB,CAAA,GAAA,kBAAA,8BAAA,CAA+B,WAAY;CAE3C,MAAM,kBAAA,GAAiBC,8BAAAA,QAAAA,CAAmB,mBAAoB;CAE9D,GAAG,UAAU,mBAAmB,WAAA,GAAUC,8BAAAA,QAAAA,CAAkB;CAC5D,GAAG,UAAU,mBAAmB,uBAAuB;CAEvD,MAAM,YAAY,SAAS,cAAe,KAAM;CAChD,SAAS,KAAK,YAAa,SAAU;CAErC,GAAG,UAAU,KAAM,eAAe;EACjC,MAAM,kBAAkB,CAAC;EACzB,GAAG,UAAU,QAAQ,MAAQ,YAAa;GACzC,IAAK,mBAAmB,gBACvB,gBAAgB,KAAM,OAAQ;EAEhC,CAAE;EAEF,CAAA,GAAA,mBAAA,WAAA,CAAY,SAAU,CAAC,CAAC,OACvB,iBAAA,GAAA,kBAAA,IAAA,CAACC,mBAAAA,YAAD,EAAA,UACC,iBAAA,GAAA,kBAAA,IAAA,CAACC,yCAAAA,SAAD;GACC,KAAM,GAAG;GACS;GACI;EACtB,CAAA,EACU,CAAA,CACb;CACD,CAAE;AACH"}
|
package/build/lock-unlock.cjs
CHANGED
|
@@ -1,36 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// packages/customize-widgets/src/lock-unlock.js
|
|
20
|
-
var lock_unlock_exports = {};
|
|
21
|
-
__export(lock_unlock_exports, {
|
|
22
|
-
lock: () => lock,
|
|
23
|
-
unlock: () => unlock
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(lock_unlock_exports);
|
|
26
|
-
var import_private_apis = require("@wordpress/private-apis");
|
|
27
|
-
var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
|
|
28
|
-
"I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
|
|
29
|
-
"@wordpress/customize-widgets"
|
|
30
|
-
);
|
|
31
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
-
0 && (module.exports = {
|
|
33
|
-
lock,
|
|
34
|
-
unlock
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, {
|
|
3
|
+
__esModule: { value: true },
|
|
4
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
35
5
|
});
|
|
36
|
-
|
|
6
|
+
// packages/customize-widgets/src/lock-unlock.js
|
|
7
|
+
const { lock, unlock } = (0, require("@wordpress/private-apis").__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.", "@wordpress/customize-widgets");
|
|
8
|
+
exports.lock = lock;
|
|
9
|
+
exports.unlock = unlock;
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=lock-unlock.cjs.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/lock-unlock.js"],
|
|
4
|
-
"sourcesContent": ["import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.',\n\t\t'@wordpress/customize-widgets'\n\t);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAiE;AAE1D,IAAM,EAAE,MAAM,OAAO,QAC3B;AAAA,EACC;AAAA,EACA;AACD;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"lock-unlock.cjs","names":["__dangerousOptInToUnstableAPIsOnlyForCoreModules"],"sources":["../src/lock-unlock.js"],"sourcesContent":["import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.',\n\t\t'@wordpress/customize-widgets'\n\t);\n"],"mappings":";;;;;;AAEA,MAAa,EAAE,MAAM,YAAA,G,iCACpBA,CAAAA,CAAAA,iDAAAA,CACC,iIACA,8BACD"}
|
package/build/store/actions.cjs
CHANGED
|
@@ -1,35 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// packages/customize-widgets/src/store/actions.js
|
|
20
|
-
var actions_exports = {};
|
|
21
|
-
__export(actions_exports, {
|
|
22
|
-
setIsInserterOpened: () => setIsInserterOpened
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, {
|
|
3
|
+
__esModule: { value: true },
|
|
4
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
23
5
|
});
|
|
24
|
-
|
|
6
|
+
// packages/customize-widgets/src/store/actions.js
|
|
7
|
+
/**
|
|
8
|
+
* Returns an action object used to open/close the inserter.
|
|
9
|
+
*
|
|
10
|
+
* @param {boolean|Object} value Whether the inserter should be
|
|
11
|
+
* opened (true) or closed (false).
|
|
12
|
+
* To specify an insertion point,
|
|
13
|
+
* use an object.
|
|
14
|
+
* @param {string} value.rootClientId The root client ID to insert at.
|
|
15
|
+
* @param {number} value.insertionIndex The index to insert at.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```js
|
|
19
|
+
* import { useState } from 'react';
|
|
20
|
+
* import { store as customizeWidgetsStore } from '@wordpress/customize-widgets';
|
|
21
|
+
* import { __ } from '@wordpress/i18n';
|
|
22
|
+
* import { useDispatch } from '@wordpress/data';
|
|
23
|
+
* import { Button } from '@wordpress/components';
|
|
24
|
+
*
|
|
25
|
+
* const ExampleComponent = () => {
|
|
26
|
+
* const { setIsInserterOpened } = useDispatch( customizeWidgetsStore );
|
|
27
|
+
* const [ isOpen, setIsOpen ] = useState( false );
|
|
28
|
+
*
|
|
29
|
+
* return (
|
|
30
|
+
* <Button
|
|
31
|
+
* onClick={ () => {
|
|
32
|
+
* setIsInserterOpened( ! isOpen );
|
|
33
|
+
* setIsOpen( ! isOpen );
|
|
34
|
+
* } }
|
|
35
|
+
* >
|
|
36
|
+
* { __( 'Open/close inserter' ) }
|
|
37
|
+
* </Button>
|
|
38
|
+
* );
|
|
39
|
+
* };
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @return {Object} Action object.
|
|
43
|
+
*/
|
|
25
44
|
function setIsInserterOpened(value) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
45
|
+
return {
|
|
46
|
+
type: "SET_IS_INSERTER_OPENED",
|
|
47
|
+
value
|
|
48
|
+
};
|
|
30
49
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
});
|
|
35
|
-
//# sourceMappingURL=actions.cjs.map
|
|
50
|
+
exports.setIsInserterOpened = setIsInserterOpened;
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=actions.cjs.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/store/actions.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * Returns an action object used to open/close the inserter.\n *\n * @param {boolean|Object} value Whether the inserter should be\n * opened (true) or closed (false).\n * To specify an insertion point,\n * use an object.\n * @param {string} value.rootClientId The root client ID to insert at.\n * @param {number} value.insertionIndex The index to insert at.\n *\n * @example\n * ```js\n * import { useState } from 'react';\n * import { store as customizeWidgetsStore } from '@wordpress/customize-widgets';\n * import { __ } from '@wordpress/i18n';\n * import { useDispatch } from '@wordpress/data';\n * import { Button } from '@wordpress/components';\n *\n * const ExampleComponent = () => {\n * const { setIsInserterOpened } = useDispatch( customizeWidgetsStore );\n * const [ isOpen, setIsOpen ] = useState( false );\n *\n * return (\n * <Button\n * onClick={ () => {\n * setIsInserterOpened( ! isOpen );\n * setIsOpen( ! isOpen );\n * } }\n * >\n * { __( 'Open/close inserter' ) }\n * </Button>\n * );\n * };\n * ```\n *\n * @return {Object} Action object.\n */\nexport function setIsInserterOpened( value ) {\n\treturn {\n\t\ttype: 'SET_IS_INSERTER_OPENED',\n\t\tvalue,\n\t};\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAqCO,SAAS,oBAAqB,OAAQ;AAC5C,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,EACD;AACD;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"actions.cjs","names":[],"sources":["../../src/store/actions.js"],"sourcesContent":["/**\n * Returns an action object used to open/close the inserter.\n *\n * @param {boolean|Object} value Whether the inserter should be\n * opened (true) or closed (false).\n * To specify an insertion point,\n * use an object.\n * @param {string} value.rootClientId The root client ID to insert at.\n * @param {number} value.insertionIndex The index to insert at.\n *\n * @example\n * ```js\n * import { useState } from 'react';\n * import { store as customizeWidgetsStore } from '@wordpress/customize-widgets';\n * import { __ } from '@wordpress/i18n';\n * import { useDispatch } from '@wordpress/data';\n * import { Button } from '@wordpress/components';\n *\n * const ExampleComponent = () => {\n * const { setIsInserterOpened } = useDispatch( customizeWidgetsStore );\n * const [ isOpen, setIsOpen ] = useState( false );\n *\n * return (\n * <Button\n * onClick={ () => {\n * setIsInserterOpened( ! isOpen );\n * setIsOpen( ! isOpen );\n * } }\n * >\n * { __( 'Open/close inserter' ) }\n * </Button>\n * );\n * };\n * ```\n *\n * @return {Object} Action object.\n */\nexport function setIsInserterOpened( value ) {\n\treturn {\n\t\ttype: 'SET_IS_INSERTER_OPENED',\n\t\tvalue,\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,SAAgB,oBAAqB,OAAQ;CAC5C,OAAO;EACN,MAAM;EACN;CACD;AACD"}
|
|
@@ -1,30 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// packages/customize-widgets/src/store/constants.js
|
|
20
|
-
var constants_exports = {};
|
|
21
|
-
__export(constants_exports, {
|
|
22
|
-
STORE_NAME: () => STORE_NAME
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(constants_exports);
|
|
25
|
-
var STORE_NAME = "core/customize-widgets";
|
|
26
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
27
|
-
0 && (module.exports = {
|
|
28
|
-
STORE_NAME
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, {
|
|
3
|
+
__esModule: { value: true },
|
|
4
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
29
5
|
});
|
|
30
|
-
|
|
6
|
+
// packages/customize-widgets/src/store/constants.js
|
|
7
|
+
/**
|
|
8
|
+
* Module Constants
|
|
9
|
+
*/
|
|
10
|
+
const STORE_NAME = "core/customize-widgets";
|
|
11
|
+
exports.STORE_NAME = STORE_NAME;
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=constants.cjs.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/store/constants.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * Module Constants\n */\nexport const STORE_NAME = 'core/customize-widgets';\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,IAAM,aAAa;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"constants.cjs","names":[],"sources":["../../src/store/constants.js"],"sourcesContent":["/**\n * Module Constants\n */\nexport const STORE_NAME = 'core/customize-widgets';\n"],"mappings":";;;;;;;;;AAGA,MAAa,aAAa"}
|
package/build/store/index.cjs
CHANGED
|
@@ -1,51 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, {
|
|
3
|
+
__esModule: { value: true },
|
|
4
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
5
|
+
});
|
|
6
|
+
// \0rolldown/runtime.js
|
|
1
7
|
var __create = Object.create;
|
|
2
8
|
var __defProp = Object.defineProperty;
|
|
3
9
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
10
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
11
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
12
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
13
|
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
15
|
+
key = keys[i];
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: ((k) => from[k]).bind(null, key),
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
18
22
|
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
24
|
+
value: mod,
|
|
25
|
+
enumerable: true
|
|
26
|
+
}) : target, mod));
|
|
27
|
+
let _wordpress_data = require("@wordpress/data");
|
|
28
|
+
let __reducer_js = require("./reducer.cjs");
|
|
29
|
+
__reducer_js = __toESM(__reducer_js);
|
|
30
|
+
let __selectors_js = require("./selectors.cjs");
|
|
31
|
+
__selectors_js = __toESM(__selectors_js);
|
|
32
|
+
let __actions_js = require("./actions.cjs");
|
|
33
|
+
__actions_js = __toESM(__actions_js);
|
|
34
|
+
let __constants_js = require("./constants.cjs");
|
|
29
35
|
// packages/customize-widgets/src/store/index.js
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
reducer: import_reducer.default,
|
|
42
|
-
selectors,
|
|
43
|
-
actions
|
|
36
|
+
/**
|
|
37
|
+
* Block editor data store configuration.
|
|
38
|
+
*
|
|
39
|
+
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registering-a-store
|
|
40
|
+
*
|
|
41
|
+
* @type {Object}
|
|
42
|
+
*/
|
|
43
|
+
const storeConfig = {
|
|
44
|
+
reducer: __reducer_js.default,
|
|
45
|
+
selectors: __selectors_js,
|
|
46
|
+
actions: __actions_js
|
|
44
47
|
};
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Store definition for the edit widgets namespace.
|
|
50
|
+
*
|
|
51
|
+
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
|
|
52
|
+
*
|
|
53
|
+
* @type {Object}
|
|
54
|
+
*/
|
|
55
|
+
const store = (0, _wordpress_data.createReduxStore)(__constants_js.STORE_NAME, storeConfig);
|
|
56
|
+
(0, _wordpress_data.register)(store);
|
|
57
|
+
exports.store = store;
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/store/index.js"],
|
|
4
|
-
"sourcesContent": ["import { createReduxStore, register } from '@wordpress/data';\nimport reducer from './reducer';\nimport * as selectors from './selectors';\nimport * as actions from './actions';\nimport { STORE_NAME } from './constants';\n\n/**\n * Block editor data store configuration.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registering-a-store\n *\n * @type {Object}\n */\nconst storeConfig = {\n\treducer,\n\tselectors,\n\tactions,\n};\n\n/**\n * Store definition for the edit widgets namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, storeConfig );\nregister( store );\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA2C;AAC3C,qBAAoB;AACpB,gBAA2B;AAC3B,cAAyB;AACzB,uBAA2B;AAS3B,IAAM,cAAc;AAAA,EACnB,wBAAAA;AAAA,EACA;AAAA,EACA;AACD;AASO,IAAM,YAAQ,8BAAkB,6BAAY,WAAY;AAAA,IAC/D,sBAAU,KAAM;",
|
|
6
|
-
"names": ["reducer"]
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["createReduxStore","STORE_NAME","register"],"sources":["../../src/store/index.js"],"sourcesContent":["import { createReduxStore, register } from '@wordpress/data';\nimport reducer from './reducer';\nimport * as selectors from './selectors';\nimport * as actions from './actions';\nimport { STORE_NAME } from './constants';\n\n/**\n * Block editor data store configuration.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registering-a-store\n *\n * @type {Object}\n */\nconst storeConfig = {\n\treducer,\n\tselectors,\n\tactions,\n};\n\n/**\n * Store definition for the edit widgets namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, storeConfig );\nregister( store );\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,MAAM,cAAc;CACnB,SAAA,aAAA;CACA,WAAA;CACA,SAAA;AACD;;;;;;;;AASA,MAAa,SAAA,GAAQA,gBAAAA,iBAAAA,CAAkBC,eAAAA,YAAY,WAAY;CAC/DC,GAAAA,gBAAAA,SAAAA,CAAU,KAAM"}
|