@wordpress/keycodes 4.12.1-next.082ed6819.0 → 4.13.1-next.a9f418477.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/index.js +10 -5
- package/build/index.js.map +1 -1
- package/build-module/index.js +10 -5
- package/build-module/index.js.map +1 -1
- package/build-types/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/index.js +27 -29
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
package/build/index.js
CHANGED
|
@@ -211,7 +211,8 @@ const modifiers = exports.modifiers = {
|
|
|
211
211
|
* @type {WPModifierHandler<WPKeyHandler<string>>} Keyed map of functions to raw
|
|
212
212
|
* shortcuts.
|
|
213
213
|
*/
|
|
214
|
-
const rawShortcut = exports.rawShortcut =
|
|
214
|
+
const rawShortcut = exports.rawShortcut = /* @__PURE__ */
|
|
215
|
+
mapValues(modifiers, (/** @type {WPModifier} */modifier) => {
|
|
215
216
|
return /** @type {WPKeyHandler<string>} */(character, _isApple = _platform.isAppleOS) => {
|
|
216
217
|
return [...modifier(_isApple), character.toLowerCase()].join('+');
|
|
217
218
|
};
|
|
@@ -230,7 +231,8 @@ const rawShortcut = exports.rawShortcut = mapValues(modifiers, (/** @type {WPMod
|
|
|
230
231
|
* @type {WPModifierHandler<WPKeyHandler<string[]>>} Keyed map of functions to
|
|
231
232
|
* shortcut sequences.
|
|
232
233
|
*/
|
|
233
|
-
const displayShortcutList = exports.displayShortcutList =
|
|
234
|
+
const displayShortcutList = exports.displayShortcutList = /* @__PURE__ */
|
|
235
|
+
mapValues(modifiers, (/** @type {WPModifier} */modifier) => {
|
|
234
236
|
return /** @type {WPKeyHandler<string[]>} */(character, _isApple = _platform.isAppleOS) => {
|
|
235
237
|
const isApple = _isApple();
|
|
236
238
|
const replacementKeyMap = {
|
|
@@ -266,7 +268,8 @@ const displayShortcutList = exports.displayShortcutList = mapValues(modifiers, (
|
|
|
266
268
|
* @type {WPModifierHandler<WPKeyHandler<string>>} Keyed map of functions to
|
|
267
269
|
* display shortcuts.
|
|
268
270
|
*/
|
|
269
|
-
const displayShortcut = exports.displayShortcut =
|
|
271
|
+
const displayShortcut = exports.displayShortcut = /* @__PURE__ */
|
|
272
|
+
mapValues(displayShortcutList, (/** @type {WPKeyHandler<string[]>} */shortcutList) => {
|
|
270
273
|
return /** @type {WPKeyHandler<string>} */(character, _isApple = _platform.isAppleOS) => shortcutList(character, _isApple).join('');
|
|
271
274
|
});
|
|
272
275
|
|
|
@@ -284,7 +287,8 @@ const displayShortcut = exports.displayShortcut = mapValues(displayShortcutList,
|
|
|
284
287
|
* @type {WPModifierHandler<WPKeyHandler<string>>} Keyed map of functions to
|
|
285
288
|
* shortcut ARIA labels.
|
|
286
289
|
*/
|
|
287
|
-
const shortcutAriaLabel = exports.shortcutAriaLabel =
|
|
290
|
+
const shortcutAriaLabel = exports.shortcutAriaLabel = /* @__PURE__ */
|
|
291
|
+
mapValues(modifiers, (/** @type {WPModifier} */modifier) => {
|
|
288
292
|
return /** @type {WPKeyHandler<string>} */(character, _isApple = _platform.isAppleOS) => {
|
|
289
293
|
const isApple = _isApple();
|
|
290
294
|
/** @type {Record<string,string>} */
|
|
@@ -336,7 +340,8 @@ function getEventModifiers(event) {
|
|
|
336
340
|
* @type {WPModifierHandler<WPEventKeyHandler>} Keyed map of functions
|
|
337
341
|
* to match events.
|
|
338
342
|
*/
|
|
339
|
-
const isKeyboardEvent = exports.isKeyboardEvent =
|
|
343
|
+
const isKeyboardEvent = exports.isKeyboardEvent = /* @__PURE__ */
|
|
344
|
+
mapValues(modifiers, (/** @type {WPModifier} */getModifiers) => {
|
|
340
345
|
return /** @type {WPEventKeyHandler} */(event, character, _isApple = _platform.isAppleOS) => {
|
|
341
346
|
const mods = getModifiers(_isApple);
|
|
342
347
|
const eventMods = getEventModifiers(event);
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_platform","BACKSPACE","exports","TAB","ENTER","ESCAPE","SPACE","PAGEUP","PAGEDOWN","END","HOME","LEFT","UP","RIGHT","DOWN","DELETE","F10","ALT","CTRL","COMMAND","SHIFT","ZERO","capitaliseFirstCharacter","string","length","toUpperCase","charAt","slice","mapValues","object","mapFn","Object","fromEntries","entries","map","key","value","modifiers","primary","_isApple","primaryShift","primaryAlt","secondary","access","ctrl","alt","ctrlShift","shift","shiftAlt","undefined","rawShortcut","modifier","character","isAppleOS","toLowerCase","join","displayShortcutList","isApple","replacementKeyMap","modifierKeys","reduce","accumulator","_replacementKeyMap$ke","replacementKey","displayShortcut","shortcutList","shortcutAriaLabel","__","_replacementKeyMap$ke2","getEventModifiers","event","filter","isKeyboardEvent","getModifiers","mods","eventMods","replacementWithShiftKeyMap","Comma","Backslash","IntlRo","IntlYen","modsDiff","mod","includes","eventModsDiff","altKey","String","fromCharCode","keyCode","shiftKey","code"],"sources":["@wordpress/keycodes/src/index.js"],"sourcesContent":["/**\n * Note: The order of the modifier keys in many of the [foo]Shortcut()\n * functions in this file are intentional and should not be changed. They're\n * designed to fit with the standard menu keyboard shortcuts shown in the\n * user's platform.\n *\n * For example, on MacOS menu shortcuts will place Shift before Command, but\n * on Windows Control will usually come first. So don't provide your own\n * shortcut combos directly to keyboardShortcut().\n */\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { isAppleOS } from './platform';\n\n/** @typedef {typeof ALT | CTRL | COMMAND | SHIFT } WPModifierPart */\n\n/** @typedef {'primary' | 'primaryShift' | 'primaryAlt' | 'secondary' | 'access' | 'ctrl' | 'alt' | 'ctrlShift' | 'shift' | 'shiftAlt' | 'undefined'} WPKeycodeModifier */\n\n/**\n * An object of handler functions for each of the possible modifier\n * combinations. A handler will return a value for a given key.\n *\n * @template T\n *\n * @typedef {Record<WPKeycodeModifier, T>} WPModifierHandler\n */\n\n/**\n * @template T\n *\n * @typedef {(character: string, isApple?: () => boolean) => T} WPKeyHandler\n */\n/** @typedef {(event: import('react').KeyboardEvent<HTMLElement> | KeyboardEvent, character: string, isApple?: () => boolean) => boolean} WPEventKeyHandler */\n\n/** @typedef {( isApple: () => boolean ) => WPModifierPart[]} WPModifier */\n\n/**\n * Keycode for BACKSPACE key.\n */\nexport const BACKSPACE = 8;\n\n/**\n * Keycode for TAB key.\n */\nexport const TAB = 9;\n\n/**\n * Keycode for ENTER key.\n */\nexport const ENTER = 13;\n\n/**\n * Keycode for ESCAPE key.\n */\nexport const ESCAPE = 27;\n\n/**\n * Keycode for SPACE key.\n */\nexport const SPACE = 32;\n\n/**\n * Keycode for PAGEUP key.\n */\nexport const PAGEUP = 33;\n\n/**\n * Keycode for PAGEDOWN key.\n */\nexport const PAGEDOWN = 34;\n\n/**\n * Keycode for END key.\n */\nexport const END = 35;\n\n/**\n * Keycode for HOME key.\n */\nexport const HOME = 36;\n\n/**\n * Keycode for LEFT key.\n */\nexport const LEFT = 37;\n\n/**\n * Keycode for UP key.\n */\nexport const UP = 38;\n\n/**\n * Keycode for RIGHT key.\n */\nexport const RIGHT = 39;\n\n/**\n * Keycode for DOWN key.\n */\nexport const DOWN = 40;\n\n/**\n * Keycode for DELETE key.\n */\nexport const DELETE = 46;\n\n/**\n * Keycode for F10 key.\n */\nexport const F10 = 121;\n\n/**\n * Keycode for ALT key.\n */\nexport const ALT = 'alt';\n\n/**\n * Keycode for CTRL key.\n */\nexport const CTRL = 'ctrl';\n\n/**\n * Keycode for COMMAND/META key.\n */\nexport const COMMAND = 'meta';\n\n/**\n * Keycode for SHIFT key.\n */\nexport const SHIFT = 'shift';\n\n/**\n * Keycode for ZERO key.\n */\nexport const ZERO = 48;\n\nexport { isAppleOS };\n\n/**\n * Capitalise the first character of a string.\n * @param {string} string String to capitalise.\n * @return {string} Capitalised string.\n */\nfunction capitaliseFirstCharacter( string ) {\n\treturn string.length < 2\n\t\t? string.toUpperCase()\n\t\t: string.charAt( 0 ).toUpperCase() + string.slice( 1 );\n}\n\n/**\n * Map the values of an object with a specified callback and return the result object.\n *\n * @template {{ [s: string]: any; } | ArrayLike<any>} T\n *\n * @param {T} object Object to map values of.\n * @param {( value: any ) => any} mapFn Mapping function\n *\n * @return {any} Active modifier constants.\n */\nfunction mapValues( object, mapFn ) {\n\treturn Object.fromEntries(\n\t\tObject.entries( object ).map( ( [ key, value ] ) => [\n\t\t\tkey,\n\t\t\tmapFn( value ),\n\t\t] )\n\t);\n}\n\n/**\n * Object that contains functions that return the available modifier\n * depending on platform.\n *\n * @type {WPModifierHandler< ( isApple: () => boolean ) => WPModifierPart[]>}\n */\nexport const modifiers = {\n\tprimary: ( _isApple ) => ( _isApple() ? [ COMMAND ] : [ CTRL ] ),\n\tprimaryShift: ( _isApple ) =>\n\t\t_isApple() ? [ SHIFT, COMMAND ] : [ CTRL, SHIFT ],\n\tprimaryAlt: ( _isApple ) =>\n\t\t_isApple() ? [ ALT, COMMAND ] : [ CTRL, ALT ],\n\tsecondary: ( _isApple ) =>\n\t\t_isApple() ? [ SHIFT, ALT, COMMAND ] : [ CTRL, SHIFT, ALT ],\n\taccess: ( _isApple ) => ( _isApple() ? [ CTRL, ALT ] : [ SHIFT, ALT ] ),\n\tctrl: () => [ CTRL ],\n\talt: () => [ ALT ],\n\tctrlShift: () => [ CTRL, SHIFT ],\n\tshift: () => [ SHIFT ],\n\tshiftAlt: () => [ SHIFT, ALT ],\n\tundefined: () => [],\n};\n\n/**\n * An object that contains functions to get raw shortcuts.\n *\n * These are intended for user with the KeyboardShortcuts.\n *\n * @example\n * ```js\n * // Assuming macOS:\n * rawShortcut.primary( 'm' )\n * // \"meta+m\"\"\n * ```\n *\n * @type {WPModifierHandler<WPKeyHandler<string>>} Keyed map of functions to raw\n * shortcuts.\n */\nexport const rawShortcut = mapValues(\n\tmodifiers,\n\t( /** @type {WPModifier} */ modifier ) => {\n\t\treturn /** @type {WPKeyHandler<string>} */ (\n\t\t\tcharacter,\n\t\t\t_isApple = isAppleOS\n\t\t) => {\n\t\t\treturn [ ...modifier( _isApple ), character.toLowerCase() ].join(\n\t\t\t\t'+'\n\t\t\t);\n\t\t};\n\t}\n);\n\n/**\n * Return an array of the parts of a keyboard shortcut chord for display.\n *\n * @example\n * ```js\n * // Assuming macOS:\n * displayShortcutList.primary( 'm' );\n * // [ \"⌘\", \"M\" ]\n * ```\n *\n * @type {WPModifierHandler<WPKeyHandler<string[]>>} Keyed map of functions to\n * shortcut sequences.\n */\nexport const displayShortcutList = mapValues(\n\tmodifiers,\n\t( /** @type {WPModifier} */ modifier ) => {\n\t\treturn /** @type {WPKeyHandler<string[]>} */ (\n\t\t\tcharacter,\n\t\t\t_isApple = isAppleOS\n\t\t) => {\n\t\t\tconst isApple = _isApple();\n\t\t\tconst replacementKeyMap = {\n\t\t\t\t[ ALT ]: isApple ? '⌥' : 'Alt',\n\t\t\t\t[ CTRL ]: isApple ? '⌃' : 'Ctrl', // Make sure ⌃ is the U+2303 UP ARROWHEAD unicode character and not the caret character.\n\t\t\t\t[ COMMAND ]: '⌘',\n\t\t\t\t[ SHIFT ]: isApple ? '⇧' : 'Shift',\n\t\t\t};\n\n\t\t\tconst modifierKeys = modifier( _isApple ).reduce(\n\t\t\t\t( accumulator, key ) => {\n\t\t\t\t\tconst replacementKey = replacementKeyMap[ key ] ?? key;\n\t\t\t\t\t// If on the Mac, adhere to platform convention and don't show plus between keys.\n\t\t\t\t\tif ( isApple ) {\n\t\t\t\t\t\treturn [ ...accumulator, replacementKey ];\n\t\t\t\t\t}\n\n\t\t\t\t\treturn [ ...accumulator, replacementKey, '+' ];\n\t\t\t\t},\n\t\t\t\t/** @type {string[]} */ ( [] )\n\t\t\t);\n\n\t\t\treturn [ ...modifierKeys, capitaliseFirstCharacter( character ) ];\n\t\t};\n\t}\n);\n\n/**\n * An object that contains functions to display shortcuts.\n *\n * @example\n * ```js\n * // Assuming macOS:\n * displayShortcut.primary( 'm' );\n * // \"⌘M\"\n * ```\n *\n * @type {WPModifierHandler<WPKeyHandler<string>>} Keyed map of functions to\n * display shortcuts.\n */\nexport const displayShortcut = mapValues(\n\tdisplayShortcutList,\n\t( /** @type {WPKeyHandler<string[]>} */ shortcutList ) => {\n\t\treturn /** @type {WPKeyHandler<string>} */ (\n\t\t\tcharacter,\n\t\t\t_isApple = isAppleOS\n\t\t) => shortcutList( character, _isApple ).join( '' );\n\t}\n);\n\n/**\n * An object that contains functions to return an aria label for a keyboard\n * shortcut.\n *\n * @example\n * ```js\n * // Assuming macOS:\n * shortcutAriaLabel.primary( '.' );\n * // \"Command + Period\"\n * ```\n *\n * @type {WPModifierHandler<WPKeyHandler<string>>} Keyed map of functions to\n * shortcut ARIA labels.\n */\nexport const shortcutAriaLabel = mapValues(\n\tmodifiers,\n\t( /** @type {WPModifier} */ modifier ) => {\n\t\treturn /** @type {WPKeyHandler<string>} */ (\n\t\t\tcharacter,\n\t\t\t_isApple = isAppleOS\n\t\t) => {\n\t\t\tconst isApple = _isApple();\n\t\t\t/** @type {Record<string,string>} */\n\t\t\tconst replacementKeyMap = {\n\t\t\t\t[ SHIFT ]: 'Shift',\n\t\t\t\t[ COMMAND ]: isApple ? 'Command' : 'Control',\n\t\t\t\t[ CTRL ]: 'Control',\n\t\t\t\t[ ALT ]: isApple ? 'Option' : 'Alt',\n\t\t\t\t/* translators: comma as in the character ',' */\n\t\t\t\t',': __( 'Comma' ),\n\t\t\t\t/* translators: period as in the character '.' */\n\t\t\t\t'.': __( 'Period' ),\n\t\t\t\t/* translators: backtick as in the character '`' */\n\t\t\t\t'`': __( 'Backtick' ),\n\t\t\t\t/* translators: tilde as in the character '~' */\n\t\t\t\t'~': __( 'Tilde' ),\n\t\t\t};\n\n\t\t\treturn [ ...modifier( _isApple ), character ]\n\t\t\t\t.map( ( key ) =>\n\t\t\t\t\tcapitaliseFirstCharacter( replacementKeyMap[ key ] ?? key )\n\t\t\t\t)\n\t\t\t\t.join( isApple ? ' ' : ' + ' );\n\t\t};\n\t}\n);\n\n/**\n * From a given KeyboardEvent, returns an array of active modifier constants for\n * the event.\n *\n * @param {import('react').KeyboardEvent<HTMLElement> | KeyboardEvent} event Keyboard event.\n *\n * @return {Array<WPModifierPart>} Active modifier constants.\n */\nfunction getEventModifiers( event ) {\n\treturn /** @type {WPModifierPart[]} */ ( [\n\t\tALT,\n\t\tCTRL,\n\t\tCOMMAND,\n\t\tSHIFT,\n\t] ).filter(\n\t\t( key ) =>\n\t\t\tevent[\n\t\t\t\t/** @type {'altKey' | 'ctrlKey' | 'metaKey' | 'shiftKey'} */ (\n\t\t\t\t\t`${ key }Key`\n\t\t\t\t)\n\t\t\t]\n\t);\n}\n\n/**\n * An object that contains functions to check if a keyboard event matches a\n * predefined shortcut combination.\n *\n * @example\n * ```js\n * // Assuming an event for ⌘M key press:\n * isKeyboardEvent.primary( event, 'm' );\n * // true\n * ```\n *\n * @type {WPModifierHandler<WPEventKeyHandler>} Keyed map of functions\n * to match events.\n */\nexport const isKeyboardEvent = mapValues(\n\tmodifiers,\n\t( /** @type {WPModifier} */ getModifiers ) => {\n\t\treturn /** @type {WPEventKeyHandler} */ (\n\t\t\tevent,\n\t\t\tcharacter,\n\t\t\t_isApple = isAppleOS\n\t\t) => {\n\t\t\tconst mods = getModifiers( _isApple );\n\t\t\tconst eventMods = getEventModifiers( event );\n\t\t\t/** @type {Record<string,string>} */\n\t\t\tconst replacementWithShiftKeyMap = {\n\t\t\t\tComma: ',',\n\t\t\t\tBackslash: '\\\\',\n\t\t\t\t// Windows returns `\\` for both IntlRo and IntlYen.\n\t\t\t\tIntlRo: '\\\\',\n\t\t\t\tIntlYen: '\\\\',\n\t\t\t};\n\n\t\t\tconst modsDiff = mods.filter(\n\t\t\t\t( mod ) => ! eventMods.includes( mod )\n\t\t\t);\n\t\t\tconst eventModsDiff = eventMods.filter(\n\t\t\t\t( mod ) => ! mods.includes( mod )\n\t\t\t);\n\n\t\t\tif ( modsDiff.length > 0 || eventModsDiff.length > 0 ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tlet key = event.key.toLowerCase();\n\n\t\t\tif ( ! character ) {\n\t\t\t\treturn mods.includes( /** @type {WPModifierPart} */ ( key ) );\n\t\t\t}\n\n\t\t\tif ( event.altKey && character.length === 1 ) {\n\t\t\t\tkey = String.fromCharCode( event.keyCode ).toLowerCase();\n\t\t\t}\n\n\t\t\t// `event.key` returns the value of the key pressed, taking into the state of\n\t\t\t// modifier keys such as `Shift`. If the shift key is pressed, a different\n\t\t\t// value may be returned depending on the keyboard layout. It is necessary to\n\t\t\t// convert to the physical key value that don't take into account keyboard\n\t\t\t// layout or modifier key state.\n\t\t\tif (\n\t\t\t\tevent.shiftKey &&\n\t\t\t\tcharacter.length === 1 &&\n\t\t\t\treplacementWithShiftKeyMap[ event.code ]\n\t\t\t) {\n\t\t\t\tkey = replacementWithShiftKeyMap[ event.code ];\n\t\t\t}\n\n\t\t\t// For backwards compatibility.\n\t\t\tif ( character === 'del' ) {\n\t\t\t\tcharacter = 'delete';\n\t\t\t}\n\n\t\t\treturn key === character.toLowerCase();\n\t\t};\n\t}\n);\n"],"mappings":";;;;;;;;;;;;;AAcA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,SAAA,GAAAD,OAAA;AAnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACO,MAAME,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG,CAAC;;AAE1B;AACA;AACA;AACO,MAAME,GAAG,GAAAD,OAAA,CAAAC,GAAA,GAAG,CAAC;;AAEpB;AACA;AACA;AACO,MAAMC,KAAK,GAAAF,OAAA,CAAAE,KAAA,GAAG,EAAE;;AAEvB;AACA;AACA;AACO,MAAMC,MAAM,GAAAH,OAAA,CAAAG,MAAA,GAA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AG,GAAGyC,0BAA0B,CAAEN,KAAK,CAACoB,IAAI,CAAE;IAC/C;;IAEA;IACA,IAAKtC,SAAS,KAAK,KAAK,EAAG;MAC1BA,SAAS,GAAG,QAAQ;IACrB;IAEA,OAAOjB,GAAG,KAAKiB,SAAS,CAACE,WAAW,CAAC,CAAC;EACvC,CAAC;AACF,CACD,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_platform","BACKSPACE","exports","TAB","ENTER","ESCAPE","SPACE","PAGEUP","PAGEDOWN","END","HOME","LEFT","UP","RIGHT","DOWN","DELETE","F10","ALT","CTRL","COMMAND","SHIFT","ZERO","capitaliseFirstCharacter","string","length","toUpperCase","charAt","slice","mapValues","object","mapFn","Object","fromEntries","entries","map","key","value","modifiers","primary","_isApple","primaryShift","primaryAlt","secondary","access","ctrl","alt","ctrlShift","shift","shiftAlt","undefined","rawShortcut","modifier","character","isAppleOS","toLowerCase","join","displayShortcutList","isApple","replacementKeyMap","modifierKeys","reduce","accumulator","_replacementKeyMap$ke","replacementKey","displayShortcut","shortcutList","shortcutAriaLabel","__","_replacementKeyMap$ke2","getEventModifiers","event","filter","isKeyboardEvent","getModifiers","mods","eventMods","replacementWithShiftKeyMap","Comma","Backslash","IntlRo","IntlYen","modsDiff","mod","includes","eventModsDiff","altKey","String","fromCharCode","keyCode","shiftKey","code"],"sources":["@wordpress/keycodes/src/index.js"],"sourcesContent":["/**\n * Note: The order of the modifier keys in many of the [foo]Shortcut()\n * functions in this file are intentional and should not be changed. They're\n * designed to fit with the standard menu keyboard shortcuts shown in the\n * user's platform.\n *\n * For example, on MacOS menu shortcuts will place Shift before Command, but\n * on Windows Control will usually come first. So don't provide your own\n * shortcut combos directly to keyboardShortcut().\n */\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { isAppleOS } from './platform';\n\n/** @typedef {typeof ALT | CTRL | COMMAND | SHIFT } WPModifierPart */\n\n/** @typedef {'primary' | 'primaryShift' | 'primaryAlt' | 'secondary' | 'access' | 'ctrl' | 'alt' | 'ctrlShift' | 'shift' | 'shiftAlt' | 'undefined'} WPKeycodeModifier */\n\n/**\n * An object of handler functions for each of the possible modifier\n * combinations. A handler will return a value for a given key.\n *\n * @template T\n *\n * @typedef {Record<WPKeycodeModifier, T>} WPModifierHandler\n */\n\n/**\n * @template T\n *\n * @typedef {(character: string, isApple?: () => boolean) => T} WPKeyHandler\n */\n/** @typedef {(event: import('react').KeyboardEvent<HTMLElement> | KeyboardEvent, character: string, isApple?: () => boolean) => boolean} WPEventKeyHandler */\n\n/** @typedef {( isApple: () => boolean ) => WPModifierPart[]} WPModifier */\n\n/**\n * Keycode for BACKSPACE key.\n */\nexport const BACKSPACE = 8;\n\n/**\n * Keycode for TAB key.\n */\nexport const TAB = 9;\n\n/**\n * Keycode for ENTER key.\n */\nexport const ENTER = 13;\n\n/**\n * Keycode for ESCAPE key.\n */\nexport const ESCAPE = 27;\n\n/**\n * Keycode for SPACE key.\n */\nexport const SPACE = 32;\n\n/**\n * Keycode for PAGEUP key.\n */\nexport const PAGEUP = 33;\n\n/**\n * Keycode for PAGEDOWN key.\n */\nexport const PAGEDOWN = 34;\n\n/**\n * Keycode for END key.\n */\nexport const END = 35;\n\n/**\n * Keycode for HOME key.\n */\nexport const HOME = 36;\n\n/**\n * Keycode for LEFT key.\n */\nexport const LEFT = 37;\n\n/**\n * Keycode for UP key.\n */\nexport const UP = 38;\n\n/**\n * Keycode for RIGHT key.\n */\nexport const RIGHT = 39;\n\n/**\n * Keycode for DOWN key.\n */\nexport const DOWN = 40;\n\n/**\n * Keycode for DELETE key.\n */\nexport const DELETE = 46;\n\n/**\n * Keycode for F10 key.\n */\nexport const F10 = 121;\n\n/**\n * Keycode for ALT key.\n */\nexport const ALT = 'alt';\n\n/**\n * Keycode for CTRL key.\n */\nexport const CTRL = 'ctrl';\n\n/**\n * Keycode for COMMAND/META key.\n */\nexport const COMMAND = 'meta';\n\n/**\n * Keycode for SHIFT key.\n */\nexport const SHIFT = 'shift';\n\n/**\n * Keycode for ZERO key.\n */\nexport const ZERO = 48;\n\nexport { isAppleOS };\n\n/**\n * Capitalise the first character of a string.\n * @param {string} string String to capitalise.\n * @return {string} Capitalised string.\n */\nfunction capitaliseFirstCharacter( string ) {\n\treturn string.length < 2\n\t\t? string.toUpperCase()\n\t\t: string.charAt( 0 ).toUpperCase() + string.slice( 1 );\n}\n\n/**\n * Map the values of an object with a specified callback and return the result object.\n *\n * @template {{ [s: string]: any; } | ArrayLike<any>} T\n *\n * @param {T} object Object to map values of.\n * @param {( value: any ) => any} mapFn Mapping function\n *\n * @return {any} Active modifier constants.\n */\nfunction mapValues( object, mapFn ) {\n\treturn Object.fromEntries(\n\t\tObject.entries( object ).map( ( [ key, value ] ) => [\n\t\t\tkey,\n\t\t\tmapFn( value ),\n\t\t] )\n\t);\n}\n\n/**\n * Object that contains functions that return the available modifier\n * depending on platform.\n *\n * @type {WPModifierHandler< ( isApple: () => boolean ) => WPModifierPart[]>}\n */\nexport const modifiers = {\n\tprimary: ( _isApple ) => ( _isApple() ? [ COMMAND ] : [ CTRL ] ),\n\tprimaryShift: ( _isApple ) =>\n\t\t_isApple() ? [ SHIFT, COMMAND ] : [ CTRL, SHIFT ],\n\tprimaryAlt: ( _isApple ) =>\n\t\t_isApple() ? [ ALT, COMMAND ] : [ CTRL, ALT ],\n\tsecondary: ( _isApple ) =>\n\t\t_isApple() ? [ SHIFT, ALT, COMMAND ] : [ CTRL, SHIFT, ALT ],\n\taccess: ( _isApple ) => ( _isApple() ? [ CTRL, ALT ] : [ SHIFT, ALT ] ),\n\tctrl: () => [ CTRL ],\n\talt: () => [ ALT ],\n\tctrlShift: () => [ CTRL, SHIFT ],\n\tshift: () => [ SHIFT ],\n\tshiftAlt: () => [ SHIFT, ALT ],\n\tundefined: () => [],\n};\n\n/**\n * An object that contains functions to get raw shortcuts.\n *\n * These are intended for user with the KeyboardShortcuts.\n *\n * @example\n * ```js\n * // Assuming macOS:\n * rawShortcut.primary( 'm' )\n * // \"meta+m\"\"\n * ```\n *\n * @type {WPModifierHandler<WPKeyHandler<string>>} Keyed map of functions to raw\n * shortcuts.\n */\nexport const rawShortcut =\n\t/* @__PURE__ */\n\tmapValues( modifiers, ( /** @type {WPModifier} */ modifier ) => {\n\t\treturn /** @type {WPKeyHandler<string>} */ (\n\t\t\tcharacter,\n\t\t\t_isApple = isAppleOS\n\t\t) => {\n\t\t\treturn [ ...modifier( _isApple ), character.toLowerCase() ].join(\n\t\t\t\t'+'\n\t\t\t);\n\t\t};\n\t} );\n\n/**\n * Return an array of the parts of a keyboard shortcut chord for display.\n *\n * @example\n * ```js\n * // Assuming macOS:\n * displayShortcutList.primary( 'm' );\n * // [ \"⌘\", \"M\" ]\n * ```\n *\n * @type {WPModifierHandler<WPKeyHandler<string[]>>} Keyed map of functions to\n * shortcut sequences.\n */\nexport const displayShortcutList =\n\t/* @__PURE__ */\n\tmapValues( modifiers, ( /** @type {WPModifier} */ modifier ) => {\n\t\treturn /** @type {WPKeyHandler<string[]>} */ (\n\t\t\tcharacter,\n\t\t\t_isApple = isAppleOS\n\t\t) => {\n\t\t\tconst isApple = _isApple();\n\t\t\tconst replacementKeyMap = {\n\t\t\t\t[ ALT ]: isApple ? '⌥' : 'Alt',\n\t\t\t\t[ CTRL ]: isApple ? '⌃' : 'Ctrl', // Make sure ⌃ is the U+2303 UP ARROWHEAD unicode character and not the caret character.\n\t\t\t\t[ COMMAND ]: '⌘',\n\t\t\t\t[ SHIFT ]: isApple ? '⇧' : 'Shift',\n\t\t\t};\n\n\t\t\tconst modifierKeys = modifier( _isApple ).reduce(\n\t\t\t\t( accumulator, key ) => {\n\t\t\t\t\tconst replacementKey = replacementKeyMap[ key ] ?? key;\n\t\t\t\t\t// If on the Mac, adhere to platform convention and don't show plus between keys.\n\t\t\t\t\tif ( isApple ) {\n\t\t\t\t\t\treturn [ ...accumulator, replacementKey ];\n\t\t\t\t\t}\n\n\t\t\t\t\treturn [ ...accumulator, replacementKey, '+' ];\n\t\t\t\t},\n\t\t\t\t/** @type {string[]} */ ( [] )\n\t\t\t);\n\n\t\t\treturn [ ...modifierKeys, capitaliseFirstCharacter( character ) ];\n\t\t};\n\t} );\n\n/**\n * An object that contains functions to display shortcuts.\n *\n * @example\n * ```js\n * // Assuming macOS:\n * displayShortcut.primary( 'm' );\n * // \"⌘M\"\n * ```\n *\n * @type {WPModifierHandler<WPKeyHandler<string>>} Keyed map of functions to\n * display shortcuts.\n */\nexport const displayShortcut =\n\t/* @__PURE__ */\n\tmapValues(\n\t\tdisplayShortcutList,\n\t\t( /** @type {WPKeyHandler<string[]>} */ shortcutList ) => {\n\t\t\treturn /** @type {WPKeyHandler<string>} */ (\n\t\t\t\tcharacter,\n\t\t\t\t_isApple = isAppleOS\n\t\t\t) => shortcutList( character, _isApple ).join( '' );\n\t\t}\n\t);\n\n/**\n * An object that contains functions to return an aria label for a keyboard\n * shortcut.\n *\n * @example\n * ```js\n * // Assuming macOS:\n * shortcutAriaLabel.primary( '.' );\n * // \"Command + Period\"\n * ```\n *\n * @type {WPModifierHandler<WPKeyHandler<string>>} Keyed map of functions to\n * shortcut ARIA labels.\n */\nexport const shortcutAriaLabel =\n\t/* @__PURE__ */\n\tmapValues( modifiers, ( /** @type {WPModifier} */ modifier ) => {\n\t\treturn /** @type {WPKeyHandler<string>} */ (\n\t\t\tcharacter,\n\t\t\t_isApple = isAppleOS\n\t\t) => {\n\t\t\tconst isApple = _isApple();\n\t\t\t/** @type {Record<string,string>} */\n\t\t\tconst replacementKeyMap = {\n\t\t\t\t[ SHIFT ]: 'Shift',\n\t\t\t\t[ COMMAND ]: isApple ? 'Command' : 'Control',\n\t\t\t\t[ CTRL ]: 'Control',\n\t\t\t\t[ ALT ]: isApple ? 'Option' : 'Alt',\n\t\t\t\t/* translators: comma as in the character ',' */\n\t\t\t\t',': __( 'Comma' ),\n\t\t\t\t/* translators: period as in the character '.' */\n\t\t\t\t'.': __( 'Period' ),\n\t\t\t\t/* translators: backtick as in the character '`' */\n\t\t\t\t'`': __( 'Backtick' ),\n\t\t\t\t/* translators: tilde as in the character '~' */\n\t\t\t\t'~': __( 'Tilde' ),\n\t\t\t};\n\n\t\t\treturn [ ...modifier( _isApple ), character ]\n\t\t\t\t.map( ( key ) =>\n\t\t\t\t\tcapitaliseFirstCharacter( replacementKeyMap[ key ] ?? key )\n\t\t\t\t)\n\t\t\t\t.join( isApple ? ' ' : ' + ' );\n\t\t};\n\t} );\n\n/**\n * From a given KeyboardEvent, returns an array of active modifier constants for\n * the event.\n *\n * @param {import('react').KeyboardEvent<HTMLElement> | KeyboardEvent} event Keyboard event.\n *\n * @return {Array<WPModifierPart>} Active modifier constants.\n */\nfunction getEventModifiers( event ) {\n\treturn /** @type {WPModifierPart[]} */ ( [\n\t\tALT,\n\t\tCTRL,\n\t\tCOMMAND,\n\t\tSHIFT,\n\t] ).filter(\n\t\t( key ) =>\n\t\t\tevent[\n\t\t\t\t/** @type {'altKey' | 'ctrlKey' | 'metaKey' | 'shiftKey'} */ (\n\t\t\t\t\t`${ key }Key`\n\t\t\t\t)\n\t\t\t]\n\t);\n}\n\n/**\n * An object that contains functions to check if a keyboard event matches a\n * predefined shortcut combination.\n *\n * @example\n * ```js\n * // Assuming an event for ⌘M key press:\n * isKeyboardEvent.primary( event, 'm' );\n * // true\n * ```\n *\n * @type {WPModifierHandler<WPEventKeyHandler>} Keyed map of functions\n * to match events.\n */\nexport const isKeyboardEvent =\n\t/* @__PURE__ */\n\tmapValues( modifiers, ( /** @type {WPModifier} */ getModifiers ) => {\n\t\treturn /** @type {WPEventKeyHandler} */ (\n\t\t\tevent,\n\t\t\tcharacter,\n\t\t\t_isApple = isAppleOS\n\t\t) => {\n\t\t\tconst mods = getModifiers( _isApple );\n\t\t\tconst eventMods = getEventModifiers( event );\n\t\t\t/** @type {Record<string,string>} */\n\t\t\tconst replacementWithShiftKeyMap = {\n\t\t\t\tComma: ',',\n\t\t\t\tBackslash: '\\\\',\n\t\t\t\t// Windows returns `\\` for both IntlRo and IntlYen.\n\t\t\t\tIntlRo: '\\\\',\n\t\t\t\tIntlYen: '\\\\',\n\t\t\t};\n\n\t\t\tconst modsDiff = mods.filter(\n\t\t\t\t( mod ) => ! eventMods.includes( mod )\n\t\t\t);\n\t\t\tconst eventModsDiff = eventMods.filter(\n\t\t\t\t( mod ) => ! mods.includes( mod )\n\t\t\t);\n\n\t\t\tif ( modsDiff.length > 0 || eventModsDiff.length > 0 ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tlet key = event.key.toLowerCase();\n\n\t\t\tif ( ! character ) {\n\t\t\t\treturn mods.includes( /** @type {WPModifierPart} */ ( key ) );\n\t\t\t}\n\n\t\t\tif ( event.altKey && character.length === 1 ) {\n\t\t\t\tkey = String.fromCharCode( event.keyCode ).toLowerCase();\n\t\t\t}\n\n\t\t\t// `event.key` returns the value of the key pressed, taking into the state of\n\t\t\t// modifier keys such as `Shift`. If the shift key is pressed, a different\n\t\t\t// value may be returned depending on the keyboard layout. It is necessary to\n\t\t\t// convert to the physical key value that don't take into account keyboard\n\t\t\t// layout or modifier key state.\n\t\t\tif (\n\t\t\t\tevent.shiftKey &&\n\t\t\t\tcharacter.length === 1 &&\n\t\t\t\treplacementWithShiftKeyMap[ event.code ]\n\t\t\t) {\n\t\t\t\tkey = replacementWithShiftKeyMap[ event.code ];\n\t\t\t}\n\n\t\t\t// For backwards compatibility.\n\t\t\tif ( character === 'del' ) {\n\t\t\t\tcharacter = 'delete';\n\t\t\t}\n\n\t\t\treturn key === character.toLowerCase();\n\t\t};\n\t} );\n"],"mappings":";;;;;;;;;;;;;AAcA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,SAAA,GAAAD,OAAA;AAnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;A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AAM,CAAC;IAC9D;IAEA,IAAKmC,KAAK,CAACe,MAAM,IAAIjC,SAAS,CAAC5B,MAAM,KAAK,CAAC,EAAG;MAC7CW,GAAG,GAAGmD,MAAM,CAACC,YAAY,CAAEjB,KAAK,CAACkB,OAAQ,CAAC,CAAClC,WAAW,CAAC,CAAC;IACzD;;IAEA;IACA;IACA;IACA;IACA;IACA,IACCgB,KAAK,CAACmB,QAAQ,IACdrC,SAAS,CAAC5B,MAAM,KAAK,CAAC,IACtBoD,0BAA0B,CAAEN,KAAK,CAACoB,IAAI,CAAE,EACvC;MACDvD,GAAG,GAAGyC,0BAA0B,CAAEN,KAAK,CAACoB,IAAI,CAAE;IAC/C;;IAEA;IACA,IAAKtC,SAAS,KAAK,KAAK,EAAG;MAC1BA,SAAS,GAAG,QAAQ;IACrB;IAEA,OAAOjB,GAAG,KAAKiB,SAAS,CAACE,WAAW,CAAC,CAAC;EACvC,CAAC;AACF,CAAE,CAAC","ignoreList":[]}
|
package/build-module/index.js
CHANGED
|
@@ -200,7 +200,8 @@ export const modifiers = {
|
|
|
200
200
|
* @type {WPModifierHandler<WPKeyHandler<string>>} Keyed map of functions to raw
|
|
201
201
|
* shortcuts.
|
|
202
202
|
*/
|
|
203
|
-
export const rawShortcut =
|
|
203
|
+
export const rawShortcut = /* @__PURE__ */
|
|
204
|
+
mapValues(modifiers, (/** @type {WPModifier} */modifier) => {
|
|
204
205
|
return /** @type {WPKeyHandler<string>} */(character, _isApple = isAppleOS) => {
|
|
205
206
|
return [...modifier(_isApple), character.toLowerCase()].join('+');
|
|
206
207
|
};
|
|
@@ -219,7 +220,8 @@ export const rawShortcut = mapValues(modifiers, (/** @type {WPModifier} */modifi
|
|
|
219
220
|
* @type {WPModifierHandler<WPKeyHandler<string[]>>} Keyed map of functions to
|
|
220
221
|
* shortcut sequences.
|
|
221
222
|
*/
|
|
222
|
-
export const displayShortcutList =
|
|
223
|
+
export const displayShortcutList = /* @__PURE__ */
|
|
224
|
+
mapValues(modifiers, (/** @type {WPModifier} */modifier) => {
|
|
223
225
|
return /** @type {WPKeyHandler<string[]>} */(character, _isApple = isAppleOS) => {
|
|
224
226
|
const isApple = _isApple();
|
|
225
227
|
const replacementKeyMap = {
|
|
@@ -255,7 +257,8 @@ export const displayShortcutList = mapValues(modifiers, (/** @type {WPModifier}
|
|
|
255
257
|
* @type {WPModifierHandler<WPKeyHandler<string>>} Keyed map of functions to
|
|
256
258
|
* display shortcuts.
|
|
257
259
|
*/
|
|
258
|
-
export const displayShortcut =
|
|
260
|
+
export const displayShortcut = /* @__PURE__ */
|
|
261
|
+
mapValues(displayShortcutList, (/** @type {WPKeyHandler<string[]>} */shortcutList) => {
|
|
259
262
|
return /** @type {WPKeyHandler<string>} */(character, _isApple = isAppleOS) => shortcutList(character, _isApple).join('');
|
|
260
263
|
});
|
|
261
264
|
|
|
@@ -273,7 +276,8 @@ export const displayShortcut = mapValues(displayShortcutList, (/** @type {WPKeyH
|
|
|
273
276
|
* @type {WPModifierHandler<WPKeyHandler<string>>} Keyed map of functions to
|
|
274
277
|
* shortcut ARIA labels.
|
|
275
278
|
*/
|
|
276
|
-
export const shortcutAriaLabel =
|
|
279
|
+
export const shortcutAriaLabel = /* @__PURE__ */
|
|
280
|
+
mapValues(modifiers, (/** @type {WPModifier} */modifier) => {
|
|
277
281
|
return /** @type {WPKeyHandler<string>} */(character, _isApple = isAppleOS) => {
|
|
278
282
|
const isApple = _isApple();
|
|
279
283
|
/** @type {Record<string,string>} */
|
|
@@ -325,7 +329,8 @@ function getEventModifiers(event) {
|
|
|
325
329
|
* @type {WPModifierHandler<WPEventKeyHandler>} Keyed map of functions
|
|
326
330
|
* to match events.
|
|
327
331
|
*/
|
|
328
|
-
export const isKeyboardEvent =
|
|
332
|
+
export const isKeyboardEvent = /* @__PURE__ */
|
|
333
|
+
mapValues(modifiers, (/** @type {WPModifier} */getModifiers) => {
|
|
329
334
|
return /** @type {WPEventKeyHandler} */(event, character, _isApple = isAppleOS) => {
|
|
330
335
|
const mods = getModifiers(_isApple);
|
|
331
336
|
const eventMods = getEventModifiers(event);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","isAppleOS","BACKSPACE","TAB","ENTER","ESCAPE","SPACE","PAGEUP","PAGEDOWN","END","HOME","LEFT","UP","RIGHT","DOWN","DELETE","F10","ALT","CTRL","COMMAND","SHIFT","ZERO","capitaliseFirstCharacter","string","length","toUpperCase","charAt","slice","mapValues","object","mapFn","Object","fromEntries","entries","map","key","value","modifiers","primary","_isApple","primaryShift","primaryAlt","secondary","access","ctrl","alt","ctrlShift","shift","shiftAlt","undefined","rawShortcut","modifier","character","toLowerCase","join","displayShortcutList","isApple","replacementKeyMap","modifierKeys","reduce","accumulator","_replacementKeyMap$ke","replacementKey","displayShortcut","shortcutList","shortcutAriaLabel","_replacementKeyMap$ke2","getEventModifiers","event","filter","isKeyboardEvent","getModifiers","mods","eventMods","replacementWithShiftKeyMap","Comma","Backslash","IntlRo","IntlYen","modsDiff","mod","includes","eventModsDiff","altKey","String","fromCharCode","keyCode","shiftKey","code"],"sources":["@wordpress/keycodes/src/index.js"],"sourcesContent":["/**\n * Note: The order of the modifier keys in many of the [foo]Shortcut()\n * functions in this file are intentional and should not be changed. They're\n * designed to fit with the standard menu keyboard shortcuts shown in the\n * user's platform.\n *\n * For example, on MacOS menu shortcuts will place Shift before Command, but\n * on Windows Control will usually come first. So don't provide your own\n * shortcut combos directly to keyboardShortcut().\n */\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { isAppleOS } from './platform';\n\n/** @typedef {typeof ALT | CTRL | COMMAND | SHIFT } WPModifierPart */\n\n/** @typedef {'primary' | 'primaryShift' | 'primaryAlt' | 'secondary' | 'access' | 'ctrl' | 'alt' | 'ctrlShift' | 'shift' | 'shiftAlt' | 'undefined'} WPKeycodeModifier */\n\n/**\n * An object of handler functions for each of the possible modifier\n * combinations. A handler will return a value for a given key.\n *\n * @template T\n *\n * @typedef {Record<WPKeycodeModifier, T>} WPModifierHandler\n */\n\n/**\n * @template T\n *\n * @typedef {(character: string, isApple?: () => boolean) => T} WPKeyHandler\n */\n/** @typedef {(event: import('react').KeyboardEvent<HTMLElement> | KeyboardEvent, character: string, isApple?: () => boolean) => boolean} WPEventKeyHandler */\n\n/** @typedef {( isApple: () => boolean ) => WPModifierPart[]} WPModifier */\n\n/**\n * Keycode for BACKSPACE key.\n */\nexport const BACKSPACE = 8;\n\n/**\n * Keycode for TAB key.\n */\nexport const TAB = 9;\n\n/**\n * Keycode for ENTER key.\n */\nexport const ENTER = 13;\n\n/**\n * Keycode for ESCAPE key.\n */\nexport const ESCAPE = 27;\n\n/**\n * Keycode for SPACE key.\n */\nexport const SPACE = 32;\n\n/**\n * Keycode for PAGEUP key.\n */\nexport const PAGEUP = 33;\n\n/**\n * Keycode for PAGEDOWN key.\n */\nexport const PAGEDOWN = 34;\n\n/**\n * Keycode for END key.\n */\nexport const END = 35;\n\n/**\n * Keycode for HOME key.\n */\nexport const HOME = 36;\n\n/**\n * Keycode for LEFT key.\n */\nexport const LEFT = 37;\n\n/**\n * Keycode for UP key.\n */\nexport const UP = 38;\n\n/**\n * Keycode for RIGHT key.\n */\nexport const RIGHT = 39;\n\n/**\n * Keycode for DOWN key.\n */\nexport const DOWN = 40;\n\n/**\n * Keycode for DELETE key.\n */\nexport const DELETE = 46;\n\n/**\n * Keycode for F10 key.\n */\nexport const F10 = 121;\n\n/**\n * Keycode for ALT key.\n */\nexport const ALT = 'alt';\n\n/**\n * Keycode for CTRL key.\n */\nexport const CTRL = 'ctrl';\n\n/**\n * Keycode for COMMAND/META key.\n */\nexport const COMMAND = 'meta';\n\n/**\n * Keycode for SHIFT key.\n */\nexport const SHIFT = 'shift';\n\n/**\n * Keycode for ZERO key.\n */\nexport const ZERO = 48;\n\nexport { isAppleOS };\n\n/**\n * Capitalise the first character of a string.\n * @param {string} string String to capitalise.\n * @return {string} Capitalised string.\n */\nfunction capitaliseFirstCharacter( string ) {\n\treturn string.length < 2\n\t\t? string.toUpperCase()\n\t\t: string.charAt( 0 ).toUpperCase() + string.slice( 1 );\n}\n\n/**\n * Map the values of an object with a specified callback and return the result object.\n *\n * @template {{ [s: string]: any; } | ArrayLike<any>} T\n *\n * @param {T} object Object to map values of.\n * @param {( value: any ) => any} mapFn Mapping function\n *\n * @return {any} Active modifier constants.\n */\nfunction mapValues( object, mapFn ) {\n\treturn Object.fromEntries(\n\t\tObject.entries( object ).map( ( [ key, value ] ) => [\n\t\t\tkey,\n\t\t\tmapFn( value ),\n\t\t] )\n\t);\n}\n\n/**\n * Object that contains functions that return the available modifier\n * depending on platform.\n *\n * @type {WPModifierHandler< ( isApple: () => boolean ) => WPModifierPart[]>}\n */\nexport const modifiers = {\n\tprimary: ( _isApple ) => ( _isApple() ? [ COMMAND ] : [ CTRL ] ),\n\tprimaryShift: ( _isApple ) =>\n\t\t_isApple() ? [ SHIFT, COMMAND ] : [ CTRL, SHIFT ],\n\tprimaryAlt: ( _isApple ) =>\n\t\t_isApple() ? [ ALT, COMMAND ] : [ CTRL, ALT ],\n\tsecondary: ( _isApple ) =>\n\t\t_isApple() ? [ SHIFT, ALT, COMMAND ] : [ CTRL, SHIFT, ALT ],\n\taccess: ( _isApple ) => ( _isApple() ? [ CTRL, ALT ] : [ SHIFT, ALT ] ),\n\tctrl: () => [ CTRL ],\n\talt: () => [ ALT ],\n\tctrlShift: () => [ CTRL, SHIFT ],\n\tshift: () => [ SHIFT ],\n\tshiftAlt: () => [ SHIFT, ALT ],\n\tundefined: () => [],\n};\n\n/**\n * An object that contains functions to get raw shortcuts.\n *\n * These are intended for user with the KeyboardShortcuts.\n *\n * @example\n * ```js\n * // Assuming macOS:\n * rawShortcut.primary( 'm' )\n * // \"meta+m\"\"\n * ```\n *\n * @type {WPModifierHandler<WPKeyHandler<string>>} Keyed map of functions to raw\n * shortcuts.\n */\nexport const rawShortcut = mapValues(\n\tmodifiers,\n\t( /** @type {WPModifier} */ modifier ) => {\n\t\treturn /** @type {WPKeyHandler<string>} */ (\n\t\t\tcharacter,\n\t\t\t_isApple = isAppleOS\n\t\t) => {\n\t\t\treturn [ ...modifier( _isApple ), character.toLowerCase() ].join(\n\t\t\t\t'+'\n\t\t\t);\n\t\t};\n\t}\n);\n\n/**\n * Return an array of the parts of a keyboard shortcut chord for display.\n *\n * @example\n * ```js\n * // Assuming macOS:\n * displayShortcutList.primary( 'm' );\n * // [ \"⌘\", \"M\" ]\n * ```\n *\n * @type {WPModifierHandler<WPKeyHandler<string[]>>} Keyed map of functions to\n * shortcut sequences.\n */\nexport const displayShortcutList = mapValues(\n\tmodifiers,\n\t( /** @type {WPModifier} */ modifier ) => {\n\t\treturn /** @type {WPKeyHandler<string[]>} */ (\n\t\t\tcharacter,\n\t\t\t_isApple = isAppleOS\n\t\t) => {\n\t\t\tconst isApple = _isApple();\n\t\t\tconst replacementKeyMap = {\n\t\t\t\t[ ALT ]: isApple ? '⌥' : 'Alt',\n\t\t\t\t[ CTRL ]: isApple ? '⌃' : 'Ctrl', // Make sure ⌃ is the U+2303 UP ARROWHEAD unicode character and not the caret character.\n\t\t\t\t[ COMMAND ]: '⌘',\n\t\t\t\t[ SHIFT ]: isApple ? '⇧' : 'Shift',\n\t\t\t};\n\n\t\t\tconst modifierKeys = modifier( _isApple ).reduce(\n\t\t\t\t( accumulator, key ) => {\n\t\t\t\t\tconst replacementKey = replacementKeyMap[ key ] ?? key;\n\t\t\t\t\t// If on the Mac, adhere to platform convention and don't show plus between keys.\n\t\t\t\t\tif ( isApple ) {\n\t\t\t\t\t\treturn [ ...accumulator, replacementKey ];\n\t\t\t\t\t}\n\n\t\t\t\t\treturn [ ...accumulator, replacementKey, '+' ];\n\t\t\t\t},\n\t\t\t\t/** @type {string[]} */ ( [] )\n\t\t\t);\n\n\t\t\treturn [ ...modifierKeys, capitaliseFirstCharacter( character ) ];\n\t\t};\n\t}\n);\n\n/**\n * An object that contains functions to display shortcuts.\n *\n * @example\n * ```js\n * // Assuming macOS:\n * displayShortcut.primary( 'm' );\n * // \"⌘M\"\n * ```\n *\n * @type {WPModifierHandler<WPKeyHandler<string>>} Keyed map of functions to\n * display shortcuts.\n */\nexport const displayShortcut = mapValues(\n\tdisplayShortcutList,\n\t( /** @type {WPKeyHandler<string[]>} */ shortcutList ) => {\n\t\treturn /** @type {WPKeyHandler<string>} */ (\n\t\t\tcharacter,\n\t\t\t_isApple = isAppleOS\n\t\t) => shortcutList( character, _isApple ).join( '' );\n\t}\n);\n\n/**\n * An object that contains functions to return an aria label for a keyboard\n * shortcut.\n *\n * @example\n * ```js\n * // Assuming macOS:\n * shortcutAriaLabel.primary( '.' );\n * // \"Command + Period\"\n * ```\n *\n * @type {WPModifierHandler<WPKeyHandler<string>>} Keyed map of functions to\n * shortcut ARIA labels.\n */\nexport const shortcutAriaLabel = mapValues(\n\tmodifiers,\n\t( /** @type {WPModifier} */ modifier ) => {\n\t\treturn /** @type {WPKeyHandler<string>} */ (\n\t\t\tcharacter,\n\t\t\t_isApple = isAppleOS\n\t\t) => {\n\t\t\tconst isApple = _isApple();\n\t\t\t/** @type {Record<string,string>} */\n\t\t\tconst replacementKeyMap = {\n\t\t\t\t[ SHIFT ]: 'Shift',\n\t\t\t\t[ COMMAND ]: isApple ? 'Command' : 'Control',\n\t\t\t\t[ CTRL ]: 'Control',\n\t\t\t\t[ ALT ]: isApple ? 'Option' : 'Alt',\n\t\t\t\t/* translators: comma as in the character ',' */\n\t\t\t\t',': __( 'Comma' ),\n\t\t\t\t/* translators: period as in the character '.' */\n\t\t\t\t'.': __( 'Period' ),\n\t\t\t\t/* translators: backtick as in the character '`' */\n\t\t\t\t'`': __( 'Backtick' ),\n\t\t\t\t/* translators: tilde as in the character '~' */\n\t\t\t\t'~': __( 'Tilde' ),\n\t\t\t};\n\n\t\t\treturn [ ...modifier( _isApple ), character ]\n\t\t\t\t.map( ( key ) =>\n\t\t\t\t\tcapitaliseFirstCharacter( replacementKeyMap[ key ] ?? key )\n\t\t\t\t)\n\t\t\t\t.join( isApple ? ' ' : ' + ' );\n\t\t};\n\t}\n);\n\n/**\n * From a given KeyboardEvent, returns an array of active modifier constants for\n * the event.\n *\n * @param {import('react').KeyboardEvent<HTMLElement> | KeyboardEvent} event Keyboard event.\n *\n * @return {Array<WPModifierPart>} Active modifier constants.\n */\nfunction getEventModifiers( event ) {\n\treturn /** @type {WPModifierPart[]} */ ( [\n\t\tALT,\n\t\tCTRL,\n\t\tCOMMAND,\n\t\tSHIFT,\n\t] ).filter(\n\t\t( key ) =>\n\t\t\tevent[\n\t\t\t\t/** @type {'altKey' | 'ctrlKey' | 'metaKey' | 'shiftKey'} */ (\n\t\t\t\t\t`${ key }Key`\n\t\t\t\t)\n\t\t\t]\n\t);\n}\n\n/**\n * An object that contains functions to check if a keyboard event matches a\n * predefined shortcut combination.\n *\n * @example\n * ```js\n * // Assuming an event for ⌘M key press:\n * isKeyboardEvent.primary( event, 'm' );\n * // true\n * ```\n *\n * @type {WPModifierHandler<WPEventKeyHandler>} Keyed map of functions\n * to match events.\n */\nexport const isKeyboardEvent = mapValues(\n\tmodifiers,\n\t( /** @type {WPModifier} */ getModifiers ) => {\n\t\treturn /** @type {WPEventKeyHandler} */ (\n\t\t\tevent,\n\t\t\tcharacter,\n\t\t\t_isApple = isAppleOS\n\t\t) => {\n\t\t\tconst mods = getModifiers( _isApple );\n\t\t\tconst eventMods = getEventModifiers( event );\n\t\t\t/** @type {Record<string,string>} */\n\t\t\tconst replacementWithShiftKeyMap = {\n\t\t\t\tComma: ',',\n\t\t\t\tBackslash: '\\\\',\n\t\t\t\t// Windows returns `\\` for both IntlRo and IntlYen.\n\t\t\t\tIntlRo: '\\\\',\n\t\t\t\tIntlYen: '\\\\',\n\t\t\t};\n\n\t\t\tconst modsDiff = mods.filter(\n\t\t\t\t( mod ) => ! eventMods.includes( mod )\n\t\t\t);\n\t\t\tconst eventModsDiff = eventMods.filter(\n\t\t\t\t( mod ) => ! mods.includes( mod )\n\t\t\t);\n\n\t\t\tif ( modsDiff.length > 0 || eventModsDiff.length > 0 ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tlet key = event.key.toLowerCase();\n\n\t\t\tif ( ! character ) {\n\t\t\t\treturn mods.includes( /** @type {WPModifierPart} */ ( key ) );\n\t\t\t}\n\n\t\t\tif ( event.altKey && character.length === 1 ) {\n\t\t\t\tkey = String.fromCharCode( event.keyCode ).toLowerCase();\n\t\t\t}\n\n\t\t\t// `event.key` returns the value of the key pressed, taking into the state of\n\t\t\t// modifier keys such as `Shift`. If the shift key is pressed, a different\n\t\t\t// value may be returned depending on the keyboard layout. It is necessary to\n\t\t\t// convert to the physical key value that don't take into account keyboard\n\t\t\t// layout or modifier key state.\n\t\t\tif (\n\t\t\t\tevent.shiftKey &&\n\t\t\t\tcharacter.length === 1 &&\n\t\t\t\treplacementWithShiftKeyMap[ event.code ]\n\t\t\t) {\n\t\t\t\tkey = replacementWithShiftKeyMap[ event.code ];\n\t\t\t}\n\n\t\t\t// For backwards compatibility.\n\t\t\tif ( character === 'del' ) {\n\t\t\t\tcharacter = 'delete';\n\t\t\t}\n\n\t\t\treturn key === character.toLowerCase();\n\t\t};\n\t}\n);\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,SAASC,SAAS,QAAQ,YAAY;;AAEtC;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,OAAO,MAAMC,SAAS,GAAG,CAAC;;AAE1B;AACA;AACA;AACA,OAAO,MAAMC,GAAG,GAAG,CAAC;;AAEpB;AACA;AACA;AACA,OAAO,MAAMC,KAAK,GAAG,EAAE;;AAEvB;AACA;AACA;AACA,OAAO,MAAMC,MAAM,GAAG,EAAE;;AAExB;AACA;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,GAAGT,SAAS,CAACJ,MAAM,CACnCW,GAAG,IAAM,CAAER,IAAI,CAACS,QAAQ,CAAED,GAAI,CACjC,CAAC;IAED,IAAKD,QAAQ,CAACvD,MAAM,GAAG,CAAC,IAAI0D,aAAa,CAAC1D,MAAM,GAAG,CAAC,EAAG;MACtD,OAAO,KAAK;IACb;IAEA,IAAIW,GAAG,GAAGiC,KAAK,CAACjC,GAAG,CAACkB,WAAW,CAAC,CAAC;IAEjC,IAAK,CAAED,SAAS,EAAG;MAClB,OAAOoB,IAAI,CAACS,QAAQ,CAAE,6BAAgC9C,GAAM,CAAC;IAC9D;IAEA,IAAKiC,KAAK,CAACe,MAAM,IAAI/B,SAAS,CAAC5B,MAAM,KAAK,CAAC,EAAG;MAC7CW,GAAG,GAAGiD,MAAM,CAACC,YAAY,CAAEjB,KAAK,CAACkB,OAAQ,CAAC,CAACjC,WAAW,CAAC,CAAC;IACzD;;IAEA;IACA;IACA;IACA;IACA;IACA,IACCe,KAAK,CAACmB,QAAQ,IACdnC,SAAS,CAAC5B,MAAM,KAAK,CAAC,IACtBkD,0BAA0B,CAAEN,KAAK,CAACoB,IAAI,CAAE,EACvC;MACDrD,GAAG,GAAGuC,0BAA0B,CAAEN,KAAK,CAACoB,IAAI,CAAE;IAC/C;;IAEA;IACA,IAAKpC,SAAS,KAAK,KAAK,EAAG;MAC1BA,SAAS,GAAG,QAAQ;IACrB;IAEA,OAAOjB,GAAG,KAAKiB,SAAS,CAACC,WAAW,CAAC,CAAC;EACvC,CAAC;AACF,CACD,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["__","isAppleOS","BACKSPACE","TAB","ENTER","ESCAPE","SPACE","PAGEUP","PAGEDOWN","END","HOME","LEFT","UP","RIGHT","DOWN","DELETE","F10","ALT","CTRL","COMMAND","SHIFT","ZERO","capitaliseFirstCharacter","string","length","toUpperCase","charAt","slice","mapValues","object","mapFn","Object","fromEntries","entries","map","key","value","modifiers","primary","_isApple","primaryShift","primaryAlt","secondary","access","ctrl","alt","ctrlShift","shift","shiftAlt","undefined","rawShortcut","modifier","character","toLowerCase","join","displayShortcutList","isApple","replacementKeyMap","modifierKeys","reduce","accumulator","_replacementKeyMap$ke","replacementKey","displayShortcut","shortcutList","shortcutAriaLabel","_replacementKeyMap$ke2","getEventModifiers","event","filter","isKeyboardEvent","getModifiers","mods","eventMods","replacementWithShiftKeyMap","Comma","Backslash","IntlRo","IntlYen","modsDiff","mod","includes","eventModsDiff","altKey","String","fromCharCode","keyCode","shiftKey","code"],"sources":["@wordpress/keycodes/src/index.js"],"sourcesContent":["/**\n * Note: The order of the modifier keys in many of the [foo]Shortcut()\n * functions in this file are intentional and should not be changed. They're\n * designed to fit with the standard menu keyboard shortcuts shown in the\n * user's platform.\n *\n * For example, on MacOS menu shortcuts will place Shift before Command, but\n * on Windows Control will usually come first. So don't provide your own\n * shortcut combos directly to keyboardShortcut().\n */\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { isAppleOS } from './platform';\n\n/** @typedef {typeof ALT | CTRL | COMMAND | SHIFT } WPModifierPart */\n\n/** @typedef {'primary' | 'primaryShift' | 'primaryAlt' | 'secondary' | 'access' | 'ctrl' | 'alt' | 'ctrlShift' | 'shift' | 'shiftAlt' | 'undefined'} WPKeycodeModifier */\n\n/**\n * An object of handler functions for each of the possible modifier\n * combinations. A handler will return a value for a given key.\n *\n * @template T\n *\n * @typedef {Record<WPKeycodeModifier, T>} WPModifierHandler\n */\n\n/**\n * @template T\n *\n * @typedef {(character: string, isApple?: () => boolean) => T} WPKeyHandler\n */\n/** @typedef {(event: import('react').KeyboardEvent<HTMLElement> | KeyboardEvent, character: string, isApple?: () => boolean) => boolean} WPEventKeyHandler */\n\n/** @typedef {( isApple: () => boolean ) => WPModifierPart[]} WPModifier */\n\n/**\n * Keycode for BACKSPACE key.\n */\nexport const BACKSPACE = 8;\n\n/**\n * Keycode for TAB key.\n */\nexport const TAB = 9;\n\n/**\n * Keycode for ENTER key.\n */\nexport const ENTER = 13;\n\n/**\n * Keycode for ESCAPE key.\n */\nexport const ESCAPE = 27;\n\n/**\n * Keycode for SPACE key.\n */\nexport const SPACE = 32;\n\n/**\n * Keycode for PAGEUP key.\n */\nexport const PAGEUP = 33;\n\n/**\n * Keycode for PAGEDOWN key.\n */\nexport const PAGEDOWN = 34;\n\n/**\n * Keycode for END key.\n */\nexport const END = 35;\n\n/**\n * Keycode for HOME key.\n */\nexport const HOME = 36;\n\n/**\n * Keycode for LEFT key.\n */\nexport const LEFT = 37;\n\n/**\n * Keycode for UP key.\n */\nexport const UP = 38;\n\n/**\n * Keycode for RIGHT key.\n */\nexport const RIGHT = 39;\n\n/**\n * Keycode for DOWN key.\n */\nexport const DOWN = 40;\n\n/**\n * Keycode for DELETE key.\n */\nexport const DELETE = 46;\n\n/**\n * Keycode for F10 key.\n */\nexport const F10 = 121;\n\n/**\n * Keycode for ALT key.\n */\nexport const ALT = 'alt';\n\n/**\n * Keycode for CTRL key.\n */\nexport const CTRL = 'ctrl';\n\n/**\n * Keycode for COMMAND/META key.\n */\nexport const COMMAND = 'meta';\n\n/**\n * Keycode for SHIFT key.\n */\nexport const SHIFT = 'shift';\n\n/**\n * Keycode for ZERO key.\n */\nexport const ZERO = 48;\n\nexport { isAppleOS };\n\n/**\n * Capitalise the first character of a string.\n * @param {string} string String to capitalise.\n * @return {string} Capitalised string.\n */\nfunction capitaliseFirstCharacter( string ) {\n\treturn string.length < 2\n\t\t? string.toUpperCase()\n\t\t: string.charAt( 0 ).toUpperCase() + string.slice( 1 );\n}\n\n/**\n * Map the values of an object with a specified callback and return the result object.\n *\n * @template {{ [s: string]: any; } | ArrayLike<any>} T\n *\n * @param {T} object Object to map values of.\n * @param {( value: any ) => any} mapFn Mapping function\n *\n * @return {any} Active modifier constants.\n */\nfunction mapValues( object, mapFn ) {\n\treturn Object.fromEntries(\n\t\tObject.entries( object ).map( ( [ key, value ] ) => [\n\t\t\tkey,\n\t\t\tmapFn( value ),\n\t\t] )\n\t);\n}\n\n/**\n * Object that contains functions that return the available modifier\n * depending on platform.\n *\n * @type {WPModifierHandler< ( isApple: () => boolean ) => WPModifierPart[]>}\n */\nexport const modifiers = {\n\tprimary: ( _isApple ) => ( _isApple() ? [ COMMAND ] : [ CTRL ] ),\n\tprimaryShift: ( _isApple ) =>\n\t\t_isApple() ? [ SHIFT, COMMAND ] : [ CTRL, SHIFT ],\n\tprimaryAlt: ( _isApple ) =>\n\t\t_isApple() ? [ ALT, COMMAND ] : [ CTRL, ALT ],\n\tsecondary: ( _isApple ) =>\n\t\t_isApple() ? [ SHIFT, ALT, COMMAND ] : [ CTRL, SHIFT, ALT ],\n\taccess: ( _isApple ) => ( _isApple() ? [ CTRL, ALT ] : [ SHIFT, ALT ] ),\n\tctrl: () => [ CTRL ],\n\talt: () => [ ALT ],\n\tctrlShift: () => [ CTRL, SHIFT ],\n\tshift: () => [ SHIFT ],\n\tshiftAlt: () => [ SHIFT, ALT ],\n\tundefined: () => [],\n};\n\n/**\n * An object that contains functions to get raw shortcuts.\n *\n * These are intended for user with the KeyboardShortcuts.\n *\n * @example\n * ```js\n * // Assuming macOS:\n * rawShortcut.primary( 'm' )\n * // \"meta+m\"\"\n * ```\n *\n * @type {WPModifierHandler<WPKeyHandler<string>>} Keyed map of functions to raw\n * shortcuts.\n */\nexport const rawShortcut =\n\t/* @__PURE__ */\n\tmapValues( modifiers, ( /** @type {WPModifier} */ modifier ) => {\n\t\treturn /** @type {WPKeyHandler<string>} */ (\n\t\t\tcharacter,\n\t\t\t_isApple = isAppleOS\n\t\t) => {\n\t\t\treturn [ ...modifier( _isApple ), character.toLowerCase() ].join(\n\t\t\t\t'+'\n\t\t\t);\n\t\t};\n\t} );\n\n/**\n * Return an array of the parts of a keyboard shortcut chord for display.\n *\n * @example\n * ```js\n * // Assuming macOS:\n * displayShortcutList.primary( 'm' );\n * // [ \"⌘\", \"M\" ]\n * ```\n *\n * @type {WPModifierHandler<WPKeyHandler<string[]>>} Keyed map of functions to\n * shortcut sequences.\n */\nexport const displayShortcutList =\n\t/* @__PURE__ */\n\tmapValues( modifiers, ( /** @type {WPModifier} */ modifier ) => {\n\t\treturn /** @type {WPKeyHandler<string[]>} */ (\n\t\t\tcharacter,\n\t\t\t_isApple = isAppleOS\n\t\t) => {\n\t\t\tconst isApple = _isApple();\n\t\t\tconst replacementKeyMap = {\n\t\t\t\t[ ALT ]: isApple ? '⌥' : 'Alt',\n\t\t\t\t[ CTRL ]: isApple ? '⌃' : 'Ctrl', // Make sure ⌃ is the U+2303 UP ARROWHEAD unicode character and not the caret character.\n\t\t\t\t[ COMMAND ]: '⌘',\n\t\t\t\t[ SHIFT ]: isApple ? '⇧' : 'Shift',\n\t\t\t};\n\n\t\t\tconst modifierKeys = modifier( _isApple ).reduce(\n\t\t\t\t( accumulator, key ) => {\n\t\t\t\t\tconst replacementKey = replacementKeyMap[ key ] ?? key;\n\t\t\t\t\t// If on the Mac, adhere to platform convention and don't show plus between keys.\n\t\t\t\t\tif ( isApple ) {\n\t\t\t\t\t\treturn [ ...accumulator, replacementKey ];\n\t\t\t\t\t}\n\n\t\t\t\t\treturn [ ...accumulator, replacementKey, '+' ];\n\t\t\t\t},\n\t\t\t\t/** @type {string[]} */ ( [] )\n\t\t\t);\n\n\t\t\treturn [ ...modifierKeys, capitaliseFirstCharacter( character ) ];\n\t\t};\n\t} );\n\n/**\n * An object that contains functions to display shortcuts.\n *\n * @example\n * ```js\n * // Assuming macOS:\n * displayShortcut.primary( 'm' );\n * // \"⌘M\"\n * ```\n *\n * @type {WPModifierHandler<WPKeyHandler<string>>} Keyed map of functions to\n * display shortcuts.\n */\nexport const displayShortcut =\n\t/* @__PURE__ */\n\tmapValues(\n\t\tdisplayShortcutList,\n\t\t( /** @type {WPKeyHandler<string[]>} */ shortcutList ) => {\n\t\t\treturn /** @type {WPKeyHandler<string>} */ (\n\t\t\t\tcharacter,\n\t\t\t\t_isApple = isAppleOS\n\t\t\t) => shortcutList( character, _isApple ).join( '' );\n\t\t}\n\t);\n\n/**\n * An object that contains functions to return an aria label for a keyboard\n * shortcut.\n *\n * @example\n * ```js\n * // Assuming macOS:\n * shortcutAriaLabel.primary( '.' );\n * // \"Command + Period\"\n * ```\n *\n * @type {WPModifierHandler<WPKeyHandler<string>>} Keyed map of functions to\n * shortcut ARIA labels.\n */\nexport const shortcutAriaLabel =\n\t/* @__PURE__ */\n\tmapValues( modifiers, ( /** @type {WPModifier} */ modifier ) => {\n\t\treturn /** @type {WPKeyHandler<string>} */ (\n\t\t\tcharacter,\n\t\t\t_isApple = isAppleOS\n\t\t) => {\n\t\t\tconst isApple = _isApple();\n\t\t\t/** @type {Record<string,string>} */\n\t\t\tconst replacementKeyMap = {\n\t\t\t\t[ SHIFT ]: 'Shift',\n\t\t\t\t[ COMMAND ]: isApple ? 'Command' : 'Control',\n\t\t\t\t[ CTRL ]: 'Control',\n\t\t\t\t[ ALT ]: isApple ? 'Option' : 'Alt',\n\t\t\t\t/* translators: comma as in the character ',' */\n\t\t\t\t',': __( 'Comma' ),\n\t\t\t\t/* translators: period as in the character '.' */\n\t\t\t\t'.': __( 'Period' ),\n\t\t\t\t/* translators: backtick as in the character '`' */\n\t\t\t\t'`': __( 'Backtick' ),\n\t\t\t\t/* translators: tilde as in the character '~' */\n\t\t\t\t'~': __( 'Tilde' ),\n\t\t\t};\n\n\t\t\treturn [ ...modifier( _isApple ), character ]\n\t\t\t\t.map( ( key ) =>\n\t\t\t\t\tcapitaliseFirstCharacter( replacementKeyMap[ key ] ?? key )\n\t\t\t\t)\n\t\t\t\t.join( isApple ? ' ' : ' + ' );\n\t\t};\n\t} );\n\n/**\n * From a given KeyboardEvent, returns an array of active modifier constants for\n * the event.\n *\n * @param {import('react').KeyboardEvent<HTMLElement> | KeyboardEvent} event Keyboard event.\n *\n * @return {Array<WPModifierPart>} Active modifier constants.\n */\nfunction getEventModifiers( event ) {\n\treturn /** @type {WPModifierPart[]} */ ( [\n\t\tALT,\n\t\tCTRL,\n\t\tCOMMAND,\n\t\tSHIFT,\n\t] ).filter(\n\t\t( key ) =>\n\t\t\tevent[\n\t\t\t\t/** @type {'altKey' | 'ctrlKey' | 'metaKey' | 'shiftKey'} */ (\n\t\t\t\t\t`${ key }Key`\n\t\t\t\t)\n\t\t\t]\n\t);\n}\n\n/**\n * An object that contains functions to check if a keyboard event matches a\n * predefined shortcut combination.\n *\n * @example\n * ```js\n * // Assuming an event for ⌘M key press:\n * isKeyboardEvent.primary( event, 'm' );\n * // true\n * ```\n *\n * @type {WPModifierHandler<WPEventKeyHandler>} Keyed map of functions\n * to match events.\n */\nexport const isKeyboardEvent =\n\t/* @__PURE__ */\n\tmapValues( modifiers, ( /** @type {WPModifier} */ getModifiers ) => {\n\t\treturn /** @type {WPEventKeyHandler} */ (\n\t\t\tevent,\n\t\t\tcharacter,\n\t\t\t_isApple = isAppleOS\n\t\t) => {\n\t\t\tconst mods = getModifiers( _isApple );\n\t\t\tconst eventMods = getEventModifiers( event );\n\t\t\t/** @type {Record<string,string>} */\n\t\t\tconst replacementWithShiftKeyMap = {\n\t\t\t\tComma: ',',\n\t\t\t\tBackslash: '\\\\',\n\t\t\t\t// Windows returns `\\` for both IntlRo and IntlYen.\n\t\t\t\tIntlRo: '\\\\',\n\t\t\t\tIntlYen: '\\\\',\n\t\t\t};\n\n\t\t\tconst modsDiff = mods.filter(\n\t\t\t\t( mod ) => ! eventMods.includes( mod )\n\t\t\t);\n\t\t\tconst eventModsDiff = eventMods.filter(\n\t\t\t\t( mod ) => ! mods.includes( mod )\n\t\t\t);\n\n\t\t\tif ( modsDiff.length > 0 || eventModsDiff.length > 0 ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tlet key = event.key.toLowerCase();\n\n\t\t\tif ( ! character ) {\n\t\t\t\treturn mods.includes( /** @type {WPModifierPart} */ ( key ) );\n\t\t\t}\n\n\t\t\tif ( event.altKey && character.length === 1 ) {\n\t\t\t\tkey = String.fromCharCode( event.keyCode ).toLowerCase();\n\t\t\t}\n\n\t\t\t// `event.key` returns the value of the key pressed, taking into the state of\n\t\t\t// modifier keys such as `Shift`. If the shift key is pressed, a different\n\t\t\t// value may be returned depending on the keyboard layout. It is necessary to\n\t\t\t// convert to the physical key value that don't take into account keyboard\n\t\t\t// layout or modifier key state.\n\t\t\tif (\n\t\t\t\tevent.shiftKey &&\n\t\t\t\tcharacter.length === 1 &&\n\t\t\t\treplacementWithShiftKeyMap[ event.code ]\n\t\t\t) {\n\t\t\t\tkey = replacementWithShiftKeyMap[ event.code ];\n\t\t\t}\n\n\t\t\t// For backwards compatibility.\n\t\t\tif ( character === 'del' ) {\n\t\t\t\tcharacter = 'delete';\n\t\t\t}\n\n\t\t\treturn key === character.toLowerCase();\n\t\t};\n\t} );\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,SAASC,SAAS,QAAQ,YAAY;;AAEtC;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,OAAO,MAAMC,SAAS,GAAG,CAAC;;AAE1B;AACA;AACA;AACA,OAAO,MAAMC,GAAG,GAAG,CAAC;;AAEpB;AACA;AACA;AACA,OAAO,MAAMC,KAAK,GAAG,EAAE;;AAEvB;AACA;AACA;AACA,OAAO,MAAMC,MAAM,GAAG,EAAE;;AAExB;AACA;AACA;AACA,OAAO,MAAMC,KAAK,GAAG,EAAE;;AAEvB;AACA;AACA;AACA,OAAO,MAAMC,MAAM,GAAG,EAAE;;AAExB;AACA;AACA;AACA,OAAO,MAAMC,QAAQ,GAAG,EAAE;;AAE1B;AACA;AACA;AACA,OAAO,MAAMC,GAAG,GAAG,EAAE;;AAErB;AACA;AACA;AACA,OAAO,MAAMC,IAAI,GAAG,EAAE;;AAEt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,GAAG,GAAGiC,KAAK,CAACjC,GAAG,CAACkB,WAAW,CAAC,CAAC;IAEjC,IAAK,CAAED,SAAS,EAAG;MAClB,OAAOoB,IAAI,CAACS,QAAQ,CAAE,6BAAgC9C,GAAM,CAAC;IAC9D;IAEA,IAAKiC,KAAK,CAACe,MAAM,IAAI/B,SAAS,CAAC5B,MAAM,KAAK,CAAC,EAAG;MAC7CW,GAAG,GAAGiD,MAAM,CAACC,YAAY,CAAEjB,KAAK,CAACkB,OAAQ,CAAC,CAACjC,WAAW,CAAC,CAAC;IACzD;;IAEA;IACA;IACA;IACA;IACA;IACA,IACCe,KAAK,CAACmB,QAAQ,IACdnC,SAAS,CAAC5B,MAAM,KAAK,CAAC,IACtBkD,0BAA0B,CAAEN,KAAK,CAACoB,IAAI,CAAE,EACvC;MACDrD,GAAG,GAAGuC,0BAA0B,CAAEN,KAAK,CAACoB,IAAI,CAAE;IAC/C;;IAEA;IACA,IAAKpC,SAAS,KAAK,KAAK,EAAG;MAC1BA,SAAS,GAAG,QAAQ;IACrB;IAEA,OAAOjB,GAAG,KAAKiB,SAAS,CAACC,WAAW,CAAC,CAAC;EACvC,CAAC;AACF,CAAE,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"AAqBA,qEAAqE;AAErE,0KAA0K;AAE1K;;;;;;;GAOG;AAEH;;;;GAIG;AACH,8JAA8J;AAE9J,2EAA2E;AAE3E;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"AAqBA,qEAAqE;AAErE,0KAA0K;AAE1K;;;;;;;GAOG;AAEH;;;;GAIG;AACH,8JAA8J;AAE9J,2EAA2E;AAE3E;;GAEG;AACH,wBAAyB,CAAC,CAAC;AAE3B;;GAEG;AACH,kBAAmB,CAAC,CAAC;AAErB;;GAEG;AACH,oBAAqB,EAA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;6BAnaS,OAAO,GAAG,4BAAyB;gCAEnC,SAAS,GAAG,cAAc,GAAG,YAAY,GAAG,WAAW,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,WAAW,GAAG,OAAO,GAAG,UAAU,GAAG,WAAW;;;;;8BAMvI,CAAC,IAED,MAAM,CAAC,iBAAiB,EAAE,CAAC,CAAC;yBAI5B,CAAC,IAED,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,OAAO,KAAK,CAAC;gCAEhD,CAAC,KAAK,EAAE,OAAO,OAAO,EAAE,aAAa,CAAC,WAAW,CAAC,GAAG,aAAa,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,OAAO,KAAK,OAAO;yBAE1H,CAAE,OAAO,EAAE,MAAM,OAAO,KAAM,cAAc,EAAE;0BAtBlC,YAAY"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/keycodes",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.13.1-next.a9f418477.0",
|
|
4
4
|
"description": "Keycodes utilities for WordPress. Used to check for keyboard events across browsers/operating systems.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
"sideEffects": false,
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@babel/runtime": "7.25.7",
|
|
33
|
-
"@wordpress/i18n": "^5.
|
|
33
|
+
"@wordpress/i18n": "^5.13.1-next.a9f418477.0"
|
|
34
34
|
},
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "c1a8f3e9cada3b7d8342d1d2595c2dac0433111d"
|
|
39
39
|
}
|
package/src/index.js
CHANGED
|
@@ -211,9 +211,9 @@ export const modifiers = {
|
|
|
211
211
|
* @type {WPModifierHandler<WPKeyHandler<string>>} Keyed map of functions to raw
|
|
212
212
|
* shortcuts.
|
|
213
213
|
*/
|
|
214
|
-
export const rawShortcut =
|
|
215
|
-
|
|
216
|
-
( /** @type {WPModifier} */ modifier ) => {
|
|
214
|
+
export const rawShortcut =
|
|
215
|
+
/* @__PURE__ */
|
|
216
|
+
mapValues( modifiers, ( /** @type {WPModifier} */ modifier ) => {
|
|
217
217
|
return /** @type {WPKeyHandler<string>} */ (
|
|
218
218
|
character,
|
|
219
219
|
_isApple = isAppleOS
|
|
@@ -222,8 +222,7 @@ export const rawShortcut = mapValues(
|
|
|
222
222
|
'+'
|
|
223
223
|
);
|
|
224
224
|
};
|
|
225
|
-
}
|
|
226
|
-
);
|
|
225
|
+
} );
|
|
227
226
|
|
|
228
227
|
/**
|
|
229
228
|
* Return an array of the parts of a keyboard shortcut chord for display.
|
|
@@ -238,9 +237,9 @@ export const rawShortcut = mapValues(
|
|
|
238
237
|
* @type {WPModifierHandler<WPKeyHandler<string[]>>} Keyed map of functions to
|
|
239
238
|
* shortcut sequences.
|
|
240
239
|
*/
|
|
241
|
-
export const displayShortcutList =
|
|
242
|
-
|
|
243
|
-
( /** @type {WPModifier} */ modifier ) => {
|
|
240
|
+
export const displayShortcutList =
|
|
241
|
+
/* @__PURE__ */
|
|
242
|
+
mapValues( modifiers, ( /** @type {WPModifier} */ modifier ) => {
|
|
244
243
|
return /** @type {WPKeyHandler<string[]>} */ (
|
|
245
244
|
character,
|
|
246
245
|
_isApple = isAppleOS
|
|
@@ -268,8 +267,7 @@ export const displayShortcutList = mapValues(
|
|
|
268
267
|
|
|
269
268
|
return [ ...modifierKeys, capitaliseFirstCharacter( character ) ];
|
|
270
269
|
};
|
|
271
|
-
}
|
|
272
|
-
);
|
|
270
|
+
} );
|
|
273
271
|
|
|
274
272
|
/**
|
|
275
273
|
* An object that contains functions to display shortcuts.
|
|
@@ -284,15 +282,17 @@ export const displayShortcutList = mapValues(
|
|
|
284
282
|
* @type {WPModifierHandler<WPKeyHandler<string>>} Keyed map of functions to
|
|
285
283
|
* display shortcuts.
|
|
286
284
|
*/
|
|
287
|
-
export const displayShortcut =
|
|
288
|
-
|
|
289
|
-
(
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
);
|
|
285
|
+
export const displayShortcut =
|
|
286
|
+
/* @__PURE__ */
|
|
287
|
+
mapValues(
|
|
288
|
+
displayShortcutList,
|
|
289
|
+
( /** @type {WPKeyHandler<string[]>} */ shortcutList ) => {
|
|
290
|
+
return /** @type {WPKeyHandler<string>} */ (
|
|
291
|
+
character,
|
|
292
|
+
_isApple = isAppleOS
|
|
293
|
+
) => shortcutList( character, _isApple ).join( '' );
|
|
294
|
+
}
|
|
295
|
+
);
|
|
296
296
|
|
|
297
297
|
/**
|
|
298
298
|
* An object that contains functions to return an aria label for a keyboard
|
|
@@ -308,9 +308,9 @@ export const displayShortcut = mapValues(
|
|
|
308
308
|
* @type {WPModifierHandler<WPKeyHandler<string>>} Keyed map of functions to
|
|
309
309
|
* shortcut ARIA labels.
|
|
310
310
|
*/
|
|
311
|
-
export const shortcutAriaLabel =
|
|
312
|
-
|
|
313
|
-
( /** @type {WPModifier} */ modifier ) => {
|
|
311
|
+
export const shortcutAriaLabel =
|
|
312
|
+
/* @__PURE__ */
|
|
313
|
+
mapValues( modifiers, ( /** @type {WPModifier} */ modifier ) => {
|
|
314
314
|
return /** @type {WPKeyHandler<string>} */ (
|
|
315
315
|
character,
|
|
316
316
|
_isApple = isAppleOS
|
|
@@ -338,8 +338,7 @@ export const shortcutAriaLabel = mapValues(
|
|
|
338
338
|
)
|
|
339
339
|
.join( isApple ? ' ' : ' + ' );
|
|
340
340
|
};
|
|
341
|
-
}
|
|
342
|
-
);
|
|
341
|
+
} );
|
|
343
342
|
|
|
344
343
|
/**
|
|
345
344
|
* From a given KeyboardEvent, returns an array of active modifier constants for
|
|
@@ -379,9 +378,9 @@ function getEventModifiers( event ) {
|
|
|
379
378
|
* @type {WPModifierHandler<WPEventKeyHandler>} Keyed map of functions
|
|
380
379
|
* to match events.
|
|
381
380
|
*/
|
|
382
|
-
export const isKeyboardEvent =
|
|
383
|
-
|
|
384
|
-
( /** @type {WPModifier} */ getModifiers ) => {
|
|
381
|
+
export const isKeyboardEvent =
|
|
382
|
+
/* @__PURE__ */
|
|
383
|
+
mapValues( modifiers, ( /** @type {WPModifier} */ getModifiers ) => {
|
|
385
384
|
return /** @type {WPEventKeyHandler} */ (
|
|
386
385
|
event,
|
|
387
386
|
character,
|
|
@@ -439,5 +438,4 @@ export const isKeyboardEvent = mapValues(
|
|
|
439
438
|
|
|
440
439
|
return key === character.toLowerCase();
|
|
441
440
|
};
|
|
442
|
-
}
|
|
443
|
-
);
|
|
441
|
+
} );
|
package/tsconfig.tsbuildinfo
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/typescript/lib/lib.es2023.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../node_modules/typescript/lib/lib.es2023.intl.d.ts","../../node_modules/typescript/lib/lib.esnext.array.d.ts","../../node_modules/typescript/lib/lib.esnext.collection.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../node_modules/typescript/lib/lib.esnext.string.d.ts","../../node_modules/typescript/lib/lib.esnext.promise.d.ts","../../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../node_modules/typescript/lib/lib.esnext.object.d.ts","../../node_modules/typescript/lib/lib.esnext.regexp.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../i18n/build-types/sprintf.d.ts","../hooks/build-types/createAddHook.d.ts","../hooks/build-types/createRemoveHook.d.ts","../hooks/build-types/createHasHook.d.ts","../hooks/build-types/createDoingHook.d.ts","../hooks/build-types/createDidHook.d.ts","../hooks/build-types/index.d.ts","../hooks/build-types/createHooks.d.ts","../i18n/build-types/create-i18n.d.ts","../i18n/build-types/default-i18n.d.ts","../i18n/build-types/index.d.ts","./src/platform.js","../../node_modules/@types/react/global.d.ts","../../node_modules/csstype/index.d.ts","../../node_modules/@types/prop-types/index.d.ts","../../node_modules/@types/react/index.d.ts","./src/index.js"],"fileInfos":[{"version":"44e584d4f6444f58791784f1d530875970993129442a847597db702a073ca68c","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","17edc026abf73c5c2dd508652d63f68ec4efd9d4856e3469890d27598209feb5",{"version":"4af6b0c727b7a2896463d512fafd23634229adf69ac7c00e2ae15a09cb084fad","affectsGlobalScope":true},{"version":"9c00a480825408b6a24c63c1b71362232927247595d7c97659bc24dc68ae0757","affectsGlobalScope":true},{"version":"6920e1448680767498a0b77c6a00a8e77d14d62c3da8967b171f1ddffa3c18e4","affectsGlobalScope":true},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true},{"version":"ea011c76963fb15ef1cdd7ce6a6808b46322c527de2077b6cfdf23ae6f5f9ec7","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"bb42a7797d996412ecdc5b2787720de477103a0b2e53058569069a0e2bae6c7e","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"b541a838a13f9234aba650a825393ffc2292dc0fc87681a5d81ef0c96d281e7a","affectsGlobalScope":true},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true},{"version":"ae37d6ccd1560b0203ab88d46987393adaaa78c919e51acf32fb82c86502e98c","affectsGlobalScope":true},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"5e07ed3809d48205d5b985642a59f2eba47c402374a7cf8006b686f79efadcbd","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"479553e3779be7d4f68e9f40cdb82d038e5ef7592010100410723ceced22a0f7","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"d3d7b04b45033f57351c8434f60b6be1ea71a2dfec2d0a0c3c83badbb0e3e693","affectsGlobalScope":true},{"version":"956d27abdea9652e8368ce029bb1e0b9174e9678a273529f426df4b3d90abd60","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"e6633e05da3ff36e6da2ec170d0d03ccf33de50ca4dc6f5aeecb572cedd162fb","affectsGlobalScope":true},{"version":"d8670852241d4c6e03f2b89d67497a4bbefe29ecaa5a444e2c11a9b05e6fccc6","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"caccc56c72713969e1cfe5c3d44e5bab151544d9d2b373d7dbe5a1e4166652be","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true},{"version":"08a58483392df5fcc1db57d782e87734f77ae9eab42516028acbfe46f29a3ef7","affectsGlobalScope":true},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true},{"version":"0b11f3ca66aa33124202c80b70cd203219c3d4460cfc165e0707aa9ec710fc53","affectsGlobalScope":true},{"version":"6a3f5a0129cc80cf439ab71164334d649b47059a4f5afca90282362407d0c87f","affectsGlobalScope":true},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true},{"version":"15b98a533864d324e5f57cd3cfc0579b231df58c1c0f6063ea0fcb13c3c74ff9","affectsGlobalScope":true},{"version":"0a6282c8827e4b9a95f4bf4f5c205673ada31b982f50572d27103df8ceb8013c","affectsGlobalScope":true},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true},{"version":"56e4ed5aab5f5920980066a9409bfaf53e6d21d3f8d020c17e4de584d29600ad","affectsGlobalScope":true},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"2f1fe46a7a4e25a4a414d5491c7b39b695a6f37e97a1bdfeb71d430f98c3ed10","20f2b0befb27c07049565340fac3ab264c94afebacb3234dfb945e1c4a8ab5fb","406a8b30598c33638390e65c1b18d65804784069a176ec900aa033b2b0038673","0b48405ec967a9982c1001d4222b1c64091aba1441fc4318b08bc1cd4036794a","12324a25a603147ab9cf9724d762a767dd8b22c3b4f3ea44357bb937565509c3","7966497f2357f63036d7c12917ee20d91b7a74c4d9d682e75c44f7b7f6ea4e5b","5061f5719dccae0d9ed5b195d2dc4ec5c08d1a34c84d57c7b3b9be8a820b58bd","4fa795e77b24d2a64eab73b8bc2c8c5992b629570e0c2bfc9bb475c312d79c65","08c2de6aff6a0af37e67460ae45ca87f440ef378f5a586afcafea49a02db3990","061e88a6b235d5dd90a3cb8af8d27f397fd069e1bed76a5c7617b1c00a395ba7","2a49b24214a9709c04c7d21d99f1473058bd3b4d1310655288347a4c8862da30",{"version":"c813ac99663202e702fe5f635f7ec2d7b20747c57ff0a85a86af0dadac9170e2","signature":"6270f21b52d381dda2ca953a728f44b5ceb9edf965c97cb55f77ba7a477d77f0"},{"version":"55461596dc873b866911ef4e640fae4c39da7ac1fbc7ef5e649cb2f2fb42c349","affectsGlobalScope":true},"4c68749a564a6facdf675416d75789ee5a557afda8960e0803cf6711fa569288","f7b46d22a307739c145e5fddf537818038fdfffd580d79ed717f4d4d37249380",{"version":"8ca4709dbd22a34bcc1ebf93e1877645bdb02ebd3f3d9a211a299a8db2ee4ba1","affectsGlobalScope":true},{"version":"6670089dd4748f7825742df0131a7b0019741046dc2ead0f8c28648393106a45","signature":"079ae7b7b7e8717e26b6823b7595a91470479aed7be955e3cc55e9e51487a655"}],"root":[85,90],"options":{"allowJs":true,"allowSyntheticDefaultImports":true,"checkJs":true,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"rootDir":"./src","skipDefaultLibCheck":true,"strict":true,"target":99},"fileIdsList":[[86,87,88],[80],[75,76,77,78,79,80],[75,76,77,78,79,81],[80,81],[82],[74,82,83],[84,85,89]],"referencedMap":[[89,1],[75,2],[79,2],[78,2],[77,2],[81,3],[76,2],[80,4],[82,5],[83,6],[84,7],[90,8]],"latestChangedDtsFile":"./build-types/index.d.ts"},"version":"5.5.3"}
|
|
1
|
+
{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/typescript/lib/lib.es2023.d.ts","../../node_modules/typescript/lib/lib.es2024.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../node_modules/typescript/lib/lib.es2023.intl.d.ts","../../node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2024.collection.d.ts","../../node_modules/typescript/lib/lib.es2024.object.d.ts","../../node_modules/typescript/lib/lib.es2024.promise.d.ts","../../node_modules/typescript/lib/lib.es2024.regexp.d.ts","../../node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2024.string.d.ts","../../node_modules/typescript/lib/lib.esnext.array.d.ts","../../node_modules/typescript/lib/lib.esnext.collection.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../node_modules/typescript/lib/lib.esnext.iterator.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../i18n/build-types/sprintf.d.ts","../hooks/build-types/createAddHook.d.ts","../hooks/build-types/createRemoveHook.d.ts","../hooks/build-types/createHasHook.d.ts","../hooks/build-types/createDoingHook.d.ts","../hooks/build-types/createDidHook.d.ts","../hooks/build-types/createHooks.d.ts","../hooks/build-types/index.d.ts","../i18n/build-types/create-i18n.d.ts","../i18n/build-types/default-i18n.d.ts","../i18n/build-types/index.d.ts","./src/platform.js","../../node_modules/@types/react/global.d.ts","../../node_modules/csstype/index.d.ts","../../node_modules/@types/prop-types/index.d.ts","../../node_modules/@types/react/index.d.ts","./src/index.js"],"fileIdsList":[[91,92,93],[86],[80,81,82,83,84,86],[80,81,82,83,84,85],[87],[79,87,88],[89,90,94]],"fileInfos":[{"version":"e41c290ef7dd7dab3493e6cbe5909e0148edf4a8dad0271be08edec368a0f7b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","impliedFormat":1},{"version":"8fd575e12870e9944c7e1d62e1f5a73fcf23dd8d3a321f2a2c74c20d022283fe","impliedFormat":1},{"version":"e12a46ce14b817d4c9e6b2b478956452330bf00c9801b79de46f7a1815b5bd40","impliedFormat":1},{"version":"4fd3f3422b2d2a3dfd5cdd0f387b3a8ec45f006c6ea896a4cb41264c2100bb2c","affectsGlobalScope":true,"impliedFormat":1},{"version":"69e65d976bf166ce4a9e6f6c18f94d2424bf116e90837ace179610dbccad9b42","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"62bb211266ee48b2d0edf0d8d1b191f0c24fc379a82bd4c1692a082c540bc6b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"936e80ad36a2ee83fc3caf008e7c4c5afe45b3cf3d5c24408f039c1d47bdc1df","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"fef8cfad2e2dc5f5b3d97a6f4f2e92848eb1b88e897bb7318cef0e2820bceaab","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"f1e2a172204962276504466a6393426d2ca9c54894b1ad0a6c9dad867a65f876","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"b5ce7a470bc3628408429040c4e3a53a27755022a32fd05e2cb694e7015386c7","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"bab26767638ab3557de12c900f0b91f710c7dc40ee9793d5a27d32c04f0bf646","affectsGlobalScope":true,"impliedFormat":1},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true,"impliedFormat":1},{"version":"87dc0f382502f5bbce5129bdc0aea21e19a3abbc19259e0b43ae038a9fc4e326","affectsGlobalScope":true,"impliedFormat":1},{"version":"b1cb28af0c891c8c96b2d6b7be76bd394fddcfdb4709a20ba05a7c1605eea0f9","affectsGlobalScope":true,"impliedFormat":1},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true,"impliedFormat":1},{"version":"56e4ed5aab5f5920980066a9409bfaf53e6d21d3f8d020c17e4de584d29600ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ece9f17b3866cc077099c73f4983bddbcb1dc7ddb943227f1ec070f529dedd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a6282c8827e4b9a95f4bf4f5c205673ada31b982f50572d27103df8ceb8013c","affectsGlobalScope":true,"impliedFormat":1},{"version":"1c9319a09485199c1f7b0498f2988d6d2249793ef67edda49d1e584746be9032","affectsGlobalScope":true,"impliedFormat":1},{"version":"e3a2a0cee0f03ffdde24d89660eba2685bfbdeae955a6c67e8c4c9fd28928eeb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true,"impliedFormat":1},{"version":"51ad4c928303041605b4d7ae32e0c1ee387d43a24cd6f1ebf4a2699e1076d4fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true,"impliedFormat":1},{"version":"61d6a2092f48af66dbfb220e31eea8b10bc02b6932d6e529005fd2d7b3281290","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},"2f1fe46a7a4e25a4a414d5491c7b39b695a6f37e97a1bdfeb71d430f98c3ed10","20f2b0befb27c07049565340fac3ab264c94afebacb3234dfb945e1c4a8ab5fb","c7048acaf5edb534ee4a29e8469c7cdd87cfc40b5518a7983b7d83c2fcc5baa2","0b48405ec967a9982c1001d4222b1c64091aba1441fc4318b08bc1cd4036794a","12324a25a603147ab9cf9724d762a767dd8b22c3b4f3ea44357bb937565509c3","7966497f2357f63036d7c12917ee20d91b7a74c4d9d682e75c44f7b7f6ea4e5b","4fa795e77b24d2a64eab73b8bc2c8c5992b629570e0c2bfc9bb475c312d79c65","5061f5719dccae0d9ed5b195d2dc4ec5c08d1a34c84d57c7b3b9be8a820b58bd","50e548bea2aae3be6c1d077f39478b3a88734ea851be7c541ed8fc9f9ed86e0b","061e88a6b235d5dd90a3cb8af8d27f397fd069e1bed76a5c7617b1c00a395ba7","2a49b24214a9709c04c7d21d99f1473058bd3b4d1310655288347a4c8862da30",{"version":"c813ac99663202e702fe5f635f7ec2d7b20747c57ff0a85a86af0dadac9170e2","signature":"6270f21b52d381dda2ca953a728f44b5ceb9edf965c97cb55f77ba7a477d77f0"},{"version":"55461596dc873b866911ef4e640fae4c39da7ac1fbc7ef5e649cb2f2fb42c349","affectsGlobalScope":true,"impliedFormat":1},{"version":"4c68749a564a6facdf675416d75789ee5a557afda8960e0803cf6711fa569288","impliedFormat":1},{"version":"f7b46d22a307739c145e5fddf537818038fdfffd580d79ed717f4d4d37249380","impliedFormat":1},{"version":"8ca4709dbd22a34bcc1ebf93e1877645bdb02ebd3f3d9a211a299a8db2ee4ba1","affectsGlobalScope":true,"impliedFormat":1},{"version":"7a9c4f1c3d57af155b0016c2c52c8051f5472abee776a1a5a279b6f504554637","signature":"079ae7b7b7e8717e26b6823b7595a91470479aed7be955e3cc55e9e51487a655"}],"root":[90,95],"options":{"allowJs":true,"allowSyntheticDefaultImports":true,"checkJs":true,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"rootDir":"./src","skipDefaultLibCheck":true,"strict":true,"target":99},"referencedMap":[[94,1],[80,2],[84,2],[83,2],[82,2],[85,3],[81,2],[86,4],[87,2],[88,5],[89,6],[95,7]],"latestChangedDtsFile":"./build-types/index.d.ts","version":"5.7.2"}
|