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.
Files changed (146) hide show
  1. package/README.md +217 -11
  2. package/changelog.md +50 -0
  3. package/dist/anchor.esm.js +9 -0
  4. package/dist/anchor.esm.js.map +7 -0
  5. package/dist/anchor.global.js +695 -0
  6. package/dist/anchor.global.js.map +7 -0
  7. package/dist/anchor.global.min.js +6 -0
  8. package/dist/anchor.global.min.js.map +7 -0
  9. package/dist/autosize.css +1 -0
  10. package/dist/autosize.css.map +7 -0
  11. package/dist/autosize.esm.js +10 -0
  12. package/dist/autosize.esm.js.map +7 -0
  13. package/dist/autosize.global.js +657 -0
  14. package/dist/autosize.global.js.map +7 -0
  15. package/dist/autosize.global.min.js +6 -0
  16. package/dist/autosize.global.min.js.map +7 -0
  17. package/dist/autosize.layered.css +1 -0
  18. package/dist/autosize.layered.css.map +7 -0
  19. package/dist/chunks/chunk-22AIMRD5.js +119 -0
  20. package/dist/chunks/chunk-22AIMRD5.js.map +7 -0
  21. package/dist/chunks/chunk-5N2IRGDM.js +766 -0
  22. package/dist/chunks/chunk-5N2IRGDM.js.map +7 -0
  23. package/dist/chunks/chunk-72FVCNNZ.js +863 -0
  24. package/dist/chunks/chunk-72FVCNNZ.js.map +7 -0
  25. package/dist/chunks/chunk-AXZYYW7H.js +865 -0
  26. package/dist/chunks/chunk-AXZYYW7H.js.map +7 -0
  27. package/dist/chunks/chunk-CM3SBIVQ.js +1116 -0
  28. package/dist/chunks/chunk-CM3SBIVQ.js.map +7 -0
  29. package/dist/chunks/chunk-H4GRLGQ3.js +578 -0
  30. package/dist/chunks/chunk-H4GRLGQ3.js.map +7 -0
  31. package/dist/chunks/chunk-ITRU2RFV.js +1195 -0
  32. package/dist/chunks/chunk-ITRU2RFV.js.map +7 -0
  33. package/dist/chunks/chunk-NLUQZEL4.js +1029 -0
  34. package/dist/chunks/chunk-NLUQZEL4.js.map +7 -0
  35. package/dist/chunks/chunk-QV46A7FV.js +197 -0
  36. package/dist/chunks/chunk-QV46A7FV.js.map +7 -0
  37. package/dist/chunks/chunk-SXLUXN6W.js +612 -0
  38. package/dist/chunks/chunk-SXLUXN6W.js.map +7 -0
  39. package/dist/chunks/chunk-T2H4EJCW.js +621 -0
  40. package/dist/chunks/chunk-T2H4EJCW.js.map +7 -0
  41. package/dist/chunks/chunk-TILLYEF2.js +6044 -0
  42. package/dist/chunks/chunk-TILLYEF2.js.map +7 -0
  43. package/dist/chunks/chunk-VJO22BAT.js +72 -0
  44. package/dist/chunks/chunk-VJO22BAT.js.map +7 -0
  45. package/dist/chunks/chunk-ZGUU6DMM.js +77 -0
  46. package/dist/chunks/chunk-ZGUU6DMM.js.map +7 -0
  47. package/dist/focus-trap.esm.js +6 -594
  48. package/dist/focus-trap.esm.js.map +3 -3
  49. package/dist/focus-trap.global.js +176 -61
  50. package/dist/focus-trap.global.js.map +3 -3
  51. package/dist/focus-trap.global.min.js +4 -4
  52. package/dist/focus-trap.global.min.js.map +4 -4
  53. package/dist/index.esm.js +79 -10448
  54. package/dist/index.esm.js.map +4 -4
  55. package/dist/index.global.js +3660 -202
  56. package/dist/index.global.js.map +4 -4
  57. package/dist/index.global.min.js +6 -3
  58. package/dist/index.global.min.js.map +4 -4
  59. package/dist/mask.esm.js +16 -6094
  60. package/dist/mask.esm.js.map +4 -4
  61. package/dist/mask.global.js +44 -55
  62. package/dist/mask.global.js.map +3 -3
  63. package/dist/mask.global.min.js +3 -3
  64. package/dist/mask.global.min.js.map +4 -4
  65. package/dist/masonry.esm.js +15 -1158
  66. package/dist/masonry.esm.js.map +4 -4
  67. package/dist/masonry.global.js +84 -94
  68. package/dist/masonry.global.js.map +3 -3
  69. package/dist/masonry.global.min.js +4 -4
  70. package/dist/masonry.global.min.js.map +4 -4
  71. package/dist/scroll.css +1 -1
  72. package/dist/scroll.css.map +2 -2
  73. package/dist/scroll.esm.js +14 -1252
  74. package/dist/scroll.esm.js.map +3 -3
  75. package/dist/scroll.global.js +64 -58
  76. package/dist/scroll.global.js.map +3 -3
  77. package/dist/scroll.global.min.js +3 -3
  78. package/dist/scroll.global.min.js.map +4 -4
  79. package/dist/scroll.layered.css +1 -1
  80. package/dist/scroll.layered.css.map +2 -2
  81. package/dist/shortcut.esm.js +6 -901
  82. package/dist/shortcut.esm.js.map +4 -4
  83. package/dist/shortcut.global.js +43 -36
  84. package/dist/shortcut.global.js.map +3 -3
  85. package/dist/shortcut.global.min.js +6 -3
  86. package/dist/shortcut.global.min.js.map +4 -4
  87. package/dist/size-report.json +319 -0
  88. package/dist/sortable.css +1 -0
  89. package/dist/sortable.css.map +7 -0
  90. package/dist/sortable.esm.js +22 -0
  91. package/dist/sortable.esm.js.map +7 -0
  92. package/dist/sortable.global.js +1477 -0
  93. package/dist/sortable.global.js.map +7 -0
  94. package/dist/sortable.global.min.js +6 -0
  95. package/dist/sortable.global.min.js.map +7 -0
  96. package/dist/sortable.layered.css +1 -0
  97. package/dist/sortable.layered.css.map +7 -0
  98. package/dist/sri-manifest.json +64 -0
  99. package/dist/toast.css +1 -1
  100. package/dist/toast.css.map +2 -2
  101. package/dist/toast.esm.js +19 -1208
  102. package/dist/toast.esm.js.map +3 -3
  103. package/dist/toast.global.js +314 -111
  104. package/dist/toast.global.js.map +3 -3
  105. package/dist/toast.global.min.js +3 -3
  106. package/dist/toast.global.min.js.map +4 -4
  107. package/dist/toast.layered.css +1 -1
  108. package/dist/toast.layered.css.map +2 -2
  109. package/dist/types/anchor/Anchor.d.ts +41 -0
  110. package/dist/types/anchor/index.d.ts +3 -0
  111. package/dist/types/anchor/types.d.ts +115 -0
  112. package/dist/types/autosize/Autosize.d.ts +71 -0
  113. package/dist/types/autosize/index.d.ts +3 -0
  114. package/dist/types/autosize/types.d.ts +66 -0
  115. package/dist/types/common/AuditableComponent.d.ts +1 -1
  116. package/dist/types/common/registry.d.ts +40 -0
  117. package/dist/types/focus-trap/FocusTrap.d.ts +3 -1
  118. package/dist/types/index.d.ts +13 -1
  119. package/dist/types/scroll/types.d.ts +6 -0
  120. package/dist/types/shortcut/ShortcutManager.d.ts +2 -0
  121. package/dist/types/shortcut/types.d.ts +5 -0
  122. package/dist/types/sortable/Sortable.d.ts +75 -0
  123. package/dist/types/sortable/i18n/en.d.ts +2 -0
  124. package/dist/types/sortable/i18n/fr.d.ts +2 -0
  125. package/dist/types/sortable/i18n/index.d.ts +9 -0
  126. package/dist/types/sortable/i18n/types.d.ts +15 -0
  127. package/dist/types/sortable/index.d.ts +4 -0
  128. package/dist/types/sortable/types.d.ts +112 -0
  129. package/dist/types/toast/Toast.d.ts +6 -1
  130. package/dist/types/toast/ToastInstance.d.ts +7 -0
  131. package/dist/types/toast/ToastManager.d.ts +2 -2
  132. package/dist/types/toast/types.d.ts +27 -1
  133. package/dist/types/undo/UndoManager.d.ts +112 -0
  134. package/dist/types/undo/i18n/en.d.ts +2 -0
  135. package/dist/types/undo/i18n/fr.d.ts +2 -0
  136. package/dist/types/undo/i18n/index.d.ts +9 -0
  137. package/dist/types/undo/i18n/types.d.ts +6 -0
  138. package/dist/types/undo/index.d.ts +5 -0
  139. package/dist/types/undo/types.d.ts +106 -0
  140. package/dist/undo.esm.js +23 -0
  141. package/dist/undo.esm.js.map +7 -0
  142. package/dist/undo.global.js +1029 -0
  143. package/dist/undo.global.js.map +7 -0
  144. package/dist/undo.global.min.js +6 -0
  145. package/dist/undo.global.min.js.map +7 -0
  146. package/package.json +54 -5
@@ -39,53 +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 stripBidiAndInvisibles(raw, maxLength = 4096) {
61
- const safeLimit = Math.max(0, maxLength);
62
- return String(raw ?? "").slice(0, safeLimit).replace(/[\u061C\u200B-\u200F\u202A-\u202E\u2066-\u2069\uFEFF]/g, "");
63
- }
64
- function getDeepActiveElement(root) {
65
- if (typeof document === "undefined") return null;
66
- let active = (root ?? document).activeElement;
67
- while (active && active.shadowRoot && active.shadowRoot.activeElement) {
68
- active = active.shadowRoot.activeElement;
69
- }
70
- return active && typeof active.focus === "function" ? active : null;
71
- }
72
- function safeMove(parent, node, referenceNode = null) {
73
- const moveBefore = parent.moveBefore;
74
- if (typeof moveBefore === "function" && node.isConnected && parent.isConnected && typeof parent.getRootNode === "function" && typeof node.getRootNode === "function" && parent.getRootNode() === node.getRootNode()) {
75
- try {
76
- moveBefore.call(parent, node, referenceNode);
77
- return;
78
- } catch {
79
- }
80
- }
81
- parent.insertBefore(node, referenceNode);
82
- }
83
- function isImeComposing(event) {
84
- return Boolean(
85
- event.isComposing || event.key === "Process" || event.key === "Enter" && event.keyCode === 229
86
- );
87
- }
88
-
89
42
  // src/common/AuditableComponent.ts
90
43
  var AuditableComponent = class {
91
44
  /**
@@ -147,6 +100,42 @@ var __WulfIIFE = (() => {
147
100
  }
148
101
  };
149
102
 
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) {
111
+ const safeLimit = Math.max(0, maxLength);
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
+ );
137
+ }
138
+
150
139
  // src/mask/paste.ts
151
140
  var MAX_PASTE_LENGTH = 4096;
152
141
  function sanitizePastedText(raw, maxLength = MAX_PASTE_LENGTH) {
@@ -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" ? document.createTextNode(n) : n);
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; } if (typeof __WulfIIFE !== "undefined" && __WulfIIFE) { for (var k in __WulfIIFE) { if (Object.hasOwn(__WulfIIFE, k) && k !== "__proto__" && k !== "constructor" && k !== "prototype" && __w[k] === undefined) { try { Object.defineProperty(__w, k, { value: __WulfIIFE[k], writable: true, configurable: true, enumerable: true }); } catch (_) { try { __w[k] = __WulfIIFE[k]; } catch (__) {} } } } } }
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