@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,75 +1,62 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
character:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
character:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
character:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
character:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
keyCombination: {
|
|
64
|
-
modifier: 'access',
|
|
65
|
-
character: '1-6'
|
|
66
|
-
},
|
|
67
|
-
description: __('Convert the current paragraph or heading to a heading of level 1 to 6.')
|
|
68
|
-
}, {
|
|
69
|
-
keyCombination: {
|
|
70
|
-
modifier: 'primaryShift',
|
|
71
|
-
character: 'SPACE'
|
|
72
|
-
},
|
|
73
|
-
description: __('Add non breaking space.')
|
|
74
|
-
}];
|
|
75
|
-
//# sourceMappingURL=config.js.map
|
|
1
|
+
import { __ } from "@wordpress/i18n";
|
|
2
|
+
const textFormattingShortcuts = [
|
|
3
|
+
{
|
|
4
|
+
keyCombination: { modifier: "primary", character: "b" },
|
|
5
|
+
description: __("Make the selected text bold.")
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
keyCombination: { modifier: "primary", character: "i" },
|
|
9
|
+
description: __("Make the selected text italic.")
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
keyCombination: { modifier: "primary", character: "k" },
|
|
13
|
+
description: __("Convert the selected text into a link.")
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
keyCombination: { modifier: "primaryShift", character: "k" },
|
|
17
|
+
description: __("Remove a link.")
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
keyCombination: { character: "[[" },
|
|
21
|
+
description: __("Insert a link to a post or page.")
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
keyCombination: { modifier: "primary", character: "u" },
|
|
25
|
+
description: __("Underline the selected text.")
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
keyCombination: { modifier: "access", character: "d" },
|
|
29
|
+
description: __("Strikethrough the selected text.")
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
keyCombination: { modifier: "access", character: "x" },
|
|
33
|
+
description: __("Make the selected text inline code.")
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
keyCombination: {
|
|
37
|
+
modifier: "access",
|
|
38
|
+
character: "0"
|
|
39
|
+
},
|
|
40
|
+
aliases: [
|
|
41
|
+
{
|
|
42
|
+
modifier: "access",
|
|
43
|
+
character: "7"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
description: __("Convert the current heading to a paragraph.")
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
keyCombination: { modifier: "access", character: "1-6" },
|
|
50
|
+
description: __(
|
|
51
|
+
"Convert the current paragraph or heading to a heading of level 1 to 6."
|
|
52
|
+
)
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
keyCombination: { modifier: "primaryShift", character: "SPACE" },
|
|
56
|
+
description: __("Add non breaking space.")
|
|
57
|
+
}
|
|
58
|
+
];
|
|
59
|
+
export {
|
|
60
|
+
textFormattingShortcuts
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/keyboard-shortcut-help-modal/config.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nexport const textFormattingShortcuts = [\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'b' },\n\t\tdescription: __( 'Make the selected text bold.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'i' },\n\t\tdescription: __( 'Make the selected text italic.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'k' },\n\t\tdescription: __( 'Convert the selected text into a link.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primaryShift', character: 'k' },\n\t\tdescription: __( 'Remove a link.' ),\n\t},\n\t{\n\t\tkeyCombination: { character: '[[' },\n\t\tdescription: __( 'Insert a link to a post or page.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'u' },\n\t\tdescription: __( 'Underline the selected text.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'access', character: 'd' },\n\t\tdescription: __( 'Strikethrough the selected text.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'access', character: 'x' },\n\t\tdescription: __( 'Make the selected text inline code.' ),\n\t},\n\t{\n\t\tkeyCombination: {\n\t\t\tmodifier: 'access',\n\t\t\tcharacter: '0',\n\t\t},\n\t\taliases: [\n\t\t\t{\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: '7',\n\t\t\t},\n\t\t],\n\t\tdescription: __( 'Convert the current heading to a paragraph.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'access', character: '1-6' },\n\t\tdescription: __(\n\t\t\t'Convert the current paragraph or heading to a heading of level 1 to 6.'\n\t\t),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primaryShift', character: 'SPACE' },\n\t\tdescription: __( 'Add non breaking space.' ),\n\t},\n];\n"],
|
|
5
|
+
"mappings": "AAGA,SAAS,UAAU;AAEZ,MAAM,0BAA0B;AAAA,EACtC;AAAA,IACC,gBAAgB,EAAE,UAAU,WAAW,WAAW,IAAI;AAAA,IACtD,aAAa,GAAI,8BAA+B;AAAA,EACjD;AAAA,EACA;AAAA,IACC,gBAAgB,EAAE,UAAU,WAAW,WAAW,IAAI;AAAA,IACtD,aAAa,GAAI,gCAAiC;AAAA,EACnD;AAAA,EACA;AAAA,IACC,gBAAgB,EAAE,UAAU,WAAW,WAAW,IAAI;AAAA,IACtD,aAAa,GAAI,wCAAyC;AAAA,EAC3D;AAAA,EACA;AAAA,IACC,gBAAgB,EAAE,UAAU,gBAAgB,WAAW,IAAI;AAAA,IAC3D,aAAa,GAAI,gBAAiB;AAAA,EACnC;AAAA,EACA;AAAA,IACC,gBAAgB,EAAE,WAAW,KAAK;AAAA,IAClC,aAAa,GAAI,kCAAmC;AAAA,EACrD;AAAA,EACA;AAAA,IACC,gBAAgB,EAAE,UAAU,WAAW,WAAW,IAAI;AAAA,IACtD,aAAa,GAAI,8BAA+B;AAAA,EACjD;AAAA,EACA;AAAA,IACC,gBAAgB,EAAE,UAAU,UAAU,WAAW,IAAI;AAAA,IACrD,aAAa,GAAI,kCAAmC;AAAA,EACrD;AAAA,EACA;AAAA,IACC,gBAAgB,EAAE,UAAU,UAAU,WAAW,IAAI;AAAA,IACrD,aAAa,GAAI,qCAAsC;AAAA,EACxD;AAAA,EACA;AAAA,IACC,gBAAgB;AAAA,MACf,UAAU;AAAA,MACV,WAAW;AAAA,IACZ;AAAA,IACA,SAAS;AAAA,MACR;AAAA,QACC,UAAU;AAAA,QACV,WAAW;AAAA,MACZ;AAAA,IACD;AAAA,IACA,aAAa,GAAI,6CAA8C;AAAA,EAChE;AAAA,EACA;AAAA,IACC,gBAAgB,EAAE,UAAU,UAAU,WAAW,MAAM;AAAA,IACvD,aAAa;AAAA,MACZ;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,gBAAgB,EAAE,UAAU,gBAAgB,WAAW,QAAQ;AAAA,IAC/D,aAAa,GAAI,yBAA0B;AAAA,EAC5C;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,41 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
getShortcutKeyCombination,
|
|
22
|
-
getShortcutDescription,
|
|
23
|
-
getShortcutAliases
|
|
24
|
-
} = select(keyboardShortcutsStore);
|
|
25
|
-
return {
|
|
26
|
-
keyCombination: getShortcutKeyCombination(name),
|
|
27
|
-
aliases: getShortcutAliases(name),
|
|
28
|
-
description: getShortcutDescription(name)
|
|
29
|
-
};
|
|
30
|
-
}, [name]);
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useSelect } from "@wordpress/data";
|
|
3
|
+
import { store as keyboardShortcutsStore } from "@wordpress/keyboard-shortcuts";
|
|
4
|
+
import Shortcut from "./shortcut";
|
|
5
|
+
function DynamicShortcut({ name }) {
|
|
6
|
+
const { keyCombination, description, aliases } = useSelect(
|
|
7
|
+
(select) => {
|
|
8
|
+
const {
|
|
9
|
+
getShortcutKeyCombination,
|
|
10
|
+
getShortcutDescription,
|
|
11
|
+
getShortcutAliases
|
|
12
|
+
} = select(keyboardShortcutsStore);
|
|
13
|
+
return {
|
|
14
|
+
keyCombination: getShortcutKeyCombination(name),
|
|
15
|
+
aliases: getShortcutAliases(name),
|
|
16
|
+
description: getShortcutDescription(name)
|
|
17
|
+
};
|
|
18
|
+
},
|
|
19
|
+
[name]
|
|
20
|
+
);
|
|
31
21
|
if (!keyCombination) {
|
|
32
22
|
return null;
|
|
33
23
|
}
|
|
34
|
-
return
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
24
|
+
return /* @__PURE__ */ jsx(
|
|
25
|
+
Shortcut,
|
|
26
|
+
{
|
|
27
|
+
keyCombination,
|
|
28
|
+
description,
|
|
29
|
+
aliases
|
|
30
|
+
}
|
|
31
|
+
);
|
|
39
32
|
}
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
var dynamic_shortcut_default = DynamicShortcut;
|
|
34
|
+
export {
|
|
35
|
+
dynamic_shortcut_default as default
|
|
36
|
+
};
|
|
37
|
+
//# 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": "AAkCE;AA/BF,SAAS,iBAAiB;AAC1B,SAAS,SAAS,8BAA8B;AAKhD,OAAO,cAAc;AAErB,SAAS,gBAAiB,EAAE,KAAK,GAAI;AACpC,QAAM,EAAE,gBAAgB,aAAa,QAAQ,IAAI;AAAA,IAChD,CAAE,WAAY;AACb,YAAM;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,MACD,IAAI,OAAQ,sBAAuB;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;AAAA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,EACD;AAEF;AAEA,IAAO,2BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,122 +1,149 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
className: clsx('customize-widgets-keyboard-shortcut-help-modal__section', className),
|
|
50
|
-
children: [!!title && /*#__PURE__*/_jsx("h2", {
|
|
51
|
-
className: "customize-widgets-keyboard-shortcut-help-modal__section-title",
|
|
52
|
-
children: title
|
|
53
|
-
}), /*#__PURE__*/_jsx(ShortcutList, {
|
|
54
|
-
shortcuts: shortcuts
|
|
55
|
-
})]
|
|
56
|
-
});
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { Modal } from "@wordpress/components";
|
|
4
|
+
import { __ } from "@wordpress/i18n";
|
|
5
|
+
import {
|
|
6
|
+
useShortcut,
|
|
7
|
+
store as keyboardShortcutsStore
|
|
8
|
+
} from "@wordpress/keyboard-shortcuts";
|
|
9
|
+
import { useDispatch, useSelect } from "@wordpress/data";
|
|
10
|
+
import { useEffect } from "@wordpress/element";
|
|
11
|
+
import { textFormattingShortcuts } from "./config";
|
|
12
|
+
import Shortcut from "./shortcut";
|
|
13
|
+
import DynamicShortcut from "./dynamic-shortcut";
|
|
14
|
+
const ShortcutList = ({ shortcuts }) => (
|
|
15
|
+
/*
|
|
16
|
+
* Disable reason: The `list` ARIA role is redundant but
|
|
17
|
+
* Safari+VoiceOver won't announce the list otherwise.
|
|
18
|
+
*/
|
|
19
|
+
/* eslint-disable jsx-a11y/no-redundant-roles */
|
|
20
|
+
/* @__PURE__ */ jsx(
|
|
21
|
+
"ul",
|
|
22
|
+
{
|
|
23
|
+
className: "customize-widgets-keyboard-shortcut-help-modal__shortcut-list",
|
|
24
|
+
role: "list",
|
|
25
|
+
children: shortcuts.map((shortcut, index) => /* @__PURE__ */ jsx(
|
|
26
|
+
"li",
|
|
27
|
+
{
|
|
28
|
+
className: "customize-widgets-keyboard-shortcut-help-modal__shortcut",
|
|
29
|
+
children: typeof shortcut === "string" ? /* @__PURE__ */ jsx(DynamicShortcut, { name: shortcut }) : /* @__PURE__ */ jsx(Shortcut, { ...shortcut })
|
|
30
|
+
},
|
|
31
|
+
index
|
|
32
|
+
))
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
);
|
|
36
|
+
const ShortcutSection = ({ title, shortcuts, className }) => /* @__PURE__ */ jsxs(
|
|
37
|
+
"section",
|
|
38
|
+
{
|
|
39
|
+
className: clsx(
|
|
40
|
+
"customize-widgets-keyboard-shortcut-help-modal__section",
|
|
41
|
+
className
|
|
42
|
+
),
|
|
43
|
+
children: [
|
|
44
|
+
!!title && /* @__PURE__ */ jsx("h2", { className: "customize-widgets-keyboard-shortcut-help-modal__section-title", children: title }),
|
|
45
|
+
/* @__PURE__ */ jsx(ShortcutList, { shortcuts })
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
);
|
|
57
49
|
const ShortcutCategorySection = ({
|
|
58
50
|
title,
|
|
59
51
|
categoryName,
|
|
60
52
|
additionalShortcuts = []
|
|
61
53
|
}) => {
|
|
62
|
-
const categoryShortcuts = useSelect(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
54
|
+
const categoryShortcuts = useSelect(
|
|
55
|
+
(select) => {
|
|
56
|
+
return select(keyboardShortcutsStore).getCategoryShortcuts(
|
|
57
|
+
categoryName
|
|
58
|
+
);
|
|
59
|
+
},
|
|
60
|
+
[categoryName]
|
|
61
|
+
);
|
|
62
|
+
return /* @__PURE__ */ jsx(
|
|
63
|
+
ShortcutSection,
|
|
64
|
+
{
|
|
65
|
+
title,
|
|
66
|
+
shortcuts: categoryShortcuts.concat(additionalShortcuts)
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
69
|
};
|
|
70
|
-
|
|
70
|
+
function KeyboardShortcutHelpModal({
|
|
71
71
|
isModalActive,
|
|
72
72
|
toggleModal
|
|
73
73
|
}) {
|
|
74
|
-
const {
|
|
75
|
-
registerShortcut
|
|
76
|
-
} = useDispatch(keyboardShortcutsStore);
|
|
74
|
+
const { registerShortcut } = useDispatch(keyboardShortcutsStore);
|
|
77
75
|
useEffect(() => {
|
|
78
76
|
registerShortcut({
|
|
79
|
-
name:
|
|
80
|
-
category:
|
|
81
|
-
description: __(
|
|
77
|
+
name: "core/customize-widgets/keyboard-shortcuts",
|
|
78
|
+
category: "main",
|
|
79
|
+
description: __("Display these keyboard shortcuts."),
|
|
82
80
|
keyCombination: {
|
|
83
|
-
modifier:
|
|
84
|
-
character:
|
|
81
|
+
modifier: "access",
|
|
82
|
+
character: "h"
|
|
85
83
|
}
|
|
86
84
|
});
|
|
87
85
|
}, [registerShortcut]);
|
|
88
|
-
useShortcut(
|
|
86
|
+
useShortcut("core/customize-widgets/keyboard-shortcuts", toggleModal);
|
|
89
87
|
if (!isModalActive) {
|
|
90
88
|
return null;
|
|
91
89
|
}
|
|
92
|
-
return
|
|
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
|
-
|
|
119
|
-
|
|
120
|
-
|
|
90
|
+
return /* @__PURE__ */ jsxs(
|
|
91
|
+
Modal,
|
|
92
|
+
{
|
|
93
|
+
className: "customize-widgets-keyboard-shortcut-help-modal",
|
|
94
|
+
title: __("Keyboard shortcuts"),
|
|
95
|
+
onRequestClose: toggleModal,
|
|
96
|
+
children: [
|
|
97
|
+
/* @__PURE__ */ jsx(
|
|
98
|
+
ShortcutSection,
|
|
99
|
+
{
|
|
100
|
+
className: "customize-widgets-keyboard-shortcut-help-modal__main-shortcuts",
|
|
101
|
+
shortcuts: ["core/customize-widgets/keyboard-shortcuts"]
|
|
102
|
+
}
|
|
103
|
+
),
|
|
104
|
+
/* @__PURE__ */ jsx(
|
|
105
|
+
ShortcutCategorySection,
|
|
106
|
+
{
|
|
107
|
+
title: __("Global shortcuts"),
|
|
108
|
+
categoryName: "global"
|
|
109
|
+
}
|
|
110
|
+
),
|
|
111
|
+
/* @__PURE__ */ jsx(
|
|
112
|
+
ShortcutCategorySection,
|
|
113
|
+
{
|
|
114
|
+
title: __("Selection shortcuts"),
|
|
115
|
+
categoryName: "selection"
|
|
116
|
+
}
|
|
117
|
+
),
|
|
118
|
+
/* @__PURE__ */ jsx(
|
|
119
|
+
ShortcutCategorySection,
|
|
120
|
+
{
|
|
121
|
+
title: __("Block shortcuts"),
|
|
122
|
+
categoryName: "block",
|
|
123
|
+
additionalShortcuts: [
|
|
124
|
+
{
|
|
125
|
+
keyCombination: { character: "/" },
|
|
126
|
+
description: __(
|
|
127
|
+
"Change the block type after adding a new paragraph."
|
|
128
|
+
),
|
|
129
|
+
/* translators: The forward-slash character. e.g. '/'. */
|
|
130
|
+
ariaLabel: __("Forward-slash")
|
|
131
|
+
}
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
),
|
|
135
|
+
/* @__PURE__ */ jsx(
|
|
136
|
+
ShortcutSection,
|
|
137
|
+
{
|
|
138
|
+
title: __("Text formatting"),
|
|
139
|
+
shortcuts: textFormattingShortcuts
|
|
140
|
+
}
|
|
141
|
+
)
|
|
142
|
+
]
|
|
143
|
+
}
|
|
144
|
+
);
|
|
121
145
|
}
|
|
122
|
-
|
|
146
|
+
export {
|
|
147
|
+
KeyboardShortcutHelpModal as default
|
|
148
|
+
};
|
|
149
|
+
//# 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": []
|
|
7
|
+
}
|