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