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
package/dist/mask.global.js
CHANGED
|
@@ -39,49 +39,6 @@ var __WulfIIFE = (() => {
|
|
|
39
39
|
stripBidiAndInvisibles: () => stripBidiAndInvisibles
|
|
40
40
|
});
|
|
41
41
|
|
|
42
|
-
// src/common/dom.ts
|
|
43
|
-
function getSafeWulfNamespace() {
|
|
44
|
-
if (typeof window === "undefined") return null;
|
|
45
|
-
const win = window;
|
|
46
|
-
const existing = win.Wulf;
|
|
47
|
-
if (!existing || typeof existing !== "object" || typeof Node !== "undefined" && existing instanceof Node || typeof HTMLCollection !== "undefined" && existing instanceof HTMLCollection) {
|
|
48
|
-
const fresh = {};
|
|
49
|
-
win.Wulf = fresh;
|
|
50
|
-
return fresh;
|
|
51
|
-
}
|
|
52
|
-
return existing;
|
|
53
|
-
}
|
|
54
|
-
function safeCssEscape(value) {
|
|
55
|
-
if (typeof CSS !== "undefined" && typeof CSS.escape === "function") {
|
|
56
|
-
return CSS.escape(value);
|
|
57
|
-
}
|
|
58
|
-
return String(value).replace(/["\\\u0000-\u001F\u007F]/g, "\\$&");
|
|
59
|
-
}
|
|
60
|
-
function getDeepActiveElement(root) {
|
|
61
|
-
if (typeof document === "undefined") return null;
|
|
62
|
-
let active = (root ?? document).activeElement;
|
|
63
|
-
while (active && active.shadowRoot && active.shadowRoot.activeElement) {
|
|
64
|
-
active = active.shadowRoot.activeElement;
|
|
65
|
-
}
|
|
66
|
-
return active && typeof active.focus === "function" ? active : null;
|
|
67
|
-
}
|
|
68
|
-
function safeMove(parent, node, referenceNode = null) {
|
|
69
|
-
const moveBefore = parent.moveBefore;
|
|
70
|
-
if (typeof moveBefore === "function" && node.isConnected && parent.isConnected && typeof parent.getRootNode === "function" && typeof node.getRootNode === "function" && parent.getRootNode() === node.getRootNode()) {
|
|
71
|
-
try {
|
|
72
|
-
moveBefore.call(parent, node, referenceNode);
|
|
73
|
-
return;
|
|
74
|
-
} catch {
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
parent.insertBefore(node, referenceNode);
|
|
78
|
-
}
|
|
79
|
-
function isImeComposing(event) {
|
|
80
|
-
return Boolean(
|
|
81
|
-
event.isComposing || event.key === "Process" || event.key === "Enter" && event.keyCode === 229
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
42
|
// src/common/AuditableComponent.ts
|
|
86
43
|
var AuditableComponent = class {
|
|
87
44
|
/**
|
|
@@ -143,12 +100,44 @@ var __WulfIIFE = (() => {
|
|
|
143
100
|
}
|
|
144
101
|
};
|
|
145
102
|
|
|
146
|
-
// src/
|
|
147
|
-
|
|
148
|
-
|
|
103
|
+
// src/common/dom.ts
|
|
104
|
+
function safeCssEscape(value) {
|
|
105
|
+
if (typeof CSS !== "undefined" && typeof CSS.escape === "function") {
|
|
106
|
+
return CSS.escape(value);
|
|
107
|
+
}
|
|
108
|
+
return String(value).replace(/["\\\u0000-\u001F\u007F]/g, "\\$&");
|
|
109
|
+
}
|
|
110
|
+
function stripBidiAndInvisibles(raw, maxLength = 4096) {
|
|
149
111
|
const safeLimit = Math.max(0, maxLength);
|
|
150
|
-
return String(raw ?? "").slice(0, safeLimit).replace(/[\u200B-\u200F\u202A-\u202E\u2066-\u2069\uFEFF]/g, "");
|
|
112
|
+
return String(raw ?? "").slice(0, safeLimit).replace(/[\u061C\u200B-\u200F\u202A-\u202E\u2066-\u2069\uFEFF]/g, "");
|
|
113
|
+
}
|
|
114
|
+
function getDeepActiveElement(root) {
|
|
115
|
+
if (typeof document === "undefined") return null;
|
|
116
|
+
let active = (root ?? document).activeElement;
|
|
117
|
+
while (active && active.shadowRoot && active.shadowRoot.activeElement) {
|
|
118
|
+
active = active.shadowRoot.activeElement;
|
|
119
|
+
}
|
|
120
|
+
return active && typeof active.focus === "function" ? active : null;
|
|
121
|
+
}
|
|
122
|
+
function safeMove(parent, node, referenceNode = null) {
|
|
123
|
+
const moveBefore = parent.moveBefore;
|
|
124
|
+
if (typeof moveBefore === "function" && node.isConnected && parent.isConnected && typeof parent.getRootNode === "function" && typeof node.getRootNode === "function" && parent.getRootNode() === node.getRootNode()) {
|
|
125
|
+
try {
|
|
126
|
+
moveBefore.call(parent, node, referenceNode);
|
|
127
|
+
return;
|
|
128
|
+
} catch {
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
parent.insertBefore(node, referenceNode);
|
|
132
|
+
}
|
|
133
|
+
function isImeComposing(event) {
|
|
134
|
+
return Boolean(
|
|
135
|
+
event.isComposing || event.key === "Process" || event.key === "Enter" && event.keyCode === 229
|
|
136
|
+
);
|
|
151
137
|
}
|
|
138
|
+
|
|
139
|
+
// src/mask/paste.ts
|
|
140
|
+
var MAX_PASTE_LENGTH = 4096;
|
|
152
141
|
function sanitizePastedText(raw, maxLength = MAX_PASTE_LENGTH) {
|
|
153
142
|
return stripBidiAndInvisibles(raw, maxLength).replace(/[\u00A0\u202F\u2007]/g, " ").replace(/[\u2013\u2014\u2212]/g, "-").trim();
|
|
154
143
|
}
|
|
@@ -204,7 +193,10 @@ var __WulfIIFE = (() => {
|
|
|
204
193
|
const shouldCreateWrapper = Boolean(options.createWrapper ?? dataCreateWrapper);
|
|
205
194
|
let effectiveWrapper = providedWrapper;
|
|
206
195
|
if (!effectiveWrapper && shouldCreateWrapper) {
|
|
207
|
-
const doc = this.input.ownerDocument || document;
|
|
196
|
+
const doc = this.input.ownerDocument || (typeof document !== "undefined" ? document : null);
|
|
197
|
+
if (!doc) {
|
|
198
|
+
throw new Error("[InputMask] Document DOM introuvable pour createWrapper.");
|
|
199
|
+
}
|
|
208
200
|
const span = doc.createElement("span");
|
|
209
201
|
span.className = "wulf-mask-wrapper wulf-mask-wrapper--auto";
|
|
210
202
|
if (this.input.parentNode) {
|
|
@@ -354,7 +346,7 @@ var __WulfIIFE = (() => {
|
|
|
354
346
|
}
|
|
355
347
|
onBaseFocus = () => {
|
|
356
348
|
this.isFocused = true;
|
|
357
|
-
if (this.options.selectAllOnFocus && this.input.value.length > 0) {
|
|
349
|
+
if (this.options.selectAllOnFocus && this.input.value.length > 0 && typeof window !== "undefined") {
|
|
358
350
|
if (this.focusSelectTimerId !== null) {
|
|
359
351
|
clearTimeout(this.focusSelectTimerId);
|
|
360
352
|
}
|
|
@@ -571,9 +563,10 @@ var __WulfIIFE = (() => {
|
|
|
571
563
|
if (typeof this.ghost.replaceChildren === "function") {
|
|
572
564
|
this.ghost.replaceChildren(...nodes);
|
|
573
565
|
} else {
|
|
566
|
+
const doc = this.ghost.ownerDocument || (typeof document !== "undefined" ? document : null);
|
|
574
567
|
this.ghost.textContent = "";
|
|
575
568
|
for (const n of nodes) {
|
|
576
|
-
this.ghost.appendChild(typeof n === "string" ?
|
|
569
|
+
this.ghost.appendChild(typeof n === "string" ? doc ? doc.createTextNode(n) : new Text(n) : n);
|
|
577
570
|
}
|
|
578
571
|
}
|
|
579
572
|
this.wrapper.classList.toggle("has-visible-ghost", nodes.length > 0);
|
|
@@ -6133,12 +6126,8 @@ var __WulfIIFE = (() => {
|
|
|
6133
6126
|
sanitizePastedText,
|
|
6134
6127
|
stripBidiAndInvisibles
|
|
6135
6128
|
};
|
|
6136
|
-
var wulfNamespace = getSafeWulfNamespace();
|
|
6137
|
-
if (wulfNamespace) {
|
|
6138
|
-
wulfNamespace.Mask = Mask;
|
|
6139
|
-
}
|
|
6140
6129
|
var index_default = InputMask;
|
|
6141
6130
|
return __toCommonJS(index_exports);
|
|
6142
6131
|
})();
|
|
6143
|
-
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; }
|
|
6132
|
+
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.Mask) __set(__w, "Mask", __e.Mask); }}
|
|
6144
6133
|
//# sourceMappingURL=mask.global.js.map
|