wulf.js 2.1.1 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +217 -11
- package/changelog.md +50 -0
- package/dist/anchor.esm.js +9 -0
- package/dist/anchor.esm.js.map +7 -0
- package/dist/anchor.global.js +695 -0
- package/dist/anchor.global.js.map +7 -0
- package/dist/anchor.global.min.js +6 -0
- package/dist/anchor.global.min.js.map +7 -0
- package/dist/autosize.css +1 -0
- package/dist/autosize.css.map +7 -0
- package/dist/autosize.esm.js +10 -0
- package/dist/autosize.esm.js.map +7 -0
- package/dist/autosize.global.js +657 -0
- package/dist/autosize.global.js.map +7 -0
- package/dist/autosize.global.min.js +6 -0
- package/dist/autosize.global.min.js.map +7 -0
- package/dist/autosize.layered.css +1 -0
- package/dist/autosize.layered.css.map +7 -0
- package/dist/chunks/chunk-22AIMRD5.js +119 -0
- package/dist/chunks/chunk-22AIMRD5.js.map +7 -0
- package/dist/chunks/chunk-5N2IRGDM.js +766 -0
- package/dist/chunks/chunk-5N2IRGDM.js.map +7 -0
- package/dist/chunks/chunk-72FVCNNZ.js +863 -0
- package/dist/chunks/chunk-72FVCNNZ.js.map +7 -0
- package/dist/chunks/chunk-AXZYYW7H.js +865 -0
- package/dist/chunks/chunk-AXZYYW7H.js.map +7 -0
- package/dist/chunks/chunk-CM3SBIVQ.js +1116 -0
- package/dist/chunks/chunk-CM3SBIVQ.js.map +7 -0
- package/dist/chunks/chunk-H4GRLGQ3.js +578 -0
- package/dist/chunks/chunk-H4GRLGQ3.js.map +7 -0
- package/dist/chunks/chunk-ITRU2RFV.js +1195 -0
- package/dist/chunks/chunk-ITRU2RFV.js.map +7 -0
- package/dist/chunks/chunk-NLUQZEL4.js +1029 -0
- package/dist/chunks/chunk-NLUQZEL4.js.map +7 -0
- package/dist/chunks/chunk-QV46A7FV.js +197 -0
- package/dist/chunks/chunk-QV46A7FV.js.map +7 -0
- package/dist/chunks/chunk-SXLUXN6W.js +612 -0
- package/dist/chunks/chunk-SXLUXN6W.js.map +7 -0
- package/dist/chunks/chunk-T2H4EJCW.js +621 -0
- package/dist/chunks/chunk-T2H4EJCW.js.map +7 -0
- package/dist/chunks/chunk-TILLYEF2.js +6044 -0
- package/dist/chunks/chunk-TILLYEF2.js.map +7 -0
- package/dist/chunks/chunk-VJO22BAT.js +72 -0
- package/dist/chunks/chunk-VJO22BAT.js.map +7 -0
- package/dist/chunks/chunk-ZGUU6DMM.js +77 -0
- package/dist/chunks/chunk-ZGUU6DMM.js.map +7 -0
- package/dist/focus-trap.esm.js +6 -594
- package/dist/focus-trap.esm.js.map +3 -3
- package/dist/focus-trap.global.js +176 -61
- package/dist/focus-trap.global.js.map +3 -3
- package/dist/focus-trap.global.min.js +4 -4
- package/dist/focus-trap.global.min.js.map +4 -4
- package/dist/index.esm.js +79 -10448
- package/dist/index.esm.js.map +4 -4
- package/dist/index.global.js +3660 -202
- package/dist/index.global.js.map +4 -4
- package/dist/index.global.min.js +6 -3
- package/dist/index.global.min.js.map +4 -4
- package/dist/mask.esm.js +16 -6094
- package/dist/mask.esm.js.map +4 -4
- package/dist/mask.global.js +44 -55
- package/dist/mask.global.js.map +3 -3
- package/dist/mask.global.min.js +3 -3
- package/dist/mask.global.min.js.map +4 -4
- package/dist/masonry.esm.js +15 -1158
- package/dist/masonry.esm.js.map +4 -4
- package/dist/masonry.global.js +84 -94
- package/dist/masonry.global.js.map +3 -3
- package/dist/masonry.global.min.js +4 -4
- package/dist/masonry.global.min.js.map +4 -4
- package/dist/scroll.css +1 -1
- package/dist/scroll.css.map +2 -2
- package/dist/scroll.esm.js +14 -1252
- package/dist/scroll.esm.js.map +3 -3
- package/dist/scroll.global.js +64 -58
- package/dist/scroll.global.js.map +3 -3
- package/dist/scroll.global.min.js +3 -3
- package/dist/scroll.global.min.js.map +4 -4
- package/dist/scroll.layered.css +1 -1
- package/dist/scroll.layered.css.map +2 -2
- package/dist/shortcut.esm.js +6 -901
- package/dist/shortcut.esm.js.map +4 -4
- package/dist/shortcut.global.js +43 -36
- package/dist/shortcut.global.js.map +3 -3
- package/dist/shortcut.global.min.js +6 -3
- package/dist/shortcut.global.min.js.map +4 -4
- package/dist/size-report.json +319 -0
- package/dist/sortable.css +1 -0
- package/dist/sortable.css.map +7 -0
- package/dist/sortable.esm.js +22 -0
- package/dist/sortable.esm.js.map +7 -0
- package/dist/sortable.global.js +1477 -0
- package/dist/sortable.global.js.map +7 -0
- package/dist/sortable.global.min.js +6 -0
- package/dist/sortable.global.min.js.map +7 -0
- package/dist/sortable.layered.css +1 -0
- package/dist/sortable.layered.css.map +7 -0
- package/dist/sri-manifest.json +64 -0
- package/dist/toast.css +1 -1
- package/dist/toast.css.map +2 -2
- package/dist/toast.esm.js +19 -1208
- package/dist/toast.esm.js.map +3 -3
- package/dist/toast.global.js +314 -111
- package/dist/toast.global.js.map +3 -3
- package/dist/toast.global.min.js +3 -3
- package/dist/toast.global.min.js.map +4 -4
- package/dist/toast.layered.css +1 -1
- package/dist/toast.layered.css.map +2 -2
- package/dist/types/anchor/Anchor.d.ts +41 -0
- package/dist/types/anchor/index.d.ts +3 -0
- package/dist/types/anchor/types.d.ts +115 -0
- package/dist/types/autosize/Autosize.d.ts +71 -0
- package/dist/types/autosize/index.d.ts +3 -0
- package/dist/types/autosize/types.d.ts +66 -0
- package/dist/types/common/AuditableComponent.d.ts +1 -1
- package/dist/types/common/registry.d.ts +40 -0
- package/dist/types/focus-trap/FocusTrap.d.ts +3 -1
- package/dist/types/index.d.ts +13 -1
- package/dist/types/scroll/types.d.ts +6 -0
- package/dist/types/shortcut/ShortcutManager.d.ts +2 -0
- package/dist/types/shortcut/types.d.ts +5 -0
- package/dist/types/sortable/Sortable.d.ts +75 -0
- package/dist/types/sortable/i18n/en.d.ts +2 -0
- package/dist/types/sortable/i18n/fr.d.ts +2 -0
- package/dist/types/sortable/i18n/index.d.ts +9 -0
- package/dist/types/sortable/i18n/types.d.ts +15 -0
- package/dist/types/sortable/index.d.ts +4 -0
- package/dist/types/sortable/types.d.ts +112 -0
- package/dist/types/toast/Toast.d.ts +6 -1
- package/dist/types/toast/ToastInstance.d.ts +7 -0
- package/dist/types/toast/ToastManager.d.ts +2 -2
- package/dist/types/toast/types.d.ts +27 -1
- package/dist/types/undo/UndoManager.d.ts +112 -0
- package/dist/types/undo/i18n/en.d.ts +2 -0
- package/dist/types/undo/i18n/fr.d.ts +2 -0
- package/dist/types/undo/i18n/index.d.ts +9 -0
- package/dist/types/undo/i18n/types.d.ts +6 -0
- package/dist/types/undo/index.d.ts +5 -0
- package/dist/types/undo/types.d.ts +106 -0
- package/dist/undo.esm.js +23 -0
- package/dist/undo.esm.js.map +7 -0
- package/dist/undo.global.js +1029 -0
- package/dist/undo.global.js.map +7 -0
- package/dist/undo.global.min.js +6 -0
- package/dist/undo.global.min.js.map +7 -0
- package/package.json +54 -5
|
@@ -0,0 +1,657 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __WulfIIFE = (() => {
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/autosize/index.ts
|
|
22
|
+
var index_exports = {};
|
|
23
|
+
__export(index_exports, {
|
|
24
|
+
Autosize: () => Autosize,
|
|
25
|
+
default: () => Autosize
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// src/common/AuditableComponent.ts
|
|
29
|
+
var AuditableComponent = class {
|
|
30
|
+
/**
|
|
31
|
+
* Indication affichée en pied de warning pour expliquer comment désactiver l'audit.
|
|
32
|
+
*/
|
|
33
|
+
getAuditDisableHint() {
|
|
34
|
+
return "Passez { audit: false } dans les options pour d\xE9sactiver cet avertissement";
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Exécute l'audit d'accessibilité et émet un avertissement standardisé dans la console
|
|
38
|
+
* si l'audit est activé et que des contraintes manquent.
|
|
39
|
+
*/
|
|
40
|
+
runAuditWarning(enabled = true) {
|
|
41
|
+
if (!enabled) return [];
|
|
42
|
+
const warnings = this.audit();
|
|
43
|
+
if (warnings.length > 0 && typeof console !== "undefined" && typeof console.warn === "function") {
|
|
44
|
+
console.warn(
|
|
45
|
+
`[${this.getAuditPrefix()}] Audit d'accessibilit\xE9 \u2014 ${warnings.length} contrainte(s) manquante(s) sur ${this.getAuditTargetLabel()} :
|
|
46
|
+
` + warnings.map((w) => ` - ${w}`).join("\n") + `
|
|
47
|
+
(${this.getAuditDisableHint()})`
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
return warnings;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Vérifie si un attribut de référence d'IDs ARIA (ex: aria-labelledby, aria-describedby, aria-errormessage)
|
|
54
|
+
* pointe vers des éléments réellement présents dans le document (et optionnellement non vides).
|
|
55
|
+
*/
|
|
56
|
+
checkAriaIdReferences(element, attrName, warnings, requireNonEmptyText = false) {
|
|
57
|
+
const rawValue = element.getAttribute(attrName)?.trim();
|
|
58
|
+
if (!rawValue) return false;
|
|
59
|
+
const doc = element.ownerDocument || document;
|
|
60
|
+
const root = typeof element.getRootNode === "function" ? element.getRootNode() : doc;
|
|
61
|
+
const ids = rawValue.split(/\s+/).filter(Boolean);
|
|
62
|
+
const targets = ids.map(
|
|
63
|
+
(id) => typeof ShadowRoot !== "undefined" && root instanceof ShadowRoot ? root.getElementById(id) : doc.getElementById(id)
|
|
64
|
+
);
|
|
65
|
+
const allFound = ids.length > 0 && targets.every((el) => Boolean(el));
|
|
66
|
+
if (!allFound) {
|
|
67
|
+
warnings.push(
|
|
68
|
+
`Attribut ${attrName}="${rawValue}" invalide : l'\xE9l\xE9ment cible est introuvable dans le DOM.`
|
|
69
|
+
);
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
if (requireNonEmptyText) {
|
|
73
|
+
const hasNonEmptyText = targets.some((el) => {
|
|
74
|
+
if (!el) return false;
|
|
75
|
+
const text = el.textContent?.trim() || el.getAttribute("aria-label")?.trim() || "";
|
|
76
|
+
return text.length > 0;
|
|
77
|
+
});
|
|
78
|
+
if (!hasNonEmptyText) {
|
|
79
|
+
warnings.push(
|
|
80
|
+
`Attribut ${attrName}="${rawValue}" invalide : l'\xE9l\xE9ment cible ne contient aucun texte accessible.`
|
|
81
|
+
);
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
// src/common/dom.ts
|
|
90
|
+
function safeCssEscape(value) {
|
|
91
|
+
if (typeof CSS !== "undefined" && typeof CSS.escape === "function") {
|
|
92
|
+
return CSS.escape(value);
|
|
93
|
+
}
|
|
94
|
+
return String(value).replace(/["\\\u0000-\u001F\u007F]/g, "\\$&");
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// src/autosize/Autosize.ts
|
|
98
|
+
function parsePositiveNum(val) {
|
|
99
|
+
if (val === null || val === void 0 || val === "") return void 0;
|
|
100
|
+
const n = typeof val === "number" ? val : Number(val);
|
|
101
|
+
return Number.isFinite(n) && n > 0 ? n : void 0;
|
|
102
|
+
}
|
|
103
|
+
function parsePositiveInt(val) {
|
|
104
|
+
const n = parsePositiveNum(val);
|
|
105
|
+
return n !== void 0 ? Math.floor(n) || void 0 : void 0;
|
|
106
|
+
}
|
|
107
|
+
function resolveTextarea(target) {
|
|
108
|
+
if (typeof document === "undefined") return null;
|
|
109
|
+
const el = typeof target === "string" ? (() => {
|
|
110
|
+
try {
|
|
111
|
+
return target ? document.querySelector(target) : null;
|
|
112
|
+
} catch {
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
})() : target;
|
|
116
|
+
return typeof HTMLTextAreaElement !== "undefined" && el instanceof HTMLTextAreaElement ? el : null;
|
|
117
|
+
}
|
|
118
|
+
function getParentCrossingShadow(el) {
|
|
119
|
+
if (el.assignedSlot) return el.assignedSlot;
|
|
120
|
+
if (el.parentElement) return el.parentElement;
|
|
121
|
+
const root = typeof el.getRootNode === "function" ? el.getRootNode() : null;
|
|
122
|
+
if (typeof ShadowRoot !== "undefined" && root instanceof ShadowRoot && root.host instanceof Element) {
|
|
123
|
+
return root.host;
|
|
124
|
+
}
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
function captureScrollAncestors(el) {
|
|
128
|
+
const ancestors = [];
|
|
129
|
+
let curr = getParentCrossingShadow(el);
|
|
130
|
+
while (curr) {
|
|
131
|
+
if (curr.scrollTop !== 0 || curr.scrollLeft !== 0) {
|
|
132
|
+
ancestors.push({ el: curr, top: curr.scrollTop, left: curr.scrollLeft });
|
|
133
|
+
} else if (typeof window !== "undefined" && typeof window.getComputedStyle === "function") {
|
|
134
|
+
const oy = window.getComputedStyle(curr).overflowY;
|
|
135
|
+
if (oy === "auto" || oy === "scroll" || oy === "overlay") {
|
|
136
|
+
ancestors.push({ el: curr, top: curr.scrollTop, left: curr.scrollLeft });
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
curr = getParentCrossingShadow(curr);
|
|
140
|
+
}
|
|
141
|
+
const winX = typeof window !== "undefined" ? window.scrollX : 0;
|
|
142
|
+
const winY = typeof window !== "undefined" ? window.scrollY : 0;
|
|
143
|
+
return { ancestors, winX, winY };
|
|
144
|
+
}
|
|
145
|
+
function restoreScrollAncestors(snap) {
|
|
146
|
+
for (const item of snap.ancestors) {
|
|
147
|
+
if (item.el.scrollTop !== item.top) item.el.scrollTop = item.top;
|
|
148
|
+
if (item.el.scrollLeft !== item.left) item.el.scrollLeft = item.left;
|
|
149
|
+
}
|
|
150
|
+
if (typeof window !== "undefined" && (window.scrollX !== snap.winX || window.scrollY !== snap.winY)) {
|
|
151
|
+
window.scrollTo(snap.winX, snap.winY);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
var Autosize = class _Autosize extends AuditableComponent {
|
|
155
|
+
element;
|
|
156
|
+
mode = "fallback";
|
|
157
|
+
options;
|
|
158
|
+
disabled;
|
|
159
|
+
isDestroyed = false;
|
|
160
|
+
isMeasuring = false;
|
|
161
|
+
savedStyles = null;
|
|
162
|
+
abortController = null;
|
|
163
|
+
resizeObserver = null;
|
|
164
|
+
rafId = null;
|
|
165
|
+
lastInlineSize = null;
|
|
166
|
+
lastHeight = 0;
|
|
167
|
+
lastAppliedHeight = null;
|
|
168
|
+
manualHeightPx = null;
|
|
169
|
+
constructor(target, options = {}) {
|
|
170
|
+
super();
|
|
171
|
+
this.element = resolveTextarea(target);
|
|
172
|
+
this.options = {
|
|
173
|
+
useNativeFieldSizing: options.useNativeFieldSizing ?? true,
|
|
174
|
+
resize: options.resize === "vertical" ? "vertical" : "none",
|
|
175
|
+
observeFonts: options.observeFonts ?? true,
|
|
176
|
+
audit: options.audit ?? true,
|
|
177
|
+
...options
|
|
178
|
+
};
|
|
179
|
+
this.disabled = Boolean(this.options.disabled);
|
|
180
|
+
if (this.element) {
|
|
181
|
+
this.captureInitialStyles(this.element);
|
|
182
|
+
this.lastHeight = this.readBoundingHeight(this.element);
|
|
183
|
+
this.bindEvents();
|
|
184
|
+
if (!this.disabled) {
|
|
185
|
+
this.applyModeAndMeasure(false);
|
|
186
|
+
}
|
|
187
|
+
this.runAuditWarning(this.options.audit !== false);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Indique si le navigateur supporte nativement `field-sizing: content`.
|
|
192
|
+
*/
|
|
193
|
+
static supportsNativeFieldSizing() {
|
|
194
|
+
return typeof CSS !== "undefined" && typeof CSS.supports === "function" && CSS.supports("field-sizing", "content");
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Initialisation opt-in explicite de tous les `<textarea data-wulf-autosize>` dans `root`.
|
|
198
|
+
* Aucun effet de bord au chargement du module.
|
|
199
|
+
*/
|
|
200
|
+
static initAll(root, options = {}) {
|
|
201
|
+
if (typeof document === "undefined") return [];
|
|
202
|
+
const scope = root ?? document;
|
|
203
|
+
const nodes = scope.querySelectorAll("textarea[data-wulf-autosize]");
|
|
204
|
+
const instances = [];
|
|
205
|
+
for (const el of nodes) {
|
|
206
|
+
const resizeAttr = el.getAttribute("data-wulf-resize");
|
|
207
|
+
const nativeAttr = el.getAttribute("data-wulf-native");
|
|
208
|
+
const merged = {
|
|
209
|
+
minRows: parsePositiveInt(el.getAttribute("data-wulf-min-rows")),
|
|
210
|
+
maxRows: parsePositiveInt(el.getAttribute("data-wulf-max-rows")),
|
|
211
|
+
minHeight: parsePositiveNum(el.getAttribute("data-wulf-min-height")),
|
|
212
|
+
maxHeight: parsePositiveNum(el.getAttribute("data-wulf-max-height")),
|
|
213
|
+
resize: resizeAttr === "vertical" ? "vertical" : "none",
|
|
214
|
+
useNativeFieldSizing: nativeAttr === "false" ? false : void 0,
|
|
215
|
+
...options
|
|
216
|
+
};
|
|
217
|
+
instances.push(new _Autosize(el, merged));
|
|
218
|
+
}
|
|
219
|
+
return instances;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Recalcule et applique la hauteur optimale de la zone de texte.
|
|
223
|
+
*/
|
|
224
|
+
update() {
|
|
225
|
+
if (this.isDestroyed || !this.element || this.disabled) {
|
|
226
|
+
return this.lastHeight;
|
|
227
|
+
}
|
|
228
|
+
return this.applyModeAndMeasure(true);
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Efface toute hauteur manuelle mémorisée (mode `resize: 'vertical'`) et réévalue la taille.
|
|
232
|
+
*/
|
|
233
|
+
reset() {
|
|
234
|
+
if (this.isDestroyed || !this.element) return;
|
|
235
|
+
this.manualHeightPx = null;
|
|
236
|
+
if (!this.disabled) {
|
|
237
|
+
this.applyModeAndMeasure(true);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Active ou suspend le redimensionnement automatique tout en restaurant les styles d'origine à la pause.
|
|
242
|
+
*/
|
|
243
|
+
setDisabled(disabled) {
|
|
244
|
+
if (this.isDestroyed || !this.element) return;
|
|
245
|
+
const next = Boolean(disabled);
|
|
246
|
+
if (this.disabled === next) return;
|
|
247
|
+
this.disabled = next;
|
|
248
|
+
if (next) {
|
|
249
|
+
this.restoreInitialStyles();
|
|
250
|
+
} else {
|
|
251
|
+
this.applyModeAndMeasure(true);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
isDisabled() {
|
|
255
|
+
return this.disabled;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Met à jour les options à la volée et applique le nouveau dimensionnement.
|
|
259
|
+
*/
|
|
260
|
+
updateOptions(options) {
|
|
261
|
+
if (this.isDestroyed || !options) return;
|
|
262
|
+
const prevDisabled = this.disabled;
|
|
263
|
+
this.options = { ...this.options, ...options };
|
|
264
|
+
if (options.resize !== void 0) {
|
|
265
|
+
this.options.resize = options.resize === "vertical" ? "vertical" : "none";
|
|
266
|
+
if (this.options.resize === "none") {
|
|
267
|
+
this.manualHeightPx = null;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
if (options.disabled !== void 0) {
|
|
271
|
+
this.disabled = Boolean(options.disabled);
|
|
272
|
+
}
|
|
273
|
+
if (this.element) {
|
|
274
|
+
if (this.disabled) {
|
|
275
|
+
if (!prevDisabled) this.restoreInitialStyles();
|
|
276
|
+
} else {
|
|
277
|
+
this.applyModeAndMeasure(true);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Audite la conformité WAI-ARIA / WCAG du `<textarea>` ciblé.
|
|
283
|
+
*/
|
|
284
|
+
audit() {
|
|
285
|
+
const warnings = [];
|
|
286
|
+
const el = this.element;
|
|
287
|
+
if (!el) {
|
|
288
|
+
warnings.push("\xC9l\xE9ment cible introuvable ou non valide (un <textarea> est requis).");
|
|
289
|
+
return warnings;
|
|
290
|
+
}
|
|
291
|
+
const hasAriaLabel = Boolean(el.getAttribute("aria-label")?.trim());
|
|
292
|
+
const hasAriaLabelledby = this.checkAriaIdReferences(el, "aria-labelledby", warnings, true);
|
|
293
|
+
const hasAssociatedLabel = this.hasNonEmptyLabel(el);
|
|
294
|
+
if (!hasAriaLabel && !hasAriaLabelledby && !hasAssociatedLabel) {
|
|
295
|
+
if (el.getAttribute("placeholder")?.trim()) {
|
|
296
|
+
warnings.push(
|
|
297
|
+
"Un placeholder est pr\xE9sent sans libell\xE9 accessible persistant (<label>, aria-label ou aria-labelledby) \u2014 non conforme WCAG 3.3.2."
|
|
298
|
+
);
|
|
299
|
+
} else {
|
|
300
|
+
warnings.push(
|
|
301
|
+
'Aucun nom accessible d\xE9tect\xE9 sur le <textarea> (ajoutez un <label for="...">, un <label> englobant, aria-label ou aria-labelledby).'
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
if (el.hasAttribute("aria-describedby")) {
|
|
306
|
+
this.checkAriaIdReferences(el, "aria-describedby", warnings);
|
|
307
|
+
}
|
|
308
|
+
if (el.hasAttribute("aria-errormessage")) {
|
|
309
|
+
this.checkAriaIdReferences(el, "aria-errormessage", warnings);
|
|
310
|
+
}
|
|
311
|
+
const tabIndexAttr = el.getAttribute("tabindex");
|
|
312
|
+
if (tabIndexAttr !== null) {
|
|
313
|
+
const parsed = Number.parseInt(tabIndexAttr, 10);
|
|
314
|
+
if (Number.isFinite(parsed) && parsed > 0) {
|
|
315
|
+
warnings.push(`\xC9vitez tabindex="${parsed}" (> 0) qui perturbe l'ordre de tabulation naturel.`);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
return warnings;
|
|
319
|
+
}
|
|
320
|
+
getAuditPrefix() {
|
|
321
|
+
return "Wulf.Autosize";
|
|
322
|
+
}
|
|
323
|
+
getAuditTargetLabel() {
|
|
324
|
+
if (!this.element) return "<textarea>";
|
|
325
|
+
return this.element.id ? `#${this.element.id}` : "<textarea>";
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Détruit l'instance : coupe tous les écouteurs/observers et restaure intégralement le DOM d'origine.
|
|
329
|
+
*/
|
|
330
|
+
destroy() {
|
|
331
|
+
if (this.isDestroyed) return;
|
|
332
|
+
this.isDestroyed = true;
|
|
333
|
+
if (this.rafId !== null && typeof cancelAnimationFrame === "function") {
|
|
334
|
+
cancelAnimationFrame(this.rafId);
|
|
335
|
+
this.rafId = null;
|
|
336
|
+
}
|
|
337
|
+
if (this.resizeObserver) {
|
|
338
|
+
this.resizeObserver.disconnect();
|
|
339
|
+
this.resizeObserver = null;
|
|
340
|
+
}
|
|
341
|
+
if (this.abortController) {
|
|
342
|
+
this.abortController.abort();
|
|
343
|
+
this.abortController = null;
|
|
344
|
+
}
|
|
345
|
+
this.restoreInitialStyles();
|
|
346
|
+
}
|
|
347
|
+
// --- Implémentation interne ---
|
|
348
|
+
hasNonEmptyLabel(el) {
|
|
349
|
+
if (el.labels && el.labels.length > 0) {
|
|
350
|
+
for (const lbl of Array.from(el.labels)) {
|
|
351
|
+
if ((lbl.textContent?.trim() || "").length > 0) return true;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
if (el.id) {
|
|
355
|
+
const root = typeof el.getRootNode === "function" ? el.getRootNode() : document;
|
|
356
|
+
const scope = root && "querySelector" in root ? root : document;
|
|
357
|
+
try {
|
|
358
|
+
const explicit = scope.querySelector(`label[for="${safeCssEscape(el.id)}"]`);
|
|
359
|
+
if (explicit && (explicit.textContent?.trim() || "").length > 0) return true;
|
|
360
|
+
} catch {
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
const parentLabel = typeof el.closest === "function" ? el.closest("label") : null;
|
|
364
|
+
return Boolean(parentLabel && (parentLabel.textContent?.trim() || "").length > 0);
|
|
365
|
+
}
|
|
366
|
+
captureInitialStyles(el) {
|
|
367
|
+
this.savedStyles = {
|
|
368
|
+
height: el.style.height,
|
|
369
|
+
blockSize: el.style.blockSize,
|
|
370
|
+
minBlockSize: el.style.minBlockSize,
|
|
371
|
+
maxBlockSize: el.style.maxBlockSize,
|
|
372
|
+
overflowY: el.style.overflowY,
|
|
373
|
+
resize: el.style.resize,
|
|
374
|
+
fieldSizing: el.style.getPropertyValue("field-sizing"),
|
|
375
|
+
hadDataAttr: el.hasAttribute("data-wulf-autosize"),
|
|
376
|
+
prevDataAttr: el.getAttribute("data-wulf-autosize")
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
restoreInitialStyles() {
|
|
380
|
+
const el = this.element;
|
|
381
|
+
const saved = this.savedStyles;
|
|
382
|
+
if (!el || !saved) return;
|
|
383
|
+
el.classList.remove(
|
|
384
|
+
"wulf-autosize",
|
|
385
|
+
"wulf-autosize--native",
|
|
386
|
+
"wulf-autosize--fallback",
|
|
387
|
+
"wulf-autosize--resize-none",
|
|
388
|
+
"wulf-autosize--resize-vertical"
|
|
389
|
+
);
|
|
390
|
+
const restoreProp = (prop, val) => {
|
|
391
|
+
if (val) el.style.setProperty(prop, val);
|
|
392
|
+
else el.style.removeProperty(prop);
|
|
393
|
+
};
|
|
394
|
+
restoreProp("height", saved.height);
|
|
395
|
+
restoreProp("block-size", saved.blockSize);
|
|
396
|
+
restoreProp("min-block-size", saved.minBlockSize);
|
|
397
|
+
restoreProp("max-block-size", saved.maxBlockSize);
|
|
398
|
+
restoreProp("overflow-y", saved.overflowY);
|
|
399
|
+
restoreProp("resize", saved.resize);
|
|
400
|
+
restoreProp("field-sizing", saved.fieldSizing);
|
|
401
|
+
if (saved.hadDataAttr && saved.prevDataAttr !== null) {
|
|
402
|
+
el.setAttribute("data-wulf-autosize", saved.prevDataAttr);
|
|
403
|
+
} else if (!saved.hadDataAttr) {
|
|
404
|
+
el.removeAttribute("data-wulf-autosize");
|
|
405
|
+
} else {
|
|
406
|
+
el.setAttribute("data-wulf-autosize", "");
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
bindEvents() {
|
|
410
|
+
const el = this.element;
|
|
411
|
+
if (!el || typeof window === "undefined") return;
|
|
412
|
+
this.abortController = new AbortController();
|
|
413
|
+
const { signal } = this.abortController;
|
|
414
|
+
const onTextChange = () => {
|
|
415
|
+
if (!this.isDestroyed && !this.disabled && this.mode === "fallback") {
|
|
416
|
+
this.applyModeAndMeasure(true);
|
|
417
|
+
}
|
|
418
|
+
};
|
|
419
|
+
el.addEventListener("input", onTextChange, { signal });
|
|
420
|
+
el.addEventListener("change", onTextChange, { signal });
|
|
421
|
+
if (el.form) {
|
|
422
|
+
el.form.addEventListener(
|
|
423
|
+
"reset",
|
|
424
|
+
() => {
|
|
425
|
+
queueMicrotask(() => {
|
|
426
|
+
if (!this.isDestroyed && !this.disabled) {
|
|
427
|
+
this.manualHeightPx = null;
|
|
428
|
+
this.applyModeAndMeasure(true);
|
|
429
|
+
}
|
|
430
|
+
});
|
|
431
|
+
},
|
|
432
|
+
{ signal }
|
|
433
|
+
);
|
|
434
|
+
}
|
|
435
|
+
const onPointerRelease = () => {
|
|
436
|
+
if (!this.isDestroyed && !this.disabled && this.options.resize === "vertical") {
|
|
437
|
+
this.captureManualResizeIfNeeded();
|
|
438
|
+
}
|
|
439
|
+
};
|
|
440
|
+
window.addEventListener("pointerup", onPointerRelease, { signal, passive: true });
|
|
441
|
+
window.addEventListener("mouseup", onPointerRelease, { signal, passive: true });
|
|
442
|
+
if (this.options.observeFonts !== false && typeof document !== "undefined" && document.fonts?.ready) {
|
|
443
|
+
document.fonts.ready.then(() => {
|
|
444
|
+
if (!this.isDestroyed && !this.disabled) {
|
|
445
|
+
this.applyModeAndMeasure(true);
|
|
446
|
+
}
|
|
447
|
+
}).catch(() => {
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
if (typeof ResizeObserver !== "undefined") {
|
|
451
|
+
this.resizeObserver = new ResizeObserver((entries) => {
|
|
452
|
+
if (this.isDestroyed || this.disabled || !this.element) return;
|
|
453
|
+
const entry = entries[0];
|
|
454
|
+
if (!entry) return;
|
|
455
|
+
const inlineSize = entry.borderBoxSize && entry.borderBoxSize[0] ? entry.borderBoxSize[0].inlineSize : entry.contentRect.width;
|
|
456
|
+
const blockSize = entry.borderBoxSize && entry.borderBoxSize[0] ? entry.borderBoxSize[0].blockSize : entry.contentRect.height;
|
|
457
|
+
if (this.mode === "native") {
|
|
458
|
+
if (blockSize > 0 && Math.abs(blockSize - this.lastHeight) >= 0.5) {
|
|
459
|
+
const prev = this.lastHeight;
|
|
460
|
+
this.lastHeight = blockSize;
|
|
461
|
+
this.emitResize(blockSize, prev, this.isElementOverflowing(this.element));
|
|
462
|
+
}
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
if (!this.isMeasuring && this.options.resize === "vertical") {
|
|
466
|
+
this.captureManualResizeIfNeeded(blockSize);
|
|
467
|
+
}
|
|
468
|
+
const prevInline = this.lastInlineSize;
|
|
469
|
+
const becameVisible = prevInline === 0 && inlineSize > 0;
|
|
470
|
+
const widthChanged = prevInline !== null && Math.abs(inlineSize - prevInline) >= 0.5;
|
|
471
|
+
this.lastInlineSize = inlineSize;
|
|
472
|
+
if (becameVisible || widthChanged) {
|
|
473
|
+
this.scheduleUpdate();
|
|
474
|
+
}
|
|
475
|
+
});
|
|
476
|
+
this.resizeObserver.observe(el);
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
captureManualResizeIfNeeded(observedHeight) {
|
|
480
|
+
const el = this.element;
|
|
481
|
+
if (!el || this.isMeasuring || this.lastAppliedHeight === null) return;
|
|
482
|
+
const inlineHeight = el.style.height;
|
|
483
|
+
if (!inlineHeight) return;
|
|
484
|
+
const parsedInline = inlineHeight.endsWith("px") ? parseFloat(inlineHeight) : NaN;
|
|
485
|
+
let manualPx = Number.isFinite(parsedInline) && parsedInline > 0 ? parsedInline : NaN;
|
|
486
|
+
if (!Number.isFinite(manualPx)) {
|
|
487
|
+
const boxH = observedHeight ?? this.readBoundingHeight(el);
|
|
488
|
+
const cs = typeof window !== "undefined" && typeof window.getComputedStyle === "function" ? window.getComputedStyle(el) : null;
|
|
489
|
+
if (cs && cs.boxSizing !== "border-box") {
|
|
490
|
+
const pad = (parseFloat(cs.paddingTop) || 0) + (parseFloat(cs.paddingBottom) || 0);
|
|
491
|
+
const brd = (parseFloat(cs.borderTopWidth) || 0) + (parseFloat(cs.borderBottomWidth) || 0);
|
|
492
|
+
manualPx = Math.max(0, boxH - pad - brd);
|
|
493
|
+
} else {
|
|
494
|
+
manualPx = boxH;
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
if (manualPx > 0 && Math.abs(manualPx - this.lastAppliedHeight) >= 2) {
|
|
498
|
+
this.manualHeightPx = manualPx;
|
|
499
|
+
this.lastAppliedHeight = manualPx;
|
|
500
|
+
const overflowing = this.isElementOverflowing(el);
|
|
501
|
+
el.style.overflowY = overflowing ? "auto" : "hidden";
|
|
502
|
+
const boxHeight = observedHeight ?? this.readBoundingHeight(el);
|
|
503
|
+
if (Math.abs(boxHeight - this.lastHeight) >= 0.5) {
|
|
504
|
+
const prev = this.lastHeight;
|
|
505
|
+
this.lastHeight = boxHeight;
|
|
506
|
+
this.emitResize(boxHeight, prev, overflowing);
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
scheduleUpdate() {
|
|
511
|
+
if (this.rafId !== null) return;
|
|
512
|
+
const schedule = typeof requestAnimationFrame === "function" ? requestAnimationFrame : (cb) => setTimeout(cb, 0);
|
|
513
|
+
this.rafId = schedule(() => {
|
|
514
|
+
this.rafId = null;
|
|
515
|
+
if (!this.isDestroyed && !this.disabled) {
|
|
516
|
+
this.applyModeAndMeasure(true);
|
|
517
|
+
}
|
|
518
|
+
});
|
|
519
|
+
}
|
|
520
|
+
readBoundingHeight(el) {
|
|
521
|
+
return typeof el.getBoundingClientRect === "function" ? el.getBoundingClientRect().height : 0;
|
|
522
|
+
}
|
|
523
|
+
isElementOverflowing(el) {
|
|
524
|
+
return el.scrollHeight > el.clientHeight + 1;
|
|
525
|
+
}
|
|
526
|
+
computeBounds(el) {
|
|
527
|
+
const cs = typeof window !== "undefined" && typeof window.getComputedStyle === "function" ? window.getComputedStyle(el) : null;
|
|
528
|
+
const fontSize = cs ? parseFloat(cs.fontSize) || 16 : 16;
|
|
529
|
+
const rawLh = cs ? parseFloat(cs.lineHeight) : NaN;
|
|
530
|
+
const lineHeight = Number.isFinite(rawLh) && rawLh > 0 ? rawLh : fontSize * 1.2;
|
|
531
|
+
const paddingY = cs ? (parseFloat(cs.paddingTop) || 0) + (parseFloat(cs.paddingBottom) || 0) : 0;
|
|
532
|
+
const borderY = cs ? (parseFloat(cs.borderTopWidth) || 0) + (parseFloat(cs.borderBottomWidth) || 0) : 0;
|
|
533
|
+
const isBorderBox = cs ? cs.boxSizing === "border-box" : true;
|
|
534
|
+
const extraVertical = isBorderBox ? paddingY + borderY : 0;
|
|
535
|
+
const minRowsOpt = parsePositiveNum(this.options.minRows);
|
|
536
|
+
const attrRows = parsePositiveInt(el.getAttribute("rows"));
|
|
537
|
+
const effectiveMinRows = minRowsOpt ?? attrRows;
|
|
538
|
+
const rowsMinPx = effectiveMinRows !== void 0 ? effectiveMinRows * lineHeight + extraVertical : 0;
|
|
539
|
+
const minHeightOpt = parsePositiveNum(this.options.minHeight) ?? 0;
|
|
540
|
+
const minPx = Math.max(rowsMinPx, minHeightOpt);
|
|
541
|
+
const maxRowsOpt = parsePositiveNum(this.options.maxRows);
|
|
542
|
+
const rowsMaxPx = maxRowsOpt !== void 0 ? maxRowsOpt * lineHeight + extraVertical : Infinity;
|
|
543
|
+
const maxHeightOpt = parsePositiveNum(this.options.maxHeight) ?? Infinity;
|
|
544
|
+
let maxPx = Math.min(rowsMaxPx, maxHeightOpt);
|
|
545
|
+
if (maxPx < minPx) maxPx = minPx;
|
|
546
|
+
return { minPx, maxPx, paddingY, borderY, isBorderBox };
|
|
547
|
+
}
|
|
548
|
+
applyModeAndMeasure(emitEvents) {
|
|
549
|
+
const el = this.element;
|
|
550
|
+
if (!el) return 0;
|
|
551
|
+
const resizeMode = this.options.resize === "vertical" ? "vertical" : "none";
|
|
552
|
+
const wantNative = this.options.useNativeFieldSizing !== false && _Autosize.supportsNativeFieldSizing() && resizeMode === "none" && this.manualHeightPx === null;
|
|
553
|
+
this.mode = wantNative ? "native" : "fallback";
|
|
554
|
+
el.classList.add("wulf-autosize");
|
|
555
|
+
el.classList.toggle("wulf-autosize--native", wantNative);
|
|
556
|
+
el.classList.toggle("wulf-autosize--fallback", !wantNative);
|
|
557
|
+
el.classList.toggle("wulf-autosize--resize-none", resizeMode === "none");
|
|
558
|
+
el.classList.toggle("wulf-autosize--resize-vertical", resizeMode === "vertical");
|
|
559
|
+
el.setAttribute("data-wulf-autosize", this.mode);
|
|
560
|
+
const bounds = this.computeBounds(el);
|
|
561
|
+
if (wantNative) {
|
|
562
|
+
el.style.setProperty("field-sizing", "content");
|
|
563
|
+
el.style.blockSize = "auto";
|
|
564
|
+
el.style.resize = "none";
|
|
565
|
+
el.style.removeProperty("height");
|
|
566
|
+
el.style.removeProperty("overflow-y");
|
|
567
|
+
if (bounds.minPx > 0) el.style.minBlockSize = `${Math.ceil(bounds.minPx)}px`;
|
|
568
|
+
else el.style.removeProperty("min-block-size");
|
|
569
|
+
if (Number.isFinite(bounds.maxPx)) el.style.maxBlockSize = `${Math.ceil(bounds.maxPx)}px`;
|
|
570
|
+
else el.style.removeProperty("max-block-size");
|
|
571
|
+
const rect2 = typeof el.getBoundingClientRect === "function" ? el.getBoundingClientRect() : null;
|
|
572
|
+
if (rect2) {
|
|
573
|
+
this.lastInlineSize = rect2.width;
|
|
574
|
+
if (rect2.height > 0) {
|
|
575
|
+
const prev = this.lastHeight;
|
|
576
|
+
this.lastHeight = rect2.height;
|
|
577
|
+
if (emitEvents && Math.abs(rect2.height - prev) >= 0.5) {
|
|
578
|
+
this.emitResize(rect2.height, prev, this.isElementOverflowing(el));
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
return this.lastHeight;
|
|
583
|
+
}
|
|
584
|
+
el.style.removeProperty("field-sizing");
|
|
585
|
+
el.style.removeProperty("block-size");
|
|
586
|
+
el.style.removeProperty("min-block-size");
|
|
587
|
+
el.style.removeProperty("max-block-size");
|
|
588
|
+
el.style.resize = resizeMode;
|
|
589
|
+
const rect = typeof el.getBoundingClientRect === "function" ? el.getBoundingClientRect() : null;
|
|
590
|
+
if (!el.isConnected || !rect || rect.width === 0) {
|
|
591
|
+
this.lastInlineSize = rect ? rect.width : 0;
|
|
592
|
+
return this.lastHeight;
|
|
593
|
+
}
|
|
594
|
+
this.lastInlineSize = rect.width;
|
|
595
|
+
if (this.manualHeightPx !== null) {
|
|
596
|
+
const locked = Math.ceil(this.manualHeightPx);
|
|
597
|
+
el.style.height = `${locked}px`;
|
|
598
|
+
this.lastAppliedHeight = locked;
|
|
599
|
+
el.style.overflowY = this.isElementOverflowing(el) ? "auto" : "hidden";
|
|
600
|
+
const boxH = this.readBoundingHeight(el);
|
|
601
|
+
if (boxH > 0) this.lastHeight = boxH;
|
|
602
|
+
return this.lastHeight;
|
|
603
|
+
}
|
|
604
|
+
const scrollSnap = captureScrollAncestors(el);
|
|
605
|
+
const prevInlineHeight = el.style.height;
|
|
606
|
+
this.isMeasuring = true;
|
|
607
|
+
try {
|
|
608
|
+
el.style.height = "auto";
|
|
609
|
+
const rawScrollHeight = el.scrollHeight;
|
|
610
|
+
if (rawScrollHeight === 0) {
|
|
611
|
+
el.style.height = prevInlineHeight;
|
|
612
|
+
restoreScrollAncestors(scrollSnap);
|
|
613
|
+
return this.lastHeight;
|
|
614
|
+
}
|
|
615
|
+
const contentHeight = bounds.isBorderBox ? rawScrollHeight + bounds.borderY : Math.max(0, rawScrollHeight - bounds.paddingY);
|
|
616
|
+
const overflowing = Number.isFinite(bounds.maxPx) && contentHeight > bounds.maxPx + 0.5;
|
|
617
|
+
const finalHeight = Math.ceil(Math.min(bounds.maxPx, Math.max(bounds.minPx, contentHeight)));
|
|
618
|
+
el.style.height = `${finalHeight}px`;
|
|
619
|
+
el.style.overflowY = overflowing ? "auto" : "hidden";
|
|
620
|
+
this.lastAppliedHeight = finalHeight;
|
|
621
|
+
restoreScrollAncestors(scrollSnap);
|
|
622
|
+
const prev = this.lastHeight;
|
|
623
|
+
this.lastHeight = finalHeight;
|
|
624
|
+
if (emitEvents && Math.abs(finalHeight - prev) >= 0.5) {
|
|
625
|
+
this.emitResize(finalHeight, prev, overflowing);
|
|
626
|
+
}
|
|
627
|
+
return finalHeight;
|
|
628
|
+
} finally {
|
|
629
|
+
this.isMeasuring = false;
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
emitResize(height, previousHeight, overflowing) {
|
|
633
|
+
const el = this.element;
|
|
634
|
+
if (!el) return;
|
|
635
|
+
const detail = {
|
|
636
|
+
textarea: el,
|
|
637
|
+
height,
|
|
638
|
+
previousHeight,
|
|
639
|
+
overflowing,
|
|
640
|
+
mode: this.mode
|
|
641
|
+
};
|
|
642
|
+
if (typeof this.options.onResize === "function") {
|
|
643
|
+
try {
|
|
644
|
+
this.options.onResize(detail);
|
|
645
|
+
} catch (err) {
|
|
646
|
+
console.error("[Wulf.Autosize] Erreur dans onResize :", err);
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
if (typeof CustomEvent === "function") {
|
|
650
|
+
el.dispatchEvent(new CustomEvent("wulf:autosize:resize", { detail, bubbles: true }));
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
};
|
|
654
|
+
return __toCommonJS(index_exports);
|
|
655
|
+
})();
|
|
656
|
+
if (typeof window !== "undefined") { var __w = window.Wulf; if (!__w || typeof __w !== "object" || (typeof Node !== "undefined" && __w instanceof Node) || (typeof HTMLCollection !== "undefined" && __w instanceof HTMLCollection)) { __w = {}; window.Wulf = __w; } var __set = function(obj, key, val) { try { Object.defineProperty(obj, key, { value: val, writable: true, configurable: true, enumerable: true }); } catch (_) { try { obj[key] = val; } catch (__) {} } }; if (typeof __WulfIIFE !== "undefined" && __WulfIIFE) { var __e = __WulfIIFE; var __skip = ["__proto__","constructor","prototype"]; for (var k in __e) { if (Object.hasOwn(__e, k) && __skip.indexOf(k) === -1 && __w[k] === undefined) { __set(__w, k, __e[k]); } } if (__e.Autosize) __set(__w, "Autosize", Object.assign(__e.Autosize, { Autosize: __e.Autosize, default: __e.Autosize })); }}
|
|
657
|
+
//# sourceMappingURL=autosize.global.js.map
|