PageSourceSearch

https://riffmagazine.com/wp-includes/js/dist/keycodes.js?ver=0ae26254e495f9f44348

js riffmagazine.com collected 2026-10-02 04:03:48 UTC 8,081 bytes, 242 lines download raw bytes

vendor: 2,474 bytes, lines 1-63
1/******/ (() => { // webpackBootstrap
2/******/ 	"use strict";
3/******/ 	// The require scope
4/******/ 	var __webpack_require__ = {};
5/******/ 	
6/************************************************************************/
7/******/ 	/* webpack/runtime/define property getters */
8/******/ 	(() => {
9/******/ 		// define getter functions for harmony exports
10/******/ 		__webpack_require__.d = (exports, definition) => {
11/******/ 			for(var key in definition) {
12/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
13/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
14/******/ 				}
15/******/ 			}
16/******/ 		};
17/******/ 	})();
18/******/ 	
19/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
20/******/ 	(() => {
21/******/ 		__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
22/******/ 	})();
23/******/ 	
24/******/ 	/* webpack/runtime/make namespace object */
25/******/ 	(() => {
26/******/ 		// define __esModule on exports
27/******/ 		__webpack_require__.r = (exports) => {
28/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
29/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
30/******/ 			}
31/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
32/******/ 		};
33/******/ 	})();
34/******/ 	
35/************************************************************************/
36var __webpack_exports__ = {};
37// ESM COMPAT FLAG
38__webpack_require__.r(__webpack_exports__);
39
40// EXPORTS
41__webpack_require__.d(__webpack_exports__, {
42  ALT: () => (/* binding */ ALT),
43  BACKSPACE: () => (/* binding */ BACKSPACE),
44  COMMAND: () => (/* binding */ COMMAND),
45  CTRL: () => (/* binding */ CTRL),
46  DELETE: () => (/* binding */ DELETE),
47  DOWN: () => (/* binding */ DOWN),
48  END: () => (/* binding */ END),
49  ENTER: () => (/* binding */ ENTER),
50  ESCAPE: () => (/* binding */ ESCAPE),
51  F10: () => (/* binding */ F10),
52  HOME: () => (/* binding */ HOME),
53  LEFT: () => (/* binding */ LEFT),
54  PAGEDOWN: () => (/* binding */ PAGEDOWN),
55  PAGEUP: () => (/* binding */ PAGEUP),
56  RIGHT: () => (/* binding */ RIGHT),
57  SHIFT: () => (/* binding */ SHIFT),
58  SPACE: () => (/* binding */ SPACE),
59  TAB: () => (/* binding */ TAB),
60  UP: () => (/* binding */ UP),
61  ZERO: () => (/* binding */ ZERO),
62  displayShortcut: () => (/* binding */ displayShortcut),
63  displayShortcutList: () => (/* binding */ displayShortcutList),
64  isAppleOS: () => (/* reexport */ isAppleOS),
65  isKeyboardEvent: () => (/* binding */ isKeyboardEvent),
66  modifiers: () => (/* binding */ modifiers),
67  rawShortcut: () => (/* binding */ rawShortcut),
68  shortcutAriaLabel: () => (/* binding */ shortcutAriaLabel)
69});
70
71;// external ["wp","i18n"]
72const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
73;// ./node_modules/@wordpress/keycodes/build-module/platform.js
74function isAppleOS(_window) {
75  if (!_window) {
76    if (typeof window === "undefined") {
77      return false;
78    }
79    _window = window;
80  }
81  const { platform } = _window.navigator;
82  return platform.indexOf("Mac") !== -1 || ["iPad", "iPhone"].includes(platform);
83}
84
85
86;// ./node_modules/@wordpress/keycodes/build-module/index.js
87
88
89const BACKSPACE = 8;
90const TAB = 9;
91const ENTER = 13;
92const ESCAPE = 27;
93const SPACE = 32;
94const PAGEUP = 33;
95const PAGEDOWN = 34;
96const END = 35;
97const HOME = 36;
98const LEFT = 37;
99const UP = 38;
100const RIGHT = 39;
101const DOWN = 40;
102const DELETE = 46;
103const F10 = 121;
104const ALT = "alt";
105const CTRL = "ctrl";
106const COMMAND = "meta";
107const SHIFT = "shift";
108const ZERO = 48;
109function capitaliseFirstCharacter(string) {
110  return string.length < 2 ? string.toUpperCase() : string.charAt(0).toUpperCase() + string.slice(1);
111}
112function mapValues(object, mapFn) {
113  return Object.fromEntries(
114    Object.entries(object).map(([key, value]) => [
115      key,
116      mapFn(value)
117    ])
118  );
119}
120const modifiers = {
121  primary: (_isApple) => _isApple() ? [COMMAND] : [CTRL],
122  primaryShift: (_isApple) => _isApple() ? [SHIFT, COMMAND] : [CTRL, SHIFT],
123  primaryAlt: (_isApple) => _isApple() ? [ALT, COMMAND] : [CTRL, ALT],
124  secondary: (_isApple) => _isApple() ? [SHIFT, ALT, COMMAND] : [CTRL, SHIFT, ALT],
125  access: (_isApple) => _isApple() ? [CTRL, ALT] : [SHIFT, ALT],
126  ctrl: () => [CTRL],
127  alt: () => [ALT],
128  ctrlShift: () => [CTRL, SHIFT],
129  shift: () => [SHIFT],
130  shiftAlt: () => [SHIFT, ALT],
131  undefined: () => []
132};
133const rawShortcut = /* @__PURE__ */ mapValues(modifiers, (modifier) => {
134  return (character, _isApple = isAppleOS) => {
135    return [...modifier(_isApple), character.toLowerCase()].join(
136      "+"
137    );
138  };
139});
140const displayShortcutList = /* @__PURE__ */ mapValues(
141  modifiers,
142  (modifier) => {
143    return (character, _isApple = isAppleOS) => {
144      const isApple = _isApple();
145      const replacementKeyMap = {
146        [ALT]: isApple ? "\u2325" : "Alt",
147        [CTRL]: isApple ? "\u2303" : "Ctrl",
148        // Make sure ⌃ is the U+2303 UP ARROWHEAD unicode character and not the caret character.
149        [COMMAND]: "\u2318",
150        [SHIFT]: isApple ? "\u21E7" : "Shift"
151      };
152      const modifierKeys = modifier(_isApple).reduce(
153        (accumulator, key) => {
154          const replacementKey = replacementKeyMap[key] ?? key;
155          if (isApple) {
156            return [...accumulator, replacementKey];
157          }
158          return [...accumulator, replacementKey, "+"];
159        },
160        []
161      );
162      return [
163        ...modifierKeys,
164        capitaliseFirstCharacter(character)
165      ];
166    };
167  }
168);
169const displayShortcut = /* @__PURE__ */ mapValues(
170  displayShortcutList,
171  (shortcutList) => {
172    return (character, _isApple = isAppleOS) => shortcutList(character, _isApple).join("");
173  }
174);
175const shortcutAriaLabel = /* @__PURE__ */ mapValues(modifiers, (modifier) => {
176  return (character, _isApple = isAppleOS) => {
177    const isApple = _isApple();
178    const replacementKeyMap = {
179      [SHIFT]: "Shift",
180      [COMMAND]: isApple ? "Command" : "Control",
181      [CTRL]: "Control",
182      [ALT]: isApple ? "Option" : "Alt",
183      /* translators: comma as in the character ',' */
184      ",": (0,external_wp_i18n_namespaceObject.__)("Comma"),
185      /* translators: period as in the character '.' */
186      ".": (0,external_wp_i18n_namespaceObject.__)("Period"),
187      /* translators: backtick as in the character '`' */
188      "`": (0,external_wp_i18n_namespaceObject.__)("Backtick"),
189      /* translators: tilde as in the character '~' */
190      "~": (0,external_wp_i18n_namespaceObject.__)("Tilde")
191    };
192    return [...modifier(_isApple), character].map(
193      (key) => capitaliseFirstCharacter(replacementKeyMap[key] ?? key)
194    ).join(isApple ? " " : " + ");
195  };
196});
197function getEventModifiers(event) {
198  return [ALT, CTRL, COMMAND, SHIFT].filter(
199    (key) => event[`${key}Key`]
200  );
201}
202const isKeyboardEvent = /* @__PURE__ */ mapValues(modifiers, (getModifiers) => {
203  return (event, character, _isApple = isAppleOS) => {
204    const mods = getModifiers(_isApple);
205    const eventMods = getEventModifiers(event);
206    const replacementWithShiftKeyMap = {
207      Comma: ",",
208      Backslash: "\\",
209      // Windows returns `\` for both IntlRo and IntlYen.
210      IntlRo: "\\",
211      IntlYen: "\\"
212    };
213    const modsDiff = mods.filter(
214      (mod) => !eventMods.includes(mod)
215    );
216    const eventModsDiff = eventMods.filter(
217      (mod) => !mods.includes(mod)
218    );
219    if (modsDiff.length > 0 || eventModsDiff.length > 0) {
220      return false;
221    }
222    let key = event.key.toLowerCase();
223    if (!character) {
224      return mods.includes(key);
225    }
226    if (event.altKey && character.length === 1) {
227      key = String.fromCharCode(event.keyCode).toLowerCase();
228    }
229    if (event.shiftKey && character.length === 1 && replacementWithShiftKeyMap[event.code]) {
230      key = replacementWithShiftKeyMap[event.code];
231    }
232    if (character === "del") {
233      character = "delete";
234    }
235    return key === character.toLowerCase();
236  };
237});
238
239
240(window.wp = window.wp || {}).keycodes = __webpack_exports__;
241/******/ })()
242;

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.