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