PluginProbe
Gutenberg / trunk
Gutenberg vtrunk
24.1.0 24.0.0 23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 All 404 releases
← All changes | build/scripts/keycodes/index.js +19 -0 23.9.0 → trunk View file →
@@ -67,8 +67,9 @@
67 67 displayShortcut: () => displayShortcut,
68 68 displayShortcutList: () => displayShortcutList,
69 69 isAppleOS: () => isAppleOS,
70 70 isKeyboardEvent: () => isKeyboardEvent,
71 + keyboardShortcut: () => keyboardShortcut,
71 72 modifiers: () => modifiers,
72 73 rawShortcut: () => rawShortcut,
73 74 shortcutAriaLabel: () => shortcutAriaLabel,
74 75 withIgnoreIMEEvents: () => withIgnoreIMEEvents
@@ -217,8 +218,26 @@
217 218 (key) => capitaliseFirstCharacter(replacementKeyMap[key] ?? key)
218 219 ).join(isApple ? " " : " + ");
219 220 };
220 221 });
222 + var keyboardShortcut = /* @__PURE__ */ Object.fromEntries(
223 + Object.keys(modifiers).map(
224 + (modifier) => [
225 + modifier,
226 + (character, _isApple = isAppleOS) => ({
227 + displayShortcut: displayShortcut[modifier](
228 + character,
229 + _isApple
230 + ),
231 + ariaKeyShortcut: ariaKeyShortcut[modifier](
232 + character,
233 + _isApple
234 + ),
235 + label: shortcutAriaLabel[modifier](character, _isApple)
236 + })
237 + ]
238 + )
239 + );
221 240 function getEventModifiers(event) {
222 241 return [ALT, CTRL, COMMAND, SHIFT].filter(
223 242 (key) => event[`${key}Key`]
224 243 );