wulf.js 1.9.3 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/README.md +118 -78
  2. package/changelog.md +60 -0
  3. package/dist/focus-trap.esm.js +202 -136
  4. package/dist/focus-trap.esm.js.map +3 -3
  5. package/dist/focus-trap.global.js +203 -137
  6. package/dist/focus-trap.global.js.map +3 -3
  7. package/dist/focus-trap.global.min.js +4 -4
  8. package/dist/focus-trap.global.min.js.map +4 -4
  9. package/dist/index.esm.js +2130 -858
  10. package/dist/index.esm.js.map +4 -4
  11. package/dist/index.global.js +2124 -852
  12. package/dist/index.global.js.map +4 -4
  13. package/dist/index.global.min.js +4 -4
  14. package/dist/index.global.min.js.map +4 -4
  15. package/dist/mask.css +1 -1
  16. package/dist/mask.css.map +2 -2
  17. package/dist/mask.esm.js +686 -330
  18. package/dist/mask.esm.js.map +3 -3
  19. package/dist/mask.global.js +687 -331
  20. package/dist/mask.global.js.map +3 -3
  21. package/dist/mask.global.min.js +4 -4
  22. package/dist/mask.global.min.js.map +4 -4
  23. package/dist/mask.layered.css +1 -0
  24. package/dist/mask.layered.css.map +7 -0
  25. package/dist/masonry.css +1 -1
  26. package/dist/masonry.css.map +2 -2
  27. package/dist/masonry.esm.js +248 -77
  28. package/dist/masonry.esm.js.map +3 -3
  29. package/dist/masonry.global.js +249 -78
  30. package/dist/masonry.global.js.map +3 -3
  31. package/dist/masonry.global.min.js +4 -4
  32. package/dist/masonry.global.min.js.map +4 -4
  33. package/dist/masonry.layered.css +1 -0
  34. package/dist/masonry.layered.css.map +7 -0
  35. package/dist/scroll.css +1 -1
  36. package/dist/scroll.css.map +2 -2
  37. package/dist/scroll.esm.js +462 -129
  38. package/dist/scroll.esm.js.map +3 -3
  39. package/dist/scroll.global.js +463 -130
  40. package/dist/scroll.global.js.map +3 -3
  41. package/dist/scroll.global.min.js +4 -4
  42. package/dist/scroll.global.min.js.map +4 -4
  43. package/dist/scroll.layered.css +1 -0
  44. package/dist/scroll.layered.css.map +7 -0
  45. package/dist/shortcut.esm.js +164 -48
  46. package/dist/shortcut.esm.js.map +3 -3
  47. package/dist/shortcut.global.js +165 -49
  48. package/dist/shortcut.global.js.map +3 -3
  49. package/dist/shortcut.global.min.js +2 -2
  50. package/dist/shortcut.global.min.js.map +4 -4
  51. package/dist/toast.css +1 -1
  52. package/dist/toast.css.map +2 -2
  53. package/dist/toast.esm.js +489 -124
  54. package/dist/toast.esm.js.map +3 -3
  55. package/dist/toast.global.js +490 -125
  56. package/dist/toast.global.js.map +3 -3
  57. package/dist/toast.global.min.js +3 -3
  58. package/dist/toast.global.min.js.map +4 -4
  59. package/dist/toast.layered.css +1 -0
  60. package/dist/toast.layered.css.map +7 -0
  61. package/dist/types/common/dom.d.ts +38 -0
  62. package/dist/types/focus-trap/FocusTrap.d.ts +14 -6
  63. package/dist/types/focus-trap/types.d.ts +2 -2
  64. package/dist/types/index.d.ts +10 -0
  65. package/dist/types/mask/BaseInputMask.d.ts +20 -0
  66. package/dist/types/mask/InputAmountMask.d.ts +2 -0
  67. package/dist/types/mask/InputEmailMask.d.ts +16 -1
  68. package/dist/types/mask/MaskEngine.d.ts +4 -0
  69. package/dist/types/masonry/Masonry.d.ts +10 -3
  70. package/dist/types/scroll/ScrollBlock.d.ts +31 -3
  71. package/dist/types/scroll/types.d.ts +13 -1
  72. package/dist/types/shortcut/ShortcutFormatter.d.ts +6 -0
  73. package/dist/types/shortcut/ShortcutManager.d.ts +1 -0
  74. package/dist/types/toast/Toast.d.ts +4 -0
  75. package/dist/types/toast/ToastInstance.d.ts +22 -10
  76. package/dist/types/toast/ToastManager.d.ts +37 -4
  77. package/dist/types/toast/i18n/types.d.ts +2 -0
  78. package/dist/types/toast/types.d.ts +9 -2
  79. package/package.json +16 -3
@@ -26,6 +26,24 @@ var __WulfIIFE = (() => {
26
26
  default: () => ShortcutManager
27
27
  });
28
28
 
29
+ // src/common/dom.ts
30
+ function getSafeWulfNamespace() {
31
+ if (typeof window === "undefined") return null;
32
+ const win = window;
33
+ const existing = win.Wulf;
34
+ if (!existing || typeof existing !== "object" || typeof Node !== "undefined" && existing instanceof Node || typeof HTMLCollection !== "undefined" && existing instanceof HTMLCollection) {
35
+ const fresh = {};
36
+ win.Wulf = fresh;
37
+ return fresh;
38
+ }
39
+ return existing;
40
+ }
41
+ function isImeComposing(event) {
42
+ return Boolean(
43
+ event.isComposing || event.key === "Process" || event.key === "Enter" && event.keyCode === 229
44
+ );
45
+ }
46
+
29
47
  // src/shortcut/ShortcutFormatter.ts
30
48
  var ShortcutFormatter = class _ShortcutFormatter {
31
49
  /**
@@ -53,6 +71,9 @@ var __WulfIIFE = (() => {
53
71
  * Normalise un nom de touche unitaire pour les comparaisons.
54
72
  */
55
73
  static normalizeKeyName(key) {
74
+ if (key === " ") {
75
+ return " ";
76
+ }
56
77
  const k = key.trim().toLowerCase();
57
78
  switch (k) {
58
79
  case "esc":
@@ -62,6 +83,8 @@ var __WulfIIFE = (() => {
62
83
  case "space":
63
84
  case "spacebar":
64
85
  return " ";
86
+ case "plus":
87
+ return "+";
65
88
  case "del":
66
89
  return "delete";
67
90
  case "ins":
@@ -86,30 +109,41 @@ var __WulfIIFE = (() => {
86
109
  if (typeof combo !== "string") {
87
110
  return [];
88
111
  }
112
+ if (combo === " ") {
113
+ return [{ ctrl: false, alt: false, shift: false, meta: false, key: " " }];
114
+ }
89
115
  const trimmed = combo.slice(0, 512).trim();
90
116
  if (!trimmed) {
91
117
  return [];
92
118
  }
93
- const stepsRaw = trimmed.split(/\s+/).slice(0, 10);
119
+ const normalizedChordSpacing = trimmed.replace(
120
+ /\b(ctrl|control|alt|option|opt|shift|maj|cmd|command|meta|win|super|mod|\$mod)\s*\+\s*/gi,
121
+ "$1+"
122
+ );
123
+ const stepsRaw = normalizedChordSpacing.split(/\s+/).slice(0, 10);
94
124
  const steps = [];
95
125
  for (const rawStep of stepsRaw) {
96
126
  const tokens = [];
97
- let currentToken = "";
98
- for (let i = 0; i < rawStep.length; i++) {
99
- const char = rawStep[i];
100
- if (char === "+") {
101
- if (currentToken === "" && tokens.length > 0) {
102
- tokens.push("+");
103
- } else if (currentToken !== "") {
104
- tokens.push(currentToken);
105
- currentToken = "";
127
+ if (rawStep === "+") {
128
+ tokens.push("+");
129
+ } else {
130
+ let currentToken = "";
131
+ for (let i = 0; i < rawStep.length; i++) {
132
+ const char = rawStep[i];
133
+ if (char === "+") {
134
+ if (currentToken === "" && tokens.length > 0) {
135
+ tokens.push("+");
136
+ } else if (currentToken !== "") {
137
+ tokens.push(currentToken);
138
+ currentToken = "";
139
+ }
140
+ } else {
141
+ currentToken += char;
106
142
  }
107
- } else {
108
- currentToken += char;
109
143
  }
110
- }
111
- if (currentToken !== "") {
112
- tokens.push(currentToken);
144
+ if (currentToken !== "") {
145
+ tokens.push(currentToken);
146
+ }
113
147
  }
114
148
  let ctrl = false;
115
149
  let alt = false;
@@ -181,18 +215,78 @@ var __WulfIIFE = (() => {
181
215
  /**
182
216
  * Convertit un combo technique vers le format officiel WAI-ARIA `aria-keyshortcuts`.
183
217
  * Standard W3C : les modificateurs sont 'Control', 'Alt', 'Shift', 'Meta' et le séparateur est '+'.
218
+ * Attention : dans WAI-ARIA 1.2, l'espace délimite des raccourcis alternatifs et non une séquence temporelle.
219
+ * Pour une séquence multi-étapes (ex: "g i"), retourne une chaîne vide afin de ne pas induire le lecteur d'écran en erreur.
184
220
  */
185
221
  static toAriaKeyShortcuts(combo, isApple = _ShortcutFormatter.isApple()) {
186
222
  const steps = _ShortcutFormatter.parseCombo(combo, isApple);
187
- return steps.map((step) => {
188
- const parts = [];
189
- if (step.ctrl) parts.push("Control");
190
- if (step.alt) parts.push("Alt");
191
- if (step.shift) parts.push("Shift");
192
- if (step.meta) parts.push("Meta");
193
- parts.push(_ShortcutFormatter.formatKeyDisplay(step.key, false));
194
- return parts.join("+");
195
- }).join(" ");
223
+ if (steps.length !== 1) {
224
+ return "";
225
+ }
226
+ const step = steps[0];
227
+ const ariaKey = _ShortcutFormatter.formatAriaKey(step.key);
228
+ if (!ariaKey) {
229
+ return "";
230
+ }
231
+ const parts = [];
232
+ if (step.ctrl) parts.push("Control");
233
+ if (step.alt) parts.push("Alt");
234
+ if (step.shift) parts.push("Shift");
235
+ if (step.meta) parts.push("Meta");
236
+ parts.push(ariaKey);
237
+ return parts.join("+");
238
+ }
239
+ /**
240
+ * Formate un nom de touche strictement conforme aux valeurs standard W3C UI Events / aria-keyshortcuts.
241
+ */
242
+ static formatAriaKey(key) {
243
+ if (!key) return "";
244
+ switch (key.toLowerCase()) {
245
+ case "escape":
246
+ return "Escape";
247
+ case "enter":
248
+ return "Enter";
249
+ case " ":
250
+ return "Space";
251
+ case "tab":
252
+ return "Tab";
253
+ case "backspace":
254
+ return "Backspace";
255
+ case "delete":
256
+ return "Delete";
257
+ case "insert":
258
+ return "Insert";
259
+ case "home":
260
+ return "Home";
261
+ case "end":
262
+ return "End";
263
+ case "pageup":
264
+ return "PageUp";
265
+ case "pagedown":
266
+ return "PageDown";
267
+ case "arrowup":
268
+ return "ArrowUp";
269
+ case "arrowdown":
270
+ return "ArrowDown";
271
+ case "arrowleft":
272
+ return "ArrowLeft";
273
+ case "arrowright":
274
+ return "ArrowRight";
275
+ case "printscreen":
276
+ return "PrintScreen";
277
+ case "scrolllock":
278
+ return "ScrollLock";
279
+ case "numlock":
280
+ return "NumLock";
281
+ case "capslock":
282
+ return "CapsLock";
283
+ case "contextmenu":
284
+ return "ContextMenu";
285
+ case "+":
286
+ return "Plus";
287
+ default:
288
+ return key.length === 1 ? key.toUpperCase() : key.charAt(0).toUpperCase() + key.slice(1);
289
+ }
196
290
  }
197
291
  static formatKeyDisplay(key, isApple) {
198
292
  if (!key) return "";
@@ -225,17 +319,21 @@ var __WulfIIFE = (() => {
225
319
 
226
320
  // src/shortcut/ShortcutManager.ts
227
321
  var ShortcutManager = class _ShortcutManager {
322
+ options;
323
+ shortcuts = /* @__PURE__ */ new Map();
324
+ scopeStack = [];
325
+ sequenceBuffer = [];
326
+ sequenceTimer = null;
327
+ isListening = true;
328
+ boundListener = null;
329
+ abortController = null;
330
+ idCounter = 0;
228
331
  constructor(options) {
229
- this.shortcuts = /* @__PURE__ */ new Map();
230
- this.scopeStack = [];
231
- this.sequenceBuffer = [];
232
- this.sequenceTimer = null;
233
- this.isListening = true;
234
- this.boundListener = null;
235
- this.idCounter = 0;
332
+ const rawTimeout = options?.sequenceTimeout;
333
+ const sequenceTimeout = typeof rawTimeout === "number" && Number.isFinite(rawTimeout) && rawTimeout > 0 ? Math.min(rawTimeout, 1e4) : 800;
236
334
  this.options = {
237
335
  defaultScope: options?.defaultScope || "global",
238
- sequenceTimeout: options?.sequenceTimeout ?? 800,
336
+ sequenceTimeout,
239
337
  target: options?.target || (typeof window !== "undefined" ? window : {}),
240
338
  onError: options?.onError
241
339
  };
@@ -264,12 +362,12 @@ var __WulfIIFE = (() => {
264
362
  return true;
265
363
  }
266
364
  const role = el.getAttribute("role");
267
- if (role === "textbox" || role === "searchbox") {
365
+ if (role === "textbox" || role === "searchbox" || role === "combobox" || role === "spinbutton") {
268
366
  return true;
269
367
  }
270
368
  if (typeof el.closest === "function") {
271
369
  const editableAncestor = el.closest(
272
- '[contenteditable="true"], [contenteditable="plaintext-only"], [contenteditable=""], [role="textbox"], [role="searchbox"]'
370
+ '[contenteditable="true"], [contenteditable="plaintext-only"], [contenteditable=""], [role="textbox"], [role="searchbox"], [role="combobox"], [role="spinbutton"]'
273
371
  );
274
372
  if (editableAncestor) {
275
373
  return true;
@@ -328,6 +426,9 @@ var __WulfIIFE = (() => {
328
426
  * Retire tous les raccourcis correspondant à une combinaison et éventuellement un scope.
329
427
  */
330
428
  unbind(combo, scope) {
429
+ if (typeof combo !== "string" || !combo.trim()) {
430
+ return;
431
+ }
331
432
  const formatted = ShortcutFormatter.format(combo);
332
433
  for (const [id, s] of this.shortcuts.entries()) {
333
434
  if (s.formattedCombo === formatted || s.combo.trim().toLowerCase() === combo.trim().toLowerCase()) {
@@ -426,7 +527,11 @@ var __WulfIIFE = (() => {
426
527
  attachAria(element, combo) {
427
528
  if (element && typeof element.setAttribute === "function") {
428
529
  const ariaValue = ShortcutFormatter.toAriaKeyShortcuts(combo);
429
- element.setAttribute("aria-keyshortcuts", ariaValue);
530
+ if (ariaValue) {
531
+ element.setAttribute("aria-keyshortcuts", ariaValue);
532
+ } else if (typeof element.removeAttribute === "function") {
533
+ element.removeAttribute("aria-keyshortcuts");
534
+ }
430
535
  }
431
536
  }
432
537
  /**
@@ -450,23 +555,30 @@ var __WulfIIFE = (() => {
450
555
  if (typeof window === "undefined" || !this.options.target) {
451
556
  return;
452
557
  }
558
+ this.abortController = new AbortController();
453
559
  this.boundListener = (event) => this.handleKeyDown(event);
454
560
  const target = this.options.target;
455
561
  if (typeof target.addEventListener === "function") {
456
- target.addEventListener("keydown", this.boundListener, false);
562
+ target.addEventListener("keydown", this.boundListener, {
563
+ capture: false,
564
+ signal: this.abortController.signal
565
+ });
457
566
  }
458
567
  }
459
568
  removeListener() {
460
- if (this.boundListener && this.options.target) {
569
+ if (this.abortController) {
570
+ this.abortController.abort();
571
+ this.abortController = null;
572
+ } else if (this.boundListener && this.options.target) {
461
573
  const target = this.options.target;
462
574
  if (typeof target.removeEventListener === "function") {
463
575
  target.removeEventListener("keydown", this.boundListener, false);
464
576
  }
465
- this.boundListener = null;
466
577
  }
578
+ this.boundListener = null;
467
579
  }
468
580
  handleKeyDown(event) {
469
- if (!this.isListening) {
581
+ if (!this.isListening || isImeComposing(event)) {
470
582
  return;
471
583
  }
472
584
  const k = (event.key || "").toLowerCase();
@@ -485,7 +597,7 @@ var __WulfIIFE = (() => {
485
597
  meta: event.metaKey,
486
598
  key: ShortcutFormatter.normalizeKeyName(event.key || "")
487
599
  };
488
- const now = Date.now();
600
+ const now = event.timeStamp > 0 ? event.timeStamp : typeof performance !== "undefined" ? performance.now() : Date.now();
489
601
  if (this.sequenceBuffer.length > 0) {
490
602
  const last = this.sequenceBuffer[this.sequenceBuffer.length - 1];
491
603
  if (now - last.timestamp > this.options.sequenceTimeout) {
@@ -528,8 +640,12 @@ var __WulfIIFE = (() => {
528
640
  continue;
529
641
  }
530
642
  const firstStep = shortcut.normalizedSteps[0];
531
- if (firstStep && firstStep.key.length === 1 && !firstStep.ctrl && !firstStep.alt && !firstStep.meta) {
532
- continue;
643
+ if (firstStep && firstStep.key.length === 1) {
644
+ const isUntouchedChar = !firstStep.ctrl && !firstStep.alt && !firstStep.meta;
645
+ const isAltGrOrOptionChar = firstStep.ctrl && firstStep.alt && !firstStep.meta || firstStep.alt && !firstStep.ctrl && !firstStep.meta;
646
+ if (isUntouchedChar || isAltGrOrOptionChar) {
647
+ continue;
648
+ }
533
649
  }
534
650
  }
535
651
  list.push(shortcut);
@@ -540,13 +656,15 @@ var __WulfIIFE = (() => {
540
656
  if (step.ctrl !== eventStep.ctrl) return false;
541
657
  if (step.alt !== eventStep.alt) return false;
542
658
  if (step.meta !== eventStep.meta) return false;
543
- const keyMatches = step.key === eventStep.key || rawEvent && step.key === rawEvent.key.toLowerCase();
659
+ const rawKey = typeof rawEvent?.key === "string" ? rawEvent.key : "";
660
+ const keyMatches = step.key === eventStep.key || rawKey !== "" && step.key === rawKey.toLowerCase();
544
661
  if (!keyMatches) return false;
545
662
  if (step.shift === eventStep.shift) {
546
663
  return true;
547
664
  }
548
665
  if (!step.shift && eventStep.shift) {
549
- if (rawEvent && rawEvent.key === step.key) {
666
+ const isNonAlphaSymbol = step.key.length === 1 && !/^[a-z]$/i.test(step.key);
667
+ if (rawKey !== "" && rawKey === step.key || isNonAlphaSymbol && eventStep.key === step.key) {
550
668
  return true;
551
669
  }
552
670
  }
@@ -642,10 +760,8 @@ var __WulfIIFE = (() => {
642
760
  };
643
761
 
644
762
  // src/shortcut/index.ts
645
- if (typeof window !== "undefined") {
646
- const win = window;
647
- const wulfNamespace = win.Wulf || {};
648
- win.Wulf = wulfNamespace;
763
+ var wulfNamespace = getSafeWulfNamespace();
764
+ if (wulfNamespace) {
649
765
  wulfNamespace.Shortcut = Object.assign(ShortcutManager, {
650
766
  ShortcutManager,
651
767
  ShortcutFormatter
@@ -653,5 +769,5 @@ var __WulfIIFE = (() => {
653
769
  }
654
770
  return __toCommonJS(index_exports);
655
771
  })();
656
- if (typeof window !== "undefined") { window.Wulf = window.Wulf || {}; if (typeof __WulfIIFE !== "undefined" && __WulfIIFE) { for (var k in __WulfIIFE) { if (Object.prototype.hasOwnProperty.call(__WulfIIFE, k) && k !== "__proto__" && k !== "constructor" && k !== "prototype" && window.Wulf[k] === undefined) { try { Object.defineProperty(window.Wulf, k, { value: __WulfIIFE[k], writable: true, configurable: true, enumerable: true }); } catch (_) { try { window.Wulf[k] = __WulfIIFE[k]; } catch (__) {} } } } } }
772
+ if (typeof window !== "undefined") { var __w = window.Wulf; if (!__w || typeof __w !== "object" || (typeof Node !== "undefined" && __w instanceof Node) || (typeof HTMLCollection !== "undefined" && __w instanceof HTMLCollection)) { __w = {}; window.Wulf = __w; } if (typeof __WulfIIFE !== "undefined" && __WulfIIFE) { for (var k in __WulfIIFE) { if (Object.hasOwn(__WulfIIFE, k) && k !== "__proto__" && k !== "constructor" && k !== "prototype" && __w[k] === undefined) { try { Object.defineProperty(__w, k, { value: __WulfIIFE[k], writable: true, configurable: true, enumerable: true }); } catch (_) { try { __w[k] = __WulfIIFE[k]; } catch (__) {} } } } } }
657
773
  //# sourceMappingURL=shortcut.global.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/shortcut/index.ts", "../src/shortcut/ShortcutFormatter.ts", "../src/shortcut/ShortcutManager.ts"],
4
- "sourcesContent": ["import { ShortcutManager } from './ShortcutManager';\nimport { ShortcutFormatter } from './ShortcutFormatter';\n\nexport { ShortcutManager } from './ShortcutManager';\nexport { ShortcutFormatter } from './ShortcutFormatter';\nexport * from './types';\nexport { ShortcutManager as default } from './ShortcutManager';\n\n// Attachement namespace global dans les environnements de navigation (IIFE / Vanilla)\nif (typeof window !== 'undefined') {\n const win = window as unknown as Record<string, unknown>;\n const wulfNamespace = ((win.Wulf as Record<string, unknown>) || {}) as Record<string, unknown>;\n win.Wulf = wulfNamespace;\n\n wulfNamespace.Shortcut = Object.assign(ShortcutManager, {\n ShortcutManager,\n ShortcutFormatter\n });\n}\n\n\n", "import { NormalizedStep } from './types';\n\n/**\n * Utilitaires de d\u00E9tection d'OS, de parsing de cha\u00EEnes et de formatage de raccourcis.\n */\nexport class ShortcutFormatter {\n /**\n * D\u00E9tecte si l'environnement d'ex\u00E9cution actuel est un environnement Apple (macOS / iOS / iPadOS).\n */\n public static isApple(): boolean {\n if (typeof navigator === 'undefined') {\n return false;\n }\n\n // 1. D\u00E9tection moderne via User-Agent Client Hints (si disponible)\n const uaData = (navigator as unknown as { userAgentData?: { platform?: string } }).userAgentData;\n if (uaData && typeof uaData.platform === 'string') {\n const p = uaData.platform.toLowerCase();\n if (p.includes('mac') || p.includes('ios')) {\n return true;\n }\n }\n\n // 2. D\u00E9tection via navigator.platform\n const platform = (navigator.platform || '').toLowerCase();\n if (platform.includes('mac') || platform.includes('iphone') || platform.includes('ipad') || platform.includes('ipod')) {\n return true;\n }\n\n // 3. D\u00E9tection de secours via User-Agent\n const ua = (navigator.userAgent || '').toLowerCase();\n return ua.includes('macintosh') || ua.includes('mac os x') || ua.includes('ipad') || ua.includes('iphone');\n }\n\n /**\n * Normalise un nom de touche unitaire pour les comparaisons.\n */\n public static normalizeKeyName(key: string): string {\n const k = key.trim().toLowerCase();\n switch (k) {\n case 'esc':\n return 'escape';\n case 'return':\n return 'enter';\n case 'space':\n case 'spacebar':\n return ' ';\n case 'del':\n return 'delete';\n case 'ins':\n return 'insert';\n case 'up':\n return 'arrowup';\n case 'down':\n return 'arrowdown';\n case 'left':\n return 'arrowleft';\n case 'right':\n return 'arrowright';\n default:\n return k;\n }\n }\n\n /**\n * Parse une cha\u00EEne de combinaison (ex: \"Mod+K\", \"g i\", \"Shift+?\", \"Alt++\")\n * et retourne la liste des \u00E9tapes normalis\u00E9es n\u00E9cessaires au d\u00E9clenchement.\n */\n public static parseCombo(combo: string, isApple: boolean = ShortcutFormatter.isApple()): NormalizedStep[] {\n if (typeof combo !== 'string') {\n return [];\n }\n const trimmed = combo.slice(0, 512).trim();\n if (!trimmed) {\n return [];\n }\n\n // D\u00E9coupage en \u00E9tapes pour les s\u00E9quences (ex: \"g i\" -> [\"g\", \"i\"]), plafonn\u00E9 \u00E0 10 \u00E9tapes max (anti-DoS)\n // Attention : on s\u00E9pare par espaces, sauf si l'espace est la touche elle-m\u00EAme (\"space\")\n const stepsRaw = trimmed.split(/\\s+/).slice(0, 10);\n const steps: NormalizedStep[] = [];\n\n for (const rawStep of stepsRaw) {\n // D\u00E9coupage de chaque accord sur le symbole '+' (gestion du cas '++' pour la touche '+')\n const tokens: string[] = [];\n let currentToken = '';\n\n for (let i = 0; i < rawStep.length; i++) {\n const char = rawStep[i];\n if (char === '+') {\n // Si le token actuel est vide et qu'on a d\u00E9j\u00E0 des tokens, c'est que c'est un '+' litt\u00E9ral (ex: \"Ctrl++\")\n if (currentToken === '' && tokens.length > 0) {\n tokens.push('+');\n } else if (currentToken !== '') {\n tokens.push(currentToken);\n currentToken = '';\n }\n } else {\n currentToken += char;\n }\n }\n if (currentToken !== '') {\n tokens.push(currentToken);\n }\n\n let ctrl = false;\n let alt = false;\n let shift = false;\n let meta = false;\n let mainKey = '';\n\n for (const token of tokens) {\n const lower = token.trim().toLowerCase();\n if (lower === 'ctrl' || lower === 'control') {\n ctrl = true;\n } else if (lower === 'alt' || lower === 'option' || lower === 'opt') {\n alt = true;\n } else if (lower === 'shift' || lower === 'maj') {\n shift = true;\n } else if (lower === 'cmd' || lower === 'command' || lower === 'meta' || lower === 'win' || lower === 'super') {\n meta = true;\n } else if (lower === 'mod' || lower === '$mod') {\n if (isApple) {\n meta = true;\n } else {\n ctrl = true;\n }\n } else {\n // Touche principale\n mainKey = ShortcutFormatter.normalizeKeyName(token);\n }\n }\n\n steps.push({\n ctrl,\n alt,\n shift,\n meta,\n key: mainKey\n });\n }\n\n return steps;\n }\n\n /**\n * Formate une combinaison brute en libell\u00E9 soign\u00E9 et lisible pour l'OS cible.\n * Ex: \"Mod+Shift+P\" -> macOS: \"\u21E7\u2318P\", Windows: \"Ctrl+Shift+P\"\n * Ex: \"g i\" -> \"g puis i\" ou \"g i\"\n */\n public static format(combo: string, isApple: boolean = ShortcutFormatter.isApple()): string {\n const steps = ShortcutFormatter.parseCombo(combo, isApple);\n if (steps.length === 0) {\n return combo;\n }\n\n const formattedSteps = steps.map(step => {\n const parts: string[] = [];\n\n if (isApple) {\n if (step.ctrl) parts.push('\u2303');\n if (step.alt) parts.push('\u2325');\n if (step.shift) parts.push('\u21E7');\n if (step.meta) parts.push('\u2318');\n\n const keyDisplay = ShortcutFormatter.formatKeyDisplay(step.key, true);\n parts.push(keyDisplay);\n return parts.join('');\n } else {\n if (step.ctrl) parts.push('Ctrl');\n if (step.alt) parts.push('Alt');\n if (step.shift) parts.push('Shift');\n if (step.meta) parts.push('Win');\n\n const keyDisplay = ShortcutFormatter.formatKeyDisplay(step.key, false);\n parts.push(keyDisplay);\n return parts.join('+');\n }\n });\n\n return formattedSteps.join(' ');\n }\n\n /**\n * Convertit un combo technique vers le format officiel WAI-ARIA `aria-keyshortcuts`.\n * Standard W3C : les modificateurs sont 'Control', 'Alt', 'Shift', 'Meta' et le s\u00E9parateur est '+'.\n */\n public static toAriaKeyShortcuts(combo: string, isApple: boolean = ShortcutFormatter.isApple()): string {\n const steps = ShortcutFormatter.parseCombo(combo, isApple);\n return steps.map(step => {\n const parts: string[] = [];\n if (step.ctrl) parts.push('Control');\n if (step.alt) parts.push('Alt');\n if (step.shift) parts.push('Shift');\n if (step.meta) parts.push('Meta');\n parts.push(ShortcutFormatter.formatKeyDisplay(step.key, false));\n return parts.join('+');\n }).join(' ');\n }\n\n private static formatKeyDisplay(key: string, isApple: boolean): string {\n if (!key) return '';\n switch (key.toLowerCase()) {\n case 'escape':\n return isApple ? '\u238B' : 'Esc';\n case 'enter':\n return isApple ? '\u21A9' : 'Enter';\n case ' ':\n return isApple ? '\u2423' : 'Space';\n case 'tab':\n return isApple ? '\u21E5' : 'Tab';\n case 'backspace':\n return isApple ? '\u232B' : 'Backspace';\n case 'delete':\n return isApple ? '\u2326' : 'Suppr';\n case 'arrowup':\n return '\u2191';\n case 'arrowdown':\n return '\u2193';\n case 'arrowleft':\n return '\u2190';\n case 'arrowright':\n return '\u2192';\n default:\n return key.length === 1 ? key.toUpperCase() : key.charAt(0).toUpperCase() + key.slice(1);\n }\n }\n}\n\n", "import {\n ShortcutDefinition,\n ShortcutManagerOptions,\n ShortcutInfo,\n RegisteredShortcut,\n NormalizedStep\n} from './types';\nimport { ShortcutFormatter } from './ShortcutFormatter';\n\n/**\n * Moteur autonome et modulaire de gestion des raccourcis clavier applicatifs (Wulf.Shortcut).\n * Z\u00E9ro d\u00E9pendance. Conforme \u00E0 l'Axiome Primordial de pr\u00E9servation de la saisie utilisateur.\n */\nexport class ShortcutManager {\n private readonly options: Required<Omit<ShortcutManagerOptions, 'onError'>> & {\n onError?: (error: Error, combo: string) => void;\n };\n private readonly shortcuts: Map<string, RegisteredShortcut> = new Map();\n private scopeStack: string[] = [];\n private sequenceBuffer: { step: NormalizedStep; timestamp: number }[] = [];\n private sequenceTimer: ReturnType<typeof setTimeout> | null = null;\n private isListening = true;\n private boundListener: ((event: KeyboardEvent) => void) | null = null;\n private idCounter = 0;\n\n constructor(options?: ShortcutManagerOptions) {\n this.options = {\n defaultScope: options?.defaultScope || 'global',\n sequenceTimeout: options?.sequenceTimeout ?? 800,\n target: options?.target || (typeof window !== 'undefined' ? window : ({} as Window)),\n onError: options?.onError\n };\n\n this.scopeStack = [this.options.defaultScope];\n this.initListener();\n }\n\n /**\n * V\u00E9rifie si un \u00E9l\u00E9ment DOM est une zone d'\u00E9dition o\u00F9 la saisie de l'utilisateur\n * ne doit JAMAIS \u00EAtre interrompue ou d\u00E9tourn\u00E9e (Axiome Primordial).\n */\n public static isEditable(target: EventTarget | null): boolean {\n if (!target || typeof (target as HTMLElement).tagName !== 'string') {\n return false;\n }\n\n const el = target as HTMLElement;\n const tagName = el.tagName.toUpperCase();\n\n // 1. \u00C9l\u00E9ments natifs de formulaire textuel\n if (tagName === 'INPUT') {\n const type = (el as HTMLInputElement).type?.toLowerCase() || 'text';\n // Seuls les types non-textuels ne sont pas consid\u00E9r\u00E9s comme de la saisie libre\n const nonTextTypes = ['button', 'checkbox', 'radio', 'submit', 'reset', 'range', 'color', 'file', 'image'];\n return !nonTextTypes.includes(type);\n }\n if (tagName === 'TEXTAREA' || tagName === 'SELECT') {\n return true;\n }\n\n // 2. \u00C9l\u00E9ments modifiables en ligne (contenteditable)\n if (\n el.isContentEditable ||\n el.getAttribute('contenteditable') === 'true' ||\n el.getAttribute('contenteditable') === 'plaintext-only' ||\n el.getAttribute('contenteditable') === ''\n ) {\n return true;\n }\n\n // 3. R\u00F4les ARIA de saisie\n const role = el.getAttribute('role');\n if (role === 'textbox' || role === 'searchbox') {\n return true;\n }\n\n // 4. \u00C9l\u00E9ment enfant situ\u00E9 \u00E0 l'int\u00E9rieur d'un conteneur contenteditable ou ARIA textbox/searchbox\n if (typeof el.closest === 'function') {\n const editableAncestor = el.closest(\n '[contenteditable=\"true\"], [contenteditable=\"plaintext-only\"], [contenteditable=\"\"], [role=\"textbox\"], [role=\"searchbox\"]'\n );\n if (editableAncestor) {\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * V\u00E9rifie si la cible est un champ de mot de passe (sanctuaire anti-keylogging).\n */\n private static isPasswordField(target: EventTarget | null): boolean {\n if (!target || typeof (target as HTMLElement).tagName !== 'string') {\n return false;\n }\n const el = target as HTMLInputElement;\n return el.tagName.toUpperCase() === 'INPUT' && (el.type || '').toLowerCase() === 'password';\n }\n\n /**\n * Enregistre un ou plusieurs raccourcis clavier.\n * Retourne une fonction de nettoyage pour d\u00E9senregistrer imm\u00E9diatement.\n */\n public bind(definition: ShortcutDefinition | ShortcutDefinition[]): () => void {\n const list = Array.isArray(definition) ? definition : [definition];\n const registeredIds: string[] = [];\n\n for (const def of list) {\n if (!def.combo || typeof def.handler !== 'function') {\n continue;\n }\n\n const id = `wulf_shortcut_${++this.idCounter}`;\n const normalizedSteps = ShortcutFormatter.parseCombo(def.combo);\n const isSequence = normalizedSteps.length > 1;\n const formattedCombo = ShortcutFormatter.format(def.combo);\n\n const registered: RegisteredShortcut = {\n ...def,\n id,\n scope: def.scope || 'global',\n category: def.category || 'G\u00E9n\u00E9ral',\n allowInEditable: def.allowInEditable ?? false,\n preventDefault: def.preventDefault ?? true,\n stopPropagation: def.stopPropagation ?? true,\n priority: def.priority ?? 0,\n formattedCombo,\n normalizedSteps,\n isSequence\n };\n\n this.shortcuts.set(id, registered);\n registeredIds.push(id);\n }\n\n // Fonction de d\u00E9sabonnement direct\n return () => {\n for (const id of registeredIds) {\n this.shortcuts.delete(id);\n }\n };\n }\n\n /**\n * Retire tous les raccourcis correspondant \u00E0 une combinaison et \u00E9ventuellement un scope.\n */\n public unbind(combo: string, scope?: string): void {\n const formatted = ShortcutFormatter.format(combo);\n for (const [id, s] of this.shortcuts.entries()) {\n if (s.formattedCombo === formatted || s.combo.trim().toLowerCase() === combo.trim().toLowerCase()) {\n if (!scope || s.scope === scope) {\n this.shortcuts.delete(id);\n }\n }\n }\n }\n\n /**\n * Empile un nouveau scope actif (mode LIFO).\n * Seuls les raccourcis de ce scope (et les omnipr\u00E9sents '*') seront actifs.\n */\n public pushScope(scope: string): void {\n if (scope && typeof scope === 'string') {\n if (this.scopeStack.length >= 64) {\n return;\n }\n this.scopeStack.push(scope);\n this.clearSequenceBuffer();\n }\n }\n\n /**\n * D\u00E9pile le scope actuel et r\u00E9tablit le pr\u00E9c\u00E9dent.\n * Si un param\u00E8tre `scope` est pass\u00E9, ne retire que si le scope actuel correspond.\n */\n public popScope(scope?: string): string | undefined {\n if (this.scopeStack.length <= 1) {\n return this.scopeStack[0];\n }\n\n if (scope) {\n if (this.getScope() === scope) {\n const popped = this.scopeStack.pop();\n this.clearSequenceBuffer();\n return popped;\n }\n return undefined;\n }\n\n const popped = this.scopeStack.pop();\n this.clearSequenceBuffer();\n return popped;\n }\n\n /**\n * R\u00E9initialise brutalement la pile pour activer le scope sp\u00E9cifi\u00E9.\n */\n public setScope(scope: string): void {\n this.scopeStack = [scope || this.options.defaultScope];\n this.clearSequenceBuffer();\n }\n\n /**\n * Retourne le scope actuellement actif au sommet de la pile.\n */\n public getScope(): string {\n return this.scopeStack[this.scopeStack.length - 1] || this.options.defaultScope;\n }\n\n /**\n * Retourne une copie de la pile compl\u00E8te des scopes.\n */\n public getScopeStack(): string[] {\n return [...this.scopeStack];\n }\n\n /**\n * Met en pause l'\u00E9coute de tous les raccourcis.\n */\n public pause(): void {\n this.isListening = false;\n this.clearSequenceBuffer();\n }\n\n /**\n * R\u00E9active l'\u00E9coute des raccourcis.\n */\n public resume(): void {\n this.isListening = true;\n }\n\n /**\n * Indique si le gestionnaire est actif et \u00E0 l'\u00E9coute.\n */\n public isActive(): boolean {\n return this.isListening;\n }\n\n /**\n * Retourne le catalogue des raccourcis enregistr\u00E9s (optionnellement filtr\u00E9 par scope).\n */\n public getRegistry(scope?: string): RegisteredShortcut[] {\n const list: RegisteredShortcut[] = [];\n for (const shortcut of this.shortcuts.values()) {\n if (!scope || shortcut.scope === scope || shortcut.scope === '*') {\n list.push({ ...shortcut });\n }\n }\n return list;\n }\n\n /**\n * Associe l'attribut standard WAI-ARIA `aria-keyshortcuts` sur un \u00E9l\u00E9ment DOM.\n */\n public attachAria(element: HTMLElement, combo: string): void {\n if (element && typeof element.setAttribute === 'function') {\n const ariaValue = ShortcutFormatter.toAriaKeyShortcuts(combo);\n element.setAttribute('aria-keyshortcuts', ariaValue);\n }\n }\n\n /**\n * Formate une combinaison brute selon l'OS courant (\"\u2318K\" ou \"Ctrl+K\").\n */\n public static format(combo: string, isApple?: boolean): string {\n return ShortcutFormatter.format(combo, isApple);\n }\n\n /**\n * D\u00E9truit le gestionnaire : supprime les \u00E9couteurs du DOM et vide toute la m\u00E9moire.\n */\n public destroy(): void {\n this.pause();\n this.removeListener();\n this.shortcuts.clear();\n this.scopeStack = [];\n this.clearSequenceBuffer();\n }\n\n // --- Impl\u00E9mentation Interne ---\n\n private initListener(): void {\n if (typeof window === 'undefined' || !this.options.target) {\n return;\n }\n\n this.boundListener = (event: KeyboardEvent) => this.handleKeyDown(event);\n const target = this.options.target as EventTarget;\n if (typeof target.addEventListener === 'function') {\n target.addEventListener('keydown', this.boundListener as EventListener, false);\n }\n }\n\n private removeListener(): void {\n if (this.boundListener && this.options.target) {\n const target = this.options.target as EventTarget;\n if (typeof target.removeEventListener === 'function') {\n target.removeEventListener('keydown', this.boundListener as EventListener, false);\n }\n this.boundListener = null;\n }\n }\n\n private handleKeyDown(event: KeyboardEvent): void {\n if (!this.isListening) {\n return;\n }\n\n // Touches modificatrices isol\u00E9es : on ne fait rien\n const k = (event.key || '').toLowerCase();\n if (['control', 'alt', 'shift', 'meta'].includes(k)) {\n return;\n }\n\n const currentScope = this.getScope();\n const composed = typeof event.composedPath === 'function' ? event.composedPath() : [];\n const actualTarget = (composed.length > 0 ? composed[0] : event.target) as EventTarget | null;\n const isEditable = ShortcutManager.isEditable(actualTarget) || ShortcutManager.isEditable(event.target);\n const isPasswordInput = ShortcutManager.isPasswordField(actualTarget) || ShortcutManager.isPasswordField(event.target);\n\n // Extraction du pas de touche actuel\n const currentStep: NormalizedStep = {\n ctrl: event.ctrlKey,\n alt: event.altKey,\n shift: event.shiftKey,\n meta: event.metaKey,\n key: ShortcutFormatter.normalizeKeyName(event.key || '')\n };\n\n const now = Date.now();\n\n // 1. Purge du buffer de s\u00E9quence si le d\u00E9lai est d\u00E9pass\u00E9\n if (this.sequenceBuffer.length > 0) {\n const last = this.sequenceBuffer[this.sequenceBuffer.length - 1];\n if (now - last.timestamp > this.options.sequenceTimeout) {\n this.clearSequenceBuffer();\n }\n }\n\n // Candidats potentiels actifs pour le scope courant\n const activeCandidates = this.getActiveShortcuts(currentScope, isEditable, isPasswordInput);\n\n // 2. \u00C9valuation des s\u00E9quences temporelles (Key Sequences)\n const proposedSequence = [...this.sequenceBuffer.map(b => b.step), currentStep];\n const matchingSequence = this.findMatchingSequence(activeCandidates, proposedSequence);\n\n if (matchingSequence) {\n this.clearSequenceBuffer();\n this.executeShortcut(matchingSequence, event, currentScope, true);\n return;\n }\n\n // V\u00E9rifier si le pas actuel peut \u00EAtre le pr\u00E9fixe d'une s\u00E9quence enregistr\u00E9e\n if (this.isPrefixOfAnySequence(activeCandidates, proposedSequence)) {\n this.sequenceBuffer.push({ step: currentStep, timestamp: now });\n this.resetSequenceTimer();\n // On bloque l'\u00E9v\u00E9nement pour ne pas d\u00E9clencher un accord unitaire pendant une s\u00E9quence\n if (event.key.length === 1 && !event.ctrlKey && !event.altKey && !event.metaKey && !isEditable) {\n event.preventDefault();\n }\n return;\n }\n\n // Si la s\u00E9quence ne m\u00E8ne \u00E0 rien, on vide le buffer\n this.clearSequenceBuffer();\n\n // 3. \u00C9valuation des accords simultan\u00E9s unitaires (Single Chords)\n const matchingChord = this.findMatchingChord(activeCandidates, currentStep, event);\n if (matchingChord) {\n this.executeShortcut(matchingChord, event, currentScope, false);\n }\n }\n\n private getActiveShortcuts(\n currentScope: string,\n isEditable: boolean,\n isPasswordInput: boolean = false\n ): RegisteredShortcut[] {\n const list: RegisteredShortcut[] = [];\n for (const shortcut of this.shortcuts.values()) {\n // Filtrage de scope\n if (shortcut.scope !== currentScope && shortcut.scope !== '*') {\n continue;\n }\n // R\u00C8GLE ABSOLUE (Axiome Primordial) : Filtrage des \u00E9l\u00E9ments \u00E9ditables\n if (isEditable && !shortcut.allowInEditable) {\n continue;\n }\n // Sanctuaire Password : m\u00EAme avec allowInEditable: true, interdire les s\u00E9quences et touches imprimables sans modificateur\n if (isPasswordInput) {\n if (shortcut.isSequence) {\n continue;\n }\n const firstStep = shortcut.normalizedSteps[0];\n if (firstStep && firstStep.key.length === 1 && !firstStep.ctrl && !firstStep.alt && !firstStep.meta) {\n continue;\n }\n }\n list.push(shortcut);\n }\n\n // Tri par priorit\u00E9 d\u00E9croissante\n return list.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));\n }\n\n private stepMatches(step: NormalizedStep, eventStep: NormalizedStep, rawEvent?: KeyboardEvent): boolean {\n if (step.ctrl !== eventStep.ctrl) return false;\n if (step.alt !== eventStep.alt) return false;\n if (step.meta !== eventStep.meta) return false;\n\n // Correspondance de la touche\n const keyMatches =\n step.key === eventStep.key ||\n (rawEvent && step.key === rawEvent.key.toLowerCase());\n\n if (!keyMatches) return false;\n\n // Correspondance Shift :\n // Si la touche sp\u00E9cifie shift: true, l'\u00E9v\u00E9nement doit avoir shiftKey true.\n // Si la touche sp\u00E9cifie shift: false, mais que le caract\u00E8re est un symbole (ex: \"?\")\n // tap\u00E9 avec shift, on tol\u00E8re si la touche correspond exactement.\n if (step.shift === eventStep.shift) {\n return true;\n }\n\n if (!step.shift && eventStep.shift) {\n // Autoris\u00E9 si c'est un caract\u00E8re sp\u00E9cial direct (comme \"?\" ou \"!\")\n if (rawEvent && rawEvent.key === step.key) {\n return true;\n }\n }\n\n return false;\n }\n\n private findMatchingChord(\n candidates: RegisteredShortcut[],\n currentStep: NormalizedStep,\n rawEvent: KeyboardEvent\n ): RegisteredShortcut | null {\n for (const candidate of candidates) {\n if (candidate.isSequence || candidate.normalizedSteps.length !== 1) {\n continue;\n }\n\n const step = candidate.normalizedSteps[0];\n if (this.stepMatches(step, currentStep, rawEvent)) {\n return candidate;\n }\n }\n return null;\n }\n\n private findMatchingSequence(\n candidates: RegisteredShortcut[],\n proposed: NormalizedStep[]\n ): RegisteredShortcut | null {\n for (const candidate of candidates) {\n if (!candidate.isSequence || candidate.normalizedSteps.length !== proposed.length) {\n continue;\n }\n\n let allMatch = true;\n for (let i = 0; i < proposed.length; i++) {\n if (!this.stepMatches(candidate.normalizedSteps[i], proposed[i])) {\n allMatch = false;\n break;\n }\n }\n\n if (allMatch) {\n return candidate;\n }\n }\n return null;\n }\n\n private isPrefixOfAnySequence(candidates: RegisteredShortcut[], proposed: NormalizedStep[]): boolean {\n for (const candidate of candidates) {\n if (!candidate.isSequence || candidate.normalizedSteps.length <= proposed.length) {\n continue;\n }\n\n let prefixMatches = true;\n for (let i = 0; i < proposed.length; i++) {\n if (!this.stepMatches(candidate.normalizedSteps[i], proposed[i])) {\n prefixMatches = false;\n break;\n }\n }\n\n if (prefixMatches) {\n return true;\n }\n }\n return false;\n }\n\n private executeShortcut(\n shortcut: RegisteredShortcut,\n event: KeyboardEvent,\n scope: string,\n isSequence: boolean\n ): void {\n if (shortcut.preventDefault) {\n event.preventDefault();\n }\n if (shortcut.stopPropagation) {\n event.stopPropagation();\n }\n\n const info: ShortcutInfo = {\n combo: shortcut.combo,\n formattedCombo: shortcut.formattedCombo,\n scope,\n target: event.target,\n isSequence\n };\n\n try {\n shortcut.handler(event, info);\n } catch (err) {\n if (this.options.onError) {\n this.options.onError(err instanceof Error ? err : new Error(String(err)), shortcut.combo);\n } else {\n console.error(`[Wulf.Shortcut] Erreur lors de l'ex\u00E9cution du raccourci \"${shortcut.combo}\":`, err);\n }\n }\n }\n\n private resetSequenceTimer(): void {\n if (this.sequenceTimer) {\n clearTimeout(this.sequenceTimer);\n }\n this.sequenceTimer = setTimeout(() => {\n this.clearSequenceBuffer();\n }, this.options.sequenceTimeout);\n }\n\n private clearSequenceBuffer(): void {\n this.sequenceBuffer = [];\n if (this.sequenceTimer) {\n clearTimeout(this.sequenceTimer);\n this.sequenceTimer = null;\n }\n }\n}\n\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACKO,MAAM,oBAAN,MAAM,mBAAkB;AAAA;AAAA;AAAA;AAAA,IAI7B,OAAc,UAAmB;AAC/B,UAAI,OAAO,cAAc,aAA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.ts"],
4
+ "sourcesContent": ["import { getSafeWulfNamespace } from '../common/dom';\nimport { ShortcutManager } from './ShortcutManager';\nimport { ShortcutFormatter } from './ShortcutFormatter';\n\nexport { ShortcutManager } from './ShortcutManager';\nexport { ShortcutFormatter } from './ShortcutFormatter';\nexport * from './types';\nexport { ShortcutManager as default } from './ShortcutManager';\n\n// Attachement namespace global dans les environnements de navigation (IIFE / Vanilla)\nconst wulfNamespace = getSafeWulfNamespace();\nif (wulfNamespace) {\n wulfNamespace.Shortcut = Object.assign(ShortcutManager, {\n ShortcutManager,\n ShortcutFormatter\n });\n}\n\n\n", "/**\n * Utilitaires DOM & animations l\u00E9gers partag\u00E9s entre les modules Wulf (z\u00E9ro d\u00E9pendance).\n */\n\n/**\n * Retourne de mani\u00E8re s\u00FBre le namespace global window.Wulf en bloquant tout DOM Clobbering.\n */\nexport function getSafeWulfNamespace(): Record<string, unknown> | null {\n if (typeof window === 'undefined') return null;\n const win = window as unknown as Record<string, unknown>;\n const existing = win.Wulf;\n if (\n !existing ||\n typeof existing !== 'object' ||\n (typeof Node !== 'undefined' && existing instanceof Node) ||\n (typeof HTMLCollection !== 'undefined' && existing instanceof HTMLCollection)\n ) {\n const fresh: Record<string, unknown> = {};\n win.Wulf = fresh;\n return fresh;\n }\n return existing as Record<string, unknown>;\n}\n\n/**\n * \u00C9chappe une cha\u00EEne pour son utilisation s\u00FBre dans un s\u00E9lecteur CSS.\n */\nexport function safeCssEscape(value: string): string {\n if (typeof CSS !== 'undefined' && typeof CSS.escape === 'function') {\n return CSS.escape(value);\n }\n return String(value).replace(/[\"\\\\\\u0000-\\u001F\\u007F]/g, '\\\\$&');\n}\n\n/**\n * Retourne l'\u00E9l\u00E9ment ayant r\u00E9ellement le focus, en descendant \u00E0 travers les Shadow Roots ouverts.\n */\nexport function getDeepActiveElement(root?: Document | ShadowRoot | null): HTMLElement | null {\n if (typeof document === 'undefined') return null;\n let active: Element | null = (root ?? document).activeElement;\n while (active && active.shadowRoot && active.shadowRoot.activeElement) {\n active = active.shadowRoot.activeElement;\n }\n return active && typeof (active as HTMLElement).focus === 'function' ? (active as HTMLElement) : null;\n}\n\n/**\n * D\u00E9place un n\u0153ud DOM via moveBefore() si disponible et compatible (m\u00EAme racine connect\u00E9e)\n * afin de pr\u00E9server focus, \u00E9tat d'iframe et animations CSS, avec repli insertBefore().\n */\nexport function safeMove(parent: Element, node: Node, referenceNode: Node | null = null): void {\n const moveBefore = (parent as Element & { moveBefore?: (n: Node, ref: Node | null) => void }).moveBefore;\n if (\n typeof moveBefore === 'function' &&\n node.isConnected &&\n parent.isConnected &&\n typeof parent.getRootNode === 'function' &&\n typeof node.getRootNode === 'function' &&\n parent.getRootNode() === node.getRootNode()\n ) {\n try {\n moveBefore.call(parent, node, referenceNode);\n return;\n } catch {\n // Repli transparent vers insertBefore si l'op\u00E9ration atomique \u00E9choue\n }\n }\n parent.insertBefore(node, referenceNode);\n}\n\n/**\n * D\u00E9tecte une composition IME en cours, en cantonnant le repli Safari WebKit 165004 (keyCode 229)\n * \u00E0 la touche Enter pour ne pas bloquer les claviers virtuels mobiles Android.\n */\nexport function isImeComposing(event: KeyboardEvent): boolean {\n return Boolean(\n event.isComposing ||\n event.key === 'Process' ||\n (event.key === 'Enter' && event.keyCode === 229)\n );\n}\n\n/**\n * Convertit une dur\u00E9e CSS (nombre en ms ou cha\u00EEne \".3s\" / \"300ms\" / \"0.3s, 150ms\") en millisecondes born\u00E9es.\n */\nexport function parseCssDurationMs(\n duration: number | string | undefined,\n fallbackMs: number = 300,\n maxMs: number = 60000\n): number {\n const safeFallback = Number.isFinite(fallbackMs) && fallbackMs >= 0 ? Math.min(fallbackMs, maxMs) : 300;\n if (typeof duration === 'number') {\n return Number.isFinite(duration) && duration >= 0 ? Math.min(duration, maxMs) : safeFallback;\n }\n if (typeof duration === 'string') {\n const parts = duration.split(',');\n let maxParsed = -1;\n for (const part of parts) {\n const match = /^\\+?(\\d+(?:\\.\\d+)?|\\.\\d+)(ms|s)?$/i.exec(part.trim());\n if (match) {\n const raw = parseFloat(match[1]);\n if (Number.isFinite(raw) && raw >= 0) {\n const ms = match[2]?.toLowerCase() === 's' ? raw * 1000 : raw;\n if (ms > maxParsed) {\n maxParsed = ms;\n }\n }\n }\n }\n if (maxParsed >= 0) {\n return Math.min(maxParsed, maxMs);\n }\n }\n return safeFallback;\n}\n\n/**\n * Indique si l'utilisateur pr\u00E9f\u00E8re les animations r\u00E9duites.\n */\nexport function prefersReducedMotion(): boolean {\n return (\n typeof window !== 'undefined' &&\n typeof window.matchMedia === 'function' &&\n window.matchMedia('(prefers-reduced-motion: reduce)').matches\n );\n}\n\n/**\n * Attend la fin des animations/transitions CSS finies en cours sur un \u00E9l\u00E9ment via getAnimations(),\n * avec r\u00E9solution imm\u00E9diate sous prefers-reduced-motion et filet de s\u00E9curit\u00E9 timeout/signal.\n */\nexport function waitForAnimations(\n element: Element,\n fallbackMs: number,\n signal?: AbortSignal\n): Promise<void> {\n const safeFallback = Number.isFinite(fallbackMs) ? Math.min(fallbackMs, 60000) : 300;\n if (signal?.aborted || safeFallback <= 0 || prefersReducedMotion()) {\n return Promise.resolve();\n }\n\n const animations = typeof element.getAnimations === 'function'\n ? element.getAnimations().filter((a) => {\n if (a.playState !== 'running') return false;\n const timing = a.effect?.getComputedTiming?.();\n return timing ? Number.isFinite(timing.endTime as number) : true;\n })\n : [];\n if (animations.length === 0) {\n return Promise.resolve();\n }\n\n return new Promise<void>((resolve) => {\n let settled = false;\n let timerId: ReturnType<typeof setTimeout> | null = null;\n\n const finish = () => {\n if (settled) return;\n settled = true;\n if (timerId !== null) {\n clearTimeout(timerId);\n timerId = null;\n }\n signal?.removeEventListener('abort', finish);\n resolve();\n };\n\n signal?.addEventListener('abort', finish, { once: true });\n timerId = setTimeout(finish, safeFallback);\n Promise.allSettled(animations.map((a) => a.finished)).then(finish);\n });\n}\n", "import { NormalizedStep } from './types';\n\n/**\n * Utilitaires de d\u00E9tection d'OS, de parsing de cha\u00EEnes et de formatage de raccourcis.\n */\nexport class ShortcutFormatter {\n /**\n * D\u00E9tecte si l'environnement d'ex\u00E9cution actuel est un environnement Apple (macOS / iOS / iPadOS).\n */\n public static isApple(): boolean {\n if (typeof navigator === 'undefined') {\n return false;\n }\n\n // 1. D\u00E9tection moderne via User-Agent Client Hints (si disponible)\n const uaData = (navigator as unknown as { userAgentData?: { platform?: string } }).userAgentData;\n if (uaData && typeof uaData.platform === 'string') {\n const p = uaData.platform.toLowerCase();\n if (p.includes('mac') || p.includes('ios')) {\n return true;\n }\n }\n\n // 2. D\u00E9tection via navigator.platform\n const platform = (navigator.platform || '').toLowerCase();\n if (platform.includes('mac') || platform.includes('iphone') || platform.includes('ipad') || platform.includes('ipod')) {\n return true;\n }\n\n // 3. D\u00E9tection de secours via User-Agent\n const ua = (navigator.userAgent || '').toLowerCase();\n return ua.includes('macintosh') || ua.includes('mac os x') || ua.includes('ipad') || ua.includes('iphone');\n }\n\n /**\n * Normalise un nom de touche unitaire pour les comparaisons.\n */\n public static normalizeKeyName(key: string): string {\n if (key === ' ') {\n return ' ';\n }\n const k = key.trim().toLowerCase();\n switch (k) {\n case 'esc':\n return 'escape';\n case 'return':\n return 'enter';\n case 'space':\n case 'spacebar':\n return ' ';\n case 'plus':\n return '+';\n case 'del':\n return 'delete';\n case 'ins':\n return 'insert';\n case 'up':\n return 'arrowup';\n case 'down':\n return 'arrowdown';\n case 'left':\n return 'arrowleft';\n case 'right':\n return 'arrowright';\n default:\n return k;\n }\n }\n\n /**\n * Parse une cha\u00EEne de combinaison (ex: \"Mod+K\", \"g i\", \"Shift+?\", \"Alt++\")\n * et retourne la liste des \u00E9tapes normalis\u00E9es n\u00E9cessaires au d\u00E9clenchement.\n */\n public static parseCombo(combo: string, isApple: boolean = ShortcutFormatter.isApple()): NormalizedStep[] {\n if (typeof combo !== 'string') {\n return [];\n }\n if (combo === ' ') {\n return [{ ctrl: false, alt: false, shift: false, meta: false, key: ' ' }];\n }\n const trimmed = combo.slice(0, 512).trim();\n if (!trimmed) {\n return [];\n }\n\n // Normaliser les espaces autour des op\u00E9rateurs '+' d'accords (\"Mod + Shift + P\" -> \"Mod+Shift+P\")\n // tout en pr\u00E9servant les s\u00E9quences s\u00E9par\u00E9es par espaces (\"g i\", \"g +\")\n const normalizedChordSpacing = trimmed.replace(\n /\\b(ctrl|control|alt|option|opt|shift|maj|cmd|command|meta|win|super|mod|\\$mod)\\s*\\+\\s*/gi,\n '$1+'\n );\n\n // D\u00E9coupage en \u00E9tapes pour les s\u00E9quences (ex: \"g i\" -> [\"g\", \"i\"]), plafonn\u00E9 \u00E0 10 \u00E9tapes max (anti-DoS)\n const stepsRaw = normalizedChordSpacing.split(/\\s+/).slice(0, 10);\n const steps: NormalizedStep[] = [];\n\n for (const rawStep of stepsRaw) {\n // D\u00E9coupage de chaque accord sur le symbole '+' (gestion de '+' isol\u00E9 et de '++' pour la touche '+')\n const tokens: string[] = [];\n if (rawStep === '+') {\n tokens.push('+');\n } else {\n let currentToken = '';\n for (let i = 0; i < rawStep.length; i++) {\n const char = rawStep[i];\n if (char === '+') {\n if (currentToken === '' && tokens.length > 0) {\n tokens.push('+');\n } else if (currentToken !== '') {\n tokens.push(currentToken);\n currentToken = '';\n }\n } else {\n currentToken += char;\n }\n }\n if (currentToken !== '') {\n tokens.push(currentToken);\n }\n }\n\n let ctrl = false;\n let alt = false;\n let shift = false;\n let meta = false;\n let mainKey = '';\n\n for (const token of tokens) {\n const lower = token.trim().toLowerCase();\n if (lower === 'ctrl' || lower === 'control') {\n ctrl = true;\n } else if (lower === 'alt' || lower === 'option' || lower === 'opt') {\n alt = true;\n } else if (lower === 'shift' || lower === 'maj') {\n shift = true;\n } else if (lower === 'cmd' || lower === 'command' || lower === 'meta' || lower === 'win' || lower === 'super') {\n meta = true;\n } else if (lower === 'mod' || lower === '$mod') {\n if (isApple) {\n meta = true;\n } else {\n ctrl = true;\n }\n } else {\n // Touche principale\n mainKey = ShortcutFormatter.normalizeKeyName(token);\n }\n }\n\n steps.push({\n ctrl,\n alt,\n shift,\n meta,\n key: mainKey\n });\n }\n\n return steps;\n }\n\n /**\n * Formate une combinaison brute en libell\u00E9 soign\u00E9 et lisible pour l'OS cible.\n * Ex: \"Mod+Shift+P\" -> macOS: \"\u21E7\u2318P\", Windows: \"Ctrl+Shift+P\"\n * Ex: \"g i\" -> \"g puis i\" ou \"g i\"\n */\n public static format(combo: string, isApple: boolean = ShortcutFormatter.isApple()): string {\n const steps = ShortcutFormatter.parseCombo(combo, isApple);\n if (steps.length === 0) {\n return combo;\n }\n\n const formattedSteps = steps.map(step => {\n const parts: string[] = [];\n\n if (isApple) {\n if (step.ctrl) parts.push('\u2303');\n if (step.alt) parts.push('\u2325');\n if (step.shift) parts.push('\u21E7');\n if (step.meta) parts.push('\u2318');\n\n const keyDisplay = ShortcutFormatter.formatKeyDisplay(step.key, true);\n parts.push(keyDisplay);\n return parts.join('');\n } else {\n if (step.ctrl) parts.push('Ctrl');\n if (step.alt) parts.push('Alt');\n if (step.shift) parts.push('Shift');\n if (step.meta) parts.push('Win');\n\n const keyDisplay = ShortcutFormatter.formatKeyDisplay(step.key, false);\n parts.push(keyDisplay);\n return parts.join('+');\n }\n });\n\n return formattedSteps.join(' ');\n }\n\n /**\n * Convertit un combo technique vers le format officiel WAI-ARIA `aria-keyshortcuts`.\n * Standard W3C : les modificateurs sont 'Control', 'Alt', 'Shift', 'Meta' et le s\u00E9parateur est '+'.\n * Attention : dans WAI-ARIA 1.2, l'espace d\u00E9limite des raccourcis alternatifs et non une s\u00E9quence temporelle.\n * Pour une s\u00E9quence multi-\u00E9tapes (ex: \"g i\"), retourne une cha\u00EEne vide afin de ne pas induire le lecteur d'\u00E9cran en erreur.\n */\n public static toAriaKeyShortcuts(combo: string, isApple: boolean = ShortcutFormatter.isApple()): string {\n const steps = ShortcutFormatter.parseCombo(combo, isApple);\n if (steps.length !== 1) {\n return '';\n }\n const step = steps[0];\n const ariaKey = ShortcutFormatter.formatAriaKey(step.key);\n if (!ariaKey) {\n return '';\n }\n const parts: string[] = [];\n if (step.ctrl) parts.push('Control');\n if (step.alt) parts.push('Alt');\n if (step.shift) parts.push('Shift');\n if (step.meta) parts.push('Meta');\n parts.push(ariaKey);\n return parts.join('+');\n }\n\n /**\n * Formate un nom de touche strictement conforme aux valeurs standard W3C UI Events / aria-keyshortcuts.\n */\n private static formatAriaKey(key: string): string {\n if (!key) return '';\n switch (key.toLowerCase()) {\n case 'escape':\n return 'Escape';\n case 'enter':\n return 'Enter';\n case ' ':\n return 'Space';\n case 'tab':\n return 'Tab';\n case 'backspace':\n return 'Backspace';\n case 'delete':\n return 'Delete';\n case 'insert':\n return 'Insert';\n case 'home':\n return 'Home';\n case 'end':\n return 'End';\n case 'pageup':\n return 'PageUp';\n case 'pagedown':\n return 'PageDown';\n case 'arrowup':\n return 'ArrowUp';\n case 'arrowdown':\n return 'ArrowDown';\n case 'arrowleft':\n return 'ArrowLeft';\n case 'arrowright':\n return 'ArrowRight';\n case 'printscreen':\n return 'PrintScreen';\n case 'scrolllock':\n return 'ScrollLock';\n case 'numlock':\n return 'NumLock';\n case 'capslock':\n return 'CapsLock';\n case 'contextmenu':\n return 'ContextMenu';\n case '+':\n return 'Plus';\n default:\n return key.length === 1 ? key.toUpperCase() : key.charAt(0).toUpperCase() + key.slice(1);\n }\n }\n\n private static formatKeyDisplay(key: string, isApple: boolean): string {\n if (!key) return '';\n switch (key.toLowerCase()) {\n case 'escape':\n return isApple ? '\u238B' : 'Esc';\n case 'enter':\n return isApple ? '\u21A9' : 'Enter';\n case ' ':\n return isApple ? '\u2423' : 'Space';\n case 'tab':\n return isApple ? '\u21E5' : 'Tab';\n case 'backspace':\n return isApple ? '\u232B' : 'Backspace';\n case 'delete':\n return isApple ? '\u2326' : 'Suppr';\n case 'arrowup':\n return '\u2191';\n case 'arrowdown':\n return '\u2193';\n case 'arrowleft':\n return '\u2190';\n case 'arrowright':\n return '\u2192';\n default:\n return key.length === 1 ? key.toUpperCase() : key.charAt(0).toUpperCase() + key.slice(1);\n }\n }\n}\n\n", "import {\n ShortcutDefinition,\n ShortcutManagerOptions,\n ShortcutInfo,\n RegisteredShortcut,\n NormalizedStep\n} from './types';\nimport { ShortcutFormatter } from './ShortcutFormatter';\nimport { isImeComposing } from '../common/dom';\n\n/**\n * Moteur autonome et modulaire de gestion des raccourcis clavier applicatifs (Wulf.Shortcut).\n * Z\u00E9ro d\u00E9pendance. Conforme \u00E0 l'Axiome Primordial de pr\u00E9servation de la saisie utilisateur.\n */\nexport class ShortcutManager {\n private readonly options: Required<Omit<ShortcutManagerOptions, 'onError'>> & {\n onError?: (error: Error, combo: string) => void;\n };\n private readonly shortcuts: Map<string, RegisteredShortcut> = new Map();\n private scopeStack: string[] = [];\n private sequenceBuffer: { step: NormalizedStep; timestamp: number }[] = [];\n private sequenceTimer: ReturnType<typeof setTimeout> | null = null;\n private isListening = true;\n private boundListener: ((event: KeyboardEvent) => void) | null = null;\n private abortController: AbortController | null = null;\n private idCounter = 0;\n\n constructor(options?: ShortcutManagerOptions) {\n const rawTimeout = options?.sequenceTimeout;\n const sequenceTimeout =\n typeof rawTimeout === 'number' && Number.isFinite(rawTimeout) && rawTimeout > 0\n ? Math.min(rawTimeout, 10000)\n : 800;\n\n this.options = {\n defaultScope: options?.defaultScope || 'global',\n sequenceTimeout,\n target: options?.target || (typeof window !== 'undefined' ? window : ({} as Window)),\n onError: options?.onError\n };\n\n this.scopeStack = [this.options.defaultScope];\n this.initListener();\n }\n\n /**\n * V\u00E9rifie si un \u00E9l\u00E9ment DOM est une zone d'\u00E9dition o\u00F9 la saisie de l'utilisateur\n * ne doit JAMAIS \u00EAtre interrompue ou d\u00E9tourn\u00E9e (Axiome Primordial).\n */\n public static isEditable(target: EventTarget | null): boolean {\n if (!target || typeof (target as HTMLElement).tagName !== 'string') {\n return false;\n }\n\n const el = target as HTMLElement;\n const tagName = el.tagName.toUpperCase();\n\n // 1. \u00C9l\u00E9ments natifs de formulaire textuel\n if (tagName === 'INPUT') {\n const type = (el as HTMLInputElement).type?.toLowerCase() || 'text';\n // Seuls les types non-textuels ne sont pas consid\u00E9r\u00E9s comme de la saisie libre\n const nonTextTypes = ['button', 'checkbox', 'radio', 'submit', 'reset', 'range', 'color', 'file', 'image'];\n return !nonTextTypes.includes(type);\n }\n if (tagName === 'TEXTAREA' || tagName === 'SELECT') {\n return true;\n }\n\n // 2. \u00C9l\u00E9ments modifiables en ligne (contenteditable)\n if (\n el.isContentEditable ||\n el.getAttribute('contenteditable') === 'true' ||\n el.getAttribute('contenteditable') === 'plaintext-only' ||\n el.getAttribute('contenteditable') === ''\n ) {\n return true;\n }\n\n // 3. R\u00F4les ARIA de saisie\n const role = el.getAttribute('role');\n if (role === 'textbox' || role === 'searchbox' || role === 'combobox' || role === 'spinbutton') {\n return true;\n }\n\n // 4. \u00C9l\u00E9ment enfant situ\u00E9 \u00E0 l'int\u00E9rieur d'un conteneur contenteditable ou ARIA textbox/searchbox/combobox/spinbutton\n if (typeof el.closest === 'function') {\n const editableAncestor = el.closest(\n '[contenteditable=\"true\"], [contenteditable=\"plaintext-only\"], [contenteditable=\"\"], [role=\"textbox\"], [role=\"searchbox\"], [role=\"combobox\"], [role=\"spinbutton\"]'\n );\n if (editableAncestor) {\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * V\u00E9rifie si la cible est un champ de mot de passe (sanctuaire anti-keylogging).\n */\n private static isPasswordField(target: EventTarget | null): boolean {\n if (!target || typeof (target as HTMLElement).tagName !== 'string') {\n return false;\n }\n const el = target as HTMLInputElement;\n return el.tagName.toUpperCase() === 'INPUT' && (el.type || '').toLowerCase() === 'password';\n }\n\n /**\n * Enregistre un ou plusieurs raccourcis clavier.\n * Retourne une fonction de nettoyage pour d\u00E9senregistrer imm\u00E9diatement.\n */\n public bind(definition: ShortcutDefinition | ShortcutDefinition[]): () => void {\n const list = Array.isArray(definition) ? definition : [definition];\n const registeredIds: string[] = [];\n\n for (const def of list) {\n if (!def.combo || typeof def.handler !== 'function') {\n continue;\n }\n\n const id = `wulf_shortcut_${++this.idCounter}`;\n const normalizedSteps = ShortcutFormatter.parseCombo(def.combo);\n const isSequence = normalizedSteps.length > 1;\n const formattedCombo = ShortcutFormatter.format(def.combo);\n\n const registered: RegisteredShortcut = {\n ...def,\n id,\n scope: def.scope || 'global',\n category: def.category || 'G\u00E9n\u00E9ral',\n allowInEditable: def.allowInEditable ?? false,\n preventDefault: def.preventDefault ?? true,\n stopPropagation: def.stopPropagation ?? true,\n priority: def.priority ?? 0,\n formattedCombo,\n normalizedSteps,\n isSequence\n };\n\n this.shortcuts.set(id, registered);\n registeredIds.push(id);\n }\n\n // Fonction de d\u00E9sabonnement direct\n return () => {\n for (const id of registeredIds) {\n this.shortcuts.delete(id);\n }\n };\n }\n\n /**\n * Retire tous les raccourcis correspondant \u00E0 une combinaison et \u00E9ventuellement un scope.\n */\n public unbind(combo: string, scope?: string): void {\n if (typeof combo !== 'string' || !combo.trim()) {\n return;\n }\n const formatted = ShortcutFormatter.format(combo);\n for (const [id, s] of this.shortcuts.entries()) {\n if (s.formattedCombo === formatted || s.combo.trim().toLowerCase() === combo.trim().toLowerCase()) {\n if (!scope || s.scope === scope) {\n this.shortcuts.delete(id);\n }\n }\n }\n }\n\n /**\n * Empile un nouveau scope actif (mode LIFO).\n * Seuls les raccourcis de ce scope (et les omnipr\u00E9sents '*') seront actifs.\n */\n public pushScope(scope: string): void {\n if (scope && typeof scope === 'string') {\n if (this.scopeStack.length >= 64) {\n return;\n }\n this.scopeStack.push(scope);\n this.clearSequenceBuffer();\n }\n }\n\n /**\n * D\u00E9pile le scope actuel et r\u00E9tablit le pr\u00E9c\u00E9dent.\n * Si un param\u00E8tre `scope` est pass\u00E9, ne retire que si le scope actuel correspond.\n */\n public popScope(scope?: string): string | undefined {\n if (this.scopeStack.length <= 1) {\n return this.scopeStack[0];\n }\n\n if (scope) {\n if (this.getScope() === scope) {\n const popped = this.scopeStack.pop();\n this.clearSequenceBuffer();\n return popped;\n }\n return undefined;\n }\n\n const popped = this.scopeStack.pop();\n this.clearSequenceBuffer();\n return popped;\n }\n\n /**\n * R\u00E9initialise brutalement la pile pour activer le scope sp\u00E9cifi\u00E9.\n */\n public setScope(scope: string): void {\n this.scopeStack = [scope || this.options.defaultScope];\n this.clearSequenceBuffer();\n }\n\n /**\n * Retourne le scope actuellement actif au sommet de la pile.\n */\n public getScope(): string {\n return this.scopeStack[this.scopeStack.length - 1] || this.options.defaultScope;\n }\n\n /**\n * Retourne une copie de la pile compl\u00E8te des scopes.\n */\n public getScopeStack(): string[] {\n return [...this.scopeStack];\n }\n\n /**\n * Met en pause l'\u00E9coute de tous les raccourcis.\n */\n public pause(): void {\n this.isListening = false;\n this.clearSequenceBuffer();\n }\n\n /**\n * R\u00E9active l'\u00E9coute des raccourcis.\n */\n public resume(): void {\n this.isListening = true;\n }\n\n /**\n * Indique si le gestionnaire est actif et \u00E0 l'\u00E9coute.\n */\n public isActive(): boolean {\n return this.isListening;\n }\n\n /**\n * Retourne le catalogue des raccourcis enregistr\u00E9s (optionnellement filtr\u00E9 par scope).\n */\n public getRegistry(scope?: string): RegisteredShortcut[] {\n const list: RegisteredShortcut[] = [];\n for (const shortcut of this.shortcuts.values()) {\n if (!scope || shortcut.scope === scope || shortcut.scope === '*') {\n list.push({ ...shortcut });\n }\n }\n return list;\n }\n\n /**\n * Associe l'attribut standard WAI-ARIA `aria-keyshortcuts` sur un \u00E9l\u00E9ment DOM.\n */\n public attachAria(element: HTMLElement, combo: string): void {\n if (element && typeof element.setAttribute === 'function') {\n const ariaValue = ShortcutFormatter.toAriaKeyShortcuts(combo);\n if (ariaValue) {\n element.setAttribute('aria-keyshortcuts', ariaValue);\n } else if (typeof element.removeAttribute === 'function') {\n element.removeAttribute('aria-keyshortcuts');\n }\n }\n }\n\n /**\n * Formate une combinaison brute selon l'OS courant (\"\u2318K\" ou \"Ctrl+K\").\n */\n public static format(combo: string, isApple?: boolean): string {\n return ShortcutFormatter.format(combo, isApple);\n }\n\n /**\n * D\u00E9truit le gestionnaire : supprime les \u00E9couteurs du DOM et vide toute la m\u00E9moire.\n */\n public destroy(): void {\n this.pause();\n this.removeListener();\n this.shortcuts.clear();\n this.scopeStack = [];\n this.clearSequenceBuffer();\n }\n\n // --- Impl\u00E9mentation Interne ---\n\n private initListener(): void {\n if (typeof window === 'undefined' || !this.options.target) {\n return;\n }\n\n this.abortController = new AbortController();\n this.boundListener = (event: KeyboardEvent) => this.handleKeyDown(event);\n const target = this.options.target as EventTarget;\n if (typeof target.addEventListener === 'function') {\n target.addEventListener('keydown', this.boundListener as EventListener, {\n capture: false,\n signal: this.abortController.signal\n });\n }\n }\n\n private removeListener(): void {\n if (this.abortController) {\n this.abortController.abort();\n this.abortController = null;\n } else if (this.boundListener && this.options.target) {\n const target = this.options.target as EventTarget;\n if (typeof target.removeEventListener === 'function') {\n target.removeEventListener('keydown', this.boundListener as EventListener, false);\n }\n }\n this.boundListener = null;\n }\n\n private handleKeyDown(event: KeyboardEvent): void {\n if (!this.isListening || isImeComposing(event)) {\n return;\n }\n\n // Touches modificatrices isol\u00E9es : on ne fait rien\n const k = (event.key || '').toLowerCase();\n if (['control', 'alt', 'shift', 'meta'].includes(k)) {\n return;\n }\n\n const currentScope = this.getScope();\n const composed = typeof event.composedPath === 'function' ? event.composedPath() : [];\n const actualTarget = (composed.length > 0 ? composed[0] : event.target) as EventTarget | null;\n const isEditable = ShortcutManager.isEditable(actualTarget) || ShortcutManager.isEditable(event.target);\n const isPasswordInput = ShortcutManager.isPasswordField(actualTarget) || ShortcutManager.isPasswordField(event.target);\n\n // Extraction du pas de touche actuel\n const currentStep: NormalizedStep = {\n ctrl: event.ctrlKey,\n alt: event.altKey,\n shift: event.shiftKey,\n meta: event.metaKey,\n key: ShortcutFormatter.normalizeKeyName(event.key || '')\n };\n\n const now = event.timeStamp > 0\n ? event.timeStamp\n : (typeof performance !== 'undefined' ? performance.now() : Date.now());\n\n // 1. Purge du buffer de s\u00E9quence si le d\u00E9lai est d\u00E9pass\u00E9\n if (this.sequenceBuffer.length > 0) {\n const last = this.sequenceBuffer[this.sequenceBuffer.length - 1];\n if (now - last.timestamp > this.options.sequenceTimeout) {\n this.clearSequenceBuffer();\n }\n }\n\n // Candidats potentiels actifs pour le scope courant\n const activeCandidates = this.getActiveShortcuts(currentScope, isEditable, isPasswordInput);\n\n // 2. \u00C9valuation des s\u00E9quences temporelles (Key Sequences)\n const proposedSequence = [...this.sequenceBuffer.map(b => b.step), currentStep];\n const matchingSequence = this.findMatchingSequence(activeCandidates, proposedSequence);\n\n if (matchingSequence) {\n this.clearSequenceBuffer();\n this.executeShortcut(matchingSequence, event, currentScope, true);\n return;\n }\n\n // V\u00E9rifier si le pas actuel peut \u00EAtre le pr\u00E9fixe d'une s\u00E9quence enregistr\u00E9e\n if (this.isPrefixOfAnySequence(activeCandidates, proposedSequence)) {\n this.sequenceBuffer.push({ step: currentStep, timestamp: now });\n this.resetSequenceTimer();\n // On bloque l'\u00E9v\u00E9nement pour ne pas d\u00E9clencher un accord unitaire pendant une s\u00E9quence\n if (event.key.length === 1 && !event.ctrlKey && !event.altKey && !event.metaKey && !isEditable) {\n event.preventDefault();\n }\n return;\n }\n\n // Si la s\u00E9quence ne m\u00E8ne \u00E0 rien, on vide le buffer\n this.clearSequenceBuffer();\n\n // 3. \u00C9valuation des accords simultan\u00E9s unitaires (Single Chords)\n const matchingChord = this.findMatchingChord(activeCandidates, currentStep, event);\n if (matchingChord) {\n this.executeShortcut(matchingChord, event, currentScope, false);\n }\n }\n\n private getActiveShortcuts(\n currentScope: string,\n isEditable: boolean,\n isPasswordInput: boolean = false\n ): RegisteredShortcut[] {\n const list: RegisteredShortcut[] = [];\n for (const shortcut of this.shortcuts.values()) {\n // Filtrage de scope\n if (shortcut.scope !== currentScope && shortcut.scope !== '*') {\n continue;\n }\n // R\u00C8GLE ABSOLUE (Axiome Primordial) : Filtrage des \u00E9l\u00E9ments \u00E9ditables\n if (isEditable && !shortcut.allowInEditable) {\n continue;\n }\n // Sanctuaire Password : m\u00EAme avec allowInEditable: true, interdire les s\u00E9quences et touches imprimables (y compris AltGr / Option)\n if (isPasswordInput) {\n if (shortcut.isSequence) {\n continue;\n }\n const firstStep = shortcut.normalizedSteps[0];\n if (firstStep && firstStep.key.length === 1) {\n const isUntouchedChar = !firstStep.ctrl && !firstStep.alt && !firstStep.meta;\n const isAltGrOrOptionChar =\n (firstStep.ctrl && firstStep.alt && !firstStep.meta) ||\n (firstStep.alt && !firstStep.ctrl && !firstStep.meta);\n if (isUntouchedChar || isAltGrOrOptionChar) {\n continue;\n }\n }\n }\n list.push(shortcut);\n }\n\n // Tri par priorit\u00E9 d\u00E9croissante\n return list.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));\n }\n\n private stepMatches(step: NormalizedStep, eventStep: NormalizedStep, rawEvent?: KeyboardEvent): boolean {\n if (step.ctrl !== eventStep.ctrl) return false;\n if (step.alt !== eventStep.alt) return false;\n if (step.meta !== eventStep.meta) return false;\n\n const rawKey = typeof rawEvent?.key === 'string' ? rawEvent.key : '';\n\n // Correspondance de la touche\n const keyMatches =\n step.key === eventStep.key ||\n (rawKey !== '' && step.key === rawKey.toLowerCase());\n\n if (!keyMatches) return false;\n\n // Correspondance Shift :\n // Si la touche sp\u00E9cifie shift: true, l'\u00E9v\u00E9nement doit avoir shiftKey true.\n // Si la touche sp\u00E9cifie shift: false, mais que le caract\u00E8re est un symbole (ex: \"?\")\n // tap\u00E9 avec shift, on tol\u00E8re si la touche correspond exactement (en accord comme en s\u00E9quence).\n if (step.shift === eventStep.shift) {\n return true;\n }\n\n if (!step.shift && eventStep.shift) {\n const isNonAlphaSymbol = step.key.length === 1 && !/^[a-z]$/i.test(step.key);\n if ((rawKey !== '' && rawKey === step.key) || (isNonAlphaSymbol && eventStep.key === step.key)) {\n return true;\n }\n }\n\n return false;\n }\n\n private findMatchingChord(\n candidates: RegisteredShortcut[],\n currentStep: NormalizedStep,\n rawEvent: KeyboardEvent\n ): RegisteredShortcut | null {\n for (const candidate of candidates) {\n if (candidate.isSequence || candidate.normalizedSteps.length !== 1) {\n continue;\n }\n\n const step = candidate.normalizedSteps[0];\n if (this.stepMatches(step, currentStep, rawEvent)) {\n return candidate;\n }\n }\n return null;\n }\n\n private findMatchingSequence(\n candidates: RegisteredShortcut[],\n proposed: NormalizedStep[]\n ): RegisteredShortcut | null {\n for (const candidate of candidates) {\n if (!candidate.isSequence || candidate.normalizedSteps.length !== proposed.length) {\n continue;\n }\n\n let allMatch = true;\n for (let i = 0; i < proposed.length; i++) {\n if (!this.stepMatches(candidate.normalizedSteps[i], proposed[i])) {\n allMatch = false;\n break;\n }\n }\n\n if (allMatch) {\n return candidate;\n }\n }\n return null;\n }\n\n private isPrefixOfAnySequence(candidates: RegisteredShortcut[], proposed: NormalizedStep[]): boolean {\n for (const candidate of candidates) {\n if (!candidate.isSequence || candidate.normalizedSteps.length <= proposed.length) {\n continue;\n }\n\n let prefixMatches = true;\n for (let i = 0; i < proposed.length; i++) {\n if (!this.stepMatches(candidate.normalizedSteps[i], proposed[i])) {\n prefixMatches = false;\n break;\n }\n }\n\n if (prefixMatches) {\n return true;\n }\n }\n return false;\n }\n\n private executeShortcut(\n shortcut: RegisteredShortcut,\n event: KeyboardEvent,\n scope: string,\n isSequence: boolean\n ): void {\n if (shortcut.preventDefault) {\n event.preventDefault();\n }\n if (shortcut.stopPropagation) {\n event.stopPropagation();\n }\n\n const info: ShortcutInfo = {\n combo: shortcut.combo,\n formattedCombo: shortcut.formattedCombo,\n scope,\n target: event.target,\n isSequence\n };\n\n try {\n shortcut.handler(event, info);\n } catch (err) {\n if (this.options.onError) {\n this.options.onError(err instanceof Error ? err : new Error(String(err)), shortcut.combo);\n } else {\n console.error(`[Wulf.Shortcut] Erreur lors de l'ex\u00E9cution du raccourci \"${shortcut.combo}\":`, err);\n }\n }\n }\n\n private resetSequenceTimer(): void {\n if (this.sequenceTimer) {\n clearTimeout(this.sequenceTimer);\n }\n this.sequenceTimer = setTimeout(() => {\n this.clearSequenceBuffer();\n }, this.options.sequenceTimeout);\n }\n\n private clearSequenceBuffer(): void {\n this.sequenceBuffer = [];\n if (this.sequenceTimer) {\n clearTimeout(this.sequenceTimer);\n this.sequenceTimer = null;\n }\n }\n}\n\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACOO,WAAS,uBAAuD;AACrE,QAAI,OAAO,WAAW,YAAa,QAAO;AAC1C,UAAM,MAAM;AACZ,UAAM,WAAW,IAAI;AACrB,QACE,CAAC,YACD,OAAO,aAAa,YACnB,OAAO,SAAS,eAAe,oBAAoB,QACnD,OAAO,mBAAmB,eAAe,oBAAoB,gBAC9D;AACA,YAAM,QAAiC,CAAC;AACxC,UAAI,OAAO;AACX,aAAO;AAAA,IACT;AACA,WAAO;AAAA,EACT;AAoDO,WAAS,eAAe,OAA+B;AAC5D,WAAO;AAAA,MACL,MAAM,eACN,MAAM,QAAQ,aACb,MAAM,QAAQ,WAAW,MAAM,YAAY;AAAA,IAC9C;AAAA,EACF;;;AC3EO,MAAM,oBAAN,MAAM,mBAAkB;AAAA;AAAA;AAAA;AAAA,IAI7B,OAAc,UAAmB;AAC/B,UAAI,OAAO,cAAc,aAAa;AACpC,eAAO;AAAA,MACT;AAGA,YAAM,SAAU,UAAmE;AACnF,UAAI,UAAU,OAAO,OAAO,aAAa,UAAU;AACjD,cAAM,IAAI,OAAO,SAAS,YAAY;AACtC,YAAI,EAAE,SAAS,KAAK,KAAK,EAAE,SAAS,KAAK,GAAG;AAC1C,iBAAO;AAAA,QACT;AAAA,MACF;AAGA,YAAM,YAAY,UAAU,YAAY,IAAI,YAAY;AACxD,UAAI,SAAS,SAAS,KAAK,KAAK,SAAS,SAAS,QAAQ,KAAK,SAAS,SAAS,MAAM,KAAK,SAAS,SAAS,MAAM,GAAG;AACrH,eAAO;AAAA,MACT;AAGA,YAAM,MAAM,UAAU,aAAa,IAAI,YAAY;AACnD,aAAO,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