@wordpress/edit-widgets 6.31.1-next.f56bd8138.0 → 6.32.1-next.47f435fc9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/blocks/widget-area/block.json +26 -0
- package/build/blocks/widget-area/edit/index.js +94 -87
- package/build/blocks/widget-area/edit/index.js.map +7 -1
- package/build/blocks/widget-area/edit/inner-blocks.js +68 -50
- package/build/blocks/widget-area/edit/inner-blocks.js.map +7 -1
- package/build/blocks/widget-area/edit/use-is-dragging-within.js +34 -40
- package/build/blocks/widget-area/edit/use-is-dragging-within.js.map +7 -1
- package/build/blocks/widget-area/index.js +49 -52
- package/build/blocks/widget-area/index.js.map +7 -1
- package/build/components/error-boundary/index.js +49 -51
- package/build/components/error-boundary/index.js.map +7 -1
- package/build/components/header/document-tools/index.js +104 -74
- package/build/components/header/document-tools/index.js.map +7 -1
- package/build/components/header/index.js +81 -62
- package/build/components/header/index.js.map +7 -1
- package/build/components/header/undo-redo/redo.js +50 -38
- package/build/components/header/undo-redo/redo.js.map +7 -1
- package/build/components/header/undo-redo/undo.js +49 -37
- package/build/components/header/undo-redo/undo.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 +154 -103
- package/build/components/keyboard-shortcut-help-modal/index.js.map +7 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +74 -56
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +7 -1
- package/build/components/keyboard-shortcuts/index.js +89 -82
- package/build/components/keyboard-shortcuts/index.js.map +7 -1
- package/build/components/layout/index.js +75 -49
- package/build/components/layout/index.js.map +7 -1
- package/build/components/layout/interface.js +89 -75
- package/build/components/layout/interface.js.map +7 -1
- package/build/components/layout/unsaved-changes-warning.js +35 -42
- package/build/components/layout/unsaved-changes-warning.js.map +7 -1
- package/build/components/more-menu/index.js +189 -108
- package/build/components/more-menu/index.js.map +7 -1
- package/build/components/more-menu/tools-more-menu-group.js +29 -23
- package/build/components/more-menu/tools-more-menu-group.js.map +7 -1
- package/build/components/notices/index.js +62 -48
- package/build/components/notices/index.js.map +7 -1
- package/build/components/save-button/index.js +55 -47
- package/build/components/save-button/index.js.map +7 -1
- package/build/components/secondary-sidebar/index.js +41 -34
- package/build/components/secondary-sidebar/index.js.map +7 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js +55 -46
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +7 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +76 -67
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +7 -1
- package/build/components/sidebar/index.js +149 -138
- package/build/components/sidebar/index.js.map +7 -1
- package/build/components/sidebar/widget-areas.js +73 -57
- package/build/components/sidebar/widget-areas.js.map +7 -1
- package/build/components/welcome-guide/index.js +182 -137
- package/build/components/welcome-guide/index.js.map +7 -1
- package/build/components/widget-areas-block-editor-content/index.js +64 -43
- package/build/components/widget-areas-block-editor-content/index.js.map +7 -1
- package/build/components/widget-areas-block-editor-provider/index.js +115 -92
- package/build/components/widget-areas-block-editor-provider/index.js.map +7 -1
- package/build/constants.js +30 -8
- package/build/constants.js.map +7 -1
- package/build/filters/index.js +3 -5
- package/build/filters/index.js.map +7 -1
- package/build/filters/move-to-widget-area.js +52 -59
- package/build/filters/move-to-widget-area.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/hooks/use-last-selected-widget-area.js +38 -44
- package/build/hooks/use-last-selected-widget-area.js.map +7 -1
- package/build/hooks/use-widget-library-insertion-point.js +60 -55
- package/build/hooks/use-widget-library-insertion-point.js.map +7 -1
- package/build/index.js +86 -93
- 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 +181 -313
- 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 +51 -51
- package/build/store/index.js.map +7 -1
- package/build/store/private-selectors.js +28 -7
- package/build/store/private-selectors.js.map +7 -1
- package/build/store/reducer.js +65 -118
- package/build/store/reducer.js.map +7 -1
- package/build/store/resolvers.js +64 -63
- package/build/store/resolvers.js.map +7 -1
- package/build/store/selectors.js +194 -231
- package/build/store/selectors.js.map +7 -1
- package/build/store/transformers.js +47 -41
- package/build/store/transformers.js.map +7 -1
- package/build/store/utils.js +47 -70
- package/build/store/utils.js.map +7 -1
- package/build-module/blocks/widget-area/block.json +26 -0
- package/build-module/blocks/widget-area/edit/index.js +63 -75
- package/build-module/blocks/widget-area/edit/index.js.map +7 -1
- package/build-module/blocks/widget-area/edit/inner-blocks.js +38 -41
- package/build-module/blocks/widget-area/edit/inner-blocks.js.map +7 -1
- package/build-module/blocks/widget-area/edit/use-is-dragging-within.js +14 -33
- package/build-module/blocks/widget-area/edit/use-is-dragging-within.js.map +7 -1
- package/build-module/blocks/widget-area/index.js +14 -46
- package/build-module/blocks/widget-area/index.js.map +7 -1
- package/build-module/components/error-boundary/index.js +30 -43
- package/build-module/components/error-boundary/index.js.map +7 -1
- package/build-module/components/header/document-tools/index.js +75 -66
- package/build-module/components/header/document-tools/index.js.map +7 -1
- package/build-module/components/header/index.js +52 -54
- package/build-module/components/header/index.js.map +7 -1
- package/build-module/components/header/undo-redo/redo.js +32 -32
- package/build-module/components/header/undo-redo/redo.js.map +7 -1
- package/build-module/components/header/undo-redo/undo.js +31 -31
- package/build-module/components/header/undo-redo/undo.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 -97
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +7 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +56 -50
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +7 -1
- package/build-module/components/keyboard-shortcuts/index.js +73 -75
- package/build-module/components/keyboard-shortcuts/index.js.map +7 -1
- package/build-module/components/layout/index.js +46 -41
- package/build-module/components/layout/index.js.map +7 -1
- package/build-module/components/layout/interface.js +63 -66
- package/build-module/components/layout/interface.js.map +7 -1
- package/build-module/components/layout/unsaved-changes-warning.js +17 -37
- package/build-module/components/layout/unsaved-changes-warning.js.map +7 -1
- package/build-module/components/more-menu/index.js +167 -102
- package/build-module/components/more-menu/index.js.map +7 -1
- package/build-module/components/more-menu/tools-more-menu-group.js +11 -17
- package/build-module/components/more-menu/tools-more-menu-group.js.map +7 -1
- package/build-module/components/notices/index.js +43 -42
- package/build-module/components/notices/index.js.map +7 -1
- package/build-module/components/save-button/index.js +37 -41
- package/build-module/components/save-button/index.js.map +7 -1
- package/build-module/components/secondary-sidebar/index.js +14 -27
- package/build-module/components/secondary-sidebar/index.js.map +7 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js +26 -38
- package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +7 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +57 -60
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +7 -1
- package/build-module/components/sidebar/index.js +129 -127
- package/build-module/components/sidebar/index.js.map +7 -1
- package/build-module/components/sidebar/widget-areas.js +53 -49
- package/build-module/components/sidebar/widget-areas.js.map +7 -1
- package/build-module/components/welcome-guide/index.js +165 -132
- package/build-module/components/welcome-guide/index.js.map +7 -1
- package/build-module/components/widget-areas-block-editor-content/index.js +43 -36
- package/build-module/components/widget-areas-block-editor-content/index.js.map +7 -1
- package/build-module/components/widget-areas-block-editor-provider/index.js +85 -83
- package/build-module/components/widget-areas-block-editor-provider/index.js.map +7 -1
- package/build-module/constants.js +7 -3
- package/build-module/constants.js.map +7 -1
- package/build-module/filters/index.js +3 -6
- package/build-module/filters/index.js.map +7 -1
- package/build-module/filters/move-to-widget-area.js +52 -57
- package/build-module/filters/move-to-widget-area.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/hooks/use-last-selected-widget-area.js +20 -39
- package/build-module/hooks/use-last-selected-widget-area.js.map +7 -1
- package/build-module/hooks/use-widget-library-insertion-point.js +42 -49
- package/build-module/hooks/use-widget-library-insertion-point.js.map +7 -1
- package/build-module/index.js +60 -72
- 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 +153 -293
- 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 +16 -40
- package/build-module/store/index.js.map +7 -1
- package/build-module/store/private-selectors.js +7 -3
- package/build-module/store/private-selectors.js.map +7 -1
- package/build-module/store/reducer.js +42 -111
- package/build-module/store/reducer.js.map +7 -1
- package/build-module/store/resolvers.js +43 -51
- package/build-module/store/resolvers.js.map +7 -1
- package/build-module/store/selectors.js +171 -224
- package/build-module/store/selectors.js.map +7 -1
- package/build-module/store/transformers.js +23 -34
- package/build-module/store/transformers.js.map +7 -1
- package/build-module/store/utils.js +22 -63
- package/build-module/store/utils.js.map +7 -1
- package/build-style/style-rtl.css +216 -88
- package/build-style/style.css +216 -88
- package/package.json +36 -29
- package/src/blocks/widget-area/editor.scss +3 -0
- package/src/components/customizer-edit-widgets-initializer/style.scss +3 -0
- package/src/components/error-boundary/style.scss +2 -0
- package/src/components/header/style.scss +5 -0
- package/src/components/keyboard-shortcut-help-modal/style.scss +2 -0
- package/src/components/layout/style.scss +3 -0
- package/src/components/more-menu/style.scss +2 -0
- package/src/components/notices/style.scss +3 -0
- package/src/components/secondary-sidebar/style.scss +4 -0
- package/src/components/sidebar/style.scss +2 -0
- package/src/components/welcome-guide/style.scss +2 -0
- package/src/components/widget-areas-block-editor-content/style.scss +2 -0
- package/src/style.scss +16 -13
|
@@ -1,49 +1,66 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
Object.
|
|
5
|
-
|
|
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 dynamic_shortcut_exports = {};
|
|
29
|
+
__export(dynamic_shortcut_exports, {
|
|
30
|
+
default: () => dynamic_shortcut_default
|
|
6
31
|
});
|
|
7
|
-
exports
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const {
|
|
29
|
-
getShortcutKeyCombination,
|
|
30
|
-
getShortcutDescription,
|
|
31
|
-
getShortcutAliases
|
|
32
|
-
} = select(_keyboardShortcuts.store);
|
|
33
|
-
return {
|
|
34
|
-
keyCombination: getShortcutKeyCombination(name),
|
|
35
|
-
aliases: getShortcutAliases(name),
|
|
36
|
-
description: getShortcutDescription(name)
|
|
37
|
-
};
|
|
38
|
-
}, [name]);
|
|
32
|
+
module.exports = __toCommonJS(dynamic_shortcut_exports);
|
|
33
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
34
|
+
var import_data = require("@wordpress/data");
|
|
35
|
+
var import_keyboard_shortcuts = require("@wordpress/keyboard-shortcuts");
|
|
36
|
+
var import_shortcut = __toESM(require("./shortcut"));
|
|
37
|
+
function DynamicShortcut({ name }) {
|
|
38
|
+
const { keyCombination, description, aliases } = (0, import_data.useSelect)(
|
|
39
|
+
(select) => {
|
|
40
|
+
const {
|
|
41
|
+
getShortcutKeyCombination,
|
|
42
|
+
getShortcutDescription,
|
|
43
|
+
getShortcutAliases
|
|
44
|
+
} = select(import_keyboard_shortcuts.store);
|
|
45
|
+
return {
|
|
46
|
+
keyCombination: getShortcutKeyCombination(name),
|
|
47
|
+
aliases: getShortcutAliases(name),
|
|
48
|
+
description: getShortcutDescription(name)
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
[name]
|
|
52
|
+
);
|
|
39
53
|
if (!keyCombination) {
|
|
40
54
|
return null;
|
|
41
55
|
}
|
|
42
|
-
return
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
56
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
57
|
+
import_shortcut.default,
|
|
58
|
+
{
|
|
59
|
+
keyCombination,
|
|
60
|
+
description,
|
|
61
|
+
aliases
|
|
62
|
+
}
|
|
63
|
+
);
|
|
47
64
|
}
|
|
48
|
-
var
|
|
49
|
-
//# sourceMappingURL=dynamic-shortcut.js.map
|
|
65
|
+
var dynamic_shortcut_default = DynamicShortcut;
|
|
66
|
+
//# sourceMappingURL=dynamic-shortcut.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\n\n/**\n * Internal dependencies\n */\nimport Shortcut from './shortcut';\n\nfunction DynamicShortcut( { name } ) {\n\tconst { keyCombination, description, aliases } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetShortcutKeyCombination,\n\t\t\t\tgetShortcutDescription,\n\t\t\t\tgetShortcutAliases,\n\t\t\t} = select( keyboardShortcutsStore );\n\n\t\t\treturn {\n\t\t\t\tkeyCombination: getShortcutKeyCombination( name ),\n\t\t\t\taliases: getShortcutAliases( name ),\n\t\t\t\tdescription: getShortcutDescription( name ),\n\t\t\t};\n\t\t},\n\t\t[ name ]\n\t);\n\n\tif ( ! keyCombination ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Shortcut\n\t\t\tkeyCombination={ keyCombination }\n\t\t\tdescription={ description }\n\t\t\taliases={ aliases }\n\t\t/>\n\t);\n}\n\nexport default DynamicShortcut;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkCE;AA/BF,kBAA0B;AAC1B,gCAAgD;AAKhD,sBAAqB;AAErB,SAAS,gBAAiB,EAAE,KAAK,GAAI;AACpC,QAAM,EAAE,gBAAgB,aAAa,QAAQ,QAAI;AAAA,IAChD,CAAE,WAAY;AACb,YAAM;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,MACD,IAAI,OAAQ,0BAAAA,KAAuB;AAEnC,aAAO;AAAA,QACN,gBAAgB,0BAA2B,IAAK;AAAA,QAChD,SAAS,mBAAoB,IAAK;AAAA,QAClC,aAAa,uBAAwB,IAAK;AAAA,MAC3C;AAAA,IACD;AAAA,IACA,CAAE,IAAK;AAAA,EACR;AAEA,MAAK,CAAE,gBAAiB;AACvB,WAAO;AAAA,EACR;AAEA,SACC;AAAA,IAAC,gBAAAC;AAAA,IAAA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,EACD;AAEF;AAEA,IAAO,2BAAQ;",
|
|
6
|
+
"names": ["keyboardShortcutsStore", "Shortcut"]
|
|
7
|
+
}
|
|
@@ -1,120 +1,171 @@
|
|
|
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
|
-
}) =>
|
|
32
|
-
/*#__PURE__*/
|
|
33
|
-
/*
|
|
34
|
-
* Disable reason: The `list` ARIA role is redundant but
|
|
35
|
-
* Safari+VoiceOver won't announce the list otherwise.
|
|
36
|
-
*/
|
|
37
|
-
/* eslint-disable jsx-a11y/no-redundant-roles */
|
|
38
|
-
(0, _jsxRuntime.jsx)("ul", {
|
|
39
|
-
className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-list",
|
|
40
|
-
role: "list",
|
|
41
|
-
children: shortcuts.map((shortcut, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
42
|
-
className: "edit-widgets-keyboard-shortcut-help-modal__shortcut",
|
|
43
|
-
children: typeof shortcut === 'string' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_dynamicShortcut.default, {
|
|
44
|
-
name: shortcut
|
|
45
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_shortcut.default, {
|
|
46
|
-
...shortcut
|
|
47
|
-
})
|
|
48
|
-
}, index))
|
|
49
|
-
})
|
|
50
|
-
/* eslint-enable jsx-a11y/no-redundant-roles */;
|
|
51
|
-
const ShortcutSection = ({
|
|
52
|
-
title,
|
|
53
|
-
shortcuts,
|
|
54
|
-
className
|
|
55
|
-
}) => /*#__PURE__*/(0, _jsxRuntime.jsxs)("section", {
|
|
56
|
-
className: (0, _clsx.default)('edit-widgets-keyboard-shortcut-help-modal__section', className),
|
|
57
|
-
children: [!!title && /*#__PURE__*/(0, _jsxRuntime.jsx)("h2", {
|
|
58
|
-
className: "edit-widgets-keyboard-shortcut-help-modal__section-title",
|
|
59
|
-
children: title
|
|
60
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(ShortcutList, {
|
|
61
|
-
shortcuts: shortcuts
|
|
62
|
-
})]
|
|
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
|
|
63
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_config = require("./config");
|
|
40
|
+
var import_shortcut = __toESM(require("./shortcut"));
|
|
41
|
+
var import_dynamic_shortcut = __toESM(require("./dynamic-shortcut"));
|
|
42
|
+
const ShortcutList = ({ shortcuts }) => (
|
|
43
|
+
/*
|
|
44
|
+
* Disable reason: The `list` ARIA role is redundant but
|
|
45
|
+
* Safari+VoiceOver won't announce the list otherwise.
|
|
46
|
+
*/
|
|
47
|
+
/* eslint-disable jsx-a11y/no-redundant-roles */
|
|
48
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
49
|
+
"ul",
|
|
50
|
+
{
|
|
51
|
+
className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-list",
|
|
52
|
+
role: "list",
|
|
53
|
+
children: shortcuts.map((shortcut, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
54
|
+
"li",
|
|
55
|
+
{
|
|
56
|
+
className: "edit-widgets-keyboard-shortcut-help-modal__shortcut",
|
|
57
|
+
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 })
|
|
58
|
+
},
|
|
59
|
+
index
|
|
60
|
+
))
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
);
|
|
64
|
+
const ShortcutSection = ({ title, shortcuts, className }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
65
|
+
"section",
|
|
66
|
+
{
|
|
67
|
+
className: (0, import_clsx.default)(
|
|
68
|
+
"edit-widgets-keyboard-shortcut-help-modal__section",
|
|
69
|
+
className
|
|
70
|
+
),
|
|
71
|
+
children: [
|
|
72
|
+
!!title && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "edit-widgets-keyboard-shortcut-help-modal__section-title", children: title }),
|
|
73
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ShortcutList, { shortcuts })
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
);
|
|
64
77
|
const ShortcutCategorySection = ({
|
|
65
78
|
title,
|
|
66
79
|
categoryName,
|
|
67
80
|
additionalShortcuts = []
|
|
68
81
|
}) => {
|
|
69
|
-
const categoryShortcuts = (0,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
82
|
+
const categoryShortcuts = (0, import_data.useSelect)(
|
|
83
|
+
(select) => {
|
|
84
|
+
return select(import_keyboard_shortcuts.store).getCategoryShortcuts(
|
|
85
|
+
categoryName
|
|
86
|
+
);
|
|
87
|
+
},
|
|
88
|
+
[categoryName]
|
|
89
|
+
);
|
|
90
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
91
|
+
ShortcutSection,
|
|
92
|
+
{
|
|
93
|
+
title,
|
|
94
|
+
shortcuts: categoryShortcuts.concat(additionalShortcuts)
|
|
95
|
+
}
|
|
96
|
+
);
|
|
76
97
|
};
|
|
77
98
|
function KeyboardShortcutHelpModal({
|
|
78
99
|
isModalActive,
|
|
79
100
|
toggleModal
|
|
80
101
|
}) {
|
|
81
|
-
(0,
|
|
102
|
+
(0, import_keyboard_shortcuts.useShortcut)("core/edit-widgets/keyboard-shortcuts", toggleModal, {
|
|
82
103
|
bindGlobal: true
|
|
83
104
|
});
|
|
84
105
|
if (!isModalActive) {
|
|
85
106
|
return null;
|
|
86
107
|
}
|
|
87
|
-
return
|
|
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
|
-
|
|
108
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
109
|
+
import_components.Modal,
|
|
110
|
+
{
|
|
111
|
+
className: "edit-widgets-keyboard-shortcut-help-modal",
|
|
112
|
+
title: (0, import_i18n.__)("Keyboard shortcuts"),
|
|
113
|
+
onRequestClose: toggleModal,
|
|
114
|
+
children: [
|
|
115
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
116
|
+
ShortcutSection,
|
|
117
|
+
{
|
|
118
|
+
className: "edit-widgets-keyboard-shortcut-help-modal__main-shortcuts",
|
|
119
|
+
shortcuts: ["core/edit-widgets/keyboard-shortcuts"]
|
|
120
|
+
}
|
|
121
|
+
),
|
|
122
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
123
|
+
ShortcutCategorySection,
|
|
124
|
+
{
|
|
125
|
+
title: (0, import_i18n.__)("Global shortcuts"),
|
|
126
|
+
categoryName: "global"
|
|
127
|
+
}
|
|
128
|
+
),
|
|
129
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
130
|
+
ShortcutCategorySection,
|
|
131
|
+
{
|
|
132
|
+
title: (0, import_i18n.__)("Selection shortcuts"),
|
|
133
|
+
categoryName: "selection"
|
|
134
|
+
}
|
|
135
|
+
),
|
|
136
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
137
|
+
ShortcutCategorySection,
|
|
138
|
+
{
|
|
139
|
+
title: (0, import_i18n.__)("Block shortcuts"),
|
|
140
|
+
categoryName: "block",
|
|
141
|
+
additionalShortcuts: [
|
|
142
|
+
{
|
|
143
|
+
keyCombination: { character: "/" },
|
|
144
|
+
description: (0, import_i18n.__)(
|
|
145
|
+
"Change the block type after adding a new paragraph."
|
|
146
|
+
),
|
|
147
|
+
/* translators: The forward-slash character. e.g. '/'. */
|
|
148
|
+
ariaLabel: (0, import_i18n.__)("Forward-slash")
|
|
149
|
+
}
|
|
150
|
+
]
|
|
151
|
+
}
|
|
152
|
+
),
|
|
153
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
154
|
+
ShortcutSection,
|
|
155
|
+
{
|
|
156
|
+
title: (0, import_i18n.__)("Text formatting"),
|
|
157
|
+
shortcuts: import_config.textFormattingShortcuts
|
|
158
|
+
}
|
|
159
|
+
),
|
|
160
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
161
|
+
ShortcutCategorySection,
|
|
162
|
+
{
|
|
163
|
+
title: (0, import_i18n.__)("List View shortcuts"),
|
|
164
|
+
categoryName: "list-view"
|
|
165
|
+
}
|
|
166
|
+
)
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
);
|
|
119
170
|
}
|
|
120
|
-
//# sourceMappingURL=index.js.map
|
|
171
|
+
//# 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 { useSelect } from '@wordpress/data';\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=\"edit-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=\"edit-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'edit-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=\"edit-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\tuseShortcut( 'core/edit-widgets/keyboard-shortcuts', toggleModal, {\n\t\tbindGlobal: true,\n\t} );\n\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"edit-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=\"edit-widgets-keyboard-shortcut-help-modal__main-shortcuts\"\n\t\t\t\tshortcuts={ [ 'core/edit-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\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'List View shortcuts' ) }\n\t\t\t\tcategoryName=\"list-view\"\n\t\t\t/>\n\t\t</Modal>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAuCK;AApCL,kBAAiB;AAKjB,wBAAsB;AACtB,kBAAmB;AACnB,gCAGO;AACP,kBAA0B;AAK1B,oBAAwC;AACxC,sBAAqB;AACrB,8BAA4B;AAE5B,MAAM,eAAe,CAAE,EAAE,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMlC;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,MAAK;AAAA,MAEH,oBAAU,IAAK,CAAE,UAAU,UAC5B;AAAA,QAAC;AAAA;AAAA,UACA,WAAU;AAAA,UAGR,iBAAO,aAAa,WACrB,4CAAC,wBAAAA,SAAA,EAAgB,MAAO,UAAW,IAEnC,4CAAC,gBAAAC,SAAA,EAAW,GAAG,UAAW;AAAA;AAAA,QALrB;AAAA,MAOP,CACC;AAAA;AAAA,EACH;AAAA;AAID,MAAM,kBAAkB,CAAE,EAAE,OAAO,WAAW,UAAU,MACvD;AAAA,EAAC;AAAA;AAAA,IACA,eAAY,YAAAC;AAAA,MACX;AAAA,MACA;AAAA,IACD;AAAA,IAEE;AAAA,OAAC,CAAE,SACJ,4CAAC,QAAG,WAAU,4DACX,iBACH;AAAA,MAED,4CAAC,gBAAa,WAAwB;AAAA;AAAA;AACvC;AAGD,MAAM,0BAA0B,CAAE;AAAA,EACjC;AAAA,EACA;AAAA,EACA,sBAAsB,CAAC;AACxB,MAAO;AACN,QAAM,wBAAoB;AAAA,IACzB,CAAE,WAAY;AACb,aAAO,OAAQ,0BAAAC,KAAuB,EAAE;AAAA,QACvC;AAAA,MACD;AAAA,IACD;AAAA,IACA,CAAE,YAAa;AAAA,EAChB;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA;AAAA,MACA,WAAY,kBAAkB,OAAQ,mBAAoB;AAAA;AAAA,EAC3D;AAEF;AAEe,SAAR,0BAA4C;AAAA,EAClD;AAAA,EACA;AACD,GAAI;AACH,6CAAa,wCAAwC,aAAa;AAAA,IACjE,YAAY;AAAA,EACb,CAAE;AAEF,MAAK,CAAE,eAAgB;AACtB,WAAO;AAAA,EACR;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,WAAQ,gBAAI,oBAAqB;AAAA,MACjC,gBAAiB;AAAA,MAEjB;AAAA;AAAA,UAAC;AAAA;AAAA,YACA,WAAU;AAAA,YACV,WAAY,CAAE,sCAAuC;AAAA;AAAA,QACtD;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACA,WAAQ,gBAAI,kBAAmB;AAAA,YAC/B,cAAa;AAAA;AAAA,QACd;AAAA,QAEA;AAAA,UAAC;AAAA;AAAA,YACA,WAAQ,gBAAI,qBAAsB;AAAA,YAClC,cAAa;AAAA;AAAA,QACd;AAAA,QAEA;AAAA,UAAC;AAAA;AAAA,YACA,WAAQ,gBAAI,iBAAkB;AAAA,YAC9B,cAAa;AAAA,YACb,qBAAsB;AAAA,cACrB;AAAA,gBACC,gBAAgB,EAAE,WAAW,IAAI;AAAA,gBACjC,iBAAa;AAAA,kBACZ;AAAA,gBACD;AAAA;AAAA,gBAEA,eAAW,gBAAI,eAAgB;AAAA,cAChC;AAAA,YACD;AAAA;AAAA,QACD;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACA,WAAQ,gBAAI,iBAAkB;AAAA,YAC9B,WAAY;AAAA;AAAA,QACb;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACA,WAAQ,gBAAI,qBAAsB;AAAA,YAClC,cAAa;AAAA;AAAA,QACd;AAAA;AAAA;AAAA,EACD;AAEF;",
|
|
6
|
+
"names": ["DynamicShortcut", "Shortcut", "clsx", "keyboardShortcutsStore"]
|
|
7
|
+
}
|
|
@@ -1,60 +1,78 @@
|
|
|
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
|
-
const shortcut = keyCombination.modifier ? _keycodes.displayShortcutList[keyCombination.modifier](keyCombination.character) : keyCombination.character;
|
|
19
|
-
const ariaLabel = keyCombination.modifier ? _keycodes.shortcutAriaLabel[keyCombination.modifier](keyCombination.character) : keyCombination.character;
|
|
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;
|
|
20
33
|
const shortcuts = Array.isArray(shortcut) ? shortcut : [shortcut];
|
|
21
|
-
return
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
35
|
+
"kbd",
|
|
36
|
+
{
|
|
37
|
+
className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-key-combination",
|
|
38
|
+
"aria-label": forceAriaLabel || ariaLabel,
|
|
39
|
+
children: shortcuts.map((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: "edit-widgets-keyboard-shortcut-help-modal__shortcut-key",
|
|
47
|
+
children: character
|
|
48
|
+
},
|
|
49
|
+
index
|
|
50
|
+
);
|
|
51
|
+
})
|
|
52
|
+
}
|
|
53
|
+
);
|
|
36
54
|
}
|
|
37
|
-
function Shortcut({
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
})
|
|
57
|
-
});
|
|
55
|
+
function Shortcut({ description, keyCombination, aliases = [], ariaLabel }) {
|
|
56
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
57
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-description", children: description }),
|
|
58
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-term", children: [
|
|
59
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
60
|
+
KeyCombination,
|
|
61
|
+
{
|
|
62
|
+
keyCombination,
|
|
63
|
+
forceAriaLabel: ariaLabel
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
aliases.map((alias, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
67
|
+
KeyCombination,
|
|
68
|
+
{
|
|
69
|
+
keyCombination: alias,
|
|
70
|
+
forceAriaLabel: ariaLabel
|
|
71
|
+
},
|
|
72
|
+
index
|
|
73
|
+
))
|
|
74
|
+
] })
|
|
75
|
+
] });
|
|
58
76
|
}
|
|
59
|
-
var
|
|
60
|
-
//# sourceMappingURL=shortcut.js.map
|
|
77
|
+
var shortcut_default = Shortcut;
|
|
78
|
+
//# 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\tconst shortcuts = Array.isArray( shortcut ) ? shortcut : [ shortcut ];\n\n\treturn (\n\t\t<kbd\n\t\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-key-combination\"\n\t\t\taria-label={ forceAriaLabel || ariaLabel }\n\t\t>\n\t\t\t{ shortcuts.map( ( character, index ) => {\n\t\t\t\tif ( character === '+' ) {\n\t\t\t\t\treturn <Fragment key={ index }>{ character }</Fragment>;\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\t<kbd\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-key\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ character }\n\t\t\t\t\t</kbd>\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=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-description\">\n\t\t\t\t{ description }\n\t\t\t</div>\n\t\t\t<div className=\"edit-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;AA0BY;AAvBZ,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;AAClB,QAAM,YAAY,MAAM,QAAS,QAAS,IAAI,WAAW,CAAE,QAAS;AAEpE,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,cAAa,kBAAkB;AAAA,MAE7B,oBAAU,IAAK,CAAE,WAAW,UAAW;AACxC,YAAK,cAAc,KAAM;AACxB,iBAAO,4CAAC,2BAAyB,uBAAV,KAAqB;AAAA,QAC7C;AAEA,eACC;AAAA,UAAC;AAAA;AAAA,YAEA,WAAU;AAAA,YAER;AAAA;AAAA,UAHI;AAAA,QAIP;AAAA,MAEF,CAAE;AAAA;AAAA,EACH;AAEF;AAEA,SAAS,SAAU,EAAE,aAAa,gBAAgB,UAAU,CAAC,GAAG,UAAU,GAAI;AAC7E,SACC,4EACC;AAAA,gDAAC,SAAI,WAAU,mEACZ,uBACH;AAAA,IACA,6CAAC,SAAI,WAAU,4DACd;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
|
+
}
|