@wordpress/customize-widgets 5.57.0 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 -95
- 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 +37 -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 +103 -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 +46 -72
- 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 +103 -128
- 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 +31 -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 +76 -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/package.json +30 -31
- package/src/components/customize-widgets/index.jsx +5 -2
- package/src/components/customize-widgets/use-clear-selected-block.js +2 -1
- package/src/components/welcome-guide/index.jsx +6 -2
- package/CHANGELOG.md +0 -289
- package/build/filters/index.cjs.map +0 -7
- package/build-module/filters/index.mjs.map +0 -7
|
@@ -1,162 +1,114 @@
|
|
|
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_components = require("@wordpress/components");
|
|
28
|
+
let _wordpress_data = require("@wordpress/data");
|
|
29
|
+
let _wordpress_element = require("@wordpress/element");
|
|
30
|
+
let _wordpress_i18n = require("@wordpress/i18n");
|
|
31
|
+
let _wordpress_icons = require("@wordpress/icons");
|
|
32
|
+
let _wordpress_keycodes = require("@wordpress/keycodes");
|
|
33
|
+
let _wordpress_keyboard_shortcuts = require("@wordpress/keyboard-shortcuts");
|
|
34
|
+
let _wordpress_preferences = require("@wordpress/preferences");
|
|
35
|
+
let _wordpress_ui = require("@wordpress/ui");
|
|
36
|
+
let ___keyboard_shortcut_help_modal_index_jsx = require("../keyboard-shortcut-help-modal/index.cjs");
|
|
37
|
+
___keyboard_shortcut_help_modal_index_jsx = __toESM(___keyboard_shortcut_help_modal_index_jsx);
|
|
38
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
29
39
|
// packages/customize-widgets/src/components/more-menu/index.jsx
|
|
30
|
-
var more_menu_exports = {};
|
|
31
|
-
__export(more_menu_exports, {
|
|
32
|
-
default: () => MoreMenu
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(more_menu_exports);
|
|
35
|
-
var import_components = require("@wordpress/components");
|
|
36
|
-
var import_data = require("@wordpress/data");
|
|
37
|
-
var import_element = require("@wordpress/element");
|
|
38
|
-
var import_i18n = require("@wordpress/i18n");
|
|
39
|
-
var import_icons = require("@wordpress/icons");
|
|
40
|
-
var import_keycodes = require("@wordpress/keycodes");
|
|
41
|
-
var import_keyboard_shortcuts = require("@wordpress/keyboard-shortcuts");
|
|
42
|
-
var import_preferences = require("@wordpress/preferences");
|
|
43
|
-
var import_ui = require("@wordpress/ui");
|
|
44
|
-
var import_keyboard_shortcut_help_modal = __toESM(require("../keyboard-shortcut-help-modal/index.cjs"));
|
|
45
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
46
40
|
function MoreMenu() {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
),
|
|
118
|
-
target: "_blank",
|
|
119
|
-
rel: "noopener",
|
|
120
|
-
children: [
|
|
121
|
-
(0, import_i18n.__)("Help"),
|
|
122
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.VisuallyHidden, {
|
|
123
|
-
render: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {}),
|
|
124
|
-
/* translators: accessibility text */
|
|
125
|
-
children: (0, import_i18n.__)("(opens in a new tab)")
|
|
126
|
-
})
|
|
127
|
-
]
|
|
128
|
-
}
|
|
129
|
-
)
|
|
130
|
-
] }),
|
|
131
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.MenuGroup, { label: (0, import_i18n.__)("Preferences"), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
132
|
-
import_preferences.PreferenceToggleMenuItem,
|
|
133
|
-
{
|
|
134
|
-
scope: "core/customize-widgets",
|
|
135
|
-
name: "keepCaretInsideBlock",
|
|
136
|
-
label: (0, import_i18n.__)(
|
|
137
|
-
"Contain text cursor inside block"
|
|
138
|
-
),
|
|
139
|
-
info: (0, import_i18n.__)(
|
|
140
|
-
"Aids screen readers by stopping text caret from leaving blocks."
|
|
141
|
-
),
|
|
142
|
-
messageActivated: (0, import_i18n.__)(
|
|
143
|
-
"Contain text cursor inside block activated"
|
|
144
|
-
),
|
|
145
|
-
messageDeactivated: (0, import_i18n.__)(
|
|
146
|
-
"Contain text cursor inside block deactivated"
|
|
147
|
-
)
|
|
148
|
-
}
|
|
149
|
-
) })
|
|
150
|
-
] })
|
|
151
|
-
}
|
|
152
|
-
),
|
|
153
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
154
|
-
import_keyboard_shortcut_help_modal.default,
|
|
155
|
-
{
|
|
156
|
-
isModalActive: isKeyboardShortcutsModalActive,
|
|
157
|
-
toggleModal: toggleKeyboardShortcutsModal
|
|
158
|
-
}
|
|
159
|
-
)
|
|
160
|
-
] });
|
|
41
|
+
const [isKeyboardShortcutsModalActive, setIsKeyboardShortcutsModalVisible] = (0, _wordpress_element.useState)(false);
|
|
42
|
+
const toggleKeyboardShortcutsModal = () => setIsKeyboardShortcutsModalVisible(!isKeyboardShortcutsModalActive);
|
|
43
|
+
(0, _wordpress_keyboard_shortcuts.useShortcut)("core/customize-widgets/keyboard-shortcuts", toggleKeyboardShortcutsModal);
|
|
44
|
+
const { toggle } = (0, _wordpress_data.useDispatch)(_wordpress_preferences.store);
|
|
45
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_components.ToolbarDropdownMenu, {
|
|
46
|
+
icon: _wordpress_icons.moreVertical,
|
|
47
|
+
label: (0, _wordpress_i18n.__)("Options"),
|
|
48
|
+
popoverProps: {
|
|
49
|
+
placement: "bottom-end",
|
|
50
|
+
className: "more-menu-dropdown__content"
|
|
51
|
+
},
|
|
52
|
+
toggleProps: {
|
|
53
|
+
tooltipPosition: "bottom",
|
|
54
|
+
size: "compact"
|
|
55
|
+
},
|
|
56
|
+
children: () => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
57
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_components.MenuGroup, {
|
|
58
|
+
label: (0, _wordpress_i18n._x)("View", "noun"),
|
|
59
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_preferences.PreferenceToggleMenuItem, {
|
|
60
|
+
scope: "core/customize-widgets",
|
|
61
|
+
name: "fixedToolbar",
|
|
62
|
+
label: (0, _wordpress_i18n.__)("Top toolbar"),
|
|
63
|
+
info: (0, _wordpress_i18n.__)("Access all block and document tools in a single place"),
|
|
64
|
+
messageActivated: (0, _wordpress_i18n.__)("Top toolbar activated"),
|
|
65
|
+
messageDeactivated: (0, _wordpress_i18n.__)("Top toolbar deactivated")
|
|
66
|
+
})
|
|
67
|
+
}),
|
|
68
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_wordpress_components.MenuGroup, {
|
|
69
|
+
label: (0, _wordpress_i18n.__)("Tools"),
|
|
70
|
+
children: [
|
|
71
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_components.MenuItem, {
|
|
72
|
+
onClick: () => {
|
|
73
|
+
setIsKeyboardShortcutsModalVisible(true);
|
|
74
|
+
},
|
|
75
|
+
shortcut: _wordpress_keycodes.displayShortcut.access("h"),
|
|
76
|
+
children: (0, _wordpress_i18n.__)("Keyboard shortcuts")
|
|
77
|
+
}),
|
|
78
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_components.MenuItem, {
|
|
79
|
+
onClick: () => toggle("core/customize-widgets", "welcomeGuide"),
|
|
80
|
+
children: (0, _wordpress_i18n.__)("Welcome Guide")
|
|
81
|
+
}),
|
|
82
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_wordpress_components.MenuItem, {
|
|
83
|
+
role: "menuitem",
|
|
84
|
+
icon: _wordpress_icons.external,
|
|
85
|
+
href: (0, _wordpress_i18n.__)("https://wordpress.org/documentation/article/block-based-widgets-editor/"),
|
|
86
|
+
target: "_blank",
|
|
87
|
+
rel: "noopener",
|
|
88
|
+
children: [(0, _wordpress_i18n.__)("Help"), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_ui.VisuallyHidden, {
|
|
89
|
+
render: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {}),
|
|
90
|
+
children: (0, _wordpress_i18n.__)("(opens in a new tab)")
|
|
91
|
+
})]
|
|
92
|
+
})
|
|
93
|
+
]
|
|
94
|
+
}),
|
|
95
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_components.MenuGroup, {
|
|
96
|
+
label: (0, _wordpress_i18n.__)("Preferences"),
|
|
97
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_preferences.PreferenceToggleMenuItem, {
|
|
98
|
+
scope: "core/customize-widgets",
|
|
99
|
+
name: "keepCaretInsideBlock",
|
|
100
|
+
label: (0, _wordpress_i18n.__)("Contain text cursor inside block"),
|
|
101
|
+
info: (0, _wordpress_i18n.__)("Aids screen readers by stopping text caret from leaving blocks."),
|
|
102
|
+
messageActivated: (0, _wordpress_i18n.__)("Contain text cursor inside block activated"),
|
|
103
|
+
messageDeactivated: (0, _wordpress_i18n.__)("Contain text cursor inside block deactivated")
|
|
104
|
+
})
|
|
105
|
+
})
|
|
106
|
+
] })
|
|
107
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(___keyboard_shortcut_help_modal_index_jsx.default, {
|
|
108
|
+
isModalActive: isKeyboardShortcutsModalActive,
|
|
109
|
+
toggleModal: toggleKeyboardShortcutsModal
|
|
110
|
+
})] });
|
|
161
111
|
}
|
|
162
|
-
|
|
112
|
+
exports.default = MoreMenu;
|
|
113
|
+
|
|
114
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/more-menu/index.jsx"],
|
|
4
|
-
"sourcesContent": ["import {\n\tMenuGroup,\n\tMenuItem,\n\tToolbarDropdownMenu,\n} from '@wordpress/components';\nimport { useDispatch } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { __, _x } from '@wordpress/i18n';\nimport { external, moreVertical } from '@wordpress/icons';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport {\n\tPreferenceToggleMenuItem,\n\tstore as preferencesStore,\n} from '@wordpress/preferences';\nimport { VisuallyHidden } from '@wordpress/ui';\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\n\nexport default function MoreMenu() {\n\tconst [\n\t\tisKeyboardShortcutsModalActive,\n\t\tsetIsKeyboardShortcutsModalVisible,\n\t] = useState( false );\n\tconst toggleKeyboardShortcutsModal = () =>\n\t\tsetIsKeyboardShortcutsModalVisible( ! isKeyboardShortcutsModalActive );\n\n\tuseShortcut(\n\t\t'core/customize-widgets/keyboard-shortcuts',\n\t\ttoggleKeyboardShortcutsModal\n\t);\n\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\treturn (\n\t\t<>\n\t\t\t<ToolbarDropdownMenu\n\t\t\t\ticon={ moreVertical }\n\t\t\t\tlabel={ __( 'Options' ) }\n\t\t\t\tpopoverProps={ {\n\t\t\t\t\tplacement: 'bottom-end',\n\t\t\t\t\tclassName: 'more-menu-dropdown__content',\n\t\t\t\t} }\n\t\t\t\ttoggleProps={ {\n\t\t\t\t\ttooltipPosition: 'bottom',\n\t\t\t\t\tsize: 'compact',\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ () => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<MenuGroup label={ _x( 'View', 'noun' ) }>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core/customize-widgets\"\n\t\t\t\t\t\t\t\tname=\"fixedToolbar\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t'Access all block and document tools in a single place'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Top toolbar activated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Top toolbar deactivated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<MenuGroup label={ __( 'Tools' ) }>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tsetIsKeyboardShortcutsModalVisible( true );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.access( 'h' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Keyboard shortcuts' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\ttoggle(\n\t\t\t\t\t\t\t\t\t\t'core/customize-widgets',\n\t\t\t\t\t\t\t\t\t\t'welcomeGuide'\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Welcome Guide' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/block-based-widgets-editor/'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noopener\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Help' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden render={ <span /> }>\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<MenuGroup label={ __( 'Preferences' ) }>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core/customize-widgets\"\n\t\t\t\t\t\t\t\tname=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t'Aids screen readers by stopping text caret from leaving blocks.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block activated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block deactivated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</ToolbarDropdownMenu>\n\t\t\t<KeyboardShortcutHelpModal\n\t\t\t\tisModalActive={ isKeyboardShortcutsModalActive }\n\t\t\t\ttoggleModal={ toggleKeyboardShortcutsModal }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAIO;AACP,kBAA4B;AAC5B,qBAAyB;AACzB,kBAAuB;AACvB,mBAAuC;AACvC,sBAAgC;AAChC,gCAA4B;AAC5B,yBAGO;AACP,gBAA+B;AAC/B,0CAAsC;AAgCjC;AA9BU,SAAR,WAA4B;AAClC,QAAM;AAAA,IACL;AAAA,IACA;AAAA,EACD,QAAI,yBAAU,KAAM;AACpB,QAAM,+BAA+B,MACpC,mCAAoC,CAAE,8BAA+B;AAEtE;AAAA,IACC;AAAA,IACA;AAAA,EACD;AAEA,QAAM,EAAE,OAAO,QAAI,yBAAa,mBAAAA,KAAiB;AAEjD,SACC,4EACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,MAAO;AAAA,QACP,WAAQ,gBAAI,SAAU;AAAA,QACtB,cAAe;AAAA,UACd,WAAW;AAAA,UACX,WAAW;AAAA,QACZ;AAAA,QACA,aAAc;AAAA,UACb,iBAAiB;AAAA,UACjB,MAAM;AAAA,QACP;AAAA,QAEE,gBACD,4EACC;AAAA,sDAAC,+BAAU,WAAQ,gBAAI,QAAQ,MAAO,GACrC;AAAA,YAAC;AAAA;AAAA,cACA,OAAM;AAAA,cACN,MAAK;AAAA,cACL,WAAQ,gBAAI,aAAc;AAAA,cAC1B,UAAO;AAAA,gBACN;AAAA,cACD;AAAA,cACA,sBAAmB;AAAA,gBAClB;AAAA,cACD;AAAA,cACA,wBAAqB;AAAA,gBACpB;AAAA,cACD;AAAA;AAAA,UACD,GACD;AAAA,UACA,6CAAC,+BAAU,WAAQ,gBAAI,OAAQ,GAC9B;AAAA;AAAA,cAAC;AAAA;AAAA,gBACA,SAAU,MAAM;AACf,qDAAoC,IAAK;AAAA,gBAC1C;AAAA,gBACA,UAAW,gCAAgB,OAAQ,GAAI;AAAA,gBAErC,8BAAI,oBAAqB;AAAA;AAAA,YAC5B;AAAA,YACA;AAAA,cAAC;AAAA;AAAA,gBACA,SAAU,MACT;AAAA,kBACC;AAAA,kBACA;AAAA,gBACD;AAAA,gBAGC,8BAAI,eAAgB;AAAA;AAAA,YACvB;AAAA,YACA;AAAA,cAAC;AAAA;AAAA,gBACA,MAAK;AAAA,gBACL,MAAO;AAAA,gBACP,UAAO;AAAA,kBACN;AAAA,gBACD;AAAA,gBACA,QAAO;AAAA,gBACP,KAAI;AAAA,gBAEF;AAAA,sCAAI,MAAO;AAAA,kBACb,4CAAC;AAAA,oBAAe,QAAS,4CAAC,UAAK;AAAA;AAAA,oBAG7B,8BAAI,sBAAuB;AAAA,mBAE7B;AAAA;AAAA;AAAA,YACD;AAAA,aACD;AAAA,UACA,4CAAC,+BAAU,WAAQ,gBAAI,aAAc,GACpC;AAAA,YAAC;AAAA;AAAA,cACA,OAAM;AAAA,cACN,MAAK;AAAA,cACL,WAAQ;AAAA,gBACP;AAAA,cACD;AAAA,cACA,UAAO;AAAA,gBACN;AAAA,cACD;AAAA,cACA,sBAAmB;AAAA,gBAClB;AAAA,cACD;AAAA,cACA,wBAAqB;AAAA,gBACpB;AAAA,cACD;AAAA;AAAA,UACD,GACD;AAAA,WACD;AAAA;AAAA,IAEF;AAAA,IACA;AAAA,MAAC,oCAAAC;AAAA,MAAA;AAAA,QACA,eAAgB;AAAA,QAChB,aAAc;AAAA;AAAA,IACf;AAAA,KACD;AAEF;",
|
|
6
|
-
"names": ["preferencesStore", "KeyboardShortcutHelpModal"]
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["useState","useDispatch","preferencesStore","ToolbarDropdownMenu","moreVertical","__","MenuGroup","_x","PreferenceToggleMenuItem","MenuItem","displayShortcut","external","VisuallyHidden","KeyboardShortcutHelpModal"],"sources":["../../../src/components/more-menu/index.jsx"],"sourcesContent":["import {\n\tMenuGroup,\n\tMenuItem,\n\tToolbarDropdownMenu,\n} from '@wordpress/components';\nimport { useDispatch } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { __, _x } from '@wordpress/i18n';\nimport { external, moreVertical } from '@wordpress/icons';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport {\n\tPreferenceToggleMenuItem,\n\tstore as preferencesStore,\n} from '@wordpress/preferences';\nimport { VisuallyHidden } from '@wordpress/ui';\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\n\nexport default function MoreMenu() {\n\tconst [\n\t\tisKeyboardShortcutsModalActive,\n\t\tsetIsKeyboardShortcutsModalVisible,\n\t] = useState( false );\n\tconst toggleKeyboardShortcutsModal = () =>\n\t\tsetIsKeyboardShortcutsModalVisible( ! isKeyboardShortcutsModalActive );\n\n\tuseShortcut(\n\t\t'core/customize-widgets/keyboard-shortcuts',\n\t\ttoggleKeyboardShortcutsModal\n\t);\n\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\treturn (\n\t\t<>\n\t\t\t<ToolbarDropdownMenu\n\t\t\t\ticon={ moreVertical }\n\t\t\t\tlabel={ __( 'Options' ) }\n\t\t\t\tpopoverProps={ {\n\t\t\t\t\tplacement: 'bottom-end',\n\t\t\t\t\tclassName: 'more-menu-dropdown__content',\n\t\t\t\t} }\n\t\t\t\ttoggleProps={ {\n\t\t\t\t\ttooltipPosition: 'bottom',\n\t\t\t\t\tsize: 'compact',\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ () => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<MenuGroup label={ _x( 'View', 'noun' ) }>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core/customize-widgets\"\n\t\t\t\t\t\t\t\tname=\"fixedToolbar\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t'Access all block and document tools in a single place'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Top toolbar activated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Top toolbar deactivated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<MenuGroup label={ __( 'Tools' ) }>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tsetIsKeyboardShortcutsModalVisible( true );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.access( 'h' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Keyboard shortcuts' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\ttoggle(\n\t\t\t\t\t\t\t\t\t\t'core/customize-widgets',\n\t\t\t\t\t\t\t\t\t\t'welcomeGuide'\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Welcome Guide' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/block-based-widgets-editor/'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noopener\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Help' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden render={ <span /> }>\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<MenuGroup label={ __( 'Preferences' ) }>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core/customize-widgets\"\n\t\t\t\t\t\t\t\tname=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t'Aids screen readers by stopping text caret from leaving blocks.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block activated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block deactivated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</ToolbarDropdownMenu>\n\t\t\t<KeyboardShortcutHelpModal\n\t\t\t\tisModalActive={ isKeyboardShortcutsModalActive }\n\t\t\t\ttoggleModal={ toggleKeyboardShortcutsModal }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],"mappings":"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"}
|
|
@@ -1,165 +1,132 @@
|
|
|
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_compose = require("@wordpress/compose");
|
|
28
|
+
let _wordpress_core_data = require("@wordpress/core-data");
|
|
29
|
+
let _wordpress_data = require("@wordpress/data");
|
|
30
|
+
let _wordpress_element = require("@wordpress/element");
|
|
31
|
+
let _wordpress_block_editor = require("@wordpress/block-editor");
|
|
32
|
+
let _wordpress_media_utils = require("@wordpress/media-utils");
|
|
33
|
+
let _wordpress_preferences = require("@wordpress/preferences");
|
|
34
|
+
let ___block_inspector_button_index_jsx = require("../block-inspector-button/index.cjs");
|
|
35
|
+
___block_inspector_button_index_jsx = __toESM(___block_inspector_button_index_jsx);
|
|
36
|
+
let ___header_index_jsx = require("../header/index.cjs");
|
|
37
|
+
___header_index_jsx = __toESM(___header_index_jsx);
|
|
38
|
+
let ___inserter_use_inserter_js = require("../inserter/use-inserter.cjs");
|
|
39
|
+
___inserter_use_inserter_js = __toESM(___inserter_use_inserter_js);
|
|
40
|
+
let __sidebar_editor_provider_jsx = require("./sidebar-editor-provider.cjs");
|
|
41
|
+
__sidebar_editor_provider_jsx = __toESM(__sidebar_editor_provider_jsx);
|
|
42
|
+
let ___welcome_guide_index_jsx = require("../welcome-guide/index.cjs");
|
|
43
|
+
___welcome_guide_index_jsx = __toESM(___welcome_guide_index_jsx);
|
|
44
|
+
let ___keyboard_shortcuts_index_js = require("../keyboard-shortcuts/index.cjs");
|
|
45
|
+
___keyboard_shortcuts_index_js = __toESM(___keyboard_shortcuts_index_js);
|
|
46
|
+
let ___block_appender_index_jsx = require("../block-appender/index.cjs");
|
|
47
|
+
___block_appender_index_jsx = __toESM(___block_appender_index_jsx);
|
|
48
|
+
let ______lock_unlock_js = require("../../lock-unlock.cjs");
|
|
49
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
29
50
|
// packages/customize-widgets/src/components/sidebar-block-editor/index.jsx
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
hasUploadPermissions,
|
|
109
|
-
blockEditorSettings,
|
|
110
|
-
isFixedToolbarActive,
|
|
111
|
-
isMediumViewport,
|
|
112
|
-
keepCaretInsideBlock,
|
|
113
|
-
setIsInserterOpened
|
|
114
|
-
]);
|
|
115
|
-
if (isWelcomeGuideActive) {
|
|
116
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_welcome_guide.default, { sidebar });
|
|
117
|
-
}
|
|
118
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
119
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_keyboard_shortcuts.default.Register, {}),
|
|
120
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_sidebar_editor_provider.default, { sidebar, settings, children: [
|
|
121
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
122
|
-
import_keyboard_shortcuts.default,
|
|
123
|
-
{
|
|
124
|
-
undo: sidebar.undo,
|
|
125
|
-
redo: sidebar.redo,
|
|
126
|
-
save: sidebar.save
|
|
127
|
-
}
|
|
128
|
-
),
|
|
129
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
130
|
-
import_header.default,
|
|
131
|
-
{
|
|
132
|
-
sidebar,
|
|
133
|
-
inserter,
|
|
134
|
-
isInserterOpened,
|
|
135
|
-
setIsInserterOpened,
|
|
136
|
-
isFixedToolbarActive: isFixedToolbarActive || !isMediumViewport
|
|
137
|
-
}
|
|
138
|
-
),
|
|
139
|
-
(isFixedToolbarActive || !isMediumViewport) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.BlockToolbar, { hideDragHandle: true }),
|
|
140
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
141
|
-
BlockCanvas,
|
|
142
|
-
{
|
|
143
|
-
shouldIframe: false,
|
|
144
|
-
styles: settings.defaultEditorStyles,
|
|
145
|
-
height: "100%",
|
|
146
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.BlockList, { renderAppender: import_block_appender.default })
|
|
147
|
-
}
|
|
148
|
-
),
|
|
149
|
-
(0, import_element.createPortal)(
|
|
150
|
-
// This is a temporary hack to prevent button component inside <BlockInspector>
|
|
151
|
-
// from submitting form when type="button" is not specified.
|
|
152
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("form", { onSubmit: (event) => event.preventDefault(), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.BlockInspector, {}) }),
|
|
153
|
-
inspector.contentContainer[0]
|
|
154
|
-
)
|
|
155
|
-
] }),
|
|
156
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.__unstableBlockSettingsMenuFirstItem, { children: ({ onClose }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
157
|
-
import_block_inspector_button.default,
|
|
158
|
-
{
|
|
159
|
-
inspector,
|
|
160
|
-
closeMenu: onClose
|
|
161
|
-
}
|
|
162
|
-
) })
|
|
163
|
-
] });
|
|
51
|
+
const { ExperimentalBlockCanvas: BlockCanvas } = (0, ______lock_unlock_js.unlock)(_wordpress_block_editor.privateApis);
|
|
52
|
+
function SidebarBlockEditor({ blockEditorSettings, sidebar, inserter, inspector }) {
|
|
53
|
+
const [isInserterOpened, setIsInserterOpened] = (0, ___inserter_use_inserter_js.default)(inserter);
|
|
54
|
+
const isMediumViewport = (0, _wordpress_compose.useViewportMatch)("small");
|
|
55
|
+
const { hasUploadPermissions, isFixedToolbarActive, keepCaretInsideBlock, isWelcomeGuideActive } = (0, _wordpress_data.useSelect)((select) => {
|
|
56
|
+
const { get } = select(_wordpress_preferences.store);
|
|
57
|
+
return {
|
|
58
|
+
hasUploadPermissions: select(_wordpress_core_data.store).canUser("create", {
|
|
59
|
+
kind: "postType",
|
|
60
|
+
name: "attachment"
|
|
61
|
+
}) ?? true,
|
|
62
|
+
isFixedToolbarActive: !!get("core/customize-widgets", "fixedToolbar"),
|
|
63
|
+
keepCaretInsideBlock: !!get("core/customize-widgets", "keepCaretInsideBlock"),
|
|
64
|
+
isWelcomeGuideActive: !!get("core/customize-widgets", "welcomeGuide")
|
|
65
|
+
};
|
|
66
|
+
}, []);
|
|
67
|
+
const settings = (0, _wordpress_element.useMemo)(() => {
|
|
68
|
+
let mediaUploadBlockEditor;
|
|
69
|
+
if (hasUploadPermissions) mediaUploadBlockEditor = ({ onError, ...argumentsObject }) => {
|
|
70
|
+
(0, _wordpress_media_utils.uploadMedia)({
|
|
71
|
+
wpAllowedMimeTypes: blockEditorSettings.allowedMimeTypes,
|
|
72
|
+
onError: ({ message }) => onError(message),
|
|
73
|
+
...argumentsObject
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
return {
|
|
77
|
+
...blockEditorSettings,
|
|
78
|
+
__experimentalSetIsInserterOpened: setIsInserterOpened,
|
|
79
|
+
mediaUpload: mediaUploadBlockEditor,
|
|
80
|
+
hasFixedToolbar: isFixedToolbarActive || !isMediumViewport,
|
|
81
|
+
keepCaretInsideBlock,
|
|
82
|
+
__unstableHasCustomAppender: true
|
|
83
|
+
};
|
|
84
|
+
}, [
|
|
85
|
+
hasUploadPermissions,
|
|
86
|
+
blockEditorSettings,
|
|
87
|
+
isFixedToolbarActive,
|
|
88
|
+
isMediumViewport,
|
|
89
|
+
keepCaretInsideBlock,
|
|
90
|
+
setIsInserterOpened
|
|
91
|
+
]);
|
|
92
|
+
if (isWelcomeGuideActive) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(___welcome_guide_index_jsx.default, { sidebar });
|
|
93
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
94
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(___keyboard_shortcuts_index_js.default.Register, {}),
|
|
95
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__sidebar_editor_provider_jsx.default, {
|
|
96
|
+
sidebar,
|
|
97
|
+
settings,
|
|
98
|
+
children: [
|
|
99
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(___keyboard_shortcuts_index_js.default, {
|
|
100
|
+
undo: sidebar.undo,
|
|
101
|
+
redo: sidebar.redo,
|
|
102
|
+
save: sidebar.save
|
|
103
|
+
}),
|
|
104
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(___header_index_jsx.default, {
|
|
105
|
+
sidebar,
|
|
106
|
+
inserter,
|
|
107
|
+
isInserterOpened,
|
|
108
|
+
setIsInserterOpened,
|
|
109
|
+
isFixedToolbarActive: isFixedToolbarActive || !isMediumViewport
|
|
110
|
+
}),
|
|
111
|
+
(isFixedToolbarActive || !isMediumViewport) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_block_editor.BlockToolbar, { hideDragHandle: true }),
|
|
112
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(BlockCanvas, {
|
|
113
|
+
shouldIframe: false,
|
|
114
|
+
styles: settings.defaultEditorStyles,
|
|
115
|
+
height: "100%",
|
|
116
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_block_editor.BlockList, { renderAppender: ___block_appender_index_jsx.default })
|
|
117
|
+
}),
|
|
118
|
+
(0, _wordpress_element.createPortal)(/* @__PURE__ */ (0, react_jsx_runtime.jsx)("form", {
|
|
119
|
+
onSubmit: (event) => event.preventDefault(),
|
|
120
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_block_editor.BlockInspector, {})
|
|
121
|
+
}), inspector.contentContainer[0])
|
|
122
|
+
]
|
|
123
|
+
}),
|
|
124
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_block_editor.__unstableBlockSettingsMenuFirstItem, { children: ({ onClose }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(___block_inspector_button_index_jsx.default, {
|
|
125
|
+
inspector,
|
|
126
|
+
closeMenu: onClose
|
|
127
|
+
}) })
|
|
128
|
+
] });
|
|
164
129
|
}
|
|
165
|
-
|
|
130
|
+
exports.default = SidebarBlockEditor;
|
|
131
|
+
|
|
132
|
+
//# sourceMappingURL=index.cjs.map
|