@wyxos/vibe 2.1.6 → 2.1.8
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/lib/index.cjs +1 -1
- package/lib/index.js +579 -551
- package/package.json +2 -1
package/lib/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as Se, ref as p, computed as S, onMounted as He, onUnmounted as Pt, createElementBlock as I, openBlock as k, normalizeStyle as $, createCommentVNode as j, createElementVNode as T, normalizeClass as ht, mergeDefaults as Ut, useAttrs as Kt, shallowRef as gt, provide as Jt, watch as ne, mergeProps as Qt, renderSlot as Zt, toDisplayString as pt, Fragment as yt, renderList as wt, createVNode as X, unref as ce, nextTick as xt, inject as en } from "vue";
|
|
2
|
+
const tn = {
|
|
3
3
|
mode: "default",
|
|
4
4
|
pageSize: 20,
|
|
5
5
|
backfillRequestDelayMs: 2e3,
|
|
6
|
+
enterStaggerMs: 40,
|
|
6
7
|
page: 1,
|
|
7
8
|
itemWidth: 300,
|
|
8
9
|
prefetchThresholdPx: 200,
|
|
@@ -11,41 +12,41 @@ const Zt = {
|
|
|
11
12
|
headerHeight: 0,
|
|
12
13
|
footerHeight: 0,
|
|
13
14
|
overscanPx: 600
|
|
14
|
-
},
|
|
15
|
+
}, nn = {
|
|
15
16
|
key: 0,
|
|
16
17
|
"data-testid": "masonry-loader-spinner",
|
|
17
18
|
class: "absolute inset-0 flex items-center justify-center"
|
|
18
|
-
},
|
|
19
|
+
}, ln = {
|
|
19
20
|
key: 1,
|
|
20
21
|
"data-testid": "masonry-loader-error",
|
|
21
22
|
class: "absolute inset-0 flex flex-col items-center justify-center gap-2 p-3"
|
|
22
|
-
},
|
|
23
|
+
}, an = ["src", "width", "height", "alt"], on = ["poster"], sn = ["src"], bt = /* @__PURE__ */ Se({
|
|
23
24
|
__name: "MasonryLoader",
|
|
24
25
|
props: {
|
|
25
26
|
item: {},
|
|
26
27
|
timeoutMs: { default: 15e3 }
|
|
27
28
|
},
|
|
28
29
|
emits: ["success", "error"],
|
|
29
|
-
setup(
|
|
30
|
-
const u =
|
|
30
|
+
setup(l, { emit: y }) {
|
|
31
|
+
const u = l, s = y, i = p(null), m = p(!1), c = p(!1), r = p(!1), h = p(0), g = S(() => {
|
|
31
32
|
const _ = u.item?.width, P = u.item?.height;
|
|
32
33
|
return { aspectRatio: `${_} / ${P}` };
|
|
33
|
-
}), M =
|
|
34
|
-
let F = null,
|
|
34
|
+
}), M = S(() => u.item?.type === "image");
|
|
35
|
+
let F = null, A = null;
|
|
35
36
|
function N() {
|
|
36
|
-
|
|
37
|
+
A != null && (window.clearTimeout(A), A = null);
|
|
37
38
|
}
|
|
38
|
-
function
|
|
39
|
+
function E() {
|
|
39
40
|
N();
|
|
40
41
|
const _ = typeof u.timeoutMs == "number" && Number.isFinite(u.timeoutMs) ? u.timeoutMs : 0;
|
|
41
|
-
_ <= 0 || (
|
|
42
|
-
|
|
42
|
+
_ <= 0 || (A = window.setTimeout(() => {
|
|
43
|
+
m.value && (c.value || r.value || W(new Error("timeout")));
|
|
43
44
|
}, _));
|
|
44
45
|
}
|
|
45
46
|
function L() {
|
|
46
|
-
|
|
47
|
+
m.value || (m.value = !0, c.value = !1, r.value = !1, E());
|
|
47
48
|
}
|
|
48
|
-
|
|
49
|
+
He(() => {
|
|
49
50
|
if (typeof IntersectionObserver > "u") {
|
|
50
51
|
L();
|
|
51
52
|
return;
|
|
@@ -63,22 +64,22 @@ const Zt = {
|
|
|
63
64
|
}), Pt(() => {
|
|
64
65
|
F?.disconnect(), F = null, N();
|
|
65
66
|
});
|
|
66
|
-
function
|
|
67
|
+
function C() {
|
|
67
68
|
c.value || (c.value = !0, r.value = !1, N(), s("success", u.item));
|
|
68
69
|
}
|
|
69
70
|
function W(_) {
|
|
70
71
|
r.value || (c.value = !1, r.value = !0, N(), s("error", { item: u.item, error: _ }));
|
|
71
72
|
}
|
|
72
73
|
function O() {
|
|
73
|
-
|
|
74
|
+
m.value && (c.value = !1, r.value = !1, h.value += 1, E());
|
|
74
75
|
}
|
|
75
|
-
return (_, P) => (k(),
|
|
76
|
+
return (_, P) => (k(), I("div", {
|
|
76
77
|
ref_key: "rootEl",
|
|
77
78
|
ref: i,
|
|
78
79
|
class: "relative bg-slate-100",
|
|
79
|
-
style: $(
|
|
80
|
+
style: $(g.value)
|
|
80
81
|
}, [
|
|
81
|
-
|
|
82
|
+
m.value && !c.value && !r.value ? (k(), I("div", nn, P[2] || (P[2] = [
|
|
82
83
|
T("svg", {
|
|
83
84
|
class: "h-5 w-5 animate-spin text-slate-500",
|
|
84
85
|
viewBox: "0 0 24 24",
|
|
@@ -99,7 +100,7 @@ const Zt = {
|
|
|
99
100
|
d: "M4 12a8 8 0 0 1 8-8v4a4 4 0 0 0-4 4H4z"
|
|
100
101
|
})
|
|
101
102
|
], -1)
|
|
102
|
-
]))) :
|
|
103
|
+
]))) : m.value && r.value ? (k(), I("div", ln, [
|
|
103
104
|
P[3] || (P[3] = T("p", { class: "text-center text-xs font-medium text-red-700" }, "Failed to load", -1)),
|
|
104
105
|
T("button", {
|
|
105
106
|
type: "button",
|
|
@@ -108,8 +109,8 @@ const Zt = {
|
|
|
108
109
|
onClick: O
|
|
109
110
|
}, " Retry ")
|
|
110
111
|
])) : j("", !0),
|
|
111
|
-
|
|
112
|
-
key: u.item.id + ":img:" +
|
|
112
|
+
m.value && M.value && !r.value ? (k(), I("img", {
|
|
113
|
+
key: u.item.id + ":img:" + h.value,
|
|
113
114
|
class: ht([
|
|
114
115
|
"h-full w-full object-cover transition-opacity duration-300",
|
|
115
116
|
c.value ? "opacity-100" : "opacity-0"
|
|
@@ -119,10 +120,10 @@ const Zt = {
|
|
|
119
120
|
height: u.item.height,
|
|
120
121
|
loading: "lazy",
|
|
121
122
|
alt: u.item.id,
|
|
122
|
-
onLoad:
|
|
123
|
+
onLoad: C,
|
|
123
124
|
onError: P[0] || (P[0] = (q) => W(q))
|
|
124
|
-
}, null, 42,
|
|
125
|
-
key: u.item.id + ":vid:" +
|
|
125
|
+
}, null, 42, an)) : m.value && !r.value ? (k(), I("video", {
|
|
126
|
+
key: u.item.id + ":vid:" + h.value,
|
|
126
127
|
class: ht([
|
|
127
128
|
"h-full w-full object-cover transition-opacity duration-300",
|
|
128
129
|
c.value ? "opacity-100" : "opacity-0"
|
|
@@ -130,62 +131,62 @@ const Zt = {
|
|
|
130
131
|
poster: u.item.preview,
|
|
131
132
|
controls: "",
|
|
132
133
|
preload: "metadata",
|
|
133
|
-
onLoadedmetadata:
|
|
134
|
+
onLoadedmetadata: C,
|
|
134
135
|
onError: P[1] || (P[1] = (q) => W(q))
|
|
135
136
|
}, [
|
|
136
137
|
T("source", {
|
|
137
138
|
src: u.item.original,
|
|
138
139
|
type: "video/mp4"
|
|
139
|
-
}, null, 8,
|
|
140
|
+
}, null, 8, sn)
|
|
140
141
|
], 42, on)) : j("", !0)
|
|
141
142
|
], 4));
|
|
142
143
|
}
|
|
143
144
|
}), Tt = Symbol("masonryItemRegistry");
|
|
144
|
-
function
|
|
145
|
-
return !
|
|
145
|
+
function rn(l, y) {
|
|
146
|
+
return !l || l <= 0 || !y || y <= 0 ? 1 : Math.max(1, Math.floor(l / y));
|
|
146
147
|
}
|
|
147
|
-
function
|
|
148
|
-
if (!
|
|
149
|
-
const i = typeof s == "number" && s > 0 ? s : 0,
|
|
150
|
-
return !c || c <= 0 ? u : c /
|
|
148
|
+
function un(l, y, u, s = 0) {
|
|
149
|
+
if (!l || l <= 0 || !y || y <= 0) return u;
|
|
150
|
+
const i = typeof s == "number" && s > 0 ? s : 0, m = Math.max(0, y - 1) * i, c = l - m;
|
|
151
|
+
return !c || c <= 0 ? u : c / y;
|
|
151
152
|
}
|
|
152
|
-
function
|
|
153
|
-
const u =
|
|
154
|
-
return typeof u == "number" && typeof s == "number" && u > 0 && s > 0 ? s / u *
|
|
153
|
+
function cn(l, y) {
|
|
154
|
+
const u = l?.width, s = l?.height;
|
|
155
|
+
return typeof u == "number" && typeof s == "number" && u > 0 && s > 0 ? s / u * y : y;
|
|
155
156
|
}
|
|
156
|
-
function _t(
|
|
157
|
-
return Number.isFinite(
|
|
157
|
+
function _t(l) {
|
|
158
|
+
return Number.isFinite(l) && l > 0 ? Math.floor(l) : 1;
|
|
158
159
|
}
|
|
159
|
-
function
|
|
160
|
-
return Number.isFinite(
|
|
160
|
+
function Le(l) {
|
|
161
|
+
return Number.isFinite(l) && l > 0 ? Math.floor(l) : 0;
|
|
161
162
|
}
|
|
162
|
-
function
|
|
163
|
-
async function
|
|
164
|
-
const i =
|
|
163
|
+
function fn(l) {
|
|
164
|
+
async function y(s) {
|
|
165
|
+
const i = Le(s);
|
|
165
166
|
if (i <= 0) return;
|
|
166
|
-
|
|
167
|
-
...
|
|
167
|
+
l.stats.value = {
|
|
168
|
+
...l.stats.value,
|
|
168
169
|
cooldownMsTotal: i,
|
|
169
170
|
cooldownMsRemaining: i
|
|
170
171
|
};
|
|
171
|
-
const
|
|
172
|
+
const m = Date.now(), c = 100;
|
|
172
173
|
await new Promise((r) => {
|
|
173
|
-
const
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
...
|
|
174
|
+
const h = setInterval(() => {
|
|
175
|
+
const g = Date.now() - m, M = Math.max(0, i - g);
|
|
176
|
+
l.stats.value = {
|
|
177
|
+
...l.stats.value,
|
|
177
178
|
cooldownMsTotal: i,
|
|
178
179
|
cooldownMsRemaining: M
|
|
179
|
-
}, M <= 0 && (clearInterval(
|
|
180
|
+
}, M <= 0 && (clearInterval(h), r());
|
|
180
181
|
}, c);
|
|
181
182
|
});
|
|
182
183
|
}
|
|
183
184
|
async function u(s) {
|
|
184
|
-
const i = _t(
|
|
185
|
-
let
|
|
186
|
-
|
|
187
|
-
...
|
|
188
|
-
enabled:
|
|
185
|
+
const i = _t(l.getPageSize()), m = l.isEnabled(), c = Le(l.getRequestDelayMs()), r = [];
|
|
186
|
+
let h = 0;
|
|
187
|
+
l.buffer.value.length && (h = l.buffer.value.length, r.push(...l.buffer.value), l.buffer.value = []), l.stats.value = {
|
|
188
|
+
...l.stats.value,
|
|
189
|
+
enabled: m,
|
|
189
190
|
isBackfillActive: !1,
|
|
190
191
|
isRequestInFlight: !1,
|
|
191
192
|
requestPage: null,
|
|
@@ -198,13 +199,13 @@ function un(o) {
|
|
|
198
199
|
pageSize: i,
|
|
199
200
|
bufferSize: 0
|
|
200
201
|
};
|
|
201
|
-
const
|
|
202
|
-
let M = s, F = 0,
|
|
202
|
+
const g = [];
|
|
203
|
+
let M = s, F = 0, A = !1;
|
|
203
204
|
for (; r.length < i && M != null; ) {
|
|
204
205
|
const L = M;
|
|
205
|
-
|
|
206
|
-
...
|
|
207
|
-
enabled:
|
|
206
|
+
A && (l.stats.value = {
|
|
207
|
+
...l.stats.value,
|
|
208
|
+
enabled: m,
|
|
208
209
|
isBackfillActive: !0,
|
|
209
210
|
isRequestInFlight: !0,
|
|
210
211
|
requestPage: L,
|
|
@@ -216,16 +217,16 @@ function un(o) {
|
|
|
216
217
|
cooldownMsRemaining: 0,
|
|
217
218
|
pageSize: i
|
|
218
219
|
});
|
|
219
|
-
const
|
|
220
|
-
|
|
221
|
-
...
|
|
222
|
-
enabled:
|
|
220
|
+
const C = await l.getContent(L);
|
|
221
|
+
g.push(L), A && (l.stats.value = {
|
|
222
|
+
...l.stats.value,
|
|
223
|
+
enabled: m,
|
|
223
224
|
isBackfillActive: !0,
|
|
224
225
|
isRequestInFlight: !1,
|
|
225
226
|
requestPage: null
|
|
226
|
-
}), F +=
|
|
227
|
-
...
|
|
228
|
-
enabled:
|
|
227
|
+
}), F += C.items.length, l.markEnterFromLeft(C.items), r.push(...C.items), M = C.nextPage, !A && r.length < i && M != null ? (A = !0, l.stats.value = {
|
|
228
|
+
...l.stats.value,
|
|
229
|
+
enabled: m,
|
|
229
230
|
isBackfillActive: !0,
|
|
230
231
|
isRequestInFlight: !1,
|
|
231
232
|
requestPage: null,
|
|
@@ -236,20 +237,20 @@ function un(o) {
|
|
|
236
237
|
cooldownMsTotal: c,
|
|
237
238
|
cooldownMsRemaining: 0,
|
|
238
239
|
pageSize: i
|
|
239
|
-
}) :
|
|
240
|
-
...
|
|
241
|
-
enabled:
|
|
240
|
+
}) : A && (l.stats.value = {
|
|
241
|
+
...l.stats.value,
|
|
242
|
+
enabled: m,
|
|
242
243
|
isBackfillActive: !0,
|
|
243
244
|
progress: {
|
|
244
245
|
collected: Math.min(r.length, i),
|
|
245
246
|
target: i
|
|
246
247
|
}
|
|
247
|
-
}),
|
|
248
|
+
}), A && r.length < i && M != null && await y(c);
|
|
248
249
|
}
|
|
249
|
-
const N = r.slice(0, i),
|
|
250
|
-
return
|
|
251
|
-
...
|
|
252
|
-
enabled:
|
|
250
|
+
const N = r.slice(0, i), E = r.slice(i);
|
|
251
|
+
return l.buffer.value = E, l.stats.value = {
|
|
252
|
+
...l.stats.value,
|
|
253
|
+
enabled: m,
|
|
253
254
|
isBackfillActive: !1,
|
|
254
255
|
isRequestInFlight: !1,
|
|
255
256
|
requestPage: null,
|
|
@@ -260,82 +261,83 @@ function un(o) {
|
|
|
260
261
|
cooldownMsTotal: c,
|
|
261
262
|
cooldownMsRemaining: 0,
|
|
262
263
|
pageSize: i,
|
|
263
|
-
bufferSize:
|
|
264
|
+
bufferSize: E.length,
|
|
264
265
|
lastBatch: {
|
|
265
266
|
startPage: s,
|
|
266
|
-
pages:
|
|
267
|
-
usedFromBuffer:
|
|
267
|
+
pages: g,
|
|
268
|
+
usedFromBuffer: h,
|
|
268
269
|
fetchedFromNetwork: F,
|
|
269
270
|
collectedTotal: r.length,
|
|
270
271
|
emitted: N.length,
|
|
271
|
-
carried:
|
|
272
|
+
carried: E.length
|
|
272
273
|
},
|
|
273
274
|
totals: {
|
|
274
|
-
pagesFetched:
|
|
275
|
-
itemsFetchedFromNetwork:
|
|
275
|
+
pagesFetched: l.stats.value.totals.pagesFetched + g.length,
|
|
276
|
+
itemsFetchedFromNetwork: l.stats.value.totals.itemsFetchedFromNetwork + F
|
|
276
277
|
}
|
|
277
|
-
}, { batchItems: N, pages:
|
|
278
|
+
}, { batchItems: N, pages: g, nextPage: M };
|
|
278
279
|
}
|
|
279
280
|
return { loadBackfillBatch: u };
|
|
280
281
|
}
|
|
281
|
-
function
|
|
282
|
-
const
|
|
282
|
+
function dn(l) {
|
|
283
|
+
const y = l.columnCount, u = l.columnWidth, s = l.gapX, i = l.gapY, m = l.headerHeight, c = l.footerHeight, r = l.bucketPx, h = Array.from({ length: y }, () => 0), g = new Array(l.items.length), M = new Array(l.items.length), F = /* @__PURE__ */ new Map(), A = /* @__PURE__ */ new Map();
|
|
283
284
|
let N = 0;
|
|
284
|
-
for (let
|
|
285
|
-
const L =
|
|
286
|
-
L?.id &&
|
|
287
|
-
let
|
|
288
|
-
for (let H = 1; H <
|
|
289
|
-
|
|
290
|
-
const W =
|
|
291
|
-
|
|
285
|
+
for (let E = 0; E < l.items.length; E += 1) {
|
|
286
|
+
const L = l.items[E];
|
|
287
|
+
L?.id && A.set(L.id, E);
|
|
288
|
+
let C = 0;
|
|
289
|
+
for (let H = 1; H < h.length; H += 1)
|
|
290
|
+
h[H] < h[C] && (C = H);
|
|
291
|
+
const W = C * (u + s), O = h[C], _ = cn(L, u) + m + c;
|
|
292
|
+
g[E] = { x: W, y: O }, M[E] = _, h[C] = O + _ + i, N = Math.max(N, O + _);
|
|
292
293
|
const P = Math.floor(O / r), q = Math.floor((O + _) / r);
|
|
293
294
|
for (let H = P; H <= q; H += 1) {
|
|
294
|
-
const
|
|
295
|
-
|
|
295
|
+
const le = F.get(H);
|
|
296
|
+
le ? le.push(E) : F.set(H, [E]);
|
|
296
297
|
}
|
|
297
298
|
}
|
|
298
|
-
return { positions:
|
|
299
|
+
return { positions: g, heights: M, buckets: F, contentHeight: N, indexById: A };
|
|
299
300
|
}
|
|
300
|
-
function
|
|
301
|
-
const
|
|
302
|
-
if (!
|
|
303
|
-
if (
|
|
304
|
-
const u = Math.max(0,
|
|
305
|
-
for (let
|
|
306
|
-
const
|
|
307
|
-
if (
|
|
308
|
-
for (const M of
|
|
301
|
+
function vn(l) {
|
|
302
|
+
const y = l.itemCount;
|
|
303
|
+
if (!y) return [];
|
|
304
|
+
if (l.viewportHeight <= 0) return Array.from({ length: y }, (h, g) => g);
|
|
305
|
+
const u = Math.max(0, l.scrollTop - l.overscanPx), s = l.scrollTop + l.viewportHeight + l.overscanPx, i = Math.floor(u / l.bucketPx), m = Math.floor(s / l.bucketPx), c = /* @__PURE__ */ new Set();
|
|
306
|
+
for (let h = i; h <= m; h += 1) {
|
|
307
|
+
const g = l.buckets.get(h);
|
|
308
|
+
if (g)
|
|
309
|
+
for (const M of g) c.add(M);
|
|
309
310
|
}
|
|
310
311
|
const r = Array.from(c);
|
|
311
|
-
return r.sort((
|
|
312
|
+
return r.sort((h, g) => h - g), r;
|
|
312
313
|
}
|
|
313
|
-
const
|
|
314
|
+
const mn = { class: "hidden" }, hn = {
|
|
314
315
|
key: 0,
|
|
315
316
|
class: "flex h-full items-center justify-center"
|
|
316
|
-
},
|
|
317
|
+
}, gn = {
|
|
317
318
|
key: 1,
|
|
318
319
|
class: "text-sm font-medium text-red-700"
|
|
319
|
-
},
|
|
320
|
+
}, pn = { class: "relative" }, yn = {
|
|
320
321
|
key: 0,
|
|
321
322
|
class: "pointer-events-auto absolute inset-0"
|
|
322
|
-
},
|
|
323
|
+
}, wn = { class: "relative" }, xn = {
|
|
323
324
|
key: 0,
|
|
324
325
|
class: "pointer-events-auto absolute inset-0"
|
|
325
|
-
},
|
|
326
|
+
}, bn = { class: "mt-4 pb-2 text-center text-xs text-slate-600" }, Mn = {
|
|
326
327
|
key: 0,
|
|
327
328
|
class: "inline-flex items-center justify-center gap-2"
|
|
328
|
-
},
|
|
329
|
+
}, Sn = { key: 1 }, In = { key: 2 }, Mt = 100, kn = 200, St = 600, It = 300, kt = 600, Ft = 600, Fn = 400, Pn = 5, Tn = 1e3, _n = /* @__PURE__ */ Se({
|
|
329
330
|
inheritAttrs: !1,
|
|
330
331
|
__name: "Masonry",
|
|
331
|
-
props: /* @__PURE__ */
|
|
332
|
+
props: /* @__PURE__ */ Ut({
|
|
332
333
|
getContent: {},
|
|
333
334
|
mode: {},
|
|
334
335
|
pageSize: {},
|
|
335
336
|
backfillRequestDelayMs: {},
|
|
337
|
+
enterStaggerMs: {},
|
|
336
338
|
items: {},
|
|
337
339
|
page: {},
|
|
338
|
-
|
|
340
|
+
restoredPages: {},
|
|
339
341
|
itemWidth: {},
|
|
340
342
|
prefetchThresholdPx: {},
|
|
341
343
|
gapX: {},
|
|
@@ -343,10 +345,10 @@ const dn = { class: "hidden" }, vn = {
|
|
|
343
345
|
headerHeight: {},
|
|
344
346
|
footerHeight: {},
|
|
345
347
|
overscanPx: {}
|
|
346
|
-
},
|
|
348
|
+
}, tn),
|
|
347
349
|
emits: ["update:items", "preloaded", "failures"],
|
|
348
|
-
setup(
|
|
349
|
-
const s =
|
|
350
|
+
setup(l, { expose: y, emit: u }) {
|
|
351
|
+
const s = l, i = u, m = Kt(), c = Se({
|
|
350
352
|
name: "SlotRenderer",
|
|
351
353
|
props: {
|
|
352
354
|
slotFn: {
|
|
@@ -360,29 +362,29 @@ const dn = { class: "hidden" }, vn = {
|
|
|
360
362
|
},
|
|
361
363
|
setup(e) {
|
|
362
364
|
return () => {
|
|
363
|
-
const
|
|
364
|
-
return
|
|
365
|
+
const t = e.slotFn;
|
|
366
|
+
return t ? t(e.slotProps) : null;
|
|
365
367
|
};
|
|
366
368
|
}
|
|
367
369
|
}), r = gt(null);
|
|
368
|
-
|
|
370
|
+
Jt(Tt, (e) => {
|
|
369
371
|
r.value || (r.value = e);
|
|
370
372
|
});
|
|
371
|
-
const
|
|
373
|
+
const h = [], g = [];
|
|
372
374
|
let M = null, F = null;
|
|
373
|
-
function
|
|
374
|
-
if (!
|
|
375
|
-
const e =
|
|
375
|
+
function A() {
|
|
376
|
+
if (!h.length) return;
|
|
377
|
+
const e = h.splice(0, h.length);
|
|
376
378
|
i("preloaded", e);
|
|
377
379
|
}
|
|
378
380
|
function N() {
|
|
379
|
-
if (!
|
|
380
|
-
const e =
|
|
381
|
+
if (!g.length) return;
|
|
382
|
+
const e = g.splice(0, g.length);
|
|
381
383
|
i("failures", e);
|
|
382
384
|
}
|
|
383
|
-
function
|
|
385
|
+
function E() {
|
|
384
386
|
M || (M = setTimeout(() => {
|
|
385
|
-
M = null,
|
|
387
|
+
M = null, A();
|
|
386
388
|
}, Mt));
|
|
387
389
|
}
|
|
388
390
|
function L() {
|
|
@@ -390,241 +392,245 @@ const dn = { class: "hidden" }, vn = {
|
|
|
390
392
|
F = null, N();
|
|
391
393
|
}, Mt));
|
|
392
394
|
}
|
|
393
|
-
function
|
|
394
|
-
r.value?.onPreloaded?.(e),
|
|
395
|
+
function C(e) {
|
|
396
|
+
r.value?.onPreloaded?.(e), h.push(e), E();
|
|
395
397
|
}
|
|
396
398
|
function W(e) {
|
|
397
|
-
r.value?.onFailed?.(e),
|
|
399
|
+
r.value?.onFailed?.(e), g.push(e), L();
|
|
398
400
|
}
|
|
399
|
-
|
|
401
|
+
He(() => {
|
|
400
402
|
if (!r.value)
|
|
401
403
|
throw new Error("[Masonry] Missing <MasonryItem> definition. Add <MasonryItem> as a child of <Masonry>.");
|
|
402
404
|
});
|
|
403
|
-
const O =
|
|
404
|
-
const { class: e, ...
|
|
405
|
-
return
|
|
406
|
-
}), _ =
|
|
407
|
-
let
|
|
408
|
-
const
|
|
409
|
-
function
|
|
405
|
+
const O = S(() => {
|
|
406
|
+
const { class: e, ...t } = m;
|
|
407
|
+
return t;
|
|
408
|
+
}), _ = p(null), P = p(0), q = p(0), H = p(0);
|
|
409
|
+
let le;
|
|
410
|
+
const ae = S(() => s.gapX), ze = S(() => s.gapY);
|
|
411
|
+
function qe(e) {
|
|
410
412
|
if (!e) return 0;
|
|
411
|
-
const
|
|
412
|
-
return Math.max(0, e.clientWidth -
|
|
413
|
+
const t = Math.max(0, ae.value);
|
|
414
|
+
return Math.max(0, e.clientWidth - t);
|
|
413
415
|
}
|
|
414
|
-
const
|
|
415
|
-
if (
|
|
416
|
-
}),
|
|
417
|
-
if (
|
|
418
|
-
}),
|
|
419
|
-
function
|
|
420
|
-
const
|
|
421
|
-
return rt.value + Math.max(0,
|
|
416
|
+
const oe = S(() => s.headerHeight), se = S(() => s.footerHeight), Ie = S(() => r.value?.header), ke = S(() => r.value?.footer), Fe = S(() => r.value?.overlay), De = S(() => !!Ie.value), Oe = S(() => !!ke.value), $e = S(() => !!Fe.value), Ve = S(() => {
|
|
417
|
+
if (oe.value > 0) return { height: `${oe.value}px` };
|
|
418
|
+
}), Ye = S(() => {
|
|
419
|
+
if (se.value > 0) return { height: `${se.value}px` };
|
|
420
|
+
}), fe = p([]), Pe = p([]), Xe = p(/* @__PURE__ */ new Map()), je = p(0), pe = p(/* @__PURE__ */ new Map());
|
|
421
|
+
function We(e) {
|
|
422
|
+
const t = typeof e == "number" && Number.isFinite(e) ? e : 0;
|
|
423
|
+
return rt.value + Math.max(0, t);
|
|
422
424
|
}
|
|
423
|
-
const
|
|
425
|
+
const G = p(/* @__PURE__ */ new Set()), U = p(/* @__PURE__ */ new Set()), ye = /* @__PURE__ */ new Set(), de = p(/* @__PURE__ */ new Map());
|
|
424
426
|
function Bt(e) {
|
|
425
|
-
|
|
426
|
-
|
|
427
|
+
return Number.isFinite(e) ? Math.max(0, Math.min(250, e)) : 0;
|
|
428
|
+
}
|
|
429
|
+
function At(e) {
|
|
430
|
+
if (!U.value.has(e)) return;
|
|
431
|
+
const t = de.value.get(e) ?? 0;
|
|
432
|
+
if (!(t <= 0))
|
|
433
|
+
return `${t}ms`;
|
|
434
|
+
}
|
|
435
|
+
const we = p(/* @__PURE__ */ new Map()), V = p(/* @__PURE__ */ new Set()), Y = p([]);
|
|
436
|
+
function Et(e) {
|
|
437
|
+
const t = we.value.get(e);
|
|
438
|
+
return t || { dx: 0, dy: 0 };
|
|
427
439
|
}
|
|
428
440
|
function Rt(e) {
|
|
429
|
-
if (
|
|
430
|
-
if (V.value.has(e)) return `transform ${
|
|
441
|
+
if (U.value.has(e)) return `transform ${kt}ms ease-out`;
|
|
442
|
+
if (V.value.has(e)) return `transform ${It}ms ease-out`;
|
|
431
443
|
}
|
|
432
|
-
function
|
|
433
|
-
const
|
|
434
|
-
return `translate3d(${
|
|
444
|
+
function Ct(e) {
|
|
445
|
+
const n = d.value[e]?.id, a = fe.value[e] ?? { x: 0, y: 0 }, o = Pe.value[e] ?? 0, f = o > 0 ? o : he.value, v = a.x, x = n && G.value.has(n) ? We(f) : a.y, b = n ? Et(n) : { dx: 0, dy: 0 };
|
|
446
|
+
return `translate3d(${v + b.dx}px,${x + b.dy}px,0)`;
|
|
435
447
|
}
|
|
436
|
-
function
|
|
437
|
-
(typeof requestAnimationFrame == "function" ? requestAnimationFrame : (
|
|
448
|
+
function re(e) {
|
|
449
|
+
(typeof requestAnimationFrame == "function" ? requestAnimationFrame : (n) => setTimeout(() => n(0), 0))(() => e());
|
|
438
450
|
}
|
|
439
|
-
function
|
|
440
|
-
|
|
451
|
+
function Nt(e) {
|
|
452
|
+
re(() => re(e));
|
|
441
453
|
}
|
|
442
|
-
const
|
|
443
|
-
function
|
|
454
|
+
const Ge = /* @__PURE__ */ new Set();
|
|
455
|
+
function Ue(e) {
|
|
444
456
|
return typeof e == "number" && Number.isFinite(e) && e > 0;
|
|
445
457
|
}
|
|
446
|
-
function
|
|
458
|
+
function Te(e) {
|
|
447
459
|
if (!Array.isArray(e) || e.length === 0) return;
|
|
448
|
-
const
|
|
449
|
-
let
|
|
450
|
-
for (const
|
|
451
|
-
const
|
|
452
|
-
if (
|
|
453
|
-
if (!
|
|
454
|
-
const
|
|
455
|
-
(!
|
|
456
|
-
`[Masonry] Item "${
|
|
457
|
-
|
|
460
|
+
const t = new Set(G.value);
|
|
461
|
+
let n = !1;
|
|
462
|
+
for (const a of e) {
|
|
463
|
+
const o = a?.id;
|
|
464
|
+
if (o) {
|
|
465
|
+
if (!Ge.has(o)) {
|
|
466
|
+
const f = a?.width, v = a?.height;
|
|
467
|
+
(!Ue(f) || !Ue(v)) && (Ge.add(o), console.warn(
|
|
468
|
+
`[Masonry] Item "${o}" has invalid dimensions (width=${String(f)}, height=${String(
|
|
469
|
+
v
|
|
458
470
|
)}); layout expects { id, width, height }.`
|
|
459
471
|
));
|
|
460
472
|
}
|
|
461
|
-
|
|
473
|
+
t.has(o) || (t.add(o), n = !0);
|
|
462
474
|
}
|
|
463
475
|
}
|
|
464
|
-
|
|
476
|
+
n && (G.value = t);
|
|
465
477
|
}
|
|
466
|
-
function
|
|
478
|
+
function Ke() {
|
|
467
479
|
const e = /* @__PURE__ */ new Map();
|
|
468
|
-
for (const
|
|
469
|
-
const
|
|
470
|
-
if (!
|
|
471
|
-
const
|
|
472
|
-
|
|
480
|
+
for (const t of Re.value) {
|
|
481
|
+
const a = d.value[t]?.id;
|
|
482
|
+
if (!a) continue;
|
|
483
|
+
const o = fe.value[t];
|
|
484
|
+
o && e.set(a, { x: o.x, y: o.y });
|
|
473
485
|
}
|
|
474
486
|
return e;
|
|
475
487
|
}
|
|
476
|
-
function
|
|
488
|
+
function Je(e, t) {
|
|
477
489
|
if (!e.size) return;
|
|
478
|
-
const
|
|
479
|
-
for (const [
|
|
480
|
-
if (
|
|
481
|
-
const x =
|
|
490
|
+
const n = /* @__PURE__ */ new Map(), a = [];
|
|
491
|
+
for (const [f, v] of e.entries()) {
|
|
492
|
+
if (t?.has(f)) continue;
|
|
493
|
+
const x = pe.value.get(f);
|
|
482
494
|
if (x == null) continue;
|
|
483
|
-
const b =
|
|
495
|
+
const b = fe.value[x];
|
|
484
496
|
if (!b) continue;
|
|
485
|
-
const
|
|
486
|
-
(
|
|
497
|
+
const w = v.x - b.x, z = v.y - b.y;
|
|
498
|
+
(w || z) && (n.set(f, { dx: w, dy: z }), a.push(f));
|
|
487
499
|
}
|
|
488
|
-
if (!
|
|
489
|
-
|
|
490
|
-
const
|
|
491
|
-
for (const
|
|
492
|
-
V.value =
|
|
493
|
-
V.value = /* @__PURE__ */ new Set([...V.value, ...
|
|
494
|
-
|
|
500
|
+
if (!n.size) return;
|
|
501
|
+
we.value = n;
|
|
502
|
+
const o = new Set(V.value);
|
|
503
|
+
for (const f of a) o.delete(f);
|
|
504
|
+
V.value = o, re(() => {
|
|
505
|
+
V.value = /* @__PURE__ */ new Set([...V.value, ...a]), re(() => {
|
|
506
|
+
we.value = /* @__PURE__ */ new Map();
|
|
495
507
|
});
|
|
496
508
|
}), setTimeout(() => {
|
|
497
|
-
const
|
|
498
|
-
for (const
|
|
499
|
-
V.value =
|
|
500
|
-
},
|
|
509
|
+
const f = new Set(V.value);
|
|
510
|
+
for (const v of a) f.delete(v);
|
|
511
|
+
V.value = f;
|
|
512
|
+
}, It);
|
|
501
513
|
}
|
|
502
|
-
const
|
|
503
|
-
let
|
|
504
|
-
function
|
|
514
|
+
const K = p(!0), J = p(!1), ie = p("");
|
|
515
|
+
let R = 0;
|
|
516
|
+
function Qe(e) {
|
|
505
517
|
return e instanceof Error && e.name === "AbortError";
|
|
506
518
|
}
|
|
507
|
-
function
|
|
519
|
+
function Ze() {
|
|
508
520
|
const e = new Error("aborted");
|
|
509
521
|
return e.name = "AbortError", e;
|
|
510
522
|
}
|
|
511
|
-
function
|
|
512
|
-
return new Promise((
|
|
523
|
+
function Ht(e) {
|
|
524
|
+
return new Promise((t) => setTimeout(t, e));
|
|
513
525
|
}
|
|
514
|
-
async function
|
|
515
|
-
let
|
|
526
|
+
async function et(e, t) {
|
|
527
|
+
let n = 0;
|
|
516
528
|
for (; ; ) {
|
|
517
|
-
if (
|
|
529
|
+
if (t !== R) throw Ze();
|
|
518
530
|
try {
|
|
519
531
|
return await s.getContent(e);
|
|
520
|
-
} catch (
|
|
521
|
-
if (
|
|
522
|
-
if (
|
|
523
|
-
|
|
532
|
+
} catch (a) {
|
|
533
|
+
if (t !== R) throw Ze();
|
|
534
|
+
if (n >= Pn) throw a;
|
|
535
|
+
n += 1, await Ht(n * Tn);
|
|
524
536
|
}
|
|
525
537
|
}
|
|
526
538
|
}
|
|
527
|
-
const D =
|
|
528
|
-
let
|
|
529
|
-
function
|
|
530
|
-
let
|
|
531
|
-
for (const
|
|
532
|
-
const
|
|
533
|
-
|
|
539
|
+
const D = p([]), tt = p([]), _e = p([]), B = p(s.page), xe = p([]);
|
|
540
|
+
let Q = null, Z = null, be = 0;
|
|
541
|
+
function Lt(e) {
|
|
542
|
+
let t = -1;
|
|
543
|
+
for (const n of e) {
|
|
544
|
+
const a = n?.originalIndex;
|
|
545
|
+
ve(a) && a > t && (t = a);
|
|
534
546
|
}
|
|
535
|
-
|
|
547
|
+
be = t + 1;
|
|
536
548
|
}
|
|
537
|
-
function
|
|
538
|
-
for (const
|
|
539
|
-
!
|
|
549
|
+
function ue(e) {
|
|
550
|
+
for (const t of e)
|
|
551
|
+
!t || typeof t != "object" || t.id && t.originalIndex == null && (t.originalIndex = be, be += 1);
|
|
540
552
|
}
|
|
541
|
-
const
|
|
542
|
-
function
|
|
553
|
+
const ee = /* @__PURE__ */ new Map(), te = [];
|
|
554
|
+
function ve(e) {
|
|
543
555
|
return typeof e == "number" && Number.isFinite(e);
|
|
544
556
|
}
|
|
545
|
-
function
|
|
546
|
-
if (!
|
|
547
|
-
const
|
|
548
|
-
for (const
|
|
549
|
-
const x =
|
|
550
|
-
x &&
|
|
557
|
+
function zt(e, t) {
|
|
558
|
+
if (!t.length) return e;
|
|
559
|
+
const n = /* @__PURE__ */ new Set();
|
|
560
|
+
for (const v of e) {
|
|
561
|
+
const x = v?.id;
|
|
562
|
+
x && n.add(x);
|
|
551
563
|
}
|
|
552
|
-
const
|
|
553
|
-
for (const
|
|
554
|
-
const x =
|
|
555
|
-
x && (
|
|
564
|
+
const a = [];
|
|
565
|
+
for (const v of t) {
|
|
566
|
+
const x = v?.id;
|
|
567
|
+
x && (n.has(x) || (a.push(v), n.add(x)));
|
|
556
568
|
}
|
|
557
|
-
if (!
|
|
558
|
-
const
|
|
559
|
-
const b =
|
|
560
|
-
return b -
|
|
561
|
-
}),
|
|
562
|
-
for (const
|
|
563
|
-
const x =
|
|
564
|
-
if (!
|
|
565
|
-
|
|
569
|
+
if (!a.length) return e;
|
|
570
|
+
const o = a.slice().sort((v, x) => {
|
|
571
|
+
const b = ve(v.originalIndex) ? v.originalIndex : Number.POSITIVE_INFINITY, w = ve(x.originalIndex) ? x.originalIndex : Number.POSITIVE_INFINITY;
|
|
572
|
+
return b - w;
|
|
573
|
+
}), f = e.slice();
|
|
574
|
+
for (const v of o) {
|
|
575
|
+
const x = v.originalIndex;
|
|
576
|
+
if (!ve(x)) {
|
|
577
|
+
f.push(v);
|
|
566
578
|
continue;
|
|
567
579
|
}
|
|
568
|
-
let b = 0,
|
|
569
|
-
for (; b <
|
|
570
|
-
const z = b +
|
|
571
|
-
(
|
|
580
|
+
let b = 0, w = f.length;
|
|
581
|
+
for (; b < w; ) {
|
|
582
|
+
const z = b + w >> 1, ge = f[z]?.originalIndex;
|
|
583
|
+
(ve(ge) ? ge : Number.POSITIVE_INFINITY) <= x ? b = z + 1 : w = z;
|
|
572
584
|
}
|
|
573
|
-
|
|
585
|
+
f.splice(b, 0, v);
|
|
574
586
|
}
|
|
575
|
-
return
|
|
587
|
+
return f;
|
|
576
588
|
}
|
|
577
|
-
async function
|
|
589
|
+
async function nt(e) {
|
|
578
590
|
if (!e.length) return;
|
|
579
|
-
|
|
580
|
-
const
|
|
581
|
-
d.value =
|
|
591
|
+
Te(e);
|
|
592
|
+
const t = Ke();
|
|
593
|
+
d.value = zt(d.value, e), await xt(), Je(t);
|
|
582
594
|
}
|
|
583
|
-
async function
|
|
584
|
-
const
|
|
585
|
-
if (!
|
|
586
|
-
const
|
|
587
|
-
for (const
|
|
588
|
-
const
|
|
589
|
-
|
|
595
|
+
async function qt(e) {
|
|
596
|
+
const n = (Array.isArray(e) ? e : [e]).map(Ae).filter(Boolean);
|
|
597
|
+
if (!n.length) return;
|
|
598
|
+
const a = [];
|
|
599
|
+
for (const o of n) {
|
|
600
|
+
const f = ee.get(o);
|
|
601
|
+
f && a.push(f);
|
|
590
602
|
}
|
|
591
|
-
if (
|
|
592
|
-
await
|
|
593
|
-
for (const
|
|
594
|
-
|
|
603
|
+
if (a.length) {
|
|
604
|
+
await nt(a);
|
|
605
|
+
for (const o of a)
|
|
606
|
+
o?.id && ee.delete(o.id);
|
|
595
607
|
}
|
|
596
608
|
}
|
|
597
|
-
async function
|
|
598
|
-
const e =
|
|
609
|
+
async function Dt() {
|
|
610
|
+
const e = te.pop();
|
|
599
611
|
if (!e?.length) return;
|
|
600
|
-
const
|
|
601
|
-
for (const
|
|
602
|
-
const
|
|
603
|
-
|
|
612
|
+
const t = [];
|
|
613
|
+
for (const n of e) {
|
|
614
|
+
const a = ee.get(n);
|
|
615
|
+
a && t.push(a);
|
|
604
616
|
}
|
|
605
|
-
if (
|
|
606
|
-
await
|
|
607
|
-
for (const
|
|
608
|
-
|
|
617
|
+
if (t.length) {
|
|
618
|
+
await nt(t);
|
|
619
|
+
for (const n of t)
|
|
620
|
+
n?.id && ee.delete(n.id);
|
|
609
621
|
}
|
|
610
622
|
}
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
if (!t.length) return;
|
|
620
|
-
const l = new Set(t);
|
|
621
|
-
for (const a of l) G.delete(a);
|
|
622
|
-
for (let a = K.length - 1; a >= 0; a -= 1) {
|
|
623
|
-
const p = K[a].filter((x) => !l.has(x));
|
|
624
|
-
p.length ? K[a] = p : K.splice(a, 1);
|
|
623
|
+
function Ot(e) {
|
|
624
|
+
const n = (Array.isArray(e) ? e : [e]).map(Ae).filter(Boolean);
|
|
625
|
+
if (!n.length) return;
|
|
626
|
+
const a = new Set(n);
|
|
627
|
+
for (const o of a) ee.delete(o);
|
|
628
|
+
for (let o = te.length - 1; o >= 0; o -= 1) {
|
|
629
|
+
const v = te[o].filter((x) => !a.has(x));
|
|
630
|
+
v.length ? te[o] = v : te.splice(o, 1);
|
|
625
631
|
}
|
|
626
632
|
}
|
|
627
|
-
const
|
|
633
|
+
const Be = gt({
|
|
628
634
|
enabled: !1,
|
|
629
635
|
isBackfillActive: !1,
|
|
630
636
|
isRequestInFlight: !1,
|
|
@@ -642,187 +648,216 @@ const dn = { class: "hidden" }, vn = {
|
|
|
642
648
|
pagesFetched: 0,
|
|
643
649
|
itemsFetchedFromNetwork: 0
|
|
644
650
|
}
|
|
645
|
-
}),
|
|
646
|
-
getContent: (e) =>
|
|
647
|
-
markEnterFromLeft:
|
|
648
|
-
buffer:
|
|
649
|
-
stats:
|
|
651
|
+
}), lt = fn({
|
|
652
|
+
getContent: (e) => et(e, R),
|
|
653
|
+
markEnterFromLeft: Te,
|
|
654
|
+
buffer: xe,
|
|
655
|
+
stats: Be,
|
|
650
656
|
isEnabled: () => s.mode === "backfill",
|
|
651
657
|
getPageSize: () => s.pageSize,
|
|
652
658
|
getRequestDelayMs: () => s.backfillRequestDelayMs
|
|
653
|
-
}),
|
|
654
|
-
|
|
659
|
+
}), Me = S(() => s.items !== void 0);
|
|
660
|
+
ne(
|
|
655
661
|
() => s.items,
|
|
656
662
|
(e) => {
|
|
657
|
-
|
|
663
|
+
Me.value && (_e.value = Array.isArray(e) ? e : []);
|
|
658
664
|
},
|
|
659
665
|
{ immediate: !0 }
|
|
660
666
|
);
|
|
661
|
-
const d =
|
|
667
|
+
const d = S({
|
|
662
668
|
get() {
|
|
663
|
-
return
|
|
669
|
+
return Me.value ? _e.value : tt.value;
|
|
664
670
|
},
|
|
665
671
|
set(e) {
|
|
666
|
-
|
|
672
|
+
Me.value ? (_e.value = e, i("update:items", e)) : tt.value = e;
|
|
667
673
|
}
|
|
668
|
-
});
|
|
669
|
-
async function
|
|
670
|
-
const
|
|
671
|
-
return
|
|
674
|
+
}), me = p(!1);
|
|
675
|
+
async function at(e) {
|
|
676
|
+
const t = await et(e, R);
|
|
677
|
+
return ue(t.items), Te(t.items), { items: t.items, nextPage: t.nextPage };
|
|
672
678
|
}
|
|
673
|
-
function
|
|
679
|
+
function Ae(e) {
|
|
674
680
|
return e ? typeof e == "string" ? e : e?.id : null;
|
|
675
681
|
}
|
|
676
|
-
async function
|
|
677
|
-
const
|
|
678
|
-
if (!
|
|
679
|
-
const
|
|
680
|
-
for (const b of
|
|
681
|
-
const
|
|
682
|
-
if (
|
|
683
|
-
const z = d.value[
|
|
684
|
-
z && (
|
|
682
|
+
async function ot(e) {
|
|
683
|
+
const n = (Array.isArray(e) ? e : [e]).map(Ae).filter(Boolean);
|
|
684
|
+
if (!n.length) return;
|
|
685
|
+
const a = new Set(n), o = [];
|
|
686
|
+
for (const b of a) {
|
|
687
|
+
const w = pe.value.get(b);
|
|
688
|
+
if (w == null) continue;
|
|
689
|
+
const z = d.value[w];
|
|
690
|
+
z && (ee.set(b, z), o.push(b));
|
|
685
691
|
}
|
|
686
|
-
|
|
687
|
-
const
|
|
688
|
-
for (const b of
|
|
689
|
-
const
|
|
690
|
-
if (
|
|
691
|
-
const z = d.value[
|
|
692
|
+
o.length && te.push(o);
|
|
693
|
+
const f = Ke(), v = he.value, x = [];
|
|
694
|
+
for (const b of a) {
|
|
695
|
+
const w = pe.value.get(b);
|
|
696
|
+
if (w == null) continue;
|
|
697
|
+
const z = d.value[w];
|
|
692
698
|
if (!z) continue;
|
|
693
|
-
const
|
|
699
|
+
const ge = fe.value[w] ?? { x: 0, y: 0 }, mt = Pe.value[w] ?? v;
|
|
694
700
|
x.push({
|
|
695
701
|
id: b,
|
|
696
702
|
item: z,
|
|
697
|
-
fromX:
|
|
698
|
-
fromY:
|
|
699
|
-
width:
|
|
703
|
+
fromX: ge.x,
|
|
704
|
+
fromY: ge.y,
|
|
705
|
+
width: v,
|
|
700
706
|
height: mt,
|
|
701
707
|
leaving: !0
|
|
702
708
|
});
|
|
703
709
|
}
|
|
704
710
|
if (x.length && (Y.value = [...Y.value, ...x]), d.value = d.value.filter((b) => {
|
|
705
|
-
const
|
|
706
|
-
return !
|
|
707
|
-
}), await xt(),
|
|
708
|
-
const b = new Set(x.map((
|
|
709
|
-
|
|
711
|
+
const w = b?.id;
|
|
712
|
+
return !w || !a.has(w);
|
|
713
|
+
}), await xt(), Je(f, a), x.length) {
|
|
714
|
+
const b = new Set(x.map((w) => w.id));
|
|
715
|
+
re(() => {
|
|
710
716
|
Y.value = Y.value.map(
|
|
711
|
-
(
|
|
717
|
+
(w) => b.has(w.id) ? { ...w, leaving: !1 } : w
|
|
712
718
|
), setTimeout(() => {
|
|
713
|
-
Y.value = Y.value.filter((
|
|
719
|
+
Y.value = Y.value.filter((w) => !b.has(w.id));
|
|
714
720
|
}, Ft);
|
|
715
721
|
});
|
|
716
722
|
}
|
|
717
723
|
}
|
|
718
|
-
async function
|
|
719
|
-
return
|
|
724
|
+
async function Ee(e) {
|
|
725
|
+
return ot(e);
|
|
720
726
|
}
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
727
|
+
function $t() {
|
|
728
|
+
R += 1, Q = null, Z = null, K.value = !1, J.value = !1;
|
|
729
|
+
}
|
|
730
|
+
y({
|
|
731
|
+
remove: ot,
|
|
732
|
+
restore: qt,
|
|
733
|
+
undo: Dt,
|
|
734
|
+
forget: Ot,
|
|
735
|
+
loadNextPage: it,
|
|
736
|
+
cancel: $t,
|
|
737
|
+
get pagesLoaded() {
|
|
738
|
+
return D.value;
|
|
739
|
+
},
|
|
740
|
+
set pagesLoaded(e) {
|
|
741
|
+
D.value = e;
|
|
742
|
+
},
|
|
743
|
+
get nextPage() {
|
|
744
|
+
return B.value;
|
|
745
|
+
},
|
|
746
|
+
set nextPage(e) {
|
|
747
|
+
B.value = e;
|
|
748
|
+
},
|
|
749
|
+
get isLoading() {
|
|
750
|
+
return K.value || J.value;
|
|
751
|
+
},
|
|
752
|
+
get hasReachedEnd() {
|
|
753
|
+
return s.mode !== "backfill" ? B.value == null : B.value == null && xe.value.length === 0;
|
|
754
|
+
},
|
|
755
|
+
get backfillStats() {
|
|
756
|
+
return Be.value;
|
|
757
|
+
}
|
|
733
758
|
});
|
|
734
|
-
function
|
|
735
|
-
const e =
|
|
759
|
+
function st() {
|
|
760
|
+
const e = dn({
|
|
736
761
|
items: d.value,
|
|
737
|
-
columnCount:
|
|
738
|
-
columnWidth:
|
|
739
|
-
gapX:
|
|
740
|
-
gapY:
|
|
741
|
-
headerHeight:
|
|
742
|
-
footerHeight:
|
|
743
|
-
bucketPx:
|
|
762
|
+
columnCount: Ne.value,
|
|
763
|
+
columnWidth: he.value,
|
|
764
|
+
gapX: ae.value,
|
|
765
|
+
gapY: ze.value,
|
|
766
|
+
headerHeight: oe.value,
|
|
767
|
+
footerHeight: se.value,
|
|
768
|
+
bucketPx: St
|
|
744
769
|
});
|
|
745
|
-
|
|
770
|
+
fe.value = e.positions, Pe.value = e.heights, Xe.value = e.buckets, je.value = e.contentHeight, pe.value = e.indexById;
|
|
746
771
|
}
|
|
747
|
-
const rt =
|
|
772
|
+
const rt = S(() => Math.max(je.value, q.value) + kn), Re = S(() => vn({
|
|
748
773
|
itemCount: d.value.length,
|
|
749
774
|
viewportHeight: q.value,
|
|
750
775
|
scrollTop: H.value,
|
|
751
776
|
overscanPx: s.overscanPx,
|
|
752
|
-
bucketPx:
|
|
753
|
-
buckets:
|
|
777
|
+
bucketPx: St,
|
|
778
|
+
buckets: Xe.value
|
|
754
779
|
}));
|
|
755
|
-
|
|
780
|
+
ne(
|
|
756
781
|
Re,
|
|
757
782
|
(e) => {
|
|
758
783
|
if (!e?.length) return;
|
|
759
|
-
const
|
|
760
|
-
for (const
|
|
761
|
-
const
|
|
762
|
-
|
|
784
|
+
const t = [];
|
|
785
|
+
for (const a of e) {
|
|
786
|
+
const o = d.value[a]?.id;
|
|
787
|
+
o && G.value.has(o) && (ye.has(o) || (ye.add(o), t.push(o)));
|
|
788
|
+
}
|
|
789
|
+
if (!t.length) return;
|
|
790
|
+
const n = t.length > 1 ? Bt(s.enterStaggerMs) : 0;
|
|
791
|
+
if (n > 0) {
|
|
792
|
+
const a = new Map(de.value);
|
|
793
|
+
for (let o = 0; o < t.length; o += 1) {
|
|
794
|
+
const f = t[o], v = Math.min(o * n, Fn);
|
|
795
|
+
a.set(f, v);
|
|
796
|
+
}
|
|
797
|
+
de.value = a;
|
|
763
798
|
}
|
|
764
|
-
|
|
765
|
-
const
|
|
766
|
-
for (const
|
|
767
|
-
|
|
768
|
-
}),
|
|
769
|
-
const
|
|
770
|
-
for (const
|
|
771
|
-
|
|
772
|
-
const
|
|
773
|
-
for (const
|
|
774
|
-
|
|
775
|
-
|
|
799
|
+
re(() => {
|
|
800
|
+
const a = new Set(U.value);
|
|
801
|
+
for (const o of t) a.add(o);
|
|
802
|
+
U.value = a;
|
|
803
|
+
}), Nt(() => {
|
|
804
|
+
const a = new Set(G.value);
|
|
805
|
+
for (const o of t) a.delete(o);
|
|
806
|
+
G.value = a, setTimeout(() => {
|
|
807
|
+
const o = new Set(U.value), f = new Map(de.value);
|
|
808
|
+
for (const v of t)
|
|
809
|
+
o.delete(v), ye.delete(v), f.delete(v);
|
|
810
|
+
U.value = o, de.value = f;
|
|
776
811
|
}, kt);
|
|
777
|
-
})
|
|
812
|
+
});
|
|
778
813
|
},
|
|
779
814
|
{ flush: "post" }
|
|
780
815
|
);
|
|
781
|
-
async function
|
|
782
|
-
if (
|
|
783
|
-
if (
|
|
816
|
+
async function it() {
|
|
817
|
+
if (Q) return Q;
|
|
818
|
+
if (K.value || J.value || s.mode !== "backfill" && B.value == null || s.mode === "backfill" && B.value == null && xe.value.length === 0)
|
|
784
819
|
return;
|
|
785
|
-
const e =
|
|
786
|
-
let
|
|
787
|
-
return
|
|
820
|
+
const e = R;
|
|
821
|
+
let t = null;
|
|
822
|
+
return t = (async () => {
|
|
788
823
|
try {
|
|
789
|
-
if (
|
|
790
|
-
const
|
|
791
|
-
if (e !==
|
|
792
|
-
|
|
824
|
+
if (J.value = !0, ie.value = "", s.mode === "backfill") {
|
|
825
|
+
const o = await lt.loadBackfillBatch(B.value);
|
|
826
|
+
if (e !== R) return;
|
|
827
|
+
o.pages.length && (D.value = [...D.value, ...o.pages]), ue(o.batchItems), d.value = [...d.value, ...o.batchItems], B.value = o.nextPage;
|
|
793
828
|
return;
|
|
794
829
|
}
|
|
795
|
-
const
|
|
796
|
-
if (
|
|
797
|
-
const
|
|
798
|
-
if (e !==
|
|
799
|
-
D.value = [...D.value,
|
|
800
|
-
} catch (
|
|
801
|
-
if (e !==
|
|
802
|
-
|
|
830
|
+
const n = B.value;
|
|
831
|
+
if (n == null) return;
|
|
832
|
+
const a = await at(n);
|
|
833
|
+
if (e !== R) return;
|
|
834
|
+
D.value = [...D.value, n], ue(a.items), d.value = [...d.value, ...a.items], B.value = a.nextPage;
|
|
835
|
+
} catch (n) {
|
|
836
|
+
if (e !== R || Qe(n)) return;
|
|
837
|
+
ie.value = n instanceof Error ? n.message : String(n);
|
|
803
838
|
} finally {
|
|
804
|
-
e ===
|
|
839
|
+
e === R && (J.value = !1), Q === t && (Q = null);
|
|
805
840
|
}
|
|
806
|
-
})(),
|
|
841
|
+
})(), Q = t, t;
|
|
807
842
|
}
|
|
808
|
-
function
|
|
843
|
+
function Vt() {
|
|
809
844
|
const e = _.value;
|
|
810
845
|
if (!e) return;
|
|
811
|
-
H.value = e.scrollTop, q.value = e.clientHeight, e.scrollHeight - (e.scrollTop + e.clientHeight) <= s.prefetchThresholdPx &&
|
|
846
|
+
H.value = e.scrollTop, q.value = e.clientHeight, e.scrollHeight - (e.scrollTop + e.clientHeight) <= s.prefetchThresholdPx && it();
|
|
812
847
|
}
|
|
813
|
-
function
|
|
848
|
+
function ut() {
|
|
814
849
|
return _.value;
|
|
815
850
|
}
|
|
816
|
-
function
|
|
817
|
-
P.value =
|
|
851
|
+
function ct(e) {
|
|
852
|
+
P.value = qe(e), q.value = e.clientHeight;
|
|
818
853
|
}
|
|
819
|
-
function
|
|
820
|
-
typeof ResizeObserver > "u" || (
|
|
821
|
-
const e =
|
|
822
|
-
e &&
|
|
854
|
+
function Yt() {
|
|
855
|
+
typeof ResizeObserver > "u" || (le = new ResizeObserver(() => {
|
|
856
|
+
const e = ut();
|
|
857
|
+
e && ct(e);
|
|
823
858
|
}));
|
|
824
859
|
}
|
|
825
|
-
function
|
|
860
|
+
function Xt() {
|
|
826
861
|
return {
|
|
827
862
|
enabled: s.mode === "backfill",
|
|
828
863
|
isBackfillActive: !1,
|
|
@@ -833,7 +868,7 @@ const dn = { class: "hidden" }, vn = {
|
|
|
833
868
|
target: 0
|
|
834
869
|
},
|
|
835
870
|
cooldownMsRemaining: 0,
|
|
836
|
-
cooldownMsTotal:
|
|
871
|
+
cooldownMsTotal: Le(s.backfillRequestDelayMs),
|
|
837
872
|
pageSize: _t(s.pageSize),
|
|
838
873
|
bufferSize: 0,
|
|
839
874
|
lastBatch: null,
|
|
@@ -843,128 +878,120 @@ const dn = { class: "hidden" }, vn = {
|
|
|
843
878
|
}
|
|
844
879
|
};
|
|
845
880
|
}
|
|
846
|
-
function
|
|
847
|
-
|
|
848
|
-
}
|
|
849
|
-
function ft(e) {
|
|
850
|
-
ct(), d.value = [], C.value = e;
|
|
881
|
+
function ft() {
|
|
882
|
+
R += 1, Q = null, Z = null, be = 0, ee.clear(), te.length = 0, G.value = /* @__PURE__ */ new Set(), U.value = /* @__PURE__ */ new Set(), ye.clear(), we.value = /* @__PURE__ */ new Map(), V.value = /* @__PURE__ */ new Set(), Y.value = [], D.value = [], B.value = null, xe.value = [], Be.value = Xt(), K.value = !0, J.value = !1, ie.value = "";
|
|
851
883
|
}
|
|
852
|
-
function
|
|
853
|
-
|
|
854
|
-
for (const a of n) {
|
|
855
|
-
if (a == null) continue;
|
|
856
|
-
const h = typeof a == "string" ? `s:${a}` : `n:${String(a)}`;
|
|
857
|
-
l.has(h) || (l.add(h), t.push(a));
|
|
858
|
-
}
|
|
859
|
-
return t;
|
|
884
|
+
function dt(e) {
|
|
885
|
+
ft(), d.value = [], B.value = e;
|
|
860
886
|
}
|
|
861
|
-
function
|
|
862
|
-
const n = [];
|
|
863
|
-
for (const
|
|
864
|
-
if (
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
}
|
|
868
|
-
if (typeof t == "string") {
|
|
869
|
-
const l = Number.parseInt(t, 10);
|
|
870
|
-
Number.isFinite(l) && n.push(l);
|
|
871
|
-
}
|
|
887
|
+
function jt(e) {
|
|
888
|
+
const t = Array.isArray(e) ? e : [e], n = [], a = /* @__PURE__ */ new Set();
|
|
889
|
+
for (const o of t) {
|
|
890
|
+
if (o == null) continue;
|
|
891
|
+
const f = typeof o == "string" ? `s:${o}` : `n:${String(o)}`;
|
|
892
|
+
a.has(f) || (a.add(f), n.push(o));
|
|
872
893
|
}
|
|
873
|
-
return n
|
|
894
|
+
return n;
|
|
874
895
|
}
|
|
875
|
-
function
|
|
876
|
-
|
|
877
|
-
const n = Vt(e);
|
|
878
|
-
D.value = n, C.value = Yt(n), ce.value = !1, Ct(d.value), re(d.value);
|
|
896
|
+
function Ce(e) {
|
|
897
|
+
ft(), D.value = e ? jt(e) : [], B.value = s.page, K.value = !1, Lt(d.value), ue(d.value);
|
|
879
898
|
}
|
|
880
899
|
async function vt(e) {
|
|
881
|
-
if (
|
|
882
|
-
const
|
|
883
|
-
let
|
|
884
|
-
return
|
|
900
|
+
if (Z) return Z;
|
|
901
|
+
const t = R;
|
|
902
|
+
let n = null;
|
|
903
|
+
return n = (async () => {
|
|
885
904
|
try {
|
|
886
905
|
if (s.mode === "backfill") {
|
|
887
|
-
const
|
|
888
|
-
if (
|
|
889
|
-
D.value =
|
|
906
|
+
const a = await lt.loadBackfillBatch(e);
|
|
907
|
+
if (t !== R) return;
|
|
908
|
+
D.value = a.pages.length ? a.pages : [e], ue(a.batchItems), d.value = a.batchItems, B.value = a.nextPage;
|
|
890
909
|
} else {
|
|
891
|
-
const
|
|
892
|
-
if (
|
|
893
|
-
D.value = [e],
|
|
910
|
+
const a = await at(e);
|
|
911
|
+
if (t !== R) return;
|
|
912
|
+
D.value = [e], ue(a.items), d.value = a.items, B.value = a.nextPage;
|
|
894
913
|
}
|
|
895
|
-
} catch (
|
|
896
|
-
if (
|
|
897
|
-
|
|
914
|
+
} catch (a) {
|
|
915
|
+
if (t !== R || Qe(a)) return;
|
|
916
|
+
ie.value = a instanceof Error ? a.message : String(a);
|
|
898
917
|
} finally {
|
|
899
|
-
|
|
918
|
+
t === R && (K.value = !1), Z === n && (Z = null);
|
|
900
919
|
}
|
|
901
|
-
})(),
|
|
920
|
+
})(), Z = n, n;
|
|
902
921
|
}
|
|
903
|
-
function
|
|
904
|
-
const e =
|
|
905
|
-
e && (
|
|
922
|
+
function Wt() {
|
|
923
|
+
const e = ut();
|
|
924
|
+
e && (ct(e), H.value = e.scrollTop, le?.observe(e));
|
|
906
925
|
}
|
|
907
|
-
|
|
908
|
-
if (
|
|
909
|
-
|
|
926
|
+
He(async () => {
|
|
927
|
+
if (Yt(), Wt(), s.restoredPages != null) {
|
|
928
|
+
me.value = !0, Ce(s.restoredPages);
|
|
929
|
+
return;
|
|
930
|
+
}
|
|
931
|
+
if (Me.value && d.value.length > 0) {
|
|
932
|
+
me.value = !0, Ce();
|
|
910
933
|
return;
|
|
911
934
|
}
|
|
912
|
-
|
|
935
|
+
me.value = !1, dt(s.page), await vt(s.page);
|
|
913
936
|
}), Pt(() => {
|
|
914
|
-
|
|
915
|
-
}),
|
|
937
|
+
le?.disconnect(), M && (clearTimeout(M), M = null), F && (clearTimeout(F), F = null), A(), N();
|
|
938
|
+
}), ne(
|
|
916
939
|
() => s.page,
|
|
917
940
|
async (e) => {
|
|
918
|
-
|
|
941
|
+
if (me.value) {
|
|
942
|
+
B.value = e;
|
|
943
|
+
return;
|
|
944
|
+
}
|
|
945
|
+
dt(e), await vt(e);
|
|
919
946
|
}
|
|
920
|
-
),
|
|
921
|
-
() => s.
|
|
947
|
+
), ne(
|
|
948
|
+
() => s.restoredPages,
|
|
922
949
|
(e) => {
|
|
923
|
-
e &&
|
|
950
|
+
e && (me.value = !0, Ce(e));
|
|
924
951
|
}
|
|
925
|
-
),
|
|
926
|
-
|
|
952
|
+
), ne(
|
|
953
|
+
ae,
|
|
927
954
|
() => {
|
|
928
955
|
const e = _.value;
|
|
929
|
-
e && (P.value =
|
|
956
|
+
e && (P.value = qe(e));
|
|
930
957
|
},
|
|
931
958
|
{ immediate: !1 }
|
|
932
959
|
);
|
|
933
|
-
const
|
|
934
|
-
() =>
|
|
960
|
+
const Ne = S(() => rn(P.value, s.itemWidth)), he = S(
|
|
961
|
+
() => un(P.value, Ne.value, s.itemWidth, ae.value)
|
|
935
962
|
);
|
|
936
|
-
|
|
937
|
-
[
|
|
963
|
+
ne(
|
|
964
|
+
[Ne, he, ae, ze, oe, se],
|
|
938
965
|
() => {
|
|
939
|
-
|
|
966
|
+
st();
|
|
940
967
|
},
|
|
941
968
|
{ immediate: !0 }
|
|
942
|
-
),
|
|
969
|
+
), ne(
|
|
943
970
|
// Performance note: this component targets very large arrays (e.g. 10k items).
|
|
944
971
|
// Avoid deep watchers over items; rebuild layout only when the list structure
|
|
945
972
|
// changes (new array reference or length change). This keeps metadata-only
|
|
946
973
|
// updates (e.g. reactions) cheap.
|
|
947
974
|
() => [d.value, d.value.length],
|
|
948
|
-
() =>
|
|
975
|
+
() => st(),
|
|
949
976
|
{ immediate: !0 }
|
|
950
977
|
);
|
|
951
|
-
const
|
|
978
|
+
const Gt = S(() => [
|
|
952
979
|
"mt-8 flex min-h-0 flex-1 flex-col rounded-2xl border border-slate-200/70 bg-white/70 p-5 shadow-sm backdrop-blur",
|
|
953
|
-
|
|
980
|
+
m.class
|
|
954
981
|
]);
|
|
955
|
-
return (e,
|
|
956
|
-
T("div",
|
|
957
|
-
|
|
982
|
+
return (e, t) => (k(), I("section", Qt(O.value, { class: Gt.value }), [
|
|
983
|
+
T("div", mn, [
|
|
984
|
+
Zt(e.$slots, "default")
|
|
958
985
|
]),
|
|
959
986
|
T("div", {
|
|
960
987
|
ref_key: "scrollViewportRef",
|
|
961
988
|
ref: _,
|
|
962
989
|
"data-testid": "items-scroll-container",
|
|
963
990
|
class: "mt-4 min-h-0 flex-1 overflow-auto",
|
|
964
|
-
style: $({ paddingRight:
|
|
965
|
-
onScroll:
|
|
991
|
+
style: $({ paddingRight: ae.value + "px" }),
|
|
992
|
+
onScroll: Vt
|
|
966
993
|
}, [
|
|
967
|
-
|
|
994
|
+
K.value ? (k(), I("div", hn, t[0] || (t[0] = [
|
|
968
995
|
T("div", { class: "inline-flex items-center gap-3 text-sm text-slate-600" }, [
|
|
969
996
|
T("svg", {
|
|
970
997
|
class: "h-5 w-5 animate-spin text-slate-500",
|
|
@@ -988,107 +1015,108 @@ const dn = { class: "hidden" }, vn = {
|
|
|
988
1015
|
]),
|
|
989
1016
|
T("span", null, "Loading…")
|
|
990
1017
|
], -1)
|
|
991
|
-
]))) :
|
|
1018
|
+
]))) : ie.value ? (k(), I("p", gn, "Error: " + pt(ie.value), 1)) : (k(), I("div", {
|
|
992
1019
|
key: 2,
|
|
993
1020
|
class: "relative",
|
|
994
1021
|
style: $({ height: rt.value + "px" })
|
|
995
1022
|
}, [
|
|
996
|
-
(k(!0),
|
|
997
|
-
key: d.value[
|
|
1023
|
+
(k(!0), I(yt, null, wt(Re.value, (n) => (k(), I("article", {
|
|
1024
|
+
key: d.value[n].id,
|
|
998
1025
|
"data-testid": "item-card",
|
|
999
1026
|
class: "absolute overflow-hidden rounded-xl border border-slate-200/60 bg-white shadow-sm",
|
|
1000
1027
|
style: $({
|
|
1001
|
-
width:
|
|
1002
|
-
transition: Rt(d.value[
|
|
1003
|
-
|
|
1028
|
+
width: he.value + "px",
|
|
1029
|
+
transition: Rt(d.value[n].id),
|
|
1030
|
+
transitionDelay: At(d.value[n].id),
|
|
1031
|
+
transform: Ct(n)
|
|
1004
1032
|
})
|
|
1005
1033
|
}, [
|
|
1006
|
-
|
|
1034
|
+
De.value || oe.value > 0 ? (k(), I("div", {
|
|
1007
1035
|
key: 0,
|
|
1008
1036
|
"data-testid": "item-header-container",
|
|
1009
1037
|
class: "w-full",
|
|
1010
|
-
style: $(
|
|
1038
|
+
style: $(Ve.value)
|
|
1011
1039
|
}, [
|
|
1012
|
-
X(
|
|
1013
|
-
"slot-fn":
|
|
1014
|
-
"slot-props": { item: d.value[
|
|
1040
|
+
X(ce(c), {
|
|
1041
|
+
"slot-fn": Ie.value,
|
|
1042
|
+
"slot-props": { item: d.value[n], remove: () => Ee(d.value[n]) }
|
|
1015
1043
|
}, null, 8, ["slot-fn", "slot-props"])
|
|
1016
1044
|
], 4)) : j("", !0),
|
|
1017
|
-
T("div",
|
|
1045
|
+
T("div", pn, [
|
|
1018
1046
|
X(bt, {
|
|
1019
|
-
item: d.value[
|
|
1020
|
-
onSuccess:
|
|
1047
|
+
item: d.value[n],
|
|
1048
|
+
onSuccess: C,
|
|
1021
1049
|
onError: W
|
|
1022
1050
|
}, null, 8, ["item"]),
|
|
1023
|
-
|
|
1024
|
-
X(
|
|
1025
|
-
"slot-fn":
|
|
1026
|
-
"slot-props": { item: d.value[
|
|
1051
|
+
$e.value ? (k(), I("div", yn, [
|
|
1052
|
+
X(ce(c), {
|
|
1053
|
+
"slot-fn": Fe.value,
|
|
1054
|
+
"slot-props": { item: d.value[n], remove: () => Ee(d.value[n]) }
|
|
1027
1055
|
}, null, 8, ["slot-fn", "slot-props"])
|
|
1028
1056
|
])) : j("", !0)
|
|
1029
1057
|
]),
|
|
1030
|
-
|
|
1058
|
+
Oe.value || se.value > 0 ? (k(), I("div", {
|
|
1031
1059
|
key: 1,
|
|
1032
1060
|
"data-testid": "item-footer-container",
|
|
1033
1061
|
class: "w-full",
|
|
1034
|
-
style: $(
|
|
1062
|
+
style: $(Ye.value)
|
|
1035
1063
|
}, [
|
|
1036
|
-
X(
|
|
1037
|
-
"slot-fn":
|
|
1038
|
-
"slot-props": { item: d.value[
|
|
1064
|
+
X(ce(c), {
|
|
1065
|
+
"slot-fn": ke.value,
|
|
1066
|
+
"slot-props": { item: d.value[n], remove: () => Ee(d.value[n]) }
|
|
1039
1067
|
}, null, 8, ["slot-fn", "slot-props"])
|
|
1040
1068
|
], 4)) : j("", !0)
|
|
1041
1069
|
], 4))), 128)),
|
|
1042
|
-
(k(!0),
|
|
1043
|
-
key:
|
|
1070
|
+
(k(!0), I(yt, null, wt(Y.value, (n) => (k(), I("article", {
|
|
1071
|
+
key: n.id + ":leaving",
|
|
1044
1072
|
"data-testid": "item-card-leaving",
|
|
1045
1073
|
class: "pointer-events-none absolute overflow-hidden rounded-xl border border-slate-200/60 bg-white shadow-sm",
|
|
1046
1074
|
style: $({
|
|
1047
|
-
width:
|
|
1075
|
+
width: n.width + "px",
|
|
1048
1076
|
transition: "transform " + Ft + "ms ease-out",
|
|
1049
|
-
transform:
|
|
1077
|
+
transform: n.leaving ? "translate3d(" + n.fromX + "px," + n.fromY + "px,0)" : "translate3d(" + n.fromX + "px," + We(n.height) + "px,0)"
|
|
1050
1078
|
})
|
|
1051
1079
|
}, [
|
|
1052
|
-
|
|
1080
|
+
De.value || oe.value > 0 ? (k(), I("div", {
|
|
1053
1081
|
key: 0,
|
|
1054
1082
|
"data-testid": "item-header-container",
|
|
1055
1083
|
class: "w-full",
|
|
1056
|
-
style: $(
|
|
1084
|
+
style: $(Ve.value)
|
|
1057
1085
|
}, [
|
|
1058
|
-
X(
|
|
1059
|
-
"slot-fn":
|
|
1060
|
-
"slot-props": { item:
|
|
1086
|
+
X(ce(c), {
|
|
1087
|
+
"slot-fn": Ie.value,
|
|
1088
|
+
"slot-props": { item: n.item, remove: () => {
|
|
1061
1089
|
} }
|
|
1062
1090
|
}, null, 8, ["slot-fn", "slot-props"])
|
|
1063
1091
|
], 4)) : j("", !0),
|
|
1064
|
-
T("div",
|
|
1092
|
+
T("div", wn, [
|
|
1065
1093
|
X(bt, {
|
|
1066
|
-
item:
|
|
1094
|
+
item: n.item
|
|
1067
1095
|
}, null, 8, ["item"]),
|
|
1068
|
-
|
|
1069
|
-
X(
|
|
1070
|
-
"slot-fn":
|
|
1071
|
-
"slot-props": { item:
|
|
1096
|
+
$e.value ? (k(), I("div", xn, [
|
|
1097
|
+
X(ce(c), {
|
|
1098
|
+
"slot-fn": Fe.value,
|
|
1099
|
+
"slot-props": { item: n.item, remove: () => {
|
|
1072
1100
|
} }
|
|
1073
1101
|
}, null, 8, ["slot-fn", "slot-props"])
|
|
1074
1102
|
])) : j("", !0)
|
|
1075
1103
|
]),
|
|
1076
|
-
|
|
1104
|
+
Oe.value || se.value > 0 ? (k(), I("div", {
|
|
1077
1105
|
key: 1,
|
|
1078
1106
|
"data-testid": "item-footer-container",
|
|
1079
1107
|
class: "w-full",
|
|
1080
|
-
style: $(
|
|
1108
|
+
style: $(Ye.value)
|
|
1081
1109
|
}, [
|
|
1082
|
-
X(
|
|
1083
|
-
"slot-fn":
|
|
1084
|
-
"slot-props": { item:
|
|
1110
|
+
X(ce(c), {
|
|
1111
|
+
"slot-fn": ke.value,
|
|
1112
|
+
"slot-props": { item: n.item, remove: () => {
|
|
1085
1113
|
} }
|
|
1086
1114
|
}, null, 8, ["slot-fn", "slot-props"])
|
|
1087
1115
|
], 4)) : j("", !0)
|
|
1088
1116
|
], 4))), 128))
|
|
1089
1117
|
], 4)),
|
|
1090
|
-
T("div",
|
|
1091
|
-
|
|
1118
|
+
T("div", bn, [
|
|
1119
|
+
J.value ? (k(), I("span", Mn, t[1] || (t[1] = [
|
|
1092
1120
|
T("svg", {
|
|
1093
1121
|
class: "h-4 w-4 animate-spin text-slate-500",
|
|
1094
1122
|
viewBox: "0 0 24 24",
|
|
@@ -1110,40 +1138,40 @@ const dn = { class: "hidden" }, vn = {
|
|
|
1110
1138
|
})
|
|
1111
1139
|
], -1),
|
|
1112
1140
|
T("span", null, "Loading more…", -1)
|
|
1113
|
-
]))) :
|
|
1141
|
+
]))) : B.value == null ? (k(), I("span", Sn, "End of list")) : (k(), I("span", In, "Scroll to load page " + pt(B.value), 1))
|
|
1114
1142
|
])
|
|
1115
1143
|
], 36)
|
|
1116
1144
|
], 16));
|
|
1117
1145
|
}
|
|
1118
|
-
}),
|
|
1146
|
+
}), Bn = Se({
|
|
1119
1147
|
name: "MasonryItem",
|
|
1120
|
-
setup(
|
|
1121
|
-
const s =
|
|
1148
|
+
setup(l, { slots: y, attrs: u }) {
|
|
1149
|
+
const s = en(Tt, null);
|
|
1122
1150
|
if (!s)
|
|
1123
1151
|
return () => null;
|
|
1124
|
-
const i = u.onPreloaded,
|
|
1152
|
+
const i = u.onPreloaded, m = u.onFailed, c = y.overlay, r = y.default;
|
|
1125
1153
|
return s({
|
|
1126
|
-
header:
|
|
1154
|
+
header: y.header,
|
|
1127
1155
|
overlay: c ?? r,
|
|
1128
|
-
footer:
|
|
1129
|
-
onPreloaded: typeof i == "function" ? i : Array.isArray(i) ? (
|
|
1130
|
-
for (const
|
|
1131
|
-
typeof
|
|
1156
|
+
footer: y.footer,
|
|
1157
|
+
onPreloaded: typeof i == "function" ? i : Array.isArray(i) ? (h) => {
|
|
1158
|
+
for (const g of i)
|
|
1159
|
+
typeof g == "function" && g(h);
|
|
1132
1160
|
} : void 0,
|
|
1133
|
-
onFailed: typeof
|
|
1134
|
-
for (const
|
|
1135
|
-
typeof
|
|
1161
|
+
onFailed: typeof m == "function" ? m : Array.isArray(m) ? (h) => {
|
|
1162
|
+
for (const g of m)
|
|
1163
|
+
typeof g == "function" && g(h);
|
|
1136
1164
|
} : void 0
|
|
1137
1165
|
}), () => null;
|
|
1138
1166
|
}
|
|
1139
|
-
}),
|
|
1140
|
-
install(
|
|
1141
|
-
|
|
1167
|
+
}), En = {
|
|
1168
|
+
install(l) {
|
|
1169
|
+
l.component("Masonry", _n), l.component("MasonryItem", Bn);
|
|
1142
1170
|
}
|
|
1143
1171
|
};
|
|
1144
1172
|
export {
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1173
|
+
_n as Masonry,
|
|
1174
|
+
Bn as MasonryItem,
|
|
1175
|
+
En as VibePlugin,
|
|
1176
|
+
tn as masonryDefaults
|
|
1149
1177
|
};
|