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