1 this["wp"] = this["wp"] || {}; this["wp"]["keycodes"] = |
1 /******/ (function() { // webpackBootstrap |
2 /******/ (function(modules) { // webpackBootstrap |
2 /******/ "use strict"; |
3 /******/ // The module cache |
3 /******/ // The require scope |
4 /******/ var installedModules = {}; |
4 /******/ var __webpack_require__ = {}; |
5 /******/ |
5 /******/ |
6 /******/ // The require function |
6 /************************************************************************/ |
7 /******/ function __webpack_require__(moduleId) { |
7 /******/ /* webpack/runtime/define property getters */ |
8 /******/ |
8 /******/ !function() { |
9 /******/ // Check if module is in cache |
9 /******/ // define getter functions for harmony exports |
10 /******/ if(installedModules[moduleId]) { |
10 /******/ __webpack_require__.d = function(exports, definition) { |
11 /******/ return installedModules[moduleId].exports; |
11 /******/ for(var key in definition) { |
12 /******/ } |
12 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { |
13 /******/ // Create a new module (and put it into the cache) |
13 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); |
14 /******/ var module = installedModules[moduleId] = { |
14 /******/ } |
15 /******/ i: moduleId, |
15 /******/ } |
16 /******/ l: false, |
|
17 /******/ exports: {} |
|
18 /******/ }; |
16 /******/ }; |
19 /******/ |
17 /******/ }(); |
20 /******/ // Execute the module function |
18 /******/ |
21 /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); |
19 /******/ /* webpack/runtime/hasOwnProperty shorthand */ |
22 /******/ |
20 /******/ !function() { |
23 /******/ // Flag the module as loaded |
21 /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } |
24 /******/ module.l = true; |
22 /******/ }(); |
25 /******/ |
23 /******/ |
26 /******/ // Return the exports of the module |
24 /******/ /* webpack/runtime/make namespace object */ |
27 /******/ return module.exports; |
25 /******/ !function() { |
28 /******/ } |
26 /******/ // define __esModule on exports |
29 /******/ |
27 /******/ __webpack_require__.r = function(exports) { |
30 /******/ |
28 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
31 /******/ // expose the modules object (__webpack_modules__) |
29 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
32 /******/ __webpack_require__.m = modules; |
30 /******/ } |
33 /******/ |
31 /******/ Object.defineProperty(exports, '__esModule', { value: true }); |
34 /******/ // expose the module cache |
32 /******/ }; |
35 /******/ __webpack_require__.c = installedModules; |
33 /******/ }(); |
36 /******/ |
34 /******/ |
37 /******/ // define getter function for harmony exports |
|
38 /******/ __webpack_require__.d = function(exports, name, getter) { |
|
39 /******/ if(!__webpack_require__.o(exports, name)) { |
|
40 /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); |
|
41 /******/ } |
|
42 /******/ }; |
|
43 /******/ |
|
44 /******/ // define __esModule on exports |
|
45 /******/ __webpack_require__.r = function(exports) { |
|
46 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
|
47 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
|
48 /******/ } |
|
49 /******/ Object.defineProperty(exports, '__esModule', { value: true }); |
|
50 /******/ }; |
|
51 /******/ |
|
52 /******/ // create a fake namespace object |
|
53 /******/ // mode & 1: value is a module id, require it |
|
54 /******/ // mode & 2: merge all properties of value into the ns |
|
55 /******/ // mode & 4: return value when already ns object |
|
56 /******/ // mode & 8|1: behave like require |
|
57 /******/ __webpack_require__.t = function(value, mode) { |
|
58 /******/ if(mode & 1) value = __webpack_require__(value); |
|
59 /******/ if(mode & 8) return value; |
|
60 /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; |
|
61 /******/ var ns = Object.create(null); |
|
62 /******/ __webpack_require__.r(ns); |
|
63 /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); |
|
64 /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); |
|
65 /******/ return ns; |
|
66 /******/ }; |
|
67 /******/ |
|
68 /******/ // getDefaultExport function for compatibility with non-harmony modules |
|
69 /******/ __webpack_require__.n = function(module) { |
|
70 /******/ var getter = module && module.__esModule ? |
|
71 /******/ function getDefault() { return module['default']; } : |
|
72 /******/ function getModuleExports() { return module; }; |
|
73 /******/ __webpack_require__.d(getter, 'a', getter); |
|
74 /******/ return getter; |
|
75 /******/ }; |
|
76 /******/ |
|
77 /******/ // Object.prototype.hasOwnProperty.call |
|
78 /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; |
|
79 /******/ |
|
80 /******/ // __webpack_public_path__ |
|
81 /******/ __webpack_require__.p = ""; |
|
82 /******/ |
|
83 /******/ |
|
84 /******/ // Load entry module and return exports |
|
85 /******/ return __webpack_require__(__webpack_require__.s = "z7pY"); |
|
86 /******/ }) |
|
87 /************************************************************************/ |
35 /************************************************************************/ |
88 /******/ ({ |
36 var __webpack_exports__ = {}; |
89 |
|
90 /***/ "YLtl": |
|
91 /***/ (function(module, exports) { |
|
92 |
|
93 (function() { module.exports = window["lodash"]; }()); |
|
94 |
|
95 /***/ }), |
|
96 |
|
97 /***/ "l3Sj": |
|
98 /***/ (function(module, exports) { |
|
99 |
|
100 (function() { module.exports = window["wp"]["i18n"]; }()); |
|
101 |
|
102 /***/ }), |
|
103 |
|
104 /***/ "z7pY": |
|
105 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
106 |
|
107 "use strict"; |
|
108 // ESM COMPAT FLAG |
37 // ESM COMPAT FLAG |
109 __webpack_require__.r(__webpack_exports__); |
38 __webpack_require__.r(__webpack_exports__); |
110 |
39 |
111 // EXPORTS |
40 // EXPORTS |
112 __webpack_require__.d(__webpack_exports__, "BACKSPACE", function() { return /* binding */ BACKSPACE; }); |
41 __webpack_require__.d(__webpack_exports__, { |
113 __webpack_require__.d(__webpack_exports__, "TAB", function() { return /* binding */ TAB; }); |
42 "ALT": function() { return /* binding */ ALT; }, |
114 __webpack_require__.d(__webpack_exports__, "ENTER", function() { return /* binding */ ENTER; }); |
43 "BACKSPACE": function() { return /* binding */ BACKSPACE; }, |
115 __webpack_require__.d(__webpack_exports__, "ESCAPE", function() { return /* binding */ ESCAPE; }); |
44 "COMMAND": function() { return /* binding */ COMMAND; }, |
116 __webpack_require__.d(__webpack_exports__, "SPACE", function() { return /* binding */ SPACE; }); |
45 "CTRL": function() { return /* binding */ CTRL; }, |
117 __webpack_require__.d(__webpack_exports__, "LEFT", function() { return /* binding */ LEFT; }); |
46 "DELETE": function() { return /* binding */ DELETE; }, |
118 __webpack_require__.d(__webpack_exports__, "UP", function() { return /* binding */ UP; }); |
47 "DOWN": function() { return /* binding */ DOWN; }, |
119 __webpack_require__.d(__webpack_exports__, "RIGHT", function() { return /* binding */ RIGHT; }); |
48 "END": function() { return /* binding */ END; }, |
120 __webpack_require__.d(__webpack_exports__, "DOWN", function() { return /* binding */ DOWN; }); |
49 "ENTER": function() { return /* binding */ ENTER; }, |
121 __webpack_require__.d(__webpack_exports__, "DELETE", function() { return /* binding */ DELETE; }); |
50 "ESCAPE": function() { return /* binding */ ESCAPE; }, |
122 __webpack_require__.d(__webpack_exports__, "F10", function() { return /* binding */ F10; }); |
51 "F10": function() { return /* binding */ F10; }, |
123 __webpack_require__.d(__webpack_exports__, "ALT", function() { return /* binding */ ALT; }); |
52 "HOME": function() { return /* binding */ HOME; }, |
124 __webpack_require__.d(__webpack_exports__, "CTRL", function() { return /* binding */ CTRL; }); |
53 "LEFT": function() { return /* binding */ LEFT; }, |
125 __webpack_require__.d(__webpack_exports__, "COMMAND", function() { return /* binding */ COMMAND; }); |
54 "PAGEDOWN": function() { return /* binding */ PAGEDOWN; }, |
126 __webpack_require__.d(__webpack_exports__, "SHIFT", function() { return /* binding */ SHIFT; }); |
55 "PAGEUP": function() { return /* binding */ PAGEUP; }, |
127 __webpack_require__.d(__webpack_exports__, "ZERO", function() { return /* binding */ ZERO; }); |
56 "RIGHT": function() { return /* binding */ RIGHT; }, |
128 __webpack_require__.d(__webpack_exports__, "modifiers", function() { return /* binding */ modifiers; }); |
57 "SHIFT": function() { return /* binding */ SHIFT; }, |
129 __webpack_require__.d(__webpack_exports__, "rawShortcut", function() { return /* binding */ rawShortcut; }); |
58 "SPACE": function() { return /* binding */ SPACE; }, |
130 __webpack_require__.d(__webpack_exports__, "displayShortcutList", function() { return /* binding */ displayShortcutList; }); |
59 "TAB": function() { return /* binding */ TAB; }, |
131 __webpack_require__.d(__webpack_exports__, "displayShortcut", function() { return /* binding */ displayShortcut; }); |
60 "UP": function() { return /* binding */ UP; }, |
132 __webpack_require__.d(__webpack_exports__, "shortcutAriaLabel", function() { return /* binding */ shortcutAriaLabel; }); |
61 "ZERO": function() { return /* binding */ ZERO; }, |
133 __webpack_require__.d(__webpack_exports__, "isKeyboardEvent", function() { return /* binding */ isKeyboardEvent; }); |
62 "displayShortcut": function() { return /* binding */ displayShortcut; }, |
134 |
63 "displayShortcutList": function() { return /* binding */ displayShortcutList; }, |
135 // EXTERNAL MODULE: external "lodash" |
64 "isKeyboardEvent": function() { return /* binding */ isKeyboardEvent; }, |
136 var external_lodash_ = __webpack_require__("YLtl"); |
65 "modifiers": function() { return /* binding */ modifiers; }, |
137 |
66 "rawShortcut": function() { return /* binding */ rawShortcut; }, |
138 // EXTERNAL MODULE: external ["wp","i18n"] |
67 "shortcutAriaLabel": function() { return /* binding */ shortcutAriaLabel; } |
139 var external_wp_i18n_ = __webpack_require__("l3Sj"); |
68 }); |
140 |
69 |
141 // CONCATENATED MODULE: ./node_modules/@wordpress/keycodes/build-module/platform.js |
70 ;// CONCATENATED MODULE: external "lodash" |
|
71 var external_lodash_namespaceObject = window["lodash"]; |
|
72 ;// CONCATENATED MODULE: external ["wp","i18n"] |
|
73 var external_wp_i18n_namespaceObject = window["wp"]["i18n"]; |
|
74 ;// CONCATENATED MODULE: ./node_modules/@wordpress/keycodes/build-module/platform.js |
142 /** |
75 /** |
143 * External dependencies |
76 * External dependencies |
144 */ |
77 */ |
145 |
78 |
146 /** |
79 /** |
348 * |
306 * |
349 * @type {WPModifierHandler<WPKeyHandler<string[]>>} Keyed map of functions to |
307 * @type {WPModifierHandler<WPKeyHandler<string[]>>} Keyed map of functions to |
350 * shortcut sequences. |
308 * shortcut sequences. |
351 */ |
309 */ |
352 |
310 |
353 const displayShortcutList = Object(external_lodash_["mapValues"])(modifiers, modifier => { |
311 const displayShortcutList = (0,external_lodash_namespaceObject.mapValues)(modifiers, modifier => { |
354 return ( |
312 return ( |
355 /** @type {WPKeyHandler<string[]>} */ |
313 /** @type {WPKeyHandler<string[]>} */ |
356 (character, _isApple = isAppleOS) => { |
314 function (character) { |
|
315 let _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isAppleOS; |
|
316 |
357 const isApple = _isApple(); |
317 const isApple = _isApple(); |
358 |
318 |
359 const replacementKeyMap = { |
319 const replacementKeyMap = { |
360 [ALT]: isApple ? '⌥' : 'Alt', |
320 [ALT]: isApple ? '⌥' : 'Alt', |
361 [CTRL]: isApple ? '⌃' : 'Ctrl', |
321 [CTRL]: isApple ? '⌃' : 'Ctrl', |
362 // Make sure ⌃ is the U+2303 UP ARROWHEAD unicode character and not the caret character. |
322 // Make sure ⌃ is the U+2303 UP ARROWHEAD unicode character and not the caret character. |
363 [COMMAND]: '⌘', |
323 [COMMAND]: '⌘', |
364 [SHIFT]: isApple ? '⇧' : 'Shift' |
324 [SHIFT]: isApple ? '⇧' : 'Shift' |
365 }; |
325 }; |
366 const modifierKeys = modifier(_isApple).reduce((accumulator, key) => { |
326 const modifierKeys = modifier(_isApple).reduce((accumulator, key) => { |
367 const replacementKey = Object(external_lodash_["get"])(replacementKeyMap, key, key); // If on the Mac, adhere to platform convention and don't show plus between keys. |
327 const replacementKey = (0,external_lodash_namespaceObject.get)(replacementKeyMap, key, key); // If on the Mac, adhere to platform convention and don't show plus between keys. |
368 |
328 |
369 if (isApple) { |
329 if (isApple) { |
370 return [...accumulator, replacementKey]; |
330 return [...accumulator, replacementKey]; |
371 } |
331 } |
372 |
332 |
373 return [...accumulator, replacementKey, '+']; |
333 return [...accumulator, replacementKey, '+']; |
374 }, |
334 }, |
375 /** @type {string[]} */ |
335 /** @type {string[]} */ |
376 []); |
336 []); |
377 const capitalizedCharacter = Object(external_lodash_["capitalize"])(character); |
337 const capitalizedCharacter = (0,external_lodash_namespaceObject.capitalize)(character); |
378 return [...modifierKeys, capitalizedCharacter]; |
338 return [...modifierKeys, capitalizedCharacter]; |
379 } |
339 } |
380 ); |
340 ); |
381 }); |
341 }); |
382 /** |
342 /** |
412 * |
376 * |
413 * @type {WPModifierHandler<WPKeyHandler<string>>} Keyed map of functions to |
377 * @type {WPModifierHandler<WPKeyHandler<string>>} Keyed map of functions to |
414 * shortcut ARIA labels. |
378 * shortcut ARIA labels. |
415 */ |
379 */ |
416 |
380 |
417 const shortcutAriaLabel = Object(external_lodash_["mapValues"])(modifiers, modifier => { |
381 const shortcutAriaLabel = (0,external_lodash_namespaceObject.mapValues)(modifiers, modifier => { |
418 return ( |
382 return ( |
419 /** @type {WPKeyHandler<string>} */ |
383 /** @type {WPKeyHandler<string>} */ |
420 (character, _isApple = isAppleOS) => { |
384 function (character) { |
|
385 let _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isAppleOS; |
|
386 |
421 const isApple = _isApple(); |
387 const isApple = _isApple(); |
422 |
388 |
423 const replacementKeyMap = { |
389 const replacementKeyMap = { |
424 [SHIFT]: 'Shift', |
390 [SHIFT]: 'Shift', |
425 [COMMAND]: isApple ? 'Command' : 'Control', |
391 [COMMAND]: isApple ? 'Command' : 'Control', |
426 [CTRL]: 'Control', |
392 [CTRL]: 'Control', |
427 [ALT]: isApple ? 'Option' : 'Alt', |
393 [ALT]: isApple ? 'Option' : 'Alt', |
428 |
394 |
429 /* translators: comma as in the character ',' */ |
395 /* translators: comma as in the character ',' */ |
430 ',': Object(external_wp_i18n_["__"])('Comma'), |
396 ',': (0,external_wp_i18n_namespaceObject.__)('Comma'), |
431 |
397 |
432 /* translators: period as in the character '.' */ |
398 /* translators: period as in the character '.' */ |
433 '.': Object(external_wp_i18n_["__"])('Period'), |
399 '.': (0,external_wp_i18n_namespaceObject.__)('Period'), |
434 |
400 |
435 /* translators: backtick as in the character '`' */ |
401 /* translators: backtick as in the character '`' */ |
436 '`': Object(external_wp_i18n_["__"])('Backtick') |
402 '`': (0,external_wp_i18n_namespaceObject.__)('Backtick') |
437 }; |
403 }; |
438 return [...modifier(_isApple), character].map(key => Object(external_lodash_["capitalize"])(Object(external_lodash_["get"])(replacementKeyMap, key, key))).join(isApple ? ' ' : ' + '); |
404 return [...modifier(_isApple), character].map(key => (0,external_lodash_namespaceObject.capitalize)((0,external_lodash_namespaceObject.get)(replacementKeyMap, key, key))).join(isApple ? ' ' : ' + '); |
439 } |
405 } |
440 ); |
406 ); |
441 }); |
407 }); |
442 /** |
408 /** |
443 * From a given KeyboardEvent, returns an array of active modifier constants for |
409 * From a given KeyboardEvent, returns an array of active modifier constants for |