wulf.js 0.0.0-stage → 1.8.4
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/LICENSE +21 -0
- package/README.md +870 -2
- package/changelog.md +291 -0
- package/dist/index.cjs.js +4247 -0
- package/dist/index.cjs.js.map +7 -0
- package/dist/index.esm.js +4230 -0
- package/dist/index.esm.js.map +7 -0
- package/dist/index.global.js +4250 -0
- package/dist/index.global.js.map +7 -0
- package/dist/index.global.min.js +3 -0
- package/dist/index.global.min.js.map +7 -0
- package/dist/mask.cjs.js +2782 -0
- package/dist/mask.cjs.js.map +7 -0
- package/dist/mask.css +1 -0
- package/dist/mask.css.map +7 -0
- package/dist/mask.esm.js +2759 -0
- package/dist/mask.esm.js.map +7 -0
- package/dist/mask.global.js +2785 -0
- package/dist/mask.global.js.map +7 -0
- package/dist/mask.global.min.js +3 -0
- package/dist/mask.global.min.js.map +7 -0
- package/dist/masonry.cjs.js +572 -0
- package/dist/masonry.cjs.js.map +7 -0
- package/dist/masonry.css +1 -0
- package/dist/masonry.css.map +7 -0
- package/dist/masonry.esm.js +549 -0
- package/dist/masonry.esm.js.map +7 -0
- package/dist/masonry.global.js +575 -0
- package/dist/masonry.global.js.map +7 -0
- package/dist/masonry.global.min.js +3 -0
- package/dist/masonry.global.min.js.map +7 -0
- package/dist/scroll.cjs.js +500 -0
- package/dist/scroll.cjs.js.map +7 -0
- package/dist/scroll.css +1 -0
- package/dist/scroll.css.map +7 -0
- package/dist/scroll.esm.js +477 -0
- package/dist/scroll.esm.js.map +7 -0
- package/dist/scroll.global.js +503 -0
- package/dist/scroll.global.js.map +7 -0
- package/dist/scroll.global.min.js +3 -0
- package/dist/scroll.global.min.js.map +7 -0
- package/dist/toast.cjs.js +433 -0
- package/dist/toast.cjs.js.map +7 -0
- package/dist/toast.css +1 -0
- package/dist/toast.css.map +7 -0
- package/dist/toast.esm.js +410 -0
- package/dist/toast.esm.js.map +7 -0
- package/dist/toast.global.js +436 -0
- package/dist/toast.global.js.map +7 -0
- package/dist/toast.global.min.js +3 -0
- package/dist/toast.global.min.js.map +7 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/mask/AmountEngine.d.ts +72 -0
- package/dist/types/mask/BaseInputMask.d.ts +173 -0
- package/dist/types/mask/EmailEngine.d.ts +42 -0
- package/dist/types/mask/InputAmountMask.d.ts +70 -0
- package/dist/types/mask/InputEmailMask.d.ts +65 -0
- package/dist/types/mask/InputMask.d.ts +116 -0
- package/dist/types/mask/MaskEngine.d.ts +102 -0
- package/dist/types/mask/MaskHistory.d.ts +48 -0
- package/dist/types/mask/MaskKeyboard.d.ts +28 -0
- package/dist/types/mask/index.d.ts +28 -0
- package/dist/types/mask/types.d.ts +137 -0
- package/dist/types/masonry/LayoutEngine.d.ts +29 -0
- package/dist/types/masonry/Masonry.d.ts +63 -0
- package/dist/types/masonry/index.d.ts +7 -0
- package/dist/types/masonry/types.d.ts +125 -0
- package/dist/types/scroll/ScrollBlock.d.ts +94 -0
- package/dist/types/scroll/index.d.ts +8 -0
- package/dist/types/scroll/types.d.ts +76 -0
- package/dist/types/toast/Toast.d.ts +15 -0
- package/dist/types/toast/ToastInstance.d.ts +52 -0
- package/dist/types/toast/ToastManager.d.ts +34 -0
- package/dist/types/toast/index.d.ts +6 -0
- package/dist/types/toast/types.d.ts +68 -0
- package/package.json +99 -4
|
@@ -0,0 +1,549 @@
|
|
|
1
|
+
// src/masonry/LayoutEngine.ts
|
|
2
|
+
var LayoutEngine = class {
|
|
3
|
+
/**
|
|
4
|
+
* Normalise les gouttières horizontales et verticales.
|
|
5
|
+
*/
|
|
6
|
+
static parseGutter(gutterOption) {
|
|
7
|
+
if (typeof gutterOption === "number") {
|
|
8
|
+
return { x: Math.max(0, gutterOption), y: Math.max(0, gutterOption) };
|
|
9
|
+
}
|
|
10
|
+
if (gutterOption && typeof gutterOption === "object") {
|
|
11
|
+
return {
|
|
12
|
+
x: Math.max(0, Number(gutterOption.x) || 0),
|
|
13
|
+
y: Math.max(0, Number(gutterOption.y) || 0)
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
return { x: 0, y: 0 };
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Résout la largeur effective d'une colonne en pixels.
|
|
20
|
+
*/
|
|
21
|
+
static resolveColumnWidth(container, firstItem, columnWidthOption) {
|
|
22
|
+
if (typeof columnWidthOption === "number" && columnWidthOption > 0) {
|
|
23
|
+
return columnWidthOption;
|
|
24
|
+
}
|
|
25
|
+
if (typeof columnWidthOption === "string") {
|
|
26
|
+
const el = container.querySelector(columnWidthOption);
|
|
27
|
+
if (el) {
|
|
28
|
+
const w = el.getBoundingClientRect().width;
|
|
29
|
+
if (w > 0) return w;
|
|
30
|
+
}
|
|
31
|
+
const parsed = parseFloat(columnWidthOption);
|
|
32
|
+
if (!isNaN(parsed) && parsed > 0) {
|
|
33
|
+
if (columnWidthOption.endsWith("%")) {
|
|
34
|
+
const containerW2 = container.getBoundingClientRect().width;
|
|
35
|
+
return containerW2 * parsed / 100;
|
|
36
|
+
}
|
|
37
|
+
return parsed;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
if (columnWidthOption instanceof HTMLElement) {
|
|
41
|
+
const w = columnWidthOption.getBoundingClientRect().width;
|
|
42
|
+
if (w > 0) return w;
|
|
43
|
+
}
|
|
44
|
+
if (firstItem) {
|
|
45
|
+
const w = firstItem.getBoundingClientRect().width;
|
|
46
|
+
if (w > 0) return w;
|
|
47
|
+
}
|
|
48
|
+
const containerW = container.getBoundingClientRect().width;
|
|
49
|
+
return containerW > 0 ? containerW : 200;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Extrait le facteur d'étalement (span) d'un item sur plusieurs colonnes.
|
|
53
|
+
*/
|
|
54
|
+
static getItemSpan(item, colWidth, gutterX, maxCols) {
|
|
55
|
+
const dataSpan = item.getAttribute("data-masonry-span") || item.dataset.masonrySpan;
|
|
56
|
+
if (dataSpan) {
|
|
57
|
+
const parsed = parseInt(dataSpan, 10);
|
|
58
|
+
if (!isNaN(parsed) && parsed > 0) {
|
|
59
|
+
return Math.min(maxCols, parsed);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
const match = item.className.match(/(?:^|\s)(?:span|col-span)-(\d+)(?:\s|$)/);
|
|
63
|
+
if (match && match[1]) {
|
|
64
|
+
const parsed = parseInt(match[1], 10);
|
|
65
|
+
if (!isNaN(parsed) && parsed > 0) {
|
|
66
|
+
return Math.min(maxCols, parsed);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return 1;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Calcule les positions optimales de tous les items.
|
|
73
|
+
*/
|
|
74
|
+
static calculate(container, items, options) {
|
|
75
|
+
const containerRect = container.getBoundingClientRect();
|
|
76
|
+
const containerWidth = containerRect.width;
|
|
77
|
+
const { x: gutterX, y: gutterY } = this.parseGutter(options.gutter);
|
|
78
|
+
if (containerWidth <= 0 || items.length === 0) {
|
|
79
|
+
return {
|
|
80
|
+
cols: 1,
|
|
81
|
+
colWidth: containerWidth,
|
|
82
|
+
gutterX,
|
|
83
|
+
gutterY,
|
|
84
|
+
containerHeight: 0,
|
|
85
|
+
containerWidth,
|
|
86
|
+
positions: []
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
const firstItem = items[0] || null;
|
|
90
|
+
let colWidth = this.resolveColumnWidth(container, firstItem, options.columnWidth);
|
|
91
|
+
let cols = Math.floor((containerWidth + gutterX) / (colWidth + gutterX));
|
|
92
|
+
cols = Math.max(1, cols);
|
|
93
|
+
if (!options.columnWidth && cols > 1) {
|
|
94
|
+
colWidth = (containerWidth - (cols - 1) * gutterX) / cols;
|
|
95
|
+
}
|
|
96
|
+
const fittedWidth = options.fitWidth ? cols * colWidth + (cols - 1) * gutterX : void 0;
|
|
97
|
+
const colHeights = new Array(cols).fill(0);
|
|
98
|
+
const positions = [];
|
|
99
|
+
const itemHeights = items.map((item) => {
|
|
100
|
+
const h = item.getBoundingClientRect().height;
|
|
101
|
+
return h > 0 ? h : 50;
|
|
102
|
+
});
|
|
103
|
+
let currentHCol = 0;
|
|
104
|
+
for (let i = 0; i < items.length; i++) {
|
|
105
|
+
const item = items[i];
|
|
106
|
+
const itemH = itemHeights[i];
|
|
107
|
+
const span = this.getItemSpan(item, colWidth, gutterX, cols);
|
|
108
|
+
let targetCol = 0;
|
|
109
|
+
let targetY = 0;
|
|
110
|
+
if (options.horizontalOrder) {
|
|
111
|
+
if (currentHCol + span > cols) {
|
|
112
|
+
currentHCol = 0;
|
|
113
|
+
}
|
|
114
|
+
targetCol = currentHCol;
|
|
115
|
+
let maxY = 0;
|
|
116
|
+
for (let s = 0; s < span; s++) {
|
|
117
|
+
if (colHeights[targetCol + s] > maxY) {
|
|
118
|
+
maxY = colHeights[targetCol + s];
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
targetY = maxY;
|
|
122
|
+
currentHCol = (targetCol + span) % cols;
|
|
123
|
+
} else {
|
|
124
|
+
if (span === 1) {
|
|
125
|
+
let minH = colHeights[0];
|
|
126
|
+
targetCol = 0;
|
|
127
|
+
for (let c = 1; c < cols; c++) {
|
|
128
|
+
if (colHeights[c] < minH) {
|
|
129
|
+
minH = colHeights[c];
|
|
130
|
+
targetCol = c;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
targetY = minH;
|
|
134
|
+
} else {
|
|
135
|
+
let bestMax = Infinity;
|
|
136
|
+
targetCol = 0;
|
|
137
|
+
for (let c = 0; c <= cols - span; c++) {
|
|
138
|
+
let maxInSpan = 0;
|
|
139
|
+
for (let s = 0; s < span; s++) {
|
|
140
|
+
if (colHeights[c + s] > maxInSpan) {
|
|
141
|
+
maxInSpan = colHeights[c + s];
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
if (maxInSpan < bestMax) {
|
|
145
|
+
bestMax = maxInSpan;
|
|
146
|
+
targetCol = c;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
targetY = bestMax;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
const itemW = span * colWidth + (span - 1) * gutterX;
|
|
153
|
+
const targetX = targetCol * (colWidth + gutterX);
|
|
154
|
+
positions.push({
|
|
155
|
+
element: item,
|
|
156
|
+
x: targetX,
|
|
157
|
+
y: targetY,
|
|
158
|
+
width: itemW,
|
|
159
|
+
height: itemH,
|
|
160
|
+
column: targetCol,
|
|
161
|
+
span
|
|
162
|
+
});
|
|
163
|
+
const nextY = targetY + itemH + gutterY;
|
|
164
|
+
for (let s = 0; s < span; s++) {
|
|
165
|
+
colHeights[targetCol + s] = nextY;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
let maxColH = 0;
|
|
169
|
+
for (let c = 0; c < cols; c++) {
|
|
170
|
+
if (colHeights[c] > maxColH) {
|
|
171
|
+
maxColH = colHeights[c];
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
const containerHeight = Math.max(0, maxColH > 0 ? maxColH - gutterY : 0);
|
|
175
|
+
return {
|
|
176
|
+
cols,
|
|
177
|
+
colWidth,
|
|
178
|
+
gutterX,
|
|
179
|
+
gutterY,
|
|
180
|
+
containerHeight,
|
|
181
|
+
containerWidth,
|
|
182
|
+
fittedWidth,
|
|
183
|
+
positions
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
// src/masonry/Masonry.ts
|
|
189
|
+
var Masonry = class {
|
|
190
|
+
constructor(target, options = {}) {
|
|
191
|
+
this.isNativeCSSGrid = false;
|
|
192
|
+
this._items = [];
|
|
193
|
+
this.resizeObserver = null;
|
|
194
|
+
this.itemResizeObserver = null;
|
|
195
|
+
this.layoutRafId = null;
|
|
196
|
+
this.isDestroyed = false;
|
|
197
|
+
this.wasRoleInferred = false;
|
|
198
|
+
this.wasAriaLabelInferred = false;
|
|
199
|
+
this.removeTimers = /* @__PURE__ */ new Set();
|
|
200
|
+
this.pendingImageListeners = [];
|
|
201
|
+
if (typeof target === "string") {
|
|
202
|
+
const el = document.querySelector(target);
|
|
203
|
+
if (!el) {
|
|
204
|
+
throw new Error(`[Wulf.Masonry] Conteneur introuvable pour le s\xE9lecteur : "${target}"`);
|
|
205
|
+
}
|
|
206
|
+
this.root = el;
|
|
207
|
+
} else if (target instanceof HTMLElement) {
|
|
208
|
+
this.root = target;
|
|
209
|
+
} else {
|
|
210
|
+
throw new Error("[Wulf.Masonry] Cible invalide : fournissez un \xE9l\xE9ment HTMLElement ou un s\xE9lecteur valide.");
|
|
211
|
+
}
|
|
212
|
+
this.originalContainerStyles = {
|
|
213
|
+
height: this.root.style.height,
|
|
214
|
+
width: this.root.style.width
|
|
215
|
+
};
|
|
216
|
+
this.options = {
|
|
217
|
+
itemSelector: options.itemSelector || "> *",
|
|
218
|
+
columnWidth: options.columnWidth ?? 0,
|
|
219
|
+
gutter: options.gutter ?? 0,
|
|
220
|
+
percentPosition: options.percentPosition !== false,
|
|
221
|
+
fitWidth: Boolean(options.fitWidth),
|
|
222
|
+
horizontalOrder: Boolean(options.horizontalOrder),
|
|
223
|
+
transitionDuration: options.transitionDuration !== void 0 ? options.transitionDuration : 300,
|
|
224
|
+
stagger: options.stagger || 0,
|
|
225
|
+
resize: options.resize !== false,
|
|
226
|
+
autoImages: options.autoImages !== false,
|
|
227
|
+
useNativeCSSGrid: options.useNativeCSSGrid !== false,
|
|
228
|
+
ariaRole: options.ariaRole || "region",
|
|
229
|
+
ariaLabel: options.ariaLabel || "Galerie en grille asym\xE9trique",
|
|
230
|
+
onLayout: options.onLayout || (() => {
|
|
231
|
+
}),
|
|
232
|
+
onItemPlaced: options.onItemPlaced || (() => {
|
|
233
|
+
})
|
|
234
|
+
};
|
|
235
|
+
const supportsNativeCSS = typeof CSS !== "undefined" && typeof CSS.supports === "function" && CSS.supports("grid-template-rows", "masonry");
|
|
236
|
+
if (this.options.useNativeCSSGrid && supportsNativeCSS) {
|
|
237
|
+
this.isNativeCSSGrid = true;
|
|
238
|
+
this.root.classList.add("wulf-masonry", "wulf-masonry--native");
|
|
239
|
+
} else {
|
|
240
|
+
this.root.classList.add("wulf-masonry");
|
|
241
|
+
}
|
|
242
|
+
this.initAccessibility();
|
|
243
|
+
this.applyTransitionDuration();
|
|
244
|
+
this.reloadItems();
|
|
245
|
+
this.initObservers();
|
|
246
|
+
this.initImages();
|
|
247
|
+
this.layout();
|
|
248
|
+
}
|
|
249
|
+
get items() {
|
|
250
|
+
return [...this._items];
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Initialise les attributs WAI-ARIA du conteneur.
|
|
254
|
+
*/
|
|
255
|
+
initAccessibility() {
|
|
256
|
+
if (this.options.ariaRole && !this.root.hasAttribute("role")) {
|
|
257
|
+
this.root.setAttribute("role", this.options.ariaRole);
|
|
258
|
+
this.wasRoleInferred = true;
|
|
259
|
+
}
|
|
260
|
+
if (this.options.ariaLabel && !this.root.hasAttribute("aria-label")) {
|
|
261
|
+
this.root.setAttribute("aria-label", this.options.ariaLabel);
|
|
262
|
+
this.wasAriaLabelInferred = true;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Configure les variables CSS de transition sur le conteneur.
|
|
267
|
+
*/
|
|
268
|
+
applyTransitionDuration() {
|
|
269
|
+
const dur = this.options.transitionDuration;
|
|
270
|
+
const durValue = typeof dur === "number" ? `${dur}ms` : dur;
|
|
271
|
+
this.root.style.setProperty("--wulf-masonry-duration", durValue);
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Réindexe les éléments enfants ciblés par la disposition.
|
|
275
|
+
*/
|
|
276
|
+
reloadItems() {
|
|
277
|
+
if (this.isDestroyed) return;
|
|
278
|
+
let matched = [];
|
|
279
|
+
if (this.options.itemSelector === "> *") {
|
|
280
|
+
matched = Array.from(this.root.children).filter(
|
|
281
|
+
(el) => el instanceof HTMLElement && !el.hasAttribute("data-masonry-ignore")
|
|
282
|
+
);
|
|
283
|
+
} else {
|
|
284
|
+
try {
|
|
285
|
+
matched = Array.from(this.root.querySelectorAll(this.options.itemSelector)).filter(
|
|
286
|
+
(el) => el.parentElement === this.root && !el.hasAttribute("data-masonry-ignore")
|
|
287
|
+
);
|
|
288
|
+
} catch {
|
|
289
|
+
matched = Array.from(this.root.children).filter(
|
|
290
|
+
(el) => el instanceof HTMLElement && !el.hasAttribute("data-masonry-ignore")
|
|
291
|
+
);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
this._items = matched;
|
|
295
|
+
for (const item of this._items) {
|
|
296
|
+
item.classList.add("wulf-masonry-item");
|
|
297
|
+
if (this.itemResizeObserver) {
|
|
298
|
+
this.itemResizeObserver.observe(item);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Active ResizeObserver sur le conteneur et les éléments individuels.
|
|
304
|
+
*/
|
|
305
|
+
initObservers() {
|
|
306
|
+
if (!this.options.resize || typeof ResizeObserver === "undefined") return;
|
|
307
|
+
let prevWidth = this.root.getBoundingClientRect().width;
|
|
308
|
+
this.resizeObserver = new ResizeObserver((entries) => {
|
|
309
|
+
for (const entry of entries) {
|
|
310
|
+
const currentWidth = entry.contentRect.width;
|
|
311
|
+
if (Math.abs(currentWidth - prevWidth) >= 1) {
|
|
312
|
+
prevWidth = currentWidth;
|
|
313
|
+
this.scheduleLayout();
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
this.resizeObserver.observe(this.root);
|
|
318
|
+
this.itemResizeObserver = new ResizeObserver(() => {
|
|
319
|
+
this.scheduleLayout();
|
|
320
|
+
});
|
|
321
|
+
for (const item of this._items) {
|
|
322
|
+
this.itemResizeObserver.observe(item);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Détecte les balises <img> sans dimensions prédéfinies et attend leur décodage/chargement.
|
|
327
|
+
*/
|
|
328
|
+
initImages() {
|
|
329
|
+
if (!this.options.autoImages) return;
|
|
330
|
+
const images = Array.from(this.root.querySelectorAll("img"));
|
|
331
|
+
for (const img of images) {
|
|
332
|
+
if (!img.complete) {
|
|
333
|
+
const attachLoadListener = () => {
|
|
334
|
+
const onLoad = () => {
|
|
335
|
+
this.pendingImageListeners = this.pendingImageListeners.filter((l) => l.handler !== onLoad);
|
|
336
|
+
if (!this.isDestroyed) this.scheduleLayout();
|
|
337
|
+
};
|
|
338
|
+
this.pendingImageListeners.push({ img, handler: onLoad });
|
|
339
|
+
img.addEventListener("load", onLoad, { once: true });
|
|
340
|
+
};
|
|
341
|
+
if (typeof img.decode === "function") {
|
|
342
|
+
img.decode().then(() => {
|
|
343
|
+
if (!this.isDestroyed) this.scheduleLayout();
|
|
344
|
+
}).catch(() => {
|
|
345
|
+
attachLoadListener();
|
|
346
|
+
});
|
|
347
|
+
} else {
|
|
348
|
+
attachLoadListener();
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Planifie un recalcul au prochain tick d'animation via requestAnimationFrame.
|
|
355
|
+
*/
|
|
356
|
+
scheduleLayout() {
|
|
357
|
+
if (this.isDestroyed) return;
|
|
358
|
+
if (this.layoutRafId !== null) {
|
|
359
|
+
cancelAnimationFrame(this.layoutRafId);
|
|
360
|
+
}
|
|
361
|
+
this.layoutRafId = requestAnimationFrame(() => {
|
|
362
|
+
this.layoutRafId = null;
|
|
363
|
+
this.layout();
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Calcule et applique les nouvelles coordonnées GPU de chaque item.
|
|
368
|
+
*/
|
|
369
|
+
layout() {
|
|
370
|
+
if (this.isDestroyed) return;
|
|
371
|
+
if (this.isNativeCSSGrid) {
|
|
372
|
+
this.options.onLayout([]);
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
this.root.setAttribute("aria-busy", "true");
|
|
376
|
+
const result = LayoutEngine.calculate(this.root, this._items, this.options);
|
|
377
|
+
this.root.style.height = `${result.containerHeight}px`;
|
|
378
|
+
if (this.options.fitWidth && result.fittedWidth !== void 0) {
|
|
379
|
+
this.root.style.width = `${result.fittedWidth}px`;
|
|
380
|
+
this.root.classList.add("wulf-masonry--fit-width");
|
|
381
|
+
} else {
|
|
382
|
+
this.root.classList.remove("wulf-masonry--fit-width");
|
|
383
|
+
}
|
|
384
|
+
const stagger = this.options.stagger;
|
|
385
|
+
for (let i = 0; i < result.positions.length; i++) {
|
|
386
|
+
const pos = result.positions[i];
|
|
387
|
+
const item = pos.element;
|
|
388
|
+
item.style.setProperty("--wulf-masonry-w", `${pos.width}px`);
|
|
389
|
+
item.style.setProperty("--wulf-masonry-x", `${pos.x}px`);
|
|
390
|
+
item.style.setProperty("--wulf-masonry-y", `${pos.y}px`);
|
|
391
|
+
if (stagger > 0) {
|
|
392
|
+
item.style.transitionDelay = `${i * stagger}ms`;
|
|
393
|
+
} else {
|
|
394
|
+
item.style.removeProperty("transition-delay");
|
|
395
|
+
}
|
|
396
|
+
item.classList.remove("wulf-masonry-item--hidden");
|
|
397
|
+
this.options.onItemPlaced(item, pos);
|
|
398
|
+
}
|
|
399
|
+
this.root.setAttribute("aria-busy", "false");
|
|
400
|
+
this.options.onLayout(result.positions);
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Ajoute de nouveaux éléments à la fin du conteneur.
|
|
404
|
+
*/
|
|
405
|
+
append(elements) {
|
|
406
|
+
if (this.isDestroyed) return;
|
|
407
|
+
const list = Array.isArray(elements) ? elements : [elements];
|
|
408
|
+
if (list.length === 0) return;
|
|
409
|
+
const frag = document.createDocumentFragment();
|
|
410
|
+
for (const el of list) {
|
|
411
|
+
el.classList.add("wulf-masonry-item", "wulf-masonry-item--hidden");
|
|
412
|
+
frag.appendChild(el);
|
|
413
|
+
}
|
|
414
|
+
this.root.appendChild(frag);
|
|
415
|
+
this.reloadItems();
|
|
416
|
+
this.initImages();
|
|
417
|
+
this.layout();
|
|
418
|
+
}
|
|
419
|
+
/**
|
|
420
|
+
* Ajoute de nouveaux éléments au début du conteneur.
|
|
421
|
+
*/
|
|
422
|
+
prepend(elements) {
|
|
423
|
+
if (this.isDestroyed) return;
|
|
424
|
+
const list = Array.isArray(elements) ? elements : [elements];
|
|
425
|
+
if (list.length === 0) return;
|
|
426
|
+
const first = this.root.firstChild;
|
|
427
|
+
const frag = document.createDocumentFragment();
|
|
428
|
+
for (const el of list) {
|
|
429
|
+
el.classList.add("wulf-masonry-item", "wulf-masonry-item--hidden");
|
|
430
|
+
frag.appendChild(el);
|
|
431
|
+
}
|
|
432
|
+
this.root.insertBefore(frag, first);
|
|
433
|
+
this.reloadItems();
|
|
434
|
+
this.initImages();
|
|
435
|
+
this.layout();
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* Supprime des éléments avec animation de fondu/sortie.
|
|
439
|
+
*/
|
|
440
|
+
remove(elements) {
|
|
441
|
+
if (this.isDestroyed) return;
|
|
442
|
+
const list = Array.isArray(elements) ? elements : [elements];
|
|
443
|
+
if (list.length === 0) return;
|
|
444
|
+
for (const el of list) {
|
|
445
|
+
el.classList.add("wulf-masonry-item--hidden");
|
|
446
|
+
}
|
|
447
|
+
const dur = typeof this.options.transitionDuration === "number" ? this.options.transitionDuration : 300;
|
|
448
|
+
if (dur <= 0) {
|
|
449
|
+
for (const el of list) {
|
|
450
|
+
if (el.parentElement === this.root) {
|
|
451
|
+
if (this.itemResizeObserver) {
|
|
452
|
+
this.itemResizeObserver.unobserve(el);
|
|
453
|
+
}
|
|
454
|
+
this.root.removeChild(el);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
this.reloadItems();
|
|
458
|
+
this.layout();
|
|
459
|
+
return;
|
|
460
|
+
}
|
|
461
|
+
const timerId = window.setTimeout(() => {
|
|
462
|
+
this.removeTimers.delete(timerId);
|
|
463
|
+
if (this.isDestroyed) return;
|
|
464
|
+
for (const el of list) {
|
|
465
|
+
if (el.parentElement === this.root) {
|
|
466
|
+
if (this.itemResizeObserver) {
|
|
467
|
+
this.itemResizeObserver.unobserve(el);
|
|
468
|
+
}
|
|
469
|
+
this.root.removeChild(el);
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
this.reloadItems();
|
|
473
|
+
this.layout();
|
|
474
|
+
}, dur);
|
|
475
|
+
this.removeTimers.add(timerId);
|
|
476
|
+
}
|
|
477
|
+
/**
|
|
478
|
+
* Libère les ressources, déconnecte les observateurs et nettoie les styles injectés.
|
|
479
|
+
*/
|
|
480
|
+
destroy() {
|
|
481
|
+
if (this.isDestroyed) return;
|
|
482
|
+
this.isDestroyed = true;
|
|
483
|
+
for (const timerId of this.removeTimers) {
|
|
484
|
+
clearTimeout(timerId);
|
|
485
|
+
}
|
|
486
|
+
this.removeTimers.clear();
|
|
487
|
+
for (const { img, handler } of this.pendingImageListeners) {
|
|
488
|
+
img.removeEventListener("load", handler);
|
|
489
|
+
}
|
|
490
|
+
this.pendingImageListeners = [];
|
|
491
|
+
if (this.layoutRafId !== null) {
|
|
492
|
+
cancelAnimationFrame(this.layoutRafId);
|
|
493
|
+
this.layoutRafId = null;
|
|
494
|
+
}
|
|
495
|
+
if (this.resizeObserver) {
|
|
496
|
+
this.resizeObserver.disconnect();
|
|
497
|
+
this.resizeObserver = null;
|
|
498
|
+
}
|
|
499
|
+
if (this.itemResizeObserver) {
|
|
500
|
+
this.itemResizeObserver.disconnect();
|
|
501
|
+
this.itemResizeObserver = null;
|
|
502
|
+
}
|
|
503
|
+
this.root.classList.remove("wulf-masonry", "wulf-masonry--native", "wulf-masonry--fit-width");
|
|
504
|
+
this.root.removeAttribute("aria-busy");
|
|
505
|
+
if (this.wasRoleInferred && this.root.getAttribute("role") === this.options.ariaRole) {
|
|
506
|
+
this.root.removeAttribute("role");
|
|
507
|
+
}
|
|
508
|
+
if (this.wasAriaLabelInferred && this.root.getAttribute("aria-label") === this.options.ariaLabel) {
|
|
509
|
+
this.root.removeAttribute("aria-label");
|
|
510
|
+
}
|
|
511
|
+
this.root.style.removeProperty("--wulf-masonry-duration");
|
|
512
|
+
if (this.originalContainerStyles.height) {
|
|
513
|
+
this.root.style.height = this.originalContainerStyles.height;
|
|
514
|
+
} else {
|
|
515
|
+
this.root.style.removeProperty("height");
|
|
516
|
+
}
|
|
517
|
+
if (this.originalContainerStyles.width) {
|
|
518
|
+
this.root.style.width = this.originalContainerStyles.width;
|
|
519
|
+
} else {
|
|
520
|
+
this.root.style.removeProperty("width");
|
|
521
|
+
}
|
|
522
|
+
for (const item of this._items) {
|
|
523
|
+
item.classList.remove("wulf-masonry-item", "wulf-masonry-item--hidden");
|
|
524
|
+
item.style.removeProperty("--wulf-masonry-w");
|
|
525
|
+
item.style.removeProperty("--wulf-masonry-x");
|
|
526
|
+
item.style.removeProperty("--wulf-masonry-y");
|
|
527
|
+
item.style.removeProperty("transition-delay");
|
|
528
|
+
}
|
|
529
|
+
this._items = [];
|
|
530
|
+
}
|
|
531
|
+
};
|
|
532
|
+
|
|
533
|
+
// src/masonry/index.ts
|
|
534
|
+
var index_default = Masonry;
|
|
535
|
+
if (typeof window !== "undefined") {
|
|
536
|
+
const win = window;
|
|
537
|
+
const wulfNamespace = win.Wulf || {};
|
|
538
|
+
win.Wulf = wulfNamespace;
|
|
539
|
+
wulfNamespace.Masonry = Object.assign(Masonry, {
|
|
540
|
+
Masonry,
|
|
541
|
+
LayoutEngine
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
export {
|
|
545
|
+
LayoutEngine,
|
|
546
|
+
Masonry,
|
|
547
|
+
index_default as default
|
|
548
|
+
};
|
|
549
|
+
//# sourceMappingURL=masonry.esm.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/masonry/LayoutEngine.ts", "../src/masonry/Masonry.ts", "../src/masonry/index.ts"],
|
|
4
|
+
"sourcesContent": ["import { MasonryGutter, MasonryItemPosition, MasonryOptions } from './types';\n\nexport interface LayoutCalculationResult {\n cols: number;\n colWidth: number;\n gutterX: number;\n gutterY: number;\n containerHeight: number;\n containerWidth: number;\n fittedWidth?: number;\n positions: MasonryItemPosition[];\n}\n\nexport class LayoutEngine {\n /**\n * Normalise les goutti\u00E8res horizontales et verticales.\n */\n public static parseGutter(gutterOption?: number | MasonryGutter): MasonryGutter {\n if (typeof gutterOption === 'number') {\n return { x: Math.max(0, gutterOption), y: Math.max(0, gutterOption) };\n }\n if (gutterOption && typeof gutterOption === 'object') {\n return {\n x: Math.max(0, Number(gutterOption.x) || 0),\n y: Math.max(0, Number(gutterOption.y) || 0)\n };\n }\n return { x: 0, y: 0 };\n }\n\n /**\n * R\u00E9sout la largeur effective d'une colonne en pixels.\n */\n public static resolveColumnWidth(\n container: HTMLElement,\n firstItem: HTMLElement | null,\n columnWidthOption?: number | string | HTMLElement\n ): number {\n if (typeof columnWidthOption === 'number' && columnWidthOption > 0) {\n return columnWidthOption;\n }\n\n if (typeof columnWidthOption === 'string') {\n const el = container.querySelector<HTMLElement>(columnWidthOption);\n if (el) {\n const w = el.getBoundingClientRect().width;\n if (w > 0) return w;\n }\n const parsed = parseFloat(columnWidthOption);\n if (!isNaN(parsed) && parsed > 0) {\n if (columnWidthOption.endsWith('%')) {\n const containerW = container.getBoundingClientRect().width;\n return (containerW * parsed) / 100;\n }\n return parsed;\n }\n }\n\n if (columnWidthOption instanceof HTMLElement) {\n const w = columnWidthOption.getBoundingClientRect().width;\n if (w > 0) return w;\n }\n\n if (firstItem) {\n const w = firstItem.getBoundingClientRect().width;\n if (w > 0) return w;\n }\n\n const containerW = container.getBoundingClientRect().width;\n return containerW > 0 ? containerW : 200;\n }\n\n /**\n * Extrait le facteur d'\u00E9talement (span) d'un item sur plusieurs colonnes.\n */\n public static getItemSpan(item: HTMLElement, colWidth: number, gutterX: number, maxCols: number): number {\n const dataSpan = item.getAttribute('data-masonry-span') || item.dataset.masonrySpan;\n if (dataSpan) {\n const parsed = parseInt(dataSpan, 10);\n if (!isNaN(parsed) && parsed > 0) {\n return Math.min(maxCols, parsed);\n }\n }\n\n // D\u00E9tection par classe utilitaire (ex: span-2, col-span-2)\n const match = item.className.match(/(?:^|\\s)(?:span|col-span)-(\\d+)(?:\\s|$)/);\n if (match && match[1]) {\n const parsed = parseInt(match[1], 10);\n if (!isNaN(parsed) && parsed > 0) {\n return Math.min(maxCols, parsed);\n }\n }\n\n return 1;\n }\n\n /**\n * Calcule les positions optimales de tous les items.\n */\n public static calculate(\n container: HTMLElement,\n items: HTMLElement[],\n options: MasonryOptions\n ): LayoutCalculationResult {\n const containerRect = container.getBoundingClientRect();\n const containerWidth = containerRect.width;\n const { x: gutterX, y: gutterY } = this.parseGutter(options.gutter);\n\n if (containerWidth <= 0 || items.length === 0) {\n return {\n cols: 1,\n colWidth: containerWidth,\n gutterX,\n gutterY,\n containerHeight: 0,\n containerWidth,\n positions: []\n };\n }\n\n const firstItem = items[0] || null;\n let colWidth = this.resolveColumnWidth(container, firstItem, options.columnWidth);\n\n // Calcul du nombre de colonnes possibles\n // (cols * colWidth) + (cols - 1) * gutterX <= containerWidth\n let cols = Math.floor((containerWidth + gutterX) / (colWidth + gutterX));\n cols = Math.max(1, cols);\n\n // Si percentPosition ou fitWidth, ajustement pr\u00E9cis de la largeur de colonne pour remplir l'espace\n if (!options.columnWidth && cols > 1) {\n colWidth = (containerWidth - (cols - 1) * gutterX) / cols;\n }\n\n const fittedWidth = options.fitWidth ? cols * colWidth + (cols - 1) * gutterX : undefined;\n\n // Tableau de suivi des hauteurs cumul\u00E9es pour chaque colonne\n const colHeights = new Array(cols).fill(0);\n const positions: MasonryItemPosition[] = [];\n\n // Mesure par lot pr\u00E9alable (Batch Read) de toutes les hauteurs d'items pour \u00E9viter le layout thrashing\n const itemHeights = items.map((item) => {\n // Si l'\u00E9l\u00E9ment a d\u00E9j\u00E0 une hauteur calcul\u00E9e\n const h = item.getBoundingClientRect().height;\n return h > 0 ? h : 50;\n });\n\n let currentHCol = 0; // Pointeur pour le mode horizontalOrder\n\n for (let i = 0; i < items.length; i++) {\n const item = items[i];\n const itemH = itemHeights[i];\n const span = this.getItemSpan(item, colWidth, gutterX, cols);\n\n let targetCol = 0;\n let targetY = 0;\n\n if (options.horizontalOrder) {\n // Mode respectant l'ordre naturel gauche -> droite\n if (currentHCol + span > cols) {\n currentHCol = 0;\n }\n targetCol = currentHCol;\n\n // Calcul de la hauteur maximale sous le span requis\n let maxY = 0;\n for (let s = 0; s < span; s++) {\n if (colHeights[targetCol + s] > maxY) {\n maxY = colHeights[targetCol + s];\n }\n }\n targetY = maxY;\n currentHCol = (targetCol + span) % cols;\n } else {\n // Mode shortest-column classique (optimisation de tassement)\n if (span === 1) {\n let minH = colHeights[0];\n targetCol = 0;\n for (let c = 1; c < cols; c++) {\n if (colHeights[c] < minH) {\n minH = colHeights[c];\n targetCol = c;\n }\n }\n targetY = minH;\n } else {\n // Pour un item multi-colonnes, trouve le groupe de colonnes cons\u00E9cutives dont le max est minimal\n let bestMax = Infinity;\n targetCol = 0;\n for (let c = 0; c <= cols - span; c++) {\n let maxInSpan = 0;\n for (let s = 0; s < span; s++) {\n if (colHeights[c + s] > maxInSpan) {\n maxInSpan = colHeights[c + s];\n }\n }\n if (maxInSpan < bestMax) {\n bestMax = maxInSpan;\n targetCol = c;\n }\n }\n targetY = bestMax;\n }\n }\n\n const itemW = span * colWidth + (span - 1) * gutterX;\n const targetX = targetCol * (colWidth + gutterX);\n\n positions.push({\n element: item,\n x: targetX,\n y: targetY,\n width: itemW,\n height: itemH,\n column: targetCol,\n span\n });\n\n // Mise \u00E0 jour des hauteurs pour toutes les colonnes occup\u00E9es par ce span\n const nextY = targetY + itemH + gutterY;\n for (let s = 0; s < span; s++) {\n colHeights[targetCol + s] = nextY;\n }\n }\n\n // Hauteur totale du conteneur (la plus haute colonne, moins la derni\u00E8re marge)\n let maxColH = 0;\n for (let c = 0; c < cols; c++) {\n if (colHeights[c] > maxColH) {\n maxColH = colHeights[c];\n }\n }\n const containerHeight = Math.max(0, maxColH > 0 ? maxColH - gutterY : 0);\n\n return {\n cols,\n colWidth,\n gutterX,\n gutterY,\n containerHeight,\n containerWidth,\n fittedWidth,\n positions\n };\n }\n}\n", "import { IMasonry, MasonryItemPosition, MasonryOptions } from './types';\nimport { LayoutEngine } from './LayoutEngine';\n\nexport class Masonry implements IMasonry {\n public readonly root: HTMLElement;\n public readonly isNativeCSSGrid: boolean = false;\n private _items: HTMLElement[] = [];\n private options: Required<MasonryOptions>;\n\n private resizeObserver: ResizeObserver | null = null;\n private itemResizeObserver: ResizeObserver | null = null;\n private layoutRafId: number | null = null;\n private isDestroyed: boolean = false;\n private wasRoleInferred: boolean = false;\n private wasAriaLabelInferred: boolean = false;\n private removeTimers: Set<number> = new Set();\n private pendingImageListeners: Array<{ img: HTMLImageElement; handler: () => void }> = [];\n\n private originalContainerStyles: {\n height: string;\n width: string;\n };\n\n constructor(target: HTMLElement | string, options: MasonryOptions = {}) {\n if (typeof target === 'string') {\n const el = document.querySelector<HTMLElement>(target);\n if (!el) {\n throw new Error(`[Wulf.Masonry] Conteneur introuvable pour le s\u00E9lecteur : \"${target}\"`);\n }\n this.root = el;\n } else if (target instanceof HTMLElement) {\n this.root = target;\n } else {\n throw new Error('[Wulf.Masonry] Cible invalide : fournissez un \u00E9l\u00E9ment HTMLElement ou un s\u00E9lecteur valide.');\n }\n\n // Sauvegarde des styles initiaux pour destruction propre\n this.originalContainerStyles = {\n height: this.root.style.height,\n width: this.root.style.width\n };\n\n // Fusion avec les options par d\u00E9faut\n this.options = {\n itemSelector: options.itemSelector || '> *',\n columnWidth: options.columnWidth ?? 0,\n gutter: options.gutter ?? 0,\n percentPosition: options.percentPosition !== false,\n fitWidth: Boolean(options.fitWidth),\n horizontalOrder: Boolean(options.horizontalOrder),\n transitionDuration: options.transitionDuration !== undefined ? options.transitionDuration : 300,\n stagger: options.stagger || 0,\n resize: options.resize !== false,\n autoImages: options.autoImages !== false,\n useNativeCSSGrid: options.useNativeCSSGrid !== false,\n ariaRole: options.ariaRole || 'region',\n ariaLabel: options.ariaLabel || 'Galerie en grille asym\u00E9trique',\n onLayout: options.onLayout || (() => {}),\n onItemPlaced: options.onItemPlaced || (() => {})\n };\n\n // D\u00E9tection de la compatibilit\u00E9 CSS Grid Level 3 masonry\n const supportsNativeCSS =\n typeof CSS !== 'undefined' &&\n typeof CSS.supports === 'function' &&\n CSS.supports('grid-template-rows', 'masonry');\n\n if (this.options.useNativeCSSGrid && supportsNativeCSS) {\n this.isNativeCSSGrid = true;\n this.root.classList.add('wulf-masonry', 'wulf-masonry--native');\n } else {\n this.root.classList.add('wulf-masonry');\n }\n\n this.initAccessibility();\n this.applyTransitionDuration();\n this.reloadItems();\n this.initObservers();\n this.initImages();\n\n // Premier calcul de disposition\n this.layout();\n }\n\n public get items(): HTMLElement[] {\n return [...this._items];\n }\n\n /**\n * Initialise les attributs WAI-ARIA du conteneur.\n */\n private initAccessibility(): void {\n if (this.options.ariaRole && !this.root.hasAttribute('role')) {\n this.root.setAttribute('role', this.options.ariaRole);\n this.wasRoleInferred = true;\n }\n if (this.options.ariaLabel && !this.root.hasAttribute('aria-label')) {\n this.root.setAttribute('aria-label', this.options.ariaLabel);\n this.wasAriaLabelInferred = true;\n }\n }\n\n /**\n * Configure les variables CSS de transition sur le conteneur.\n */\n private applyTransitionDuration(): void {\n const dur = this.options.transitionDuration;\n const durValue = typeof dur === 'number' ? `${dur}ms` : dur;\n this.root.style.setProperty('--wulf-masonry-duration', durValue);\n }\n\n /**\n * R\u00E9indexe les \u00E9l\u00E9ments enfants cibl\u00E9s par la disposition.\n */\n public reloadItems(): void {\n if (this.isDestroyed) return;\n\n let matched: HTMLElement[] = [];\n if (this.options.itemSelector === '> *') {\n matched = Array.from(this.root.children).filter(\n (el): el is HTMLElement => el instanceof HTMLElement && !el.hasAttribute('data-masonry-ignore')\n );\n } else {\n try {\n matched = Array.from(this.root.querySelectorAll<HTMLElement>(this.options.itemSelector)).filter(\n (el) => el.parentElement === this.root && !el.hasAttribute('data-masonry-ignore')\n );\n } catch {\n matched = Array.from(this.root.children).filter(\n (el): el is HTMLElement => el instanceof HTMLElement && !el.hasAttribute('data-masonry-ignore')\n );\n }\n }\n\n this._items = matched;\n\n // Association de la classe d'item et observation\n for (const item of this._items) {\n item.classList.add('wulf-masonry-item');\n if (this.itemResizeObserver) {\n this.itemResizeObserver.observe(item);\n }\n }\n }\n\n /**\n * Active ResizeObserver sur le conteneur et les \u00E9l\u00E9ments individuels.\n */\n private initObservers(): void {\n if (!this.options.resize || typeof ResizeObserver === 'undefined') return;\n\n // Surveillance de la largeur du conteneur\n let prevWidth = this.root.getBoundingClientRect().width;\n this.resizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n const currentWidth = entry.contentRect.width;\n if (Math.abs(currentWidth - prevWidth) >= 1) {\n prevWidth = currentWidth;\n this.scheduleLayout();\n }\n }\n });\n this.resizeObserver.observe(this.root);\n\n // Surveillance des changements de hauteur internes des items\n this.itemResizeObserver = new ResizeObserver(() => {\n this.scheduleLayout();\n });\n\n for (const item of this._items) {\n this.itemResizeObserver.observe(item);\n }\n }\n\n /**\n * D\u00E9tecte les balises <img> sans dimensions pr\u00E9d\u00E9finies et attend leur d\u00E9codage/chargement.\n */\n private initImages(): void {\n if (!this.options.autoImages) return;\n\n const images = Array.from(this.root.querySelectorAll<HTMLImageElement>('img'));\n for (const img of images) {\n if (!img.complete) {\n const attachLoadListener = () => {\n const onLoad = () => {\n this.pendingImageListeners = this.pendingImageListeners.filter((l) => l.handler !== onLoad);\n if (!this.isDestroyed) this.scheduleLayout();\n };\n this.pendingImageListeners.push({ img, handler: onLoad });\n img.addEventListener('load', onLoad, { once: true });\n };\n\n if (typeof img.decode === 'function') {\n img.decode().then(() => {\n if (!this.isDestroyed) this.scheduleLayout();\n }).catch(() => {\n attachLoadListener();\n });\n } else {\n attachLoadListener();\n }\n }\n }\n }\n\n /**\n * Planifie un recalcul au prochain tick d'animation via requestAnimationFrame.\n */\n private scheduleLayout(): void {\n if (this.isDestroyed) return;\n if (this.layoutRafId !== null) {\n cancelAnimationFrame(this.layoutRafId);\n }\n this.layoutRafId = requestAnimationFrame(() => {\n this.layoutRafId = null;\n this.layout();\n });\n }\n\n /**\n * Calcule et applique les nouvelles coordonn\u00E9es GPU de chaque item.\n */\n public layout(): void {\n if (this.isDestroyed) return;\n\n // Si d\u00E9l\u00E9gation native CSS active, pas de positionnement JS requis\n if (this.isNativeCSSGrid) {\n this.options.onLayout([]);\n return;\n }\n\n this.root.setAttribute('aria-busy', 'true');\n\n // \u00C9tape 1 : Lecture group\u00E9e (Batch Read via LayoutEngine)\n const result = LayoutEngine.calculate(this.root, this._items, this.options);\n\n // \u00C9tape 2 : \u00C9criture group\u00E9e (Batch Write)\n this.root.style.height = `${result.containerHeight}px`;\n\n if (this.options.fitWidth && result.fittedWidth !== undefined) {\n this.root.style.width = `${result.fittedWidth}px`;\n this.root.classList.add('wulf-masonry--fit-width');\n } else {\n this.root.classList.remove('wulf-masonry--fit-width');\n }\n\n const stagger = this.options.stagger;\n\n for (let i = 0; i < result.positions.length; i++) {\n const pos = result.positions[i];\n const item = pos.element;\n\n item.style.setProperty('--wulf-masonry-w', `${pos.width}px`);\n item.style.setProperty('--wulf-masonry-x', `${pos.x}px`);\n item.style.setProperty('--wulf-masonry-y', `${pos.y}px`);\n\n if (stagger > 0) {\n item.style.transitionDelay = `${i * stagger}ms`;\n } else {\n item.style.removeProperty('transition-delay');\n }\n\n item.classList.remove('wulf-masonry-item--hidden');\n this.options.onItemPlaced(item, pos);\n }\n\n this.root.setAttribute('aria-busy', 'false');\n this.options.onLayout(result.positions);\n }\n\n /**\n * Ajoute de nouveaux \u00E9l\u00E9ments \u00E0 la fin du conteneur.\n */\n public append(elements: HTMLElement | HTMLElement[]): void {\n if (this.isDestroyed) return;\n const list = Array.isArray(elements) ? elements : [elements];\n if (list.length === 0) return;\n\n const frag = document.createDocumentFragment();\n for (const el of list) {\n el.classList.add('wulf-masonry-item', 'wulf-masonry-item--hidden');\n frag.appendChild(el);\n }\n this.root.appendChild(frag);\n\n this.reloadItems();\n this.initImages();\n this.layout();\n }\n\n /**\n * Ajoute de nouveaux \u00E9l\u00E9ments au d\u00E9but du conteneur.\n */\n public prepend(elements: HTMLElement | HTMLElement[]): void {\n if (this.isDestroyed) return;\n const list = Array.isArray(elements) ? elements : [elements];\n if (list.length === 0) return;\n\n const first = this.root.firstChild;\n const frag = document.createDocumentFragment();\n for (const el of list) {\n el.classList.add('wulf-masonry-item', 'wulf-masonry-item--hidden');\n frag.appendChild(el);\n }\n this.root.insertBefore(frag, first);\n\n this.reloadItems();\n this.initImages();\n this.layout();\n }\n\n /**\n * Supprime des \u00E9l\u00E9ments avec animation de fondu/sortie.\n */\n public remove(elements: HTMLElement | HTMLElement[]): void {\n if (this.isDestroyed) return;\n const list = Array.isArray(elements) ? elements : [elements];\n if (list.length === 0) return;\n\n for (const el of list) {\n el.classList.add('wulf-masonry-item--hidden');\n }\n\n const dur = typeof this.options.transitionDuration === 'number' ? this.options.transitionDuration : 300;\n\n if (dur <= 0) {\n for (const el of list) {\n if (el.parentElement === this.root) {\n if (this.itemResizeObserver) {\n this.itemResizeObserver.unobserve(el);\n }\n this.root.removeChild(el);\n }\n }\n this.reloadItems();\n this.layout();\n return;\n }\n\n const timerId = window.setTimeout(() => {\n this.removeTimers.delete(timerId);\n if (this.isDestroyed) return;\n for (const el of list) {\n if (el.parentElement === this.root) {\n if (this.itemResizeObserver) {\n this.itemResizeObserver.unobserve(el);\n }\n this.root.removeChild(el);\n }\n }\n this.reloadItems();\n this.layout();\n }, dur);\n this.removeTimers.add(timerId);\n }\n\n /**\n * Lib\u00E8re les ressources, d\u00E9connecte les observateurs et nettoie les styles inject\u00E9s.\n */\n public destroy(): void {\n if (this.isDestroyed) return;\n this.isDestroyed = true;\n\n for (const timerId of this.removeTimers) {\n clearTimeout(timerId);\n }\n this.removeTimers.clear();\n\n for (const { img, handler } of this.pendingImageListeners) {\n img.removeEventListener('load', handler);\n }\n this.pendingImageListeners = [];\n\n if (this.layoutRafId !== null) {\n cancelAnimationFrame(this.layoutRafId);\n this.layoutRafId = null;\n }\n\n if (this.resizeObserver) {\n this.resizeObserver.disconnect();\n this.resizeObserver = null;\n }\n\n if (this.itemResizeObserver) {\n this.itemResizeObserver.disconnect();\n this.itemResizeObserver = null;\n }\n\n // Nettoyage des classes et attributs sur le conteneur\n this.root.classList.remove('wulf-masonry', 'wulf-masonry--native', 'wulf-masonry--fit-width');\n this.root.removeAttribute('aria-busy');\n if (this.wasRoleInferred && this.root.getAttribute('role') === this.options.ariaRole) {\n this.root.removeAttribute('role');\n }\n if (this.wasAriaLabelInferred && this.root.getAttribute('aria-label') === this.options.ariaLabel) {\n this.root.removeAttribute('aria-label');\n }\n this.root.style.removeProperty('--wulf-masonry-duration');\n\n if (this.originalContainerStyles.height) {\n this.root.style.height = this.originalContainerStyles.height;\n } else {\n this.root.style.removeProperty('height');\n }\n\n if (this.originalContainerStyles.width) {\n this.root.style.width = this.originalContainerStyles.width;\n } else {\n this.root.style.removeProperty('width');\n }\n\n // Nettoyage des styles sur les items\n for (const item of this._items) {\n item.classList.remove('wulf-masonry-item', 'wulf-masonry-item--hidden');\n item.style.removeProperty('--wulf-masonry-w');\n item.style.removeProperty('--wulf-masonry-x');\n item.style.removeProperty('--wulf-masonry-y');\n item.style.removeProperty('transition-delay');\n }\n\n this._items = [];\n }\n}\n\nexport default Masonry;\n", "import { Masonry } from './Masonry';\nimport { LayoutEngine } from './LayoutEngine';\n\nexport * from './types';\nexport * from './LayoutEngine';\nexport * from './Masonry';\n\nexport { Masonry, LayoutEngine };\nexport default Masonry;\n\n// Attachement namespace global dans les environnements de navigation (IIFE / Vanilla)\nif (typeof window !== 'undefined') {\n const win = window as unknown as Record<string, unknown>;\n const wulfNamespace = ((win.Wulf as Record<string, unknown>) || {}) as Record<string, unknown>;\n win.Wulf = wulfNamespace;\n\n // Namespace sp\u00E9cifique et exclusif \u00E0 la librairie Masonry : Wulf.Masonry\n wulfNamespace.Masonry = Object.assign(Masonry, {\n Masonry,\n LayoutEngine\n });\n}\n"],
|
|
5
|
+
"mappings": ";AAaO,IAAM,eAAN,MAAmB;AAAA;AAAA;AAAA;AAAA,EAIxB,OAAc,YAAY,cAAsD;AAC9E,QAAI,OAAO,iBAAiB,UAAU;AACpC,aAAO,EAAE,GAAG,KAAK,IAAI,GAAG,YAAY,GAAG,GAAG,KAAK,IAAI,GAAG,YAAY,EAAE;AAAA,IACtE;AACA,QAAI,gBAAgB,OAAO,iBAAiB,UAAU;AACpD,aAAO;AAAA,QACL,GAAG,KAAK,IAAI,GAAG,OAAO,aAAa,CAAC,KAAK,CAAC;AAAA,QAC1C,GAAG,KAAK,IAAI,GAAG,OAAO,aAAa,CAAC,KAAK,CAAC;AAAA,MAC5C;AAAA,IACF;AACA,WAAO,EAAE,GAAG,GAAG,GAAG,EAAE;AAAA,EACtB;AAAA;AAAA;AAAA;AAAA,EAKA,OAAc,mBACZ,WACA,WACA,mBACQ;AACR,QAAI,OAAO,sBAAsB,YAAY,oBAAoB,GAAG;AAClE,aAAO;AAAA,IACT;AAEA,QAAI,OAAO,sBAAsB,UAAU;AACzC,YAAM,KAAK,UAAU,cAA2B,iBAAiB;AACjE,UAAI,IAAI;AACN,cAAM,IAAI,GAAG,sBAAsB,EAAE;AACrC,YAAI,IAAI,EAAG,QAAO;AAAA,MACpB;AACA,YAAM,SAAS,WAAW,iBAAiB;AAC3C,UAAI,CAAC,MAAM,MAAM,KAAK,SAAS,GAAG;AAChC,YAAI,kBAAkB,SAAS,GAAG,GAAG;AACnC,gBAAMA,cAAa,UAAU,sBAAsB,EAAE;AACrD,iBAAQA,cAAa,SAAU;AAAA,QACjC;AACA,eAAO;AAAA,MACT;AAAA,IACF;AAEA,QAAI,6BAA6B,aAAa;AAC5C,YAAM,IAAI,kBAAkB,sBAAsB,EAAE;AACpD,UAAI,IAAI,EAAG,QAAO;AAAA,IAC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