wp/wp-includes/js/dist/keycodes.js
changeset 16 a86126ab1dd4
parent 9 177826044cd9
child 18 be944660c56a
equal deleted inserted replaced
15:3d4e9c994f10 16:a86126ab1dd4
    80 /******/ 	// __webpack_public_path__
    80 /******/ 	// __webpack_public_path__
    81 /******/ 	__webpack_require__.p = "";
    81 /******/ 	__webpack_require__.p = "";
    82 /******/
    82 /******/
    83 /******/
    83 /******/
    84 /******/ 	// Load entry module and return exports
    84 /******/ 	// Load entry module and return exports
    85 /******/ 	return __webpack_require__(__webpack_require__.s = 382);
    85 /******/ 	return __webpack_require__(__webpack_require__.s = 466);
    86 /******/ })
    86 /******/ })
    87 /************************************************************************/
    87 /************************************************************************/
    88 /******/ ({
    88 /******/ ({
    89 
    89 
    90 /***/ 1:
    90 /***/ 1:
    92 
    92 
    93 (function() { module.exports = this["wp"]["i18n"]; }());
    93 (function() { module.exports = this["wp"]["i18n"]; }());
    94 
    94 
    95 /***/ }),
    95 /***/ }),
    96 
    96 
    97 /***/ 15:
    97 /***/ 18:
       
    98 /***/ (function(module, __webpack_exports__, __webpack_require__) {
       
    99 
       
   100 "use strict";
       
   101 
       
   102 // EXPORTS
       
   103 __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _toConsumableArray; });
       
   104 
       
   105 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
       
   106 var arrayLikeToArray = __webpack_require__(26);
       
   107 
       
   108 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
       
   109 
       
   110 function _arrayWithoutHoles(arr) {
       
   111   if (Array.isArray(arr)) return Object(arrayLikeToArray["a" /* default */])(arr);
       
   112 }
       
   113 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
       
   114 var iterableToArray = __webpack_require__(35);
       
   115 
       
   116 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
       
   117 var unsupportedIterableToArray = __webpack_require__(29);
       
   118 
       
   119 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
       
   120 function _nonIterableSpread() {
       
   121   throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
       
   122 }
       
   123 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
       
   124 
       
   125 
       
   126 
       
   127 
       
   128 function _toConsumableArray(arr) {
       
   129   return _arrayWithoutHoles(arr) || Object(iterableToArray["a" /* default */])(arr) || Object(unsupportedIterableToArray["a" /* default */])(arr) || _nonIterableSpread();
       
   130 }
       
   131 
       
   132 /***/ }),
       
   133 
       
   134 /***/ 2:
       
   135 /***/ (function(module, exports) {
       
   136 
       
   137 (function() { module.exports = this["lodash"]; }());
       
   138 
       
   139 /***/ }),
       
   140 
       
   141 /***/ 26:
       
   142 /***/ (function(module, __webpack_exports__, __webpack_require__) {
       
   143 
       
   144 "use strict";
       
   145 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayLikeToArray; });
       
   146 function _arrayLikeToArray(arr, len) {
       
   147   if (len == null || len > arr.length) len = arr.length;
       
   148 
       
   149   for (var i = 0, arr2 = new Array(len); i < len; i++) {
       
   150     arr2[i] = arr[i];
       
   151   }
       
   152 
       
   153   return arr2;
       
   154 }
       
   155 
       
   156 /***/ }),
       
   157 
       
   158 /***/ 29:
       
   159 /***/ (function(module, __webpack_exports__, __webpack_require__) {
       
   160 
       
   161 "use strict";
       
   162 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _unsupportedIterableToArray; });
       
   163 /* harmony import */ var _arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26);
       
   164 
       
   165 function _unsupportedIterableToArray(o, minLen) {
       
   166   if (!o) return;
       
   167   if (typeof o === "string") return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
       
   168   var n = Object.prototype.toString.call(o).slice(8, -1);
       
   169   if (n === "Object" && o.constructor) n = o.constructor.name;
       
   170   if (n === "Map" || n === "Set") return Array.from(o);
       
   171   if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
       
   172 }
       
   173 
       
   174 /***/ }),
       
   175 
       
   176 /***/ 35:
       
   177 /***/ (function(module, __webpack_exports__, __webpack_require__) {
       
   178 
       
   179 "use strict";
       
   180 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _iterableToArray; });
       
   181 function _iterableToArray(iter) {
       
   182   if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
       
   183 }
       
   184 
       
   185 /***/ }),
       
   186 
       
   187 /***/ 466:
       
   188 /***/ (function(module, __webpack_exports__, __webpack_require__) {
       
   189 
       
   190 "use strict";
       
   191 // ESM COMPAT FLAG
       
   192 __webpack_require__.r(__webpack_exports__);
       
   193 
       
   194 // EXPORTS
       
   195 __webpack_require__.d(__webpack_exports__, "BACKSPACE", function() { return /* binding */ BACKSPACE; });
       
   196 __webpack_require__.d(__webpack_exports__, "TAB", function() { return /* binding */ TAB; });
       
   197 __webpack_require__.d(__webpack_exports__, "ENTER", function() { return /* binding */ ENTER; });
       
   198 __webpack_require__.d(__webpack_exports__, "ESCAPE", function() { return /* binding */ ESCAPE; });
       
   199 __webpack_require__.d(__webpack_exports__, "SPACE", function() { return /* binding */ SPACE; });
       
   200 __webpack_require__.d(__webpack_exports__, "LEFT", function() { return /* binding */ LEFT; });
       
   201 __webpack_require__.d(__webpack_exports__, "UP", function() { return /* binding */ UP; });
       
   202 __webpack_require__.d(__webpack_exports__, "RIGHT", function() { return /* binding */ RIGHT; });
       
   203 __webpack_require__.d(__webpack_exports__, "DOWN", function() { return /* binding */ DOWN; });
       
   204 __webpack_require__.d(__webpack_exports__, "DELETE", function() { return /* binding */ DELETE; });
       
   205 __webpack_require__.d(__webpack_exports__, "F10", function() { return /* binding */ F10; });
       
   206 __webpack_require__.d(__webpack_exports__, "ALT", function() { return /* binding */ ALT; });
       
   207 __webpack_require__.d(__webpack_exports__, "CTRL", function() { return /* binding */ CTRL; });
       
   208 __webpack_require__.d(__webpack_exports__, "COMMAND", function() { return /* binding */ COMMAND; });
       
   209 __webpack_require__.d(__webpack_exports__, "SHIFT", function() { return /* binding */ SHIFT; });
       
   210 __webpack_require__.d(__webpack_exports__, "ZERO", function() { return /* binding */ ZERO; });
       
   211 __webpack_require__.d(__webpack_exports__, "modifiers", function() { return /* binding */ modifiers; });
       
   212 __webpack_require__.d(__webpack_exports__, "rawShortcut", function() { return /* binding */ rawShortcut; });
       
   213 __webpack_require__.d(__webpack_exports__, "displayShortcutList", function() { return /* binding */ displayShortcutList; });
       
   214 __webpack_require__.d(__webpack_exports__, "displayShortcut", function() { return /* binding */ displayShortcut; });
       
   215 __webpack_require__.d(__webpack_exports__, "shortcutAriaLabel", function() { return /* binding */ shortcutAriaLabel; });
       
   216 __webpack_require__.d(__webpack_exports__, "isKeyboardEvent", function() { return /* binding */ isKeyboardEvent; });
       
   217 
       
   218 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
       
   219 var defineProperty = __webpack_require__(5);
       
   220 
       
   221 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
       
   222 var toConsumableArray = __webpack_require__(18);
       
   223 
       
   224 // EXTERNAL MODULE: external {"this":"lodash"}
       
   225 var external_this_lodash_ = __webpack_require__(2);
       
   226 
       
   227 // EXTERNAL MODULE: external {"this":["wp","i18n"]}
       
   228 var external_this_wp_i18n_ = __webpack_require__(1);
       
   229 
       
   230 // CONCATENATED MODULE: ./node_modules/@wordpress/keycodes/build-module/platform.js
       
   231 /**
       
   232  * External dependencies
       
   233  */
       
   234 
       
   235 /**
       
   236  * Return true if platform is MacOS.
       
   237  *
       
   238  * @param {Object} _window   window object by default; used for DI testing.
       
   239  *
       
   240  * @return {boolean}         True if MacOS; false otherwise.
       
   241  */
       
   242 
       
   243 function isAppleOS() {
       
   244   var _window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
       
   245 
       
   246   var platform = _window.navigator.platform;
       
   247   return platform.indexOf('Mac') !== -1 || Object(external_this_lodash_["includes"])(['iPad', 'iPhone'], platform);
       
   248 }
       
   249 
       
   250 // CONCATENATED MODULE: ./node_modules/@wordpress/keycodes/build-module/index.js
       
   251 
       
   252 
       
   253 
       
   254 /**
       
   255  * Note: The order of the modifier keys in many of the [foo]Shortcut()
       
   256  * functions in this file are intentional and should not be changed. They're
       
   257  * designed to fit with the standard menu keyboard shortcuts shown in the
       
   258  * user's platform.
       
   259  *
       
   260  * For example, on MacOS menu shortcuts will place Shift before Command, but
       
   261  * on Windows Control will usually come first. So don't provide your own
       
   262  * shortcut combos directly to keyboardShortcut().
       
   263  */
       
   264 
       
   265 /**
       
   266  * External dependencies
       
   267  */
       
   268 
       
   269 /**
       
   270  * WordPress dependencies
       
   271  */
       
   272 
       
   273 
       
   274 /**
       
   275  * Internal dependencies
       
   276  */
       
   277 
       
   278 
       
   279 /**
       
   280  * @typedef {'primary'|'primaryShift'|'primaryAlt'|'secondary'|'access'|'ctrl'|'alt'|'ctrlShift'|'shift'|'shiftAlt'} WPKeycodeModifier
       
   281  */
       
   282 
       
   283 /**
       
   284  * An object of handler functions for each of the possible modifier
       
   285  * combinations. A handler will return a value for a given key.
       
   286  *
       
   287  * @typedef {Record<WPKeycodeModifier, (key:string)=>any>} WPKeycodeHandlerByModifier
       
   288  */
       
   289 
       
   290 /**
       
   291  * Keycode for BACKSPACE key.
       
   292  */
       
   293 
       
   294 var BACKSPACE = 8;
       
   295 /**
       
   296  * Keycode for TAB key.
       
   297  */
       
   298 
       
   299 var TAB = 9;
       
   300 /**
       
   301  * Keycode for ENTER key.
       
   302  */
       
   303 
       
   304 var ENTER = 13;
       
   305 /**
       
   306  * Keycode for ESCAPE key.
       
   307  */
       
   308 
       
   309 var ESCAPE = 27;
       
   310 /**
       
   311  * Keycode for SPACE key.
       
   312  */
       
   313 
       
   314 var SPACE = 32;
       
   315 /**
       
   316  * Keycode for LEFT key.
       
   317  */
       
   318 
       
   319 var LEFT = 37;
       
   320 /**
       
   321  * Keycode for UP key.
       
   322  */
       
   323 
       
   324 var UP = 38;
       
   325 /**
       
   326  * Keycode for RIGHT key.
       
   327  */
       
   328 
       
   329 var RIGHT = 39;
       
   330 /**
       
   331  * Keycode for DOWN key.
       
   332  */
       
   333 
       
   334 var DOWN = 40;
       
   335 /**
       
   336  * Keycode for DELETE key.
       
   337  */
       
   338 
       
   339 var DELETE = 46;
       
   340 /**
       
   341  * Keycode for F10 key.
       
   342  */
       
   343 
       
   344 var F10 = 121;
       
   345 /**
       
   346  * Keycode for ALT key.
       
   347  */
       
   348 
       
   349 var ALT = 'alt';
       
   350 /**
       
   351  * Keycode for CTRL key.
       
   352  */
       
   353 
       
   354 var CTRL = 'ctrl';
       
   355 /**
       
   356  * Keycode for COMMAND/META key.
       
   357  */
       
   358 
       
   359 var COMMAND = 'meta';
       
   360 /**
       
   361  * Keycode for SHIFT key.
       
   362  */
       
   363 
       
   364 var SHIFT = 'shift';
       
   365 /**
       
   366  * Keycode for ZERO key.
       
   367  */
       
   368 
       
   369 var ZERO = 48;
       
   370 /**
       
   371  * Object that contains functions that return the available modifier
       
   372  * depending on platform.
       
   373  *
       
   374  * - `primary`: takes a isApple function as a parameter.
       
   375  * - `primaryShift`: takes a isApple function as a parameter.
       
   376  * - `primaryAlt`: takes a isApple function as a parameter.
       
   377  * - `secondary`: takes a isApple function as a parameter.
       
   378  * - `access`: takes a isApple function as a parameter.
       
   379  * - `ctrl`
       
   380  * - `alt`
       
   381  * - `ctrlShift`
       
   382  * - `shift`
       
   383  * - `shiftAlt`
       
   384  */
       
   385 
       
   386 var modifiers = {
       
   387   primary: function primary(_isApple) {
       
   388     return _isApple() ? [COMMAND] : [CTRL];
       
   389   },
       
   390   primaryShift: function primaryShift(_isApple) {
       
   391     return _isApple() ? [SHIFT, COMMAND] : [CTRL, SHIFT];
       
   392   },
       
   393   primaryAlt: function primaryAlt(_isApple) {
       
   394     return _isApple() ? [ALT, COMMAND] : [CTRL, ALT];
       
   395   },
       
   396   secondary: function secondary(_isApple) {
       
   397     return _isApple() ? [SHIFT, ALT, COMMAND] : [CTRL, SHIFT, ALT];
       
   398   },
       
   399   access: function access(_isApple) {
       
   400     return _isApple() ? [CTRL, ALT] : [SHIFT, ALT];
       
   401   },
       
   402   ctrl: function ctrl() {
       
   403     return [CTRL];
       
   404   },
       
   405   alt: function alt() {
       
   406     return [ALT];
       
   407   },
       
   408   ctrlShift: function ctrlShift() {
       
   409     return [CTRL, SHIFT];
       
   410   },
       
   411   shift: function shift() {
       
   412     return [SHIFT];
       
   413   },
       
   414   shiftAlt: function shiftAlt() {
       
   415     return [SHIFT, ALT];
       
   416   }
       
   417 };
       
   418 /**
       
   419  * An object that contains functions to get raw shortcuts.
       
   420  * E.g. rawShortcut.primary( 'm' ) will return 'meta+m' on Mac.
       
   421  * These are intended for user with the KeyboardShortcuts component or TinyMCE.
       
   422  *
       
   423  * @type {WPKeycodeHandlerByModifier} Keyed map of functions to raw shortcuts.
       
   424  */
       
   425 
       
   426 var rawShortcut = Object(external_this_lodash_["mapValues"])(modifiers, function (modifier) {
       
   427   return function (character) {
       
   428     var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isAppleOS;
       
   429 
       
   430     return [].concat(Object(toConsumableArray["a" /* default */])(modifier(_isApple)), [character.toLowerCase()]).join('+');
       
   431   };
       
   432 });
       
   433 /**
       
   434  * Return an array of the parts of a keyboard shortcut chord for display
       
   435  * E.g displayShortcutList.primary( 'm' ) will return [ '⌘', 'M' ] on Mac.
       
   436  *
       
   437  * @type {WPKeycodeHandlerByModifier} Keyed map of functions to shortcut
       
   438  *                                    sequences.
       
   439  */
       
   440 
       
   441 var displayShortcutList = Object(external_this_lodash_["mapValues"])(modifiers, function (modifier) {
       
   442   return function (character) {
       
   443     var _replacementKeyMap;
       
   444 
       
   445     var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isAppleOS;
       
   446 
       
   447     var isApple = _isApple();
       
   448 
       
   449     var replacementKeyMap = (_replacementKeyMap = {}, Object(defineProperty["a" /* default */])(_replacementKeyMap, ALT, isApple ? '⌥' : 'Alt'), Object(defineProperty["a" /* default */])(_replacementKeyMap, CTRL, isApple ? '^' : 'Ctrl'), Object(defineProperty["a" /* default */])(_replacementKeyMap, COMMAND, '⌘'), Object(defineProperty["a" /* default */])(_replacementKeyMap, SHIFT, isApple ? '⇧' : 'Shift'), _replacementKeyMap);
       
   450     var modifierKeys = modifier(_isApple).reduce(function (accumulator, key) {
       
   451       var replacementKey = Object(external_this_lodash_["get"])(replacementKeyMap, key, key); // If on the Mac, adhere to platform convention and don't show plus between keys.
       
   452 
       
   453       if (isApple) {
       
   454         return [].concat(Object(toConsumableArray["a" /* default */])(accumulator), [replacementKey]);
       
   455       }
       
   456 
       
   457       return [].concat(Object(toConsumableArray["a" /* default */])(accumulator), [replacementKey, '+']);
       
   458     }, []);
       
   459     var capitalizedCharacter = Object(external_this_lodash_["capitalize"])(character);
       
   460     return [].concat(Object(toConsumableArray["a" /* default */])(modifierKeys), [capitalizedCharacter]);
       
   461   };
       
   462 });
       
   463 /**
       
   464  * An object that contains functions to display shortcuts.
       
   465  * E.g. displayShortcut.primary( 'm' ) will return '⌘M' on Mac.
       
   466  *
       
   467  * @type {WPKeycodeHandlerByModifier} Keyed map of functions to display
       
   468  *                                    shortcuts.
       
   469  */
       
   470 
       
   471 var displayShortcut = Object(external_this_lodash_["mapValues"])(displayShortcutList, function (shortcutList) {
       
   472   return function (character) {
       
   473     var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isAppleOS;
       
   474 
       
   475     return shortcutList(character, _isApple).join('');
       
   476   };
       
   477 });
       
   478 /**
       
   479  * An object that contains functions to return an aria label for a keyboard shortcut.
       
   480  * E.g. shortcutAriaLabel.primary( '.' ) will return 'Command + Period' on Mac.
       
   481  *
       
   482  * @type {WPKeycodeHandlerByModifier} Keyed map of functions to shortcut ARIA
       
   483  *                                    labels.
       
   484  */
       
   485 
       
   486 var shortcutAriaLabel = Object(external_this_lodash_["mapValues"])(modifiers, function (modifier) {
       
   487   return function (character) {
       
   488     var _replacementKeyMap2;
       
   489 
       
   490     var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isAppleOS;
       
   491 
       
   492     var isApple = _isApple();
       
   493 
       
   494     var replacementKeyMap = (_replacementKeyMap2 = {}, Object(defineProperty["a" /* default */])(_replacementKeyMap2, SHIFT, 'Shift'), Object(defineProperty["a" /* default */])(_replacementKeyMap2, COMMAND, isApple ? 'Command' : 'Control'), Object(defineProperty["a" /* default */])(_replacementKeyMap2, CTRL, 'Control'), Object(defineProperty["a" /* default */])(_replacementKeyMap2, ALT, isApple ? 'Option' : 'Alt'), Object(defineProperty["a" /* default */])(_replacementKeyMap2, ',', Object(external_this_wp_i18n_["__"])('Comma')), Object(defineProperty["a" /* default */])(_replacementKeyMap2, '.', Object(external_this_wp_i18n_["__"])('Period')), Object(defineProperty["a" /* default */])(_replacementKeyMap2, '`', Object(external_this_wp_i18n_["__"])('Backtick')), _replacementKeyMap2);
       
   495     return [].concat(Object(toConsumableArray["a" /* default */])(modifier(_isApple)), [character]).map(function (key) {
       
   496       return Object(external_this_lodash_["capitalize"])(Object(external_this_lodash_["get"])(replacementKeyMap, key, key));
       
   497     }).join(isApple ? ' ' : ' + ');
       
   498   };
       
   499 });
       
   500 /**
       
   501  * From a given KeyboardEvent, returns an array of active modifier constants for
       
   502  * the event.
       
   503  *
       
   504  * @param {KeyboardEvent} event Keyboard event.
       
   505  *
       
   506  * @return {Array<ALT|CTRL|COMMAND|SHIFT>} Active modifier constants.
       
   507  */
       
   508 
       
   509 function getEventModifiers(event) {
       
   510   return [ALT, CTRL, COMMAND, SHIFT].filter(function (key) {
       
   511     return event["".concat(key, "Key")];
       
   512   });
       
   513 }
       
   514 /**
       
   515  * An object that contains functions to check if a keyboard event matches a
       
   516  * predefined shortcut combination.
       
   517  * E.g. isKeyboardEvent.primary( event, 'm' ) will return true if the event
       
   518  * signals pressing ⌘M.
       
   519  *
       
   520  * @type {WPKeycodeHandlerByModifier} Keyed map of functions to match events.
       
   521  */
       
   522 
       
   523 
       
   524 var isKeyboardEvent = Object(external_this_lodash_["mapValues"])(modifiers, function (getModifiers) {
       
   525   return function (event, character) {
       
   526     var _isApple = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : isAppleOS;
       
   527 
       
   528     var mods = getModifiers(_isApple);
       
   529     var eventMods = getEventModifiers(event);
       
   530 
       
   531     if (Object(external_this_lodash_["xor"])(mods, eventMods).length) {
       
   532       return false;
       
   533     }
       
   534 
       
   535     if (!character) {
       
   536       return Object(external_this_lodash_["includes"])(mods, event.key.toLowerCase());
       
   537     }
       
   538 
       
   539     return event.key === character;
       
   540   };
       
   541 });
       
   542 
       
   543 
       
   544 /***/ }),
       
   545 
       
   546 /***/ 5:
    98 /***/ (function(module, __webpack_exports__, __webpack_require__) {
   547 /***/ (function(module, __webpack_exports__, __webpack_require__) {
    99 
   548 
   100 "use strict";
   549 "use strict";
   101 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; });
   550 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; });
   102 function _defineProperty(obj, key, value) {
   551 function _defineProperty(obj, key, value) {
   112   }
   561   }
   113 
   562 
   114   return obj;
   563   return obj;
   115 }
   564 }
   116 
   565 
   117 /***/ }),
       
   118 
       
   119 /***/ 17:
       
   120 /***/ (function(module, __webpack_exports__, __webpack_require__) {
       
   121 
       
   122 "use strict";
       
   123 
       
   124 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
       
   125 function _arrayWithoutHoles(arr) {
       
   126   if (Array.isArray(arr)) {
       
   127     for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {
       
   128       arr2[i] = arr[i];
       
   129     }
       
   130 
       
   131     return arr2;
       
   132   }
       
   133 }
       
   134 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
       
   135 var iterableToArray = __webpack_require__(34);
       
   136 
       
   137 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
       
   138 function _nonIterableSpread() {
       
   139   throw new TypeError("Invalid attempt to spread non-iterable instance");
       
   140 }
       
   141 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
       
   142 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _toConsumableArray; });
       
   143 
       
   144 
       
   145 
       
   146 function _toConsumableArray(arr) {
       
   147   return _arrayWithoutHoles(arr) || Object(iterableToArray["a" /* default */])(arr) || _nonIterableSpread();
       
   148 }
       
   149 
       
   150 /***/ }),
       
   151 
       
   152 /***/ 2:
       
   153 /***/ (function(module, exports) {
       
   154 
       
   155 (function() { module.exports = this["lodash"]; }());
       
   156 
       
   157 /***/ }),
       
   158 
       
   159 /***/ 34:
       
   160 /***/ (function(module, __webpack_exports__, __webpack_require__) {
       
   161 
       
   162 "use strict";
       
   163 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _iterableToArray; });
       
   164 function _iterableToArray(iter) {
       
   165   if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
       
   166 }
       
   167 
       
   168 /***/ }),
       
   169 
       
   170 /***/ 382:
       
   171 /***/ (function(module, __webpack_exports__, __webpack_require__) {
       
   172 
       
   173 "use strict";
       
   174 __webpack_require__.r(__webpack_exports__);
       
   175 
       
   176 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
       
   177 var defineProperty = __webpack_require__(15);
       
   178 
       
   179 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
       
   180 var toConsumableArray = __webpack_require__(17);
       
   181 
       
   182 // EXTERNAL MODULE: external "lodash"
       
   183 var external_lodash_ = __webpack_require__(2);
       
   184 
       
   185 // EXTERNAL MODULE: external {"this":["wp","i18n"]}
       
   186 var external_this_wp_i18n_ = __webpack_require__(1);
       
   187 
       
   188 // CONCATENATED MODULE: ./node_modules/@wordpress/keycodes/build-module/platform.js
       
   189 /**
       
   190  * External dependencies
       
   191  */
       
   192 
       
   193 /**
       
   194  * Return true if platform is MacOS.
       
   195  *
       
   196  * @param {Object} _window   window object by default; used for DI testing.
       
   197  *
       
   198  * @return {boolean}         True if MacOS; false otherwise.
       
   199  */
       
   200 
       
   201 function isAppleOS() {
       
   202   var _window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
       
   203 
       
   204   var platform = _window.navigator.platform;
       
   205   return platform.indexOf('Mac') !== -1 || Object(external_lodash_["includes"])(['iPad', 'iPhone'], platform);
       
   206 }
       
   207 
       
   208 // CONCATENATED MODULE: ./node_modules/@wordpress/keycodes/build-module/index.js
       
   209 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BACKSPACE", function() { return BACKSPACE; });
       
   210 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TAB", function() { return TAB; });
       
   211 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ENTER", function() { return ENTER; });
       
   212 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ESCAPE", function() { return ESCAPE; });
       
   213 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SPACE", function() { return SPACE; });
       
   214 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LEFT", function() { return LEFT; });
       
   215 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UP", function() { return UP; });
       
   216 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RIGHT", function() { return RIGHT; });
       
   217 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DOWN", function() { return DOWN; });
       
   218 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DELETE", function() { return DELETE; });
       
   219 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "F10", function() { return F10; });
       
   220 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ALT", function() { return ALT; });
       
   221 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CTRL", function() { return CTRL; });
       
   222 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "COMMAND", function() { return COMMAND; });
       
   223 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SHIFT", function() { return SHIFT; });
       
   224 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modifiers", function() { return modifiers; });
       
   225 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rawShortcut", function() { return rawShortcut; });
       
   226 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "displayShortcutList", function() { return displayShortcutList; });
       
   227 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "displayShortcut", function() { return displayShortcut; });
       
   228 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shortcutAriaLabel", function() { return shortcutAriaLabel; });
       
   229 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isKeyboardEvent", function() { return isKeyboardEvent; });
       
   230 
       
   231 
       
   232 
       
   233 /**
       
   234  * Note: The order of the modifier keys in many of the [foo]Shortcut()
       
   235  * functions in this file are intentional and should not be changed. They're
       
   236  * designed to fit with the standard menu keyboard shortcuts shown in the
       
   237  * user's platform.
       
   238  *
       
   239  * For example, on MacOS menu shortcuts will place Shift before Command, but
       
   240  * on Windows Control will usually come first. So don't provide your own
       
   241  * shortcut combos directly to keyboardShortcut().
       
   242  */
       
   243 
       
   244 /**
       
   245  * External dependencies
       
   246  */
       
   247 
       
   248 /**
       
   249  * WordPress dependencies
       
   250  */
       
   251 
       
   252 
       
   253 /**
       
   254  * Internal dependencies
       
   255  */
       
   256 
       
   257 
       
   258 /**
       
   259  * Keycode for BACKSPACE key.
       
   260  */
       
   261 
       
   262 var BACKSPACE = 8;
       
   263 /**
       
   264  * Keycode for TAB key.
       
   265  */
       
   266 
       
   267 var TAB = 9;
       
   268 /**
       
   269  * Keycode for ENTER key.
       
   270  */
       
   271 
       
   272 var ENTER = 13;
       
   273 /**
       
   274  * Keycode for ESCAPE key.
       
   275  */
       
   276 
       
   277 var ESCAPE = 27;
       
   278 /**
       
   279  * Keycode for SPACE key.
       
   280  */
       
   281 
       
   282 var SPACE = 32;
       
   283 /**
       
   284  * Keycode for LEFT key.
       
   285  */
       
   286 
       
   287 var LEFT = 37;
       
   288 /**
       
   289  * Keycode for UP key.
       
   290  */
       
   291 
       
   292 var UP = 38;
       
   293 /**
       
   294  * Keycode for RIGHT key.
       
   295  */
       
   296 
       
   297 var RIGHT = 39;
       
   298 /**
       
   299  * Keycode for DOWN key.
       
   300  */
       
   301 
       
   302 var DOWN = 40;
       
   303 /**
       
   304  * Keycode for DELETE key.
       
   305  */
       
   306 
       
   307 var DELETE = 46;
       
   308 /**
       
   309  * Keycode for F10 key.
       
   310  */
       
   311 
       
   312 var F10 = 121;
       
   313 /**
       
   314  * Keycode for ALT key.
       
   315  */
       
   316 
       
   317 var ALT = 'alt';
       
   318 /**
       
   319  * Keycode for CTRL key.
       
   320  */
       
   321 
       
   322 var CTRL = 'ctrl';
       
   323 /**
       
   324  * Keycode for COMMAND/META key.
       
   325  */
       
   326 
       
   327 var COMMAND = 'meta';
       
   328 /**
       
   329  * Keycode for SHIFT key.
       
   330  */
       
   331 
       
   332 var SHIFT = 'shift';
       
   333 /**
       
   334  * Object that contains functions that return the available modifier
       
   335  * depending on platform.
       
   336  *
       
   337  * - `primary`: takes a isApple function as a parameter.
       
   338  * - `primaryShift`: takes a isApple function as a parameter.
       
   339  * - `primaryAlt`: takes a isApple function as a parameter.
       
   340  * - `secondary`: takes a isApple function as a parameter.
       
   341  * - `access`: takes a isApple function as a parameter.
       
   342  * - `ctrl`
       
   343  * - `alt`
       
   344  * - `ctrlShift`
       
   345  * - `shift`
       
   346  * - `shiftAlt`
       
   347  */
       
   348 
       
   349 var modifiers = {
       
   350   primary: function primary(_isApple) {
       
   351     return _isApple() ? [COMMAND] : [CTRL];
       
   352   },
       
   353   primaryShift: function primaryShift(_isApple) {
       
   354     return _isApple() ? [SHIFT, COMMAND] : [CTRL, SHIFT];
       
   355   },
       
   356   primaryAlt: function primaryAlt(_isApple) {
       
   357     return _isApple() ? [ALT, COMMAND] : [CTRL, ALT];
       
   358   },
       
   359   secondary: function secondary(_isApple) {
       
   360     return _isApple() ? [SHIFT, ALT, COMMAND] : [CTRL, SHIFT, ALT];
       
   361   },
       
   362   access: function access(_isApple) {
       
   363     return _isApple() ? [CTRL, ALT] : [SHIFT, ALT];
       
   364   },
       
   365   ctrl: function ctrl() {
       
   366     return [CTRL];
       
   367   },
       
   368   alt: function alt() {
       
   369     return [ALT];
       
   370   },
       
   371   ctrlShift: function ctrlShift() {
       
   372     return [CTRL, SHIFT];
       
   373   },
       
   374   shift: function shift() {
       
   375     return [SHIFT];
       
   376   },
       
   377   shiftAlt: function shiftAlt() {
       
   378     return [SHIFT, ALT];
       
   379   }
       
   380 };
       
   381 /**
       
   382  * An object that contains functions to get raw shortcuts.
       
   383  * E.g. rawShortcut.primary( 'm' ) will return 'meta+m' on Mac.
       
   384  * These are intended for user with the KeyboardShortcuts component or TinyMCE.
       
   385  *
       
   386  * @type {Object} Keyed map of functions to raw shortcuts.
       
   387  */
       
   388 
       
   389 var rawShortcut = Object(external_lodash_["mapValues"])(modifiers, function (modifier) {
       
   390   return function (character) {
       
   391     var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isAppleOS;
       
   392 
       
   393     return [].concat(Object(toConsumableArray["a" /* default */])(modifier(_isApple)), [character.toLowerCase()]).join('+');
       
   394   };
       
   395 });
       
   396 /**
       
   397  * Return an array of the parts of a keyboard shortcut chord for display
       
   398  * E.g displayShortcutList.primary( 'm' ) will return [ '⌘', 'M' ] on Mac.
       
   399  *
       
   400  * @type {Object} keyed map of functions to shortcut sequences
       
   401  */
       
   402 
       
   403 var displayShortcutList = Object(external_lodash_["mapValues"])(modifiers, function (modifier) {
       
   404   return function (character) {
       
   405     var _replacementKeyMap;
       
   406 
       
   407     var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isAppleOS;
       
   408 
       
   409     var isApple = _isApple();
       
   410 
       
   411     var replacementKeyMap = (_replacementKeyMap = {}, Object(defineProperty["a" /* default */])(_replacementKeyMap, ALT, isApple ? '⌥' : 'Alt'), Object(defineProperty["a" /* default */])(_replacementKeyMap, CTRL, isApple ? '^' : 'Ctrl'), Object(defineProperty["a" /* default */])(_replacementKeyMap, COMMAND, '⌘'), Object(defineProperty["a" /* default */])(_replacementKeyMap, SHIFT, isApple ? '⇧' : 'Shift'), _replacementKeyMap);
       
   412     var modifierKeys = modifier(_isApple).reduce(function (accumulator, key) {
       
   413       var replacementKey = Object(external_lodash_["get"])(replacementKeyMap, key, key); // If on the Mac, adhere to platform convention and don't show plus between keys.
       
   414 
       
   415       if (isApple) {
       
   416         return [].concat(Object(toConsumableArray["a" /* default */])(accumulator), [replacementKey]);
       
   417       }
       
   418 
       
   419       return [].concat(Object(toConsumableArray["a" /* default */])(accumulator), [replacementKey, '+']);
       
   420     }, []);
       
   421     var capitalizedCharacter = Object(external_lodash_["capitalize"])(character);
       
   422     return [].concat(Object(toConsumableArray["a" /* default */])(modifierKeys), [capitalizedCharacter]);
       
   423   };
       
   424 });
       
   425 /**
       
   426  * An object that contains functions to display shortcuts.
       
   427  * E.g. displayShortcut.primary( 'm' ) will return '⌘M' on Mac.
       
   428  *
       
   429  * @type {Object} Keyed map of functions to display shortcuts.
       
   430  */
       
   431 
       
   432 var displayShortcut = Object(external_lodash_["mapValues"])(displayShortcutList, function (shortcutList) {
       
   433   return function (character) {
       
   434     var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isAppleOS;
       
   435 
       
   436     return shortcutList(character, _isApple).join('');
       
   437   };
       
   438 });
       
   439 /**
       
   440  * An object that contains functions to return an aria label for a keyboard shortcut.
       
   441  * E.g. shortcutAriaLabel.primary( '.' ) will return 'Command + Period' on Mac.
       
   442  */
       
   443 
       
   444 var shortcutAriaLabel = Object(external_lodash_["mapValues"])(modifiers, function (modifier) {
       
   445   return function (character) {
       
   446     var _replacementKeyMap2;
       
   447 
       
   448     var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isAppleOS;
       
   449 
       
   450     var isApple = _isApple();
       
   451 
       
   452     var replacementKeyMap = (_replacementKeyMap2 = {}, Object(defineProperty["a" /* default */])(_replacementKeyMap2, SHIFT, 'Shift'), Object(defineProperty["a" /* default */])(_replacementKeyMap2, COMMAND, isApple ? 'Command' : 'Control'), Object(defineProperty["a" /* default */])(_replacementKeyMap2, CTRL, 'Control'), Object(defineProperty["a" /* default */])(_replacementKeyMap2, ALT, isApple ? 'Option' : 'Alt'), Object(defineProperty["a" /* default */])(_replacementKeyMap2, ',', Object(external_this_wp_i18n_["__"])('Comma')), Object(defineProperty["a" /* default */])(_replacementKeyMap2, '.', Object(external_this_wp_i18n_["__"])('Period')), Object(defineProperty["a" /* default */])(_replacementKeyMap2, '`', Object(external_this_wp_i18n_["__"])('Backtick')), _replacementKeyMap2);
       
   453     return [].concat(Object(toConsumableArray["a" /* default */])(modifier(_isApple)), [character]).map(function (key) {
       
   454       return Object(external_lodash_["capitalize"])(Object(external_lodash_["get"])(replacementKeyMap, key, key));
       
   455     }).join(isApple ? ' ' : ' + ');
       
   456   };
       
   457 });
       
   458 /**
       
   459  * An object that contains functions to check if a keyboard event matches a
       
   460  * predefined shortcut combination.
       
   461  * E.g. isKeyboardEvent.primary( event, 'm' ) will return true if the event
       
   462  * signals pressing ⌘M.
       
   463  *
       
   464  * @type {Object} Keyed map of functions to match events.
       
   465  */
       
   466 
       
   467 var isKeyboardEvent = Object(external_lodash_["mapValues"])(modifiers, function (getModifiers) {
       
   468   return function (event, character) {
       
   469     var _isApple = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : isAppleOS;
       
   470 
       
   471     var mods = getModifiers(_isApple);
       
   472 
       
   473     if (!mods.every(function (key) {
       
   474       return event["".concat(key, "Key")];
       
   475     })) {
       
   476       return false;
       
   477     }
       
   478 
       
   479     if (!character) {
       
   480       return Object(external_lodash_["includes"])(mods, event.key.toLowerCase());
       
   481     }
       
   482 
       
   483     return event.key === character;
       
   484   };
       
   485 });
       
   486 
       
   487 
       
   488 /***/ })
   566 /***/ })
   489 
   567 
   490 /******/ });
   568 /******/ });