@wyxos/vibe 2.1.7 → 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 +598 -583
- 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 Qt = {
|
|
|
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,
|
|
35
|
-
function
|
|
36
|
-
|
|
34
|
+
}), M = S(() => u.item?.type === "image");
|
|
35
|
+
let F = null, A = null;
|
|
36
|
+
function N() {
|
|
37
|
+
A != null && (window.clearTimeout(A), A = null);
|
|
37
38
|
}
|
|
38
|
-
function
|
|
39
|
-
|
|
39
|
+
function E() {
|
|
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;
|
|
@@ -60,25 +61,25 @@ const Qt = {
|
|
|
60
61
|
},
|
|
61
62
|
{ threshold: [0, 0.5, 1] }
|
|
62
63
|
), i.value && F.observe(i.value);
|
|
63
|
-
}),
|
|
64
|
-
F?.disconnect(), F = null,
|
|
64
|
+
}), Pt(() => {
|
|
65
|
+
F?.disconnect(), F = null, N();
|
|
65
66
|
});
|
|
66
|
-
function
|
|
67
|
-
c.value || (c.value = !0, r.value = !1,
|
|
67
|
+
function C() {
|
|
68
|
+
c.value || (c.value = !0, r.value = !1, N(), s("success", u.item));
|
|
68
69
|
}
|
|
69
70
|
function W(_) {
|
|
70
|
-
r.value || (c.value = !1, r.value = !0,
|
|
71
|
+
r.value || (c.value = !1, r.value = !0, N(), s("error", { item: u.item, error: _ }));
|
|
71
72
|
}
|
|
72
|
-
function
|
|
73
|
-
|
|
73
|
+
function O() {
|
|
74
|
+
m.value && (c.value = !1, r.value = !1, h.value += 1, E());
|
|
74
75
|
}
|
|
75
|
-
return (_, P) => (
|
|
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,18 +100,18 @@ const Qt = {
|
|
|
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",
|
|
106
107
|
"data-testid": "masonry-loader-retry",
|
|
107
108
|
class: "inline-flex items-center rounded-md border border-slate-200 bg-white px-2 py-1 text-xs font-medium text-slate-700",
|
|
108
|
-
onClick:
|
|
109
|
+
onClick: O
|
|
109
110
|
}, " Retry ")
|
|
110
111
|
])) : j("", !0),
|
|
111
|
-
|
|
112
|
-
key: u.item.id + ":img:" +
|
|
113
|
-
class:
|
|
112
|
+
m.value && M.value && !r.value ? (k(), I("img", {
|
|
113
|
+
key: u.item.id + ":img:" + h.value,
|
|
114
|
+
class: ht([
|
|
114
115
|
"h-full w-full object-cover transition-opacity duration-300",
|
|
115
116
|
c.value ? "opacity-100" : "opacity-0"
|
|
116
117
|
]),
|
|
@@ -119,73 +120,73 @@ const Qt = {
|
|
|
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:" +
|
|
126
|
-
class:
|
|
125
|
+
}, null, 42, an)) : m.value && !r.value ? (k(), I("video", {
|
|
126
|
+
key: u.item.id + ":vid:" + h.value,
|
|
127
|
+
class: ht([
|
|
127
128
|
"h-full w-full object-cover transition-opacity duration-300",
|
|
128
129
|
c.value ? "opacity-100" : "opacity-0"
|
|
129
130
|
]),
|
|
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
|
-
], 42,
|
|
140
|
+
}, null, 8, sn)
|
|
141
|
+
], 42, on)) : j("", !0)
|
|
141
142
|
], 4));
|
|
142
143
|
}
|
|
143
|
-
}),
|
|
144
|
-
function
|
|
145
|
-
return !
|
|
144
|
+
}), Tt = Symbol("masonryItemRegistry");
|
|
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
|
|
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
|
|
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
|
|
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
|
-
async function u(
|
|
184
|
-
const i =
|
|
185
|
-
let
|
|
186
|
-
|
|
187
|
-
...
|
|
188
|
-
enabled:
|
|
184
|
+
async function u(s) {
|
|
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 rn(o) {
|
|
|
198
199
|
pageSize: i,
|
|
199
200
|
bufferSize: 0
|
|
200
201
|
};
|
|
201
|
-
const
|
|
202
|
-
let M =
|
|
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 rn(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 rn(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
|
|
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,79 +261,80 @@ function rn(o) {
|
|
|
260
261
|
cooldownMsTotal: c,
|
|
261
262
|
cooldownMsRemaining: 0,
|
|
262
263
|
pageSize: i,
|
|
263
|
-
bufferSize:
|
|
264
|
+
bufferSize: E.length,
|
|
264
265
|
lastBatch: {
|
|
265
|
-
startPage:
|
|
266
|
-
pages:
|
|
267
|
-
usedFromBuffer:
|
|
266
|
+
startPage: s,
|
|
267
|
+
pages: g,
|
|
268
|
+
usedFromBuffer: h,
|
|
268
269
|
fetchedFromNetwork: F,
|
|
269
270
|
collectedTotal: r.length,
|
|
270
|
-
emitted:
|
|
271
|
-
carried:
|
|
271
|
+
emitted: N.length,
|
|
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:
|
|
278
|
+
}, { batchItems: N, pages: g, nextPage: M };
|
|
278
279
|
}
|
|
279
280
|
return { loadBackfillBatch: u };
|
|
280
281
|
}
|
|
281
|
-
function
|
|
282
|
-
const
|
|
283
|
-
let
|
|
284
|
-
for (let
|
|
285
|
-
const L =
|
|
286
|
-
L?.id &&
|
|
287
|
-
let
|
|
288
|
-
for (let H = 1; H <
|
|
289
|
-
|
|
290
|
-
const W =
|
|
291
|
-
|
|
292
|
-
const P = Math.floor(
|
|
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();
|
|
284
|
+
let N = 0;
|
|
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 + _);
|
|
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: {},
|
|
@@ -343,10 +345,10 @@ const fn = { class: "hidden" }, dn = {
|
|
|
343
345
|
headerHeight: {},
|
|
344
346
|
footerHeight: {},
|
|
345
347
|
overscanPx: {}
|
|
346
|
-
},
|
|
348
|
+
}, tn),
|
|
347
349
|
emits: ["update:items", "preloaded", "failures"],
|
|
348
|
-
setup(
|
|
349
|
-
const
|
|
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,265 +362,275 @@ const fn = { class: "hidden" }, dn = {
|
|
|
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
|
-
}), r =
|
|
368
|
-
|
|
369
|
+
}), r = gt(null);
|
|
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
|
-
function
|
|
379
|
-
if (!
|
|
380
|
-
const e =
|
|
380
|
+
function N() {
|
|
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,
|
|
386
|
-
},
|
|
387
|
+
M = null, A();
|
|
388
|
+
}, Mt));
|
|
387
389
|
}
|
|
388
390
|
function L() {
|
|
389
391
|
F || (F = setTimeout(() => {
|
|
390
|
-
F = null,
|
|
391
|
-
},
|
|
392
|
+
F = null, N();
|
|
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
|
|
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);
|
|
415
|
+
}
|
|
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);
|
|
413
424
|
}
|
|
414
|
-
const
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
if (ae.value > 0) return { height: `${ae.value}px` };
|
|
418
|
-
}), fe = w([]), ke = w([]), $e = w(/* @__PURE__ */ new Map()), Ve = w(0), he = w(/* @__PURE__ */ new Map());
|
|
419
|
-
function Ye(e) {
|
|
420
|
-
const n = typeof e == "number" && Number.isFinite(e) ? e : 0;
|
|
421
|
-
return lt.value + Math.max(0, n);
|
|
425
|
+
const G = p(/* @__PURE__ */ new Set()), U = p(/* @__PURE__ */ new Set()), ye = /* @__PURE__ */ new Set(), de = p(/* @__PURE__ */ new Map());
|
|
426
|
+
function Bt(e) {
|
|
427
|
+
return Number.isFinite(e) ? Math.max(0, Math.min(250, e)) : 0;
|
|
422
428
|
}
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
const
|
|
426
|
-
|
|
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`;
|
|
427
434
|
}
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
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 };
|
|
431
439
|
}
|
|
432
|
-
function
|
|
433
|
-
|
|
434
|
-
return `
|
|
440
|
+
function Rt(e) {
|
|
441
|
+
if (U.value.has(e)) return `transform ${kt}ms ease-out`;
|
|
442
|
+
if (V.value.has(e)) return `transform ${It}ms ease-out`;
|
|
443
|
+
}
|
|
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
448
|
function re(e) {
|
|
437
|
-
(typeof requestAnimationFrame == "function" ? requestAnimationFrame : (
|
|
449
|
+
(typeof requestAnimationFrame == "function" ? requestAnimationFrame : (n) => setTimeout(() => n(0), 0))(() => e());
|
|
438
450
|
}
|
|
439
|
-
function
|
|
451
|
+
function Nt(e) {
|
|
440
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
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
|
-
return await
|
|
520
|
-
} catch (
|
|
521
|
-
if (
|
|
522
|
-
if (
|
|
523
|
-
|
|
531
|
+
return await s.getContent(e);
|
|
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
|
|
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
549
|
function ue(e) {
|
|
538
|
-
for (const
|
|
539
|
-
!
|
|
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
|
-
function
|
|
612
|
-
const
|
|
613
|
-
if (!
|
|
614
|
-
const
|
|
615
|
-
for (const
|
|
616
|
-
for (let
|
|
617
|
-
const
|
|
618
|
-
|
|
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);
|
|
619
631
|
}
|
|
620
632
|
}
|
|
621
|
-
const
|
|
633
|
+
const Be = gt({
|
|
622
634
|
enabled: !1,
|
|
623
635
|
isBackfillActive: !1,
|
|
624
636
|
isRequestInFlight: !1,
|
|
@@ -636,208 +648,218 @@ const fn = { class: "hidden" }, dn = {
|
|
|
636
648
|
pagesFetched: 0,
|
|
637
649
|
itemsFetchedFromNetwork: 0
|
|
638
650
|
}
|
|
639
|
-
}),
|
|
640
|
-
getContent: (e) =>
|
|
641
|
-
markEnterFromLeft:
|
|
642
|
-
buffer:
|
|
643
|
-
stats:
|
|
644
|
-
isEnabled: () =>
|
|
645
|
-
getPageSize: () =>
|
|
646
|
-
getRequestDelayMs: () =>
|
|
647
|
-
}),
|
|
648
|
-
|
|
649
|
-
() =>
|
|
651
|
+
}), lt = fn({
|
|
652
|
+
getContent: (e) => et(e, R),
|
|
653
|
+
markEnterFromLeft: Te,
|
|
654
|
+
buffer: xe,
|
|
655
|
+
stats: Be,
|
|
656
|
+
isEnabled: () => s.mode === "backfill",
|
|
657
|
+
getPageSize: () => s.pageSize,
|
|
658
|
+
getRequestDelayMs: () => s.backfillRequestDelayMs
|
|
659
|
+
}), Me = S(() => s.items !== void 0);
|
|
660
|
+
ne(
|
|
661
|
+
() => s.items,
|
|
650
662
|
(e) => {
|
|
651
|
-
|
|
663
|
+
Me.value && (_e.value = Array.isArray(e) ? e : []);
|
|
652
664
|
},
|
|
653
665
|
{ immediate: !0 }
|
|
654
666
|
);
|
|
655
|
-
const d =
|
|
667
|
+
const d = S({
|
|
656
668
|
get() {
|
|
657
|
-
return
|
|
669
|
+
return Me.value ? _e.value : tt.value;
|
|
658
670
|
},
|
|
659
671
|
set(e) {
|
|
660
|
-
|
|
672
|
+
Me.value ? (_e.value = e, i("update:items", e)) : tt.value = e;
|
|
661
673
|
}
|
|
662
|
-
});
|
|
663
|
-
async function
|
|
664
|
-
const
|
|
665
|
-
return ue(
|
|
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 };
|
|
666
678
|
}
|
|
667
|
-
function
|
|
679
|
+
function Ae(e) {
|
|
668
680
|
return e ? typeof e == "string" ? e : e?.id : null;
|
|
669
681
|
}
|
|
670
|
-
async function
|
|
671
|
-
const
|
|
672
|
-
if (!
|
|
673
|
-
const
|
|
674
|
-
for (const b of
|
|
675
|
-
const
|
|
676
|
-
if (
|
|
677
|
-
const z = d.value[
|
|
678
|
-
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));
|
|
679
691
|
}
|
|
680
|
-
|
|
681
|
-
const
|
|
682
|
-
for (const b of
|
|
683
|
-
const
|
|
684
|
-
if (
|
|
685
|
-
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];
|
|
686
698
|
if (!z) continue;
|
|
687
|
-
const
|
|
699
|
+
const ge = fe.value[w] ?? { x: 0, y: 0 }, mt = Pe.value[w] ?? v;
|
|
688
700
|
x.push({
|
|
689
701
|
id: b,
|
|
690
702
|
item: z,
|
|
691
|
-
fromX:
|
|
692
|
-
fromY:
|
|
693
|
-
width:
|
|
694
|
-
height:
|
|
703
|
+
fromX: ge.x,
|
|
704
|
+
fromY: ge.y,
|
|
705
|
+
width: v,
|
|
706
|
+
height: mt,
|
|
695
707
|
leaving: !0
|
|
696
708
|
});
|
|
697
709
|
}
|
|
698
710
|
if (x.length && (Y.value = [...Y.value, ...x]), d.value = d.value.filter((b) => {
|
|
699
|
-
const
|
|
700
|
-
return !
|
|
701
|
-
}), await
|
|
702
|
-
const b = new Set(x.map((
|
|
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));
|
|
703
715
|
re(() => {
|
|
704
716
|
Y.value = Y.value.map(
|
|
705
|
-
(
|
|
717
|
+
(w) => b.has(w.id) ? { ...w, leaving: !1 } : w
|
|
706
718
|
), setTimeout(() => {
|
|
707
|
-
Y.value = Y.value.filter((
|
|
708
|
-
},
|
|
719
|
+
Y.value = Y.value.filter((w) => !b.has(w.id));
|
|
720
|
+
}, Ft);
|
|
709
721
|
});
|
|
710
722
|
}
|
|
711
723
|
}
|
|
712
|
-
async function
|
|
713
|
-
return
|
|
724
|
+
async function Ee(e) {
|
|
725
|
+
return ot(e);
|
|
714
726
|
}
|
|
715
|
-
function
|
|
716
|
-
|
|
727
|
+
function $t() {
|
|
728
|
+
R += 1, Q = null, Z = null, K.value = !1, J.value = !1;
|
|
717
729
|
}
|
|
718
|
-
|
|
719
|
-
remove:
|
|
720
|
-
restore:
|
|
721
|
-
undo:
|
|
722
|
-
forget:
|
|
723
|
-
loadNextPage:
|
|
724
|
-
cancel:
|
|
730
|
+
y({
|
|
731
|
+
remove: ot,
|
|
732
|
+
restore: qt,
|
|
733
|
+
undo: Dt,
|
|
734
|
+
forget: Ot,
|
|
735
|
+
loadNextPage: it,
|
|
736
|
+
cancel: $t,
|
|
725
737
|
get pagesLoaded() {
|
|
726
|
-
return
|
|
738
|
+
return D.value;
|
|
727
739
|
},
|
|
728
740
|
set pagesLoaded(e) {
|
|
729
|
-
|
|
741
|
+
D.value = e;
|
|
730
742
|
},
|
|
731
743
|
get nextPage() {
|
|
732
|
-
return
|
|
744
|
+
return B.value;
|
|
733
745
|
},
|
|
734
746
|
set nextPage(e) {
|
|
735
|
-
|
|
747
|
+
B.value = e;
|
|
736
748
|
},
|
|
737
749
|
get isLoading() {
|
|
738
|
-
return
|
|
750
|
+
return K.value || J.value;
|
|
739
751
|
},
|
|
740
752
|
get hasReachedEnd() {
|
|
741
|
-
return
|
|
753
|
+
return s.mode !== "backfill" ? B.value == null : B.value == null && xe.value.length === 0;
|
|
742
754
|
},
|
|
743
755
|
get backfillStats() {
|
|
744
|
-
return
|
|
756
|
+
return Be.value;
|
|
745
757
|
}
|
|
746
758
|
});
|
|
747
|
-
function
|
|
748
|
-
const e =
|
|
759
|
+
function st() {
|
|
760
|
+
const e = dn({
|
|
749
761
|
items: d.value,
|
|
750
|
-
columnCount:
|
|
751
|
-
columnWidth:
|
|
752
|
-
gapX:
|
|
753
|
-
gapY:
|
|
754
|
-
headerHeight:
|
|
755
|
-
footerHeight:
|
|
756
|
-
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
|
|
757
769
|
});
|
|
758
|
-
fe.value = e.positions,
|
|
770
|
+
fe.value = e.positions, Pe.value = e.heights, Xe.value = e.buckets, je.value = e.contentHeight, pe.value = e.indexById;
|
|
759
771
|
}
|
|
760
|
-
const
|
|
772
|
+
const rt = S(() => Math.max(je.value, q.value) + kn), Re = S(() => vn({
|
|
761
773
|
itemCount: d.value.length,
|
|
762
774
|
viewportHeight: q.value,
|
|
763
775
|
scrollTop: H.value,
|
|
764
|
-
overscanPx:
|
|
765
|
-
bucketPx:
|
|
766
|
-
buckets:
|
|
776
|
+
overscanPx: s.overscanPx,
|
|
777
|
+
bucketPx: St,
|
|
778
|
+
buckets: Xe.value
|
|
767
779
|
}));
|
|
768
|
-
|
|
769
|
-
|
|
780
|
+
ne(
|
|
781
|
+
Re,
|
|
770
782
|
(e) => {
|
|
771
783
|
if (!e?.length) return;
|
|
772
|
-
const
|
|
773
|
-
for (const
|
|
774
|
-
const
|
|
775
|
-
|
|
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;
|
|
776
798
|
}
|
|
777
|
-
|
|
778
|
-
const
|
|
779
|
-
for (const
|
|
780
|
-
|
|
781
|
-
}),
|
|
782
|
-
const
|
|
783
|
-
for (const
|
|
784
|
-
|
|
785
|
-
const
|
|
786
|
-
for (const
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
},
|
|
790
|
-
})
|
|
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;
|
|
811
|
+
}, kt);
|
|
812
|
+
});
|
|
791
813
|
},
|
|
792
814
|
{ flush: "post" }
|
|
793
815
|
);
|
|
794
|
-
async function
|
|
795
|
-
if (
|
|
796
|
-
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)
|
|
797
819
|
return;
|
|
798
|
-
const e =
|
|
799
|
-
let
|
|
800
|
-
return
|
|
820
|
+
const e = R;
|
|
821
|
+
let t = null;
|
|
822
|
+
return t = (async () => {
|
|
801
823
|
try {
|
|
802
|
-
if (
|
|
803
|
-
const
|
|
804
|
-
if (e !==
|
|
805
|
-
|
|
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;
|
|
806
828
|
return;
|
|
807
829
|
}
|
|
808
|
-
const
|
|
809
|
-
if (
|
|
810
|
-
const
|
|
811
|
-
if (e !==
|
|
812
|
-
|
|
813
|
-
} catch (
|
|
814
|
-
if (e !==
|
|
815
|
-
ie.value =
|
|
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);
|
|
816
838
|
} finally {
|
|
817
|
-
e ===
|
|
839
|
+
e === R && (J.value = !1), Q === t && (Q = null);
|
|
818
840
|
}
|
|
819
|
-
})(),
|
|
841
|
+
})(), Q = t, t;
|
|
820
842
|
}
|
|
821
|
-
function
|
|
843
|
+
function Vt() {
|
|
822
844
|
const e = _.value;
|
|
823
845
|
if (!e) return;
|
|
824
|
-
H.value = e.scrollTop, q.value = e.clientHeight, e.scrollHeight - (e.scrollTop + e.clientHeight) <=
|
|
846
|
+
H.value = e.scrollTop, q.value = e.clientHeight, e.scrollHeight - (e.scrollTop + e.clientHeight) <= s.prefetchThresholdPx && it();
|
|
825
847
|
}
|
|
826
|
-
function
|
|
848
|
+
function ut() {
|
|
827
849
|
return _.value;
|
|
828
850
|
}
|
|
829
|
-
function
|
|
830
|
-
P.value =
|
|
851
|
+
function ct(e) {
|
|
852
|
+
P.value = qe(e), q.value = e.clientHeight;
|
|
831
853
|
}
|
|
832
|
-
function
|
|
833
|
-
typeof ResizeObserver > "u" || (
|
|
834
|
-
const e =
|
|
835
|
-
e &&
|
|
854
|
+
function Yt() {
|
|
855
|
+
typeof ResizeObserver > "u" || (le = new ResizeObserver(() => {
|
|
856
|
+
const e = ut();
|
|
857
|
+
e && ct(e);
|
|
836
858
|
}));
|
|
837
859
|
}
|
|
838
|
-
function
|
|
860
|
+
function Xt() {
|
|
839
861
|
return {
|
|
840
|
-
enabled:
|
|
862
|
+
enabled: s.mode === "backfill",
|
|
841
863
|
isBackfillActive: !1,
|
|
842
864
|
isRequestInFlight: !1,
|
|
843
865
|
requestPage: null,
|
|
@@ -846,8 +868,8 @@ const fn = { class: "hidden" }, dn = {
|
|
|
846
868
|
target: 0
|
|
847
869
|
},
|
|
848
870
|
cooldownMsRemaining: 0,
|
|
849
|
-
cooldownMsTotal:
|
|
850
|
-
pageSize:
|
|
871
|
+
cooldownMsTotal: Le(s.backfillRequestDelayMs),
|
|
872
|
+
pageSize: _t(s.pageSize),
|
|
851
873
|
bufferSize: 0,
|
|
852
874
|
lastBatch: null,
|
|
853
875
|
totals: {
|
|
@@ -856,128 +878,120 @@ const fn = { class: "hidden" }, dn = {
|
|
|
856
878
|
}
|
|
857
879
|
};
|
|
858
880
|
}
|
|
859
|
-
function
|
|
860
|
-
|
|
861
|
-
}
|
|
862
|
-
function ut(e) {
|
|
863
|
-
it(), d.value = [], R.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 = "";
|
|
864
883
|
}
|
|
865
|
-
function
|
|
866
|
-
|
|
867
|
-
for (const s of n) {
|
|
868
|
-
if (s == null) continue;
|
|
869
|
-
const h = typeof s == "string" ? `s:${s}` : `n:${String(s)}`;
|
|
870
|
-
l.has(h) || (l.add(h), t.push(s));
|
|
871
|
-
}
|
|
872
|
-
return t;
|
|
884
|
+
function dt(e) {
|
|
885
|
+
ft(), d.value = [], B.value = e;
|
|
873
886
|
}
|
|
874
|
-
function
|
|
875
|
-
const n = [];
|
|
876
|
-
for (const
|
|
877
|
-
if (
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
}
|
|
881
|
-
if (typeof t == "string") {
|
|
882
|
-
const l = Number.parseInt(t, 10);
|
|
883
|
-
Number.isFinite(l) && n.push(l);
|
|
884
|
-
}
|
|
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));
|
|
885
893
|
}
|
|
886
|
-
return n
|
|
894
|
+
return n;
|
|
887
895
|
}
|
|
888
|
-
function
|
|
889
|
-
|
|
890
|
-
const n = $t(e);
|
|
891
|
-
O.value = n, R.value = typeof a.page == "string" ? a.page : Vt(n), G.value = !1, Et(d.value), ue(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);
|
|
892
898
|
}
|
|
893
|
-
async function
|
|
894
|
-
if (
|
|
895
|
-
const
|
|
896
|
-
let
|
|
897
|
-
return
|
|
899
|
+
async function vt(e) {
|
|
900
|
+
if (Z) return Z;
|
|
901
|
+
const t = R;
|
|
902
|
+
let n = null;
|
|
903
|
+
return n = (async () => {
|
|
898
904
|
try {
|
|
899
|
-
if (
|
|
900
|
-
const
|
|
901
|
-
if (
|
|
902
|
-
|
|
905
|
+
if (s.mode === "backfill") {
|
|
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;
|
|
903
909
|
} else {
|
|
904
|
-
const
|
|
905
|
-
if (
|
|
906
|
-
|
|
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;
|
|
907
913
|
}
|
|
908
|
-
} catch (
|
|
909
|
-
if (
|
|
910
|
-
ie.value =
|
|
914
|
+
} catch (a) {
|
|
915
|
+
if (t !== R || Qe(a)) return;
|
|
916
|
+
ie.value = a instanceof Error ? a.message : String(a);
|
|
911
917
|
} finally {
|
|
912
|
-
|
|
918
|
+
t === R && (K.value = !1), Z === n && (Z = null);
|
|
913
919
|
}
|
|
914
|
-
})(),
|
|
920
|
+
})(), Z = n, n;
|
|
915
921
|
}
|
|
916
|
-
function
|
|
917
|
-
const e =
|
|
918
|
-
e && (
|
|
922
|
+
function Wt() {
|
|
923
|
+
const e = ut();
|
|
924
|
+
e && (ct(e), H.value = e.scrollTop, le?.observe(e));
|
|
919
925
|
}
|
|
920
|
-
|
|
921
|
-
if (
|
|
922
|
-
|
|
926
|
+
He(async () => {
|
|
927
|
+
if (Yt(), Wt(), s.restoredPages != null) {
|
|
928
|
+
me.value = !0, Ce(s.restoredPages);
|
|
923
929
|
return;
|
|
924
930
|
}
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
()
|
|
931
|
+
if (Me.value && d.value.length > 0) {
|
|
932
|
+
me.value = !0, Ce();
|
|
933
|
+
return;
|
|
934
|
+
}
|
|
935
|
+
me.value = !1, dt(s.page), await vt(s.page);
|
|
936
|
+
}), Pt(() => {
|
|
937
|
+
le?.disconnect(), M && (clearTimeout(M), M = null), F && (clearTimeout(F), F = null), A(), N();
|
|
938
|
+
}), ne(
|
|
939
|
+
() => s.page,
|
|
930
940
|
async (e) => {
|
|
931
|
-
|
|
941
|
+
if (me.value) {
|
|
942
|
+
B.value = e;
|
|
943
|
+
return;
|
|
944
|
+
}
|
|
945
|
+
dt(e), await vt(e);
|
|
932
946
|
}
|
|
933
|
-
),
|
|
934
|
-
() =>
|
|
947
|
+
), ne(
|
|
948
|
+
() => s.restoredPages,
|
|
935
949
|
(e) => {
|
|
936
|
-
e &&
|
|
950
|
+
e && (me.value = !0, Ce(e));
|
|
937
951
|
}
|
|
938
|
-
),
|
|
939
|
-
|
|
952
|
+
), ne(
|
|
953
|
+
ae,
|
|
940
954
|
() => {
|
|
941
955
|
const e = _.value;
|
|
942
|
-
e && (P.value =
|
|
956
|
+
e && (P.value = qe(e));
|
|
943
957
|
},
|
|
944
958
|
{ immediate: !1 }
|
|
945
959
|
);
|
|
946
|
-
const
|
|
947
|
-
() =>
|
|
960
|
+
const Ne = S(() => rn(P.value, s.itemWidth)), he = S(
|
|
961
|
+
() => un(P.value, Ne.value, s.itemWidth, ae.value)
|
|
948
962
|
);
|
|
949
|
-
|
|
950
|
-
[
|
|
963
|
+
ne(
|
|
964
|
+
[Ne, he, ae, ze, oe, se],
|
|
951
965
|
() => {
|
|
952
|
-
|
|
966
|
+
st();
|
|
953
967
|
},
|
|
954
968
|
{ immediate: !0 }
|
|
955
|
-
),
|
|
969
|
+
), ne(
|
|
956
970
|
// Performance note: this component targets very large arrays (e.g. 10k items).
|
|
957
971
|
// Avoid deep watchers over items; rebuild layout only when the list structure
|
|
958
972
|
// changes (new array reference or length change). This keeps metadata-only
|
|
959
973
|
// updates (e.g. reactions) cheap.
|
|
960
974
|
() => [d.value, d.value.length],
|
|
961
|
-
() =>
|
|
975
|
+
() => st(),
|
|
962
976
|
{ immediate: !0 }
|
|
963
977
|
);
|
|
964
|
-
const
|
|
978
|
+
const Gt = S(() => [
|
|
965
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",
|
|
966
|
-
|
|
980
|
+
m.class
|
|
967
981
|
]);
|
|
968
|
-
return (e,
|
|
969
|
-
T("div",
|
|
970
|
-
|
|
982
|
+
return (e, t) => (k(), I("section", Qt(O.value, { class: Gt.value }), [
|
|
983
|
+
T("div", mn, [
|
|
984
|
+
Zt(e.$slots, "default")
|
|
971
985
|
]),
|
|
972
986
|
T("div", {
|
|
973
987
|
ref_key: "scrollViewportRef",
|
|
974
988
|
ref: _,
|
|
975
989
|
"data-testid": "items-scroll-container",
|
|
976
990
|
class: "mt-4 min-h-0 flex-1 overflow-auto",
|
|
977
|
-
style: $({ paddingRight:
|
|
978
|
-
onScroll:
|
|
991
|
+
style: $({ paddingRight: ae.value + "px" }),
|
|
992
|
+
onScroll: Vt
|
|
979
993
|
}, [
|
|
980
|
-
|
|
994
|
+
K.value ? (k(), I("div", hn, t[0] || (t[0] = [
|
|
981
995
|
T("div", { class: "inline-flex items-center gap-3 text-sm text-slate-600" }, [
|
|
982
996
|
T("svg", {
|
|
983
997
|
class: "h-5 w-5 animate-spin text-slate-500",
|
|
@@ -1001,107 +1015,108 @@ const fn = { class: "hidden" }, dn = {
|
|
|
1001
1015
|
]),
|
|
1002
1016
|
T("span", null, "Loading…")
|
|
1003
1017
|
], -1)
|
|
1004
|
-
]))) : ie.value ? (
|
|
1018
|
+
]))) : ie.value ? (k(), I("p", gn, "Error: " + pt(ie.value), 1)) : (k(), I("div", {
|
|
1005
1019
|
key: 2,
|
|
1006
1020
|
class: "relative",
|
|
1007
|
-
style: $({ height:
|
|
1021
|
+
style: $({ height: rt.value + "px" })
|
|
1008
1022
|
}, [
|
|
1009
|
-
(
|
|
1010
|
-
key: d.value[
|
|
1023
|
+
(k(!0), I(yt, null, wt(Re.value, (n) => (k(), I("article", {
|
|
1024
|
+
key: d.value[n].id,
|
|
1011
1025
|
"data-testid": "item-card",
|
|
1012
1026
|
class: "absolute overflow-hidden rounded-xl border border-slate-200/60 bg-white shadow-sm",
|
|
1013
1027
|
style: $({
|
|
1014
|
-
width:
|
|
1015
|
-
transition:
|
|
1016
|
-
|
|
1028
|
+
width: he.value + "px",
|
|
1029
|
+
transition: Rt(d.value[n].id),
|
|
1030
|
+
transitionDelay: At(d.value[n].id),
|
|
1031
|
+
transform: Ct(n)
|
|
1017
1032
|
})
|
|
1018
1033
|
}, [
|
|
1019
|
-
|
|
1034
|
+
De.value || oe.value > 0 ? (k(), I("div", {
|
|
1020
1035
|
key: 0,
|
|
1021
1036
|
"data-testid": "item-header-container",
|
|
1022
1037
|
class: "w-full",
|
|
1023
|
-
style: $(
|
|
1038
|
+
style: $(Ve.value)
|
|
1024
1039
|
}, [
|
|
1025
1040
|
X(ce(c), {
|
|
1026
|
-
"slot-fn":
|
|
1027
|
-
"slot-props": { item: d.value[
|
|
1041
|
+
"slot-fn": Ie.value,
|
|
1042
|
+
"slot-props": { item: d.value[n], remove: () => Ee(d.value[n]) }
|
|
1028
1043
|
}, null, 8, ["slot-fn", "slot-props"])
|
|
1029
1044
|
], 4)) : j("", !0),
|
|
1030
|
-
T("div",
|
|
1031
|
-
X(
|
|
1032
|
-
item: d.value[
|
|
1033
|
-
onSuccess:
|
|
1045
|
+
T("div", pn, [
|
|
1046
|
+
X(bt, {
|
|
1047
|
+
item: d.value[n],
|
|
1048
|
+
onSuccess: C,
|
|
1034
1049
|
onError: W
|
|
1035
1050
|
}, null, 8, ["item"]),
|
|
1036
|
-
|
|
1051
|
+
$e.value ? (k(), I("div", yn, [
|
|
1037
1052
|
X(ce(c), {
|
|
1038
|
-
"slot-fn":
|
|
1039
|
-
"slot-props": { item: d.value[
|
|
1053
|
+
"slot-fn": Fe.value,
|
|
1054
|
+
"slot-props": { item: d.value[n], remove: () => Ee(d.value[n]) }
|
|
1040
1055
|
}, null, 8, ["slot-fn", "slot-props"])
|
|
1041
1056
|
])) : j("", !0)
|
|
1042
1057
|
]),
|
|
1043
|
-
|
|
1058
|
+
Oe.value || se.value > 0 ? (k(), I("div", {
|
|
1044
1059
|
key: 1,
|
|
1045
1060
|
"data-testid": "item-footer-container",
|
|
1046
1061
|
class: "w-full",
|
|
1047
|
-
style: $(
|
|
1062
|
+
style: $(Ye.value)
|
|
1048
1063
|
}, [
|
|
1049
1064
|
X(ce(c), {
|
|
1050
|
-
"slot-fn":
|
|
1051
|
-
"slot-props": { item: d.value[
|
|
1065
|
+
"slot-fn": ke.value,
|
|
1066
|
+
"slot-props": { item: d.value[n], remove: () => Ee(d.value[n]) }
|
|
1052
1067
|
}, null, 8, ["slot-fn", "slot-props"])
|
|
1053
1068
|
], 4)) : j("", !0)
|
|
1054
1069
|
], 4))), 128)),
|
|
1055
|
-
(
|
|
1056
|
-
key:
|
|
1070
|
+
(k(!0), I(yt, null, wt(Y.value, (n) => (k(), I("article", {
|
|
1071
|
+
key: n.id + ":leaving",
|
|
1057
1072
|
"data-testid": "item-card-leaving",
|
|
1058
1073
|
class: "pointer-events-none absolute overflow-hidden rounded-xl border border-slate-200/60 bg-white shadow-sm",
|
|
1059
1074
|
style: $({
|
|
1060
|
-
width:
|
|
1061
|
-
transition: "transform " +
|
|
1062
|
-
transform:
|
|
1075
|
+
width: n.width + "px",
|
|
1076
|
+
transition: "transform " + Ft + "ms ease-out",
|
|
1077
|
+
transform: n.leaving ? "translate3d(" + n.fromX + "px," + n.fromY + "px,0)" : "translate3d(" + n.fromX + "px," + We(n.height) + "px,0)"
|
|
1063
1078
|
})
|
|
1064
1079
|
}, [
|
|
1065
|
-
|
|
1080
|
+
De.value || oe.value > 0 ? (k(), I("div", {
|
|
1066
1081
|
key: 0,
|
|
1067
1082
|
"data-testid": "item-header-container",
|
|
1068
1083
|
class: "w-full",
|
|
1069
|
-
style: $(
|
|
1084
|
+
style: $(Ve.value)
|
|
1070
1085
|
}, [
|
|
1071
1086
|
X(ce(c), {
|
|
1072
|
-
"slot-fn":
|
|
1073
|
-
"slot-props": { item:
|
|
1087
|
+
"slot-fn": Ie.value,
|
|
1088
|
+
"slot-props": { item: n.item, remove: () => {
|
|
1074
1089
|
} }
|
|
1075
1090
|
}, null, 8, ["slot-fn", "slot-props"])
|
|
1076
1091
|
], 4)) : j("", !0),
|
|
1077
|
-
T("div",
|
|
1078
|
-
X(
|
|
1079
|
-
item:
|
|
1092
|
+
T("div", wn, [
|
|
1093
|
+
X(bt, {
|
|
1094
|
+
item: n.item
|
|
1080
1095
|
}, null, 8, ["item"]),
|
|
1081
|
-
|
|
1096
|
+
$e.value ? (k(), I("div", xn, [
|
|
1082
1097
|
X(ce(c), {
|
|
1083
|
-
"slot-fn":
|
|
1084
|
-
"slot-props": { item:
|
|
1098
|
+
"slot-fn": Fe.value,
|
|
1099
|
+
"slot-props": { item: n.item, remove: () => {
|
|
1085
1100
|
} }
|
|
1086
1101
|
}, null, 8, ["slot-fn", "slot-props"])
|
|
1087
1102
|
])) : j("", !0)
|
|
1088
1103
|
]),
|
|
1089
|
-
|
|
1104
|
+
Oe.value || se.value > 0 ? (k(), I("div", {
|
|
1090
1105
|
key: 1,
|
|
1091
1106
|
"data-testid": "item-footer-container",
|
|
1092
1107
|
class: "w-full",
|
|
1093
|
-
style: $(
|
|
1108
|
+
style: $(Ye.value)
|
|
1094
1109
|
}, [
|
|
1095
1110
|
X(ce(c), {
|
|
1096
|
-
"slot-fn":
|
|
1097
|
-
"slot-props": { item:
|
|
1111
|
+
"slot-fn": ke.value,
|
|
1112
|
+
"slot-props": { item: n.item, remove: () => {
|
|
1098
1113
|
} }
|
|
1099
1114
|
}, null, 8, ["slot-fn", "slot-props"])
|
|
1100
1115
|
], 4)) : j("", !0)
|
|
1101
1116
|
], 4))), 128))
|
|
1102
1117
|
], 4)),
|
|
1103
|
-
T("div",
|
|
1104
|
-
|
|
1118
|
+
T("div", bn, [
|
|
1119
|
+
J.value ? (k(), I("span", Mn, t[1] || (t[1] = [
|
|
1105
1120
|
T("svg", {
|
|
1106
1121
|
class: "h-4 w-4 animate-spin text-slate-500",
|
|
1107
1122
|
viewBox: "0 0 24 24",
|
|
@@ -1123,40 +1138,40 @@ const fn = { class: "hidden" }, dn = {
|
|
|
1123
1138
|
})
|
|
1124
1139
|
], -1),
|
|
1125
1140
|
T("span", null, "Loading more…", -1)
|
|
1126
|
-
]))) :
|
|
1141
|
+
]))) : B.value == null ? (k(), I("span", Sn, "End of list")) : (k(), I("span", In, "Scroll to load page " + pt(B.value), 1))
|
|
1127
1142
|
])
|
|
1128
1143
|
], 36)
|
|
1129
1144
|
], 16));
|
|
1130
1145
|
}
|
|
1131
|
-
}),
|
|
1146
|
+
}), Bn = Se({
|
|
1132
1147
|
name: "MasonryItem",
|
|
1133
|
-
setup(
|
|
1134
|
-
const
|
|
1135
|
-
if (!
|
|
1148
|
+
setup(l, { slots: y, attrs: u }) {
|
|
1149
|
+
const s = en(Tt, null);
|
|
1150
|
+
if (!s)
|
|
1136
1151
|
return () => null;
|
|
1137
|
-
const i = u.onPreloaded,
|
|
1138
|
-
return
|
|
1139
|
-
header:
|
|
1152
|
+
const i = u.onPreloaded, m = u.onFailed, c = y.overlay, r = y.default;
|
|
1153
|
+
return s({
|
|
1154
|
+
header: y.header,
|
|
1140
1155
|
overlay: c ?? r,
|
|
1141
|
-
footer:
|
|
1142
|
-
onPreloaded: typeof i == "function" ? i : Array.isArray(i) ? (
|
|
1143
|
-
for (const
|
|
1144
|
-
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);
|
|
1145
1160
|
} : void 0,
|
|
1146
|
-
onFailed: typeof
|
|
1147
|
-
for (const
|
|
1148
|
-
typeof
|
|
1161
|
+
onFailed: typeof m == "function" ? m : Array.isArray(m) ? (h) => {
|
|
1162
|
+
for (const g of m)
|
|
1163
|
+
typeof g == "function" && g(h);
|
|
1149
1164
|
} : void 0
|
|
1150
1165
|
}), () => null;
|
|
1151
1166
|
}
|
|
1152
|
-
}),
|
|
1153
|
-
install(
|
|
1154
|
-
|
|
1167
|
+
}), En = {
|
|
1168
|
+
install(l) {
|
|
1169
|
+
l.component("Masonry", _n), l.component("MasonryItem", Bn);
|
|
1155
1170
|
}
|
|
1156
1171
|
};
|
|
1157
1172
|
export {
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1173
|
+
_n as Masonry,
|
|
1174
|
+
Bn as MasonryItem,
|
|
1175
|
+
En as VibePlugin,
|
|
1176
|
+
tn as masonryDefaults
|
|
1162
1177
|
};
|