@wordpress/customize-widgets 5.32.0 → 5.32.1-next.ff1cebbba.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.js +33 -27
- package/build/components/block-appender/index.js.map +7 -1
- package/build/components/block-inspector-button/index.js +51 -36
- package/build/components/block-inspector-button/index.js.map +7 -1
- package/build/components/customize-widgets/index.js +83 -61
- package/build/components/customize-widgets/index.js.map +7 -1
- package/build/components/customize-widgets/use-clear-selected-block.js +56 -63
- package/build/components/customize-widgets/use-clear-selected-block.js.map +7 -1
- package/build/components/error-boundary/index.js +46 -45
- package/build/components/error-boundary/index.js.map +7 -1
- package/build/components/focus-control/index.js +69 -57
- package/build/components/focus-control/index.js.map +7 -1
- package/build/components/focus-control/use-blocks-focus-control.js +38 -31
- package/build/components/focus-control/use-blocks-focus-control.js.map +7 -1
- package/build/components/header/index.js +110 -71
- package/build/components/header/index.js.map +7 -1
- package/build/components/inserter/index.js +77 -53
- package/build/components/inserter/index.js.map +7 -1
- package/build/components/inserter/use-inserter.js +46 -29
- package/build/components/inserter/use-inserter.js.map +7 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +74 -71
- package/build/components/keyboard-shortcut-help-modal/config.js.map +7 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +61 -44
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +7 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +155 -110
- package/build/components/keyboard-shortcut-help-modal/index.js.map +7 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +76 -56
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +7 -1
- package/build/components/keyboard-shortcuts/index.js +60 -51
- package/build/components/keyboard-shortcuts/index.js.map +7 -1
- package/build/components/more-menu/index.js +151 -90
- package/build/components/more-menu/index.js.map +7 -1
- package/build/components/sidebar-block-editor/index.js +133 -105
- package/build/components/sidebar-block-editor/index.js.map +7 -1
- package/build/components/sidebar-block-editor/sidebar-adapter.js +73 -67
- package/build/components/sidebar-block-editor/sidebar-adapter.js.map +7 -1
- package/build/components/sidebar-block-editor/sidebar-editor-provider.js +51 -33
- package/build/components/sidebar-block-editor/sidebar-editor-provider.js.map +7 -1
- package/build/components/sidebar-block-editor/use-sidebar-block-editor.js +100 -79
- package/build/components/sidebar-block-editor/use-sidebar-block-editor.js.map +7 -1
- package/build/components/sidebar-controls/index.js +45 -31
- package/build/components/sidebar-controls/index.js.map +7 -1
- package/build/components/welcome-guide/index.js +86 -58
- package/build/components/welcome-guide/index.js.map +7 -1
- package/build/controls/inserter-outer-section.js +49 -58
- package/build/controls/inserter-outer-section.js.map +7 -1
- package/build/controls/inspector-section.js +30 -36
- package/build/controls/inspector-section.js.map +7 -1
- package/build/controls/sidebar-control.js +51 -30
- package/build/controls/sidebar-control.js.map +7 -1
- package/build/controls/sidebar-section.js +71 -39
- package/build/controls/sidebar-section.js.map +7 -1
- package/build/filters/index.js +4 -6
- package/build/filters/index.js.map +7 -1
- package/build/filters/move-to-sidebar.js +77 -79
- package/build/filters/move-to-sidebar.js.map +7 -1
- package/build/filters/replace-media-upload.js +9 -11
- package/build/filters/replace-media-upload.js.map +7 -1
- package/build/filters/wide-widget-display.js +20 -25
- package/build/filters/wide-widget-display.js.map +7 -1
- package/build/index.js +81 -70
- package/build/index.js.map +7 -1
- package/build/lock-unlock.js +31 -15
- package/build/lock-unlock.js.map +7 -1
- package/build/store/actions.js +27 -44
- package/build/store/actions.js.map +7 -1
- package/build/store/constants.js +27 -10
- package/build/store/constants.js.map +7 -1
- package/build/store/index.js +44 -40
- package/build/store/index.js.map +7 -1
- package/build/store/reducer.js +25 -19
- package/build/store/reducer.js.map +7 -1
- package/build/store/selectors.js +31 -44
- package/build/store/selectors.js.map +7 -1
- package/build/utils.js +45 -73
- package/build/utils.js.map +7 -1
- package/build-module/components/block-appender/index.js +17 -20
- package/build-module/components/block-appender/index.js.map +7 -1
- package/build-module/components/block-inspector-button/index.js +33 -30
- package/build-module/components/block-inspector-button/index.js.map +7 -1
- package/build-module/components/customize-widgets/index.js +52 -51
- package/build-module/components/customize-widgets/index.js.map +7 -1
- package/build-module/components/customize-widgets/use-clear-selected-block.js +38 -58
- package/build-module/components/customize-widgets/use-clear-selected-block.js.map +7 -1
- package/build-module/components/error-boundary/index.js +27 -37
- package/build-module/components/error-boundary/index.js.map +7 -1
- package/build-module/components/focus-control/index.js +50 -45
- package/build-module/components/focus-control/index.js.map +7 -1
- package/build-module/components/focus-control/use-blocks-focus-control.js +17 -22
- package/build-module/components/focus-control/use-blocks-focus-control.js.map +7 -1
- package/build-module/components/header/index.js +81 -63
- package/build-module/components/header/index.js.map +7 -1
- package/build-module/components/inserter/index.js +59 -47
- package/build-module/components/inserter/index.js.map +7 -1
- package/build-module/components/inserter/use-inserter.js +28 -23
- package/build-module/components/inserter/use-inserter.js.map +7 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +62 -75
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +7 -1
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +33 -37
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +7 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +130 -103
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +7 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +58 -50
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +7 -1
- package/build-module/components/keyboard-shortcuts/index.js +44 -44
- package/build-module/components/keyboard-shortcuts/index.js.map +7 -1
- package/build-module/components/more-menu/index.js +129 -84
- package/build-module/components/more-menu/index.js.map +7 -1
- package/build-module/components/sidebar-block-editor/index.js +109 -96
- package/build-module/components/sidebar-block-editor/index.js.map +7 -1
- package/build-module/components/sidebar-block-editor/sidebar-adapter.js +54 -59
- package/build-module/components/sidebar-block-editor/sidebar-adapter.js.map +7 -1
- package/build-module/components/sidebar-block-editor/sidebar-editor-provider.js +22 -25
- package/build-module/components/sidebar-block-editor/sidebar-editor-provider.js.map +7 -1
- package/build-module/components/sidebar-block-editor/use-sidebar-block-editor.js +70 -70
- package/build-module/components/sidebar-block-editor/use-sidebar-block-editor.js.map +7 -1
- package/build-module/components/sidebar-controls/index.js +24 -25
- package/build-module/components/sidebar-controls/index.js.map +7 -1
- package/build-module/components/welcome-guide/index.js +68 -52
- package/build-module/components/welcome-guide/index.js.map +7 -1
- package/build-module/controls/inserter-outer-section.js +31 -52
- package/build-module/controls/inserter-outer-section.js.map +7 -1
- package/build-module/controls/inspector-section.js +13 -32
- package/build-module/controls/inspector-section.js.map +7 -1
- package/build-module/controls/sidebar-control.js +22 -22
- package/build-module/controls/sidebar-control.js.map +7 -1
- package/build-module/controls/sidebar-section.js +43 -32
- package/build-module/controls/sidebar-section.js.map +7 -1
- package/build-module/filters/index.js +4 -7
- package/build-module/filters/index.js.map +7 -1
- package/build-module/filters/move-to-sidebar.js +83 -76
- package/build-module/filters/move-to-sidebar.js.map +7 -1
- package/build-module/filters/replace-media-upload.js +8 -7
- package/build-module/filters/replace-media-upload.js.map +7 -1
- package/build-module/filters/wide-widget-display.js +20 -22
- package/build-module/filters/wide-widget-display.js.map +7 -1
- package/build-module/index.js +53 -51
- package/build-module/index.js.map +7 -1
- package/build-module/lock-unlock.js +8 -7
- package/build-module/lock-unlock.js.map +7 -1
- package/build-module/store/actions.js +6 -40
- package/build-module/store/actions.js.map +7 -1
- package/build-module/store/constants.js +5 -5
- package/build-module/store/constants.js.map +7 -1
- package/build-module/store/index.js +10 -30
- package/build-module/store/index.js.map +7 -1
- package/build-module/store/reducer.js +7 -14
- package/build-module/store/reducer.js.map +7 -1
- package/build-module/store/selectors.js +10 -40
- package/build-module/store/selectors.js.map +7 -1
- package/build-module/utils.js +21 -66
- package/build-module/utils.js.map +7 -1
- package/build-style/style-rtl.css +14 -149
- package/build-style/style.css +14 -149
- package/package.json +30 -23
- package/src/components/block-inspector-button/style.scss +3 -0
- package/src/components/header/style.scss +5 -0
- package/src/components/inserter/style.scss +3 -0
- package/src/components/keyboard-shortcut-help-modal/style.scss +2 -0
- package/src/components/more-menu/style.scss +2 -0
- package/src/components/sidebar-block-editor/style.scss +2 -0
- package/src/components/welcome-guide/style.scss +2 -0
- package/src/controls/style.scss +2 -0
- package/src/style.scss +10 -8
|
@@ -1,22 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
addFilter('editor.BlockEdit', 'core/customize-widgets/wide-widget-display', withWideWidgetDisplay);
|
|
22
|
-
//# sourceMappingURL=wide-widget-display.js.map
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createHigherOrderComponent } from "@wordpress/compose";
|
|
3
|
+
import { addFilter } from "@wordpress/hooks";
|
|
4
|
+
const { wp } = window;
|
|
5
|
+
const withWideWidgetDisplay = createHigherOrderComponent(
|
|
6
|
+
(BlockEdit) => (props) => {
|
|
7
|
+
const { idBase } = props.attributes;
|
|
8
|
+
const isWide = wp.customize.Widgets.data.availableWidgets.find(
|
|
9
|
+
(widget) => widget.id_base === idBase
|
|
10
|
+
)?.is_wide ?? false;
|
|
11
|
+
return /* @__PURE__ */ jsx(BlockEdit, { ...props, isWide }, "edit");
|
|
12
|
+
},
|
|
13
|
+
"withWideWidgetDisplay"
|
|
14
|
+
);
|
|
15
|
+
addFilter(
|
|
16
|
+
"editor.BlockEdit",
|
|
17
|
+
"core/customize-widgets/wide-widget-display",
|
|
18
|
+
withWideWidgetDisplay
|
|
19
|
+
);
|
|
20
|
+
//# sourceMappingURL=wide-widget-display.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/filters/wide-widget-display.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { 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": "AAgBS;AAbT,SAAS,kCAAkC;AAC3C,SAAS,iBAAiB;AAE1B,MAAM,EAAE,GAAG,IAAI;AAEf,MAAM,wBAAwB;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,oBAAC,aAAuB,GAAG,OAAQ,UAApB,MAAsC;AAAA,EAC7D;AAAA,EACA;AACD;AAEA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/build-module/index.js
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createRoot, StrictMode } from "@wordpress/element";
|
|
3
|
+
import {
|
|
4
|
+
registerCoreBlocks,
|
|
5
|
+
__experimentalGetCoreBlocks,
|
|
6
|
+
__experimentalRegisterExperimentalCoreBlocks
|
|
7
|
+
} from "@wordpress/block-library";
|
|
8
|
+
import {
|
|
9
|
+
registerLegacyWidgetBlock,
|
|
10
|
+
registerLegacyWidgetVariations,
|
|
11
|
+
registerWidgetGroupBlock
|
|
12
|
+
} from "@wordpress/widgets";
|
|
13
|
+
import {
|
|
14
|
+
setFreeformContentHandlerName,
|
|
15
|
+
store as blocksStore
|
|
16
|
+
} from "@wordpress/blocks";
|
|
17
|
+
import { dispatch } from "@wordpress/data";
|
|
18
|
+
import { store as preferencesStore } from "@wordpress/preferences";
|
|
19
|
+
import CustomizeWidgets from "./components/customize-widgets";
|
|
20
|
+
import getSidebarSection from "./controls/sidebar-section";
|
|
21
|
+
import getSidebarControl from "./controls/sidebar-control";
|
|
22
|
+
import "./filters";
|
|
23
|
+
const { wp } = window;
|
|
24
|
+
const DISABLED_BLOCKS = [
|
|
25
|
+
"core/more",
|
|
26
|
+
"core/block",
|
|
27
|
+
"core/freeform",
|
|
28
|
+
"core/template-part"
|
|
29
|
+
];
|
|
23
30
|
const ENABLE_EXPERIMENTAL_FSE_BLOCKS = false;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
* Initializes the widgets block editor in the customizer.
|
|
27
|
-
*
|
|
28
|
-
* @param {string} editorName The editor name.
|
|
29
|
-
* @param {Object} blockEditorSettings Block editor settings.
|
|
30
|
-
*/
|
|
31
|
-
export function initialize(editorName, blockEditorSettings) {
|
|
32
|
-
dispatch(preferencesStore).setDefaults('core/customize-widgets', {
|
|
31
|
+
function initialize(editorName, blockEditorSettings) {
|
|
32
|
+
dispatch(preferencesStore).setDefaults("core/customize-widgets", {
|
|
33
33
|
fixedToolbar: false,
|
|
34
34
|
welcomeGuide: true
|
|
35
35
|
});
|
|
36
36
|
dispatch(blocksStore).reapplyBlockTypeFilters();
|
|
37
|
-
const coreBlocks = __experimentalGetCoreBlocks().filter(block => {
|
|
38
|
-
return !(DISABLED_BLOCKS.includes(block.name) || block.name.startsWith(
|
|
37
|
+
const coreBlocks = __experimentalGetCoreBlocks().filter((block) => {
|
|
38
|
+
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"));
|
|
39
39
|
});
|
|
40
40
|
registerCoreBlocks(coreBlocks);
|
|
41
41
|
registerLegacyWidgetBlock();
|
|
@@ -46,32 +46,34 @@ export function initialize(editorName, blockEditorSettings) {
|
|
|
46
46
|
}
|
|
47
47
|
registerLegacyWidgetVariations(blockEditorSettings);
|
|
48
48
|
registerWidgetGroupBlock();
|
|
49
|
-
|
|
50
|
-
// As we are unregistering `core/freeform` to avoid the Classic block, we must
|
|
51
|
-
// replace it with something as the default freeform content handler. Failure to
|
|
52
|
-
// do this will result in errors in the default block parser.
|
|
53
|
-
// see: https://github.com/WordPress/gutenberg/issues/33097
|
|
54
|
-
setFreeformContentHandlerName('core/html');
|
|
49
|
+
setFreeformContentHandlerName("core/html");
|
|
55
50
|
const SidebarControl = getSidebarControl(blockEditorSettings);
|
|
56
51
|
wp.customize.sectionConstructor.sidebar = getSidebarSection();
|
|
57
52
|
wp.customize.controlConstructor.sidebar_block_editor = SidebarControl;
|
|
58
|
-
const container = document.createElement(
|
|
53
|
+
const container = document.createElement("div");
|
|
59
54
|
document.body.appendChild(container);
|
|
60
|
-
wp.customize.bind(
|
|
55
|
+
wp.customize.bind("ready", () => {
|
|
61
56
|
const sidebarControls = [];
|
|
62
|
-
wp.customize.control.each(control => {
|
|
57
|
+
wp.customize.control.each((control) => {
|
|
63
58
|
if (control instanceof SidebarControl) {
|
|
64
59
|
sidebarControls.push(control);
|
|
65
60
|
}
|
|
66
61
|
});
|
|
67
|
-
createRoot(container).render(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
62
|
+
createRoot(container).render(
|
|
63
|
+
/* @__PURE__ */ jsx(StrictMode, { children: /* @__PURE__ */ jsx(
|
|
64
|
+
CustomizeWidgets,
|
|
65
|
+
{
|
|
66
|
+
api: wp.customize,
|
|
67
|
+
sidebarControls,
|
|
68
|
+
blockEditorSettings
|
|
69
|
+
}
|
|
70
|
+
) })
|
|
71
|
+
);
|
|
74
72
|
});
|
|
75
73
|
}
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
import { store } from "./store";
|
|
75
|
+
export {
|
|
76
|
+
initialize,
|
|
77
|
+
store
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { 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';\n\n/**\n * Internal dependencies\n */\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);\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": "AA+FI;AA5FJ,SAAS,YAAY,kBAAkB;AACvC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP;AAAA,EACC;AAAA,EACA,SAAS;AAAA,OACH;AACP,SAAS,gBAAgB;AACzB,SAAS,SAAS,wBAAwB;AAK1C,OAAO,sBAAsB;AAC7B,OAAO,uBAAuB;AAC9B,OAAO,uBAAuB;AAC9B,OAAO;AAEP,MAAM,EAAE,GAAG,IAAI;AAEf,MAAM,kBAAkB;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AACA,MAAM,iCAAiC;AAQhC,SAAS,WAAY,YAAY,qBAAsB;AAC7D,WAAU,gBAAiB,EAAE,YAAa,0BAA0B;AAAA,IACnE,cAAc;AAAA,IACd,cAAc;AAAA,EACf,CAAE;AAEF,WAAU,WAAY,EAAE,wBAAwB;AAChD,QAAM,aAAa,4BAA4B,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;AAAA,EAE3C,CAAE;AACF,qBAAoB,UAAW;AAC/B,4BAA0B;AAC1B,MAAK,WAAW,qBAAsB;AACrC,iDAA8C;AAAA,MAC7C,iBAAiB;AAAA,IAClB,CAAE;AAAA,EACH;AACA,iCAAgC,mBAAoB;AACpD,2BAAyB;AAMzB,gCAA+B,WAAY;AAE3C,QAAM,iBAAiB,kBAAmB,mBAAoB;AAE9D,KAAG,UAAU,mBAAmB,UAAU,kBAAkB;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,eAAY,SAAU,EAAE;AAAA,MACvB,oBAAC,cACA;AAAA,QAAC;AAAA;AAAA,UACA,KAAM,GAAG;AAAA,UACT;AAAA,UACA;AAAA;AAAA,MACD,GACD;AAAA,IACD;AAAA,EACD,CAAE;AACH;AACA,SAAS,aAAa;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from "@wordpress/private-apis";
|
|
2
|
+
const { lock, unlock } = __dangerousOptInToUnstableAPIsOnlyForCoreModules(
|
|
3
|
+
"I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
|
|
4
|
+
"@wordpress/customize-widgets"
|
|
5
|
+
);
|
|
6
|
+
export {
|
|
6
7
|
lock,
|
|
7
8
|
unlock
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=lock-unlock.js.map
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=lock-unlock.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/lock-unlock.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __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": "AAGA,SAAS,wDAAwD;AAE1D,MAAM,EAAE,MAAM,OAAO,IAC3B;AAAA,EACC;AAAA,EACA;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,44 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
* Returns an action object used to open/close the inserter.
|
|
3
|
-
*
|
|
4
|
-
* @param {boolean|Object} value Whether the inserter should be
|
|
5
|
-
* opened (true) or closed (false).
|
|
6
|
-
* To specify an insertion point,
|
|
7
|
-
* use an object.
|
|
8
|
-
* @param {string} value.rootClientId The root client ID to insert at.
|
|
9
|
-
* @param {number} value.insertionIndex The index to insert at.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```js
|
|
13
|
-
* import { useState } from 'react';
|
|
14
|
-
* import { store as customizeWidgetsStore } from '@wordpress/customize-widgets';
|
|
15
|
-
* import { __ } from '@wordpress/i18n';
|
|
16
|
-
* import { useDispatch } from '@wordpress/data';
|
|
17
|
-
* import { Button } from '@wordpress/components';
|
|
18
|
-
*
|
|
19
|
-
* const ExampleComponent = () => {
|
|
20
|
-
* const { setIsInserterOpened } = useDispatch( customizeWidgetsStore );
|
|
21
|
-
* const [ isOpen, setIsOpen ] = useState( false );
|
|
22
|
-
*
|
|
23
|
-
* return (
|
|
24
|
-
* <Button
|
|
25
|
-
* onClick={ () => {
|
|
26
|
-
* setIsInserterOpened( ! isOpen );
|
|
27
|
-
* setIsOpen( ! isOpen );
|
|
28
|
-
* } }
|
|
29
|
-
* >
|
|
30
|
-
* { __( 'Open/close inserter' ) }
|
|
31
|
-
* </Button>
|
|
32
|
-
* );
|
|
33
|
-
* };
|
|
34
|
-
* ```
|
|
35
|
-
*
|
|
36
|
-
* @return {Object} Action object.
|
|
37
|
-
*/
|
|
38
|
-
export function setIsInserterOpened(value) {
|
|
1
|
+
function setIsInserterOpened(value) {
|
|
39
2
|
return {
|
|
40
|
-
type:
|
|
3
|
+
type: "SET_IS_INSERTER_OPENED",
|
|
41
4
|
value
|
|
42
5
|
};
|
|
43
6
|
}
|
|
44
|
-
|
|
7
|
+
export {
|
|
8
|
+
setIsInserterOpened
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=actions.js.map
|
|
@@ -1 +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": "AAqCO,SAAS,oBAAqB,OAAQ;AAC5C,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,EACD;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
//# sourceMappingURL=constants.js.map
|
|
1
|
+
const STORE_NAME = "core/customize-widgets";
|
|
2
|
+
export {
|
|
3
|
+
STORE_NAME
|
|
4
|
+
};
|
|
5
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +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": "AAGO,MAAM,aAAa;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,36 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Internal dependencies
|
|
8
|
-
*/
|
|
9
|
-
import reducer from './reducer';
|
|
10
|
-
import * as selectors from './selectors';
|
|
11
|
-
import * as actions from './actions';
|
|
12
|
-
import { STORE_NAME } from './constants';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Block editor data store configuration.
|
|
16
|
-
*
|
|
17
|
-
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registering-a-store
|
|
18
|
-
*
|
|
19
|
-
* @type {Object}
|
|
20
|
-
*/
|
|
1
|
+
import { createReduxStore, register } from "@wordpress/data";
|
|
2
|
+
import reducer from "./reducer";
|
|
3
|
+
import * as selectors from "./selectors";
|
|
4
|
+
import * as actions from "./actions";
|
|
5
|
+
import { STORE_NAME } from "./constants";
|
|
21
6
|
const storeConfig = {
|
|
22
7
|
reducer,
|
|
23
8
|
selectors,
|
|
24
9
|
actions
|
|
25
10
|
};
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Store definition for the edit widgets namespace.
|
|
29
|
-
*
|
|
30
|
-
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
|
|
31
|
-
*
|
|
32
|
-
* @type {Object}
|
|
33
|
-
*/
|
|
34
|
-
export const store = createReduxStore(STORE_NAME, storeConfig);
|
|
11
|
+
const store = createReduxStore(STORE_NAME, storeConfig);
|
|
35
12
|
register(store);
|
|
36
|
-
|
|
13
|
+
export {
|
|
14
|
+
store
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/store/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\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": "AAGA,SAAS,kBAAkB,gBAAgB;AAK3C,OAAO,aAAa;AACpB,YAAY,eAAe;AAC3B,YAAY,aAAa;AACzB,SAAS,kBAAkB;AAS3B,MAAM,cAAc;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AACD;AASO,MAAM,QAAQ,iBAAkB,YAAY,WAAY;AAC/D,SAAU,KAAM;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,22 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { combineReducers } from '@wordpress/data';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Reducer tracking whether the inserter is open.
|
|
8
|
-
*
|
|
9
|
-
* @param {boolean|Object} state
|
|
10
|
-
* @param {Object} action
|
|
11
|
-
*/
|
|
1
|
+
import { combineReducers } from "@wordpress/data";
|
|
12
2
|
function blockInserterPanel(state = false, action) {
|
|
13
3
|
switch (action.type) {
|
|
14
|
-
case
|
|
4
|
+
case "SET_IS_INSERTER_OPENED":
|
|
15
5
|
return action.value;
|
|
16
6
|
}
|
|
17
7
|
return state;
|
|
18
8
|
}
|
|
19
|
-
|
|
9
|
+
var reducer_default = combineReducers({
|
|
20
10
|
blockInserterPanel
|
|
21
11
|
});
|
|
22
|
-
|
|
12
|
+
export {
|
|
13
|
+
reducer_default as default
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=reducer.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/store/reducer.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Reducer tracking whether the inserter is open.\n *\n * @param {boolean|Object} state\n * @param {Object} action\n */\nfunction blockInserterPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value;\n\t}\n\treturn state;\n}\n\nexport default combineReducers( {\n\tblockInserterPanel,\n} );\n"],
|
|
5
|
+
"mappings": "AAGA,SAAS,uBAAuB;AAQhC,SAAS,mBAAoB,QAAQ,OAAO,QAAS;AACpD,UAAS,OAAO,MAAO;AAAA,IACtB,KAAK;AACJ,aAAO,OAAO;AAAA,EAChB;AACA,SAAO;AACR;AAEA,IAAO,kBAAQ,gBAAiB;AAAA,EAC/B;AACD,CAAE;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,48 +1,18 @@
|
|
|
1
1
|
const EMPTY_INSERTION_POINT = {
|
|
2
|
-
rootClientId:
|
|
3
|
-
insertionIndex:
|
|
2
|
+
rootClientId: void 0,
|
|
3
|
+
insertionIndex: void 0
|
|
4
4
|
};
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Returns true if the inserter is opened.
|
|
8
|
-
*
|
|
9
|
-
* @param {Object} state Global application state.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```js
|
|
13
|
-
* import { store as customizeWidgetsStore } from '@wordpress/customize-widgets';
|
|
14
|
-
* import { __ } from '@wordpress/i18n';
|
|
15
|
-
* import { useSelect } from '@wordpress/data';
|
|
16
|
-
*
|
|
17
|
-
* const ExampleComponent = () => {
|
|
18
|
-
* const { isInserterOpened } = useSelect(
|
|
19
|
-
* ( select ) => select( customizeWidgetsStore ),
|
|
20
|
-
* []
|
|
21
|
-
* );
|
|
22
|
-
*
|
|
23
|
-
* return isInserterOpened()
|
|
24
|
-
* ? __( 'Inserter is open' )
|
|
25
|
-
* : __( 'Inserter is closed.' );
|
|
26
|
-
* };
|
|
27
|
-
* ```
|
|
28
|
-
*
|
|
29
|
-
* @return {boolean} Whether the inserter is opened.
|
|
30
|
-
*/
|
|
31
|
-
export function isInserterOpened(state) {
|
|
5
|
+
function isInserterOpened(state) {
|
|
32
6
|
return !!state.blockInserterPanel;
|
|
33
7
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
* Get the insertion point for the inserter.
|
|
37
|
-
*
|
|
38
|
-
* @param {Object} state Global application state.
|
|
39
|
-
*
|
|
40
|
-
* @return {Object} The root client ID and index to insert at.
|
|
41
|
-
*/
|
|
42
|
-
export function __experimentalGetInsertionPoint(state) {
|
|
43
|
-
if (typeof state.blockInserterPanel === 'boolean') {
|
|
8
|
+
function __experimentalGetInsertionPoint(state) {
|
|
9
|
+
if (typeof state.blockInserterPanel === "boolean") {
|
|
44
10
|
return EMPTY_INSERTION_POINT;
|
|
45
11
|
}
|
|
46
12
|
return state.blockInserterPanel;
|
|
47
13
|
}
|
|
48
|
-
|
|
14
|
+
export {
|
|
15
|
+
__experimentalGetInsertionPoint,
|
|
16
|
+
isInserterOpened
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=selectors.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/store/selectors.js"],
|
|
4
|
+
"sourcesContent": ["const EMPTY_INSERTION_POINT = {\n\trootClientId: undefined,\n\tinsertionIndex: undefined,\n};\n\n/**\n * Returns true if the inserter is opened.\n *\n * @param {Object} state Global application state.\n *\n * @example\n * ```js\n * import { store as customizeWidgetsStore } from '@wordpress/customize-widgets';\n * import { __ } from '@wordpress/i18n';\n * import { useSelect } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n * const { isInserterOpened } = useSelect(\n * ( select ) => select( customizeWidgetsStore ),\n * []\n * );\n *\n * return isInserterOpened()\n * ? __( 'Inserter is open' )\n * : __( 'Inserter is closed.' );\n * };\n * ```\n *\n * @return {boolean} Whether the inserter is opened.\n */\nexport function isInserterOpened( state ) {\n\treturn !! state.blockInserterPanel;\n}\n\n/**\n * Get the insertion point for the inserter.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID and index to insert at.\n */\nexport function __experimentalGetInsertionPoint( state ) {\n\tif ( typeof state.blockInserterPanel === 'boolean' ) {\n\t\treturn EMPTY_INSERTION_POINT;\n\t}\n\n\treturn state.blockInserterPanel;\n}\n"],
|
|
5
|
+
"mappings": "AAAA,MAAM,wBAAwB;AAAA,EAC7B,cAAc;AAAA,EACd,gBAAgB;AACjB;AA2BO,SAAS,iBAAkB,OAAQ;AACzC,SAAO,CAAC,CAAE,MAAM;AACjB;AASO,SAAS,gCAAiC,OAAQ;AACxD,MAAK,OAAO,MAAM,uBAAuB,WAAY;AACpD,WAAO;AAAA,EACR;AAEA,SAAO,MAAM;AACd;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|