@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,130 +1,175 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
Object.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
shortcuts
|
|
32
|
-
}) =>
|
|
33
|
-
/*#__PURE__*/
|
|
34
|
-
/*
|
|
35
|
-
* Disable reason: The `list` ARIA role is redundant but
|
|
36
|
-
* Safari+VoiceOver won't announce the list otherwise.
|
|
37
|
-
*/
|
|
38
|
-
/* eslint-disable jsx-a11y/no-redundant-roles */
|
|
39
|
-
(0, _jsxRuntime.jsx)("ul", {
|
|
40
|
-
className: "customize-widgets-keyboard-shortcut-help-modal__shortcut-list",
|
|
41
|
-
role: "list",
|
|
42
|
-
children: shortcuts.map((shortcut, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
43
|
-
className: "customize-widgets-keyboard-shortcut-help-modal__shortcut",
|
|
44
|
-
children: typeof shortcut === 'string' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_dynamicShortcut.default, {
|
|
45
|
-
name: shortcut
|
|
46
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_shortcut.default, {
|
|
47
|
-
...shortcut
|
|
48
|
-
})
|
|
49
|
-
}, index))
|
|
50
|
-
})
|
|
51
|
-
/* eslint-enable jsx-a11y/no-redundant-roles */;
|
|
52
|
-
const ShortcutSection = ({
|
|
53
|
-
title,
|
|
54
|
-
shortcuts,
|
|
55
|
-
className
|
|
56
|
-
}) => /*#__PURE__*/(0, _jsxRuntime.jsxs)("section", {
|
|
57
|
-
className: (0, _clsx.default)('customize-widgets-keyboard-shortcut-help-modal__section', className),
|
|
58
|
-
children: [!!title && /*#__PURE__*/(0, _jsxRuntime.jsx)("h2", {
|
|
59
|
-
className: "customize-widgets-keyboard-shortcut-help-modal__section-title",
|
|
60
|
-
children: title
|
|
61
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(ShortcutList, {
|
|
62
|
-
shortcuts: shortcuts
|
|
63
|
-
})]
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
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
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var keyboard_shortcut_help_modal_exports = {};
|
|
29
|
+
__export(keyboard_shortcut_help_modal_exports, {
|
|
30
|
+
default: () => KeyboardShortcutHelpModal
|
|
64
31
|
});
|
|
32
|
+
module.exports = __toCommonJS(keyboard_shortcut_help_modal_exports);
|
|
33
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
34
|
+
var import_clsx = __toESM(require("clsx"));
|
|
35
|
+
var import_components = require("@wordpress/components");
|
|
36
|
+
var import_i18n = require("@wordpress/i18n");
|
|
37
|
+
var import_keyboard_shortcuts = require("@wordpress/keyboard-shortcuts");
|
|
38
|
+
var import_data = require("@wordpress/data");
|
|
39
|
+
var import_element = require("@wordpress/element");
|
|
40
|
+
var import_config = require("./config");
|
|
41
|
+
var import_shortcut = __toESM(require("./shortcut"));
|
|
42
|
+
var import_dynamic_shortcut = __toESM(require("./dynamic-shortcut"));
|
|
43
|
+
const ShortcutList = ({ shortcuts }) => (
|
|
44
|
+
/*
|
|
45
|
+
* Disable reason: The `list` ARIA role is redundant but
|
|
46
|
+
* Safari+VoiceOver won't announce the list otherwise.
|
|
47
|
+
*/
|
|
48
|
+
/* eslint-disable jsx-a11y/no-redundant-roles */
|
|
49
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
50
|
+
"ul",
|
|
51
|
+
{
|
|
52
|
+
className: "customize-widgets-keyboard-shortcut-help-modal__shortcut-list",
|
|
53
|
+
role: "list",
|
|
54
|
+
children: shortcuts.map((shortcut, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
55
|
+
"li",
|
|
56
|
+
{
|
|
57
|
+
className: "customize-widgets-keyboard-shortcut-help-modal__shortcut",
|
|
58
|
+
children: typeof shortcut === "string" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dynamic_shortcut.default, { name: shortcut }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_shortcut.default, { ...shortcut })
|
|
59
|
+
},
|
|
60
|
+
index
|
|
61
|
+
))
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
);
|
|
65
|
+
const ShortcutSection = ({ title, shortcuts, className }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
66
|
+
"section",
|
|
67
|
+
{
|
|
68
|
+
className: (0, import_clsx.default)(
|
|
69
|
+
"customize-widgets-keyboard-shortcut-help-modal__section",
|
|
70
|
+
className
|
|
71
|
+
),
|
|
72
|
+
children: [
|
|
73
|
+
!!title && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "customize-widgets-keyboard-shortcut-help-modal__section-title", children: title }),
|
|
74
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ShortcutList, { shortcuts })
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
);
|
|
65
78
|
const ShortcutCategorySection = ({
|
|
66
79
|
title,
|
|
67
80
|
categoryName,
|
|
68
81
|
additionalShortcuts = []
|
|
69
82
|
}) => {
|
|
70
|
-
const categoryShortcuts = (0,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
83
|
+
const categoryShortcuts = (0, import_data.useSelect)(
|
|
84
|
+
(select) => {
|
|
85
|
+
return select(import_keyboard_shortcuts.store).getCategoryShortcuts(
|
|
86
|
+
categoryName
|
|
87
|
+
);
|
|
88
|
+
},
|
|
89
|
+
[categoryName]
|
|
90
|
+
);
|
|
91
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
92
|
+
ShortcutSection,
|
|
93
|
+
{
|
|
94
|
+
title,
|
|
95
|
+
shortcuts: categoryShortcuts.concat(additionalShortcuts)
|
|
96
|
+
}
|
|
97
|
+
);
|
|
77
98
|
};
|
|
78
99
|
function KeyboardShortcutHelpModal({
|
|
79
100
|
isModalActive,
|
|
80
101
|
toggleModal
|
|
81
102
|
}) {
|
|
82
|
-
const {
|
|
83
|
-
|
|
84
|
-
} = (0, _data.useDispatch)(_keyboardShortcuts.store);
|
|
85
|
-
(0, _element.useEffect)(() => {
|
|
103
|
+
const { registerShortcut } = (0, import_data.useDispatch)(import_keyboard_shortcuts.store);
|
|
104
|
+
(0, import_element.useEffect)(() => {
|
|
86
105
|
registerShortcut({
|
|
87
|
-
name:
|
|
88
|
-
category:
|
|
89
|
-
description: (0,
|
|
106
|
+
name: "core/customize-widgets/keyboard-shortcuts",
|
|
107
|
+
category: "main",
|
|
108
|
+
description: (0, import_i18n.__)("Display these keyboard shortcuts."),
|
|
90
109
|
keyCombination: {
|
|
91
|
-
modifier:
|
|
92
|
-
character:
|
|
110
|
+
modifier: "access",
|
|
111
|
+
character: "h"
|
|
93
112
|
}
|
|
94
113
|
});
|
|
95
114
|
}, [registerShortcut]);
|
|
96
|
-
(0,
|
|
115
|
+
(0, import_keyboard_shortcuts.useShortcut)("core/customize-widgets/keyboard-shortcuts", toggleModal);
|
|
97
116
|
if (!isModalActive) {
|
|
98
117
|
return null;
|
|
99
118
|
}
|
|
100
|
-
return
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
/*
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
119
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
120
|
+
import_components.Modal,
|
|
121
|
+
{
|
|
122
|
+
className: "customize-widgets-keyboard-shortcut-help-modal",
|
|
123
|
+
title: (0, import_i18n.__)("Keyboard shortcuts"),
|
|
124
|
+
onRequestClose: toggleModal,
|
|
125
|
+
children: [
|
|
126
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
127
|
+
ShortcutSection,
|
|
128
|
+
{
|
|
129
|
+
className: "customize-widgets-keyboard-shortcut-help-modal__main-shortcuts",
|
|
130
|
+
shortcuts: ["core/customize-widgets/keyboard-shortcuts"]
|
|
131
|
+
}
|
|
132
|
+
),
|
|
133
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
134
|
+
ShortcutCategorySection,
|
|
135
|
+
{
|
|
136
|
+
title: (0, import_i18n.__)("Global shortcuts"),
|
|
137
|
+
categoryName: "global"
|
|
138
|
+
}
|
|
139
|
+
),
|
|
140
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
141
|
+
ShortcutCategorySection,
|
|
142
|
+
{
|
|
143
|
+
title: (0, import_i18n.__)("Selection shortcuts"),
|
|
144
|
+
categoryName: "selection"
|
|
145
|
+
}
|
|
146
|
+
),
|
|
147
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
148
|
+
ShortcutCategorySection,
|
|
149
|
+
{
|
|
150
|
+
title: (0, import_i18n.__)("Block shortcuts"),
|
|
151
|
+
categoryName: "block",
|
|
152
|
+
additionalShortcuts: [
|
|
153
|
+
{
|
|
154
|
+
keyCombination: { character: "/" },
|
|
155
|
+
description: (0, import_i18n.__)(
|
|
156
|
+
"Change the block type after adding a new paragraph."
|
|
157
|
+
),
|
|
158
|
+
/* translators: The forward-slash character. e.g. '/'. */
|
|
159
|
+
ariaLabel: (0, import_i18n.__)("Forward-slash")
|
|
160
|
+
}
|
|
161
|
+
]
|
|
162
|
+
}
|
|
163
|
+
),
|
|
164
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
165
|
+
ShortcutSection,
|
|
166
|
+
{
|
|
167
|
+
title: (0, import_i18n.__)("Text formatting"),
|
|
168
|
+
shortcuts: import_config.textFormattingShortcuts
|
|
169
|
+
}
|
|
170
|
+
)
|
|
171
|
+
]
|
|
172
|
+
}
|
|
173
|
+
);
|
|
129
174
|
}
|
|
130
|
-
//# sourceMappingURL=index.js.map
|
|
175
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/keyboard-shortcut-help-modal/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Modal } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { textFormattingShortcuts } from './config';\nimport Shortcut from './shortcut';\nimport DynamicShortcut from './dynamic-shortcut';\n\nconst ShortcutList = ( { shortcuts } ) => (\n\t/*\n\t * Disable reason: The `list` ARIA role is redundant but\n\t * Safari+VoiceOver won't announce the list otherwise.\n\t */\n\t/* eslint-disable jsx-a11y/no-redundant-roles */\n\t<ul\n\t\tclassName=\"customize-widgets-keyboard-shortcut-help-modal__shortcut-list\"\n\t\trole=\"list\"\n\t>\n\t\t{ shortcuts.map( ( shortcut, index ) => (\n\t\t\t<li\n\t\t\t\tclassName=\"customize-widgets-keyboard-shortcut-help-modal__shortcut\"\n\t\t\t\tkey={ index }\n\t\t\t>\n\t\t\t\t{ typeof shortcut === 'string' ? (\n\t\t\t\t\t<DynamicShortcut name={ shortcut } />\n\t\t\t\t) : (\n\t\t\t\t\t<Shortcut { ...shortcut } />\n\t\t\t\t) }\n\t\t\t</li>\n\t\t) ) }\n\t</ul>\n\t/* eslint-enable jsx-a11y/no-redundant-roles */\n);\n\nconst ShortcutSection = ( { title, shortcuts, className } ) => (\n\t<section\n\t\tclassName={ clsx(\n\t\t\t'customize-widgets-keyboard-shortcut-help-modal__section',\n\t\t\tclassName\n\t\t) }\n\t>\n\t\t{ !! title && (\n\t\t\t<h2 className=\"customize-widgets-keyboard-shortcut-help-modal__section-title\">\n\t\t\t\t{ title }\n\t\t\t</h2>\n\t\t) }\n\t\t<ShortcutList shortcuts={ shortcuts } />\n\t</section>\n);\n\nconst ShortcutCategorySection = ( {\n\ttitle,\n\tcategoryName,\n\tadditionalShortcuts = [],\n} ) => {\n\tconst categoryShortcuts = useSelect(\n\t\t( select ) => {\n\t\t\treturn select( keyboardShortcutsStore ).getCategoryShortcuts(\n\t\t\t\tcategoryName\n\t\t\t);\n\t\t},\n\t\t[ categoryName ]\n\t);\n\n\treturn (\n\t\t<ShortcutSection\n\t\t\ttitle={ title }\n\t\t\tshortcuts={ categoryShortcuts.concat( additionalShortcuts ) }\n\t\t/>\n\t);\n};\n\nexport default function KeyboardShortcutHelpModal( {\n\tisModalActive,\n\ttoggleModal,\n} ) {\n\tconst { registerShortcut } = useDispatch( keyboardShortcutsStore );\n\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/customize-widgets/keyboard-shortcuts',\n\t\t\tcategory: 'main',\n\t\t\tdescription: __( 'Display these keyboard shortcuts.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: 'h',\n\t\t\t},\n\t\t} );\n\t}, [ registerShortcut ] );\n\n\tuseShortcut( 'core/customize-widgets/keyboard-shortcuts', toggleModal );\n\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"customize-widgets-keyboard-shortcut-help-modal\"\n\t\t\ttitle={ __( 'Keyboard shortcuts' ) }\n\t\t\tonRequestClose={ toggleModal }\n\t\t>\n\t\t\t<ShortcutSection\n\t\t\t\tclassName=\"customize-widgets-keyboard-shortcut-help-modal__main-shortcuts\"\n\t\t\t\tshortcuts={ [ 'core/customize-widgets/keyboard-shortcuts' ] }\n\t\t\t/>\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Global shortcuts' ) }\n\t\t\t\tcategoryName=\"global\"\n\t\t\t/>\n\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Selection shortcuts' ) }\n\t\t\t\tcategoryName=\"selection\"\n\t\t\t/>\n\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Block shortcuts' ) }\n\t\t\t\tcategoryName=\"block\"\n\t\t\t\tadditionalShortcuts={ [\n\t\t\t\t\t{\n\t\t\t\t\t\tkeyCombination: { character: '/' },\n\t\t\t\t\t\tdescription: __(\n\t\t\t\t\t\t\t'Change the block type after adding a new paragraph.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t/* translators: The forward-slash character. e.g. '/'. */\n\t\t\t\t\t\tariaLabel: __( 'Forward-slash' ),\n\t\t\t\t\t},\n\t\t\t\t] }\n\t\t\t/>\n\t\t\t<ShortcutSection\n\t\t\t\ttitle={ __( 'Text formatting' ) }\n\t\t\t\tshortcuts={ textFormattingShortcuts }\n\t\t\t/>\n\t\t</Modal>\n\t);\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["DynamicShortcut", "Shortcut", "clsx", "keyboardShortcutsStore"]
|
|
7
|
+
}
|
|
@@ -1,59 +1,79 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
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
|
+
var shortcut_exports = {};
|
|
19
|
+
__export(shortcut_exports, {
|
|
20
|
+
default: () => shortcut_default
|
|
5
21
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
22
|
+
module.exports = __toCommonJS(shortcut_exports);
|
|
23
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
24
|
+
var import_element = require("@wordpress/element");
|
|
25
|
+
var import_keycodes = require("@wordpress/keycodes");
|
|
26
|
+
function KeyCombination({ keyCombination, forceAriaLabel }) {
|
|
27
|
+
const shortcut = keyCombination.modifier ? import_keycodes.displayShortcutList[keyCombination.modifier](
|
|
28
|
+
keyCombination.character
|
|
29
|
+
) : keyCombination.character;
|
|
30
|
+
const ariaLabel = keyCombination.modifier ? import_keycodes.shortcutAriaLabel[keyCombination.modifier](
|
|
31
|
+
keyCombination.character
|
|
32
|
+
) : keyCombination.character;
|
|
33
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
34
|
+
"kbd",
|
|
35
|
+
{
|
|
36
|
+
className: "customize-widgets-keyboard-shortcut-help-modal__shortcut-key-combination",
|
|
37
|
+
"aria-label": forceAriaLabel || ariaLabel,
|
|
38
|
+
children: (Array.isArray(shortcut) ? shortcut : [shortcut]).map(
|
|
39
|
+
(character, index) => {
|
|
40
|
+
if (character === "+") {
|
|
41
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_element.Fragment, { children: character }, index);
|
|
42
|
+
}
|
|
43
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
44
|
+
"kbd",
|
|
45
|
+
{
|
|
46
|
+
className: "customize-widgets-keyboard-shortcut-help-modal__shortcut-key",
|
|
47
|
+
children: character
|
|
48
|
+
},
|
|
49
|
+
index
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
);
|
|
35
55
|
}
|
|
36
|
-
function Shortcut({
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
})
|
|
56
|
-
});
|
|
56
|
+
function Shortcut({ description, keyCombination, aliases = [], ariaLabel }) {
|
|
57
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
58
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "customize-widgets-keyboard-shortcut-help-modal__shortcut-description", children: description }),
|
|
59
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "customize-widgets-keyboard-shortcut-help-modal__shortcut-term", children: [
|
|
60
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
61
|
+
KeyCombination,
|
|
62
|
+
{
|
|
63
|
+
keyCombination,
|
|
64
|
+
forceAriaLabel: ariaLabel
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
aliases.map((alias, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
68
|
+
KeyCombination,
|
|
69
|
+
{
|
|
70
|
+
keyCombination: alias,
|
|
71
|
+
forceAriaLabel: ariaLabel
|
|
72
|
+
},
|
|
73
|
+
index
|
|
74
|
+
))
|
|
75
|
+
] })
|
|
76
|
+
] });
|
|
57
77
|
}
|
|
58
|
-
var
|
|
59
|
-
//# sourceMappingURL=shortcut.js.map
|
|
78
|
+
var shortcut_default = Shortcut;
|
|
79
|
+
//# sourceMappingURL=shortcut.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/keyboard-shortcut-help-modal/shortcut.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Fragment } from '@wordpress/element';\nimport { displayShortcutList, shortcutAriaLabel } from '@wordpress/keycodes';\n\nfunction KeyCombination( { keyCombination, forceAriaLabel } ) {\n\tconst shortcut = keyCombination.modifier\n\t\t? displayShortcutList[ keyCombination.modifier ](\n\t\t\t\tkeyCombination.character\n\t\t )\n\t\t: keyCombination.character;\n\tconst ariaLabel = keyCombination.modifier\n\t\t? shortcutAriaLabel[ keyCombination.modifier ](\n\t\t\t\tkeyCombination.character\n\t\t )\n\t\t: keyCombination.character;\n\n\treturn (\n\t\t<kbd\n\t\t\tclassName=\"customize-widgets-keyboard-shortcut-help-modal__shortcut-key-combination\"\n\t\t\taria-label={ forceAriaLabel || ariaLabel }\n\t\t>\n\t\t\t{ ( Array.isArray( shortcut ) ? shortcut : [ shortcut ] ).map(\n\t\t\t\t( character, index ) => {\n\t\t\t\t\tif ( character === '+' ) {\n\t\t\t\t\t\treturn <Fragment key={ index }>{ character }</Fragment>;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<kbd\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tclassName=\"customize-widgets-keyboard-shortcut-help-modal__shortcut-key\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ character }\n\t\t\t\t\t\t</kbd>\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t) }\n\t\t</kbd>\n\t);\n}\n\nfunction Shortcut( { description, keyCombination, aliases = [], ariaLabel } ) {\n\treturn (\n\t\t<>\n\t\t\t<div className=\"customize-widgets-keyboard-shortcut-help-modal__shortcut-description\">\n\t\t\t\t{ description }\n\t\t\t</div>\n\t\t\t<div className=\"customize-widgets-keyboard-shortcut-help-modal__shortcut-term\">\n\t\t\t\t<KeyCombination\n\t\t\t\t\tkeyCombination={ keyCombination }\n\t\t\t\t\tforceAriaLabel={ ariaLabel }\n\t\t\t\t/>\n\t\t\t\t{ aliases.map( ( alias, index ) => (\n\t\t\t\t\t<KeyCombination\n\t\t\t\t\t\tkeyCombination={ alias }\n\t\t\t\t\t\tforceAriaLabel={ ariaLabel }\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default Shortcut;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA0Ba;AAvBb,qBAAyB;AACzB,sBAAuD;AAEvD,SAAS,eAAgB,EAAE,gBAAgB,eAAe,GAAI;AAC7D,QAAM,WAAW,eAAe,WAC7B,oCAAqB,eAAe,QAAS;AAAA,IAC7C,eAAe;AAAA,EACf,IACA,eAAe;AAClB,QAAM,YAAY,eAAe,WAC9B,kCAAmB,eAAe,QAAS;AAAA,IAC3C,eAAe;AAAA,EACf,IACA,eAAe;AAElB,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,cAAa,kBAAkB;AAAA,MAE3B,iBAAM,QAAS,QAAS,IAAI,WAAW,CAAE,QAAS,GAAI;AAAA,QACzD,CAAE,WAAW,UAAW;AACvB,cAAK,cAAc,KAAM;AACxB,mBAAO,4CAAC,2BAAyB,uBAAV,KAAqB;AAAA,UAC7C;AAEA,iBACC;AAAA,YAAC;AAAA;AAAA,cAEA,WAAU;AAAA,cAER;AAAA;AAAA,YAHI;AAAA,UAIP;AAAA,QAEF;AAAA,MACD;AAAA;AAAA,EACD;AAEF;AAEA,SAAS,SAAU,EAAE,aAAa,gBAAgB,UAAU,CAAC,GAAG,UAAU,GAAI;AAC7E,SACC,4EACC;AAAA,gDAAC,SAAI,WAAU,wEACZ,uBACH;AAAA,IACA,6CAAC,SAAI,WAAU,iEACd;AAAA;AAAA,QAAC;AAAA;AAAA,UACA;AAAA,UACA,gBAAiB;AAAA;AAAA,MAClB;AAAA,MACE,QAAQ,IAAK,CAAE,OAAO,UACvB;AAAA,QAAC;AAAA;AAAA,UACA,gBAAiB;AAAA,UACjB,gBAAiB;AAAA;AAAA,QACX;AAAA,MACP,CACC;AAAA,OACH;AAAA,KACD;AAEF;AAEA,IAAO,mBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,86 +1,95 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
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
|
+
var keyboard_shortcuts_exports = {};
|
|
19
|
+
__export(keyboard_shortcuts_exports, {
|
|
20
|
+
default: () => keyboard_shortcuts_default
|
|
5
21
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
function KeyboardShortcuts({
|
|
17
|
-
undo,
|
|
18
|
-
redo,
|
|
19
|
-
save
|
|
20
|
-
}) {
|
|
21
|
-
(0, _keyboardShortcuts.useShortcut)('core/customize-widgets/undo', event => {
|
|
22
|
+
module.exports = __toCommonJS(keyboard_shortcuts_exports);
|
|
23
|
+
var import_element = require("@wordpress/element");
|
|
24
|
+
var import_keyboard_shortcuts = require("@wordpress/keyboard-shortcuts");
|
|
25
|
+
var import_keycodes = require("@wordpress/keycodes");
|
|
26
|
+
var import_data = require("@wordpress/data");
|
|
27
|
+
var import_i18n = require("@wordpress/i18n");
|
|
28
|
+
function KeyboardShortcuts({ undo, redo, save }) {
|
|
29
|
+
(0, import_keyboard_shortcuts.useShortcut)("core/customize-widgets/undo", (event) => {
|
|
22
30
|
undo();
|
|
23
31
|
event.preventDefault();
|
|
24
32
|
});
|
|
25
|
-
(0,
|
|
33
|
+
(0, import_keyboard_shortcuts.useShortcut)("core/customize-widgets/redo", (event) => {
|
|
26
34
|
redo();
|
|
27
35
|
event.preventDefault();
|
|
28
36
|
});
|
|
29
|
-
(0,
|
|
37
|
+
(0, import_keyboard_shortcuts.useShortcut)("core/customize-widgets/save", (event) => {
|
|
30
38
|
event.preventDefault();
|
|
31
39
|
save();
|
|
32
40
|
});
|
|
33
41
|
return null;
|
|
34
42
|
}
|
|
35
43
|
function KeyboardShortcutsRegister() {
|
|
36
|
-
const {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
(0, _element.useEffect)(() => {
|
|
44
|
+
const { registerShortcut, unregisterShortcut } = (0, import_data.useDispatch)(
|
|
45
|
+
import_keyboard_shortcuts.store
|
|
46
|
+
);
|
|
47
|
+
(0, import_element.useEffect)(() => {
|
|
41
48
|
registerShortcut({
|
|
42
|
-
name:
|
|
43
|
-
category:
|
|
44
|
-
description: (0,
|
|
49
|
+
name: "core/customize-widgets/undo",
|
|
50
|
+
category: "global",
|
|
51
|
+
description: (0, import_i18n.__)("Undo your last changes."),
|
|
45
52
|
keyCombination: {
|
|
46
|
-
modifier:
|
|
47
|
-
character:
|
|
53
|
+
modifier: "primary",
|
|
54
|
+
character: "z"
|
|
48
55
|
}
|
|
49
56
|
});
|
|
50
57
|
registerShortcut({
|
|
51
|
-
name:
|
|
52
|
-
category:
|
|
53
|
-
description: (0,
|
|
58
|
+
name: "core/customize-widgets/redo",
|
|
59
|
+
category: "global",
|
|
60
|
+
description: (0, import_i18n.__)("Redo your last undo."),
|
|
54
61
|
keyCombination: {
|
|
55
|
-
modifier:
|
|
56
|
-
character:
|
|
62
|
+
modifier: "primaryShift",
|
|
63
|
+
character: "z"
|
|
57
64
|
},
|
|
58
65
|
// Disable on Apple OS because it conflicts with the browser's
|
|
59
66
|
// history shortcut. It's a fine alias for both Windows and Linux.
|
|
60
67
|
// Since there's no conflict for Ctrl+Shift+Z on both Windows and
|
|
61
68
|
// Linux, we keep it as the default for consistency.
|
|
62
|
-
aliases: (0,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
69
|
+
aliases: (0, import_keycodes.isAppleOS)() ? [] : [
|
|
70
|
+
{
|
|
71
|
+
modifier: "primary",
|
|
72
|
+
character: "y"
|
|
73
|
+
}
|
|
74
|
+
]
|
|
66
75
|
});
|
|
67
76
|
registerShortcut({
|
|
68
|
-
name:
|
|
69
|
-
category:
|
|
70
|
-
description: (0,
|
|
77
|
+
name: "core/customize-widgets/save",
|
|
78
|
+
category: "global",
|
|
79
|
+
description: (0, import_i18n.__)("Save your changes."),
|
|
71
80
|
keyCombination: {
|
|
72
|
-
modifier:
|
|
73
|
-
character:
|
|
81
|
+
modifier: "primary",
|
|
82
|
+
character: "s"
|
|
74
83
|
}
|
|
75
84
|
});
|
|
76
85
|
return () => {
|
|
77
|
-
unregisterShortcut(
|
|
78
|
-
unregisterShortcut(
|
|
79
|
-
unregisterShortcut(
|
|
86
|
+
unregisterShortcut("core/customize-widgets/undo");
|
|
87
|
+
unregisterShortcut("core/customize-widgets/redo");
|
|
88
|
+
unregisterShortcut("core/customize-widgets/save");
|
|
80
89
|
};
|
|
81
90
|
}, [registerShortcut]);
|
|
82
91
|
return null;
|
|
83
92
|
}
|
|
84
93
|
KeyboardShortcuts.Register = KeyboardShortcutsRegister;
|
|
85
|
-
var
|
|
86
|
-
//# sourceMappingURL=index.js.map
|
|
94
|
+
var keyboard_shortcuts_default = KeyboardShortcuts;
|
|
95
|
+
//# sourceMappingURL=index.js.map
|