wulf.js 1.9.1 → 1.9.3
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 +160 -21
- package/changelog.md +66 -0
- package/dist/focus-trap.esm.js +62 -9
- package/dist/focus-trap.esm.js.map +2 -2
- package/dist/focus-trap.global.js +64 -11
- package/dist/focus-trap.global.js.map +2 -2
- package/dist/focus-trap.global.min.js +3 -3
- package/dist/focus-trap.global.min.js.map +3 -3
- package/dist/index.esm.js +947 -101
- package/dist/index.esm.js.map +4 -4
- package/dist/index.global.js +949 -103
- package/dist/index.global.js.map +4 -4
- package/dist/index.global.min.js +3 -3
- package/dist/index.global.min.js.map +4 -4
- package/dist/mask.esm.js +66 -22
- package/dist/mask.esm.js.map +2 -2
- package/dist/mask.global.js +68 -24
- package/dist/mask.global.js.map +2 -2
- package/dist/mask.global.min.js +3 -3
- package/dist/mask.global.min.js.map +3 -3
- package/dist/masonry.esm.js +96 -40
- package/dist/masonry.esm.js.map +2 -2
- package/dist/masonry.global.js +98 -42
- package/dist/masonry.global.js.map +2 -2
- package/dist/masonry.global.min.js +3 -3
- package/dist/masonry.global.min.js.map +3 -3
- package/dist/scroll.esm.js +66 -28
- package/dist/scroll.esm.js.map +2 -2
- package/dist/scroll.global.js +68 -30
- package/dist/scroll.global.js.map +2 -2
- package/dist/scroll.global.min.js +4 -4
- package/dist/scroll.global.min.js.map +3 -3
- package/dist/shortcut.esm.js +631 -0
- package/dist/shortcut.esm.js.map +7 -0
- package/dist/shortcut.global.js +657 -0
- package/dist/shortcut.global.js.map +7 -0
- package/dist/shortcut.global.min.js +3 -0
- package/dist/shortcut.global.min.js.map +7 -0
- package/dist/toast.css +1 -1
- package/dist/toast.css.map +2 -2
- package/dist/toast.esm.js +109 -44
- package/dist/toast.esm.js.map +2 -2
- package/dist/toast.global.js +111 -46
- package/dist/toast.global.js.map +2 -2
- package/dist/toast.global.min.js +4 -4
- package/dist/toast.global.min.js.map +3 -3
- package/dist/types/focus-trap/FocusTrap.d.ts +2 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/mask/AmountEngine.d.ts +1 -0
- package/dist/types/mask/BaseInputMask.d.ts +4 -0
- package/dist/types/mask/InputAmountMask.d.ts +1 -0
- package/dist/types/mask/InputMask.d.ts +1 -0
- package/dist/types/shortcut/ShortcutFormatter.d.ts +31 -0
- package/dist/types/shortcut/ShortcutManager.d.ts +95 -0
- package/dist/types/shortcut/index.d.ts +4 -0
- package/dist/types/shortcut/types.d.ts +101 -0
- package/dist/types/toast/ToastInstance.d.ts +1 -1
- package/dist/types/toast/types.d.ts +5 -0
- package/package.json +20 -11
- package/dist/focus-trap.cjs.js +0 -430
- package/dist/focus-trap.cjs.js.map +0 -7
- package/dist/index.cjs.js +0 -5365
- package/dist/index.cjs.js.map +0 -7
- package/dist/mask.cjs.js +0 -3086
- package/dist/mask.cjs.js.map +0 -7
- package/dist/masonry.cjs.js +0 -858
- package/dist/masonry.cjs.js.map +0 -7
- package/dist/scroll.cjs.js +0 -823
- package/dist/scroll.cjs.js.map +0 -7
- package/dist/toast.cjs.js +0 -715
- package/dist/toast.cjs.js.map +0 -7
package/dist/scroll.esm.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/common/AuditableComponent.ts", "../src/common/LocalizedComponent.ts", "../src/common/i18n.ts", "../src/scroll/i18n/fr.ts", "../src/scroll/i18n/en.ts", "../src/scroll/i18n/index.ts", "../src/scroll/ScrollBlock.ts", "../src/scroll/index.ts"],
|
|
4
|
-
"sourcesContent": ["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)\n * pointe vers des \u00E9l\u00E9ments r\u00E9ellement pr\u00E9sents dans le document.\n */\n protected checkAriaIdReferences(\n element: HTMLElement,\n attrName: 'aria-labelledby' | 'aria-describedby',\n warnings: string[]\n ): boolean {\n const rawValue = element.getAttribute(attrName)?.trim();\n if (!rawValue) return false;\n\n const doc = element.ownerDocument || document;\n const ids = rawValue.split(/\\s+/).filter(Boolean);\n const isValid = ids.length > 0 && ids.every((id) => Boolean(doc.getElementById(id)));\n\n if (!isValid) {\n warnings.push(\n `Attribut ${attrName}=\"${rawValue}\" invalide : l'\u00E9l\u00E9ment cible est introuvable dans le DOM.`\n );\n }\n\n return isValid;\n }\n}\n\n", "import { I18nManager } from './i18n';\nimport { AuditableComponent } from './AuditableComponent';\n\n/**\n * Classe de base abstraite factorisant l'ensemble des m\u00E9thodes statiques\n * de localisation, l'initialisation des surcharges d'instance et l'audit d'accessibilit\u00E9.\n */\nexport abstract class LocalizedComponent<TI18n extends object = any> extends AuditableComponent {\n protected static _i18n: I18nManager<any>;\n\n /**\n * D\u00E9finit la langue globale du composant (ex: 'fr', 'en', 'es').\n */\n public static setLocale(locale: string): void {\n if (this._i18n) {\n this._i18n.setLocale(locale);\n }\n }\n\n /**\n * Retourne la langue globale active du composant.\n */\n public static getLocale(): string {\n return this._i18n ? this._i18n.getLocale() : '';\n }\n\n /**\n * Enregistre un dictionnaire de traduction pour une langue donn\u00E9e.\n */\n public static registerLocale<T extends object>(\n this: { _i18n: I18nManager<T> },\n locale: string,\n translations: Partial<T>\n ): void {\n if (this._i18n) {\n this._i18n.registerLocale(locale, translations);\n }\n }\n\n /**\n * Surcharge les libell\u00E9s globalement pour ce composant.\n */\n public static setI18n<T extends object>(\n this: { _i18n: I18nManager<T> },\n overrides: Partial<T>\n ): void {\n if (this._i18n) {\n this._i18n.setI18n(overrides);\n }\n }\n\n /**\n * Retourne l'ensemble des libell\u00E9s actifs r\u00E9solus du composant.\n */\n public static getI18n<T extends object>(this: { _i18n: I18nManager<T> }): T {\n return this._i18n ? this._i18n.getAll() : ({} as T);\n }\n\n /**\n * R\u00E9initialise les r\u00E9glages de langue et surcharges globales.\n */\n public static resetI18n(): void {\n if (this._i18n) {\n this._i18n.reset();\n }\n }\n\n /**\n * R\u00E9sout une cl\u00E9 au niveau statique de la classe.\n */\n public static t<T extends object>(\n this: { _i18n: I18nManager<T> },\n key: keyof T,\n instanceOverride?: Partial<T>\n ): string {\n return this._i18n ? this._i18n.t(key, instanceOverride) : String(key);\n }\n\n /**\n * Surcharges de localisation sp\u00E9cifiques \u00E0 cette instance.\n */\n protected i18nOverrides?: Partial<TI18n>;\n\n constructor(i18nOverrides?: Partial<TI18n>) {\n super();\n this.i18nOverrides = i18nOverrides;\n }\n\n /**\n * Traduit une cl\u00E9 en tenant compte automatiquement des surcharges de l'instance courante.\n */\n protected t(key: keyof TI18n): string {\n const ctor = this.constructor as typeof LocalizedComponent;\n return ctor._i18n ? ctor._i18n.t(key as any, this.i18nOverrides) : String(key);\n }\n}\n\n", "/**\n * Micro-moteur i18n g\u00E9n\u00E9rique, ultra-l\u00E9ger et modulaire.\n * Con\u00E7u pour \u00EAtre r\u00E9utilis\u00E9 ind\u00E9pendamment par chaque librairie (tree-shaking et isolation totale).\n */\n\nexport interface I18nManager<T> {\n /**\n * D\u00E9finit la langue active (ex: 'fr', 'en', 'es').\n */\n setLocale(locale: string): void;\n\n /**\n * Renvoie la langue active courante.\n */\n getLocale(): string;\n\n /**\n * Enregistre ou met \u00E0 jour les traductions pour une langue donn\u00E9e.\n */\n registerLocale(locale: string, translations: Partial<T>): void;\n\n /**\n * Applique des surcharges globales prioritaires sur les libell\u00E9s actuels.\n */\n setI18n(overrides: Partial<T>): void;\n\n /**\n * R\u00E9sout une cl\u00E9 de traduction en cascade :\n * 1. Surcharge d'instance locale\n * 2. Surcharges globales (setI18n)\n * 3. Dictionnaire de la langue active\n * 4. Dictionnaire de repli (fallbackLocale)\n */\n t(key: keyof T, instanceOverride?: Partial<T>): string;\n\n /**\n * Renvoie l'int\u00E9gralit\u00E9 du dictionnaire r\u00E9solu.\n */\n getAll(instanceOverride?: Partial<T>): T;\n\n /**\n * R\u00E9initialise l'\u00E9tat aux r\u00E9glages initiaux (langue de base, sans surcharges).\n */\n reset(): void;\n}\n\nfunction normalizeLocaleCode(locale: string): string {\n return locale.trim().toLowerCase().replace(/_/g, '-');\n}\n\nfunction getPrimaryLanguage(normalizedLocale: string): string | null {\n const dashIndex = normalizedLocale.indexOf('-');\n return dashIndex > 0 ? normalizedLocale.slice(0, dashIndex) : null;\n}\n\nfunction assignDefined<T extends object>(target: Partial<T>, source?: Partial<T>): Partial<T> {\n if (!source) return target;\n for (const key of Object.keys(source) as Array<keyof T>) {\n if (source[key] !== undefined) {\n target[key] = source[key];\n }\n }\n return target;\n}\n\nexport function createI18nManager<T extends object>(\n defaultLocale: string,\n locales: Record<string, T>\n): I18nManager<T> {\n const fallbackLocale = normalizeLocaleCode(defaultLocale);\n const initialLocales: Record<string, T> = {};\n for (const [loc, dict] of Object.entries(locales)) {\n initialLocales[normalizeLocaleCode(loc)] = { ...dict };\n }\n\n let currentLocale = fallbackLocale;\n let activeLocales: Record<string, Partial<T>> = { ...initialLocales };\n let globalOverrides: Partial<T> = {};\n\n function resolveActiveDictionaries(): Array<Partial<T>> {\n const dicts: Array<Partial<T>> = [];\n const exact = activeLocales[currentLocale];\n if (exact) dicts.push(exact);\n\n const primary = getPrimaryLanguage(currentLocale);\n if (primary && activeLocales[primary]) {\n dicts.push(activeLocales[primary]);\n }\n return dicts;\n }\n\n return {\n setLocale(locale: string): void {\n if (locale && locale.trim()) {\n currentLocale = normalizeLocaleCode(locale);\n }\n },\n\n getLocale(): string {\n return currentLocale;\n },\n\n registerLocale(locale: string, translations: Partial<T>): void {\n if (!locale || !locale.trim() || !translations) return;\n const norm = normalizeLocaleCode(locale);\n activeLocales[norm] = assignDefined({ ...(activeLocales[norm] || {}) }, translations);\n },\n\n setI18n(overrides: Partial<T>): void {\n if (!overrides) return;\n globalOverrides = assignDefined({ ...globalOverrides }, overrides);\n },\n\n t(key: keyof T, instanceOverride?: Partial<T>): string {\n // 1. Priorit\u00E9 instance\n if (instanceOverride && instanceOverride[key] !== undefined) {\n return String(instanceOverride[key]);\n }\n\n // 2. Priorit\u00E9 surcharge globale\n if (globalOverrides[key] !== undefined) {\n return String(globalOverrides[key]);\n }\n\n // 3. Langue active (exacte ex: 'en-us', puis primaire ex: 'en')\n for (const dict of resolveActiveDictionaries()) {\n if (dict[key] !== undefined) {\n return String(dict[key]);\n }\n }\n\n // 4. Langue de repli (fallback)\n const fallbackDict = activeLocales[fallbackLocale] || initialLocales[fallbackLocale];\n if (fallbackDict && fallbackDict[key] !== undefined) {\n return String(fallbackDict[key]);\n }\n\n return String(key);\n },\n\n getAll(instanceOverride ?: Partial<T>): T {\n const result: Partial<T> = {};\n const fallback = activeLocales[fallbackLocale] || initialLocales[fallbackLocale];\n assignDefined(result, fallback);\n\n // Du moins sp\u00E9cifique (langue primaire) au plus sp\u00E9cifique (locale exacte)\n const activeDicts = resolveActiveDictionaries().reverse();\n for (const dict of activeDicts) {\n assignDefined(result, dict);\n }\n\n assignDefined(result, globalOverrides);\n assignDefined(result, instanceOverride);\n return result as T;\n },\n\n reset(): void {\n currentLocale = fallbackLocale;\n globalOverrides = {};\n activeLocales = {};\n for(const [loc, dict] of Object.entries(initialLocales)) {\n activeLocales[loc] = { ...dict };\n }\n }\n };\n}\n", "import { ScrollI18n } from './types';\n\nexport const scrollFr: ScrollI18n = {\n viewport: 'Zone de contenu d\u00E9filable',\n verticalThumb: 'D\u00E9filement vertical',\n horizontalThumb: 'D\u00E9filement horizontal'\n};\n\n", "import { ScrollI18n } from './types';\n\nexport const scrollEn: ScrollI18n = {\n viewport: 'Scrollable content area',\n verticalThumb: 'Vertical scroll',\n horizontalThumb: 'Horizontal scroll'\n};\n\n", "import { createI18nManager, I18nManager } from '../../common/i18n';\nimport { LocalizedComponent } from '../../common/LocalizedComponent';\nimport { ScrollI18n } from './types';\nimport { scrollFr } from './fr';\nimport { scrollEn } from './en';\n\nexport type { I18nManager };\nexport { createI18nManager, LocalizedComponent };\nexport * from './types';\nexport * from './fr';\nexport * from './en';\n\nexport const scrollI18n: I18nManager<ScrollI18n> = createI18nManager<ScrollI18n>('fr', {\n fr: scrollFr,\n en: scrollEn\n});\n\n", "import {\n ScrollBlockOptions,\n ScrollInfo,\n ScrollToTarget,\n ScrollToTargetOptions,\n IScrollBlock\n} from './types';\nimport { LocalizedComponent } from '../common/LocalizedComponent';\nimport { scrollI18n, ScrollI18n } from './i18n';\n\nlet idCounter = 0;\n\n/**\n * ScrollBlock - Alternative accessible, moderne et ultra-l\u00E9g\u00E8re \u00E0 malihu-custom-scrollbar-plugin.\n * Repose sur le d\u00E9filement natif du navigateur avec synchronisation GPU sans reflow.\n */\nexport class ScrollBlock extends LocalizedComponent<ScrollI18n> implements IScrollBlock {\n protected static override _i18n = scrollI18n;\n public static readonly i18n = scrollI18n;\n\n public readonly root: HTMLElement;\n public readonly viewport: HTMLElement;\n\n private options: Required<ScrollBlockOptions>;\n private createdViewport: boolean = false;\n private wasIdGenerated: boolean = false;\n private wasRoleInferred: boolean = false;\n private wasAriaLabelInferred: boolean = false;\n private hasExplicitAriaLabel: boolean = false;\n private lastInferredAriaLabel: string = '';\n\n private trackY?: HTMLElement;\n private thumbY?: HTMLElement;\n private trackX?: HTMLElement;\n private thumbX?: HTMLElement;\n\n private resizeObserver?: ResizeObserver;\n private hideTimer?: number;\n\n private isDragging: boolean = false;\n private dragAxis?: 'y' | 'x';\n private dragPointerId?: number;\n private dragStartPos: number = 0;\n private dragStartScroll: number = 0;\n\n private atBottom: boolean = false;\n private atTop: boolean = true;\n private atRight: boolean = false;\n private atLeft: boolean = true;\n\n // R\u00E9f\u00E9rences d'\u00E9couteurs d'\u00E9v\u00E9nements pour le nettoyage\n private boundOnScroll: () => void;\n private boundOnMouseEnter: () => void;\n private boundOnMouseLeave: () => void;\n private boundOnFocusIn: () => void;\n private boundOnFocusOut: () => void;\n private boundPointerMove: (e: PointerEvent) => void;\n private boundPointerUp: (e: PointerEvent) => void;\n\n constructor(element: HTMLElement | string, options?: ScrollBlockOptions) {\n super(options?.i18n);\n\n const resolvedElement = typeof element === 'string'\n ? document.querySelector<HTMLElement>(element)\n : element;\n\n if (!resolvedElement) {\n throw new Error(`[ScrollBlock] \u00C9l\u00E9ment introuvable : \"${element}\".`);\n }\n\n this.root = resolvedElement;\n this.hasExplicitAriaLabel = Boolean(options?.ariaLabel || options?.i18n?.viewport);\n\n // Options par d\u00E9faut\n this.options = {\n axis: options?.axis || 'y',\n autoHide: options?.autoHide ?? true,\n autoHideDelay: options?.autoHideDelay ?? 1000,\n alwaysVisible: options?.alwaysVisible ?? false,\n ariaLabel: options?.ariaLabel || this.t('viewport'),\n i18n: options?.i18n || {},\n minThumbSize: options?.minThumbSize ?? 24,\n edgeThreshold: options?.edgeThreshold ?? 10,\n onScroll: options?.onScroll || (() => { }),\n onTotalScroll: options?.onTotalScroll || (() => { }),\n onTotalScrollBack: options?.onTotalScrollBack || (() => { }),\n audit: options?.audit ?? true\n };\n\n // Liaison des m\u00E9thodes\n this.boundOnScroll = this.handleScroll.bind(this);\n this.boundOnMouseEnter = this.handleMouseEnter.bind(this);\n this.boundOnMouseLeave = this.handleMouseLeave.bind(this);\n this.boundOnFocusIn = this.handleFocusIn.bind(this);\n this.boundOnFocusOut = this.handleFocusOut.bind(this);\n this.boundPointerMove = this.handlePointerMove.bind(this);\n this.boundPointerUp = this.handlePointerUp.bind(this);\n\n // Initialisation du DOM et du viewport\n this.viewport = this.setupViewport();\n this.setupAccessibility();\n this.setupScrollbars();\n this.setupEventListeners();\n this.setupObserver();\n\n // Premier calcul\n this.update();\n\n this.runAuditWarning(this.options.audit);\n }\n\n /**\n * Pr\u00E9pare le viewport d\u00E9filant sans alt\u00E9rer les \u00E9l\u00E9ments enfants.\n */\n private setupViewport(): HTMLElement {\n this.root.classList.add('wulf-scrollblock');\n\n if (this.options.alwaysVisible) {\n this.root.classList.add('is-always-visible');\n }\n\n if (this.options.axis === 'both') {\n this.root.classList.add('has-both-axes');\n }\n\n // R\u00E9utilisation d'un viewport existant ou cr\u00E9ation transparente\n const existingViewport = this.root.querySelector<HTMLElement>(':scope > .wulf-scrollblock-viewport');\n if (existingViewport) {\n return existingViewport;\n }\n\n const viewport = document.createElement('div');\n viewport.className = 'wulf-scrollblock-viewport';\n\n // D\u00E9placement des enfants existants dans le viewport\n while (this.root.firstChild) {\n viewport.appendChild(this.root.firstChild);\n }\n\n this.root.appendChild(viewport);\n this.createdViewport = true;\n return viewport;\n }\n\n /**\n * Configure les attributs WAI-ARIA pour une accessibilit\u00E9 maximale.\n */\n private setupAccessibility(): void {\n if (!this.viewport.id) {\n idCounter += 1;\n this.viewport.id = `wulf-scrollblock-vp-${idCounter}`;\n this.wasIdGenerated = true;\n }\n\n if (!this.viewport.hasAttribute('role')) {\n this.viewport.setAttribute('role', 'region');\n this.wasRoleInferred = true;\n }\n\n if (!this.viewport.hasAttribute('aria-label')) {\n const label = this.hasExplicitAriaLabel ? this.options.ariaLabel : this.t('viewport');\n this.viewport.setAttribute('aria-label', label);\n this.lastInferredAriaLabel = label;\n this.wasAriaLabelInferred = true;\n }\n }\n\n /**\n * Synchronise dynamiquement les libell\u00E9s ARIA si la langue globale change apr\u00E8s montage.\n */\n private syncAccessibilityLabels(): void {\n if (this.wasAriaLabelInferred && !this.hasExplicitAriaLabel) {\n const currentAttr = this.viewport.getAttribute('aria-label');\n if (currentAttr === this.lastInferredAriaLabel) {\n const nextLabel = this.t('viewport');\n this.viewport.setAttribute('aria-label', nextLabel);\n this.lastInferredAriaLabel = nextLabel;\n this.options.ariaLabel = nextLabel;\n }\n }\n if (this.thumbY) {\n this.thumbY.setAttribute('aria-label', this.t('verticalThumb'));\n }\n if (this.thumbX) {\n this.thumbX.setAttribute('aria-label', this.t('horizontalThumb'));\n }\n }\n\n /**\n * Cr\u00E9e les rails et curseurs selon l'axe s\u00E9lectionn\u00E9.\n */\n private setupScrollbars(): void {\n if (this.options.axis === 'y' || this.options.axis === 'both') {\n this.trackY = document.createElement('div');\n this.trackY.className = 'wulf-scrollblock-track wulf-scrollblock-vertical';\n this.trackY.setAttribute('aria-hidden', 'true');\n\n this.thumbY = document.createElement('div');\n this.thumbY.className = 'wulf-scrollblock-thumb';\n this.thumbY.setAttribute('role', 'scrollbar');\n this.thumbY.setAttribute('aria-orientation', 'vertical');\n this.thumbY.setAttribute('aria-controls', this.viewport.id);\n this.thumbY.setAttribute('aria-valuenow', '0');\n this.thumbY.setAttribute('aria-valuemin', '0');\n this.thumbY.setAttribute('aria-valuemax', '100');\n this.thumbY.setAttribute('aria-label', this.t('verticalThumb'));\n\n this.trackY.appendChild(this.thumbY);\n this.root.appendChild(this.trackY);\n\n this.attachTrackListeners(this.trackY, this.thumbY, 'y');\n }\n\n if (this.options.axis === 'x' || this.options.axis === 'both') {\n this.trackX = document.createElement('div');\n this.trackX.className = 'wulf-scrollblock-track wulf-scrollblock-horizontal';\n this.trackX.setAttribute('aria-hidden', 'true');\n\n this.thumbX = document.createElement('div');\n this.thumbX.className = 'wulf-scrollblock-thumb';\n this.thumbX.setAttribute('role', 'scrollbar');\n this.thumbX.setAttribute('aria-orientation', 'horizontal');\n this.thumbX.setAttribute('aria-controls', this.viewport.id);\n this.thumbX.setAttribute('aria-valuenow', '0');\n this.thumbX.setAttribute('aria-valuemin', '0');\n this.thumbX.setAttribute('aria-valuemax', '100');\n this.thumbX.setAttribute('aria-label', this.t('horizontalThumb'));\n\n this.trackX.appendChild(this.thumbX);\n this.root.appendChild(this.trackX);\n\n this.attachTrackListeners(this.trackX, this.thumbX, 'x');\n }\n }\n\n /**\n * Attache les \u00E9couteurs sur un rail et son curseur.\n */\n private attachTrackListeners(track: HTMLElement, thumb: HTMLElement, axis: 'y' | 'x'): void {\n thumb.addEventListener('pointerdown', (e: PointerEvent) => {\n e.preventDefault();\n e.stopPropagation();\n\n this.isDragging = true;\n this.dragAxis = axis;\n this.dragPointerId = e.pointerId;\n this.dragStartPos = axis === 'y' ? e.clientY : e.clientX;\n this.dragStartScroll = axis === 'y' ? this.viewport.scrollTop : this.viewport.scrollLeft;\n\n thumb.setPointerCapture(e.pointerId);\n thumb.classList.add('is-active');\n this.root.classList.add('is-dragging');\n\n // Liaison dynamique sur window uniquement pendant la dur\u00E9e active du drag\n window.addEventListener('pointermove', this.boundPointerMove);\n window.addEventListener('pointerup', this.boundPointerUp);\n window.addEventListener('pointercancel', this.boundPointerUp);\n });\n\n // Clic direct sur le rail (hors dragger)\n track.addEventListener('pointerdown', (e: PointerEvent) => {\n if (e.target === thumb) return;\n e.preventDefault();\n\n const rect = track.getBoundingClientRect();\n const clickPos = axis === 'y' ? (e.clientY - rect.top) : (e.clientX - rect.left);\n const trackSize = axis === 'y' ? rect.height : rect.width;\n const clientSize = axis === 'y' ? this.viewport.clientHeight : this.viewport.clientWidth;\n const scrollSize = axis === 'y' ? this.viewport.scrollHeight : this.viewport.scrollWidth;\n\n const ratio = clickPos / trackSize;\n const targetScroll = ratio * (scrollSize - clientSize);\n\n this.scrollTo(axis === 'y' ? { top: targetScroll } : { left: targetScroll }, { smooth: true });\n });\n }\n\n /**\n * \u00C9couteurs globaux sur le viewport et les interactions.\n */\n private setupEventListeners(): void {\n this.viewport.addEventListener('scroll', this.boundOnScroll, { passive: true });\n\n if (this.options.autoHide && !this.options.alwaysVisible) {\n this.root.addEventListener('mouseenter', this.boundOnMouseEnter);\n this.root.addEventListener('mouseleave', this.boundOnMouseLeave);\n this.root.addEventListener('focusin', this.boundOnFocusIn);\n this.root.addEventListener('focusout', this.boundOnFocusOut);\n }\n }\n\n /**\n * Initialise le ResizeObserver r\u00E9actif.\n */\n private setupObserver(): void {\n if (typeof ResizeObserver !== 'undefined') {\n this.resizeObserver = new ResizeObserver(() => {\n window.requestAnimationFrame(() => this.update());\n });\n this.resizeObserver.observe(this.root);\n this.resizeObserver.observe(this.viewport);\n if (this.viewport.firstElementChild) {\n this.resizeObserver.observe(this.viewport.firstElementChild);\n }\n }\n }\n\n /**\n * D\u00E9placement lors du glissement du curseur.\n */\n private handlePointerMove(e: PointerEvent): void {\n if (!this.isDragging || !this.dragAxis) return;\n\n const isY = this.dragAxis === 'y';\n const delta = (isY ? e.clientY : e.clientX) - this.dragStartPos;\n const track = isY ? this.trackY : this.trackX;\n const thumb = isY ? this.thumbY : this.thumbX;\n\n if (!track || !thumb) return;\n\n const trackSize = isY ? track.clientHeight : track.clientWidth;\n const thumbSize = isY ? thumb.clientHeight : thumb.clientWidth;\n const clientSize = isY ? this.viewport.clientHeight : this.viewport.clientWidth;\n const scrollSize = isY ? this.viewport.scrollHeight : this.viewport.scrollWidth;\n\n const maxScroll = scrollSize - clientSize;\n const maxThumbTravel = trackSize - thumbSize;\n\n if (maxThumbTravel <= 0 || maxScroll <= 0) return;\n\n const ratio = maxScroll / maxThumbTravel;\n const nextScroll = this.dragStartScroll + delta * ratio;\n\n if (isY) {\n this.viewport.scrollTop = Math.max(0, Math.min(maxScroll, nextScroll));\n } else {\n this.viewport.scrollLeft = Math.max(0, Math.min(maxScroll, nextScroll));\n }\n }\n\n /**\n * Rel\u00E2chement de la capture du pointeur.\n */\n private handlePointerUp(e: PointerEvent): void {\n if (!this.isDragging) return;\n\n if (this.dragPointerId !== undefined) {\n const activeThumb = this.dragAxis === 'y' ? this.thumbY : this.thumbX;\n if (activeThumb && activeThumb.hasPointerCapture(this.dragPointerId)) {\n activeThumb.releasePointerCapture(this.dragPointerId);\n }\n }\n\n // D\u00E9tachement imm\u00E9diat des \u00E9couteurs globaux\n window.removeEventListener('pointermove', this.boundPointerMove);\n window.removeEventListener('pointerup', this.boundPointerUp);\n window.removeEventListener('pointercancel', this.boundPointerUp);\n\n this.isDragging = false;\n this.dragAxis = undefined;\n this.dragPointerId = undefined;\n\n this.thumbY?.classList.remove('is-active');\n this.thumbX?.classList.remove('is-active');\n this.root.classList.remove('is-dragging');\n\n this.scheduleAutoHide();\n }\n\n /**\n * Gestionnaire d'\u00E9v\u00E9nement de d\u00E9filement natif.\n */\n private handleScroll(): void {\n this.syncThumbs();\n\n const { scrollTop, scrollLeft, scrollHeight, scrollWidth, clientHeight, clientWidth } = this.viewport;\n const maxTop = Math.max(0, scrollHeight - clientHeight);\n const maxLeft = Math.max(0, scrollWidth - clientWidth);\n\n const progressY = maxTop > 0 ? (scrollTop / maxTop) : 0;\n const progressX = maxLeft > 0 ? (scrollLeft / maxLeft) : 0;\n\n // D\u00E9clenchement du callback onScroll\n this.options.onScroll({\n top: scrollTop,\n left: scrollLeft,\n maxTop,\n maxLeft,\n progressY: Math.round(progressY * 100),\n progressX: Math.round(progressX * 100)\n });\n\n // D\u00E9tection des extr\u00E9mit\u00E9s (infinite scroll / edge callbacks)\n const threshold = this.options.edgeThreshold;\n\n if (maxTop > 0) {\n const nowBottom = scrollTop >= maxTop - threshold;\n const nowTop = scrollTop <= threshold;\n\n if (nowBottom && !this.atBottom) {\n this.options.onTotalScroll('bottom');\n }\n if (nowTop && !this.atTop) {\n this.options.onTotalScrollBack('top');\n }\n\n this.atBottom = nowBottom;\n this.atTop = nowTop;\n }\n\n if (maxLeft > 0) {\n const nowRight = scrollLeft >= maxLeft - threshold;\n const nowLeft = scrollLeft <= threshold;\n\n if (nowRight && !this.atRight) {\n this.options.onTotalScroll('right');\n }\n if (nowLeft && !this.atLeft) {\n this.options.onTotalScrollBack('left');\n }\n\n this.atRight = nowRight;\n this.atLeft = nowLeft;\n }\n\n // Gestion de l'affichage pendant le scroll\n if (this.options.autoHide && !this.options.alwaysVisible) {\n this.root.classList.add('is-scrolling');\n this.scheduleAutoHide();\n }\n }\n\n /**\n * Synchronise la position physique et ARIA des curseurs.\n */\n private syncThumbs(): void {\n const { scrollTop, scrollLeft, scrollHeight, scrollWidth, clientHeight, clientWidth } = this.viewport;\n\n // Axe Y\n if (this.thumbY && this.trackY) {\n const maxScrollY = scrollHeight - clientHeight;\n const trackHeight = this.trackY.clientHeight;\n const thumbHeight = this.thumbY.clientHeight;\n const maxTravelY = trackHeight - thumbHeight;\n\n if (maxScrollY > 0 && maxTravelY > 0) {\n const ratioY = scrollTop / maxScrollY;\n const posY = Math.max(0, Math.min(maxTravelY, ratioY * maxTravelY));\n this.thumbY.style.transform = `translate3d(0, ${posY}px, 0)`;\n this.thumbY.setAttribute('aria-valuenow', String(Math.round(ratioY * 100)));\n }\n }\n\n // Axe X\n if (this.thumbX && this.trackX) {\n const maxScrollX = scrollWidth - clientWidth;\n const trackWidth = this.trackX.clientWidth;\n const thumbWidth = this.thumbX.clientWidth;\n const maxTravelX = trackWidth - thumbWidth;\n\n if (maxScrollX > 0 && maxTravelX > 0) {\n const ratioX = scrollLeft / maxScrollX;\n const posX = Math.max(0, Math.min(maxTravelX, ratioX * maxTravelX));\n this.thumbX.style.transform = `translate3d(${posX}px, 0, 0)`;\n this.thumbX.setAttribute('aria-valuenow', String(Math.round(ratioX * 100)));\n }\n }\n }\n\n private handleMouseEnter(): void {\n this.root.classList.add('is-visible');\n this.clearAutoHideTimer();\n }\n\n private handleMouseLeave(): void {\n this.scheduleAutoHide();\n }\n\n private handleFocusIn(): void {\n this.root.classList.add('is-visible');\n this.clearAutoHideTimer();\n }\n\n private handleFocusOut(): void {\n this.scheduleAutoHide();\n }\n\n private clearAutoHideTimer(): void {\n if (this.hideTimer) {\n window.clearTimeout(this.hideTimer);\n this.hideTimer = undefined;\n }\n }\n\n private scheduleAutoHide(): void {\n if (this.options.alwaysVisible || !this.options.autoHide || this.isDragging) return;\n this.clearAutoHideTimer();\n\n this.hideTimer = window.setTimeout(() => {\n this.root.classList.remove('is-scrolling');\n this.root.classList.remove('is-visible');\n }, this.options.autoHideDelay);\n }\n\n /**\n * Recalcule les dimensions et la visibilit\u00E9 des barres.\n */\n public update(): void {\n this.syncAccessibilityLabels();\n const { scrollHeight, clientHeight, scrollWidth, clientWidth } = this.viewport;\n\n const canScrollY = scrollHeight > clientHeight;\n const canScrollX = scrollWidth > clientWidth;\n\n // Gestion de la classe CSS de scrollabilit\u00E9\n this.root.classList.toggle('has-scroll-y', canScrollY);\n this.root.classList.toggle('has-scroll-x', canScrollX);\n\n // WCAG 2.1.1 : tabindex=\"0\" uniquement si le contenu d\u00E9borde\n if (canScrollY || canScrollX) {\n this.viewport.setAttribute('tabindex', '0');\n } else {\n this.viewport.removeAttribute('tabindex');\n }\n\n // Mise \u00E0 jour taille du thumb Y\n if (this.trackY && this.thumbY) {\n if (canScrollY) {\n const trackHeight = this.trackY.clientHeight;\n const calculatedHeight = Math.max(\n this.options.minThumbSize,\n trackHeight * (clientHeight / scrollHeight)\n );\n this.thumbY.style.height = `${calculatedHeight}px`;\n }\n }\n\n // Mise \u00E0 jour taille du thumb X\n if (this.trackX && this.thumbX) {\n if (canScrollX) {\n const trackWidth = this.trackX.clientWidth;\n const calculatedWidth = Math.max(\n this.options.minThumbSize,\n trackWidth * (clientWidth / scrollWidth)\n );\n this.thumbX.style.width = `${calculatedWidth}px`;\n }\n }\n\n this.syncThumbs();\n }\n\n /**\n * D\u00E9filement programmatique direct ou liss\u00E9.\n */\n public scrollTo(target: ScrollToTarget, options?: { smooth?: boolean }): void {\n const prefersReducedMotion = typeof window !== 'undefined'\n && window.matchMedia\n && window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n\n const targetSmooth = typeof target === 'object' && target !== null && !(target instanceof HTMLElement)\n ? (target as ScrollToTargetOptions).smooth\n : undefined;\n const shouldSmooth = (options?.smooth ?? targetSmooth ?? true) && !prefersReducedMotion;\n const behavior: ScrollBehavior = shouldSmooth ? 'smooth' : 'auto';\n\n const maxTop = Math.max(0, this.viewport.scrollHeight - this.viewport.clientHeight);\n const maxLeft = Math.max(0, this.viewport.scrollWidth - this.viewport.clientWidth);\n\n let targetTop: number | undefined;\n let targetLeft: number | undefined;\n\n if (typeof target === 'number') {\n targetTop = target;\n } else if (typeof target === 'string') {\n switch (target) {\n case 'top':\n targetTop = 0;\n break;\n case 'bottom':\n targetTop = maxTop;\n break;\n case 'left':\n targetLeft = 0;\n break;\n case 'right':\n targetLeft = maxLeft;\n break;\n default: {\n if (/^-?\\d+(\\.\\d+)?%$/.test(target.trim())) {\n const pct = Math.max(0, Math.min(100, parseFloat(target.trim()))) / 100;\n if (this.options.axis === 'x') {\n targetLeft = maxLeft * pct;\n } else if (this.options.axis === 'both') {\n targetTop = maxTop * pct;\n targetLeft = maxLeft * pct;\n } else {\n targetTop = maxTop * pct;\n }\n break;\n }\n let el: HTMLElement | null = null;\n try {\n el = this.viewport.querySelector<HTMLElement>(target);\n } catch {\n el = null;\n }\n if (el) {\n targetTop = el.offsetTop;\n targetLeft = el.offsetLeft;\n }\n break;\n }\n }\n } else if (target instanceof HTMLElement) {\n targetTop = target.offsetTop;\n targetLeft = target.offsetLeft;\n } else if (typeof target === 'object') {\n targetTop = target.top;\n targetLeft = target.left;\n }\n\n this.viewport.scrollTo({\n top: targetTop !== undefined ? Math.max(0, Math.min(maxTop, targetTop)) : undefined,\n left: targetLeft !== undefined ? Math.max(0, Math.min(maxLeft, targetLeft)) : undefined,\n behavior\n });\n }\n\n /**\n * V\u00E9rifie la conformit\u00E9 d'accessibilit\u00E9 WAI-ARIA de la zone d\u00E9filable\n * et retourne la liste des contraintes manquantes.\n */\n public override audit(): string[] {\n const warnings: string[] = [];\n\n const hasViewportLabelledby = this.checkAriaIdReferences(this.viewport, 'aria-labelledby', warnings);\n const hasRootLabelledby = this.checkAriaIdReferences(this.root, 'aria-labelledby', warnings);\n const hasValidLabelledby = hasViewportLabelledby || hasRootLabelledby;\n\n const rootAriaLabel = this.root.getAttribute('aria-label')?.trim();\n const hasCustomViewportAriaLabel = !this.wasAriaLabelInferred && Boolean(this.viewport.getAttribute('aria-label')?.trim());\n\n if (!this.hasExplicitAriaLabel && !hasCustomViewportAriaLabel && !rootAriaLabel && !hasValidLabelledby) {\n warnings.push(\n 'Libell\u00E9 contextuel manquant : d\u00E9finissez l\\'option ariaLabel (ou un attribut aria-label / aria-labelledby sur le conteneur) pour d\u00E9crire la zone d\u00E9filable (WCAG 4.1.2).'\n );\n }\n\n if (this.options.minThumbSize < 24) {\n warnings.push(\n `Taille minimale du curseur insuffisante (minThumbSize: ${this.options.minThumbSize}px) : utilisez au moins 24px pour respecter WCAG 2.5.8.`\n );\n }\n\n return warnings;\n }\n\n protected override getAuditPrefix(): string {\n return 'Wulf.Scroll';\n }\n\n protected override getAuditTargetLabel(): string {\n return this.root.id ? `#${this.root.id}` : `<${this.root.tagName.toLowerCase()}.wulf-scrollblock>`;\n }\n\n /**\n * D\u00E9truit le composant et lib\u00E8re toutes les ressources.\n */\n public destroy(): void {\n this.clearAutoHideTimer();\n\n if (this.resizeObserver) {\n this.resizeObserver.disconnect();\n }\n\n this.viewport.removeEventListener('scroll', this.boundOnScroll);\n this.root.removeEventListener('mouseenter', this.boundOnMouseEnter);\n this.root.removeEventListener('mouseleave', this.boundOnMouseLeave);\n this.root.removeEventListener('focusin', this.boundOnFocusIn);\n this.root.removeEventListener('focusout', this.boundOnFocusOut);\n\n window.removeEventListener('pointermove', this.boundPointerMove);\n window.removeEventListener('pointerup', this.boundPointerUp);\n window.removeEventListener('pointercancel', this.boundPointerUp);\n\n this.trackY?.remove();\n this.trackX?.remove();\n\n this.root.classList.remove(\n 'wulf-scrollblock',\n 'has-scroll-y',\n 'has-scroll-x',\n 'has-both-axes',\n 'is-visible',\n 'is-scrolling',\n 'is-dragging',\n 'is-always-visible'\n );\n\n // Restauration du DOM d'origine si le viewport a \u00E9t\u00E9 cr\u00E9\u00E9 dynamiquement\n if (this.createdViewport && this.viewport.parentElement === this.root) {\n while (this.viewport.firstChild) {\n this.root.insertBefore(this.viewport.firstChild, this.viewport);\n }\n this.viewport.remove();\n } else {\n // Nettoyage des attributs ARIA inf\u00E9r\u00E9s sur un viewport pr\u00E9existant\n this.viewport.removeAttribute('tabindex');\n if (this.wasIdGenerated) {\n this.viewport.removeAttribute('id');\n }\n if (this.wasRoleInferred && this.viewport.getAttribute('role') === 'region') {\n this.viewport.removeAttribute('role');\n }\n if (this.wasAriaLabelInferred && this.viewport.getAttribute('aria-label') === this.lastInferredAriaLabel) {\n this.viewport.removeAttribute('aria-label');\n }\n }\n }\n }\n", "import { ScrollBlock } from './ScrollBlock';\nimport { scrollI18n } from './i18n';\n\nexport * from './types';\nexport * from './ScrollBlock';\nexport * from './i18n';\n\nexport const Scroll = {\n ScrollBlock,\n i18n: scrollI18n\n};\n\nexport { ScrollBlock };\nexport default ScrollBlock;\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 // Namespace sp\u00E9cifique et exclusif \u00E0 la librairie Scroll : Wulf.Scroll\n wulfNamespace.Scroll = Scroll;\n}\n"],
|
|
5
|
-
"mappings": ";AAmBO,IAAe,qBAAf,MAAwD;AAAA;AAAA;AAAA;AAAA,EAmBnD,sBAA8B;AACtC,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA,EAMU,gBAAgB,UAAmB,MAAgB;AAC3D,QAAI,CAAC,QAAS,QAAO,CAAC;AAEtB,UAAM,WAAW,KAAK,MAAM;AAC5B,QAAI,SAAS,SAAS,KAAK,OAAO,YAAY,eAAe,OAAO,QAAQ,SAAS,YAAY;AAC/F,cAAQ;AAAA,QACN,IAAI,KAAK,eAAe,CAAC,qCAA6B,SAAS,MAAM,mCAAmC,KAAK,oBAAoB,CAAC;AAAA,IAClI,SAAS,IAAI,CAAC,MAAM,OAAO,CAAC,EAAE,EAAE,KAAK,IAAI,IACzC;AAAA,GAAM,KAAK,oBAAoB,CAAC;AAAA,MAClC;AAAA,IACF;AACA,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA,EAMU,sBACR,SACA,UACA,UACS;AACT,UAAM,WAAW,QAAQ,aAAa,QAAQ,GAAG,KAAK;AACtD,QAAI,CAAC,SAAU,QAAO;AAEtB,UAAM,MAAM,QAAQ,iBAAiB;AACrC,UAAM,MAAM,SAAS,MAAM,KAAK,EAAE,OAAO,OAAO;AAChD,UAAM,UAAU,IAAI,SAAS,KAAK,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O;AAGX,gBAAc,SAAS;AACzB;",
|
|
4
|
+
"sourcesContent": ["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)\n * pointe vers des \u00E9l\u00E9ments r\u00E9ellement pr\u00E9sents dans le document.\n */\n protected checkAriaIdReferences(\n element: HTMLElement,\n attrName: 'aria-labelledby' | 'aria-describedby',\n warnings: string[]\n ): boolean {\n const rawValue = element.getAttribute(attrName)?.trim();\n if (!rawValue) return false;\n\n const doc = element.ownerDocument || document;\n const ids = rawValue.split(/\\s+/).filter(Boolean);\n const isValid = ids.length > 0 && ids.every((id) => Boolean(doc.getElementById(id)));\n\n if (!isValid) {\n warnings.push(\n `Attribut ${attrName}=\"${rawValue}\" invalide : l'\u00E9l\u00E9ment cible est introuvable dans le DOM.`\n );\n }\n\n return isValid;\n }\n}\n\n", "import { I18nManager } from './i18n';\nimport { AuditableComponent } from './AuditableComponent';\n\n/**\n * Classe de base abstraite factorisant l'ensemble des m\u00E9thodes statiques\n * de localisation, l'initialisation des surcharges d'instance et l'audit d'accessibilit\u00E9.\n */\nexport abstract class LocalizedComponent<TI18n extends object = any> extends AuditableComponent {\n protected static _i18n: I18nManager<any>;\n\n /**\n * D\u00E9finit la langue globale du composant (ex: 'fr', 'en', 'es').\n */\n public static setLocale(locale: string): void {\n if (this._i18n) {\n this._i18n.setLocale(locale);\n }\n }\n\n /**\n * Retourne la langue globale active du composant.\n */\n public static getLocale(): string {\n return this._i18n ? this._i18n.getLocale() : '';\n }\n\n /**\n * Enregistre un dictionnaire de traduction pour une langue donn\u00E9e.\n */\n public static registerLocale<T extends object>(\n this: { _i18n: I18nManager<T> },\n locale: string,\n translations: Partial<T>\n ): void {\n if (this._i18n) {\n this._i18n.registerLocale(locale, translations);\n }\n }\n\n /**\n * Surcharge les libell\u00E9s globalement pour ce composant.\n */\n public static setI18n<T extends object>(\n this: { _i18n: I18nManager<T> },\n overrides: Partial<T>\n ): void {\n if (this._i18n) {\n this._i18n.setI18n(overrides);\n }\n }\n\n /**\n * Retourne l'ensemble des libell\u00E9s actifs r\u00E9solus du composant.\n */\n public static getI18n<T extends object>(this: { _i18n: I18nManager<T> }): T {\n return this._i18n ? this._i18n.getAll() : ({} as T);\n }\n\n /**\n * R\u00E9initialise les r\u00E9glages de langue et surcharges globales.\n */\n public static resetI18n(): void {\n if (this._i18n) {\n this._i18n.reset();\n }\n }\n\n /**\n * R\u00E9sout une cl\u00E9 au niveau statique de la classe.\n */\n public static t<T extends object>(\n this: { _i18n: I18nManager<T> },\n key: keyof T,\n instanceOverride?: Partial<T>\n ): string {\n return this._i18n ? this._i18n.t(key, instanceOverride) : String(key);\n }\n\n /**\n * Surcharges de localisation sp\u00E9cifiques \u00E0 cette instance.\n */\n protected i18nOverrides?: Partial<TI18n>;\n\n constructor(i18nOverrides?: Partial<TI18n>) {\n super();\n this.i18nOverrides = i18nOverrides;\n }\n\n /**\n * Traduit une cl\u00E9 en tenant compte automatiquement des surcharges de l'instance courante.\n */\n protected t(key: keyof TI18n): string {\n const ctor = this.constructor as typeof LocalizedComponent;\n return ctor._i18n ? ctor._i18n.t(key as any, this.i18nOverrides) : String(key);\n }\n}\n\n", "/**\n * Micro-moteur i18n g\u00E9n\u00E9rique, ultra-l\u00E9ger et modulaire.\n * Con\u00E7u pour \u00EAtre r\u00E9utilis\u00E9 ind\u00E9pendamment par chaque librairie (tree-shaking et isolation totale).\n */\n\nexport interface I18nManager<T> {\n /**\n * D\u00E9finit la langue active (ex: 'fr', 'en', 'es').\n */\n setLocale(locale: string): void;\n\n /**\n * Renvoie la langue active courante.\n */\n getLocale(): string;\n\n /**\n * Enregistre ou met \u00E0 jour les traductions pour une langue donn\u00E9e.\n */\n registerLocale(locale: string, translations: Partial<T>): void;\n\n /**\n * Applique des surcharges globales prioritaires sur les libell\u00E9s actuels.\n */\n setI18n(overrides: Partial<T>): void;\n\n /**\n * R\u00E9sout une cl\u00E9 de traduction en cascade :\n * 1. Surcharge d'instance locale\n * 2. Surcharges globales (setI18n)\n * 3. Dictionnaire de la langue active\n * 4. Dictionnaire de repli (fallbackLocale)\n */\n t(key: keyof T, instanceOverride?: Partial<T>): string;\n\n /**\n * Renvoie l'int\u00E9gralit\u00E9 du dictionnaire r\u00E9solu.\n */\n getAll(instanceOverride?: Partial<T>): T;\n\n /**\n * R\u00E9initialise l'\u00E9tat aux r\u00E9glages initiaux (langue de base, sans surcharges).\n */\n reset(): void;\n}\n\nconst FORBIDDEN_KEYS = new Set(['__proto__', 'constructor', 'prototype']);\n\nfunction isSafeKey(key: string): boolean {\n return Boolean(key) && !FORBIDDEN_KEYS.has(key);\n}\n\nfunction normalizeLocaleCode(locale: string): string {\n const norm = String(locale ?? '').trim().toLowerCase().replace(/_/g, '-');\n return isSafeKey(norm) ? norm : '';\n}\n\nfunction getPrimaryLanguage(normalizedLocale: string): string | null {\n const dashIndex = normalizedLocale.indexOf('-');\n const primary = dashIndex > 0 ? normalizedLocale.slice(0, dashIndex) : null;\n return primary && isSafeKey(primary) ? primary : null;\n}\n\nfunction assignDefined<T extends object>(target: Partial<T>, source?: Partial<T>): Partial<T> {\n if (!source || typeof source !== 'object') return target;\n for (const key of Object.keys(source) as Array<keyof T>) {\n if (\n isSafeKey(String(key)) &&\n Object.prototype.hasOwnProperty.call(source, key) &&\n source[key] !== undefined\n ) {\n target[key] = source[key];\n }\n }\n return target;\n}\n\nexport function createI18nManager<T extends object>(\n defaultLocale: string,\n locales: Record<string, T>\n): I18nManager<T> {\n const fallbackLocale = normalizeLocaleCode(defaultLocale) || 'fr';\n const initialLocales: Record<string, T> = Object.create(null);\n for (const [loc, dict] of Object.entries(locales)) {\n const norm = normalizeLocaleCode(loc);\n if (norm) {\n initialLocales[norm] = assignDefined(Object.create(null), dict) as T;\n }\n }\n\n let currentLocale = fallbackLocale;\n let activeLocales: Record<string, Partial<T>> = Object.create(null);\n for (const [loc, dict] of Object.entries(initialLocales)) {\n activeLocales[loc] = assignDefined(Object.create(null), dict);\n }\n let globalOverrides: Partial<T> = Object.create(null);\n\n function resolveActiveDictionaries(): Array<Partial<T>> {\n const dicts: Array<Partial<T>> = [];\n if (isSafeKey(currentLocale)) {\n const exact = activeLocales[currentLocale];\n if (exact) dicts.push(exact);\n }\n\n const primary = getPrimaryLanguage(currentLocale);\n if (primary && activeLocales[primary]) {\n dicts.push(activeLocales[primary]);\n }\n return dicts;\n }\n\n return {\n setLocale(locale: string): void {\n if (locale && typeof locale === 'string' && locale.trim()) {\n const norm = normalizeLocaleCode(locale);\n if (norm) {\n currentLocale = norm;\n }\n }\n },\n\n getLocale(): string {\n return currentLocale;\n },\n\n registerLocale(locale: string, translations: Partial<T>): void {\n if (!locale || typeof locale !== 'string' || !locale.trim() || !translations) return;\n const norm = normalizeLocaleCode(locale);\n if (!norm) return;\n const base = assignDefined(Object.create(null), activeLocales[norm]);\n activeLocales[norm] = assignDefined(base, translations);\n },\n\n setI18n(overrides: Partial<T>): void {\n if (!overrides || typeof overrides !== 'object') return;\n const base = assignDefined(Object.create(null), globalOverrides);\n globalOverrides = assignDefined(base, overrides);\n },\n\n t(key: keyof T, instanceOverride?: Partial<T>): string {\n if (!isSafeKey(String(key))) {\n return '';\n }\n\n // 1. Priorit\u00E9 instance\n if (\n instanceOverride &&\n typeof instanceOverride === 'object' &&\n Object.prototype.hasOwnProperty.call(instanceOverride, key) &&\n instanceOverride[key] !== undefined\n ) {\n return String(instanceOverride[key]);\n }\n\n // 2. Priorit\u00E9 surcharge globale\n if (globalOverrides[key] !== undefined) {\n return String(globalOverrides[key]);\n }\n\n // 3. Langue active (exacte ex: 'en-us', puis primaire ex: 'en')\n for (const dict of resolveActiveDictionaries()) {\n if (dict[key] !== undefined) {\n return String(dict[key]);\n }\n }\n\n // 4. Langue de repli (fallback)\n const fallbackDict = activeLocales[fallbackLocale] || initialLocales[fallbackLocale];\n if (fallbackDict && fallbackDict[key] !== undefined) {\n return String(fallbackDict[key]);\n }\n\n return String(key);\n },\n\n getAll(instanceOverride?: Partial<T>): T {\n const result: Partial<T> = {};\n const fallback = activeLocales[fallbackLocale] || initialLocales[fallbackLocale];\n assignDefined(result, fallback);\n\n // Du moins sp\u00E9cifique (langue primaire) au plus sp\u00E9cifique (locale exacte)\n const activeDicts = resolveActiveDictionaries().reverse();\n for (const dict of activeDicts) {\n assignDefined(result, dict);\n }\n\n assignDefined(result, globalOverrides);\n assignDefined(result, instanceOverride);\n return result as T;\n },\n\n reset(): void {\n currentLocale = fallbackLocale;\n globalOverrides = Object.create(null);\n activeLocales = Object.create(null);\n for (const [loc, dict] of Object.entries(initialLocales)) {\n activeLocales[loc] = assignDefined(Object.create(null), dict);\n }\n }\n };\n}\n", "import { ScrollI18n } from './types';\n\nexport const scrollFr: ScrollI18n = {\n viewport: 'Zone de contenu d\u00E9filable',\n verticalThumb: 'D\u00E9filement vertical',\n horizontalThumb: 'D\u00E9filement horizontal'\n};\n\n", "import { ScrollI18n } from './types';\n\nexport const scrollEn: ScrollI18n = {\n viewport: 'Scrollable content area',\n verticalThumb: 'Vertical scroll',\n horizontalThumb: 'Horizontal scroll'\n};\n\n", "import { createI18nManager, I18nManager } from '../../common/i18n';\nimport { LocalizedComponent } from '../../common/LocalizedComponent';\nimport { ScrollI18n } from './types';\nimport { scrollFr } from './fr';\nimport { scrollEn } from './en';\n\nexport type { I18nManager };\nexport { createI18nManager, LocalizedComponent };\nexport * from './types';\nexport * from './fr';\nexport * from './en';\n\nexport const scrollI18n: I18nManager<ScrollI18n> = createI18nManager<ScrollI18n>('fr', {\n fr: scrollFr,\n en: scrollEn\n});\n\n", "import {\n ScrollBlockOptions,\n ScrollInfo,\n ScrollToTarget,\n ScrollToTargetOptions,\n IScrollBlock\n} from './types';\nimport { LocalizedComponent } from '../common/LocalizedComponent';\nimport { scrollI18n, ScrollI18n } from './i18n';\n\nlet idCounter = 0;\n\n/**\n * ScrollBlock - Alternative accessible, moderne et ultra-l\u00E9g\u00E8re \u00E0 malihu-custom-scrollbar-plugin.\n * Repose sur le d\u00E9filement natif du navigateur avec synchronisation GPU sans reflow.\n */\nexport class ScrollBlock extends LocalizedComponent<ScrollI18n> implements IScrollBlock {\n protected static override _i18n = scrollI18n;\n public static readonly i18n = scrollI18n;\n\n public readonly root: HTMLElement;\n public readonly viewport: HTMLElement;\n\n private options: Required<ScrollBlockOptions>;\n private createdViewport: boolean = false;\n private wasIdGenerated: boolean = false;\n private wasRoleInferred: boolean = false;\n private wasAriaLabelInferred: boolean = false;\n private hasExplicitAriaLabel: boolean = false;\n private lastInferredAriaLabel: string = '';\n\n private trackY?: HTMLElement;\n private thumbY?: HTMLElement;\n private trackX?: HTMLElement;\n private thumbX?: HTMLElement;\n\n private resizeObserver?: ResizeObserver;\n private hideTimer?: number;\n\n private isDragging: boolean = false;\n private dragAxis?: 'y' | 'x';\n private dragPointerId?: number;\n private dragStartPos: number = 0;\n private dragStartScroll: number = 0;\n\n private atBottom: boolean = false;\n private atTop: boolean = true;\n private atRight: boolean = false;\n private atLeft: boolean = true;\n\n // R\u00E9f\u00E9rences d'\u00E9couteurs d'\u00E9v\u00E9nements pour le nettoyage\n private boundOnScroll: () => void;\n private boundOnMouseEnter: () => void;\n private boundOnMouseLeave: () => void;\n private boundOnFocusIn: () => void;\n private boundOnFocusOut: () => void;\n private boundPointerMove: (e: PointerEvent) => void;\n private boundPointerUp: (e: PointerEvent) => void;\n\n constructor(element: HTMLElement | string, options?: ScrollBlockOptions) {\n super(options?.i18n);\n\n let resolvedElement: HTMLElement | null = null;\n if (typeof element === 'string') {\n try {\n resolvedElement = document.querySelector<HTMLElement>(element);\n } catch {\n resolvedElement = null;\n }\n } else {\n resolvedElement = element;\n }\n\n if (!resolvedElement || !(resolvedElement instanceof HTMLElement)) {\n throw new Error(`[ScrollBlock] \u00C9l\u00E9ment introuvable : \"${element}\".`);\n }\n\n this.root = resolvedElement;\n this.hasExplicitAriaLabel = Boolean(options?.ariaLabel || options?.i18n?.viewport);\n\n const rawDelay = options?.autoHideDelay;\n const safeAutoHideDelay = typeof rawDelay === 'number' && Number.isFinite(rawDelay) && rawDelay >= 0 ? rawDelay : 1000;\n const rawMinThumb = options?.minThumbSize;\n const safeMinThumbSize = typeof rawMinThumb === 'number' && Number.isFinite(rawMinThumb) && rawMinThumb > 0 ? rawMinThumb : 24;\n const rawEdge = options?.edgeThreshold;\n const safeEdgeThreshold = typeof rawEdge === 'number' && Number.isFinite(rawEdge) && rawEdge >= 0 ? rawEdge : 10;\n\n // Options par d\u00E9faut\n this.options = {\n axis: options?.axis || 'y',\n autoHide: options?.autoHide ?? true,\n autoHideDelay: safeAutoHideDelay,\n alwaysVisible: options?.alwaysVisible ?? false,\n ariaLabel: options?.ariaLabel || this.t('viewport'),\n i18n: options?.i18n || {},\n minThumbSize: safeMinThumbSize,\n edgeThreshold: safeEdgeThreshold,\n onScroll: options?.onScroll || (() => { }),\n onTotalScroll: options?.onTotalScroll || (() => { }),\n onTotalScrollBack: options?.onTotalScrollBack || (() => { }),\n audit: options?.audit ?? true\n };\n\n // Liaison des m\u00E9thodes\n this.boundOnScroll = this.handleScroll.bind(this);\n this.boundOnMouseEnter = this.handleMouseEnter.bind(this);\n this.boundOnMouseLeave = this.handleMouseLeave.bind(this);\n this.boundOnFocusIn = this.handleFocusIn.bind(this);\n this.boundOnFocusOut = this.handleFocusOut.bind(this);\n this.boundPointerMove = this.handlePointerMove.bind(this);\n this.boundPointerUp = this.handlePointerUp.bind(this);\n\n // Initialisation du DOM et du viewport\n this.viewport = this.setupViewport();\n this.setupAccessibility();\n this.setupScrollbars();\n this.setupEventListeners();\n this.setupObserver();\n\n // Premier calcul\n this.update();\n\n this.runAuditWarning(this.options.audit);\n }\n\n /**\n * Pr\u00E9pare le viewport d\u00E9filant sans alt\u00E9rer les \u00E9l\u00E9ments enfants.\n */\n private setupViewport(): HTMLElement {\n this.root.classList.add('wulf-scrollblock');\n\n if (this.options.alwaysVisible) {\n this.root.classList.add('is-always-visible');\n }\n\n if (this.options.axis === 'both') {\n this.root.classList.add('has-both-axes');\n }\n\n // R\u00E9utilisation d'un viewport existant ou cr\u00E9ation transparente\n const existingViewport = this.root.querySelector<HTMLElement>(':scope > .wulf-scrollblock-viewport');\n if (existingViewport) {\n return existingViewport;\n }\n\n const viewport = document.createElement('div');\n viewport.className = 'wulf-scrollblock-viewport';\n\n // D\u00E9placement des enfants existants dans le viewport\n while (this.root.firstChild) {\n viewport.appendChild(this.root.firstChild);\n }\n\n this.root.appendChild(viewport);\n this.createdViewport = true;\n return viewport;\n }\n\n /**\n * Configure les attributs WAI-ARIA pour une accessibilit\u00E9 maximale.\n */\n private setupAccessibility(): void {\n if (!this.viewport.id) {\n idCounter += 1;\n this.viewport.id = `wulf-scrollblock-vp-${idCounter}`;\n this.wasIdGenerated = true;\n }\n\n if (!this.viewport.hasAttribute('role')) {\n this.viewport.setAttribute('role', 'region');\n this.wasRoleInferred = true;\n }\n\n if (!this.viewport.hasAttribute('aria-label')) {\n const label = this.hasExplicitAriaLabel ? this.options.ariaLabel : this.t('viewport');\n this.viewport.setAttribute('aria-label', label);\n this.lastInferredAriaLabel = label;\n this.wasAriaLabelInferred = true;\n }\n }\n\n /**\n * Synchronise dynamiquement les libell\u00E9s ARIA si la langue globale change apr\u00E8s montage.\n */\n private syncAccessibilityLabels(): void {\n if (this.wasAriaLabelInferred && !this.hasExplicitAriaLabel) {\n const currentAttr = this.viewport.getAttribute('aria-label');\n if (currentAttr === this.lastInferredAriaLabel) {\n const nextLabel = this.t('viewport');\n this.viewport.setAttribute('aria-label', nextLabel);\n this.lastInferredAriaLabel = nextLabel;\n this.options.ariaLabel = nextLabel;\n }\n }\n if (this.thumbY) {\n this.thumbY.setAttribute('aria-label', this.t('verticalThumb'));\n }\n if (this.thumbX) {\n this.thumbX.setAttribute('aria-label', this.t('horizontalThumb'));\n }\n }\n\n /**\n * Cr\u00E9e les rails et curseurs selon l'axe s\u00E9lectionn\u00E9.\n */\n private setupScrollbars(): void {\n if (this.options.axis === 'y' || this.options.axis === 'both') {\n this.trackY = document.createElement('div');\n this.trackY.className = 'wulf-scrollblock-track wulf-scrollblock-vertical';\n this.trackY.setAttribute('aria-hidden', 'true');\n\n this.thumbY = document.createElement('div');\n this.thumbY.className = 'wulf-scrollblock-thumb';\n this.thumbY.setAttribute('role', 'scrollbar');\n this.thumbY.setAttribute('aria-orientation', 'vertical');\n this.thumbY.setAttribute('aria-controls', this.viewport.id);\n this.thumbY.setAttribute('aria-valuenow', '0');\n this.thumbY.setAttribute('aria-valuemin', '0');\n this.thumbY.setAttribute('aria-valuemax', '100');\n this.thumbY.setAttribute('aria-label', this.t('verticalThumb'));\n\n this.trackY.appendChild(this.thumbY);\n this.root.appendChild(this.trackY);\n\n this.attachTrackListeners(this.trackY, this.thumbY, 'y');\n }\n\n if (this.options.axis === 'x' || this.options.axis === 'both') {\n this.trackX = document.createElement('div');\n this.trackX.className = 'wulf-scrollblock-track wulf-scrollblock-horizontal';\n this.trackX.setAttribute('aria-hidden', 'true');\n\n this.thumbX = document.createElement('div');\n this.thumbX.className = 'wulf-scrollblock-thumb';\n this.thumbX.setAttribute('role', 'scrollbar');\n this.thumbX.setAttribute('aria-orientation', 'horizontal');\n this.thumbX.setAttribute('aria-controls', this.viewport.id);\n this.thumbX.setAttribute('aria-valuenow', '0');\n this.thumbX.setAttribute('aria-valuemin', '0');\n this.thumbX.setAttribute('aria-valuemax', '100');\n this.thumbX.setAttribute('aria-label', this.t('horizontalThumb'));\n\n this.trackX.appendChild(this.thumbX);\n this.root.appendChild(this.trackX);\n\n this.attachTrackListeners(this.trackX, this.thumbX, 'x');\n }\n }\n\n /**\n * Attache les \u00E9couteurs sur un rail et son curseur.\n */\n private attachTrackListeners(track: HTMLElement, thumb: HTMLElement, axis: 'y' | 'x'): void {\n thumb.addEventListener('pointerdown', (e: PointerEvent) => {\n e.preventDefault();\n e.stopPropagation();\n\n this.isDragging = true;\n this.dragAxis = axis;\n this.dragPointerId = e.pointerId;\n this.dragStartPos = axis === 'y' ? e.clientY : e.clientX;\n this.dragStartScroll = axis === 'y' ? this.viewport.scrollTop : this.viewport.scrollLeft;\n\n thumb.setPointerCapture(e.pointerId);\n thumb.classList.add('is-active');\n this.root.classList.add('is-dragging');\n\n // Liaison dynamique sur window uniquement pendant la dur\u00E9e active du drag\n window.addEventListener('pointermove', this.boundPointerMove);\n window.addEventListener('pointerup', this.boundPointerUp);\n window.addEventListener('pointercancel', this.boundPointerUp);\n });\n\n // Clic direct sur le rail (hors dragger)\n track.addEventListener('pointerdown', (e: PointerEvent) => {\n if (e.target === thumb) return;\n e.preventDefault();\n\n const rect = track.getBoundingClientRect();\n const clickPos = axis === 'y' ? (e.clientY - rect.top) : (e.clientX - rect.left);\n const trackSize = axis === 'y' ? rect.height : rect.width;\n const clientSize = axis === 'y' ? this.viewport.clientHeight : this.viewport.clientWidth;\n const scrollSize = axis === 'y' ? this.viewport.scrollHeight : this.viewport.scrollWidth;\n\n const ratio = clickPos / trackSize;\n const targetScroll = ratio * (scrollSize - clientSize);\n\n this.scrollTo(axis === 'y' ? { top: targetScroll } : { left: targetScroll }, { smooth: true });\n });\n }\n\n /**\n * \u00C9couteurs globaux sur le viewport et les interactions.\n */\n private setupEventListeners(): void {\n this.viewport.addEventListener('scroll', this.boundOnScroll, { passive: true });\n\n if (this.options.autoHide && !this.options.alwaysVisible) {\n this.root.addEventListener('mouseenter', this.boundOnMouseEnter);\n this.root.addEventListener('mouseleave', this.boundOnMouseLeave);\n this.root.addEventListener('focusin', this.boundOnFocusIn);\n this.root.addEventListener('focusout', this.boundOnFocusOut);\n }\n }\n\n /**\n * Initialise le ResizeObserver r\u00E9actif.\n */\n private setupObserver(): void {\n if (typeof ResizeObserver !== 'undefined') {\n this.resizeObserver = new ResizeObserver(() => {\n window.requestAnimationFrame(() => this.update());\n });\n this.resizeObserver.observe(this.root);\n this.resizeObserver.observe(this.viewport);\n if (this.viewport.firstElementChild) {\n this.resizeObserver.observe(this.viewport.firstElementChild);\n }\n }\n }\n\n /**\n * D\u00E9placement lors du glissement du curseur.\n */\n private handlePointerMove(e: PointerEvent): void {\n if (!this.isDragging || !this.dragAxis) return;\n\n const isY = this.dragAxis === 'y';\n const delta = (isY ? e.clientY : e.clientX) - this.dragStartPos;\n const track = isY ? this.trackY : this.trackX;\n const thumb = isY ? this.thumbY : this.thumbX;\n\n if (!track || !thumb) return;\n\n const trackSize = isY ? track.clientHeight : track.clientWidth;\n const thumbSize = isY ? thumb.clientHeight : thumb.clientWidth;\n const clientSize = isY ? this.viewport.clientHeight : this.viewport.clientWidth;\n const scrollSize = isY ? this.viewport.scrollHeight : this.viewport.scrollWidth;\n\n const maxScroll = scrollSize - clientSize;\n const maxThumbTravel = trackSize - thumbSize;\n\n if (maxThumbTravel <= 0 || maxScroll <= 0) return;\n\n const ratio = maxScroll / maxThumbTravel;\n const nextScroll = this.dragStartScroll + delta * ratio;\n\n if (isY) {\n this.viewport.scrollTop = Math.max(0, Math.min(maxScroll, nextScroll));\n } else {\n this.viewport.scrollLeft = Math.max(0, Math.min(maxScroll, nextScroll));\n }\n }\n\n /**\n * Rel\u00E2chement de la capture du pointeur.\n */\n private handlePointerUp(e: PointerEvent): void {\n if (!this.isDragging) return;\n\n if (this.dragPointerId !== undefined) {\n const activeThumb = this.dragAxis === 'y' ? this.thumbY : this.thumbX;\n if (activeThumb && activeThumb.hasPointerCapture(this.dragPointerId)) {\n activeThumb.releasePointerCapture(this.dragPointerId);\n }\n }\n\n // D\u00E9tachement imm\u00E9diat des \u00E9couteurs globaux\n window.removeEventListener('pointermove', this.boundPointerMove);\n window.removeEventListener('pointerup', this.boundPointerUp);\n window.removeEventListener('pointercancel', this.boundPointerUp);\n\n this.isDragging = false;\n this.dragAxis = undefined;\n this.dragPointerId = undefined;\n\n this.thumbY?.classList.remove('is-active');\n this.thumbX?.classList.remove('is-active');\n this.root.classList.remove('is-dragging');\n\n this.scheduleAutoHide();\n }\n\n /**\n * Gestionnaire d'\u00E9v\u00E9nement de d\u00E9filement natif.\n */\n private handleScroll(): void {\n this.syncThumbs();\n\n const { scrollTop, scrollLeft, scrollHeight, scrollWidth, clientHeight, clientWidth } = this.viewport;\n const maxTop = Math.max(0, scrollHeight - clientHeight);\n const maxLeft = Math.max(0, scrollWidth - clientWidth);\n\n const progressY = maxTop > 0 ? (scrollTop / maxTop) : 0;\n const progressX = maxLeft > 0 ? (scrollLeft / maxLeft) : 0;\n\n // D\u00E9clenchement du callback onScroll\n this.options.onScroll({\n top: scrollTop,\n left: scrollLeft,\n maxTop,\n maxLeft,\n progressY: Math.round(progressY * 100),\n progressX: Math.round(progressX * 100)\n });\n\n // D\u00E9tection des extr\u00E9mit\u00E9s (infinite scroll / edge callbacks)\n const threshold = this.options.edgeThreshold;\n\n if (maxTop > 0) {\n const nowBottom = scrollTop >= maxTop - threshold;\n const nowTop = scrollTop <= threshold;\n\n if (nowBottom && !this.atBottom) {\n this.options.onTotalScroll('bottom');\n }\n if (nowTop && !this.atTop) {\n this.options.onTotalScrollBack('top');\n }\n\n this.atBottom = nowBottom;\n this.atTop = nowTop;\n }\n\n if (maxLeft > 0) {\n const nowRight = scrollLeft >= maxLeft - threshold;\n const nowLeft = scrollLeft <= threshold;\n\n if (nowRight && !this.atRight) {\n this.options.onTotalScroll('right');\n }\n if (nowLeft && !this.atLeft) {\n this.options.onTotalScrollBack('left');\n }\n\n this.atRight = nowRight;\n this.atLeft = nowLeft;\n }\n\n // Gestion de l'affichage pendant le scroll\n if (this.options.autoHide && !this.options.alwaysVisible) {\n this.root.classList.add('is-scrolling');\n this.scheduleAutoHide();\n }\n }\n\n /**\n * Synchronise la position physique et ARIA des curseurs.\n */\n private syncThumbs(): void {\n const { scrollTop, scrollLeft, scrollHeight, scrollWidth, clientHeight, clientWidth } = this.viewport;\n\n // Axe Y\n if (this.thumbY && this.trackY) {\n const maxScrollY = scrollHeight - clientHeight;\n const trackHeight = this.trackY.clientHeight;\n const thumbHeight = this.thumbY.clientHeight;\n const maxTravelY = trackHeight - thumbHeight;\n\n if (maxScrollY > 0 && maxTravelY > 0) {\n const ratioY = scrollTop / maxScrollY;\n const posY = Math.max(0, Math.min(maxTravelY, ratioY * maxTravelY));\n this.thumbY.style.transform = `translate3d(0, ${posY}px, 0)`;\n this.thumbY.setAttribute('aria-valuenow', String(Math.round(ratioY * 100)));\n }\n }\n\n // Axe X\n if (this.thumbX && this.trackX) {\n const maxScrollX = scrollWidth - clientWidth;\n const trackWidth = this.trackX.clientWidth;\n const thumbWidth = this.thumbX.clientWidth;\n const maxTravelX = trackWidth - thumbWidth;\n\n if (maxScrollX > 0 && maxTravelX > 0) {\n const ratioX = scrollLeft / maxScrollX;\n const posX = Math.max(0, Math.min(maxTravelX, ratioX * maxTravelX));\n this.thumbX.style.transform = `translate3d(${posX}px, 0, 0)`;\n this.thumbX.setAttribute('aria-valuenow', String(Math.round(ratioX * 100)));\n }\n }\n }\n\n private handleMouseEnter(): void {\n this.root.classList.add('is-visible');\n this.clearAutoHideTimer();\n }\n\n private handleMouseLeave(): void {\n this.scheduleAutoHide();\n }\n\n private handleFocusIn(): void {\n this.root.classList.add('is-visible');\n this.clearAutoHideTimer();\n }\n\n private handleFocusOut(): void {\n this.scheduleAutoHide();\n }\n\n private clearAutoHideTimer(): void {\n if (this.hideTimer) {\n window.clearTimeout(this.hideTimer);\n this.hideTimer = undefined;\n }\n }\n\n private scheduleAutoHide(): void {\n if (this.options.alwaysVisible || !this.options.autoHide || this.isDragging) return;\n this.clearAutoHideTimer();\n\n this.hideTimer = window.setTimeout(() => {\n this.root.classList.remove('is-scrolling');\n this.root.classList.remove('is-visible');\n }, this.options.autoHideDelay);\n }\n\n /**\n * Recalcule les dimensions et la visibilit\u00E9 des barres.\n */\n public update(): void {\n this.syncAccessibilityLabels();\n const { scrollHeight, clientHeight, scrollWidth, clientWidth } = this.viewport;\n\n const canScrollY = scrollHeight > clientHeight;\n const canScrollX = scrollWidth > clientWidth;\n\n // Gestion de la classe CSS de scrollabilit\u00E9\n this.root.classList.toggle('has-scroll-y', canScrollY);\n this.root.classList.toggle('has-scroll-x', canScrollX);\n\n // WCAG 2.1.1 : tabindex=\"0\" uniquement si le contenu d\u00E9borde\n if (canScrollY || canScrollX) {\n this.viewport.setAttribute('tabindex', '0');\n } else {\n this.viewport.removeAttribute('tabindex');\n }\n\n // Mise \u00E0 jour taille du thumb Y\n if (this.trackY && this.thumbY) {\n if (canScrollY) {\n const trackHeight = this.trackY.clientHeight;\n const calculatedHeight = Math.max(\n this.options.minThumbSize,\n trackHeight * (clientHeight / scrollHeight)\n );\n this.thumbY.style.height = `${calculatedHeight}px`;\n }\n }\n\n // Mise \u00E0 jour taille du thumb X\n if (this.trackX && this.thumbX) {\n if (canScrollX) {\n const trackWidth = this.trackX.clientWidth;\n const calculatedWidth = Math.max(\n this.options.minThumbSize,\n trackWidth * (clientWidth / scrollWidth)\n );\n this.thumbX.style.width = `${calculatedWidth}px`;\n }\n }\n\n this.syncThumbs();\n }\n\n /**\n * D\u00E9filement programmatique direct ou liss\u00E9.\n */\n public scrollTo(target: ScrollToTarget, options?: { smooth?: boolean }): void {\n const prefersReducedMotion = typeof window !== 'undefined'\n && window.matchMedia\n && window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n\n const targetSmooth = typeof target === 'object' && target !== null && !(target instanceof HTMLElement)\n ? (target as ScrollToTargetOptions).smooth\n : undefined;\n const shouldSmooth = (options?.smooth ?? targetSmooth ?? true) && !prefersReducedMotion;\n const behavior: ScrollBehavior = shouldSmooth ? 'smooth' : 'auto';\n\n const maxTop = Math.max(0, this.viewport.scrollHeight - this.viewport.clientHeight);\n const maxLeft = Math.max(0, this.viewport.scrollWidth - this.viewport.clientWidth);\n\n let targetTop: number | undefined;\n let targetLeft: number | undefined;\n\n if (typeof target === 'number') {\n targetTop = target;\n } else if (typeof target === 'string') {\n switch (target) {\n case 'top':\n targetTop = 0;\n break;\n case 'bottom':\n targetTop = maxTop;\n break;\n case 'left':\n targetLeft = 0;\n break;\n case 'right':\n targetLeft = maxLeft;\n break;\n default: {\n if (/^-?\\d+(\\.\\d+)?%$/.test(target.trim())) {\n const pct = Math.max(0, Math.min(100, parseFloat(target.trim()))) / 100;\n if (this.options.axis === 'x') {\n targetLeft = maxLeft * pct;\n } else if (this.options.axis === 'both') {\n targetTop = maxTop * pct;\n targetLeft = maxLeft * pct;\n } else {\n targetTop = maxTop * pct;\n }\n break;\n }\n let el: HTMLElement | null = null;\n try {\n el = this.viewport.querySelector<HTMLElement>(target);\n } catch {\n el = null;\n }\n if (el) {\n targetTop = el.offsetTop;\n targetLeft = el.offsetLeft;\n }\n break;\n }\n }\n } else if (target instanceof HTMLElement) {\n targetTop = target.offsetTop;\n targetLeft = target.offsetLeft;\n } else if (typeof target === 'object') {\n targetTop = target.top;\n targetLeft = target.left;\n }\n\n this.viewport.scrollTo({\n top: targetTop !== undefined && Number.isFinite(targetTop) ? Math.max(0, Math.min(maxTop, targetTop)) : undefined,\n left: targetLeft !== undefined && Number.isFinite(targetLeft) ? Math.max(0, Math.min(maxLeft, targetLeft)) : undefined,\n behavior\n });\n }\n\n /**\n * V\u00E9rifie la conformit\u00E9 d'accessibilit\u00E9 WAI-ARIA de la zone d\u00E9filable\n * et retourne la liste des contraintes manquantes.\n */\n public override audit(): string[] {\n const warnings: string[] = [];\n\n const hasViewportLabelledby = this.checkAriaIdReferences(this.viewport, 'aria-labelledby', warnings);\n const hasRootLabelledby = this.checkAriaIdReferences(this.root, 'aria-labelledby', warnings);\n const hasValidLabelledby = hasViewportLabelledby || hasRootLabelledby;\n\n const rootAriaLabel = this.root.getAttribute('aria-label')?.trim();\n const hasCustomViewportAriaLabel = !this.wasAriaLabelInferred && Boolean(this.viewport.getAttribute('aria-label')?.trim());\n\n if (!this.hasExplicitAriaLabel && !hasCustomViewportAriaLabel && !rootAriaLabel && !hasValidLabelledby) {\n warnings.push(\n 'Libell\u00E9 contextuel manquant : d\u00E9finissez l\\'option ariaLabel (ou un attribut aria-label / aria-labelledby sur le conteneur) pour d\u00E9crire la zone d\u00E9filable (WCAG 4.1.2).'\n );\n }\n\n if (this.options.minThumbSize < 24) {\n warnings.push(\n `Taille minimale du curseur insuffisante (minThumbSize: ${this.options.minThumbSize}px) : utilisez au moins 24px pour respecter WCAG 2.5.8.`\n );\n }\n\n return warnings;\n }\n\n protected override getAuditPrefix(): string {\n return 'Wulf.Scroll';\n }\n\n protected override getAuditTargetLabel(): string {\n return this.root.id ? `#${this.root.id}` : `<${this.root.tagName.toLowerCase()}.wulf-scrollblock>`;\n }\n\n /**\n * D\u00E9truit le composant et lib\u00E8re toutes les ressources.\n */\n public destroy(): void {\n this.clearAutoHideTimer();\n\n if (this.resizeObserver) {\n this.resizeObserver.disconnect();\n }\n\n this.viewport.removeEventListener('scroll', this.boundOnScroll);\n this.root.removeEventListener('mouseenter', this.boundOnMouseEnter);\n this.root.removeEventListener('mouseleave', this.boundOnMouseLeave);\n this.root.removeEventListener('focusin', this.boundOnFocusIn);\n this.root.removeEventListener('focusout', this.boundOnFocusOut);\n\n window.removeEventListener('pointermove', this.boundPointerMove);\n window.removeEventListener('pointerup', this.boundPointerUp);\n window.removeEventListener('pointercancel', this.boundPointerUp);\n\n this.trackY?.remove();\n this.trackX?.remove();\n\n this.root.classList.remove(\n 'wulf-scrollblock',\n 'has-scroll-y',\n 'has-scroll-x',\n 'has-both-axes',\n 'is-visible',\n 'is-scrolling',\n 'is-dragging',\n 'is-always-visible'\n );\n\n // Restauration du DOM d'origine si le viewport a \u00E9t\u00E9 cr\u00E9\u00E9 dynamiquement\n if (this.createdViewport && this.viewport.parentElement === this.root) {\n while (this.viewport.firstChild) {\n this.root.insertBefore(this.viewport.firstChild, this.viewport);\n }\n this.viewport.remove();\n } else {\n // Nettoyage des attributs ARIA inf\u00E9r\u00E9s sur un viewport pr\u00E9existant\n this.viewport.removeAttribute('tabindex');\n if (this.wasIdGenerated) {\n this.viewport.removeAttribute('id');\n }\n if (this.wasRoleInferred && this.viewport.getAttribute('role') === 'region') {\n this.viewport.removeAttribute('role');\n }\n if (this.wasAriaLabelInferred && this.viewport.getAttribute('aria-label') === this.lastInferredAriaLabel) {\n this.viewport.removeAttribute('aria-label');\n }\n }\n }\n }\n", "import { ScrollBlock } from './ScrollBlock';\nimport { scrollI18n } from './i18n';\n\nexport * from './types';\nexport * from './ScrollBlock';\nexport * from './i18n';\n\nexport const Scroll = {\n ScrollBlock,\n i18n: scrollI18n\n};\n\nexport { ScrollBlock };\nexport default ScrollBlock;\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 // Namespace sp\u00E9cifique et exclusif \u00E0 la librairie Scroll : Wulf.Scroll\n wulfNamespace.Scroll = Scroll;\n}\n"],
|
|
5
|
+
"mappings": ";AAmBO,IAAe,qBAAf,MAAwD;AAAA;AAAA;AAAA;AAAA,EAmBnD,sBAA8B;AACtC,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA,EAMU,gBAAgB,UAAmB,MAAgB;AAC3D,QAAI,CAAC,QAAS,QAAO,CAAC;AAEtB,UAAM,WAAW,KAAK,MAAM;AAC5B,QAAI,SAAS,SAAS,KAAK,OAAO,YAAY,eAAe,OAAO,QAAQ,SAAS,YAAY;AAC/F,cAAQ;AAAA,QACN,IAAI,KAAK,eAAe,CAAC,qCAA6B,SAAS,MAAM,mCAAmC,KAAK,oBAAoB,CAAC;AAAA,IAClI,SAAS,IAAI,CAAC,MAAM,OAAO,CAAC,EAAE,EAAE,KAAK,IAAI,IACzC;AAAA,GAAM,KAAK,oBAAoB,CAAC;AAAA,MAClC;AAAA,IACF;AACA,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA,EAMU,sBACR,SACA,UACA,UACS;AACT,UAAM,WAAW,QAAQ,aAAa,QAAQ,GAAG,KAAK;AACtD,QAAI,CAAC,SAAU,QAAO;AAEtB,UAAM,MAAM,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S,aAAa,YAAY,MAAM,KAAK,uBAAuB;AACxG,aAAK,SAAS,gBAAgB,YAAY;AAAA,MAC5C;AAAA,IACF;AAAA,EACF;AACF;AA9sBW,YACe,QAAQ;AADvB,YAEY,OAAO;;;ACXzB,IAAM,SAAS;AAAA,EACpB;AAAA,EACA,MAAM;AACR;AAGA,IAAO,gBAAQ;AAGf,IAAI,OAAO,WAAW,aAAa;AACjC,QAAM,MAAM;AACZ,QAAM,gBAAkB,IAAI,QAAoC,CAAC;AACjE,MAAI,OAAO;AAGX,gBAAc,SAAS;AACzB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/scroll.global.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
2
|
+
var __WulfIIFE = (() => {
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -140,35 +140,49 @@ var Wulf = (() => {
|
|
|
140
140
|
};
|
|
141
141
|
|
|
142
142
|
// src/common/i18n.ts
|
|
143
|
+
var FORBIDDEN_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
144
|
+
function isSafeKey(key) {
|
|
145
|
+
return Boolean(key) && !FORBIDDEN_KEYS.has(key);
|
|
146
|
+
}
|
|
143
147
|
function normalizeLocaleCode(locale) {
|
|
144
|
-
|
|
148
|
+
const norm = String(locale ?? "").trim().toLowerCase().replace(/_/g, "-");
|
|
149
|
+
return isSafeKey(norm) ? norm : "";
|
|
145
150
|
}
|
|
146
151
|
function getPrimaryLanguage(normalizedLocale) {
|
|
147
152
|
const dashIndex = normalizedLocale.indexOf("-");
|
|
148
|
-
|
|
153
|
+
const primary = dashIndex > 0 ? normalizedLocale.slice(0, dashIndex) : null;
|
|
154
|
+
return primary && isSafeKey(primary) ? primary : null;
|
|
149
155
|
}
|
|
150
156
|
function assignDefined(target, source) {
|
|
151
|
-
if (!source) return target;
|
|
157
|
+
if (!source || typeof source !== "object") return target;
|
|
152
158
|
for (const key of Object.keys(source)) {
|
|
153
|
-
if (source[key] !== void 0) {
|
|
159
|
+
if (isSafeKey(String(key)) && Object.prototype.hasOwnProperty.call(source, key) && source[key] !== void 0) {
|
|
154
160
|
target[key] = source[key];
|
|
155
161
|
}
|
|
156
162
|
}
|
|
157
163
|
return target;
|
|
158
164
|
}
|
|
159
165
|
function createI18nManager(defaultLocale, locales) {
|
|
160
|
-
const fallbackLocale = normalizeLocaleCode(defaultLocale);
|
|
161
|
-
const initialLocales =
|
|
166
|
+
const fallbackLocale = normalizeLocaleCode(defaultLocale) || "fr";
|
|
167
|
+
const initialLocales = /* @__PURE__ */ Object.create(null);
|
|
162
168
|
for (const [loc, dict] of Object.entries(locales)) {
|
|
163
|
-
|
|
169
|
+
const norm = normalizeLocaleCode(loc);
|
|
170
|
+
if (norm) {
|
|
171
|
+
initialLocales[norm] = assignDefined(/* @__PURE__ */ Object.create(null), dict);
|
|
172
|
+
}
|
|
164
173
|
}
|
|
165
174
|
let currentLocale = fallbackLocale;
|
|
166
|
-
let activeLocales =
|
|
167
|
-
|
|
175
|
+
let activeLocales = /* @__PURE__ */ Object.create(null);
|
|
176
|
+
for (const [loc, dict] of Object.entries(initialLocales)) {
|
|
177
|
+
activeLocales[loc] = assignDefined(/* @__PURE__ */ Object.create(null), dict);
|
|
178
|
+
}
|
|
179
|
+
let globalOverrides = /* @__PURE__ */ Object.create(null);
|
|
168
180
|
function resolveActiveDictionaries() {
|
|
169
181
|
const dicts = [];
|
|
170
|
-
|
|
171
|
-
|
|
182
|
+
if (isSafeKey(currentLocale)) {
|
|
183
|
+
const exact = activeLocales[currentLocale];
|
|
184
|
+
if (exact) dicts.push(exact);
|
|
185
|
+
}
|
|
172
186
|
const primary = getPrimaryLanguage(currentLocale);
|
|
173
187
|
if (primary && activeLocales[primary]) {
|
|
174
188
|
dicts.push(activeLocales[primary]);
|
|
@@ -177,24 +191,33 @@ var Wulf = (() => {
|
|
|
177
191
|
}
|
|
178
192
|
return {
|
|
179
193
|
setLocale(locale) {
|
|
180
|
-
if (locale && locale.trim()) {
|
|
181
|
-
|
|
194
|
+
if (locale && typeof locale === "string" && locale.trim()) {
|
|
195
|
+
const norm = normalizeLocaleCode(locale);
|
|
196
|
+
if (norm) {
|
|
197
|
+
currentLocale = norm;
|
|
198
|
+
}
|
|
182
199
|
}
|
|
183
200
|
},
|
|
184
201
|
getLocale() {
|
|
185
202
|
return currentLocale;
|
|
186
203
|
},
|
|
187
204
|
registerLocale(locale, translations) {
|
|
188
|
-
if (!locale || !locale.trim() || !translations) return;
|
|
205
|
+
if (!locale || typeof locale !== "string" || !locale.trim() || !translations) return;
|
|
189
206
|
const norm = normalizeLocaleCode(locale);
|
|
190
|
-
|
|
207
|
+
if (!norm) return;
|
|
208
|
+
const base = assignDefined(/* @__PURE__ */ Object.create(null), activeLocales[norm]);
|
|
209
|
+
activeLocales[norm] = assignDefined(base, translations);
|
|
191
210
|
},
|
|
192
211
|
setI18n(overrides) {
|
|
193
|
-
if (!overrides) return;
|
|
194
|
-
|
|
212
|
+
if (!overrides || typeof overrides !== "object") return;
|
|
213
|
+
const base = assignDefined(/* @__PURE__ */ Object.create(null), globalOverrides);
|
|
214
|
+
globalOverrides = assignDefined(base, overrides);
|
|
195
215
|
},
|
|
196
216
|
t(key, instanceOverride) {
|
|
197
|
-
if (
|
|
217
|
+
if (!isSafeKey(String(key))) {
|
|
218
|
+
return "";
|
|
219
|
+
}
|
|
220
|
+
if (instanceOverride && typeof instanceOverride === "object" && Object.prototype.hasOwnProperty.call(instanceOverride, key) && instanceOverride[key] !== void 0) {
|
|
198
221
|
return String(instanceOverride[key]);
|
|
199
222
|
}
|
|
200
223
|
if (globalOverrides[key] !== void 0) {
|
|
@@ -225,10 +248,10 @@ var Wulf = (() => {
|
|
|
225
248
|
},
|
|
226
249
|
reset() {
|
|
227
250
|
currentLocale = fallbackLocale;
|
|
228
|
-
globalOverrides =
|
|
229
|
-
activeLocales =
|
|
251
|
+
globalOverrides = /* @__PURE__ */ Object.create(null);
|
|
252
|
+
activeLocales = /* @__PURE__ */ Object.create(null);
|
|
230
253
|
for (const [loc, dict] of Object.entries(initialLocales)) {
|
|
231
|
-
activeLocales[loc] =
|
|
254
|
+
activeLocales[loc] = assignDefined(/* @__PURE__ */ Object.create(null), dict);
|
|
232
255
|
}
|
|
233
256
|
}
|
|
234
257
|
};
|
|
@@ -272,21 +295,36 @@ var Wulf = (() => {
|
|
|
272
295
|
this.atTop = true;
|
|
273
296
|
this.atRight = false;
|
|
274
297
|
this.atLeft = true;
|
|
275
|
-
|
|
276
|
-
if (
|
|
298
|
+
let resolvedElement = null;
|
|
299
|
+
if (typeof element === "string") {
|
|
300
|
+
try {
|
|
301
|
+
resolvedElement = document.querySelector(element);
|
|
302
|
+
} catch {
|
|
303
|
+
resolvedElement = null;
|
|
304
|
+
}
|
|
305
|
+
} else {
|
|
306
|
+
resolvedElement = element;
|
|
307
|
+
}
|
|
308
|
+
if (!resolvedElement || !(resolvedElement instanceof HTMLElement)) {
|
|
277
309
|
throw new Error(`[ScrollBlock] \xC9l\xE9ment introuvable : "${element}".`);
|
|
278
310
|
}
|
|
279
311
|
this.root = resolvedElement;
|
|
280
312
|
this.hasExplicitAriaLabel = Boolean(options?.ariaLabel || options?.i18n?.viewport);
|
|
313
|
+
const rawDelay = options?.autoHideDelay;
|
|
314
|
+
const safeAutoHideDelay = typeof rawDelay === "number" && Number.isFinite(rawDelay) && rawDelay >= 0 ? rawDelay : 1e3;
|
|
315
|
+
const rawMinThumb = options?.minThumbSize;
|
|
316
|
+
const safeMinThumbSize = typeof rawMinThumb === "number" && Number.isFinite(rawMinThumb) && rawMinThumb > 0 ? rawMinThumb : 24;
|
|
317
|
+
const rawEdge = options?.edgeThreshold;
|
|
318
|
+
const safeEdgeThreshold = typeof rawEdge === "number" && Number.isFinite(rawEdge) && rawEdge >= 0 ? rawEdge : 10;
|
|
281
319
|
this.options = {
|
|
282
320
|
axis: options?.axis || "y",
|
|
283
321
|
autoHide: options?.autoHide ?? true,
|
|
284
|
-
autoHideDelay:
|
|
322
|
+
autoHideDelay: safeAutoHideDelay,
|
|
285
323
|
alwaysVisible: options?.alwaysVisible ?? false,
|
|
286
324
|
ariaLabel: options?.ariaLabel || this.t("viewport"),
|
|
287
325
|
i18n: options?.i18n || {},
|
|
288
|
-
minThumbSize:
|
|
289
|
-
edgeThreshold:
|
|
326
|
+
minThumbSize: safeMinThumbSize,
|
|
327
|
+
edgeThreshold: safeEdgeThreshold,
|
|
290
328
|
onScroll: options?.onScroll || (() => {
|
|
291
329
|
}),
|
|
292
330
|
onTotalScroll: options?.onTotalScroll || (() => {
|
|
@@ -724,8 +762,8 @@ var Wulf = (() => {
|
|
|
724
762
|
targetLeft = target.left;
|
|
725
763
|
}
|
|
726
764
|
this.viewport.scrollTo({
|
|
727
|
-
top: targetTop !== void 0 ? Math.max(0, Math.min(maxTop, targetTop)) : void 0,
|
|
728
|
-
left: targetLeft !== void 0 ? Math.max(0, Math.min(maxLeft, targetLeft)) : void 0,
|
|
765
|
+
top: targetTop !== void 0 && Number.isFinite(targetTop) ? Math.max(0, Math.min(maxTop, targetTop)) : void 0,
|
|
766
|
+
left: targetLeft !== void 0 && Number.isFinite(targetLeft) ? Math.max(0, Math.min(maxLeft, targetLeft)) : void 0,
|
|
729
767
|
behavior
|
|
730
768
|
});
|
|
731
769
|
}
|
|
@@ -822,5 +860,5 @@ var Wulf = (() => {
|
|
|
822
860
|
}
|
|
823
861
|
return __toCommonJS(index_exports);
|
|
824
862
|
})();
|
|
825
|
-
if (typeof window !== "undefined") { window.Wulf = window.Wulf || {}; if (typeof
|
|
863
|
+
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 (__) {} } } } } }
|
|
826
864
|
//# sourceMappingURL=scroll.global.js.map
|