wulf.js 2.1.0 → 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 +60 -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 -536
- package/dist/focus-trap.esm.js.map +3 -3
- package/dist/focus-trap.global.js +260 -87
- 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 -10069
- package/dist/index.esm.js.map +4 -4
- package/dist/index.global.js +4192 -355
- 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 -1067
- package/dist/masonry.esm.js.map +4 -4
- package/dist/masonry.global.js +229 -148
- 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 -1175
- package/dist/scroll.esm.js.map +3 -3
- package/dist/scroll.global.js +171 -88
- 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 -741
- package/dist/shortcut.esm.js.map +4 -4
- package/dist/shortcut.global.js +225 -58
- package/dist/shortcut.global.js.map +3 -3
- package/dist/shortcut.global.min.js +8 -2
- 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 -1129
- package/dist/toast.esm.js.map +3 -3
- package/dist/toast.global.js +386 -104
- package/dist/toast.global.js.map +3 -3
- package/dist/toast.global.min.js +4 -4
- 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/dom.d.ts +5 -0
- package/dist/types/common/registry.d.ts +40 -0
- package/dist/types/focus-trap/FocusTrap.d.ts +8 -3
- package/dist/types/index.d.ts +13 -1
- package/dist/types/mask/paste.d.ts +2 -5
- package/dist/types/masonry/Masonry.d.ts +2 -0
- package/dist/types/scroll/ScrollBlock.d.ts +2 -0
- package/dist/types/scroll/types.d.ts +6 -0
- package/dist/types/shortcut/ShortcutManager.d.ts +16 -3
- 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 +4 -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
|
@@ -0,0 +1,578 @@
|
|
|
1
|
+
import {
|
|
2
|
+
safeCssEscape
|
|
3
|
+
} from "./chunk-22AIMRD5.js";
|
|
4
|
+
import {
|
|
5
|
+
AuditableComponent,
|
|
6
|
+
__export
|
|
7
|
+
} from "./chunk-VJO22BAT.js";
|
|
8
|
+
|
|
9
|
+
// src/autosize/index.ts
|
|
10
|
+
var autosize_exports = {};
|
|
11
|
+
__export(autosize_exports, {
|
|
12
|
+
Autosize: () => Autosize,
|
|
13
|
+
default: () => Autosize
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
// src/autosize/Autosize.ts
|
|
17
|
+
function parsePositiveNum(val) {
|
|
18
|
+
if (val === null || val === void 0 || val === "") return void 0;
|
|
19
|
+
const n = typeof val === "number" ? val : Number(val);
|
|
20
|
+
return Number.isFinite(n) && n > 0 ? n : void 0;
|
|
21
|
+
}
|
|
22
|
+
function parsePositiveInt(val) {
|
|
23
|
+
const n = parsePositiveNum(val);
|
|
24
|
+
return n !== void 0 ? Math.floor(n) || void 0 : void 0;
|
|
25
|
+
}
|
|
26
|
+
function resolveTextarea(target) {
|
|
27
|
+
if (typeof document === "undefined") return null;
|
|
28
|
+
const el = typeof target === "string" ? (() => {
|
|
29
|
+
try {
|
|
30
|
+
return target ? document.querySelector(target) : null;
|
|
31
|
+
} catch {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
})() : target;
|
|
35
|
+
return typeof HTMLTextAreaElement !== "undefined" && el instanceof HTMLTextAreaElement ? el : null;
|
|
36
|
+
}
|
|
37
|
+
function getParentCrossingShadow(el) {
|
|
38
|
+
if (el.assignedSlot) return el.assignedSlot;
|
|
39
|
+
if (el.parentElement) return el.parentElement;
|
|
40
|
+
const root = typeof el.getRootNode === "function" ? el.getRootNode() : null;
|
|
41
|
+
if (typeof ShadowRoot !== "undefined" && root instanceof ShadowRoot && root.host instanceof Element) {
|
|
42
|
+
return root.host;
|
|
43
|
+
}
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
function captureScrollAncestors(el) {
|
|
47
|
+
const ancestors = [];
|
|
48
|
+
let curr = getParentCrossingShadow(el);
|
|
49
|
+
while (curr) {
|
|
50
|
+
if (curr.scrollTop !== 0 || curr.scrollLeft !== 0) {
|
|
51
|
+
ancestors.push({ el: curr, top: curr.scrollTop, left: curr.scrollLeft });
|
|
52
|
+
} else if (typeof window !== "undefined" && typeof window.getComputedStyle === "function") {
|
|
53
|
+
const oy = window.getComputedStyle(curr).overflowY;
|
|
54
|
+
if (oy === "auto" || oy === "scroll" || oy === "overlay") {
|
|
55
|
+
ancestors.push({ el: curr, top: curr.scrollTop, left: curr.scrollLeft });
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
curr = getParentCrossingShadow(curr);
|
|
59
|
+
}
|
|
60
|
+
const winX = typeof window !== "undefined" ? window.scrollX : 0;
|
|
61
|
+
const winY = typeof window !== "undefined" ? window.scrollY : 0;
|
|
62
|
+
return { ancestors, winX, winY };
|
|
63
|
+
}
|
|
64
|
+
function restoreScrollAncestors(snap) {
|
|
65
|
+
for (const item of snap.ancestors) {
|
|
66
|
+
if (item.el.scrollTop !== item.top) item.el.scrollTop = item.top;
|
|
67
|
+
if (item.el.scrollLeft !== item.left) item.el.scrollLeft = item.left;
|
|
68
|
+
}
|
|
69
|
+
if (typeof window !== "undefined" && (window.scrollX !== snap.winX || window.scrollY !== snap.winY)) {
|
|
70
|
+
window.scrollTo(snap.winX, snap.winY);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
var Autosize = class _Autosize extends AuditableComponent {
|
|
74
|
+
element;
|
|
75
|
+
mode = "fallback";
|
|
76
|
+
options;
|
|
77
|
+
disabled;
|
|
78
|
+
isDestroyed = false;
|
|
79
|
+
isMeasuring = false;
|
|
80
|
+
savedStyles = null;
|
|
81
|
+
abortController = null;
|
|
82
|
+
resizeObserver = null;
|
|
83
|
+
rafId = null;
|
|
84
|
+
lastInlineSize = null;
|
|
85
|
+
lastHeight = 0;
|
|
86
|
+
lastAppliedHeight = null;
|
|
87
|
+
manualHeightPx = null;
|
|
88
|
+
constructor(target, options = {}) {
|
|
89
|
+
super();
|
|
90
|
+
this.element = resolveTextarea(target);
|
|
91
|
+
this.options = {
|
|
92
|
+
useNativeFieldSizing: options.useNativeFieldSizing ?? true,
|
|
93
|
+
resize: options.resize === "vertical" ? "vertical" : "none",
|
|
94
|
+
observeFonts: options.observeFonts ?? true,
|
|
95
|
+
audit: options.audit ?? true,
|
|
96
|
+
...options
|
|
97
|
+
};
|
|
98
|
+
this.disabled = Boolean(this.options.disabled);
|
|
99
|
+
if (this.element) {
|
|
100
|
+
this.captureInitialStyles(this.element);
|
|
101
|
+
this.lastHeight = this.readBoundingHeight(this.element);
|
|
102
|
+
this.bindEvents();
|
|
103
|
+
if (!this.disabled) {
|
|
104
|
+
this.applyModeAndMeasure(false);
|
|
105
|
+
}
|
|
106
|
+
this.runAuditWarning(this.options.audit !== false);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Indique si le navigateur supporte nativement `field-sizing: content`.
|
|
111
|
+
*/
|
|
112
|
+
static supportsNativeFieldSizing() {
|
|
113
|
+
return typeof CSS !== "undefined" && typeof CSS.supports === "function" && CSS.supports("field-sizing", "content");
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Initialisation opt-in explicite de tous les `<textarea data-wulf-autosize>` dans `root`.
|
|
117
|
+
* Aucun effet de bord au chargement du module.
|
|
118
|
+
*/
|
|
119
|
+
static initAll(root, options = {}) {
|
|
120
|
+
if (typeof document === "undefined") return [];
|
|
121
|
+
const scope = root ?? document;
|
|
122
|
+
const nodes = scope.querySelectorAll("textarea[data-wulf-autosize]");
|
|
123
|
+
const instances = [];
|
|
124
|
+
for (const el of nodes) {
|
|
125
|
+
const resizeAttr = el.getAttribute("data-wulf-resize");
|
|
126
|
+
const nativeAttr = el.getAttribute("data-wulf-native");
|
|
127
|
+
const merged = {
|
|
128
|
+
minRows: parsePositiveInt(el.getAttribute("data-wulf-min-rows")),
|
|
129
|
+
maxRows: parsePositiveInt(el.getAttribute("data-wulf-max-rows")),
|
|
130
|
+
minHeight: parsePositiveNum(el.getAttribute("data-wulf-min-height")),
|
|
131
|
+
maxHeight: parsePositiveNum(el.getAttribute("data-wulf-max-height")),
|
|
132
|
+
resize: resizeAttr === "vertical" ? "vertical" : "none",
|
|
133
|
+
useNativeFieldSizing: nativeAttr === "false" ? false : void 0,
|
|
134
|
+
...options
|
|
135
|
+
};
|
|
136
|
+
instances.push(new _Autosize(el, merged));
|
|
137
|
+
}
|
|
138
|
+
return instances;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Recalcule et applique la hauteur optimale de la zone de texte.
|
|
142
|
+
*/
|
|
143
|
+
update() {
|
|
144
|
+
if (this.isDestroyed || !this.element || this.disabled) {
|
|
145
|
+
return this.lastHeight;
|
|
146
|
+
}
|
|
147
|
+
return this.applyModeAndMeasure(true);
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Efface toute hauteur manuelle mémorisée (mode `resize: 'vertical'`) et réévalue la taille.
|
|
151
|
+
*/
|
|
152
|
+
reset() {
|
|
153
|
+
if (this.isDestroyed || !this.element) return;
|
|
154
|
+
this.manualHeightPx = null;
|
|
155
|
+
if (!this.disabled) {
|
|
156
|
+
this.applyModeAndMeasure(true);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Active ou suspend le redimensionnement automatique tout en restaurant les styles d'origine à la pause.
|
|
161
|
+
*/
|
|
162
|
+
setDisabled(disabled) {
|
|
163
|
+
if (this.isDestroyed || !this.element) return;
|
|
164
|
+
const next = Boolean(disabled);
|
|
165
|
+
if (this.disabled === next) return;
|
|
166
|
+
this.disabled = next;
|
|
167
|
+
if (next) {
|
|
168
|
+
this.restoreInitialStyles();
|
|
169
|
+
} else {
|
|
170
|
+
this.applyModeAndMeasure(true);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
isDisabled() {
|
|
174
|
+
return this.disabled;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Met à jour les options à la volée et applique le nouveau dimensionnement.
|
|
178
|
+
*/
|
|
179
|
+
updateOptions(options) {
|
|
180
|
+
if (this.isDestroyed || !options) return;
|
|
181
|
+
const prevDisabled = this.disabled;
|
|
182
|
+
this.options = { ...this.options, ...options };
|
|
183
|
+
if (options.resize !== void 0) {
|
|
184
|
+
this.options.resize = options.resize === "vertical" ? "vertical" : "none";
|
|
185
|
+
if (this.options.resize === "none") {
|
|
186
|
+
this.manualHeightPx = null;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
if (options.disabled !== void 0) {
|
|
190
|
+
this.disabled = Boolean(options.disabled);
|
|
191
|
+
}
|
|
192
|
+
if (this.element) {
|
|
193
|
+
if (this.disabled) {
|
|
194
|
+
if (!prevDisabled) this.restoreInitialStyles();
|
|
195
|
+
} else {
|
|
196
|
+
this.applyModeAndMeasure(true);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Audite la conformité WAI-ARIA / WCAG du `<textarea>` ciblé.
|
|
202
|
+
*/
|
|
203
|
+
audit() {
|
|
204
|
+
const warnings = [];
|
|
205
|
+
const el = this.element;
|
|
206
|
+
if (!el) {
|
|
207
|
+
warnings.push("\xC9l\xE9ment cible introuvable ou non valide (un <textarea> est requis).");
|
|
208
|
+
return warnings;
|
|
209
|
+
}
|
|
210
|
+
const hasAriaLabel = Boolean(el.getAttribute("aria-label")?.trim());
|
|
211
|
+
const hasAriaLabelledby = this.checkAriaIdReferences(el, "aria-labelledby", warnings, true);
|
|
212
|
+
const hasAssociatedLabel = this.hasNonEmptyLabel(el);
|
|
213
|
+
if (!hasAriaLabel && !hasAriaLabelledby && !hasAssociatedLabel) {
|
|
214
|
+
if (el.getAttribute("placeholder")?.trim()) {
|
|
215
|
+
warnings.push(
|
|
216
|
+
"Un placeholder est pr\xE9sent sans libell\xE9 accessible persistant (<label>, aria-label ou aria-labelledby) \u2014 non conforme WCAG 3.3.2."
|
|
217
|
+
);
|
|
218
|
+
} else {
|
|
219
|
+
warnings.push(
|
|
220
|
+
'Aucun nom accessible d\xE9tect\xE9 sur le <textarea> (ajoutez un <label for="...">, un <label> englobant, aria-label ou aria-labelledby).'
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
if (el.hasAttribute("aria-describedby")) {
|
|
225
|
+
this.checkAriaIdReferences(el, "aria-describedby", warnings);
|
|
226
|
+
}
|
|
227
|
+
if (el.hasAttribute("aria-errormessage")) {
|
|
228
|
+
this.checkAriaIdReferences(el, "aria-errormessage", warnings);
|
|
229
|
+
}
|
|
230
|
+
const tabIndexAttr = el.getAttribute("tabindex");
|
|
231
|
+
if (tabIndexAttr !== null) {
|
|
232
|
+
const parsed = Number.parseInt(tabIndexAttr, 10);
|
|
233
|
+
if (Number.isFinite(parsed) && parsed > 0) {
|
|
234
|
+
warnings.push(`\xC9vitez tabindex="${parsed}" (> 0) qui perturbe l'ordre de tabulation naturel.`);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
return warnings;
|
|
238
|
+
}
|
|
239
|
+
getAuditPrefix() {
|
|
240
|
+
return "Wulf.Autosize";
|
|
241
|
+
}
|
|
242
|
+
getAuditTargetLabel() {
|
|
243
|
+
if (!this.element) return "<textarea>";
|
|
244
|
+
return this.element.id ? `#${this.element.id}` : "<textarea>";
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Détruit l'instance : coupe tous les écouteurs/observers et restaure intégralement le DOM d'origine.
|
|
248
|
+
*/
|
|
249
|
+
destroy() {
|
|
250
|
+
if (this.isDestroyed) return;
|
|
251
|
+
this.isDestroyed = true;
|
|
252
|
+
if (this.rafId !== null && typeof cancelAnimationFrame === "function") {
|
|
253
|
+
cancelAnimationFrame(this.rafId);
|
|
254
|
+
this.rafId = null;
|
|
255
|
+
}
|
|
256
|
+
if (this.resizeObserver) {
|
|
257
|
+
this.resizeObserver.disconnect();
|
|
258
|
+
this.resizeObserver = null;
|
|
259
|
+
}
|
|
260
|
+
if (this.abortController) {
|
|
261
|
+
this.abortController.abort();
|
|
262
|
+
this.abortController = null;
|
|
263
|
+
}
|
|
264
|
+
this.restoreInitialStyles();
|
|
265
|
+
}
|
|
266
|
+
// --- Implémentation interne ---
|
|
267
|
+
hasNonEmptyLabel(el) {
|
|
268
|
+
if (el.labels && el.labels.length > 0) {
|
|
269
|
+
for (const lbl of Array.from(el.labels)) {
|
|
270
|
+
if ((lbl.textContent?.trim() || "").length > 0) return true;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
if (el.id) {
|
|
274
|
+
const root = typeof el.getRootNode === "function" ? el.getRootNode() : document;
|
|
275
|
+
const scope = root && "querySelector" in root ? root : document;
|
|
276
|
+
try {
|
|
277
|
+
const explicit = scope.querySelector(`label[for="${safeCssEscape(el.id)}"]`);
|
|
278
|
+
if (explicit && (explicit.textContent?.trim() || "").length > 0) return true;
|
|
279
|
+
} catch {
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
const parentLabel = typeof el.closest === "function" ? el.closest("label") : null;
|
|
283
|
+
return Boolean(parentLabel && (parentLabel.textContent?.trim() || "").length > 0);
|
|
284
|
+
}
|
|
285
|
+
captureInitialStyles(el) {
|
|
286
|
+
this.savedStyles = {
|
|
287
|
+
height: el.style.height,
|
|
288
|
+
blockSize: el.style.blockSize,
|
|
289
|
+
minBlockSize: el.style.minBlockSize,
|
|
290
|
+
maxBlockSize: el.style.maxBlockSize,
|
|
291
|
+
overflowY: el.style.overflowY,
|
|
292
|
+
resize: el.style.resize,
|
|
293
|
+
fieldSizing: el.style.getPropertyValue("field-sizing"),
|
|
294
|
+
hadDataAttr: el.hasAttribute("data-wulf-autosize"),
|
|
295
|
+
prevDataAttr: el.getAttribute("data-wulf-autosize")
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
restoreInitialStyles() {
|
|
299
|
+
const el = this.element;
|
|
300
|
+
const saved = this.savedStyles;
|
|
301
|
+
if (!el || !saved) return;
|
|
302
|
+
el.classList.remove(
|
|
303
|
+
"wulf-autosize",
|
|
304
|
+
"wulf-autosize--native",
|
|
305
|
+
"wulf-autosize--fallback",
|
|
306
|
+
"wulf-autosize--resize-none",
|
|
307
|
+
"wulf-autosize--resize-vertical"
|
|
308
|
+
);
|
|
309
|
+
const restoreProp = (prop, val) => {
|
|
310
|
+
if (val) el.style.setProperty(prop, val);
|
|
311
|
+
else el.style.removeProperty(prop);
|
|
312
|
+
};
|
|
313
|
+
restoreProp("height", saved.height);
|
|
314
|
+
restoreProp("block-size", saved.blockSize);
|
|
315
|
+
restoreProp("min-block-size", saved.minBlockSize);
|
|
316
|
+
restoreProp("max-block-size", saved.maxBlockSize);
|
|
317
|
+
restoreProp("overflow-y", saved.overflowY);
|
|
318
|
+
restoreProp("resize", saved.resize);
|
|
319
|
+
restoreProp("field-sizing", saved.fieldSizing);
|
|
320
|
+
if (saved.hadDataAttr && saved.prevDataAttr !== null) {
|
|
321
|
+
el.setAttribute("data-wulf-autosize", saved.prevDataAttr);
|
|
322
|
+
} else if (!saved.hadDataAttr) {
|
|
323
|
+
el.removeAttribute("data-wulf-autosize");
|
|
324
|
+
} else {
|
|
325
|
+
el.setAttribute("data-wulf-autosize", "");
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
bindEvents() {
|
|
329
|
+
const el = this.element;
|
|
330
|
+
if (!el || typeof window === "undefined") return;
|
|
331
|
+
this.abortController = new AbortController();
|
|
332
|
+
const { signal } = this.abortController;
|
|
333
|
+
const onTextChange = () => {
|
|
334
|
+
if (!this.isDestroyed && !this.disabled && this.mode === "fallback") {
|
|
335
|
+
this.applyModeAndMeasure(true);
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
el.addEventListener("input", onTextChange, { signal });
|
|
339
|
+
el.addEventListener("change", onTextChange, { signal });
|
|
340
|
+
if (el.form) {
|
|
341
|
+
el.form.addEventListener(
|
|
342
|
+
"reset",
|
|
343
|
+
() => {
|
|
344
|
+
queueMicrotask(() => {
|
|
345
|
+
if (!this.isDestroyed && !this.disabled) {
|
|
346
|
+
this.manualHeightPx = null;
|
|
347
|
+
this.applyModeAndMeasure(true);
|
|
348
|
+
}
|
|
349
|
+
});
|
|
350
|
+
},
|
|
351
|
+
{ signal }
|
|
352
|
+
);
|
|
353
|
+
}
|
|
354
|
+
const onPointerRelease = () => {
|
|
355
|
+
if (!this.isDestroyed && !this.disabled && this.options.resize === "vertical") {
|
|
356
|
+
this.captureManualResizeIfNeeded();
|
|
357
|
+
}
|
|
358
|
+
};
|
|
359
|
+
window.addEventListener("pointerup", onPointerRelease, { signal, passive: true });
|
|
360
|
+
window.addEventListener("mouseup", onPointerRelease, { signal, passive: true });
|
|
361
|
+
if (this.options.observeFonts !== false && typeof document !== "undefined" && document.fonts?.ready) {
|
|
362
|
+
document.fonts.ready.then(() => {
|
|
363
|
+
if (!this.isDestroyed && !this.disabled) {
|
|
364
|
+
this.applyModeAndMeasure(true);
|
|
365
|
+
}
|
|
366
|
+
}).catch(() => {
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
if (typeof ResizeObserver !== "undefined") {
|
|
370
|
+
this.resizeObserver = new ResizeObserver((entries) => {
|
|
371
|
+
if (this.isDestroyed || this.disabled || !this.element) return;
|
|
372
|
+
const entry = entries[0];
|
|
373
|
+
if (!entry) return;
|
|
374
|
+
const inlineSize = entry.borderBoxSize && entry.borderBoxSize[0] ? entry.borderBoxSize[0].inlineSize : entry.contentRect.width;
|
|
375
|
+
const blockSize = entry.borderBoxSize && entry.borderBoxSize[0] ? entry.borderBoxSize[0].blockSize : entry.contentRect.height;
|
|
376
|
+
if (this.mode === "native") {
|
|
377
|
+
if (blockSize > 0 && Math.abs(blockSize - this.lastHeight) >= 0.5) {
|
|
378
|
+
const prev = this.lastHeight;
|
|
379
|
+
this.lastHeight = blockSize;
|
|
380
|
+
this.emitResize(blockSize, prev, this.isElementOverflowing(this.element));
|
|
381
|
+
}
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
if (!this.isMeasuring && this.options.resize === "vertical") {
|
|
385
|
+
this.captureManualResizeIfNeeded(blockSize);
|
|
386
|
+
}
|
|
387
|
+
const prevInline = this.lastInlineSize;
|
|
388
|
+
const becameVisible = prevInline === 0 && inlineSize > 0;
|
|
389
|
+
const widthChanged = prevInline !== null && Math.abs(inlineSize - prevInline) >= 0.5;
|
|
390
|
+
this.lastInlineSize = inlineSize;
|
|
391
|
+
if (becameVisible || widthChanged) {
|
|
392
|
+
this.scheduleUpdate();
|
|
393
|
+
}
|
|
394
|
+
});
|
|
395
|
+
this.resizeObserver.observe(el);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
captureManualResizeIfNeeded(observedHeight) {
|
|
399
|
+
const el = this.element;
|
|
400
|
+
if (!el || this.isMeasuring || this.lastAppliedHeight === null) return;
|
|
401
|
+
const inlineHeight = el.style.height;
|
|
402
|
+
if (!inlineHeight) return;
|
|
403
|
+
const parsedInline = inlineHeight.endsWith("px") ? parseFloat(inlineHeight) : NaN;
|
|
404
|
+
let manualPx = Number.isFinite(parsedInline) && parsedInline > 0 ? parsedInline : NaN;
|
|
405
|
+
if (!Number.isFinite(manualPx)) {
|
|
406
|
+
const boxH = observedHeight ?? this.readBoundingHeight(el);
|
|
407
|
+
const cs = typeof window !== "undefined" && typeof window.getComputedStyle === "function" ? window.getComputedStyle(el) : null;
|
|
408
|
+
if (cs && cs.boxSizing !== "border-box") {
|
|
409
|
+
const pad = (parseFloat(cs.paddingTop) || 0) + (parseFloat(cs.paddingBottom) || 0);
|
|
410
|
+
const brd = (parseFloat(cs.borderTopWidth) || 0) + (parseFloat(cs.borderBottomWidth) || 0);
|
|
411
|
+
manualPx = Math.max(0, boxH - pad - brd);
|
|
412
|
+
} else {
|
|
413
|
+
manualPx = boxH;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
if (manualPx > 0 && Math.abs(manualPx - this.lastAppliedHeight) >= 2) {
|
|
417
|
+
this.manualHeightPx = manualPx;
|
|
418
|
+
this.lastAppliedHeight = manualPx;
|
|
419
|
+
const overflowing = this.isElementOverflowing(el);
|
|
420
|
+
el.style.overflowY = overflowing ? "auto" : "hidden";
|
|
421
|
+
const boxHeight = observedHeight ?? this.readBoundingHeight(el);
|
|
422
|
+
if (Math.abs(boxHeight - this.lastHeight) >= 0.5) {
|
|
423
|
+
const prev = this.lastHeight;
|
|
424
|
+
this.lastHeight = boxHeight;
|
|
425
|
+
this.emitResize(boxHeight, prev, overflowing);
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
scheduleUpdate() {
|
|
430
|
+
if (this.rafId !== null) return;
|
|
431
|
+
const schedule = typeof requestAnimationFrame === "function" ? requestAnimationFrame : (cb) => setTimeout(cb, 0);
|
|
432
|
+
this.rafId = schedule(() => {
|
|
433
|
+
this.rafId = null;
|
|
434
|
+
if (!this.isDestroyed && !this.disabled) {
|
|
435
|
+
this.applyModeAndMeasure(true);
|
|
436
|
+
}
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
readBoundingHeight(el) {
|
|
440
|
+
return typeof el.getBoundingClientRect === "function" ? el.getBoundingClientRect().height : 0;
|
|
441
|
+
}
|
|
442
|
+
isElementOverflowing(el) {
|
|
443
|
+
return el.scrollHeight > el.clientHeight + 1;
|
|
444
|
+
}
|
|
445
|
+
computeBounds(el) {
|
|
446
|
+
const cs = typeof window !== "undefined" && typeof window.getComputedStyle === "function" ? window.getComputedStyle(el) : null;
|
|
447
|
+
const fontSize = cs ? parseFloat(cs.fontSize) || 16 : 16;
|
|
448
|
+
const rawLh = cs ? parseFloat(cs.lineHeight) : NaN;
|
|
449
|
+
const lineHeight = Number.isFinite(rawLh) && rawLh > 0 ? rawLh : fontSize * 1.2;
|
|
450
|
+
const paddingY = cs ? (parseFloat(cs.paddingTop) || 0) + (parseFloat(cs.paddingBottom) || 0) : 0;
|
|
451
|
+
const borderY = cs ? (parseFloat(cs.borderTopWidth) || 0) + (parseFloat(cs.borderBottomWidth) || 0) : 0;
|
|
452
|
+
const isBorderBox = cs ? cs.boxSizing === "border-box" : true;
|
|
453
|
+
const extraVertical = isBorderBox ? paddingY + borderY : 0;
|
|
454
|
+
const minRowsOpt = parsePositiveNum(this.options.minRows);
|
|
455
|
+
const attrRows = parsePositiveInt(el.getAttribute("rows"));
|
|
456
|
+
const effectiveMinRows = minRowsOpt ?? attrRows;
|
|
457
|
+
const rowsMinPx = effectiveMinRows !== void 0 ? effectiveMinRows * lineHeight + extraVertical : 0;
|
|
458
|
+
const minHeightOpt = parsePositiveNum(this.options.minHeight) ?? 0;
|
|
459
|
+
const minPx = Math.max(rowsMinPx, minHeightOpt);
|
|
460
|
+
const maxRowsOpt = parsePositiveNum(this.options.maxRows);
|
|
461
|
+
const rowsMaxPx = maxRowsOpt !== void 0 ? maxRowsOpt * lineHeight + extraVertical : Infinity;
|
|
462
|
+
const maxHeightOpt = parsePositiveNum(this.options.maxHeight) ?? Infinity;
|
|
463
|
+
let maxPx = Math.min(rowsMaxPx, maxHeightOpt);
|
|
464
|
+
if (maxPx < minPx) maxPx = minPx;
|
|
465
|
+
return { minPx, maxPx, paddingY, borderY, isBorderBox };
|
|
466
|
+
}
|
|
467
|
+
applyModeAndMeasure(emitEvents) {
|
|
468
|
+
const el = this.element;
|
|
469
|
+
if (!el) return 0;
|
|
470
|
+
const resizeMode = this.options.resize === "vertical" ? "vertical" : "none";
|
|
471
|
+
const wantNative = this.options.useNativeFieldSizing !== false && _Autosize.supportsNativeFieldSizing() && resizeMode === "none" && this.manualHeightPx === null;
|
|
472
|
+
this.mode = wantNative ? "native" : "fallback";
|
|
473
|
+
el.classList.add("wulf-autosize");
|
|
474
|
+
el.classList.toggle("wulf-autosize--native", wantNative);
|
|
475
|
+
el.classList.toggle("wulf-autosize--fallback", !wantNative);
|
|
476
|
+
el.classList.toggle("wulf-autosize--resize-none", resizeMode === "none");
|
|
477
|
+
el.classList.toggle("wulf-autosize--resize-vertical", resizeMode === "vertical");
|
|
478
|
+
el.setAttribute("data-wulf-autosize", this.mode);
|
|
479
|
+
const bounds = this.computeBounds(el);
|
|
480
|
+
if (wantNative) {
|
|
481
|
+
el.style.setProperty("field-sizing", "content");
|
|
482
|
+
el.style.blockSize = "auto";
|
|
483
|
+
el.style.resize = "none";
|
|
484
|
+
el.style.removeProperty("height");
|
|
485
|
+
el.style.removeProperty("overflow-y");
|
|
486
|
+
if (bounds.minPx > 0) el.style.minBlockSize = `${Math.ceil(bounds.minPx)}px`;
|
|
487
|
+
else el.style.removeProperty("min-block-size");
|
|
488
|
+
if (Number.isFinite(bounds.maxPx)) el.style.maxBlockSize = `${Math.ceil(bounds.maxPx)}px`;
|
|
489
|
+
else el.style.removeProperty("max-block-size");
|
|
490
|
+
const rect2 = typeof el.getBoundingClientRect === "function" ? el.getBoundingClientRect() : null;
|
|
491
|
+
if (rect2) {
|
|
492
|
+
this.lastInlineSize = rect2.width;
|
|
493
|
+
if (rect2.height > 0) {
|
|
494
|
+
const prev = this.lastHeight;
|
|
495
|
+
this.lastHeight = rect2.height;
|
|
496
|
+
if (emitEvents && Math.abs(rect2.height - prev) >= 0.5) {
|
|
497
|
+
this.emitResize(rect2.height, prev, this.isElementOverflowing(el));
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
return this.lastHeight;
|
|
502
|
+
}
|
|
503
|
+
el.style.removeProperty("field-sizing");
|
|
504
|
+
el.style.removeProperty("block-size");
|
|
505
|
+
el.style.removeProperty("min-block-size");
|
|
506
|
+
el.style.removeProperty("max-block-size");
|
|
507
|
+
el.style.resize = resizeMode;
|
|
508
|
+
const rect = typeof el.getBoundingClientRect === "function" ? el.getBoundingClientRect() : null;
|
|
509
|
+
if (!el.isConnected || !rect || rect.width === 0) {
|
|
510
|
+
this.lastInlineSize = rect ? rect.width : 0;
|
|
511
|
+
return this.lastHeight;
|
|
512
|
+
}
|
|
513
|
+
this.lastInlineSize = rect.width;
|
|
514
|
+
if (this.manualHeightPx !== null) {
|
|
515
|
+
const locked = Math.ceil(this.manualHeightPx);
|
|
516
|
+
el.style.height = `${locked}px`;
|
|
517
|
+
this.lastAppliedHeight = locked;
|
|
518
|
+
el.style.overflowY = this.isElementOverflowing(el) ? "auto" : "hidden";
|
|
519
|
+
const boxH = this.readBoundingHeight(el);
|
|
520
|
+
if (boxH > 0) this.lastHeight = boxH;
|
|
521
|
+
return this.lastHeight;
|
|
522
|
+
}
|
|
523
|
+
const scrollSnap = captureScrollAncestors(el);
|
|
524
|
+
const prevInlineHeight = el.style.height;
|
|
525
|
+
this.isMeasuring = true;
|
|
526
|
+
try {
|
|
527
|
+
el.style.height = "auto";
|
|
528
|
+
const rawScrollHeight = el.scrollHeight;
|
|
529
|
+
if (rawScrollHeight === 0) {
|
|
530
|
+
el.style.height = prevInlineHeight;
|
|
531
|
+
restoreScrollAncestors(scrollSnap);
|
|
532
|
+
return this.lastHeight;
|
|
533
|
+
}
|
|
534
|
+
const contentHeight = bounds.isBorderBox ? rawScrollHeight + bounds.borderY : Math.max(0, rawScrollHeight - bounds.paddingY);
|
|
535
|
+
const overflowing = Number.isFinite(bounds.maxPx) && contentHeight > bounds.maxPx + 0.5;
|
|
536
|
+
const finalHeight = Math.ceil(Math.min(bounds.maxPx, Math.max(bounds.minPx, contentHeight)));
|
|
537
|
+
el.style.height = `${finalHeight}px`;
|
|
538
|
+
el.style.overflowY = overflowing ? "auto" : "hidden";
|
|
539
|
+
this.lastAppliedHeight = finalHeight;
|
|
540
|
+
restoreScrollAncestors(scrollSnap);
|
|
541
|
+
const prev = this.lastHeight;
|
|
542
|
+
this.lastHeight = finalHeight;
|
|
543
|
+
if (emitEvents && Math.abs(finalHeight - prev) >= 0.5) {
|
|
544
|
+
this.emitResize(finalHeight, prev, overflowing);
|
|
545
|
+
}
|
|
546
|
+
return finalHeight;
|
|
547
|
+
} finally {
|
|
548
|
+
this.isMeasuring = false;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
emitResize(height, previousHeight, overflowing) {
|
|
552
|
+
const el = this.element;
|
|
553
|
+
if (!el) return;
|
|
554
|
+
const detail = {
|
|
555
|
+
textarea: el,
|
|
556
|
+
height,
|
|
557
|
+
previousHeight,
|
|
558
|
+
overflowing,
|
|
559
|
+
mode: this.mode
|
|
560
|
+
};
|
|
561
|
+
if (typeof this.options.onResize === "function") {
|
|
562
|
+
try {
|
|
563
|
+
this.options.onResize(detail);
|
|
564
|
+
} catch (err) {
|
|
565
|
+
console.error("[Wulf.Autosize] Erreur dans onResize :", err);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
if (typeof CustomEvent === "function") {
|
|
569
|
+
el.dispatchEvent(new CustomEvent("wulf:autosize:resize", { detail, bubbles: true }));
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
};
|
|
573
|
+
|
|
574
|
+
export {
|
|
575
|
+
Autosize,
|
|
576
|
+
autosize_exports
|
|
577
|
+
};
|
|
578
|
+
//# sourceMappingURL=chunk-H4GRLGQ3.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/autosize/index.ts", "../../src/autosize/Autosize.ts"],
|
|
4
|
+
"sourcesContent": ["export * from './types';\nexport { Autosize } from './Autosize';\nexport { Autosize as default } from './Autosize';\n", "import { AuditableComponent } from '../common/AuditableComponent';\nimport { safeCssEscape } from '../common/dom';\nimport {\n AutosizeMode,\n AutosizeOptions,\n AutosizeResizeDetail,\n AutosizeResizeMode,\n IAutosize\n} from './types';\n\ninterface SavedInlineStyles {\n height: string;\n blockSize: string;\n minBlockSize: string;\n maxBlockSize: string;\n overflowY: string;\n resize: string;\n fieldSizing: string;\n hadDataAttr: boolean;\n prevDataAttr: string | null;\n}\n\ninterface ScrollSnapshot {\n el: Element;\n top: number;\n left: number;\n}\n\nfunction parsePositiveNum(val: string | number | undefined | null): number | undefined {\n if (val === null || val === undefined || val === '') return undefined;\n const n = typeof val === 'number' ? val : Number(val);\n return Number.isFinite(n) && n > 0 ? n : undefined;\n}\n\nfunction parsePositiveInt(val: string | null | undefined): number | undefined {\n const n = parsePositiveNum(val);\n return n !== undefined ? Math.floor(n) || undefined : undefined;\n}\n\nfunction resolveTextarea(target: HTMLTextAreaElement | string): HTMLTextAreaElement | null {\n if (typeof document === 'undefined') return null;\n const el =\n typeof target === 'string'\n ? (() => {\n try {\n return target ? document.querySelector(target) : null;\n } catch {\n return null;\n }\n })()\n : target;\n return typeof HTMLTextAreaElement !== 'undefined' && el instanceof HTMLTextAreaElement ? el : null;\n}\n\nfunction getParentCrossingShadow(el: Element): Element | null {\n if (el.assignedSlot) return el.assignedSlot;\n if (el.parentElement) return el.parentElement;\n const root = typeof el.getRootNode === 'function' ? el.getRootNode() : null;\n if (typeof ShadowRoot !== 'undefined' && root instanceof ShadowRoot && root.host instanceof Element) {\n return root.host;\n }\n return null;\n}\n\nfunction captureScrollAncestors(el: HTMLElement): { ancestors: ScrollSnapshot[]; winX: number; winY: number } {\n const ancestors: ScrollSnapshot[] = [];\n let curr = getParentCrossingShadow(el);\n while (curr) {\n if (curr.scrollTop !== 0 || curr.scrollLeft !== 0) {\n ancestors.push({ el: curr, top: curr.scrollTop, left: curr.scrollLeft });\n } else if (typeof window !== 'undefined' && typeof window.getComputedStyle === 'function') {\n const oy = window.getComputedStyle(curr).overflowY;\n if (oy === 'auto' || oy === 'scroll' || oy === 'overlay') {\n ancestors.push({ el: curr, top: curr.scrollTop, left: curr.scrollLeft });\n }\n }\n curr = getParentCrossingShadow(curr);\n }\n const winX = typeof window !== 'undefined' ? window.scrollX : 0;\n const winY = typeof window !== 'undefined' ? window.scrollY : 0;\n return { ancestors, winX, winY };\n}\n\nfunction restoreScrollAncestors(snap: { ancestors: ScrollSnapshot[]; winX: number; winY: number }): void {\n for (const item of snap.ancestors) {\n if (item.el.scrollTop !== item.top) item.el.scrollTop = item.top;\n if (item.el.scrollLeft !== item.left) item.el.scrollLeft = item.left;\n }\n if (typeof window !== 'undefined' && (window.scrollX !== snap.winX || window.scrollY !== snap.winY)) {\n window.scrollTo(snap.winX, snap.winY);\n }\n}\n\n/**\n * Moteur de redimensionnement fluide pour `<textarea>` (`Wulf.Autosize`).\n * D\u00E9l\u00E9gation progressive \u00E0 `field-sizing: content` et repli JS/CSSOM d\u00E9terministe\n * sans transition pendant la frappe ni saut de scroll.\n */\nexport class Autosize extends AuditableComponent implements IAutosize {\n public readonly element: HTMLTextAreaElement | null;\n public mode: AutosizeMode = 'fallback';\n\n private options: AutosizeOptions;\n private disabled: boolean;\n private isDestroyed = false;\n private isMeasuring = false;\n private savedStyles: SavedInlineStyles | null = null;\n private abortController: AbortController | null = null;\n private resizeObserver: ResizeObserver | null = null;\n private rafId: number | null = null;\n private lastInlineSize: number | null = null;\n private lastHeight = 0;\n private lastAppliedHeight: number | null = null;\n private manualHeightPx: number | null = null;\n\n constructor(target: HTMLTextAreaElement | string, options: AutosizeOptions = {}) {\n super();\n this.element = resolveTextarea(target);\n this.options = {\n useNativeFieldSizing: options.useNativeFieldSizing ?? true,\n resize: options.resize === 'vertical' ? 'vertical' : 'none',\n observeFonts: options.observeFonts ?? true,\n audit: options.audit ?? true,\n ...options\n };\n this.disabled = Boolean(this.options.disabled);\n\n if (this.element) {\n this.captureInitialStyles(this.element);\n this.lastHeight = this.readBoundingHeight(this.element);\n this.bindEvents();\n if (!this.disabled) {\n this.applyModeAndMeasure(false);\n }\n this.runAuditWarning(this.options.audit !== false);\n }\n }\n\n /**\n * Indique si le navigateur supporte nativement `field-sizing: content`.\n */\n public static supportsNativeFieldSizing(): boolean {\n return (\n typeof CSS !== 'undefined' &&\n typeof CSS.supports === 'function' &&\n CSS.supports('field-sizing', 'content')\n );\n }\n\n /**\n * Initialisation opt-in explicite de tous les `<textarea data-wulf-autosize>` dans `root`.\n * Aucun effet de bord au chargement du module.\n */\n public static initAll(root?: ParentNode, options: AutosizeOptions = {}): Autosize[] {\n if (typeof document === 'undefined') return [];\n const scope = root ?? document;\n const nodes = scope.querySelectorAll<HTMLTextAreaElement>('textarea[data-wulf-autosize]');\n const instances: Autosize[] = [];\n\n for (const el of nodes) {\n const resizeAttr = el.getAttribute('data-wulf-resize');\n const nativeAttr = el.getAttribute('data-wulf-native');\n const merged: AutosizeOptions = {\n minRows: parsePositiveInt(el.getAttribute('data-wulf-min-rows')),\n maxRows: parsePositiveInt(el.getAttribute('data-wulf-max-rows')),\n minHeight: parsePositiveNum(el.getAttribute('data-wulf-min-height')),\n maxHeight: parsePositiveNum(el.getAttribute('data-wulf-max-height')),\n resize: resizeAttr === 'vertical' ? 'vertical' : 'none',\n useNativeFieldSizing: nativeAttr === 'false' ? false : undefined,\n ...options\n };\n instances.push(new Autosize(el, merged));\n }\n\n return instances;\n }\n\n /**\n * Recalcule et applique la hauteur optimale de la zone de texte.\n */\n public update(): number {\n if (this.isDestroyed || !this.element || this.disabled) {\n return this.lastHeight;\n }\n return this.applyModeAndMeasure(true);\n }\n\n /**\n * Efface toute hauteur manuelle m\u00E9moris\u00E9e (mode `resize: 'vertical'`) et r\u00E9\u00E9value la taille.\n */\n public reset(): void {\n if (this.isDestroyed || !this.element) return;\n this.manualHeightPx = null;\n if (!this.disabled) {\n this.applyModeAndMeasure(true);\n }\n }\n\n /**\n * Active ou suspend le redimensionnement automatique tout en restaurant les styles d'origine \u00E0 la pause.\n */\n public setDisabled(disabled: boolean): void {\n if (this.isDestroyed || !this.element) return;\n const next = Boolean(disabled);\n if (this.disabled === next) return;\n this.disabled = next;\n if (next) {\n this.restoreInitialStyles();\n } else {\n this.applyModeAndMeasure(true);\n }\n }\n\n public isDisabled(): boolean {\n return this.disabled;\n }\n\n /**\n * Met \u00E0 jour les options \u00E0 la vol\u00E9e et applique le nouveau dimensionnement.\n */\n public updateOptions(options: Partial<AutosizeOptions>): void {\n if (this.isDestroyed || !options) return;\n const prevDisabled = this.disabled;\n this.options = { ...this.options, ...options };\n if (options.resize !== undefined) {\n this.options.resize = options.resize === 'vertical' ? 'vertical' : 'none';\n if (this.options.resize === 'none') {\n this.manualHeightPx = null;\n }\n }\n if (options.disabled !== undefined) {\n this.disabled = Boolean(options.disabled);\n }\n if (this.element) {\n if (this.disabled) {\n if (!prevDisabled) this.restoreInitialStyles();\n } else {\n this.applyModeAndMeasure(true);\n }\n }\n }\n\n /**\n * Audite la conformit\u00E9 WAI-ARIA / WCAG du `<textarea>` cibl\u00E9.\n */\n public override audit(): string[] {\n const warnings: string[] = [];\n const el = this.element;\n if (!el) {\n warnings.push('\u00C9l\u00E9ment cible introuvable ou non valide (un <textarea> est requis).');\n return warnings;\n }\n\n const hasAriaLabel = Boolean(el.getAttribute('aria-label')?.trim());\n const hasAriaLabelledby = this.checkAriaIdReferences(el, 'aria-labelledby', warnings, true);\n const hasAssociatedLabel = this.hasNonEmptyLabel(el);\n\n if (!hasAriaLabel && !hasAriaLabelledby && !hasAssociatedLabel) {\n if (el.getAttribute('placeholder')?.trim()) {\n warnings.push(\n 'Un placeholder est pr\u00E9sent sans libell\u00E9 accessible persistant (<label>, aria-label ou aria-labelledby) \u2014 non conforme WCAG 3.3.2.'\n );\n } else {\n warnings.push(\n 'Aucun nom accessible d\u00E9tect\u00E9 sur le <textarea> (ajoutez un <label for=\"...\">, un <label> englobant, aria-label ou aria-labelledby).'\n );\n }\n }\n\n if (el.hasAttribute('aria-describedby')) {\n this.checkAriaIdReferences(el, 'aria-describedby', warnings);\n }\n if (el.hasAttribute('aria-errormessage')) {\n this.checkAriaIdReferences(el, 'aria-errormessage', warnings);\n }\n\n const tabIndexAttr = el.getAttribute('tabindex');\n if (tabIndexAttr !== null) {\n const parsed = Number.parseInt(tabIndexAttr, 10);\n if (Number.isFinite(parsed) && parsed > 0) {\n warnings.push(`\u00C9vitez tabindex=\"${parsed}\" (> 0) qui perturbe l'ordre de tabulation naturel.`);\n }\n }\n\n return warnings;\n }\n\n protected override getAuditPrefix(): string {\n return 'Wulf.Autosize';\n }\n\n protected override getAuditTargetLabel(): string {\n if (!this.element) return '<textarea>';\n return this.element.id ? `#${this.element.id}` : '<textarea>';\n }\n\n /**\n * D\u00E9truit l'instance : coupe tous les \u00E9couteurs/observers et restaure int\u00E9gralement le DOM d'origine.\n */\n public destroy(): void {\n if (this.isDestroyed) return;\n this.isDestroyed = true;\n\n if (this.rafId !== null && typeof cancelAnimationFrame === 'function') {\n cancelAnimationFrame(this.rafId);\n this.rafId = null;\n }\n if (this.resizeObserver) {\n this.resizeObserver.disconnect();\n this.resizeObserver = null;\n }\n if (this.abortController) {\n this.abortController.abort();\n this.abortController = null;\n }\n\n this.restoreInitialStyles();\n }\n\n // --- Impl\u00E9mentation interne ---\n\n private hasNonEmptyLabel(el: HTMLTextAreaElement): boolean {\n if (el.labels && el.labels.length > 0) {\n for (const lbl of Array.from(el.labels)) {\n if ((lbl.textContent?.trim() || '').length > 0) return true;\n }\n }\n if (el.id) {\n const root = typeof el.getRootNode === 'function' ? el.getRootNode() : document;\n const scope = (root && 'querySelector' in root ? root : document) as ParentNode;\n try {\n const explicit = scope.querySelector(`label[for=\"${safeCssEscape(el.id)}\"]`);\n if (explicit && (explicit.textContent?.trim() || '').length > 0) return true;\n } catch {\n // Ignorer\n }\n }\n const parentLabel = typeof el.closest === 'function' ? el.closest('label') : null;\n return Boolean(parentLabel && (parentLabel.textContent?.trim() || '').length > 0);\n }\n\n private captureInitialStyles(el: HTMLTextAreaElement): void {\n this.savedStyles = {\n height: el.style.height,\n blockSize: el.style.blockSize,\n minBlockSize: el.style.minBlockSize,\n maxBlockSize: el.style.maxBlockSize,\n overflowY: el.style.overflowY,\n resize: el.style.resize,\n fieldSizing: el.style.getPropertyValue('field-sizing'),\n hadDataAttr: el.hasAttribute('data-wulf-autosize'),\n prevDataAttr: el.getAttribute('data-wulf-autosize')\n };\n }\n\n private restoreInitialStyles(): void {\n const el = this.element;\n const saved = this.savedStyles;\n if (!el || !saved) return;\n\n el.classList.remove(\n 'wulf-autosize',\n 'wulf-autosize--native',\n 'wulf-autosize--fallback',\n 'wulf-autosize--resize-none',\n 'wulf-autosize--resize-vertical'\n );\n\n const restoreProp = (prop: string, val: string) => {\n if (val) el.style.setProperty(prop, val);\n else el.style.removeProperty(prop);\n };\n\n restoreProp('height', saved.height);\n restoreProp('block-size', saved.blockSize);\n restoreProp('min-block-size', saved.minBlockSize);\n restoreProp('max-block-size', saved.maxBlockSize);\n restoreProp('overflow-y', saved.overflowY);\n restoreProp('resize', saved.resize);\n restoreProp('field-sizing', saved.fieldSizing);\n\n if (saved.hadDataAttr && saved.prevDataAttr !== null) {\n el.setAttribute('data-wulf-autosize', saved.prevDataAttr);\n } else if (!saved.hadDataAttr) {\n el.removeAttribute('data-wulf-autosize');\n } else {\n el.setAttribute('data-wulf-autosize', '');\n }\n }\n\n private bindEvents(): void {\n const el = this.element;\n if (!el || typeof window === 'undefined') return;\n\n this.abortController = new AbortController();\n const { signal } = this.abortController;\n\n const onTextChange = () => {\n if (!this.isDestroyed && !this.disabled && this.mode === 'fallback') {\n this.applyModeAndMeasure(true);\n }\n };\n\n el.addEventListener('input', onTextChange, { signal });\n el.addEventListener('change', onTextChange, { signal });\n\n if (el.form) {\n el.form.addEventListener(\n 'reset',\n () => {\n queueMicrotask(() => {\n if (!this.isDestroyed && !this.disabled) {\n this.manualHeightPx = null;\n this.applyModeAndMeasure(true);\n }\n });\n },\n { signal }\n );\n }\n\n const onPointerRelease = () => {\n if (!this.isDestroyed && !this.disabled && this.options.resize === 'vertical') {\n this.captureManualResizeIfNeeded();\n }\n };\n window.addEventListener('pointerup', onPointerRelease, { signal, passive: true });\n window.addEventListener('mouseup', onPointerRelease, { signal, passive: true });\n\n if (this.options.observeFonts !== false && typeof document !== 'undefined' && document.fonts?.ready) {\n document.fonts.ready\n .then(() => {\n if (!this.isDestroyed && !this.disabled) {\n this.applyModeAndMeasure(true);\n }\n })\n .catch(() => {\n // Ignorer \u00E9chec \u00E9ventuel de chargement d'une police tierce\n });\n }\n\n if (typeof ResizeObserver !== 'undefined') {\n this.resizeObserver = new ResizeObserver((entries) => {\n if (this.isDestroyed || this.disabled || !this.element) return;\n const entry = entries[0];\n if (!entry) return;\n\n const inlineSize =\n entry.borderBoxSize && entry.borderBoxSize[0]\n ? entry.borderBoxSize[0].inlineSize\n : entry.contentRect.width;\n const blockSize =\n entry.borderBoxSize && entry.borderBoxSize[0]\n ? entry.borderBoxSize[0].blockSize\n : entry.contentRect.height;\n\n if (this.mode === 'native') {\n if (blockSize > 0 && Math.abs(blockSize - this.lastHeight) >= 0.5) {\n const prev = this.lastHeight;\n this.lastHeight = blockSize;\n this.emitResize(blockSize, prev, this.isElementOverflowing(this.element));\n }\n return;\n }\n\n // Mode fallback : si variation de hauteur hors mesure, peut \u00EAtre un resize manuel\n if (!this.isMeasuring && this.options.resize === 'vertical') {\n this.captureManualResizeIfNeeded(blockSize);\n }\n\n // Anti-boucle ResizeObserver : ne recalculer QUE sur changement de largeur (inlineSize) ou apparition 0 -> >0\n const prevInline = this.lastInlineSize;\n const becameVisible = prevInline === 0 && inlineSize > 0;\n const widthChanged = prevInline !== null && Math.abs(inlineSize - prevInline) >= 0.5;\n this.lastInlineSize = inlineSize;\n\n if (becameVisible || widthChanged) {\n this.scheduleUpdate();\n }\n });\n this.resizeObserver.observe(el);\n }\n }\n\n private captureManualResizeIfNeeded(observedHeight?: number): void {\n const el = this.element;\n if (!el || this.isMeasuring || this.lastAppliedHeight === null) return;\n const inlineHeight = el.style.height;\n if (!inlineHeight) return;\n\n const parsedInline = inlineHeight.endsWith('px') ? parseFloat(inlineHeight) : NaN;\n let manualPx = Number.isFinite(parsedInline) && parsedInline > 0 ? parsedInline : NaN;\n if (!Number.isFinite(manualPx)) {\n const boxH = observedHeight ?? this.readBoundingHeight(el);\n const cs = typeof window !== 'undefined' && typeof window.getComputedStyle === 'function' ? window.getComputedStyle(el) : null;\n if (cs && cs.boxSizing !== 'border-box') {\n const pad = (parseFloat(cs.paddingTop) || 0) + (parseFloat(cs.paddingBottom) || 0);\n const brd = (parseFloat(cs.borderTopWidth) || 0) + (parseFloat(cs.borderBottomWidth) || 0);\n manualPx = Math.max(0, boxH - pad - brd);\n } else {\n manualPx = boxH;\n }\n }\n\n if (manualPx > 0 && Math.abs(manualPx - this.lastAppliedHeight) >= 2) {\n this.manualHeightPx = manualPx;\n this.lastAppliedHeight = manualPx;\n const overflowing = this.isElementOverflowing(el);\n el.style.overflowY = overflowing ? 'auto' : 'hidden';\n const boxHeight = observedHeight ?? this.readBoundingHeight(el);\n if (Math.abs(boxHeight - this.lastHeight) >= 0.5) {\n const prev = this.lastHeight;\n this.lastHeight = boxHeight;\n this.emitResize(boxHeight, prev, overflowing);\n }\n }\n }\n\n private scheduleUpdate(): void {\n if (this.rafId !== null) return;\n const schedule =\n typeof requestAnimationFrame === 'function' ? requestAnimationFrame : (cb: () => void) => setTimeout(cb, 0) as unknown as number;\n this.rafId = schedule(() => {\n this.rafId = null;\n if (!this.isDestroyed && !this.disabled) {\n this.applyModeAndMeasure(true);\n }\n });\n }\n\n private readBoundingHeight(el: HTMLTextAreaElement): number {\n return typeof el.getBoundingClientRect === 'function' ? el.getBoundingClientRect().height : 0;\n }\n\n private isElementOverflowing(el: HTMLTextAreaElement): boolean {\n return el.scrollHeight > el.clientHeight + 1;\n }\n\n private computeBounds(el: HTMLTextAreaElement): {\n minPx: number;\n maxPx: number;\n paddingY: number;\n borderY: number;\n isBorderBox: boolean;\n } {\n const cs = typeof window !== 'undefined' && typeof window.getComputedStyle === 'function' ? window.getComputedStyle(el) : null;\n const fontSize = cs ? parseFloat(cs.fontSize) || 16 : 16;\n const rawLh = cs ? parseFloat(cs.lineHeight) : NaN;\n const lineHeight = Number.isFinite(rawLh) && rawLh > 0 ? rawLh : fontSize * 1.2;\n\n const paddingY = cs ? (parseFloat(cs.paddingTop) || 0) + (parseFloat(cs.paddingBottom) || 0) : 0;\n const borderY = cs ? (parseFloat(cs.borderTopWidth) || 0) + (parseFloat(cs.borderBottomWidth) || 0) : 0;\n const isBorderBox = cs ? cs.boxSizing === 'border-box' : true;\n const extraVertical = isBorderBox ? paddingY + borderY : 0;\n\n const minRowsOpt = parsePositiveNum(this.options.minRows);\n const attrRows = parsePositiveInt(el.getAttribute('rows'));\n const effectiveMinRows = minRowsOpt ?? attrRows;\n const rowsMinPx = effectiveMinRows !== undefined ? effectiveMinRows * lineHeight + extraVertical : 0;\n const minHeightOpt = parsePositiveNum(this.options.minHeight) ?? 0;\n const minPx = Math.max(rowsMinPx, minHeightOpt);\n\n const maxRowsOpt = parsePositiveNum(this.options.maxRows);\n const rowsMaxPx = maxRowsOpt !== undefined ? maxRowsOpt * lineHeight + extraVertical : Infinity;\n const maxHeightOpt = parsePositiveNum(this.options.maxHeight) ?? Infinity;\n let maxPx = Math.min(rowsMaxPx, maxHeightOpt);\n\n if (maxPx < minPx) maxPx = minPx;\n return { minPx, maxPx, paddingY, borderY, isBorderBox };\n }\n\n private applyModeAndMeasure(emitEvents: boolean): number {\n const el = this.element;\n if (!el) return 0;\n\n const resizeMode: AutosizeResizeMode = this.options.resize === 'vertical' ? 'vertical' : 'none';\n const wantNative =\n this.options.useNativeFieldSizing !== false &&\n Autosize.supportsNativeFieldSizing() &&\n resizeMode === 'none' &&\n this.manualHeightPx === null;\n\n this.mode = wantNative ? 'native' : 'fallback';\n\n el.classList.add('wulf-autosize');\n el.classList.toggle('wulf-autosize--native', wantNative);\n el.classList.toggle('wulf-autosize--fallback', !wantNative);\n el.classList.toggle('wulf-autosize--resize-none', resizeMode === 'none');\n el.classList.toggle('wulf-autosize--resize-vertical', resizeMode === 'vertical');\n el.setAttribute('data-wulf-autosize', this.mode);\n\n const bounds = this.computeBounds(el);\n\n if (wantNative) {\n el.style.setProperty('field-sizing', 'content');\n el.style.blockSize = 'auto';\n el.style.resize = 'none';\n el.style.removeProperty('height');\n el.style.removeProperty('overflow-y');\n if (bounds.minPx > 0) el.style.minBlockSize = `${Math.ceil(bounds.minPx)}px`;\n else el.style.removeProperty('min-block-size');\n\n if (Number.isFinite(bounds.maxPx)) el.style.maxBlockSize = `${Math.ceil(bounds.maxPx)}px`;\n else el.style.removeProperty('max-block-size');\n\n const rect = typeof el.getBoundingClientRect === 'function' ? el.getBoundingClientRect() : null;\n if (rect) {\n this.lastInlineSize = rect.width;\n if (rect.height > 0) {\n const prev = this.lastHeight;\n this.lastHeight = rect.height;\n if (emitEvents && Math.abs(rect.height - prev) >= 0.5) {\n this.emitResize(rect.height, prev, this.isElementOverflowing(el));\n }\n }\n }\n return this.lastHeight;\n }\n\n // Mode fallback (et mode resize: 'vertical') : couper field-sizing\n el.style.removeProperty('field-sizing');\n el.style.removeProperty('block-size');\n el.style.removeProperty('min-block-size');\n el.style.removeProperty('max-block-size');\n el.style.resize = resizeMode;\n\n const rect = typeof el.getBoundingClientRect === 'function' ? el.getBoundingClientRect() : null;\n if (!el.isConnected || !rect || rect.width === 0) {\n this.lastInlineSize = rect ? rect.width : 0;\n return this.lastHeight;\n }\n this.lastInlineSize = rect.width;\n\n // Si l'utilisateur a choisi manuellement une hauteur via la poign\u00E9e verticale,\n // conserver strictement cette hauteur (m\u00EAme < minRows ou > maxRows) jusqu'\u00E0 reset()\n if (this.manualHeightPx !== null) {\n const locked = Math.ceil(this.manualHeightPx);\n el.style.height = `${locked}px`;\n this.lastAppliedHeight = locked;\n el.style.overflowY = this.isElementOverflowing(el) ? 'auto' : 'hidden';\n const boxH = this.readBoundingHeight(el);\n if (boxH > 0) this.lastHeight = boxH;\n return this.lastHeight;\n }\n\n const scrollSnap = captureScrollAncestors(el);\n const prevInlineHeight = el.style.height;\n\n this.isMeasuring = true;\n try {\n el.style.height = 'auto';\n const rawScrollHeight = el.scrollHeight;\n if (rawScrollHeight === 0) {\n el.style.height = prevInlineHeight;\n restoreScrollAncestors(scrollSnap);\n return this.lastHeight;\n }\n\n const contentHeight = bounds.isBorderBox\n ? rawScrollHeight + bounds.borderY\n : Math.max(0, rawScrollHeight - bounds.paddingY);\n\n const overflowing = Number.isFinite(bounds.maxPx) && contentHeight > bounds.maxPx + 0.5;\n const finalHeight = Math.ceil(Math.min(bounds.maxPx, Math.max(bounds.minPx, contentHeight)));\n\n el.style.height = `${finalHeight}px`;\n el.style.overflowY = overflowing ? 'auto' : 'hidden';\n this.lastAppliedHeight = finalHeight;\n\n restoreScrollAncestors(scrollSnap);\n\n const prev = this.lastHeight;\n this.lastHeight = finalHeight;\n if (emitEvents && Math.abs(finalHeight - prev) >= 0.5) {\n this.emitResize(finalHeight, prev, overflowing);\n }\n return finalHeight;\n } finally {\n this.isMeasuring = false;\n }\n }\n\n private emitResize(height: number, previousHeight: number, overflowing: boolean): void {\n const el = this.element;\n if (!el) return;\n const detail: AutosizeResizeDetail = {\n textarea: el,\n height,\n previousHeight,\n overflowing,\n mode: this.mode\n };\n if (typeof this.options.onResize === 'function') {\n try {\n this.options.onResize(detail);\n } catch (err) {\n console.error('[Wulf.Autosize] Erreur dans onResize :', err);\n }\n }\n if (typeof CustomEvent === 'function') {\n el.dispatchEvent(new CustomEvent<AutosizeResizeDetail>('wulf:autosize:resize', { detail, bubbles: true }));\n }\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;AC4BA,SAAS,iBAAiB,KAA6D;AACrF,MAAI,QAAQ,QAAQ,QAAQ,UAAa,QAAQ,GAAI,QAAO;AAC5D,QAAM,IAAI,OAAO,QAAQ,WAAW,MAAM,OAAO,GAAG;AACpD,SAAO,OAAO,SAAS,CAAC,KAAK,IAAI,IAAI,IAAI;AAC3C;AAEA,SAAS,iBAAiB,KAAoD;AAC5E,QAAM,IAAI,iBAAiB,GAAG;AAC9B,SAAO,MAAM,SAAY,KAAK,MAAM,CAAC,KAAK,SAAY;AACxD;AAEA,SAAS,gBAAgB,QAAkE;AACzF,MAAI,OAAO,aAAa,YAAa,QAAO;AAC5C,QAAM,KACJ,OAAO,WAAW,YACb,MAAM;AACP,QAAI;AACF,aAAO,SAAS,SAAS,cAAc,MAAM,IAAI;AAAA,IACnD,QAAQ;AACN,aAAO;AAAA,IACT;AAAA,EACF,GAAG,IACD;AACN,SAAO,OAAO,wBAAwB,eAAe,cAAc,sBAAsB,KAAK;AAChG;AAEA,SAAS,wBAAwB,IAA6B;AAC5D,MAAI,GAAG,aAAc,QAAO,GAAG;AAC/B,MAAI,GAAG,cAAe,QAAO,GAAG;AAChC,QAAM,OAAO,OAAO,GAAG,gBAAgB,aAAa,GAAG,YAAY,IAAI;AACvE,MAAI,OAAO,eAAe,eAAe,gBAAgB,cAAc,KAAK,gBAAgB,SAAS;AACnG,WAAO,KAAK;AAAA,EACd;AACA,SAAO;AACT;AAEA,SAAS,uBAAuB,IAA8E;AAC5G,QAAM,YAA8B,CAAC;AACrC,MAAI,OAAO,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