wp/wp-includes/js/dist/keycodes.js
changeset 19 3d72ae0968f4
parent 18 be944660c56a
child 21 48c4eec2b7e6
equal deleted inserted replaced
18:be944660c56a 19:3d72ae0968f4
     1 this["wp"] = this["wp"] || {}; this["wp"]["keycodes"] =
     1 /******/ (function() { // webpackBootstrap
     2 /******/ (function(modules) { // webpackBootstrap
     2 /******/ 	"use strict";
     3 /******/ 	// The module cache
     3 /******/ 	// The require scope
     4 /******/ 	var installedModules = {};
     4 /******/ 	var __webpack_require__ = {};
     5 /******/
     5 /******/ 	
     6 /******/ 	// The require function
     6 /************************************************************************/
     7 /******/ 	function __webpack_require__(moduleId) {
     7 /******/ 	/* webpack/runtime/define property getters */
     8 /******/
     8 /******/ 	!function() {
     9 /******/ 		// Check if module is in cache
     9 /******/ 		// define getter functions for harmony exports
    10 /******/ 		if(installedModules[moduleId]) {
    10 /******/ 		__webpack_require__.d = function(exports, definition) {
    11 /******/ 			return installedModules[moduleId].exports;
    11 /******/ 			for(var key in definition) {
    12 /******/ 		}
    12 /******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
    13 /******/ 		// Create a new module (and put it into the cache)
    13 /******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
    14 /******/ 		var module = installedModules[moduleId] = {
    14 /******/ 				}
    15 /******/ 			i: moduleId,
    15 /******/ 			}
    16 /******/ 			l: false,
       
    17 /******/ 			exports: {}
       
    18 /******/ 		};
    16 /******/ 		};
    19 /******/
    17 /******/ 	}();
    20 /******/ 		// Execute the module function
    18 /******/ 	
    21 /******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
    19 /******/ 	/* webpack/runtime/hasOwnProperty shorthand */
    22 /******/
    20 /******/ 	!function() {
    23 /******/ 		// Flag the module as loaded
    21 /******/ 		__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
    24 /******/ 		module.l = true;
    22 /******/ 	}();
    25 /******/
    23 /******/ 	
    26 /******/ 		// Return the exports of the module
    24 /******/ 	/* webpack/runtime/make namespace object */
    27 /******/ 		return module.exports;
    25 /******/ 	!function() {
    28 /******/ 	}
    26 /******/ 		// define __esModule on exports
    29 /******/
    27 /******/ 		__webpack_require__.r = function(exports) {
    30 /******/
    28 /******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
    31 /******/ 	// expose the modules object (__webpack_modules__)
    29 /******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
    32 /******/ 	__webpack_require__.m = modules;
    30 /******/ 			}
    33 /******/
    31 /******/ 			Object.defineProperty(exports, '__esModule', { value: true });
    34 /******/ 	// expose the module cache
    32 /******/ 		};
    35 /******/ 	__webpack_require__.c = installedModules;
    33 /******/ 	}();
    36 /******/
    34 /******/ 	
    37 /******/ 	// define getter function for harmony exports
       
    38 /******/ 	__webpack_require__.d = function(exports, name, getter) {
       
    39 /******/ 		if(!__webpack_require__.o(exports, name)) {
       
    40 /******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
       
    41 /******/ 		}
       
    42 /******/ 	};
       
    43 /******/
       
    44 /******/ 	// define __esModule on exports
       
    45 /******/ 	__webpack_require__.r = function(exports) {
       
    46 /******/ 		if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
       
    47 /******/ 			Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
       
    48 /******/ 		}
       
    49 /******/ 		Object.defineProperty(exports, '__esModule', { value: true });
       
    50 /******/ 	};
       
    51 /******/
       
    52 /******/ 	// create a fake namespace object
       
    53 /******/ 	// mode & 1: value is a module id, require it
       
    54 /******/ 	// mode & 2: merge all properties of value into the ns
       
    55 /******/ 	// mode & 4: return value when already ns object
       
    56 /******/ 	// mode & 8|1: behave like require
       
    57 /******/ 	__webpack_require__.t = function(value, mode) {
       
    58 /******/ 		if(mode & 1) value = __webpack_require__(value);
       
    59 /******/ 		if(mode & 8) return value;
       
    60 /******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
       
    61 /******/ 		var ns = Object.create(null);
       
    62 /******/ 		__webpack_require__.r(ns);
       
    63 /******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
       
    64 /******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
       
    65 /******/ 		return ns;
       
    66 /******/ 	};
       
    67 /******/
       
    68 /******/ 	// getDefaultExport function for compatibility with non-harmony modules
       
    69 /******/ 	__webpack_require__.n = function(module) {
       
    70 /******/ 		var getter = module && module.__esModule ?
       
    71 /******/ 			function getDefault() { return module['default']; } :
       
    72 /******/ 			function getModuleExports() { return module; };
       
    73 /******/ 		__webpack_require__.d(getter, 'a', getter);
       
    74 /******/ 		return getter;
       
    75 /******/ 	};
       
    76 /******/
       
    77 /******/ 	// Object.prototype.hasOwnProperty.call
       
    78 /******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
       
    79 /******/
       
    80 /******/ 	// __webpack_public_path__
       
    81 /******/ 	__webpack_require__.p = "";
       
    82 /******/
       
    83 /******/
       
    84 /******/ 	// Load entry module and return exports
       
    85 /******/ 	return __webpack_require__(__webpack_require__.s = "z7pY");
       
    86 /******/ })
       
    87 /************************************************************************/
    35 /************************************************************************/
    88 /******/ ({
    36 var __webpack_exports__ = {};
    89 
       
    90 /***/ "YLtl":
       
    91 /***/ (function(module, exports) {
       
    92 
       
    93 (function() { module.exports = window["lodash"]; }());
       
    94 
       
    95 /***/ }),
       
    96 
       
    97 /***/ "l3Sj":
       
    98 /***/ (function(module, exports) {
       
    99 
       
   100 (function() { module.exports = window["wp"]["i18n"]; }());
       
   101 
       
   102 /***/ }),
       
   103 
       
   104 /***/ "z7pY":
       
   105 /***/ (function(module, __webpack_exports__, __webpack_require__) {
       
   106 
       
   107 "use strict";
       
   108 // ESM COMPAT FLAG
    37 // ESM COMPAT FLAG
   109 __webpack_require__.r(__webpack_exports__);
    38 __webpack_require__.r(__webpack_exports__);
   110 
    39 
   111 // EXPORTS
    40 // EXPORTS
   112 __webpack_require__.d(__webpack_exports__, "BACKSPACE", function() { return /* binding */ BACKSPACE; });
    41 __webpack_require__.d(__webpack_exports__, {
   113 __webpack_require__.d(__webpack_exports__, "TAB", function() { return /* binding */ TAB; });
    42   "ALT": function() { return /* binding */ ALT; },
   114 __webpack_require__.d(__webpack_exports__, "ENTER", function() { return /* binding */ ENTER; });
    43   "BACKSPACE": function() { return /* binding */ BACKSPACE; },
   115 __webpack_require__.d(__webpack_exports__, "ESCAPE", function() { return /* binding */ ESCAPE; });
    44   "COMMAND": function() { return /* binding */ COMMAND; },
   116 __webpack_require__.d(__webpack_exports__, "SPACE", function() { return /* binding */ SPACE; });
    45   "CTRL": function() { return /* binding */ CTRL; },
   117 __webpack_require__.d(__webpack_exports__, "LEFT", function() { return /* binding */ LEFT; });
    46   "DELETE": function() { return /* binding */ DELETE; },
   118 __webpack_require__.d(__webpack_exports__, "UP", function() { return /* binding */ UP; });
    47   "DOWN": function() { return /* binding */ DOWN; },
   119 __webpack_require__.d(__webpack_exports__, "RIGHT", function() { return /* binding */ RIGHT; });
    48   "END": function() { return /* binding */ END; },
   120 __webpack_require__.d(__webpack_exports__, "DOWN", function() { return /* binding */ DOWN; });
    49   "ENTER": function() { return /* binding */ ENTER; },
   121 __webpack_require__.d(__webpack_exports__, "DELETE", function() { return /* binding */ DELETE; });
    50   "ESCAPE": function() { return /* binding */ ESCAPE; },
   122 __webpack_require__.d(__webpack_exports__, "F10", function() { return /* binding */ F10; });
    51   "F10": function() { return /* binding */ F10; },
   123 __webpack_require__.d(__webpack_exports__, "ALT", function() { return /* binding */ ALT; });
    52   "HOME": function() { return /* binding */ HOME; },
   124 __webpack_require__.d(__webpack_exports__, "CTRL", function() { return /* binding */ CTRL; });
    53   "LEFT": function() { return /* binding */ LEFT; },
   125 __webpack_require__.d(__webpack_exports__, "COMMAND", function() { return /* binding */ COMMAND; });
    54   "PAGEDOWN": function() { return /* binding */ PAGEDOWN; },
   126 __webpack_require__.d(__webpack_exports__, "SHIFT", function() { return /* binding */ SHIFT; });
    55   "PAGEUP": function() { return /* binding */ PAGEUP; },
   127 __webpack_require__.d(__webpack_exports__, "ZERO", function() { return /* binding */ ZERO; });
    56   "RIGHT": function() { return /* binding */ RIGHT; },
   128 __webpack_require__.d(__webpack_exports__, "modifiers", function() { return /* binding */ modifiers; });
    57   "SHIFT": function() { return /* binding */ SHIFT; },
   129 __webpack_require__.d(__webpack_exports__, "rawShortcut", function() { return /* binding */ rawShortcut; });
    58   "SPACE": function() { return /* binding */ SPACE; },
   130 __webpack_require__.d(__webpack_exports__, "displayShortcutList", function() { return /* binding */ displayShortcutList; });
    59   "TAB": function() { return /* binding */ TAB; },
   131 __webpack_require__.d(__webpack_exports__, "displayShortcut", function() { return /* binding */ displayShortcut; });
    60   "UP": function() { return /* binding */ UP; },
   132 __webpack_require__.d(__webpack_exports__, "shortcutAriaLabel", function() { return /* binding */ shortcutAriaLabel; });
    61   "ZERO": function() { return /* binding */ ZERO; },
   133 __webpack_require__.d(__webpack_exports__, "isKeyboardEvent", function() { return /* binding */ isKeyboardEvent; });
    62   "displayShortcut": function() { return /* binding */ displayShortcut; },
   134 
    63   "displayShortcutList": function() { return /* binding */ displayShortcutList; },
   135 // EXTERNAL MODULE: external "lodash"
    64   "isKeyboardEvent": function() { return /* binding */ isKeyboardEvent; },
   136 var external_lodash_ = __webpack_require__("YLtl");
    65   "modifiers": function() { return /* binding */ modifiers; },
   137 
    66   "rawShortcut": function() { return /* binding */ rawShortcut; },
   138 // EXTERNAL MODULE: external ["wp","i18n"]
    67   "shortcutAriaLabel": function() { return /* binding */ shortcutAriaLabel; }
   139 var external_wp_i18n_ = __webpack_require__("l3Sj");
    68 });
   140 
    69 
   141 // CONCATENATED MODULE: ./node_modules/@wordpress/keycodes/build-module/platform.js
    70 ;// CONCATENATED MODULE: external "lodash"
       
    71 var external_lodash_namespaceObject = window["lodash"];
       
    72 ;// CONCATENATED MODULE: external ["wp","i18n"]
       
    73 var external_wp_i18n_namespaceObject = window["wp"]["i18n"];
       
    74 ;// CONCATENATED MODULE: ./node_modules/@wordpress/keycodes/build-module/platform.js
   142 /**
    75 /**
   143  * External dependencies
    76  * External dependencies
   144  */
    77  */
   145 
    78 
   146 /**
    79 /**
   149  * @param {Window?} _window window object by default; used for DI testing.
    82  * @param {Window?} _window window object by default; used for DI testing.
   150  *
    83  *
   151  * @return {boolean} True if MacOS; false otherwise.
    84  * @return {boolean} True if MacOS; false otherwise.
   152  */
    85  */
   153 
    86 
   154 function isAppleOS(_window = null) {
    87 function isAppleOS() {
       
    88   let _window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
       
    89 
   155   if (!_window) {
    90   if (!_window) {
   156     if (typeof window === 'undefined') {
    91     if (typeof window === 'undefined') {
   157       return false;
    92       return false;
   158     }
    93     }
   159 
    94 
   161   }
    96   }
   162 
    97 
   163   const {
    98   const {
   164     platform
    99     platform
   165   } = _window.navigator;
   100   } = _window.navigator;
   166   return platform.indexOf('Mac') !== -1 || Object(external_lodash_["includes"])(['iPad', 'iPhone'], platform);
   101   return platform.indexOf('Mac') !== -1 || (0,external_lodash_namespaceObject.includes)(['iPad', 'iPhone'], platform);
   167 }
   102 }
   168 
   103 
   169 // CONCATENATED MODULE: ./node_modules/@wordpress/keycodes/build-module/index.js
   104 ;// CONCATENATED MODULE: ./node_modules/@wordpress/keycodes/build-module/index.js
   170 /**
   105 /**
   171  * Note: The order of the modifier keys in many of the [foo]Shortcut()
   106  * Note: The order of the modifier keys in many of the [foo]Shortcut()
   172  * functions in this file are intentional and should not be changed. They're
   107  * functions in this file are intentional and should not be changed. They're
   173  * designed to fit with the standard menu keyboard shortcuts shown in the
   108  * designed to fit with the standard menu keyboard shortcuts shown in the
   174  * user's platform.
   109  * user's platform.
   192  */
   127  */
   193 
   128 
   194 
   129 
   195 /** @typedef {typeof ALT | CTRL | COMMAND | SHIFT } WPModifierPart */
   130 /** @typedef {typeof ALT | CTRL | COMMAND | SHIFT } WPModifierPart */
   196 
   131 
   197 /** @typedef {'primary' | 'primaryShift' | 'primaryAlt' | 'secondary' | 'access' | 'ctrl' | 'alt' | 'ctrlShift' | 'shift' | 'shiftAlt'} WPKeycodeModifier */
   132 /** @typedef {'primary' | 'primaryShift' | 'primaryAlt' | 'secondary' | 'access' | 'ctrl' | 'alt' | 'ctrlShift' | 'shift' | 'shiftAlt' | 'undefined'} WPKeycodeModifier */
   198 
   133 
   199 /**
   134 /**
   200  * An object of handler functions for each of the possible modifier
   135  * An object of handler functions for each of the possible modifier
   201  * combinations. A handler will return a value for a given key.
   136  * combinations. A handler will return a value for a given key.
   202  *
   137  *
   236 /**
   171 /**
   237  * Keycode for SPACE key.
   172  * Keycode for SPACE key.
   238  */
   173  */
   239 
   174 
   240 const SPACE = 32;
   175 const SPACE = 32;
       
   176 /**
       
   177  * Keycode for PAGEUP key.
       
   178  */
       
   179 
       
   180 const PAGEUP = 33;
       
   181 /**
       
   182  * Keycode for PAGEDOWN key.
       
   183  */
       
   184 
       
   185 const PAGEDOWN = 34;
       
   186 /**
       
   187  * Keycode for END key.
       
   188  */
       
   189 
       
   190 const END = 35;
       
   191 /**
       
   192  * Keycode for HOME key.
       
   193  */
       
   194 
       
   195 const HOME = 36;
   241 /**
   196 /**
   242  * Keycode for LEFT key.
   197  * Keycode for LEFT key.
   243  */
   198  */
   244 
   199 
   245 const LEFT = 37;
   200 const LEFT = 37;
   308   access: _isApple => _isApple() ? [CTRL, ALT] : [SHIFT, ALT],
   263   access: _isApple => _isApple() ? [CTRL, ALT] : [SHIFT, ALT],
   309   ctrl: () => [CTRL],
   264   ctrl: () => [CTRL],
   310   alt: () => [ALT],
   265   alt: () => [ALT],
   311   ctrlShift: () => [CTRL, SHIFT],
   266   ctrlShift: () => [CTRL, SHIFT],
   312   shift: () => [SHIFT],
   267   shift: () => [SHIFT],
   313   shiftAlt: () => [SHIFT, ALT]
   268   shiftAlt: () => [SHIFT, ALT],
       
   269   undefined: () => []
   314 };
   270 };
   315 /**
   271 /**
   316  * An object that contains functions to get raw shortcuts.
   272  * An object that contains functions to get raw shortcuts.
   317  *
   273  *
   318  * These are intended for user with the KeyboardShortcuts.
   274  * These are intended for user with the KeyboardShortcuts.
   326  *
   282  *
   327  * @type {WPModifierHandler<WPKeyHandler<string>>} Keyed map of functions to raw
   283  * @type {WPModifierHandler<WPKeyHandler<string>>} Keyed map of functions to raw
   328  *                                                 shortcuts.
   284  *                                                 shortcuts.
   329  */
   285  */
   330 
   286 
   331 const rawShortcut = Object(external_lodash_["mapValues"])(modifiers, modifier => {
   287 const rawShortcut = (0,external_lodash_namespaceObject.mapValues)(modifiers, modifier => {
   332   return (
   288   return (
   333     /** @type {WPKeyHandler<string>} */
   289     /** @type {WPKeyHandler<string>} */
   334     (character, _isApple = isAppleOS) => {
   290     function (character) {
       
   291       let _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isAppleOS;
       
   292 
   335       return [...modifier(_isApple), character.toLowerCase()].join('+');
   293       return [...modifier(_isApple), character.toLowerCase()].join('+');
   336     }
   294     }
   337   );
   295   );
   338 });
   296 });
   339 /**
   297 /**
   348  *
   306  *
   349  * @type {WPModifierHandler<WPKeyHandler<string[]>>} Keyed map of functions to
   307  * @type {WPModifierHandler<WPKeyHandler<string[]>>} Keyed map of functions to
   350  *                                                   shortcut sequences.
   308  *                                                   shortcut sequences.
   351  */
   309  */
   352 
   310 
   353 const displayShortcutList = Object(external_lodash_["mapValues"])(modifiers, modifier => {
   311 const displayShortcutList = (0,external_lodash_namespaceObject.mapValues)(modifiers, modifier => {
   354   return (
   312   return (
   355     /** @type {WPKeyHandler<string[]>} */
   313     /** @type {WPKeyHandler<string[]>} */
   356     (character, _isApple = isAppleOS) => {
   314     function (character) {
       
   315       let _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isAppleOS;
       
   316 
   357       const isApple = _isApple();
   317       const isApple = _isApple();
   358 
   318 
   359       const replacementKeyMap = {
   319       const replacementKeyMap = {
   360         [ALT]: isApple ? '⌥' : 'Alt',
   320         [ALT]: isApple ? '⌥' : 'Alt',
   361         [CTRL]: isApple ? '⌃' : 'Ctrl',
   321         [CTRL]: isApple ? '⌃' : 'Ctrl',
   362         // Make sure ⌃ is the U+2303 UP ARROWHEAD unicode character and not the caret character.
   322         // Make sure ⌃ is the U+2303 UP ARROWHEAD unicode character and not the caret character.
   363         [COMMAND]: '⌘',
   323         [COMMAND]: '⌘',
   364         [SHIFT]: isApple ? '⇧' : 'Shift'
   324         [SHIFT]: isApple ? '⇧' : 'Shift'
   365       };
   325       };
   366       const modifierKeys = modifier(_isApple).reduce((accumulator, key) => {
   326       const modifierKeys = modifier(_isApple).reduce((accumulator, key) => {
   367         const replacementKey = Object(external_lodash_["get"])(replacementKeyMap, key, key); // If on the Mac, adhere to platform convention and don't show plus between keys.
   327         const replacementKey = (0,external_lodash_namespaceObject.get)(replacementKeyMap, key, key); // If on the Mac, adhere to platform convention and don't show plus between keys.
   368 
   328 
   369         if (isApple) {
   329         if (isApple) {
   370           return [...accumulator, replacementKey];
   330           return [...accumulator, replacementKey];
   371         }
   331         }
   372 
   332 
   373         return [...accumulator, replacementKey, '+'];
   333         return [...accumulator, replacementKey, '+'];
   374       },
   334       },
   375       /** @type {string[]} */
   335       /** @type {string[]} */
   376       []);
   336       []);
   377       const capitalizedCharacter = Object(external_lodash_["capitalize"])(character);
   337       const capitalizedCharacter = (0,external_lodash_namespaceObject.capitalize)(character);
   378       return [...modifierKeys, capitalizedCharacter];
   338       return [...modifierKeys, capitalizedCharacter];
   379     }
   339     }
   380   );
   340   );
   381 });
   341 });
   382 /**
   342 /**
   391  *
   351  *
   392  * @type {WPModifierHandler<WPKeyHandler<string>>} Keyed map of functions to
   352  * @type {WPModifierHandler<WPKeyHandler<string>>} Keyed map of functions to
   393  *                                                 display shortcuts.
   353  *                                                 display shortcuts.
   394  */
   354  */
   395 
   355 
   396 const displayShortcut = Object(external_lodash_["mapValues"])(displayShortcutList, shortcutList => {
   356 const displayShortcut = (0,external_lodash_namespaceObject.mapValues)(displayShortcutList, shortcutList => {
   397   return (
   357   return (
   398     /** @type {WPKeyHandler<string>} */
   358     /** @type {WPKeyHandler<string>} */
   399     (character, _isApple = isAppleOS) => shortcutList(character, _isApple).join('')
   359     function (character) {
       
   360       let _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isAppleOS;
       
   361 
       
   362       return shortcutList(character, _isApple).join('');
       
   363     }
   400   );
   364   );
   401 });
   365 });
   402 /**
   366 /**
   403  * An object that contains functions to return an aria label for a keyboard
   367  * An object that contains functions to return an aria label for a keyboard
   404  * shortcut.
   368  * shortcut.
   412  *
   376  *
   413  * @type {WPModifierHandler<WPKeyHandler<string>>} Keyed map of functions to
   377  * @type {WPModifierHandler<WPKeyHandler<string>>} Keyed map of functions to
   414  *                                                 shortcut ARIA labels.
   378  *                                                 shortcut ARIA labels.
   415  */
   379  */
   416 
   380 
   417 const shortcutAriaLabel = Object(external_lodash_["mapValues"])(modifiers, modifier => {
   381 const shortcutAriaLabel = (0,external_lodash_namespaceObject.mapValues)(modifiers, modifier => {
   418   return (
   382   return (
   419     /** @type {WPKeyHandler<string>} */
   383     /** @type {WPKeyHandler<string>} */
   420     (character, _isApple = isAppleOS) => {
   384     function (character) {
       
   385       let _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isAppleOS;
       
   386 
   421       const isApple = _isApple();
   387       const isApple = _isApple();
   422 
   388 
   423       const replacementKeyMap = {
   389       const replacementKeyMap = {
   424         [SHIFT]: 'Shift',
   390         [SHIFT]: 'Shift',
   425         [COMMAND]: isApple ? 'Command' : 'Control',
   391         [COMMAND]: isApple ? 'Command' : 'Control',
   426         [CTRL]: 'Control',
   392         [CTRL]: 'Control',
   427         [ALT]: isApple ? 'Option' : 'Alt',
   393         [ALT]: isApple ? 'Option' : 'Alt',
   428 
   394 
   429         /* translators: comma as in the character ',' */
   395         /* translators: comma as in the character ',' */
   430         ',': Object(external_wp_i18n_["__"])('Comma'),
   396         ',': (0,external_wp_i18n_namespaceObject.__)('Comma'),
   431 
   397 
   432         /* translators: period as in the character '.' */
   398         /* translators: period as in the character '.' */
   433         '.': Object(external_wp_i18n_["__"])('Period'),
   399         '.': (0,external_wp_i18n_namespaceObject.__)('Period'),
   434 
   400 
   435         /* translators: backtick as in the character '`' */
   401         /* translators: backtick as in the character '`' */
   436         '`': Object(external_wp_i18n_["__"])('Backtick')
   402         '`': (0,external_wp_i18n_namespaceObject.__)('Backtick')
   437       };
   403       };
   438       return [...modifier(_isApple), character].map(key => Object(external_lodash_["capitalize"])(Object(external_lodash_["get"])(replacementKeyMap, key, key))).join(isApple ? ' ' : ' + ');
   404       return [...modifier(_isApple), character].map(key => (0,external_lodash_namespaceObject.capitalize)((0,external_lodash_namespaceObject.get)(replacementKeyMap, key, key))).join(isApple ? ' ' : ' + ');
   439     }
   405     }
   440   );
   406   );
   441 });
   407 });
   442 /**
   408 /**
   443  * From a given KeyboardEvent, returns an array of active modifier constants for
   409  * From a given KeyboardEvent, returns an array of active modifier constants for
   470  * @type {WPModifierHandler<WPEventKeyHandler>} Keyed map of functions
   436  * @type {WPModifierHandler<WPEventKeyHandler>} Keyed map of functions
   471  *                                                       to match events.
   437  *                                                       to match events.
   472  */
   438  */
   473 
   439 
   474 
   440 
   475 const isKeyboardEvent = Object(external_lodash_["mapValues"])(modifiers, getModifiers => {
   441 const isKeyboardEvent = (0,external_lodash_namespaceObject.mapValues)(modifiers, getModifiers => {
   476   return (
   442   return (
   477     /** @type {WPEventKeyHandler} */
   443     /** @type {WPEventKeyHandler} */
   478     (event, character, _isApple = isAppleOS) => {
   444     function (event, character) {
       
   445       let _isApple = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : isAppleOS;
       
   446 
   479       const mods = getModifiers(_isApple);
   447       const mods = getModifiers(_isApple);
   480       const eventMods = getEventModifiers(event);
   448       const eventMods = getEventModifiers(event);
   481 
   449 
   482       if (Object(external_lodash_["xor"])(mods, eventMods).length) {
   450       if ((0,external_lodash_namespaceObject.xor)(mods, eventMods).length) {
   483         return false;
   451         return false;
   484       }
   452       }
   485 
   453 
       
   454       let key = event.key.toLowerCase();
       
   455 
   486       if (!character) {
   456       if (!character) {
   487         return Object(external_lodash_["includes"])(mods, event.key.toLowerCase());
   457         return (0,external_lodash_namespaceObject.includes)(mods, key);
   488       }
   458       }
   489 
   459 
   490       return event.key === character;
   460       if (event.altKey && character.length === 1) {
   491     }
   461         key = String.fromCharCode(event.keyCode).toLowerCase();
   492   );
   462       } // For backwards compatibility.
   493 });
   463 
   494 
   464 
   495 
   465       if (character === 'del') {
   496 /***/ })
   466         character = 'delete';
   497 
   467       }
   498 /******/ });
   468 
       
   469       return key === character.toLowerCase();
       
   470     }
       
   471   );
       
   472 });
       
   473 
       
   474 (window.wp = window.wp || {}).keycodes = __webpack_exports__;
       
   475 /******/ })()
       
   476 ;