wp/wp-includes/js/dist/keyboard-shortcuts.js
changeset 18 be944660c56a
parent 16 a86126ab1dd4
child 19 3d72ae0968f4
equal deleted inserted replaced
17:34716fd837a4 18:be944660c56a
    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 = 456);
    85 /******/ 	return __webpack_require__(__webpack_require__.s = "cFS5");
    86 /******/ })
    86 /******/ })
    87 /************************************************************************/
    87 /************************************************************************/
    88 /******/ ({
    88 /******/ ({
    89 
    89 
    90 /***/ 14:
    90 /***/ "1ZqX":
       
    91 /***/ (function(module, exports) {
       
    92 
       
    93 (function() { module.exports = window["wp"]["data"]; }());
       
    94 
       
    95 /***/ }),
       
    96 
       
    97 /***/ "K9lf":
       
    98 /***/ (function(module, exports) {
       
    99 
       
   100 (function() { module.exports = window["wp"]["compose"]; }());
       
   101 
       
   102 /***/ }),
       
   103 
       
   104 /***/ "RxS6":
       
   105 /***/ (function(module, exports) {
       
   106 
       
   107 (function() { module.exports = window["wp"]["keycodes"]; }());
       
   108 
       
   109 /***/ }),
       
   110 
       
   111 /***/ "YLtl":
       
   112 /***/ (function(module, exports) {
       
   113 
       
   114 (function() { module.exports = window["lodash"]; }());
       
   115 
       
   116 /***/ }),
       
   117 
       
   118 /***/ "cFS5":
    91 /***/ (function(module, __webpack_exports__, __webpack_require__) {
   119 /***/ (function(module, __webpack_exports__, __webpack_require__) {
    92 
   120 
    93 "use strict";
   121 "use strict";
       
   122 // ESM COMPAT FLAG
       
   123 __webpack_require__.r(__webpack_exports__);
    94 
   124 
    95 // EXPORTS
   125 // EXPORTS
    96 __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _slicedToArray; });
   126 __webpack_require__.d(__webpack_exports__, "store", function() { return /* reexport */ store; });
    97 
   127 __webpack_require__.d(__webpack_exports__, "useShortcut", function() { return /* reexport */ use_shortcut; });
    98 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
   128 __webpack_require__.d(__webpack_exports__, "__unstableUseShortcutEventMatch", function() { return /* reexport */ useShortcutEventMatch; });
    99 var arrayWithHoles = __webpack_require__(38);
   129 
   100 
   130 // NAMESPACE OBJECT: ./node_modules/@wordpress/keyboard-shortcuts/build-module/store/actions.js
   101 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
   131 var actions_namespaceObject = {};
   102 function _iterableToArrayLimit(arr, i) {
   132 __webpack_require__.r(actions_namespaceObject);
   103   if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
   133 __webpack_require__.d(actions_namespaceObject, "registerShortcut", function() { return registerShortcut; });
   104   var _arr = [];
   134 __webpack_require__.d(actions_namespaceObject, "unregisterShortcut", function() { return unregisterShortcut; });
   105   var _n = true;
   135 
   106   var _d = false;
   136 // NAMESPACE OBJECT: ./node_modules/@wordpress/keyboard-shortcuts/build-module/store/selectors.js
   107   var _e = undefined;
   137 var selectors_namespaceObject = {};
   108 
   138 __webpack_require__.r(selectors_namespaceObject);
   109   try {
   139 __webpack_require__.d(selectors_namespaceObject, "getShortcutKeyCombination", function() { return getShortcutKeyCombination; });
   110     for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
   140 __webpack_require__.d(selectors_namespaceObject, "getShortcutRepresentation", function() { return getShortcutRepresentation; });
   111       _arr.push(_s.value);
   141 __webpack_require__.d(selectors_namespaceObject, "getShortcutDescription", function() { return getShortcutDescription; });
   112 
   142 __webpack_require__.d(selectors_namespaceObject, "getShortcutAliases", function() { return getShortcutAliases; });
   113       if (i && _arr.length === i) break;
   143 __webpack_require__.d(selectors_namespaceObject, "getAllShortcutKeyCombinations", function() { return selectors_getAllShortcutKeyCombinations; });
   114     }
   144 __webpack_require__.d(selectors_namespaceObject, "getAllShortcutRawKeyCombinations", function() { return getAllShortcutRawKeyCombinations; });
   115   } catch (err) {
   145 __webpack_require__.d(selectors_namespaceObject, "getCategoryShortcuts", function() { return getCategoryShortcuts; });
   116     _d = true;
   146 
   117     _e = err;
   147 // EXTERNAL MODULE: external ["wp","data"]
   118   } finally {
   148 var external_wp_data_ = __webpack_require__("1ZqX");
   119     try {
   149 
   120       if (!_n && _i["return"] != null) _i["return"]();
   150 // EXTERNAL MODULE: external "lodash"
   121     } finally {
   151 var external_lodash_ = __webpack_require__("YLtl");
   122       if (_d) throw _e;
   152 
   123     }
   153 // CONCATENATED MODULE: ./node_modules/@wordpress/keyboard-shortcuts/build-module/store/reducer.js
       
   154 /**
       
   155  * External dependencies
       
   156  */
       
   157 
       
   158 /**
       
   159  * Reducer returning the registered shortcuts
       
   160  *
       
   161  * @param {Object} state  Current state.
       
   162  * @param {Object} action Dispatched action.
       
   163  *
       
   164  * @return {Object} Updated state.
       
   165  */
       
   166 
       
   167 function reducer(state = {}, action) {
       
   168   switch (action.type) {
       
   169     case 'REGISTER_SHORTCUT':
       
   170       return { ...state,
       
   171         [action.name]: {
       
   172           category: action.category,
       
   173           keyCombination: action.keyCombination,
       
   174           aliases: action.aliases,
       
   175           description: action.description
       
   176         }
       
   177       };
       
   178 
       
   179     case 'UNREGISTER_SHORTCUT':
       
   180       return Object(external_lodash_["omit"])(state, action.name);
   124   }
   181   }
   125 
   182 
   126   return _arr;
   183   return state;
   127 }
   184 }
   128 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
   185 
   129 var unsupportedIterableToArray = __webpack_require__(29);
   186 /* harmony default export */ var store_reducer = (reducer);
   130 
   187 
   131 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
   188 // CONCATENATED MODULE: ./node_modules/@wordpress/keyboard-shortcuts/build-module/store/actions.js
   132 var nonIterableRest = __webpack_require__(39);
   189 /** @typedef {import('@wordpress/keycodes').WPKeycodeModifier} WPKeycodeModifier */
   133 
   190 
   134 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
   191 /**
   135 
   192  * Keyboard key combination.
   136 
   193  *
   137 
   194  * @typedef {Object} WPShortcutKeyCombination
   138 
   195  *
   139 function _slicedToArray(arr, i) {
   196  * @property {string}                      character Character.
   140   return Object(arrayWithHoles["a" /* default */])(arr) || _iterableToArrayLimit(arr, i) || Object(unsupportedIterableToArray["a" /* default */])(arr, i) || Object(nonIterableRest["a" /* default */])();
   197  * @property {WPKeycodeModifier|undefined} modifier  Modifier.
   141 }
   198  */
       
   199 
       
   200 /**
       
   201  * Configuration of a registered keyboard shortcut.
       
   202  *
       
   203  * @typedef {Object} WPShortcutConfig
       
   204  *
       
   205  * @property {string}                     name           Shortcut name.
       
   206  * @property {string}                     category       Shortcut category.
       
   207  * @property {string}                     description    Shortcut description.
       
   208  * @property {WPShortcutKeyCombination}   keyCombination Shortcut key combination.
       
   209  * @property {WPShortcutKeyCombination[]} [aliases]      Shortcut aliases.
       
   210  */
       
   211 
       
   212 /**
       
   213  * Returns an action object used to register a new keyboard shortcut.
       
   214  *
       
   215  * @param {WPShortcutConfig} config Shortcut config.
       
   216  *
       
   217  * @return {Object} action.
       
   218  */
       
   219 function registerShortcut({
       
   220   name,
       
   221   category,
       
   222   description,
       
   223   keyCombination,
       
   224   aliases
       
   225 }) {
       
   226   return {
       
   227     type: 'REGISTER_SHORTCUT',
       
   228     name,
       
   229     category,
       
   230     keyCombination,
       
   231     aliases,
       
   232     description
       
   233   };
       
   234 }
       
   235 /**
       
   236  * Returns an action object used to unregister a keyboard shortcut.
       
   237  *
       
   238  * @param {string} name Shortcut name.
       
   239  *
       
   240  * @return {Object} action.
       
   241  */
       
   242 
       
   243 function unregisterShortcut(name) {
       
   244   return {
       
   245     type: 'UNREGISTER_SHORTCUT',
       
   246     name
       
   247   };
       
   248 }
       
   249 
       
   250 // EXTERNAL MODULE: ./node_modules/rememo/es/rememo.js
       
   251 var rememo = __webpack_require__("pPDe");
       
   252 
       
   253 // EXTERNAL MODULE: external ["wp","keycodes"]
       
   254 var external_wp_keycodes_ = __webpack_require__("RxS6");
       
   255 
       
   256 // CONCATENATED MODULE: ./node_modules/@wordpress/keyboard-shortcuts/build-module/store/selectors.js
       
   257 /**
       
   258  * External dependencies
       
   259  */
       
   260 
       
   261 
       
   262 /**
       
   263  * WordPress dependencies
       
   264  */
       
   265 
       
   266 
       
   267 /** @typedef {import('./actions').WPShortcutKeyCombination} WPShortcutKeyCombination */
       
   268 
       
   269 /** @typedef {import('@wordpress/keycodes').WPKeycodeHandlerByModifier} WPKeycodeHandlerByModifier */
       
   270 
       
   271 /**
       
   272  * Shared reference to an empty array for cases where it is important to avoid
       
   273  * returning a new array reference on every invocation.
       
   274  *
       
   275  * @type {Array<any>}
       
   276  */
       
   277 
       
   278 const EMPTY_ARRAY = [];
       
   279 /**
       
   280  * Shortcut formatting methods.
       
   281  *
       
   282  * @property {WPKeycodeHandlerByModifier} display     Display formatting.
       
   283  * @property {WPKeycodeHandlerByModifier} rawShortcut Raw shortcut formatting.
       
   284  * @property {WPKeycodeHandlerByModifier} ariaLabel   ARIA label formatting.
       
   285  */
       
   286 
       
   287 const FORMATTING_METHODS = {
       
   288   display: external_wp_keycodes_["displayShortcut"],
       
   289   raw: external_wp_keycodes_["rawShortcut"],
       
   290   ariaLabel: external_wp_keycodes_["shortcutAriaLabel"]
       
   291 };
       
   292 /**
       
   293  * Returns a string representing the key combination.
       
   294  *
       
   295  * @param {?WPShortcutKeyCombination} shortcut       Key combination.
       
   296  * @param {keyof FORMATTING_METHODS}  representation Type of representation
       
   297  *                                                   (display, raw, ariaLabel).
       
   298  *
       
   299  * @return {string?} Shortcut representation.
       
   300  */
       
   301 
       
   302 function getKeyCombinationRepresentation(shortcut, representation) {
       
   303   if (!shortcut) {
       
   304     return null;
       
   305   }
       
   306 
       
   307   return shortcut.modifier ? FORMATTING_METHODS[representation][shortcut.modifier](shortcut.character) : shortcut.character;
       
   308 }
       
   309 /**
       
   310  * Returns the main key combination for a given shortcut name.
       
   311  *
       
   312  * @param {Object} state Global state.
       
   313  * @param {string} name  Shortcut name.
       
   314  *
       
   315  * @return {WPShortcutKeyCombination?} Key combination.
       
   316  */
       
   317 
       
   318 
       
   319 function getShortcutKeyCombination(state, name) {
       
   320   return state[name] ? state[name].keyCombination : null;
       
   321 }
       
   322 /**
       
   323  * Returns a string representing the main key combination for a given shortcut name.
       
   324  *
       
   325  * @param {Object}                   state          Global state.
       
   326  * @param {string}                   name           Shortcut name.
       
   327  * @param {keyof FORMATTING_METHODS} representation Type of representation
       
   328  *                                                  (display, raw, ariaLabel).
       
   329  *
       
   330  * @return {string?} Shortcut representation.
       
   331  */
       
   332 
       
   333 function getShortcutRepresentation(state, name, representation = 'display') {
       
   334   const shortcut = getShortcutKeyCombination(state, name);
       
   335   return getKeyCombinationRepresentation(shortcut, representation);
       
   336 }
       
   337 /**
       
   338  * Returns the shortcut description given its name.
       
   339  *
       
   340  * @param {Object} state Global state.
       
   341  * @param {string} name  Shortcut name.
       
   342  *
       
   343  * @return {string?} Shortcut description.
       
   344  */
       
   345 
       
   346 function getShortcutDescription(state, name) {
       
   347   return state[name] ? state[name].description : null;
       
   348 }
       
   349 /**
       
   350  * Returns the aliases for a given shortcut name.
       
   351  *
       
   352  * @param {Object} state Global state.
       
   353  * @param {string} name  Shortcut name.
       
   354  *
       
   355  * @return {WPShortcutKeyCombination[]} Key combinations.
       
   356  */
       
   357 
       
   358 function getShortcutAliases(state, name) {
       
   359   return state[name] && state[name].aliases ? state[name].aliases : EMPTY_ARRAY;
       
   360 }
       
   361 const selectors_getAllShortcutKeyCombinations = Object(rememo["a" /* default */])((state, name) => {
       
   362   return Object(external_lodash_["compact"])([getShortcutKeyCombination(state, name), ...getShortcutAliases(state, name)]);
       
   363 }, (state, name) => [state[name]]);
       
   364 /**
       
   365  * Returns the raw representation of all the keyboard combinations of a given shortcut name.
       
   366  *
       
   367  * @param {Object} state Global state.
       
   368  * @param {string} name  Shortcut name.
       
   369  *
       
   370  * @return {string[]} Shortcuts.
       
   371  */
       
   372 
       
   373 const getAllShortcutRawKeyCombinations = Object(rememo["a" /* default */])((state, name) => {
       
   374   return selectors_getAllShortcutKeyCombinations(state, name).map(combination => getKeyCombinationRepresentation(combination, 'raw'));
       
   375 }, (state, name) => [state[name]]);
       
   376 /**
       
   377  * Returns the shortcut names list for a given category name.
       
   378  *
       
   379  * @param {Object} state Global state.
       
   380  * @param {string} name  Category name.
       
   381  *
       
   382  * @return {string[]} Shortcut names.
       
   383  */
       
   384 
       
   385 const getCategoryShortcuts = Object(rememo["a" /* default */])((state, categoryName) => {
       
   386   return Object.entries(state).filter(([, shortcut]) => shortcut.category === categoryName).map(([name]) => name);
       
   387 }, state => [state]);
       
   388 
       
   389 // CONCATENATED MODULE: ./node_modules/@wordpress/keyboard-shortcuts/build-module/store/index.js
       
   390 /**
       
   391  * WordPress dependencies
       
   392  */
       
   393 
       
   394 /**
       
   395  * Internal dependencies
       
   396  */
       
   397 
       
   398 
       
   399 
       
   400 
       
   401 const STORE_NAME = 'core/keyboard-shortcuts';
       
   402 /**
       
   403  * Store definition for the keyboard shortcuts namespace.
       
   404  *
       
   405  * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
       
   406  *
       
   407  * @type {Object}
       
   408  */
       
   409 
       
   410 const store = Object(external_wp_data_["createReduxStore"])(STORE_NAME, {
       
   411   reducer: store_reducer,
       
   412   actions: actions_namespaceObject,
       
   413   selectors: selectors_namespaceObject
       
   414 });
       
   415 Object(external_wp_data_["register"])(store);
       
   416 
       
   417 // EXTERNAL MODULE: external ["wp","compose"]
       
   418 var external_wp_compose_ = __webpack_require__("K9lf");
       
   419 
       
   420 // CONCATENATED MODULE: ./node_modules/@wordpress/keyboard-shortcuts/build-module/hooks/use-shortcut.js
       
   421 /**
       
   422  * WordPress dependencies
       
   423  */
       
   424 
       
   425 
       
   426 /**
       
   427  * Internal dependencies
       
   428  */
       
   429 
       
   430 
       
   431 /**
       
   432  * Attach a keyboard shortcut handler.
       
   433  *
       
   434  * @param {string} name       Shortcut name.
       
   435  * @param {Function} callback Shortcut callback.
       
   436  * @param {Object} options    Shortcut options.
       
   437  */
       
   438 
       
   439 function useShortcut(name, callback, options) {
       
   440   const shortcuts = Object(external_wp_data_["useSelect"])(select => {
       
   441     return select(store).getAllShortcutRawKeyCombinations(name);
       
   442   }, [name]);
       
   443   Object(external_wp_compose_["useKeyboardShortcut"])(shortcuts, callback, options);
       
   444 }
       
   445 
       
   446 /* harmony default export */ var use_shortcut = (useShortcut);
       
   447 
       
   448 // CONCATENATED MODULE: ./node_modules/@wordpress/keyboard-shortcuts/build-module/hooks/use-shortcut-event-match.js
       
   449 /**
       
   450  * WordPress dependencies
       
   451  */
       
   452 
       
   453 
       
   454 /**
       
   455  * Internal dependencies
       
   456  */
       
   457 
       
   458 
       
   459 /**
       
   460  * Returns a function to check if a keyboard event matches a shortcut name.
       
   461  *
       
   462  * @return {Function} A function to to check if a keyboard event matches a
       
   463  *                    predefined shortcut combination.
       
   464  */
       
   465 
       
   466 function useShortcutEventMatch() {
       
   467   const {
       
   468     getAllShortcutKeyCombinations
       
   469   } = Object(external_wp_data_["useSelect"])(store);
       
   470   /**
       
   471    * A function to check if a keyboard event matches a predefined shortcut
       
   472    * combination.
       
   473    *
       
   474    * @param {string}        name  Shortcut name.
       
   475    * @param {KeyboardEvent} event Event to check.
       
   476    *
       
   477    * @return {boolean} True if the event matches any shortcuts, false if not.
       
   478    */
       
   479 
       
   480   function isMatch(name, event) {
       
   481     return getAllShortcutKeyCombinations(name).some(({
       
   482       modifier,
       
   483       character
       
   484     }) => {
       
   485       return external_wp_keycodes_["isKeyboardEvent"][modifier](event, character);
       
   486     });
       
   487   }
       
   488 
       
   489   return isMatch;
       
   490 }
       
   491 
       
   492 // CONCATENATED MODULE: ./node_modules/@wordpress/keyboard-shortcuts/build-module/index.js
       
   493 
       
   494 
       
   495 
       
   496 
   142 
   497 
   143 /***/ }),
   498 /***/ }),
   144 
   499 
   145 /***/ 18:
   500 /***/ "pPDe":
   146 /***/ (function(module, __webpack_exports__, __webpack_require__) {
       
   147 
       
   148 "use strict";
       
   149 
       
   150 // EXPORTS
       
   151 __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _toConsumableArray; });
       
   152 
       
   153 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
       
   154 var arrayLikeToArray = __webpack_require__(26);
       
   155 
       
   156 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
       
   157 
       
   158 function _arrayWithoutHoles(arr) {
       
   159   if (Array.isArray(arr)) return Object(arrayLikeToArray["a" /* default */])(arr);
       
   160 }
       
   161 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
       
   162 var iterableToArray = __webpack_require__(35);
       
   163 
       
   164 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
       
   165 var unsupportedIterableToArray = __webpack_require__(29);
       
   166 
       
   167 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
       
   168 function _nonIterableSpread() {
       
   169   throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
       
   170 }
       
   171 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
       
   172 
       
   173 
       
   174 
       
   175 
       
   176 function _toConsumableArray(arr) {
       
   177   return _arrayWithoutHoles(arr) || Object(iterableToArray["a" /* default */])(arr) || Object(unsupportedIterableToArray["a" /* default */])(arr) || _nonIterableSpread();
       
   178 }
       
   179 
       
   180 /***/ }),
       
   181 
       
   182 /***/ 2:
       
   183 /***/ (function(module, exports) {
       
   184 
       
   185 (function() { module.exports = this["lodash"]; }());
       
   186 
       
   187 /***/ }),
       
   188 
       
   189 /***/ 21:
       
   190 /***/ (function(module, exports) {
       
   191 
       
   192 (function() { module.exports = this["wp"]["keycodes"]; }());
       
   193 
       
   194 /***/ }),
       
   195 
       
   196 /***/ 26:
       
   197 /***/ (function(module, __webpack_exports__, __webpack_require__) {
       
   198 
       
   199 "use strict";
       
   200 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayLikeToArray; });
       
   201 function _arrayLikeToArray(arr, len) {
       
   202   if (len == null || len > arr.length) len = arr.length;
       
   203 
       
   204   for (var i = 0, arr2 = new Array(len); i < len; i++) {
       
   205     arr2[i] = arr[i];
       
   206   }
       
   207 
       
   208   return arr2;
       
   209 }
       
   210 
       
   211 /***/ }),
       
   212 
       
   213 /***/ 29:
       
   214 /***/ (function(module, __webpack_exports__, __webpack_require__) {
       
   215 
       
   216 "use strict";
       
   217 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _unsupportedIterableToArray; });
       
   218 /* harmony import */ var _arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26);
       
   219 
       
   220 function _unsupportedIterableToArray(o, minLen) {
       
   221   if (!o) return;
       
   222   if (typeof o === "string") return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
       
   223   var n = Object.prototype.toString.call(o).slice(8, -1);
       
   224   if (n === "Object" && o.constructor) n = o.constructor.name;
       
   225   if (n === "Map" || n === "Set") return Array.from(o);
       
   226   if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
       
   227 }
       
   228 
       
   229 /***/ }),
       
   230 
       
   231 /***/ 35:
       
   232 /***/ (function(module, __webpack_exports__, __webpack_require__) {
       
   233 
       
   234 "use strict";
       
   235 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _iterableToArray; });
       
   236 function _iterableToArray(iter) {
       
   237   if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
       
   238 }
       
   239 
       
   240 /***/ }),
       
   241 
       
   242 /***/ 38:
       
   243 /***/ (function(module, __webpack_exports__, __webpack_require__) {
       
   244 
       
   245 "use strict";
       
   246 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayWithHoles; });
       
   247 function _arrayWithHoles(arr) {
       
   248   if (Array.isArray(arr)) return arr;
       
   249 }
       
   250 
       
   251 /***/ }),
       
   252 
       
   253 /***/ 39:
       
   254 /***/ (function(module, __webpack_exports__, __webpack_require__) {
       
   255 
       
   256 "use strict";
       
   257 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _nonIterableRest; });
       
   258 function _nonIterableRest() {
       
   259   throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
       
   260 }
       
   261 
       
   262 /***/ }),
       
   263 
       
   264 /***/ 4:
       
   265 /***/ (function(module, exports) {
       
   266 
       
   267 (function() { module.exports = this["wp"]["data"]; }());
       
   268 
       
   269 /***/ }),
       
   270 
       
   271 /***/ 42:
       
   272 /***/ (function(module, __webpack_exports__, __webpack_require__) {
   501 /***/ (function(module, __webpack_exports__, __webpack_require__) {
   273 
   502 
   274 "use strict";
   503 "use strict";
   275 
   504 
   276 
   505 
   546 
   775 
   547 	return callSelector;
   776 	return callSelector;
   548 });
   777 });
   549 
   778 
   550 
   779 
   551 /***/ }),
       
   552 
       
   553 /***/ 456:
       
   554 /***/ (function(module, __webpack_exports__, __webpack_require__) {
       
   555 
       
   556 "use strict";
       
   557 // ESM COMPAT FLAG
       
   558 __webpack_require__.r(__webpack_exports__);
       
   559 
       
   560 // EXPORTS
       
   561 __webpack_require__.d(__webpack_exports__, "useShortcut", function() { return /* reexport */ use_shortcut; });
       
   562 
       
   563 // NAMESPACE OBJECT: ./node_modules/@wordpress/keyboard-shortcuts/build-module/store/actions.js
       
   564 var actions_namespaceObject = {};
       
   565 __webpack_require__.r(actions_namespaceObject);
       
   566 __webpack_require__.d(actions_namespaceObject, "registerShortcut", function() { return registerShortcut; });
       
   567 __webpack_require__.d(actions_namespaceObject, "unregisterShortcut", function() { return unregisterShortcut; });
       
   568 
       
   569 // NAMESPACE OBJECT: ./node_modules/@wordpress/keyboard-shortcuts/build-module/store/selectors.js
       
   570 var selectors_namespaceObject = {};
       
   571 __webpack_require__.r(selectors_namespaceObject);
       
   572 __webpack_require__.d(selectors_namespaceObject, "getShortcutKeyCombination", function() { return getShortcutKeyCombination; });
       
   573 __webpack_require__.d(selectors_namespaceObject, "getShortcutRepresentation", function() { return getShortcutRepresentation; });
       
   574 __webpack_require__.d(selectors_namespaceObject, "getShortcutDescription", function() { return getShortcutDescription; });
       
   575 __webpack_require__.d(selectors_namespaceObject, "getShortcutAliases", function() { return getShortcutAliases; });
       
   576 __webpack_require__.d(selectors_namespaceObject, "getAllShortcutRawKeyCombinations", function() { return getAllShortcutRawKeyCombinations; });
       
   577 __webpack_require__.d(selectors_namespaceObject, "getCategoryShortcuts", function() { return getCategoryShortcuts; });
       
   578 
       
   579 // EXTERNAL MODULE: external {"this":["wp","data"]}
       
   580 var external_this_wp_data_ = __webpack_require__(4);
       
   581 
       
   582 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
       
   583 var defineProperty = __webpack_require__(5);
       
   584 
       
   585 // EXTERNAL MODULE: external {"this":"lodash"}
       
   586 var external_this_lodash_ = __webpack_require__(2);
       
   587 
       
   588 // CONCATENATED MODULE: ./node_modules/@wordpress/keyboard-shortcuts/build-module/store/reducer.js
       
   589 
       
   590 
       
   591 function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
       
   592 
       
   593 function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
       
   594 
       
   595 /**
       
   596  * External dependencies
       
   597  */
       
   598 
       
   599 /**
       
   600  * Reducer returning the registered shortcuts
       
   601  *
       
   602  * @param {Object} state  Current state.
       
   603  * @param {Object} action Dispatched action.
       
   604  *
       
   605  * @return {Object} Updated state.
       
   606  */
       
   607 
       
   608 function reducer() {
       
   609   var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
       
   610   var action = arguments.length > 1 ? arguments[1] : undefined;
       
   611 
       
   612   switch (action.type) {
       
   613     case 'REGISTER_SHORTCUT':
       
   614       return _objectSpread({}, state, Object(defineProperty["a" /* default */])({}, action.name, {
       
   615         category: action.category,
       
   616         keyCombination: action.keyCombination,
       
   617         aliases: action.aliases,
       
   618         description: action.description
       
   619       }));
       
   620 
       
   621     case 'UNREGISTER_SHORTCUT':
       
   622       return Object(external_this_lodash_["omit"])(state, action.name);
       
   623   }
       
   624 
       
   625   return state;
       
   626 }
       
   627 
       
   628 /* harmony default export */ var store_reducer = (reducer);
       
   629 
       
   630 // CONCATENATED MODULE: ./node_modules/@wordpress/keyboard-shortcuts/build-module/store/actions.js
       
   631 /** @typedef {import('@wordpress/keycodes').WPKeycodeModifier} WPKeycodeModifier */
       
   632 
       
   633 /**
       
   634  * Keyboard key combination.
       
   635  *
       
   636  * @typedef {Object} WPShortcutKeyCombination
       
   637  *
       
   638  * @property {string}                      character Character.
       
   639  * @property {WPKeycodeModifier|undefined} modifier  Modifier.
       
   640  */
       
   641 
       
   642 /**
       
   643  * Configuration of a registered keyboard shortcut.
       
   644  *
       
   645  * @typedef {Object} WPShortcutConfig
       
   646  *
       
   647  * @property {string}                     name           Shortcut name.
       
   648  * @property {string}                     category       Shortcut category.
       
   649  * @property {string}                     description    Shortcut description.
       
   650  * @property {WPShortcutKeyCombination}   keyCombination Shortcut key combination.
       
   651  * @property {WPShortcutKeyCombination[]} [aliases]      Shortcut aliases.
       
   652  */
       
   653 
       
   654 /**
       
   655  * Returns an action object used to register a new keyboard shortcut.
       
   656  *
       
   657  * @param {WPShortcutConfig} config Shortcut config.
       
   658  *
       
   659  * @return {Object} action.
       
   660  */
       
   661 function registerShortcut(_ref) {
       
   662   var name = _ref.name,
       
   663       category = _ref.category,
       
   664       description = _ref.description,
       
   665       keyCombination = _ref.keyCombination,
       
   666       aliases = _ref.aliases;
       
   667   return {
       
   668     type: 'REGISTER_SHORTCUT',
       
   669     name: name,
       
   670     category: category,
       
   671     keyCombination: keyCombination,
       
   672     aliases: aliases,
       
   673     description: description
       
   674   };
       
   675 }
       
   676 /**
       
   677  * Returns an action object used to unregister a keyboard shortcut.
       
   678  *
       
   679  * @param {string} name Shortcut name.
       
   680  *
       
   681  * @return {Object} action.
       
   682  */
       
   683 
       
   684 function unregisterShortcut(name) {
       
   685   return {
       
   686     type: 'UNREGISTER_SHORTCUT',
       
   687     name: name
       
   688   };
       
   689 }
       
   690 
       
   691 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
       
   692 var slicedToArray = __webpack_require__(14);
       
   693 
       
   694 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
       
   695 var toConsumableArray = __webpack_require__(18);
       
   696 
       
   697 // EXTERNAL MODULE: ./node_modules/rememo/es/rememo.js
       
   698 var rememo = __webpack_require__(42);
       
   699 
       
   700 // EXTERNAL MODULE: external {"this":["wp","keycodes"]}
       
   701 var external_this_wp_keycodes_ = __webpack_require__(21);
       
   702 
       
   703 // CONCATENATED MODULE: ./node_modules/@wordpress/keyboard-shortcuts/build-module/store/selectors.js
       
   704 
       
   705 
       
   706 
       
   707 /**
       
   708  * External dependencies
       
   709  */
       
   710 
       
   711 
       
   712 /**
       
   713  * WordPress dependencies
       
   714  */
       
   715 
       
   716 
       
   717 /** @typedef {import('./actions').WPShortcutKeyCombination} WPShortcutKeyCombination */
       
   718 
       
   719 /** @typedef {import('@wordpress/keycodes').WPKeycodeHandlerByModifier} WPKeycodeHandlerByModifier */
       
   720 
       
   721 /**
       
   722  * Shared reference to an empty array for cases where it is important to avoid
       
   723  * returning a new array reference on every invocation.
       
   724  *
       
   725  * @type {Array<any>}
       
   726  */
       
   727 
       
   728 var EMPTY_ARRAY = [];
       
   729 /**
       
   730  * Shortcut formatting methods.
       
   731  *
       
   732  * @property {WPKeycodeHandlerByModifier} display     Display formatting.
       
   733  * @property {WPKeycodeHandlerByModifier} rawShortcut Raw shortcut formatting.
       
   734  * @property {WPKeycodeHandlerByModifier} ariaLabel   ARIA label formatting.
       
   735  */
       
   736 
       
   737 var FORMATTING_METHODS = {
       
   738   display: external_this_wp_keycodes_["displayShortcut"],
       
   739   raw: external_this_wp_keycodes_["rawShortcut"],
       
   740   ariaLabel: external_this_wp_keycodes_["shortcutAriaLabel"]
       
   741 };
       
   742 /**
       
   743  * Returns a string representing the key combination.
       
   744  *
       
   745  * @param {?WPShortcutKeyCombination} shortcut       Key combination.
       
   746  * @param {keyof FORMATTING_METHODS}  representation Type of representation
       
   747  *                                                   (display, raw, ariaLabel).
       
   748  *
       
   749  * @return {string?} Shortcut representation.
       
   750  */
       
   751 
       
   752 function getKeyCombinationRepresentation(shortcut, representation) {
       
   753   if (!shortcut) {
       
   754     return null;
       
   755   }
       
   756 
       
   757   return shortcut.modifier ? FORMATTING_METHODS[representation][shortcut.modifier](shortcut.character) : shortcut.character;
       
   758 }
       
   759 /**
       
   760  * Returns the main key combination for a given shortcut name.
       
   761  *
       
   762  * @param {Object} state Global state.
       
   763  * @param {string} name  Shortcut name.
       
   764  *
       
   765  * @return {WPShortcutKeyCombination?} Key combination.
       
   766  */
       
   767 
       
   768 
       
   769 function getShortcutKeyCombination(state, name) {
       
   770   return state[name] ? state[name].keyCombination : null;
       
   771 }
       
   772 /**
       
   773  * Returns a string representing the main key combination for a given shortcut name.
       
   774  *
       
   775  * @param {Object}                   state          Global state.
       
   776  * @param {string}                   name           Shortcut name.
       
   777  * @param {keyof FORMATTING_METHODS} representation Type of representation
       
   778  *                                                  (display, raw, ariaLabel).
       
   779  *
       
   780  * @return {string?} Shortcut representation.
       
   781  */
       
   782 
       
   783 function getShortcutRepresentation(state, name) {
       
   784   var representation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'display';
       
   785   var shortcut = getShortcutKeyCombination(state, name);
       
   786   return getKeyCombinationRepresentation(shortcut, representation);
       
   787 }
       
   788 /**
       
   789  * Returns the shortcut description given its name.
       
   790  *
       
   791  * @param {Object} state Global state.
       
   792  * @param {string} name  Shortcut name.
       
   793  *
       
   794  * @return {string?} Shortcut description.
       
   795  */
       
   796 
       
   797 function getShortcutDescription(state, name) {
       
   798   return state[name] ? state[name].description : null;
       
   799 }
       
   800 /**
       
   801  * Returns the aliases for a given shortcut name.
       
   802  *
       
   803  * @param {Object} state Global state.
       
   804  * @param {string} name  Shortcut name.
       
   805  *
       
   806  * @return {WPShortcutKeyCombination[]} Key combinations.
       
   807  */
       
   808 
       
   809 function getShortcutAliases(state, name) {
       
   810   return state[name] && state[name].aliases ? state[name].aliases : EMPTY_ARRAY;
       
   811 }
       
   812 /**
       
   813  * Returns the raw representation of all the keyboard combinations of a given shortcut name.
       
   814  *
       
   815  * @param {Object} state Global state.
       
   816  * @param {string} name  Shortcut name.
       
   817  *
       
   818  * @return {string[]} Shortcuts.
       
   819  */
       
   820 
       
   821 var getAllShortcutRawKeyCombinations = Object(rememo["a" /* default */])(function (state, name) {
       
   822   return Object(external_this_lodash_["compact"])([getKeyCombinationRepresentation(getShortcutKeyCombination(state, name), 'raw')].concat(Object(toConsumableArray["a" /* default */])(getShortcutAliases(state, name).map(function (combination) {
       
   823     return getKeyCombinationRepresentation(combination, 'raw');
       
   824   }))));
       
   825 }, function (state, name) {
       
   826   return [state[name]];
       
   827 });
       
   828 /**
       
   829  * Returns the shortcut names list for a given category name.
       
   830  *
       
   831  * @param {Object} state Global state.
       
   832  * @param {string} name  Category name.
       
   833  *
       
   834  * @return {string[]} Shortcut names.
       
   835  */
       
   836 
       
   837 var getCategoryShortcuts = Object(rememo["a" /* default */])(function (state, categoryName) {
       
   838   return Object.entries(state).filter(function (_ref) {
       
   839     var _ref2 = Object(slicedToArray["a" /* default */])(_ref, 2),
       
   840         shortcut = _ref2[1];
       
   841 
       
   842     return shortcut.category === categoryName;
       
   843   }).map(function (_ref3) {
       
   844     var _ref4 = Object(slicedToArray["a" /* default */])(_ref3, 1),
       
   845         name = _ref4[0];
       
   846 
       
   847     return name;
       
   848   });
       
   849 }, function (state) {
       
   850   return [state];
       
   851 });
       
   852 
       
   853 // CONCATENATED MODULE: ./node_modules/@wordpress/keyboard-shortcuts/build-module/store/index.js
       
   854 /**
       
   855  * WordPress dependencies
       
   856  */
       
   857 
       
   858 /**
       
   859  * Internal dependencies
       
   860  */
       
   861 
       
   862 
       
   863 
       
   864 
       
   865 /* harmony default export */ var store = (Object(external_this_wp_data_["registerStore"])('core/keyboard-shortcuts', {
       
   866   reducer: store_reducer,
       
   867   actions: actions_namespaceObject,
       
   868   selectors: selectors_namespaceObject
       
   869 }));
       
   870 
       
   871 // EXTERNAL MODULE: external {"this":["wp","compose"]}
       
   872 var external_this_wp_compose_ = __webpack_require__(9);
       
   873 
       
   874 // CONCATENATED MODULE: ./node_modules/@wordpress/keyboard-shortcuts/build-module/hooks/use-shortcut.js
       
   875 /**
       
   876  * WordPress dependencies
       
   877  */
       
   878 
       
   879 
       
   880 /**
       
   881  * Attach a keyboard shortcut handler.
       
   882  *
       
   883  * @param {string} name       Shortcut name.
       
   884  * @param {Function} callback Shortcut callback.
       
   885  * @param {Object} options    Shortcut options.
       
   886  */
       
   887 
       
   888 function useShortcut(name, callback, options) {
       
   889   var shortcuts = Object(external_this_wp_data_["useSelect"])(function (select) {
       
   890     return select('core/keyboard-shortcuts').getAllShortcutRawKeyCombinations(name);
       
   891   }, [name]);
       
   892   Object(external_this_wp_compose_["useKeyboardShortcut"])(shortcuts, callback, options);
       
   893 }
       
   894 
       
   895 /* harmony default export */ var use_shortcut = (useShortcut);
       
   896 
       
   897 // CONCATENATED MODULE: ./node_modules/@wordpress/keyboard-shortcuts/build-module/index.js
       
   898 /**
       
   899  * Internal dependencies
       
   900  */
       
   901 
       
   902 
       
   903 
       
   904 
       
   905 /***/ }),
       
   906 
       
   907 /***/ 5:
       
   908 /***/ (function(module, __webpack_exports__, __webpack_require__) {
       
   909 
       
   910 "use strict";
       
   911 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; });
       
   912 function _defineProperty(obj, key, value) {
       
   913   if (key in obj) {
       
   914     Object.defineProperty(obj, key, {
       
   915       value: value,
       
   916       enumerable: true,
       
   917       configurable: true,
       
   918       writable: true
       
   919     });
       
   920   } else {
       
   921     obj[key] = value;
       
   922   }
       
   923 
       
   924   return obj;
       
   925 }
       
   926 
       
   927 /***/ }),
       
   928 
       
   929 /***/ 9:
       
   930 /***/ (function(module, exports) {
       
   931 
       
   932 (function() { module.exports = this["wp"]["compose"]; }());
       
   933 
       
   934 /***/ })
   780 /***/ })
   935 
   781 
   936 /******/ });
   782 /******/ });