[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/js/dist/ -> keycodes.js (source)

   1  this["wp"] = this["wp"] || {}; this["wp"]["keycodes"] =
   2  /******/ (function(modules) { // webpackBootstrap
   3  /******/     // The module cache
   4  /******/     var installedModules = {};
   5  /******/
   6  /******/     // The require function
   7  /******/ 	function __webpack_require__(moduleId) {
   8  /******/
   9  /******/         // Check if module is in cache
  10  /******/         if(installedModules[moduleId]) {
  11  /******/             return installedModules[moduleId].exports;
  12  /******/         }
  13  /******/         // Create a new module (and put it into the cache)
  14  /******/         var module = installedModules[moduleId] = {
  15  /******/             i: moduleId,
  16  /******/             l: false,
  17  /******/             exports: {}
  18  /******/         };
  19  /******/
  20  /******/         // Execute the module function
  21  /******/         modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  22  /******/
  23  /******/         // Flag the module as loaded
  24  /******/         module.l = true;
  25  /******/
  26  /******/         // Return the exports of the module
  27  /******/         return module.exports;
  28  /******/     }
  29  /******/
  30  /******/
  31  /******/     // expose the modules object (__webpack_modules__)
  32  /******/     __webpack_require__.m = modules;
  33  /******/
  34  /******/     // expose the module cache
  35  /******/     __webpack_require__.c = installedModules;
  36  /******/
  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 = 481);
  86  /******/ })
  87  /************************************************************************/
  88  /******/ ({
  89  
  90  /***/ 1:
  91  /***/ (function(module, exports) {
  92  
  93  (function() { module.exports = window["wp"]["i18n"]; }());
  94  
  95  /***/ }),
  96  
  97  /***/ 15:
  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__(24);
 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__(42);
 115  
 116  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
 117  var unsupportedIterableToArray = __webpack_require__(28);
 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 = window["lodash"]; }());
 138  
 139  /***/ }),
 140  
 141  /***/ 24:
 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  /***/ 28:
 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_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(24);
 164  
 165  function _unsupportedIterableToArray(o, minLen) {
 166    if (!o) return;
 167    if (typeof o === "string") return Object(_arrayLikeToArray_js__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_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
 172  }
 173  
 174  /***/ }),
 175  
 176  /***/ 42:
 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" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
 183  }
 184  
 185  /***/ }),
 186  
 187  /***/ 481:
 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__(15);
 223  
 224  // EXTERNAL MODULE: external "lodash"
 225  var external_lodash_ = __webpack_require__(2);
 226  
 227  // EXTERNAL MODULE: external ["wp","i18n"]
 228  var external_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 {Window?} _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] : null;
 245  
 246    if (!_window) {
 247      if (typeof window === 'undefined') {
 248        return false;
 249      }
 250  
 251      _window = window;
 252    }
 253  
 254    var platform = _window.navigator.platform;
 255    return platform.indexOf('Mac') !== -1 || Object(external_lodash_["includes"])(['iPad', 'iPhone'], platform);
 256  }
 257  
 258  // CONCATENATED MODULE: ./node_modules/@wordpress/keycodes/build-module/index.js
 259  
 260  
 261  
 262  /**
 263   * Note: The order of the modifier keys in many of the [foo]Shortcut()
 264   * functions in this file are intentional and should not be changed. They're
 265   * designed to fit with the standard menu keyboard shortcuts shown in the
 266   * user's platform.
 267   *
 268   * For example, on MacOS menu shortcuts will place Shift before Command, but
 269   * on Windows Control will usually come first. So don't provide your own
 270   * shortcut combos directly to keyboardShortcut().
 271   */
 272  
 273  /**
 274   * External dependencies
 275   */
 276  
 277  /**
 278   * WordPress dependencies
 279   */
 280  
 281  
 282  /**
 283   * Internal dependencies
 284   */
 285  
 286  
 287  /** @typedef {typeof ALT | CTRL | COMMAND | SHIFT } WPModifierPart */
 288  
 289  /** @typedef {'primary' | 'primaryShift' | 'primaryAlt' | 'secondary' | 'access' | 'ctrl' | 'alt' | 'ctrlShift' | 'shift' | 'shiftAlt'} WPKeycodeModifier */
 290  
 291  /**
 292   * An object of handler functions for each of the possible modifier
 293   * combinations. A handler will return a value for a given key.
 294   *
 295   * @template T
 296   *
 297   * @typedef {Record<WPKeycodeModifier, T>} WPModifierHandler
 298   */
 299  
 300  /**
 301   * @template T
 302   *
 303   * @typedef {(character: string, isApple?: () => boolean) => T} WPKeyHandler
 304   */
 305  
 306  /** @typedef {(event: KeyboardEvent, character: string, isApple?: () => boolean) => boolean} WPEventKeyHandler */
 307  
 308  /**
 309   * Keycode for BACKSPACE key.
 310   */
 311  
 312  var BACKSPACE = 8;
 313  /**
 314   * Keycode for TAB key.
 315   */
 316  
 317  var TAB = 9;
 318  /**
 319   * Keycode for ENTER key.
 320   */
 321  
 322  var ENTER = 13;
 323  /**
 324   * Keycode for ESCAPE key.
 325   */
 326  
 327  var ESCAPE = 27;
 328  /**
 329   * Keycode for SPACE key.
 330   */
 331  
 332  var SPACE = 32;
 333  /**
 334   * Keycode for LEFT key.
 335   */
 336  
 337  var LEFT = 37;
 338  /**
 339   * Keycode for UP key.
 340   */
 341  
 342  var UP = 38;
 343  /**
 344   * Keycode for RIGHT key.
 345   */
 346  
 347  var RIGHT = 39;
 348  /**
 349   * Keycode for DOWN key.
 350   */
 351  
 352  var DOWN = 40;
 353  /**
 354   * Keycode for DELETE key.
 355   */
 356  
 357  var DELETE = 46;
 358  /**
 359   * Keycode for F10 key.
 360   */
 361  
 362  var F10 = 121;
 363  /**
 364   * Keycode for ALT key.
 365   */
 366  
 367  var ALT = 'alt';
 368  /**
 369   * Keycode for CTRL key.
 370   */
 371  
 372  var CTRL = 'ctrl';
 373  /**
 374   * Keycode for COMMAND/META key.
 375   */
 376  
 377  var COMMAND = 'meta';
 378  /**
 379   * Keycode for SHIFT key.
 380   */
 381  
 382  var SHIFT = 'shift';
 383  /**
 384   * Keycode for ZERO key.
 385   */
 386  
 387  var ZERO = 48;
 388  /**
 389   * Object that contains functions that return the available modifier
 390   * depending on platform.
 391   *
 392   * @type {WPModifierHandler< ( isApple: () => boolean ) => WPModifierPart[]>}
 393   */
 394  
 395  var modifiers = {
 396    primary: function primary(_isApple) {
 397      return _isApple() ? [COMMAND] : [CTRL];
 398    },
 399    primaryShift: function primaryShift(_isApple) {
 400      return _isApple() ? [SHIFT, COMMAND] : [CTRL, SHIFT];
 401    },
 402    primaryAlt: function primaryAlt(_isApple) {
 403      return _isApple() ? [ALT, COMMAND] : [CTRL, ALT];
 404    },
 405    secondary: function secondary(_isApple) {
 406      return _isApple() ? [SHIFT, ALT, COMMAND] : [CTRL, SHIFT, ALT];
 407    },
 408    access: function access(_isApple) {
 409      return _isApple() ? [CTRL, ALT] : [SHIFT, ALT];
 410    },
 411    ctrl: function ctrl() {
 412      return [CTRL];
 413    },
 414    alt: function alt() {
 415      return [ALT];
 416    },
 417    ctrlShift: function ctrlShift() {
 418      return [CTRL, SHIFT];
 419    },
 420    shift: function shift() {
 421      return [SHIFT];
 422    },
 423    shiftAlt: function shiftAlt() {
 424      return [SHIFT, ALT];
 425    }
 426  };
 427  /**
 428   * An object that contains functions to get raw shortcuts.
 429   *
 430   * These are intended for user with the KeyboardShortcuts.
 431   *
 432   * @example
 433   * ```js
 434   * // Assuming macOS:
 435   * rawShortcut.primary( 'm' )
 436   * // "meta+m""
 437   * ```
 438   *
 439   * @type {WPModifierHandler<WPKeyHandler<string>>} Keyed map of functions to raw
 440   *                                                 shortcuts.
 441   */
 442  
 443  var rawShortcut = Object(external_lodash_["mapValues"])(modifiers, function (modifier) {
 444    return (
 445      /** @type {WPKeyHandler<string>} */
 446      function (character) {
 447        var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isAppleOS;
 448  
 449        return [].concat(Object(toConsumableArray["a" /* default */])(modifier(_isApple)), [character.toLowerCase()]).join('+');
 450      }
 451    );
 452  });
 453  /**
 454   * Return an array of the parts of a keyboard shortcut chord for display.
 455   *
 456   * @example
 457   * ```js
 458   * // Assuming macOS:
 459   * displayShortcutList.primary( 'm' );
 460   * // [ "⌘", "M" ]
 461   * ```
 462   *
 463   * @type {WPModifierHandler<WPKeyHandler<string[]>>} Keyed map of functions to
 464   *                                                   shortcut sequences.
 465   */
 466  
 467  var displayShortcutList = Object(external_lodash_["mapValues"])(modifiers, function (modifier) {
 468    return (
 469      /** @type {WPKeyHandler<string[]>} */
 470      function (character) {
 471        var _replacementKeyMap;
 472  
 473        var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isAppleOS;
 474  
 475        var isApple = _isApple();
 476  
 477        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);
 478        var modifierKeys = modifier(_isApple).reduce(function (accumulator, key) {
 479          var replacementKey = Object(external_lodash_["get"])(replacementKeyMap, key, key); // If on the Mac, adhere to platform convention and don't show plus between keys.
 480  
 481          if (isApple) {
 482            return [].concat(Object(toConsumableArray["a" /* default */])(accumulator), [replacementKey]);
 483          }
 484  
 485          return [].concat(Object(toConsumableArray["a" /* default */])(accumulator), [replacementKey, '+']);
 486        },
 487        /** @type {string[]} */
 488        []);
 489        var capitalizedCharacter = Object(external_lodash_["capitalize"])(character);
 490        return [].concat(Object(toConsumableArray["a" /* default */])(modifierKeys), [capitalizedCharacter]);
 491      }
 492    );
 493  });
 494  /**
 495   * An object that contains functions to display shortcuts.
 496   *
 497   * @example
 498   * ```js
 499   * // Assuming macOS:
 500   * displayShortcut.primary( 'm' );
 501   * // "⌘M"
 502   * ```
 503   *
 504   * @type {WPModifierHandler<WPKeyHandler<string>>} Keyed map of functions to
 505   *                                                 display shortcuts.
 506   */
 507  
 508  var displayShortcut = Object(external_lodash_["mapValues"])(displayShortcutList, function (shortcutList) {
 509    return (
 510      /** @type {WPKeyHandler<string>} */
 511      function (character) {
 512        var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isAppleOS;
 513  
 514        return shortcutList(character, _isApple).join('');
 515      }
 516    );
 517  });
 518  /**
 519   * An object that contains functions to return an aria label for a keyboard
 520   * shortcut.
 521   *
 522   * @example
 523   * ```js
 524   * // Assuming macOS:
 525   * shortcutAriaLabel.primary( '.' );
 526   * // "Command + Period"
 527   * ```
 528   *
 529   * @type {WPModifierHandler<WPKeyHandler<string>>} Keyed map of functions to
 530   *                                                 shortcut ARIA labels.
 531   */
 532  
 533  var shortcutAriaLabel = Object(external_lodash_["mapValues"])(modifiers, function (modifier) {
 534    return (
 535      /** @type {WPKeyHandler<string>} */
 536      function (character) {
 537        var _replacementKeyMap2;
 538  
 539        var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isAppleOS;
 540  
 541        var isApple = _isApple();
 542  
 543        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_wp_i18n_["__"])('Comma')), Object(defineProperty["a" /* default */])(_replacementKeyMap2, '.', Object(external_wp_i18n_["__"])('Period')), Object(defineProperty["a" /* default */])(_replacementKeyMap2, '`', Object(external_wp_i18n_["__"])('Backtick')), _replacementKeyMap2);
 544        return [].concat(Object(toConsumableArray["a" /* default */])(modifier(_isApple)), [character]).map(function (key) {
 545          return Object(external_lodash_["capitalize"])(Object(external_lodash_["get"])(replacementKeyMap, key, key));
 546        }).join(isApple ? ' ' : ' + ');
 547      }
 548    );
 549  });
 550  /**
 551   * From a given KeyboardEvent, returns an array of active modifier constants for
 552   * the event.
 553   *
 554   * @param {KeyboardEvent} event Keyboard event.
 555   *
 556   * @return {Array<WPModifierPart>} Active modifier constants.
 557   */
 558  
 559  function getEventModifiers(event) {
 560    return (
 561      /** @type {WPModifierPart[]} */
 562      [ALT, CTRL, COMMAND, SHIFT].filter(function (key) {
 563        return event[
 564        /** @type {'altKey' | 'ctrlKey' | 'metaKey' | 'shiftKey'} */
 565        "".concat(key, "Key")];
 566      })
 567    );
 568  }
 569  /**
 570   * An object that contains functions to check if a keyboard event matches a
 571   * predefined shortcut combination.
 572   *
 573   * @example
 574   * ```js
 575   * // Assuming an event for ⌘M key press:
 576   * isKeyboardEvent.primary( event, 'm' );
 577   * // true
 578   * ```
 579   *
 580   * @type {WPModifierHandler<WPEventKeyHandler>} Keyed map of functions
 581   *                                                       to match events.
 582   */
 583  
 584  
 585  var isKeyboardEvent = Object(external_lodash_["mapValues"])(modifiers, function (getModifiers) {
 586    return (
 587      /** @type {WPEventKeyHandler} */
 588      function (event, character) {
 589        var _isApple = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : isAppleOS;
 590  
 591        var mods = getModifiers(_isApple);
 592        var eventMods = getEventModifiers(event);
 593  
 594        if (Object(external_lodash_["xor"])(mods, eventMods).length) {
 595          return false;
 596        }
 597  
 598        if (!character) {
 599          return Object(external_lodash_["includes"])(mods, event.key.toLowerCase());
 600        }
 601  
 602        return event.key === character;
 603      }
 604    );
 605  });
 606  
 607  
 608  /***/ }),
 609  
 610  /***/ 5:
 611  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 612  
 613  "use strict";
 614  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; });
 615  function _defineProperty(obj, key, value) {
 616    if (key in obj) {
 617      Object.defineProperty(obj, key, {
 618        value: value,
 619        enumerable: true,
 620        configurable: true,
 621        writable: true
 622      });
 623    } else {
 624      obj[key] = value;
 625    }
 626  
 627    return obj;
 628  }
 629  
 630  /***/ })
 631  
 632  /******/ });


Generated: Thu May 13 01:00:05 2021 Cross-referenced by PHPXref 0.7.1