wulf.js 2.1.1 → 2.2.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.
- package/README.md +217 -11
- package/changelog.md +50 -0
- package/dist/anchor.esm.js +9 -0
- package/dist/anchor.esm.js.map +7 -0
- package/dist/anchor.global.js +695 -0
- package/dist/anchor.global.js.map +7 -0
- package/dist/anchor.global.min.js +6 -0
- package/dist/anchor.global.min.js.map +7 -0
- package/dist/autosize.css +1 -0
- package/dist/autosize.css.map +7 -0
- package/dist/autosize.esm.js +10 -0
- package/dist/autosize.esm.js.map +7 -0
- package/dist/autosize.global.js +657 -0
- package/dist/autosize.global.js.map +7 -0
- package/dist/autosize.global.min.js +6 -0
- package/dist/autosize.global.min.js.map +7 -0
- package/dist/autosize.layered.css +1 -0
- package/dist/autosize.layered.css.map +7 -0
- package/dist/chunks/chunk-22AIMRD5.js +119 -0
- package/dist/chunks/chunk-22AIMRD5.js.map +7 -0
- package/dist/chunks/chunk-5N2IRGDM.js +766 -0
- package/dist/chunks/chunk-5N2IRGDM.js.map +7 -0
- package/dist/chunks/chunk-72FVCNNZ.js +863 -0
- package/dist/chunks/chunk-72FVCNNZ.js.map +7 -0
- package/dist/chunks/chunk-AXZYYW7H.js +865 -0
- package/dist/chunks/chunk-AXZYYW7H.js.map +7 -0
- package/dist/chunks/chunk-CM3SBIVQ.js +1116 -0
- package/dist/chunks/chunk-CM3SBIVQ.js.map +7 -0
- package/dist/chunks/chunk-H4GRLGQ3.js +578 -0
- package/dist/chunks/chunk-H4GRLGQ3.js.map +7 -0
- package/dist/chunks/chunk-ITRU2RFV.js +1195 -0
- package/dist/chunks/chunk-ITRU2RFV.js.map +7 -0
- package/dist/chunks/chunk-NLUQZEL4.js +1029 -0
- package/dist/chunks/chunk-NLUQZEL4.js.map +7 -0
- package/dist/chunks/chunk-QV46A7FV.js +197 -0
- package/dist/chunks/chunk-QV46A7FV.js.map +7 -0
- package/dist/chunks/chunk-SXLUXN6W.js +612 -0
- package/dist/chunks/chunk-SXLUXN6W.js.map +7 -0
- package/dist/chunks/chunk-T2H4EJCW.js +621 -0
- package/dist/chunks/chunk-T2H4EJCW.js.map +7 -0
- package/dist/chunks/chunk-TILLYEF2.js +6044 -0
- package/dist/chunks/chunk-TILLYEF2.js.map +7 -0
- package/dist/chunks/chunk-VJO22BAT.js +72 -0
- package/dist/chunks/chunk-VJO22BAT.js.map +7 -0
- package/dist/chunks/chunk-ZGUU6DMM.js +77 -0
- package/dist/chunks/chunk-ZGUU6DMM.js.map +7 -0
- package/dist/focus-trap.esm.js +6 -594
- package/dist/focus-trap.esm.js.map +3 -3
- package/dist/focus-trap.global.js +176 -61
- package/dist/focus-trap.global.js.map +3 -3
- package/dist/focus-trap.global.min.js +4 -4
- package/dist/focus-trap.global.min.js.map +4 -4
- package/dist/index.esm.js +79 -10448
- package/dist/index.esm.js.map +4 -4
- package/dist/index.global.js +3660 -202
- package/dist/index.global.js.map +4 -4
- package/dist/index.global.min.js +6 -3
- package/dist/index.global.min.js.map +4 -4
- package/dist/mask.esm.js +16 -6094
- package/dist/mask.esm.js.map +4 -4
- package/dist/mask.global.js +44 -55
- package/dist/mask.global.js.map +3 -3
- package/dist/mask.global.min.js +3 -3
- package/dist/mask.global.min.js.map +4 -4
- package/dist/masonry.esm.js +15 -1158
- package/dist/masonry.esm.js.map +4 -4
- package/dist/masonry.global.js +84 -94
- package/dist/masonry.global.js.map +3 -3
- package/dist/masonry.global.min.js +4 -4
- package/dist/masonry.global.min.js.map +4 -4
- package/dist/scroll.css +1 -1
- package/dist/scroll.css.map +2 -2
- package/dist/scroll.esm.js +14 -1252
- package/dist/scroll.esm.js.map +3 -3
- package/dist/scroll.global.js +64 -58
- package/dist/scroll.global.js.map +3 -3
- package/dist/scroll.global.min.js +3 -3
- package/dist/scroll.global.min.js.map +4 -4
- package/dist/scroll.layered.css +1 -1
- package/dist/scroll.layered.css.map +2 -2
- package/dist/shortcut.esm.js +6 -901
- package/dist/shortcut.esm.js.map +4 -4
- package/dist/shortcut.global.js +43 -36
- package/dist/shortcut.global.js.map +3 -3
- package/dist/shortcut.global.min.js +6 -3
- package/dist/shortcut.global.min.js.map +4 -4
- package/dist/size-report.json +319 -0
- package/dist/sortable.css +1 -0
- package/dist/sortable.css.map +7 -0
- package/dist/sortable.esm.js +22 -0
- package/dist/sortable.esm.js.map +7 -0
- package/dist/sortable.global.js +1477 -0
- package/dist/sortable.global.js.map +7 -0
- package/dist/sortable.global.min.js +6 -0
- package/dist/sortable.global.min.js.map +7 -0
- package/dist/sortable.layered.css +1 -0
- package/dist/sortable.layered.css.map +7 -0
- package/dist/sri-manifest.json +64 -0
- package/dist/toast.css +1 -1
- package/dist/toast.css.map +2 -2
- package/dist/toast.esm.js +19 -1208
- package/dist/toast.esm.js.map +3 -3
- package/dist/toast.global.js +314 -111
- package/dist/toast.global.js.map +3 -3
- package/dist/toast.global.min.js +3 -3
- package/dist/toast.global.min.js.map +4 -4
- package/dist/toast.layered.css +1 -1
- package/dist/toast.layered.css.map +2 -2
- package/dist/types/anchor/Anchor.d.ts +41 -0
- package/dist/types/anchor/index.d.ts +3 -0
- package/dist/types/anchor/types.d.ts +115 -0
- package/dist/types/autosize/Autosize.d.ts +71 -0
- package/dist/types/autosize/index.d.ts +3 -0
- package/dist/types/autosize/types.d.ts +66 -0
- package/dist/types/common/AuditableComponent.d.ts +1 -1
- package/dist/types/common/registry.d.ts +40 -0
- package/dist/types/focus-trap/FocusTrap.d.ts +3 -1
- package/dist/types/index.d.ts +13 -1
- package/dist/types/scroll/types.d.ts +6 -0
- package/dist/types/shortcut/ShortcutManager.d.ts +2 -0
- package/dist/types/shortcut/types.d.ts +5 -0
- package/dist/types/sortable/Sortable.d.ts +75 -0
- package/dist/types/sortable/i18n/en.d.ts +2 -0
- package/dist/types/sortable/i18n/fr.d.ts +2 -0
- package/dist/types/sortable/i18n/index.d.ts +9 -0
- package/dist/types/sortable/i18n/types.d.ts +15 -0
- package/dist/types/sortable/index.d.ts +4 -0
- package/dist/types/sortable/types.d.ts +112 -0
- package/dist/types/toast/Toast.d.ts +6 -1
- package/dist/types/toast/ToastInstance.d.ts +7 -0
- package/dist/types/toast/ToastManager.d.ts +2 -2
- package/dist/types/toast/types.d.ts +27 -1
- package/dist/types/undo/UndoManager.d.ts +112 -0
- package/dist/types/undo/i18n/en.d.ts +2 -0
- package/dist/types/undo/i18n/fr.d.ts +2 -0
- package/dist/types/undo/i18n/index.d.ts +9 -0
- package/dist/types/undo/i18n/types.d.ts +6 -0
- package/dist/types/undo/index.d.ts +5 -0
- package/dist/types/undo/types.d.ts +106 -0
- package/dist/undo.esm.js +23 -0
- package/dist/undo.esm.js.map +7 -0
- package/dist/undo.global.js +1029 -0
- package/dist/undo.global.js.map +7 -0
- package/dist/undo.global.min.js +6 -0
- package/dist/undo.global.min.js.map +7 -0
- package/package.json +54 -5
package/dist/shortcut.esm.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [
|
|
4
|
-
"sourcesContent": ["/**\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 * Supprime lin\u00E9airement (O(N)) les caract\u00E8res invisibles / marqueurs bidi / BOM\n * (protection anti-Trojan Source) sans alt\u00E9rer les espaces ni les retours \u00E0 la ligne.\n */\nexport function stripBidiAndInvisibles(raw: string, maxLength: number = 4096): string {\n const safeLimit = Math.max(0, maxLength);\n return String(raw ?? '')\n .slice(0, safeLimit)\n .replace(/[\\u061C\\u200B-\\u200F\\u202A-\\u202E\\u2066-\\u2069\\uFEFF]/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' : 'Delete';\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", "export interface AuditableOptions {\n /**\n * Ex\u00E9cute un audit d'accessibilit\u00E9 WAI-ARIA \u00E0 l'initialisation (console.warn si contraintes manquantes).\n * @default true\n */\n audit?: boolean;\n}\n\nexport interface IAuditable {\n /**\n * V\u00E9rifie la conformit\u00E9 d'accessibilit\u00E9 WAI-ARIA du composant et retourne la liste des contraintes manquantes.\n */\n audit(): string[];\n}\n\n/**\n * Classe abstraite de base imposant et factorisant le m\u00E9canisme d'audit d'accessibilit\u00E9 WAI-ARIA\n * sur l'ensemble des composants de la suite Wulf.\n */\nexport abstract class AuditableComponent implements IAuditable {\n /**\n * Analyse l'\u00E9tat DOM / options du composant et retourne la liste des contraintes d'accessibilit\u00E9 manquantes.\n */\n public abstract audit(): string[];\n\n /**\n * Identifiant du composant affich\u00E9 dans l'en-t\u00EAte du warning console (ex: \"Wulf.FocusTrap\", \"Wulf.Scroll\").\n */\n protected abstract getAuditPrefix(): string;\n\n /**\n * S\u00E9lecteur ou description de l'\u00E9l\u00E9ment DOM audit\u00E9 (ex: \"#my-modal\", \"<input>\").\n */\n protected abstract getAuditTargetLabel(): string;\n\n /**\n * Indication affich\u00E9e en pied de warning pour expliquer comment d\u00E9sactiver l'audit.\n */\n protected getAuditDisableHint(): string {\n return 'Passez { audit: false } dans les options pour d\u00E9sactiver cet avertissement';\n }\n\n /**\n * Ex\u00E9cute l'audit d'accessibilit\u00E9 et \u00E9met un avertissement standardis\u00E9 dans la console\n * si l'audit est activ\u00E9 et que des contraintes manquent.\n */\n protected runAuditWarning(enabled: boolean = true): string[] {\n if (!enabled) return [];\n\n const warnings = this.audit();\n if (warnings.length > 0 && typeof console !== 'undefined' && typeof console.warn === 'function') {\n console.warn(\n `[${this.getAuditPrefix()}] Audit d'accessibilit\u00E9 \u2014 ${warnings.length} contrainte(s) manquante(s) sur ${this.getAuditTargetLabel()} :\\n` +\n warnings.map((w) => ` - ${w}`).join('\\n') +\n `\\n(${this.getAuditDisableHint()})`\n );\n }\n return warnings;\n }\n\n /**\n * V\u00E9rifie si un attribut de r\u00E9f\u00E9rence d'IDs ARIA (ex: aria-labelledby, aria-describedby, aria-errormessage)\n * pointe vers des \u00E9l\u00E9ments r\u00E9ellement pr\u00E9sents dans le document (et optionnellement non vides).\n */\n protected checkAriaIdReferences(\n element: HTMLElement,\n attrName: 'aria-labelledby' | 'aria-describedby' | 'aria-errormessage',\n warnings: string[],\n requireNonEmptyText: boolean = false\n ): boolean {\n const rawValue = element.getAttribute(attrName)?.trim();\n if (!rawValue) return false;\n\n const doc = element.ownerDocument || document;\n const root = typeof element.getRootNode === 'function' ? element.getRootNode() : doc;\n const ids = rawValue.split(/\\s+/).filter(Boolean);\n const targets = ids.map((id) =>\n typeof ShadowRoot !== 'undefined' && root instanceof ShadowRoot ? root.getElementById(id) : doc.getElementById(id)\n );\n const allFound = ids.length > 0 && targets.every((el) => Boolean(el));\n\n if (!allFound) {\n warnings.push(\n `Attribut ${attrName}=\"${rawValue}\" invalide : l'\u00E9l\u00E9ment cible est introuvable dans le DOM.`\n );\n return false;\n }\n\n if (requireNonEmptyText) {\n const hasNonEmptyText = targets.some((el) => {\n if (!el) return false;\n const text = el.textContent?.trim() || el.getAttribute('aria-label')?.trim() || '';\n return text.length > 0;\n });\n if (!hasNonEmptyText) {\n warnings.push(\n `Attribut ${attrName}=\"${rawValue}\" invalide : l'\u00E9l\u00E9ment cible ne contient aucun texte accessible.`\n );\n return false;\n }\n }\n\n return true;\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';\nimport { AuditableComponent } from '../common/AuditableComponent';\n\nconst SENSITIVE_AUTOCOMPLETE_TOKENS = new Set([\n 'current-password',\n 'new-password',\n 'one-time-code',\n 'cc-number',\n 'cc-csc'\n]);\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 extends AuditableComponent {\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 super();\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 const contentEditable = el.getAttribute?.('contenteditable')?.toLowerCase();\n if (\n el.isContentEditable ||\n contentEditable === 'true' ||\n contentEditable === 'plaintext-only' ||\n 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 appartient \u00E0 un widget composite \u00E0 typeahead clavier (listbox, menu, tree, grid).\n */\n public static isTypeaheadWidget(target: EventTarget | null): boolean {\n if (!target || typeof (target as HTMLElement).tagName !== 'string') {\n return false;\n }\n const el = target as HTMLElement;\n const role = el.getAttribute?.('role');\n if (role === 'listbox' || role === 'menu' || role === 'menubar' || role === 'tree' || role === 'grid') {\n return true;\n }\n if (typeof el.closest === 'function') {\n return Boolean(el.closest('[role=\"listbox\"], [role=\"menu\"], [role=\"menubar\"], [role=\"tree\"], [role=\"grid\"]'));\n }\n return false;\n }\n\n /**\n * V\u00E9rifie si la cible est un champ sensible (password, data-mask-sensitive, autocomplete sensible).\n */\n private static isSensitiveField(target: EventTarget | null): boolean {\n if (!target || typeof (target as HTMLElement).tagName !== 'string') {\n return false;\n }\n const el = target as HTMLInputElement;\n if (el.tagName.toUpperCase() === 'INPUT' && (el.type || '').toLowerCase() === 'password') {\n return true;\n }\n const sensitiveAttr = el.getAttribute?.('data-mask-sensitive');\n if (sensitiveAttr !== null && sensitiveAttr !== undefined && sensitiveAttr !== 'false') {\n return true;\n }\n const ac = el.getAttribute?.('autocomplete');\n if (ac) {\n const tokens = ac.trim().toLowerCase().split(/\\s+/);\n if (tokens.some((tok) => SENSITIVE_AUTOCOMPLETE_TOKENS.has(tok))) {\n return true;\n }\n }\n return false;\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 normalizedSteps = ShortcutFormatter.parseCombo(def.combo);\n if (normalizedSteps.length === 0 || normalizedSteps.some((step) => !step.key)) {\n continue;\n }\n const id = `wulf_shortcut_${++this.idCounter}`;\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({\n ...shortcut,\n normalizedSteps: shortcut.normalizedSteps.map((step) => ({ ...step }))\n });\n }\n }\n return list;\n }\n\n /**\n * Audite le registre des raccourcis vis-\u00E0-vis de WCAG 2.1.4 et de l'Axiome Primordial.\n */\n public override audit(): string[] {\n const warnings: string[] = [];\n const criticalEditKeys = new Set(['c', 'v', 'x', 'a', 'z']);\n\n for (const shortcut of this.shortcuts.values()) {\n const isSingleCharWithoutMod =\n shortcut.normalizedSteps.length > 0 &&\n shortcut.normalizedSteps.every(\n (step) => !step.ctrl && !step.alt && !step.meta && step.key.length === 1\n );\n if (isSingleCharWithoutMod) {\n warnings.push(\n `Raccourci mono-caract\u00E8re sans modificateur \"${shortcut.combo}\" : pr\u00E9voyez une option pour le d\u00E9sactiver ou le reconfigurer (WCAG 2.1.4).`\n );\n }\n\n if (shortcut.allowInEditable && !shortcut.isSequence && shortcut.normalizedSteps.length === 1) {\n const s = shortcut.normalizedSteps[0];\n const isPrimaryModOnly = !s.alt && !s.shift && ((s.ctrl && !s.meta) || (s.meta && !s.ctrl));\n if (isPrimaryModOnly && criticalEditKeys.has(s.key)) {\n warnings.push(\n `Raccourci \"${shortcut.combo}\" avec allowInEditable: true risque d'\u00E9craser une commande d'\u00E9dition native (Ctrl/Cmd+${s.key.toUpperCase()}).`\n );\n }\n }\n }\n\n return warnings;\n }\n\n protected override getAuditPrefix(): string {\n return 'Wulf.Shortcut';\n }\n\n protected override getAuditTargetLabel(): string {\n return `${this.shortcuts.size} raccourci(s)`;\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 pathTargets = composed.length > 0 ? composed : (event.target ? [event.target] : []);\n let isEditable = ShortcutManager.isEditable(event.target);\n let isSensitiveInput = ShortcutManager.isSensitiveField(event.target);\n let isTypeahead = ShortcutManager.isTypeaheadWidget(event.target);\n for (const node of pathTargets) {\n if (!isEditable && ShortcutManager.isEditable(node)) isEditable = true;\n if (!isSensitiveInput && ShortcutManager.isSensitiveField(node)) isSensitiveInput = true;\n if (!isTypeahead && ShortcutManager.isTypeaheadWidget(node)) isTypeahead = true;\n }\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 = 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, isSensitiveInput, isTypeahead);\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 && !isTypeahead) {\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 isSensitiveInput: boolean = false,\n isTypeahead: 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 // Protection du typeahead clavier sur widgets composites (listbox, menu, tree, grid)\n if (isTypeahead) {\n const firstStep = shortcut.normalizedSteps[0];\n if (firstStep && !firstStep.ctrl && !firstStep.alt && !firstStep.meta && firstStep.key.length === 1) {\n continue;\n }\n }\n // Sanctuaire Champs Sensibles : m\u00EAme avec allowInEditable: true, interdire s\u00E9quences, touches imprimables et Backspace/Delete/Dead sans modificateur\n if (isSensitiveInput) {\n if (shortcut.isSequence) {\n continue;\n }\n const firstStep = shortcut.normalizedSteps[0];\n if (firstStep) {\n if (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 } else if (\n !firstStep.ctrl &&\n !firstStep.alt &&\n !firstStep.meta &&\n (firstStep.key === 'backspace' || firstStep.key === 'delete' || firstStep.key === 'dead')\n ) {\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 try {\n this.options.onError(err instanceof Error ? err : new Error(String(err)), shortcut.combo);\n } catch (onErrException) {\n console.error('[Wulf.Shortcut] Erreur dans le callback onError:', onErrException);\n }\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", "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"],
|
|
5
|
-
"mappings": ";AAOO,SAAS,uBAAuD;AACrE,MAAI,OAAO,WAAW,YAAa,QAAO;AAC1C,QAAM,MAAM;AACZ,QAAM,WAAW,IAAI;AACrB,MACE,CAAC,YACD,OAAO,aAAa,YACnB,OAAO,SAAS,eAAe,oBAAoB,QACnD,OAAO,mBAAmB,eAAe,oBAAoB,gBAC9D;AACA,UAAM,QAAiC,CAAC;AACxC,QAAI,OAAO;AACX,WAAO;AAAA,EACT;AACA,SAAO;AACT;AA+DO,SAAS,eAAe,OAA+B;AAC5D,SAAO;AAAA,IACL,MAAM,eACN,MAAM,QAAQ,aACb,MAAM,QAAQ,WAAW,MAAM,YAAY;AAAA,EAC9C;AACF;;;ACtFO,IAAM,oBAAN,MAAM,mBAAkB;AAAA;AAAA;AAAA;AAAA,EAI7B,OAAc,UAAmB;AAC/B,QAAI,OAAO,cAAc,aAAa;AACpC,aAAO;AAAA,IACT;AAGA,UAAM,SAAU,UAAmE;AACnF,QAAI,UAAU,O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[],
|
|
4
|
+
"sourcesContent": [],
|
|
5
|
+
"mappings": "",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
package/dist/shortcut.global.js
CHANGED
|
@@ -26,24 +26,6 @@ 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
|
-
|
|
47
29
|
// src/shortcut/ShortcutFormatter.ts
|
|
48
30
|
var ShortcutFormatter = class _ShortcutFormatter {
|
|
49
31
|
/**
|
|
@@ -317,6 +299,13 @@ var __WulfIIFE = (() => {
|
|
|
317
299
|
}
|
|
318
300
|
};
|
|
319
301
|
|
|
302
|
+
// src/common/dom.ts
|
|
303
|
+
function isImeComposing(event) {
|
|
304
|
+
return Boolean(
|
|
305
|
+
event.isComposing || event.key === "Process" || event.key === "Enter" && event.keyCode === 229
|
|
306
|
+
);
|
|
307
|
+
}
|
|
308
|
+
|
|
320
309
|
// src/common/AuditableComponent.ts
|
|
321
310
|
var AuditableComponent = class {
|
|
322
311
|
/**
|
|
@@ -393,6 +382,8 @@ var __WulfIIFE = (() => {
|
|
|
393
382
|
sequenceBuffer = [];
|
|
394
383
|
sequenceTimer = null;
|
|
395
384
|
isListening = true;
|
|
385
|
+
isDestroyed = false;
|
|
386
|
+
emittedAuditWarnings = /* @__PURE__ */ new Set();
|
|
396
387
|
boundListener = null;
|
|
397
388
|
abortController = null;
|
|
398
389
|
idCounter = 0;
|
|
@@ -404,7 +395,8 @@ var __WulfIIFE = (() => {
|
|
|
404
395
|
defaultScope: options?.defaultScope || "global",
|
|
405
396
|
sequenceTimeout,
|
|
406
397
|
target: options?.target || (typeof window !== "undefined" ? window : {}),
|
|
407
|
-
onError: options?.onError
|
|
398
|
+
onError: options?.onError,
|
|
399
|
+
audit: options?.audit ?? true
|
|
408
400
|
};
|
|
409
401
|
this.scopeStack = [this.options.defaultScope];
|
|
410
402
|
this.initListener();
|
|
@@ -491,6 +483,10 @@ var __WulfIIFE = (() => {
|
|
|
491
483
|
* Retourne une fonction de nettoyage pour désenregistrer immédiatement.
|
|
492
484
|
*/
|
|
493
485
|
bind(definition) {
|
|
486
|
+
if (this.isDestroyed) {
|
|
487
|
+
return () => {
|
|
488
|
+
};
|
|
489
|
+
}
|
|
494
490
|
const list = Array.isArray(definition) ? definition : [definition];
|
|
495
491
|
const registeredIds = [];
|
|
496
492
|
for (const def of list) {
|
|
@@ -520,6 +516,20 @@ var __WulfIIFE = (() => {
|
|
|
520
516
|
this.shortcuts.set(id, registered);
|
|
521
517
|
registeredIds.push(id);
|
|
522
518
|
}
|
|
519
|
+
if (registeredIds.length > 0 && this.options.audit) {
|
|
520
|
+
const warnings = this.audit();
|
|
521
|
+
const newWarnings = warnings.filter((w) => !this.emittedAuditWarnings.has(w));
|
|
522
|
+
if (newWarnings.length > 0) {
|
|
523
|
+
newWarnings.forEach((w) => this.emittedAuditWarnings.add(w));
|
|
524
|
+
if (typeof console !== "undefined" && typeof console.warn === "function") {
|
|
525
|
+
console.warn(
|
|
526
|
+
`[${this.getAuditPrefix()}] Audit d'accessibilit\xE9 \u2014 ${newWarnings.length} contrainte(s) manquante(s) sur ${this.getAuditTargetLabel()} :
|
|
527
|
+
` + newWarnings.map((w) => ` - ${w}`).join("\n") + `
|
|
528
|
+
(${this.getAuditDisableHint()})`
|
|
529
|
+
);
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
}
|
|
523
533
|
return () => {
|
|
524
534
|
for (const id of registeredIds) {
|
|
525
535
|
this.shortcuts.delete(id);
|
|
@@ -605,6 +615,7 @@ var __WulfIIFE = (() => {
|
|
|
605
615
|
* Réactive l'écoute des raccourcis.
|
|
606
616
|
*/
|
|
607
617
|
resume() {
|
|
618
|
+
if (this.isDestroyed) return;
|
|
608
619
|
this.isListening = true;
|
|
609
620
|
}
|
|
610
621
|
/**
|
|
@@ -684,9 +695,12 @@ var __WulfIIFE = (() => {
|
|
|
684
695
|
* Détruit le gestionnaire : supprime les écouteurs du DOM et vide toute la mémoire.
|
|
685
696
|
*/
|
|
686
697
|
destroy() {
|
|
698
|
+
if (this.isDestroyed) return;
|
|
699
|
+
this.isDestroyed = true;
|
|
687
700
|
this.pause();
|
|
688
701
|
this.removeListener();
|
|
689
702
|
this.shortcuts.clear();
|
|
703
|
+
this.emittedAuditWarnings.clear();
|
|
690
704
|
this.scopeStack = [];
|
|
691
705
|
this.clearSequenceBuffer();
|
|
692
706
|
}
|
|
@@ -718,7 +732,7 @@ var __WulfIIFE = (() => {
|
|
|
718
732
|
this.boundListener = null;
|
|
719
733
|
}
|
|
720
734
|
handleKeyDown(event) {
|
|
721
|
-
if (!this.isListening || isImeComposing(event)) {
|
|
735
|
+
if (this.isDestroyed || !this.isListening || isImeComposing(event)) {
|
|
722
736
|
return;
|
|
723
737
|
}
|
|
724
738
|
const k = (event.key || "").toLowerCase();
|
|
@@ -752,13 +766,13 @@ var __WulfIIFE = (() => {
|
|
|
752
766
|
}
|
|
753
767
|
const activeCandidates = this.getActiveShortcuts(currentScope, isEditable, isSensitiveInput, isTypeahead);
|
|
754
768
|
const proposedSequence = [...this.sequenceBuffer.map((b) => b.step), currentStep];
|
|
755
|
-
const matchingSequence = this.findMatchingSequence(activeCandidates, proposedSequence);
|
|
769
|
+
const matchingSequence = this.findMatchingSequence(activeCandidates, proposedSequence, event);
|
|
756
770
|
if (matchingSequence) {
|
|
757
771
|
this.clearSequenceBuffer();
|
|
758
772
|
this.executeShortcut(matchingSequence, event, currentScope, true);
|
|
759
773
|
return;
|
|
760
774
|
}
|
|
761
|
-
if (this.isPrefixOfAnySequence(activeCandidates, proposedSequence)) {
|
|
775
|
+
if (this.isPrefixOfAnySequence(activeCandidates, proposedSequence, event)) {
|
|
762
776
|
this.sequenceBuffer.push({ step: currentStep, timestamp: now });
|
|
763
777
|
this.resetSequenceTimer();
|
|
764
778
|
if (event.key.length === 1 && !event.ctrlKey && !event.altKey && !event.metaKey && !isEditable && !isTypeahead) {
|
|
@@ -838,14 +852,15 @@ var __WulfIIFE = (() => {
|
|
|
838
852
|
}
|
|
839
853
|
return null;
|
|
840
854
|
}
|
|
841
|
-
findMatchingSequence(candidates, proposed) {
|
|
855
|
+
findMatchingSequence(candidates, proposed, rawEvent) {
|
|
842
856
|
for (const candidate of candidates) {
|
|
843
857
|
if (!candidate.isSequence || candidate.normalizedSteps.length !== proposed.length) {
|
|
844
858
|
continue;
|
|
845
859
|
}
|
|
846
860
|
let allMatch = true;
|
|
847
861
|
for (let i = 0; i < proposed.length; i++) {
|
|
848
|
-
|
|
862
|
+
const stepEvent = i === proposed.length - 1 ? rawEvent : void 0;
|
|
863
|
+
if (!this.stepMatches(candidate.normalizedSteps[i], proposed[i], stepEvent)) {
|
|
849
864
|
allMatch = false;
|
|
850
865
|
break;
|
|
851
866
|
}
|
|
@@ -856,14 +871,15 @@ var __WulfIIFE = (() => {
|
|
|
856
871
|
}
|
|
857
872
|
return null;
|
|
858
873
|
}
|
|
859
|
-
isPrefixOfAnySequence(candidates, proposed) {
|
|
874
|
+
isPrefixOfAnySequence(candidates, proposed, rawEvent) {
|
|
860
875
|
for (const candidate of candidates) {
|
|
861
876
|
if (!candidate.isSequence || candidate.normalizedSteps.length <= proposed.length) {
|
|
862
877
|
continue;
|
|
863
878
|
}
|
|
864
879
|
let prefixMatches = true;
|
|
865
880
|
for (let i = 0; i < proposed.length; i++) {
|
|
866
|
-
|
|
881
|
+
const stepEvent = i === proposed.length - 1 ? rawEvent : void 0;
|
|
882
|
+
if (!this.stepMatches(candidate.normalizedSteps[i], proposed[i], stepEvent)) {
|
|
867
883
|
prefixMatches = false;
|
|
868
884
|
break;
|
|
869
885
|
}
|
|
@@ -918,16 +934,7 @@ var __WulfIIFE = (() => {
|
|
|
918
934
|
}
|
|
919
935
|
}
|
|
920
936
|
};
|
|
921
|
-
|
|
922
|
-
// src/shortcut/index.ts
|
|
923
|
-
var wulfNamespace = getSafeWulfNamespace();
|
|
924
|
-
if (wulfNamespace) {
|
|
925
|
-
wulfNamespace.Shortcut = Object.assign(ShortcutManager, {
|
|
926
|
-
ShortcutManager,
|
|
927
|
-
ShortcutFormatter
|
|
928
|
-
});
|
|
929
|
-
}
|
|
930
937
|
return __toCommonJS(index_exports);
|
|
931
938
|
})();
|
|
932
|
-
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
|
|
939
|
+
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; } var __set = function(obj, key, val) { try { Object.defineProperty(obj, key, { value: val, writable: true, configurable: true, enumerable: true }); } catch (_) { try { obj[key] = val; } catch (__) {} } }; if (typeof __WulfIIFE !== "undefined" && __WulfIIFE) { var __e = __WulfIIFE; var __skip = ["__proto__","constructor","prototype"]; for (var k in __e) { if (Object.hasOwn(__e, k) && __skip.indexOf(k) === -1 && __w[k] === undefined) { __set(__w, k, __e[k]); } } if (__e.ShortcutManager) __set(__w, "Shortcut", Object.assign(__e.ShortcutManager, { ShortcutManager: __e.ShortcutManager, ShortcutFormatter: __e.ShortcutFormatter, default: __e.ShortcutManager })); }}
|
|
933
940
|
//# sourceMappingURL=shortcut.global.js.map
|