@wyxos/vibe 3.0.6 → 3.0.7
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 +10 -0
- package/lib/components/viewer-core/removalState.d.ts +3 -0
- package/lib/components/viewer-core/useAutoResolveSource.d.ts +3 -0
- package/lib/components/viewer-core/useController.d.ts +4 -0
- package/lib/components/viewer-core/useDataSource.d.ts +3 -0
- package/lib/index.cjs +1 -1
- package/lib/index.js +589 -570
- package/lib/style.css +1 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -3,10 +3,10 @@ import { Comment as e, Fragment as t, Text as n, Transition as r, computed as i,
|
|
|
3
3
|
var B = (e) => {
|
|
4
4
|
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
|
|
5
5
|
return !1;
|
|
6
|
-
}, V = (e) => e === "", H = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), U = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), W = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()),
|
|
6
|
+
}, V = (e) => e === "", H = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), U = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), W = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), ee = (e) => {
|
|
7
7
|
let t = W(e);
|
|
8
8
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
9
|
-
},
|
|
9
|
+
}, G = {
|
|
10
10
|
xmlns: "http://www.w3.org/2000/svg",
|
|
11
11
|
width: 24,
|
|
12
12
|
height: 24,
|
|
@@ -16,27 +16,27 @@ var B = (e) => {
|
|
|
16
16
|
"stroke-width": 2,
|
|
17
17
|
"stroke-linecap": "round",
|
|
18
18
|
"stroke-linejoin": "round"
|
|
19
|
-
},
|
|
20
|
-
...
|
|
19
|
+
}, K = ({ name: e, iconNode: t, absoluteStrokeWidth: n, "absolute-stroke-width": r, strokeWidth: i, "stroke-width": a, size: o = G.width, color: s = G.stroke, ...c }, { slots: l }) => p("svg", {
|
|
20
|
+
...G,
|
|
21
21
|
...c,
|
|
22
22
|
width: o,
|
|
23
23
|
height: o,
|
|
24
24
|
stroke: s,
|
|
25
|
-
"stroke-width": V(n) || V(r) || n === !0 || r === !0 ? Number(i || a ||
|
|
26
|
-
class: H("lucide", c.class, ...e ? [`lucide-${U(
|
|
25
|
+
"stroke-width": V(n) || V(r) || n === !0 || r === !0 ? Number(i || a || G["stroke-width"]) * 24 / Number(o) : i || a || G["stroke-width"],
|
|
26
|
+
class: H("lucide", c.class, ...e ? [`lucide-${U(ee(e))}-icon`, `lucide-${U(e)}`] : ["lucide-icon"]),
|
|
27
27
|
...!l.default && !B(c) && { "aria-hidden": "true" }
|
|
28
|
-
}, [...t.map((e) => p(...e)), ...l.default ? [l.default()] : []]),
|
|
28
|
+
}, [...t.map((e) => p(...e)), ...l.default ? [l.default()] : []]), q = (e, t) => (n, { slots: r, attrs: i }) => p(K, {
|
|
29
29
|
...i,
|
|
30
30
|
...n,
|
|
31
31
|
iconNode: t,
|
|
32
32
|
name: e
|
|
33
|
-
}, r),
|
|
33
|
+
}, r), J = q("arrow-left", [["path", {
|
|
34
34
|
d: "m12 19-7-7 7-7",
|
|
35
35
|
key: "1l729n"
|
|
36
36
|
}], ["path", {
|
|
37
37
|
d: "M19 12H5",
|
|
38
38
|
key: "x3x0zl"
|
|
39
|
-
}]]),
|
|
39
|
+
}]]), Y = q("audio-lines", [
|
|
40
40
|
["path", {
|
|
41
41
|
d: "M2 10v3",
|
|
42
42
|
key: "1fnikh"
|
|
@@ -61,7 +61,7 @@ var B = (e) => {
|
|
|
61
61
|
d: "M22 10v3",
|
|
62
62
|
key: "154ddg"
|
|
63
63
|
}]
|
|
64
|
-
]),
|
|
64
|
+
]), X = q("clapperboard", [
|
|
65
65
|
["path", {
|
|
66
66
|
d: "m12.296 3.464 3.02 3.956",
|
|
67
67
|
key: "qash78"
|
|
@@ -78,13 +78,13 @@ var B = (e) => {
|
|
|
78
78
|
d: "m6.18 5.276 3.1 3.899",
|
|
79
79
|
key: "zjj9t3"
|
|
80
80
|
}]
|
|
81
|
-
]), te =
|
|
81
|
+
]), te = q("file", [["path", {
|
|
82
82
|
d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
|
|
83
83
|
key: "1oefj6"
|
|
84
84
|
}], ["path", {
|
|
85
85
|
d: "M14 2v5a1 1 0 0 0 1 1h5",
|
|
86
86
|
key: "wfsgrz"
|
|
87
|
-
}]]), ne =
|
|
87
|
+
}]]), ne = q("image-plus", [
|
|
88
88
|
["path", {
|
|
89
89
|
d: "M16 5h6",
|
|
90
90
|
key: "1vod17"
|
|
@@ -107,10 +107,10 @@ var B = (e) => {
|
|
|
107
107
|
r: "2",
|
|
108
108
|
key: "af1f0g"
|
|
109
109
|
}]
|
|
110
|
-
]), re =
|
|
110
|
+
]), re = q("loader-circle", [["path", {
|
|
111
111
|
d: "M21 12a9 9 0 1 1-6.219-8.56",
|
|
112
112
|
key: "13zald"
|
|
113
|
-
}]]), ie =
|
|
113
|
+
}]]), ie = q("pause", [["rect", {
|
|
114
114
|
x: "14",
|
|
115
115
|
y: "3",
|
|
116
116
|
width: "5",
|
|
@@ -124,10 +124,10 @@ var B = (e) => {
|
|
|
124
124
|
height: "18",
|
|
125
125
|
rx: "1",
|
|
126
126
|
key: "1wsw3u"
|
|
127
|
-
}]]), ae =
|
|
127
|
+
}]]), ae = q("play", [["path", {
|
|
128
128
|
d: "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",
|
|
129
129
|
key: "10ikf1"
|
|
130
|
-
}]]), oe =
|
|
130
|
+
}]]), oe = q("triangle-alert", [
|
|
131
131
|
["path", {
|
|
132
132
|
d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
|
|
133
133
|
key: "wmoenq"
|
|
@@ -141,13 +141,13 @@ var B = (e) => {
|
|
|
141
141
|
key: "p32p05"
|
|
142
142
|
}]
|
|
143
143
|
]);
|
|
144
|
-
function Z(e, t = 150) {
|
|
145
|
-
return ce(e, (e) => `${e.surface}|${e.occurrenceKey}|${e.url}|${e.kind}`, t);
|
|
146
|
-
}
|
|
147
144
|
function se(e, t = 150) {
|
|
148
|
-
return
|
|
145
|
+
return le(e, (e) => `${e.surface}|${e.occurrenceKey}|${e.url}|${e.kind}`, t);
|
|
146
|
+
}
|
|
147
|
+
function ce(e, t = 150) {
|
|
148
|
+
return le(e, (e) => `${e.surface}|${e.occurrenceKey}|${e.url}`, t);
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function le(e, t, n) {
|
|
151
151
|
let r = [], i = /* @__PURE__ */ new Set(), a = null;
|
|
152
152
|
function o(e) {
|
|
153
153
|
let o = t(e);
|
|
@@ -171,29 +171,29 @@ function ce(e, t, n) {
|
|
|
171
171
|
}
|
|
172
172
|
//#endregion
|
|
173
173
|
//#region src/components/viewer-core/dom.ts
|
|
174
|
-
function
|
|
174
|
+
function ue(e) {
|
|
175
175
|
return e instanceof HTMLElement && [
|
|
176
176
|
"INPUT",
|
|
177
177
|
"TEXTAREA",
|
|
178
178
|
"SELECT"
|
|
179
179
|
].includes(e.tagName);
|
|
180
180
|
}
|
|
181
|
-
function
|
|
181
|
+
function de(e) {
|
|
182
182
|
return e instanceof HTMLElement && !!e.closest("[data-swipe-lock], input, textarea, select, a");
|
|
183
183
|
}
|
|
184
184
|
//#endregion
|
|
185
185
|
//#region src/components/viewer-core/removalState.ts
|
|
186
|
-
function
|
|
186
|
+
function fe() {
|
|
187
187
|
let e = T(/* @__PURE__ */ new Set()), t = T([]);
|
|
188
188
|
function n(n) {
|
|
189
|
-
let r =
|
|
189
|
+
let r = Z(n).filter((t) => !e.value.has(t));
|
|
190
190
|
if (!r.length) return { ids: [] };
|
|
191
191
|
let i = new Set(e.value);
|
|
192
192
|
for (let e of r) i.add(e);
|
|
193
193
|
return e.value = i, t.value = [...t.value, r], { ids: r };
|
|
194
194
|
}
|
|
195
195
|
function r(t) {
|
|
196
|
-
let n =
|
|
196
|
+
let n = Z(t).filter((t) => e.value.has(t));
|
|
197
197
|
if (!n.length) return { ids: [] };
|
|
198
198
|
let r = new Set(e.value);
|
|
199
199
|
for (let e of n) r.delete(e);
|
|
@@ -224,92 +224,92 @@ function ue() {
|
|
|
224
224
|
undo: i
|
|
225
225
|
};
|
|
226
226
|
}
|
|
227
|
-
function
|
|
227
|
+
function Z(e) {
|
|
228
228
|
let t = Array.isArray(e) ? e : [e];
|
|
229
229
|
return Array.from(new Set(t.filter((e) => typeof e == "string" && e.length > 0)));
|
|
230
230
|
}
|
|
231
231
|
//#endregion
|
|
232
232
|
//#region src/components/viewer-core/itemIdentity.ts
|
|
233
|
-
var
|
|
234
|
-
function
|
|
235
|
-
let t = e[
|
|
233
|
+
var pe = "__vibeOccurrenceKey";
|
|
234
|
+
function Q(e) {
|
|
235
|
+
let t = e[pe];
|
|
236
236
|
return typeof t == "string" && t.length > 0 ? t : e.id;
|
|
237
237
|
}
|
|
238
|
-
function
|
|
238
|
+
function me(e, t, n) {
|
|
239
239
|
let r = /* @__PURE__ */ new Map(), i = [], a = n;
|
|
240
240
|
for (let e of t) {
|
|
241
|
-
let t = r.get(e.id), n =
|
|
241
|
+
let t = r.get(e.id), n = Q(e);
|
|
242
242
|
t ? t.push(n) : r.set(e.id, [n]);
|
|
243
243
|
}
|
|
244
244
|
for (let t of e) {
|
|
245
245
|
let e = r.get(t.id)?.shift() ?? `vibe-occurrence-${a += 1}`;
|
|
246
|
-
i.push(
|
|
246
|
+
i.push(he(t, e));
|
|
247
247
|
}
|
|
248
248
|
return {
|
|
249
249
|
items: i,
|
|
250
250
|
nextSequence: a
|
|
251
251
|
};
|
|
252
252
|
}
|
|
253
|
-
function
|
|
254
|
-
return
|
|
253
|
+
function he(e, t) {
|
|
254
|
+
return Q(e) === t ? e : {
|
|
255
255
|
...e,
|
|
256
|
-
[
|
|
256
|
+
[pe]: t
|
|
257
257
|
};
|
|
258
258
|
}
|
|
259
259
|
//#endregion
|
|
260
260
|
//#region src/components/viewer-core/autoBuckets.ts
|
|
261
|
-
function
|
|
261
|
+
function ge(e) {
|
|
262
262
|
return e.flatMap((e) => e.items);
|
|
263
263
|
}
|
|
264
|
-
function ge(e, t) {
|
|
265
|
-
return t.size ? e.filter((e) => !t.has(e.id)) : e;
|
|
266
|
-
}
|
|
267
264
|
function _e(e, t) {
|
|
268
|
-
return
|
|
265
|
+
return t.size ? e.filter((e) => !t.has(e.id)) : e;
|
|
269
266
|
}
|
|
270
267
|
function ve(e, t) {
|
|
271
|
-
return _e(e, t)
|
|
268
|
+
return _e(e.items, t);
|
|
269
|
+
}
|
|
270
|
+
function ye(e, t) {
|
|
271
|
+
return ve(e, t).length;
|
|
272
272
|
}
|
|
273
|
-
function
|
|
273
|
+
function be(e, t, n) {
|
|
274
274
|
if (n < 0) return null;
|
|
275
275
|
let r = 0;
|
|
276
276
|
for (let i of e) {
|
|
277
|
-
let e =
|
|
277
|
+
let e = ve(i, t), a = r + e.length;
|
|
278
278
|
if (n < a) return i.cursor;
|
|
279
279
|
r = a;
|
|
280
280
|
}
|
|
281
281
|
return null;
|
|
282
282
|
}
|
|
283
|
-
function
|
|
283
|
+
function xe(e, t, n) {
|
|
284
284
|
let r = [...e], i = r.findIndex((e) => e.cursor === t);
|
|
285
285
|
return i >= 0 && r.splice(i, 1, n), r;
|
|
286
286
|
}
|
|
287
|
-
function
|
|
288
|
-
let r =
|
|
287
|
+
function Se(e, t, n) {
|
|
288
|
+
let r = me(e, t, n);
|
|
289
289
|
return {
|
|
290
290
|
items: r.items,
|
|
291
291
|
nextSequence: r.nextSequence
|
|
292
292
|
};
|
|
293
293
|
}
|
|
294
|
-
function
|
|
294
|
+
function Ce(e) {
|
|
295
295
|
return e === "filling" || e === "initializing" || e === "loading" || e === "refreshing";
|
|
296
296
|
}
|
|
297
|
-
function
|
|
297
|
+
function we(e) {
|
|
298
298
|
return !e || !Number.isFinite(e) || e < 1 ? 25 : Math.floor(e);
|
|
299
299
|
}
|
|
300
|
-
function
|
|
300
|
+
function Te(e) {
|
|
301
301
|
return e ?? "__vibe_initial_cursor__";
|
|
302
302
|
}
|
|
303
|
-
function
|
|
303
|
+
function Ee(e, t, n) {
|
|
304
304
|
return Math.min(Math.max(e, t), n);
|
|
305
305
|
}
|
|
306
306
|
//#endregion
|
|
307
307
|
//#region src/components/viewer-core/autoResolveState.ts
|
|
308
|
-
function
|
|
308
|
+
function De(e) {
|
|
309
309
|
return e instanceof DOMException && e.name === "AbortError" || e instanceof Error && (e.name === "AbortError" || e.name === "CanceledError") ? !0 : typeof e == "object" && !!e && "code" in e && e.code === "ERR_CANCELED";
|
|
310
310
|
}
|
|
311
|
-
function
|
|
312
|
-
let t =
|
|
311
|
+
function Oe(e) {
|
|
312
|
+
let t = Se(e.nextItems, e.previousItems, e.sequence);
|
|
313
313
|
return {
|
|
314
314
|
bucket: {
|
|
315
315
|
cursor: e.cursor,
|
|
@@ -320,7 +320,7 @@ function De(e) {
|
|
|
320
320
|
nextSequence: t.nextSequence
|
|
321
321
|
};
|
|
322
322
|
}
|
|
323
|
-
function
|
|
323
|
+
function ke(e, t, n, r) {
|
|
324
324
|
if (!e.length) return r ? null : {
|
|
325
325
|
buckets: [],
|
|
326
326
|
canceled: r,
|
|
@@ -330,46 +330,46 @@ function Oe(e, t, n, r) {
|
|
|
330
330
|
return {
|
|
331
331
|
buckets: i,
|
|
332
332
|
canceled: r,
|
|
333
|
-
visibleCount: i.reduce((e, t) => e +
|
|
333
|
+
visibleCount: i.reduce((e, t) => e + ye(t, n), 0)
|
|
334
334
|
};
|
|
335
335
|
}
|
|
336
|
-
function
|
|
337
|
-
let t =
|
|
336
|
+
function Ae(e) {
|
|
337
|
+
let t = Oe({
|
|
338
338
|
cursor: e.initialState.cursor,
|
|
339
339
|
nextCursor: e.initialState.nextCursor ?? null,
|
|
340
340
|
nextItems: e.initialState.items,
|
|
341
341
|
previousCursor: e.initialState.previousCursor ?? null,
|
|
342
342
|
previousItems: [],
|
|
343
343
|
sequence: e.sequence
|
|
344
|
-
}), n =
|
|
344
|
+
}), n = _e(t.bucket.items, e.removedIds);
|
|
345
345
|
return {
|
|
346
|
-
activeIndex:
|
|
346
|
+
activeIndex: Ee(e.initialState.activeIndex ?? 0, 0, Math.max(0, n.length - 1)),
|
|
347
347
|
buckets: [t.bucket],
|
|
348
348
|
nextSequence: t.nextSequence
|
|
349
349
|
};
|
|
350
350
|
}
|
|
351
|
-
function
|
|
352
|
-
let n = e[
|
|
353
|
-
return n ?
|
|
351
|
+
function je(e, t) {
|
|
352
|
+
let n = e[Ee(t, 0, Math.max(0, e.length - 1))];
|
|
353
|
+
return n ? Q(n) : null;
|
|
354
354
|
}
|
|
355
|
-
function
|
|
355
|
+
function Me(e, t, n = null) {
|
|
356
356
|
if (!e.length) return 0;
|
|
357
|
-
let r = n ? e.findIndex((e) =>
|
|
358
|
-
return r >= 0 ? r :
|
|
357
|
+
let r = n ? e.findIndex((e) => Q(e) === n) : -1;
|
|
358
|
+
return r >= 0 ? r : Ee(t, 0, e.length - 1);
|
|
359
359
|
}
|
|
360
|
-
function
|
|
361
|
-
return e ?
|
|
360
|
+
function Ne(e, t, n) {
|
|
361
|
+
return e ? ye(e, t) < n : !1;
|
|
362
362
|
}
|
|
363
363
|
//#endregion
|
|
364
364
|
//#region src/components/viewer-core/fillDelay.ts
|
|
365
|
-
var
|
|
366
|
-
function
|
|
365
|
+
var Pe = 2e3, Fe = 1e3, Ie = 100;
|
|
366
|
+
function Le(e, t = Pe, n = Fe) {
|
|
367
367
|
return t + Math.max(0, e - 1) * n;
|
|
368
368
|
}
|
|
369
|
-
function
|
|
369
|
+
function Re(e, t) {
|
|
370
370
|
return !Number.isFinite(e) || e == null || e < 0 ? t : Math.floor(e);
|
|
371
371
|
}
|
|
372
|
-
function
|
|
372
|
+
function ze() {
|
|
373
373
|
let e = T(null), t = null, n = null, r = null;
|
|
374
374
|
function i(i = !1) {
|
|
375
375
|
if (t &&= (clearInterval(t), null), n &&= (clearTimeout(n), null), e.value = null, i && r) {
|
|
@@ -387,7 +387,7 @@ function Re() {
|
|
|
387
387
|
let t = Math.max(0, a - (Date.now() - s));
|
|
388
388
|
e.value = t, t <= 0 && l();
|
|
389
389
|
};
|
|
390
|
-
t = setInterval(u,
|
|
390
|
+
t = setInterval(u, Ie), n = setTimeout(l, a), u();
|
|
391
391
|
}));
|
|
392
392
|
}
|
|
393
393
|
return {
|
|
@@ -398,173 +398,180 @@ function Re() {
|
|
|
398
398
|
}
|
|
399
399
|
//#endregion
|
|
400
400
|
//#region src/components/viewer-core/useAutoResolveSource.ts
|
|
401
|
-
function
|
|
402
|
-
let t = !!e.initialState?.items.length, n = T([]), r = T(0), a = T([]), o = T(!1), s = T(null), c = T(!t && typeof e.resolve == "function" ? "initializing" : "idle"), l = T(null), u =
|
|
403
|
-
F(() =>
|
|
401
|
+
function Be(e) {
|
|
402
|
+
let t = !!e.initialState?.items.length, n = T([]), r = T(0), a = T([]), o = T(!1), s = T(null), c = T(!t && typeof e.resolve == "function" ? "initializing" : "idle"), l = T(null), u = ze(), d = u.remainingMs, f = T(null), p = T(!1), m = T(!0), h = T(!1), g = /* @__PURE__ */ new Set(), _ = null, v = null, y = 0, S = 0, C = i(() => Re(e.fillDelayMs, Pe)), w = i(() => Re(e.fillDelayStepMs, Fe)), E = i(() => typeof e.resolve == "function"), D = i(() => e.mode ?? "dynamic"), O = i(() => we(e.pageSize)), k = i(() => ge(n.value)), A = i(() => _e(k.value, e.removedIds.value)), j = i(() => r.value), M = i(() => Ce(c.value) || p.value), N = i(() => Ve(n.value, e.removedIds.value)), P = i(() => He(n.value, e.removedIds.value)), I = i(() => P.value?.nextCursor ?? null), L = i(() => o.value ? null : N.value?.previousCursor ?? null), R = i(() => !!I.value), z = i(() => !!L.value), B = i(() => E.value && n.value.length > 0), V = i(() => _e(ge(a.value), e.removedIds.value)), H = i(() => be(n.value, e.removedIds.value, j.value)), U = i(() => !A.value.length && !M.value && !!s.value);
|
|
403
|
+
F(() => A.value.length, (e) => {
|
|
404
404
|
if (e === 0) {
|
|
405
405
|
r.value = 0;
|
|
406
406
|
return;
|
|
407
407
|
}
|
|
408
|
-
o.value &&= (
|
|
408
|
+
o.value &&= (he(), !1), r.value > e - 1 && (r.value = e - 1);
|
|
409
409
|
}), F(() => r.value, () => {
|
|
410
|
-
m.value &&
|
|
410
|
+
m.value && se();
|
|
411
411
|
}), x(() => {
|
|
412
|
-
|
|
412
|
+
pe() || e.resolve && W();
|
|
413
413
|
}), b(() => {
|
|
414
|
-
|
|
414
|
+
_?.abort(), _ = null, u.clear(!0);
|
|
415
415
|
});
|
|
416
|
-
async function
|
|
417
|
-
|
|
418
|
-
let t = await
|
|
419
|
-
continueUntilFilled:
|
|
416
|
+
async function W() {
|
|
417
|
+
v = W;
|
|
418
|
+
let t = await de({
|
|
419
|
+
continueUntilFilled: D.value === "dynamic",
|
|
420
420
|
cursor: e.initialCursor ?? null,
|
|
421
421
|
direction: "forward",
|
|
422
422
|
phase: "initializing"
|
|
423
423
|
});
|
|
424
|
-
t && (n.value = t.buckets, r.value = 0,
|
|
424
|
+
t && (n.value = t.buckets, r.value = 0, Z());
|
|
425
425
|
}
|
|
426
|
-
async function
|
|
427
|
-
if (!
|
|
428
|
-
if (!
|
|
429
|
-
if (
|
|
430
|
-
await
|
|
426
|
+
async function ee() {
|
|
427
|
+
if (!(h.value || M.value)) {
|
|
428
|
+
if (!R.value) return B.value ? ue("trailing") : void 0;
|
|
429
|
+
if (D.value === "static" && me("trailing")) return ue("trailing");
|
|
430
|
+
await ce(I.value);
|
|
431
431
|
}
|
|
432
432
|
}
|
|
433
433
|
async function G() {
|
|
434
|
-
if (!(!
|
|
435
|
-
if (
|
|
436
|
-
await
|
|
434
|
+
if (!(h.value || !z.value || M.value)) {
|
|
435
|
+
if (D.value === "static" && me("leading")) return ue("leading");
|
|
436
|
+
await le(L.value);
|
|
437
437
|
}
|
|
438
438
|
}
|
|
439
439
|
async function K() {
|
|
440
|
-
if (
|
|
441
|
-
if (n.value = [], r.value = 0, a.value = [], o.value = !1, s.value = null, c.value =
|
|
442
|
-
|
|
440
|
+
if (U.value) {
|
|
441
|
+
if (n.value = [], r.value = 0, a.value = [], o.value = !1, s.value = null, c.value = E.value ? "initializing" : "idle", l.value = null, f.value = null, p.value = !1, g.clear(), _?.abort(), _ = null, u.clear(!0), pe()) {
|
|
442
|
+
Z();
|
|
443
443
|
return;
|
|
444
444
|
}
|
|
445
|
-
await
|
|
445
|
+
await W();
|
|
446
446
|
}
|
|
447
447
|
}
|
|
448
448
|
async function q() {
|
|
449
|
-
if (
|
|
450
|
-
c.value !== "failed" || !
|
|
449
|
+
if (U.value) return K();
|
|
450
|
+
h.value || c.value !== "failed" || !v || (s.value = null, await v());
|
|
451
451
|
}
|
|
452
452
|
async function J() {
|
|
453
|
-
if (!a.value.length) return p.value = !1,
|
|
454
|
-
n.value = [...n.value, ...a.value], a.value = [], p.value = !1,
|
|
453
|
+
if (!a.value.length) return p.value = !1, Z();
|
|
454
|
+
n.value = [...n.value, ...a.value], a.value = [], p.value = !1, Z();
|
|
455
455
|
}
|
|
456
456
|
function Y(t) {
|
|
457
|
-
let n =
|
|
457
|
+
let n = A.value;
|
|
458
458
|
if (!n.length) return;
|
|
459
|
-
let i =
|
|
459
|
+
let i = Ee(t, 0, n.length - 1);
|
|
460
460
|
i !== r.value && (r.value = i, e.emit("update:activeIndex", i));
|
|
461
461
|
}
|
|
462
462
|
function X(e) {
|
|
463
463
|
m.value = e;
|
|
464
464
|
}
|
|
465
|
-
function ee() {
|
|
466
|
-
v += 1, g?.abort(), g = null, u.clear(!0), h.clear(), s.value = null, l.value = null, f.value = null, a.value.length > 0 && (n.value = [...n.value, ...a.value], a.value = []), p.value = !1, o.value = !1, Q();
|
|
467
|
-
}
|
|
468
465
|
function te() {
|
|
469
|
-
|
|
466
|
+
h.value = !0, u.clear(!0);
|
|
470
467
|
}
|
|
471
|
-
function ne(
|
|
472
|
-
|
|
468
|
+
function ne() {
|
|
469
|
+
h.value = !1;
|
|
470
|
+
}
|
|
471
|
+
function re() {
|
|
472
|
+
y += 1, _?.abort(), _ = null, u.clear(!0), g.clear(), s.value = null, l.value = null, f.value = null, a.value.length > 0 && (n.value = [...n.value, ...a.value], a.value = []), p.value = !1, o.value = !1, Z();
|
|
473
|
+
}
|
|
474
|
+
function ie() {
|
|
475
|
+
return je(A.value, j.value);
|
|
476
|
+
}
|
|
477
|
+
function ae(e = null) {
|
|
478
|
+
if (A.value.length === 0) {
|
|
473
479
|
r.value = 0, n.value.length > 0 && (o.value = !0);
|
|
474
480
|
return;
|
|
475
481
|
}
|
|
476
|
-
r.value =
|
|
482
|
+
r.value = Me(A.value, j.value, e);
|
|
477
483
|
}
|
|
478
|
-
function
|
|
479
|
-
a.value.length > 0 && !
|
|
484
|
+
function oe() {
|
|
485
|
+
a.value.length > 0 && !V.value.length && J();
|
|
480
486
|
}
|
|
481
|
-
async function
|
|
482
|
-
!
|
|
487
|
+
async function se() {
|
|
488
|
+
!A.value.length || Q() || (z.value && r.value < 3 && await G(), R.value && r.value >= A.value.length - 3 && await ee());
|
|
483
489
|
}
|
|
484
|
-
async function
|
|
485
|
-
|
|
486
|
-
await
|
|
490
|
+
async function ce(e) {
|
|
491
|
+
v = async () => {
|
|
492
|
+
await ce(e);
|
|
487
493
|
};
|
|
488
|
-
let t = await
|
|
489
|
-
continueUntilFilled:
|
|
494
|
+
let t = await de({
|
|
495
|
+
continueUntilFilled: D.value === "dynamic",
|
|
490
496
|
cursor: e,
|
|
491
497
|
direction: "forward",
|
|
492
498
|
phase: "loading"
|
|
493
499
|
});
|
|
494
500
|
if (t) {
|
|
495
|
-
if (t.canceled) return n.value = [...n.value, ...t.buckets], a.value = [], p.value = !1,
|
|
496
|
-
if (a.value = t.buckets, !
|
|
501
|
+
if (t.canceled) return n.value = [...n.value, ...t.buckets], a.value = [], p.value = !1, Z();
|
|
502
|
+
if (a.value = t.buckets, !V.value.length) return n.value = [...n.value, ...a.value], a.value = [], p.value = !1, Z();
|
|
497
503
|
p.value = !0;
|
|
498
504
|
}
|
|
499
505
|
}
|
|
500
|
-
async function
|
|
501
|
-
|
|
502
|
-
await
|
|
506
|
+
async function le(e) {
|
|
507
|
+
v = async () => {
|
|
508
|
+
await le(e);
|
|
503
509
|
};
|
|
504
|
-
let t = await
|
|
505
|
-
continueUntilFilled:
|
|
510
|
+
let t = await de({
|
|
511
|
+
continueUntilFilled: D.value === "dynamic",
|
|
506
512
|
cursor: e,
|
|
507
513
|
direction: "backward",
|
|
508
514
|
phase: "loading"
|
|
509
515
|
});
|
|
510
516
|
if (!t) return;
|
|
511
|
-
let r =
|
|
512
|
-
n.value = [...t.buckets, ...n.value],
|
|
517
|
+
let r = ie();
|
|
518
|
+
n.value = [...t.buckets, ...n.value], ae(r), Z();
|
|
513
519
|
}
|
|
514
|
-
async function
|
|
515
|
-
if (
|
|
516
|
-
await
|
|
520
|
+
async function ue(t) {
|
|
521
|
+
if (v = async () => {
|
|
522
|
+
await ue(t);
|
|
517
523
|
}, !e.resolve) return;
|
|
518
|
-
let r = t === "leading" ?
|
|
524
|
+
let r = t === "leading" ? N.value : P.value;
|
|
519
525
|
if (!r) return;
|
|
520
|
-
let i =
|
|
521
|
-
if (
|
|
522
|
-
|
|
523
|
-
let a = ++
|
|
524
|
-
|
|
526
|
+
let i = Te(r.cursor);
|
|
527
|
+
if (g.has(i)) return;
|
|
528
|
+
g.add(i), s.value = null, c.value = "refreshing", l.value = null, f.value = null;
|
|
529
|
+
let a = ++y, o = typeof AbortController > "u" ? null : new AbortController();
|
|
530
|
+
_ = o;
|
|
525
531
|
try {
|
|
526
532
|
let t = await e.resolve({
|
|
527
533
|
cursor: r.cursor,
|
|
528
|
-
pageSize:
|
|
534
|
+
pageSize: O.value,
|
|
529
535
|
signal: o?.signal
|
|
530
536
|
});
|
|
531
|
-
if (a !==
|
|
532
|
-
let i =
|
|
537
|
+
if (a !== y) return Z();
|
|
538
|
+
let i = fe({
|
|
533
539
|
cursor: r.cursor,
|
|
534
540
|
nextCursor: t.nextPage,
|
|
535
541
|
nextItems: t.items,
|
|
536
542
|
previousCursor: t.previousPage ?? null,
|
|
537
543
|
previousItems: r.items
|
|
538
|
-
}), s =
|
|
539
|
-
n.value =
|
|
544
|
+
}), s = ie();
|
|
545
|
+
n.value = xe(n.value, r.cursor, i), ae(s), Z();
|
|
540
546
|
} catch (e) {
|
|
541
|
-
if (
|
|
542
|
-
|
|
547
|
+
if (De(e) || a !== y) {
|
|
548
|
+
Z();
|
|
543
549
|
return;
|
|
544
550
|
}
|
|
545
551
|
s.value = e instanceof Error ? e.message : "The viewer could not load items.", c.value = "failed", l.value = null, f.value = null;
|
|
546
552
|
} finally {
|
|
547
|
-
|
|
553
|
+
_ === o && (_ = null), g.delete(i);
|
|
548
554
|
}
|
|
549
555
|
}
|
|
550
|
-
async function
|
|
556
|
+
async function de(t) {
|
|
551
557
|
if (!e.resolve) return null;
|
|
552
|
-
let n = ++
|
|
558
|
+
let n = ++y, r = /* @__PURE__ */ new Set(), i = [], a = t.cursor, o = 0;
|
|
553
559
|
for (s.value = null, c.value = t.phase, l.value = null, f.value = null;;) {
|
|
554
|
-
if (n !==
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
r.
|
|
560
|
+
if (n !== y) return ke(i, t.direction, e.removedIds.value, !0);
|
|
561
|
+
if (i.length > 0 && h.value) return ke(i, t.direction, e.removedIds.value, !1);
|
|
562
|
+
let d = Te(a);
|
|
563
|
+
if (r.has(d) || g.has(d)) break;
|
|
564
|
+
r.add(d), g.add(d);
|
|
558
565
|
let p = typeof AbortController > "u" ? null : new AbortController();
|
|
559
|
-
|
|
566
|
+
_ = p;
|
|
560
567
|
try {
|
|
561
568
|
let r = await e.resolve({
|
|
562
569
|
cursor: a,
|
|
563
|
-
pageSize:
|
|
570
|
+
pageSize: O.value,
|
|
564
571
|
signal: p?.signal
|
|
565
572
|
});
|
|
566
|
-
if (n !==
|
|
567
|
-
let s =
|
|
573
|
+
if (n !== y) return ke(i, t.direction, e.removedIds.value, !0);
|
|
574
|
+
let s = fe({
|
|
568
575
|
cursor: a,
|
|
569
576
|
nextCursor: r.nextPage,
|
|
570
577
|
nextItems: r.items,
|
|
@@ -572,108 +579,112 @@ function ze(e) {
|
|
|
572
579
|
previousItems: []
|
|
573
580
|
});
|
|
574
581
|
i.push(s);
|
|
575
|
-
let d = i.reduce((t, n) => t +
|
|
576
|
-
if (!t.continueUntilFilled || d >=
|
|
582
|
+
let d = i.reduce((t, n) => t + ye(n, e.removedIds.value), 0), m = t.direction === "forward" ? s.nextCursor : s.previousCursor;
|
|
583
|
+
if (!t.continueUntilFilled || d >= O.value || !m) return {
|
|
577
584
|
canceled: !1,
|
|
578
585
|
buckets: t.direction === "backward" ? [...i].reverse() : i,
|
|
579
586
|
visibleCount: d
|
|
580
587
|
};
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
588
|
+
if (h.value) return ke(i, t.direction, e.removedIds.value, !1);
|
|
589
|
+
c.value = "filling", l.value = d, f.value = O.value, o += 1;
|
|
590
|
+
let g = Le(o, C.value, w.value);
|
|
591
|
+
if (await u.wait(g), n !== y) return ke(i, t.direction, e.removedIds.value, !0);
|
|
584
592
|
a = m;
|
|
585
593
|
} catch (r) {
|
|
586
|
-
return
|
|
594
|
+
return De(r) || n !== y ? ke(i, t.direction, e.removedIds.value, !0) : (s.value = r instanceof Error ? r.message : "The viewer could not load items.", c.value = "failed", l.value = null, f.value = null, null);
|
|
587
595
|
} finally {
|
|
588
|
-
|
|
596
|
+
_ === p && (_ = null), g.delete(d);
|
|
589
597
|
}
|
|
590
598
|
}
|
|
591
|
-
return
|
|
599
|
+
return ke(i, t.direction, e.removedIds.value, !1);
|
|
592
600
|
}
|
|
593
|
-
function
|
|
594
|
-
let t =
|
|
601
|
+
function fe(e) {
|
|
602
|
+
let t = Oe({
|
|
595
603
|
cursor: e.cursor,
|
|
596
604
|
nextCursor: e.nextCursor,
|
|
597
605
|
nextItems: e.nextItems,
|
|
598
606
|
previousCursor: e.previousCursor,
|
|
599
607
|
previousItems: e.previousItems,
|
|
600
|
-
sequence:
|
|
608
|
+
sequence: S
|
|
601
609
|
});
|
|
602
|
-
return
|
|
610
|
+
return S = t.nextSequence, t.bucket;
|
|
603
611
|
}
|
|
604
|
-
function
|
|
612
|
+
function Z() {
|
|
605
613
|
c.value = "idle", l.value = null, f.value = null, u.clear();
|
|
606
614
|
}
|
|
607
|
-
function
|
|
615
|
+
function pe() {
|
|
608
616
|
if (!e.initialState || !e.initialState.items.length) return !1;
|
|
609
|
-
let t =
|
|
617
|
+
let t = Ae({
|
|
610
618
|
initialState: e.initialState,
|
|
611
619
|
removedIds: e.removedIds.value,
|
|
612
|
-
sequence:
|
|
620
|
+
sequence: S
|
|
613
621
|
});
|
|
614
|
-
return n.value = t.buckets, r.value = t.activeIndex,
|
|
622
|
+
return n.value = t.buckets, r.value = t.activeIndex, S = t.nextSequence, o.value = !1, s.value = null, a.value = [], p.value = !1, !0;
|
|
615
623
|
}
|
|
616
|
-
function
|
|
624
|
+
function Q() {
|
|
617
625
|
return c.value === "initializing";
|
|
618
626
|
}
|
|
619
|
-
function
|
|
620
|
-
return
|
|
627
|
+
function me(t) {
|
|
628
|
+
return Ne(t === "leading" ? N.value : P.value, e.removedIds.value, O.value);
|
|
621
629
|
}
|
|
622
|
-
function
|
|
623
|
-
let t = n.value.findIndex((t) =>
|
|
630
|
+
function he() {
|
|
631
|
+
let t = n.value.findIndex((t) => ye(t, e.removedIds.value) > 0);
|
|
624
632
|
if (t < 0) return;
|
|
625
633
|
let r = t;
|
|
626
|
-
for (let i = n.value.length - 1; i >= t; --i) if (
|
|
634
|
+
for (let i = n.value.length - 1; i >= t; --i) if (ye(n.value[i], e.removedIds.value) > 0) {
|
|
627
635
|
r = i;
|
|
628
636
|
break;
|
|
629
637
|
}
|
|
630
638
|
n.value = n.value.slice(t, r + 1);
|
|
631
639
|
}
|
|
632
640
|
return {
|
|
633
|
-
activeIndex:
|
|
634
|
-
canRetryInitialLoad:
|
|
635
|
-
cancel:
|
|
636
|
-
canRefreshTrailingBoundary:
|
|
641
|
+
activeIndex: j,
|
|
642
|
+
canRetryInitialLoad: U,
|
|
643
|
+
cancel: re,
|
|
644
|
+
canRefreshTrailingBoundary: B,
|
|
637
645
|
commitPendingAppend: J,
|
|
638
|
-
currentCursor:
|
|
646
|
+
currentCursor: H,
|
|
639
647
|
errorMessage: s,
|
|
640
648
|
fillCollectedCount: l,
|
|
641
649
|
fillDelayRemainingMs: d,
|
|
642
650
|
fillTargetCount: f,
|
|
643
|
-
hasNextPage:
|
|
644
|
-
hasPreviousPage:
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
651
|
+
hasNextPage: R,
|
|
652
|
+
hasPreviousPage: z,
|
|
653
|
+
isPageLoadingLocked: h,
|
|
654
|
+
items: A,
|
|
655
|
+
lockPageLoading: te,
|
|
656
|
+
loading: M,
|
|
657
|
+
mode: D,
|
|
658
|
+
nextCursor: I,
|
|
659
|
+
pendingAppendItems: V,
|
|
650
660
|
phase: c,
|
|
651
|
-
prefetchNextPage:
|
|
661
|
+
prefetchNextPage: ee,
|
|
652
662
|
prefetchPreviousPage: G,
|
|
653
|
-
previousCursor:
|
|
663
|
+
previousCursor: L,
|
|
654
664
|
retryInitialLoad: K,
|
|
655
665
|
retry: q,
|
|
656
666
|
setActiveIndex: Y,
|
|
657
667
|
setAutoPrefetchEnabled: X,
|
|
658
|
-
syncActiveIndexAfterVisibilityChange:
|
|
659
|
-
|
|
660
|
-
|
|
668
|
+
syncActiveIndexAfterVisibilityChange: ae,
|
|
669
|
+
unlockPageLoading: ne,
|
|
670
|
+
getActiveOccurrenceKey: ie,
|
|
671
|
+
maybeCommitPendingAppendWhenFilteredOut: oe
|
|
661
672
|
};
|
|
662
673
|
}
|
|
663
|
-
function Be(e, t) {
|
|
664
|
-
return e.find((e) => ve(e, t) > 0) ?? e[0] ?? null;
|
|
665
|
-
}
|
|
666
674
|
function Ve(e, t) {
|
|
675
|
+
return e.find((e) => ye(e, t) > 0) ?? e[0] ?? null;
|
|
676
|
+
}
|
|
677
|
+
function He(e, t) {
|
|
667
678
|
for (let n = e.length - 1; n >= 0; --n) {
|
|
668
679
|
let r = e[n];
|
|
669
|
-
if (
|
|
680
|
+
if (ye(r, t) > 0) return r;
|
|
670
681
|
}
|
|
671
682
|
return e[e.length - 1] ?? null;
|
|
672
683
|
}
|
|
673
684
|
//#endregion
|
|
674
685
|
//#region src/components/viewer-core/useDataSource.ts
|
|
675
|
-
function
|
|
676
|
-
let { clearRemoved: n, getRemovedIds: r, remove: a, removedIds: o, restore: s, undo: c } =
|
|
686
|
+
function Ue(e, t) {
|
|
687
|
+
let { clearRemoved: n, getRemovedIds: r, remove: a, removedIds: o, restore: s, undo: c } = fe(), l = Be({
|
|
677
688
|
emit: t,
|
|
678
689
|
fillDelayMs: e.fillDelayMs,
|
|
679
690
|
fillDelayStepMs: e.fillDelayStepMs,
|
|
@@ -734,7 +745,9 @@ function He(e, t) {
|
|
|
734
745
|
getRemovedIds: r,
|
|
735
746
|
hasNextPage: p,
|
|
736
747
|
hasPreviousPage: m,
|
|
748
|
+
isPageLoadingLocked: l.isPageLoadingLocked,
|
|
737
749
|
items: u,
|
|
750
|
+
lockPageLoading: l.lockPageLoading,
|
|
738
751
|
loading: f,
|
|
739
752
|
loadNext: T,
|
|
740
753
|
loadPrevious: E,
|
|
@@ -753,14 +766,15 @@ function He(e, t) {
|
|
|
753
766
|
retryInitialLoad: l.retryInitialLoad,
|
|
754
767
|
setActiveIndex: v,
|
|
755
768
|
setAutoPrefetchEnabled: l.setAutoPrefetchEnabled,
|
|
756
|
-
undo: x
|
|
769
|
+
undo: x,
|
|
770
|
+
unlockPageLoading: l.unlockPageLoading
|
|
757
771
|
};
|
|
758
772
|
}
|
|
759
773
|
//#endregion
|
|
760
774
|
//#region src/components/viewer-core/useController.ts
|
|
761
|
-
var
|
|
762
|
-
function
|
|
763
|
-
let n =
|
|
775
|
+
var We = 1024;
|
|
776
|
+
function Ge(e, t) {
|
|
777
|
+
let n = Ue(e, t), r = T(0), a = T("list"), o = C({
|
|
764
778
|
activeIndex: 0,
|
|
765
779
|
currentCursor: null,
|
|
766
780
|
errorMessage: null,
|
|
@@ -773,12 +787,13 @@ function We(e, t) {
|
|
|
773
787
|
loadState: "loaded",
|
|
774
788
|
mode: "dynamic",
|
|
775
789
|
nextCursor: null,
|
|
790
|
+
pageLoadingLocked: !1,
|
|
776
791
|
phase: "idle",
|
|
777
792
|
previousCursor: null,
|
|
778
793
|
removedCount: 0,
|
|
779
794
|
removedIds: [],
|
|
780
795
|
surfaceMode: "list"
|
|
781
|
-
}), s = i(() => r.value >=
|
|
796
|
+
}), s = i(() => r.value >= We), c = i(() => s.value ? a.value : "fullscreen"), l = i(() => s.value && c.value === "fullscreen");
|
|
782
797
|
F(s, (e) => {
|
|
783
798
|
e && m();
|
|
784
799
|
}), F(() => e.surfaceMode, () => {
|
|
@@ -790,7 +805,7 @@ function We(e, t) {
|
|
|
790
805
|
}), F(c, (e) => {
|
|
791
806
|
n.setAutoPrefetchEnabled(e === "fullscreen");
|
|
792
807
|
}, { immediate: !0 }), I(() => {
|
|
793
|
-
o.activeIndex = n.activeIndex.value, o.currentCursor = n.currentCursor.value, o.errorMessage = n.errorMessage.value, o.fillCollectedCount = n.fillCollectedCount.value, o.fillDelayRemainingMs = n.fillDelayRemainingMs.value, o.fillTargetCount = n.fillTargetCount.value, o.hasNextPage = n.hasNextPage.value, o.hasPreviousPage = n.hasPreviousPage.value, o.itemCount = n.items.value.length, o.loadState = n.loading.value ? "loading" : n.errorMessage.value ? "failed" : "loaded", o.mode = n.mode.value, o.nextCursor = n.nextCursor.value, o.phase = n.phase.value, o.previousCursor = n.previousCursor.value, o.removedCount = n.removedCount.value, o.removedIds = n.getRemovedIds(), o.surfaceMode = c.value;
|
|
808
|
+
o.activeIndex = n.activeIndex.value, o.currentCursor = n.currentCursor.value, o.errorMessage = n.errorMessage.value, o.fillCollectedCount = n.fillCollectedCount.value, o.fillDelayRemainingMs = n.fillDelayRemainingMs.value, o.fillTargetCount = n.fillTargetCount.value, o.hasNextPage = n.hasNextPage.value, o.hasPreviousPage = n.hasPreviousPage.value, o.itemCount = n.items.value.length, o.loadState = n.loading.value ? "loading" : n.errorMessage.value ? "failed" : "loaded", o.mode = n.mode.value, o.nextCursor = n.nextCursor.value, o.pageLoadingLocked = n.isPageLoadingLocked.value, o.phase = n.phase.value, o.previousCursor = n.previousCursor.value, o.removedCount = n.removedCount.value, o.removedIds = n.getRemovedIds(), o.surfaceMode = c.value;
|
|
794
809
|
}), x(() => {
|
|
795
810
|
p(), m(), window.addEventListener("keydown", f), window.addEventListener("resize", p);
|
|
796
811
|
}), b(() => {
|
|
@@ -803,7 +818,7 @@ function We(e, t) {
|
|
|
803
818
|
!s.value || a.value === "list" || (a.value = "list", t("update:surfaceMode", "list"));
|
|
804
819
|
}
|
|
805
820
|
function f(e) {
|
|
806
|
-
e.defaultPrevented || e.key !== "Escape" || !s.value || c.value !== "fullscreen" ||
|
|
821
|
+
e.defaultPrevented || e.key !== "Escape" || !s.value || c.value !== "fullscreen" || ue(e.target) || (e.preventDefault(), d());
|
|
807
822
|
}
|
|
808
823
|
function p() {
|
|
809
824
|
r.value = window.innerWidth || 0;
|
|
@@ -815,6 +830,7 @@ function We(e, t) {
|
|
|
815
830
|
...n,
|
|
816
831
|
cancel: n.cancel,
|
|
817
832
|
isDesktop: s,
|
|
833
|
+
lockPageLoading: n.lockPageLoading,
|
|
818
834
|
loadNext: n.loadNext,
|
|
819
835
|
loadPrevious: n.loadPrevious,
|
|
820
836
|
openFullscreen: u,
|
|
@@ -822,19 +838,20 @@ function We(e, t) {
|
|
|
822
838
|
retry: n.retry,
|
|
823
839
|
showBackToList: l,
|
|
824
840
|
status: w(o),
|
|
825
|
-
surfaceMode: c
|
|
841
|
+
surfaceMode: c,
|
|
842
|
+
unlockPageLoading: n.unlockPageLoading
|
|
826
843
|
};
|
|
827
844
|
}
|
|
828
845
|
//#endregion
|
|
829
846
|
//#region src/components/FullscreenMediaBar.vue?vue&type=script&setup=true&lang.ts
|
|
830
|
-
var
|
|
847
|
+
var Ke = {
|
|
831
848
|
"data-testid": "vibe-media-bar",
|
|
832
849
|
class: "absolute inset-x-0 bottom-0 z-[5] bg-[linear-gradient(180deg,transparent,rgba(0,0,0,0.42)_24%,rgba(0,0,0,0.78))] px-[clamp(1rem,2.6vw,2.25rem)] pt-4 pb-[1.15rem]"
|
|
833
|
-
},
|
|
850
|
+
}, qe = { class: "grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3 border-t border-white/12 bg-black/70 px-4 py-3 backdrop-blur-[18px]" }, Je = { class: "text-[0.76rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74" }, Ye = { class: "relative h-4 w-full" }, Xe = [
|
|
834
851
|
"max",
|
|
835
852
|
"value",
|
|
836
853
|
"disabled"
|
|
837
|
-
],
|
|
854
|
+
], Ze = { class: "text-[0.76rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74" }, Qe = /* @__PURE__ */ d({
|
|
838
855
|
__name: "FullscreenMediaBar",
|
|
839
856
|
props: {
|
|
840
857
|
currentTime: {},
|
|
@@ -846,9 +863,9 @@ var Ge = {
|
|
|
846
863
|
emits: ["seek-input"],
|
|
847
864
|
setup(e, { emit: t }) {
|
|
848
865
|
let n = e, r = t;
|
|
849
|
-
return (e, t) => (S(), s("div",
|
|
850
|
-
c("span",
|
|
851
|
-
c("div",
|
|
866
|
+
return (e, t) => (S(), s("div", Ke, [c("div", qe, [
|
|
867
|
+
c("span", Je, k(n.currentTimeLabel), 1),
|
|
868
|
+
c("div", Ye, [
|
|
852
869
|
t[1] ||= c("div", { class: "absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-white/12" }, null, -1),
|
|
853
870
|
c("div", {
|
|
854
871
|
class: "absolute left-0 top-1/2 h-px -translate-y-1/2 bg-[#f7f1ea]",
|
|
@@ -865,25 +882,25 @@ var Ge = {
|
|
|
865
882
|
disabled: n.duration <= 0,
|
|
866
883
|
class: "vibe-media-slider absolute inset-0 z-10 h-4 w-full cursor-pointer bg-transparent disabled:cursor-default disabled:opacity-50",
|
|
867
884
|
onInput: t[0] ||= (e) => r("seek-input", e)
|
|
868
|
-
}, null, 40,
|
|
885
|
+
}, null, 40, Xe)
|
|
869
886
|
]),
|
|
870
|
-
c("span",
|
|
887
|
+
c("span", Ze, k(n.durationLabel), 1)
|
|
871
888
|
])]));
|
|
872
889
|
}
|
|
873
|
-
}),
|
|
890
|
+
}), $e = { class: "pointer-events-none absolute inset-0 z-[3] flex flex-col justify-between p-[clamp(1.25rem,2.6vw,2.25rem)]" }, et = { class: "grid gap-4" }, tt = { class: "flex min-h-11 items-center justify-between gap-4" }, nt = { class: "min-w-0 flex flex-1 items-center gap-3" }, rt = {
|
|
874
891
|
key: 1,
|
|
875
892
|
"data-testid": "vibe-title",
|
|
876
893
|
class: "m-0 truncate text-left text-[0.82rem] leading-none tracking-[-0.04em] min-[721px]:text-[1.2rem]"
|
|
877
|
-
},
|
|
894
|
+
}, it = { class: "pointer-events-auto flex shrink-0 items-center gap-2" }, at = {
|
|
878
895
|
"data-testid": "vibe-pagination",
|
|
879
896
|
class: "inline-flex shrink-0 items-center gap-2 whitespace-nowrap border border-white/14 bg-black/40 px-3 py-2 text-[0.63rem] font-bold uppercase tracking-[0.12em] text-[#f7f1ea]/72 backdrop-blur-[18px] min-[721px]:gap-3 min-[721px]:px-4 min-[721px]:py-3 min-[721px]:text-[0.74rem] min-[721px]:tracking-[0.2em]"
|
|
880
|
-
},
|
|
897
|
+
}, ot = { class: "whitespace-nowrap" }, st = {
|
|
881
898
|
key: 0,
|
|
882
899
|
class: "whitespace-nowrap border-l border-white/12 pl-2 text-[#f7f1ea]/56 min-[721px]:pl-3"
|
|
883
|
-
},
|
|
900
|
+
}, ct = {
|
|
884
901
|
key: 0,
|
|
885
902
|
class: "grid gap-2 max-[720px]:justify-items-start"
|
|
886
|
-
},
|
|
903
|
+
}, lt = /* @__PURE__ */ d({
|
|
887
904
|
__name: "FullscreenHeader",
|
|
888
905
|
props: {
|
|
889
906
|
currentIndex: {},
|
|
@@ -896,49 +913,49 @@ var Ge = {
|
|
|
896
913
|
emits: ["back-to-list"],
|
|
897
914
|
setup(e, { emit: t }) {
|
|
898
915
|
let n = e, r = t;
|
|
899
|
-
return (e, t) => (S(), s("div",
|
|
916
|
+
return (e, t) => (S(), s("div", $e, [c("div", et, [c("div", tt, [c("div", nt, [n.showBackToList ? (S(), s("button", {
|
|
900
917
|
key: 0,
|
|
901
918
|
type: "button",
|
|
902
919
|
"data-testid": "vibe-back-to-list",
|
|
903
920
|
class: "pointer-events-auto inline-flex h-11 w-11 shrink-0 items-center justify-center border border-white/14 bg-black/40 text-[#f7f1ea]/78 backdrop-blur-[18px] transition hover:border-white/28 hover:bg-black/55",
|
|
904
921
|
"aria-label": "Back to list",
|
|
905
922
|
onClick: t[0] ||= (e) => r("back-to-list")
|
|
906
|
-
}, [u(j(
|
|
923
|
+
}, [u(j(J), {
|
|
907
924
|
class: "h-4 w-4 stroke-[2.2]",
|
|
908
925
|
"aria-hidden": "true"
|
|
909
|
-
})])) : o("", !0), n.title ? (S(), s("h2",
|
|
926
|
+
})])) : o("", !0), n.title ? (S(), s("h2", rt, k(n.title), 1)) : o("", !0)]), c("div", it, [c("span", at, [c("span", ot, k(n.currentIndex + 1) + " / " + k(n.total), 1), n.paginationDetail ? (S(), s("span", st, k(n.paginationDetail), 1)) : o("", !0)]), D(e.$slots, "actions")])])]), n.showEndBadge ? (S(), s("div", ct, [...t[1] ||= [c("span", { class: "inline-flex items-center border border-amber-300/35 bg-black/40 px-4 py-3 text-[0.74rem] font-bold uppercase tracking-[0.2em] text-amber-200 backdrop-blur-[18px]" }, " End reached ", -1)]])) : o("", !0)]));
|
|
910
927
|
}
|
|
911
|
-
}),
|
|
928
|
+
}), ut = {
|
|
912
929
|
image: ne,
|
|
913
|
-
video:
|
|
914
|
-
audio:
|
|
930
|
+
video: X,
|
|
931
|
+
audio: Y,
|
|
915
932
|
other: te
|
|
916
|
-
},
|
|
933
|
+
}, dt = {
|
|
917
934
|
image: "Image",
|
|
918
935
|
video: "Video",
|
|
919
936
|
audio: "Audio",
|
|
920
937
|
other: "File"
|
|
921
938
|
};
|
|
922
|
-
function dt(e) {
|
|
923
|
-
return lt[e];
|
|
924
|
-
}
|
|
925
939
|
function ft(e) {
|
|
926
940
|
return ut[e];
|
|
927
941
|
}
|
|
942
|
+
function pt(e) {
|
|
943
|
+
return dt[e];
|
|
944
|
+
}
|
|
928
945
|
//#endregion
|
|
929
946
|
//#region src/components/viewer-core/useFullscreenSurfaceMedia.ts
|
|
930
|
-
var
|
|
931
|
-
function
|
|
947
|
+
var mt = 2;
|
|
948
|
+
function ht(e) {
|
|
932
949
|
function t(e, t) {
|
|
933
950
|
let n = t.title?.trim();
|
|
934
|
-
return n ? `${e} ${n}` : `${e} ${
|
|
951
|
+
return n ? `${e} ${n}` : `${e} ${pt(t.type).toLowerCase()}`;
|
|
935
952
|
}
|
|
936
953
|
function n(e) {
|
|
937
|
-
return
|
|
954
|
+
return Q(e);
|
|
938
955
|
}
|
|
939
956
|
function r(t) {
|
|
940
957
|
let n = e.resolvedActiveIndex.value;
|
|
941
|
-
return !!e.active.value && t >= n && t <= n +
|
|
958
|
+
return !!e.active.value && t >= n && t <= n + mt;
|
|
942
959
|
}
|
|
943
960
|
function i(t, i) {
|
|
944
961
|
let a = n(i);
|
|
@@ -973,11 +990,11 @@ function mt(e) {
|
|
|
973
990
|
}
|
|
974
991
|
//#endregion
|
|
975
992
|
//#region src/components/viewer-core/slotContent.ts
|
|
976
|
-
function
|
|
993
|
+
function gt(e) {
|
|
977
994
|
if (!Array.isArray(e)) return !1;
|
|
978
995
|
for (let t of e) {
|
|
979
996
|
if (Array.isArray(t)) {
|
|
980
|
-
if (
|
|
997
|
+
if (gt(t)) return !0;
|
|
981
998
|
continue;
|
|
982
999
|
}
|
|
983
1000
|
if (!m(t)) {
|
|
@@ -988,20 +1005,20 @@ function ht(e) {
|
|
|
988
1005
|
if (t != null && t !== !1) return !0;
|
|
989
1006
|
continue;
|
|
990
1007
|
}
|
|
991
|
-
if (!
|
|
1008
|
+
if (!_t(t)) return !0;
|
|
992
1009
|
}
|
|
993
1010
|
return !1;
|
|
994
1011
|
}
|
|
995
|
-
function
|
|
996
|
-
return r.type === e ? !0 : r.type === n ? typeof r.children == "string" ? r.children.trim().length === 0 : !0 : r.type === t ? !
|
|
1012
|
+
function _t(r) {
|
|
1013
|
+
return r.type === e ? !0 : r.type === n ? typeof r.children == "string" ? r.children.trim().length === 0 : !0 : r.type === t ? !gt(r.children) : !1;
|
|
997
1014
|
}
|
|
998
1015
|
//#endregion
|
|
999
1016
|
//#region src/components/viewer-core/useSurfaceEmptyState.ts
|
|
1000
|
-
var
|
|
1001
|
-
function
|
|
1017
|
+
var vt = "no items available";
|
|
1018
|
+
function yt(e) {
|
|
1002
1019
|
let t = i(() => e.loading.value || e.itemCount.value > 0 || e.emptyStateMode.value === "hidden" ? null : {
|
|
1003
1020
|
loading: !!e.loading.value,
|
|
1004
|
-
message:
|
|
1021
|
+
message: vt,
|
|
1005
1022
|
mode: e.emptyStateMode.value === "badge" ? "badge" : "inline",
|
|
1006
1023
|
surface: e.surface,
|
|
1007
1024
|
total: e.itemCount.value
|
|
@@ -1009,23 +1026,23 @@ function vt(e) {
|
|
|
1009
1026
|
return {
|
|
1010
1027
|
emptyStateProps: t,
|
|
1011
1028
|
showBadgeEmptyState: i(() => t.value?.mode === "badge"),
|
|
1012
|
-
showCustomEmptyState: i(() =>
|
|
1029
|
+
showCustomEmptyState: i(() => gt(n.value)),
|
|
1013
1030
|
showInlineEmptyState: i(() => t.value?.mode === "inline")
|
|
1014
1031
|
};
|
|
1015
1032
|
}
|
|
1016
1033
|
//#endregion
|
|
1017
1034
|
//#region src/components/viewer-core/format.ts
|
|
1018
|
-
function
|
|
1035
|
+
function bt(e) {
|
|
1019
1036
|
if (!Number.isFinite(e) || e <= 0) return "0:00";
|
|
1020
1037
|
let t = Math.floor(e), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), i = t % 60;
|
|
1021
1038
|
return n > 0 ? `${n}:${String(r).padStart(2, "0")}:${String(i).padStart(2, "0")}` : `${r}:${String(i).padStart(2, "0")}`;
|
|
1022
1039
|
}
|
|
1023
1040
|
//#endregion
|
|
1024
1041
|
//#region src/components/viewer-core/surfaceStatus.ts
|
|
1025
|
-
function
|
|
1042
|
+
function xt(e) {
|
|
1026
1043
|
return e.phase ? e.phase : e.loading ? e.itemCount > 0 ? "loading" : "initializing" : "idle";
|
|
1027
1044
|
}
|
|
1028
|
-
function
|
|
1045
|
+
function St(e) {
|
|
1029
1046
|
return e.phase === "failed" ? {
|
|
1030
1047
|
kind: "failed",
|
|
1031
1048
|
message: e.errorMessage ?? (e.hasItems ? "The viewer could not load more items." : "The viewer could not load items.")
|
|
@@ -1048,7 +1065,7 @@ function xt(e) {
|
|
|
1048
1065
|
}
|
|
1049
1066
|
//#endregion
|
|
1050
1067
|
//#region src/components/viewer-core/useActivation.ts
|
|
1051
|
-
function
|
|
1068
|
+
function Ct(e) {
|
|
1052
1069
|
let t = !1;
|
|
1053
1070
|
F(e.enabled, async (t) => {
|
|
1054
1071
|
if (n(t), t) {
|
|
@@ -1071,42 +1088,42 @@ function St(e) {
|
|
|
1071
1088
|
}
|
|
1072
1089
|
//#endregion
|
|
1073
1090
|
//#region src/components/viewer-core/assetState.ts
|
|
1074
|
-
var
|
|
1091
|
+
var wt = {
|
|
1075
1092
|
currentTime: 0,
|
|
1076
1093
|
duration: 0,
|
|
1077
1094
|
errorKind: null,
|
|
1078
1095
|
paused: !0,
|
|
1079
1096
|
ready: !1
|
|
1080
1097
|
};
|
|
1081
|
-
function
|
|
1082
|
-
return { ...
|
|
1098
|
+
function Tt() {
|
|
1099
|
+
return { ...wt };
|
|
1083
1100
|
}
|
|
1084
|
-
function
|
|
1101
|
+
function Et(e) {
|
|
1085
1102
|
return e.complete && !!(e.currentSrc || e.getAttribute("src"));
|
|
1086
1103
|
}
|
|
1087
|
-
function
|
|
1088
|
-
e.currentTime = Number.isFinite(t.currentTime) ? t.currentTime : 0, e.duration = Number.isFinite(t.duration) ? t.duration : 0, e.paused = t.paused, n && n !== "error" && (e.errorKind = null), e.ready =
|
|
1104
|
+
function Dt(e, t, n) {
|
|
1105
|
+
e.currentTime = Number.isFinite(t.currentTime) ? t.currentTime : 0, e.duration = Number.isFinite(t.duration) ? t.duration : 0, e.paused = t.paused, n && n !== "error" && (e.errorKind = null), e.ready = Ot(t, n);
|
|
1089
1106
|
}
|
|
1090
|
-
function
|
|
1107
|
+
function Ot(e, t) {
|
|
1091
1108
|
return t === "error" || t === "loadstart" || t === "waiting" || t === "stalled" ? !1 : t === "canplay" || t === "canplaythrough" || t === "playing" ? !0 : e.readyState >= HTMLMediaElement.HAVE_CURRENT_DATA;
|
|
1092
1109
|
}
|
|
1093
1110
|
//#endregion
|
|
1094
1111
|
//#region src/components/viewer-core/loadError.ts
|
|
1095
|
-
var
|
|
1096
|
-
function
|
|
1112
|
+
var kt = /* @__PURE__ */ new Map();
|
|
1113
|
+
function At(e) {
|
|
1097
1114
|
return e === "not-found" ? "404" : "Load error";
|
|
1098
1115
|
}
|
|
1099
|
-
function
|
|
1116
|
+
function jt(e) {
|
|
1100
1117
|
return e === "generic";
|
|
1101
1118
|
}
|
|
1102
|
-
function
|
|
1103
|
-
let t =
|
|
1119
|
+
function Mt(e) {
|
|
1120
|
+
let t = kt.get(e);
|
|
1104
1121
|
if (t) return t;
|
|
1105
|
-
let n =
|
|
1106
|
-
return
|
|
1122
|
+
let n = Nt(e);
|
|
1123
|
+
return kt.set(e, n), n;
|
|
1107
1124
|
}
|
|
1108
|
-
async function
|
|
1109
|
-
if (!
|
|
1125
|
+
async function Nt(e) {
|
|
1126
|
+
if (!Pt(e)) return "generic";
|
|
1110
1127
|
try {
|
|
1111
1128
|
let t = await fetch(e, { method: "HEAD" });
|
|
1112
1129
|
if (!t.ok && t.status === 404) return "not-found";
|
|
@@ -1115,12 +1132,12 @@ async function Mt(e) {
|
|
|
1115
1132
|
}
|
|
1116
1133
|
return "generic";
|
|
1117
1134
|
}
|
|
1118
|
-
function
|
|
1135
|
+
function Pt(e) {
|
|
1119
1136
|
return /^(https?:\/\/|\/)/i.test(e);
|
|
1120
1137
|
}
|
|
1121
1138
|
//#endregion
|
|
1122
1139
|
//#region src/components/viewer-core/mediaPlayback.ts
|
|
1123
|
-
function
|
|
1140
|
+
function Ft(e) {
|
|
1124
1141
|
try {
|
|
1125
1142
|
let t = e.play();
|
|
1126
1143
|
t && typeof t.catch == "function" && t.catch(() => {});
|
|
@@ -1128,12 +1145,12 @@ function Pt(e) {
|
|
|
1128
1145
|
}
|
|
1129
1146
|
//#endregion
|
|
1130
1147
|
//#region src/components/viewer-core/useMedia.ts
|
|
1131
|
-
function
|
|
1132
|
-
let t = T({}), n = T({}), r = T({}), a = T({}), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Set(), l = i(() => e.activeItem.value ?
|
|
1148
|
+
function It(e) {
|
|
1149
|
+
let t = T({}), n = T({}), r = T({}), a = T({}), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Set(), l = i(() => e.activeItem.value ? Q(e.activeItem.value) : null), u = i(() => e.activeMediaItem.value ? Q(e.activeMediaItem.value) : null), d = i(() => {
|
|
1133
1150
|
let t = /* @__PURE__ */ new Map();
|
|
1134
|
-
for (let n of e.items.value) t.set(
|
|
1151
|
+
for (let n of e.items.value) t.set(Q(n), n);
|
|
1135
1152
|
return t;
|
|
1136
|
-
}), f = i(() => u.value ? r.value[u.value] ??
|
|
1153
|
+
}), f = i(() => u.value ? r.value[u.value] ?? wt : wt), p = i(() => u.value ? f.value.duration : 0), m = i(() => p.value <= 0 ? 0 : Lt(f.value.currentTime / p.value * 100, 0, 100)), h = i(() => l.value ? N(l.value) : null);
|
|
1137
1154
|
F(() => l.value, async () => {
|
|
1138
1155
|
await x();
|
|
1139
1156
|
}), F(() => e.itemCount.value, async () => {
|
|
@@ -1154,7 +1171,7 @@ function Ft(e) {
|
|
|
1154
1171
|
s.delete(e);
|
|
1155
1172
|
}
|
|
1156
1173
|
function y(e, r) {
|
|
1157
|
-
r instanceof HTMLImageElement &&
|
|
1174
|
+
r instanceof HTMLImageElement && Et(r) && (t.value[e] = !0, n.value[e] = null, K(e, r.currentSrc || r.src || J(e)));
|
|
1158
1175
|
}
|
|
1159
1176
|
function b() {
|
|
1160
1177
|
B(), a.value = {}, n.value = {}, t.value = {}, r.value = {}, c.clear();
|
|
@@ -1171,14 +1188,14 @@ function Ft(e) {
|
|
|
1171
1188
|
z(n, e);
|
|
1172
1189
|
continue;
|
|
1173
1190
|
}
|
|
1174
|
-
n.muted = !0, n.loop = !1, n.playsInline = !0,
|
|
1191
|
+
n.muted = !0, n.loop = !1, n.playsInline = !0, Ft(n), H(e, n);
|
|
1175
1192
|
}
|
|
1176
1193
|
for (let [e, n] of s.entries()) {
|
|
1177
1194
|
if (e !== t || r.value[e]?.errorKind) {
|
|
1178
1195
|
z(n, e);
|
|
1179
1196
|
continue;
|
|
1180
1197
|
}
|
|
1181
|
-
|
|
1198
|
+
Ft(n), H(e, n);
|
|
1182
1199
|
}
|
|
1183
1200
|
}
|
|
1184
1201
|
function S(e, t) {
|
|
@@ -1187,16 +1204,16 @@ function Ft(e) {
|
|
|
1187
1204
|
let i = r.value[e]?.ready ?? !1;
|
|
1188
1205
|
H(e, n, t.type);
|
|
1189
1206
|
let a = r.value[e]?.ready ?? !1;
|
|
1190
|
-
!i && a &&
|
|
1207
|
+
!i && a && K(e, n.currentSrc || n.src || J(e));
|
|
1191
1208
|
}
|
|
1192
1209
|
}
|
|
1193
1210
|
function C(e, r) {
|
|
1194
|
-
t.value[e] = !0, n.value[e] = null,
|
|
1211
|
+
t.value[e] = !0, n.value[e] = null, K(e, r);
|
|
1195
1212
|
}
|
|
1196
1213
|
async function w(r, i) {
|
|
1197
|
-
let a =
|
|
1214
|
+
let a = q(r) ?? e.activeItem.value;
|
|
1198
1215
|
t.value[r] = !1, n.value[r] = "generic";
|
|
1199
|
-
let o = await
|
|
1216
|
+
let o = await Mt(i);
|
|
1200
1217
|
n.value[r] = o, a && e.onAssetError?.({
|
|
1201
1218
|
item: a,
|
|
1202
1219
|
occurrenceKey: r,
|
|
@@ -1206,7 +1223,7 @@ function Ft(e) {
|
|
|
1206
1223
|
});
|
|
1207
1224
|
}
|
|
1208
1225
|
async function E(t, n) {
|
|
1209
|
-
let r = W(t), i = V(t), a =
|
|
1226
|
+
let r = W(t), i = V(t), a = q(t) ?? e.activeMediaItem.value ?? e.activeItem.value;
|
|
1210
1227
|
if (r) {
|
|
1211
1228
|
r.pause();
|
|
1212
1229
|
try {
|
|
@@ -1214,7 +1231,7 @@ function Ft(e) {
|
|
|
1214
1231
|
} catch {}
|
|
1215
1232
|
}
|
|
1216
1233
|
i.currentTime = 0, i.duration = 0, i.paused = !0, i.ready = !1, i.errorKind = "generic";
|
|
1217
|
-
let o = await
|
|
1234
|
+
let o = await Mt(n);
|
|
1218
1235
|
i.errorKind = o, a && e.onAssetError?.({
|
|
1219
1236
|
item: a,
|
|
1220
1237
|
occurrenceKey: t,
|
|
@@ -1224,17 +1241,17 @@ function Ft(e) {
|
|
|
1224
1241
|
});
|
|
1225
1242
|
}
|
|
1226
1243
|
function D(e, t, n) {
|
|
1227
|
-
e.button !== 0 || Date.now() < n ||
|
|
1244
|
+
e.button !== 0 || Date.now() < n || G(o.get(t) ?? null);
|
|
1228
1245
|
}
|
|
1229
1246
|
function O(e, t, n) {
|
|
1230
|
-
e.button !== 0 || Date.now() < n ||
|
|
1247
|
+
e.button !== 0 || Date.now() < n || G(W(t));
|
|
1231
1248
|
}
|
|
1232
1249
|
function k(e) {
|
|
1233
|
-
let t =
|
|
1250
|
+
let t = ee(), n = u.value;
|
|
1234
1251
|
if (!t || !n || !(e.target instanceof HTMLInputElement)) return;
|
|
1235
1252
|
let r = Number.parseFloat(e.target.value);
|
|
1236
1253
|
if (!Number.isFinite(r)) return;
|
|
1237
|
-
let i =
|
|
1254
|
+
let i = Lt(r, 0, p.value || 0);
|
|
1238
1255
|
U(n, i, t), t.currentTime = i;
|
|
1239
1256
|
}
|
|
1240
1257
|
function A(e) {
|
|
@@ -1251,10 +1268,10 @@ function Ft(e) {
|
|
|
1251
1268
|
}
|
|
1252
1269
|
function P(e) {
|
|
1253
1270
|
let t = N(e);
|
|
1254
|
-
return t ?
|
|
1271
|
+
return t ? At(t) : null;
|
|
1255
1272
|
}
|
|
1256
1273
|
function I(e) {
|
|
1257
|
-
return
|
|
1274
|
+
return jt(N(e));
|
|
1258
1275
|
}
|
|
1259
1276
|
function L(e) {
|
|
1260
1277
|
return `${e}:${a.value[e] ?? 0}`;
|
|
@@ -1281,10 +1298,10 @@ function Ft(e) {
|
|
|
1281
1298
|
for (let [e, t] of s.entries()) z(t, e);
|
|
1282
1299
|
}
|
|
1283
1300
|
function V(e) {
|
|
1284
|
-
return r.value[e] || (r.value[e] =
|
|
1301
|
+
return r.value[e] || (r.value[e] = Tt()), r.value[e];
|
|
1285
1302
|
}
|
|
1286
1303
|
function H(e, t, n) {
|
|
1287
|
-
|
|
1304
|
+
Dt(V(e), t, n);
|
|
1288
1305
|
}
|
|
1289
1306
|
function U(e, t, n) {
|
|
1290
1307
|
let r = V(e);
|
|
@@ -1293,20 +1310,20 @@ function Ft(e) {
|
|
|
1293
1310
|
function W(e) {
|
|
1294
1311
|
return o.get(e) ?? s.get(e) ?? null;
|
|
1295
1312
|
}
|
|
1296
|
-
function
|
|
1313
|
+
function ee() {
|
|
1297
1314
|
return u.value ? W(u.value) : null;
|
|
1298
1315
|
}
|
|
1299
|
-
function
|
|
1316
|
+
function G(e) {
|
|
1300
1317
|
if (e) {
|
|
1301
1318
|
if (e.paused) {
|
|
1302
|
-
|
|
1319
|
+
Ft(e);
|
|
1303
1320
|
return;
|
|
1304
1321
|
}
|
|
1305
1322
|
e.pause();
|
|
1306
1323
|
}
|
|
1307
1324
|
}
|
|
1308
|
-
function
|
|
1309
|
-
let r =
|
|
1325
|
+
function K(t, n) {
|
|
1326
|
+
let r = q(t) ?? e.activeMediaItem.value ?? e.activeItem.value;
|
|
1310
1327
|
if (!r || !n) return;
|
|
1311
1328
|
let i = `${t}|${n}`;
|
|
1312
1329
|
c.has(i) || (c.add(i), e.onAssetLoad?.({
|
|
@@ -1316,11 +1333,11 @@ function Ft(e) {
|
|
|
1316
1333
|
url: n
|
|
1317
1334
|
}));
|
|
1318
1335
|
}
|
|
1319
|
-
function
|
|
1336
|
+
function q(e) {
|
|
1320
1337
|
return d.value.get(e) ?? null;
|
|
1321
1338
|
}
|
|
1322
|
-
function
|
|
1323
|
-
return
|
|
1339
|
+
function J(e) {
|
|
1340
|
+
return q(e)?.url ?? null;
|
|
1324
1341
|
}
|
|
1325
1342
|
return {
|
|
1326
1343
|
activeAssetErrorKind: h,
|
|
@@ -1350,10 +1367,10 @@ function Ft(e) {
|
|
|
1350
1367
|
syncMediaPlayback: x
|
|
1351
1368
|
};
|
|
1352
1369
|
}
|
|
1353
|
-
function
|
|
1370
|
+
function Lt(e, t, n) {
|
|
1354
1371
|
return Math.min(Math.max(e, t), n);
|
|
1355
1372
|
}
|
|
1356
|
-
function
|
|
1373
|
+
function Rt(e, t, n = 2) {
|
|
1357
1374
|
return t <= 0 ? {
|
|
1358
1375
|
start: 0,
|
|
1359
1376
|
end: -1
|
|
@@ -1362,14 +1379,14 @@ function Lt(e, t, n = 2) {
|
|
|
1362
1379
|
end: Math.min(t - 1, e + n)
|
|
1363
1380
|
};
|
|
1364
1381
|
}
|
|
1365
|
-
function
|
|
1366
|
-
let r =
|
|
1382
|
+
function zt(e, t, n = 2) {
|
|
1383
|
+
let r = Rt(t, e.length, n);
|
|
1367
1384
|
return r.end < r.start ? [] : e.slice(r.start, r.end + 1).map((e, t) => ({
|
|
1368
1385
|
item: e,
|
|
1369
1386
|
index: r.start + t
|
|
1370
1387
|
}));
|
|
1371
1388
|
}
|
|
1372
|
-
function
|
|
1389
|
+
function Bt(e, t, n, r, i) {
|
|
1373
1390
|
return {
|
|
1374
1391
|
transform: `translate3d(0, ${(e - t) * n + r}px, 0)`,
|
|
1375
1392
|
transition: i ? "none" : "transform 320ms cubic-bezier(0.22, 1, 0.36, 1)"
|
|
@@ -1377,12 +1394,12 @@ function zt(e, t, n, r, i) {
|
|
|
1377
1394
|
}
|
|
1378
1395
|
//#endregion
|
|
1379
1396
|
//#region src/components/viewer-core/useViewer.ts
|
|
1380
|
-
function
|
|
1381
|
-
let r = i(() => e.items), a = i(() => e.activeIndex ?? 0), o = i(() => e.errorMessage ?? null), s = i(() => e.loading ?? !1), c = i(() => e.hasNextPage ?? !1), l = i(() => e.paginationDetail ?? null), u = i(() =>
|
|
1397
|
+
function Vt(e, t, n = {}) {
|
|
1398
|
+
let r = i(() => e.items), a = i(() => e.activeIndex ?? 0), o = i(() => e.errorMessage ?? null), s = i(() => e.loading ?? !1), c = i(() => e.hasNextPage ?? !1), l = i(() => e.paginationDetail ?? null), u = i(() => xt({
|
|
1382
1399
|
itemCount: r.value.length,
|
|
1383
1400
|
loading: s.value,
|
|
1384
1401
|
phase: e.phase
|
|
1385
|
-
})), d = i(() => !1), f = T(null), p = T(0), m = T(!1), h = T(1), g = n.enabled ?? i(() => !0), _ = null, v = 0, y = 0, b = 0, x = i(() => r.value.length === 0 ? 0 : N(a.value, 0, r.value.length - 1)), S = i(() => r.value[x.value] ?? null), C = i(() => S.value?.type === "audio" || S.value?.type === "video" ? S.value : null), w =
|
|
1402
|
+
})), d = i(() => !1), f = T(null), p = T(0), m = T(!1), h = T(1), g = n.enabled ?? i(() => !0), _ = null, v = 0, y = 0, b = 0, x = i(() => r.value.length === 0 ? 0 : N(a.value, 0, r.value.length - 1)), S = i(() => r.value[x.value] ?? null), C = i(() => S.value?.type === "audio" || S.value?.type === "video" ? S.value : null), w = It({
|
|
1386
1403
|
items: r,
|
|
1387
1404
|
activeItem: S,
|
|
1388
1405
|
activeMediaItem: C,
|
|
@@ -1390,14 +1407,14 @@ function Bt(e, t, n = {}) {
|
|
|
1390
1407
|
itemCount: i(() => r.value.length),
|
|
1391
1408
|
onAssetError: n.onAssetError,
|
|
1392
1409
|
onAssetLoad: n.onAssetLoad
|
|
1393
|
-
}), E = i(() => r.value.length > 0 && x.value === r.value.length - 1), D = i(() =>
|
|
1410
|
+
}), E = i(() => r.value.length > 0 && x.value === r.value.length - 1), D = i(() => St({
|
|
1394
1411
|
errorMessage: o.value,
|
|
1395
1412
|
hasItems: r.value.length > 0,
|
|
1396
1413
|
hasNextPage: c.value,
|
|
1397
1414
|
phase: u.value,
|
|
1398
1415
|
surface: "fullscreen"
|
|
1399
|
-
})), O = i(() => D.value?.kind ?? null), k = i(() => D.value?.message ?? null), A = i(() => Math.min(96, h.value * .15 || 96)), j = i(() =>
|
|
1400
|
-
|
|
1416
|
+
})), O = i(() => D.value?.kind ?? null), k = i(() => D.value?.message ?? null), A = i(() => Math.min(96, h.value * .15 || 96)), j = i(() => Rt(x.value, r.value.length)), M = i(() => zt(r.value, x.value));
|
|
1417
|
+
Ct({
|
|
1401
1418
|
enabled: g,
|
|
1402
1419
|
onDisable() {
|
|
1403
1420
|
U(), w.resetMediaState();
|
|
@@ -1405,7 +1422,7 @@ function Bt(e, t, n = {}) {
|
|
|
1405
1422
|
onEnable() {
|
|
1406
1423
|
return w.syncMediaPlayback();
|
|
1407
1424
|
},
|
|
1408
|
-
onKeydown:
|
|
1425
|
+
onKeydown: ee,
|
|
1409
1426
|
onResize: P
|
|
1410
1427
|
});
|
|
1411
1428
|
function N(e, t, n) {
|
|
@@ -1427,7 +1444,7 @@ function Bt(e, t, n = {}) {
|
|
|
1427
1444
|
return t && !F(-1) || n && !F(1) ? e * .24 : e;
|
|
1428
1445
|
}
|
|
1429
1446
|
function R(e) {
|
|
1430
|
-
!g.value || r.value.length === 0 || e.pointerType === "mouse" ||
|
|
1447
|
+
!g.value || r.value.length === 0 || e.pointerType === "mouse" || de(e.target) || (_ = e.pointerId, v = e.clientY, p.value = 0, m.value = !0, f.value?.setPointerCapture?.(e.pointerId));
|
|
1431
1448
|
}
|
|
1432
1449
|
function z(e) {
|
|
1433
1450
|
!g.value || !m.value || _ !== e.pointerId || (p.value = L(e.clientY - v));
|
|
@@ -1445,31 +1462,31 @@ function Bt(e, t, n = {}) {
|
|
|
1445
1462
|
p.value = 0, m.value = !1, _ = null;
|
|
1446
1463
|
}
|
|
1447
1464
|
function W(e) {
|
|
1448
|
-
if (!g.value || r.value.length === 0 || m.value ||
|
|
1465
|
+
if (!g.value || r.value.length === 0 || m.value || de(e.target) || Math.abs(e.deltaY) < Math.max(Math.abs(e.deltaX), 24)) return;
|
|
1449
1466
|
e.preventDefault();
|
|
1450
1467
|
let t = Date.now();
|
|
1451
1468
|
t < y || (y = t + 400, I(e.deltaY > 0 ? 1 : -1));
|
|
1452
1469
|
}
|
|
1453
|
-
function
|
|
1454
|
-
!g.value || r.value.length === 0 ||
|
|
1470
|
+
function ee(e) {
|
|
1471
|
+
!g.value || r.value.length === 0 || ue(e.target) || ((e.key === "ArrowDown" || e.key === "PageDown") && (e.preventDefault(), I(1)), (e.key === "ArrowUp" || e.key === "PageUp") && (e.preventDefault(), I(-1)));
|
|
1455
1472
|
}
|
|
1456
|
-
function
|
|
1473
|
+
function G(e, t) {
|
|
1457
1474
|
w.onVideoClick(e, t, b);
|
|
1458
1475
|
}
|
|
1459
|
-
function
|
|
1476
|
+
function K(e, t) {
|
|
1460
1477
|
w.onAudioCoverClick(e, t, b);
|
|
1461
1478
|
}
|
|
1462
|
-
function
|
|
1479
|
+
function q(e) {
|
|
1463
1480
|
w.onMediaSeekInput(e);
|
|
1464
1481
|
}
|
|
1465
|
-
function
|
|
1482
|
+
function J(e) {
|
|
1466
1483
|
return e.type === "image" || e.type === "video";
|
|
1467
1484
|
}
|
|
1468
|
-
function
|
|
1485
|
+
function Y(e) {
|
|
1469
1486
|
return e.type === "audio";
|
|
1470
1487
|
}
|
|
1471
|
-
function
|
|
1472
|
-
return
|
|
1488
|
+
function X(e) {
|
|
1489
|
+
return Bt(e, x.value, h.value, p.value, m.value);
|
|
1473
1490
|
}
|
|
1474
1491
|
return {
|
|
1475
1492
|
activeItem: S,
|
|
@@ -1484,29 +1501,29 @@ function Bt(e, t, n = {}) {
|
|
|
1484
1501
|
getAssetErrorKind: w.getAssetErrorKind,
|
|
1485
1502
|
getAssetErrorLabel: w.getAssetErrorLabel,
|
|
1486
1503
|
getAssetRenderKey: w.getAssetRenderKey,
|
|
1487
|
-
formatPlaybackTime:
|
|
1504
|
+
formatPlaybackTime: bt,
|
|
1488
1505
|
getImageSource: w.getImageSource,
|
|
1489
|
-
getSlideStyle:
|
|
1506
|
+
getSlideStyle: X,
|
|
1490
1507
|
hasNextPage: c,
|
|
1491
1508
|
isAtEnd: E,
|
|
1492
|
-
isAudio:
|
|
1493
|
-
isVisual:
|
|
1509
|
+
isAudio: Y,
|
|
1510
|
+
isVisual: J,
|
|
1494
1511
|
items: r,
|
|
1495
1512
|
loading: s,
|
|
1496
1513
|
mediaStates: w.mediaStates,
|
|
1497
1514
|
isImageReady: w.isImageReady,
|
|
1498
1515
|
isMediaReady: w.isMediaReady,
|
|
1499
|
-
onAudioCoverClick:
|
|
1516
|
+
onAudioCoverClick: K,
|
|
1500
1517
|
onImageError: w.onImageError,
|
|
1501
1518
|
onImageLoad: w.onImageLoad,
|
|
1502
1519
|
onMediaEvent: w.onMediaEvent,
|
|
1503
1520
|
onMediaError: w.onMediaError,
|
|
1504
|
-
onMediaSeekInput:
|
|
1521
|
+
onMediaSeekInput: q,
|
|
1505
1522
|
onPointerCancel: V,
|
|
1506
1523
|
onPointerDown: R,
|
|
1507
1524
|
onPointerMove: z,
|
|
1508
1525
|
onPointerUp: B,
|
|
1509
|
-
onVideoClick:
|
|
1526
|
+
onVideoClick: G,
|
|
1510
1527
|
onWheel: W,
|
|
1511
1528
|
registerAudioElement: w.registerAudioElement,
|
|
1512
1529
|
registerImageElement: w.registerImageElement,
|
|
@@ -1525,26 +1542,26 @@ function Bt(e, t, n = {}) {
|
|
|
1525
1542
|
}
|
|
1526
1543
|
//#endregion
|
|
1527
1544
|
//#region src/components/viewer-core/theme.ts
|
|
1528
|
-
var
|
|
1545
|
+
var Ht = {
|
|
1529
1546
|
image: "bg-[radial-gradient(circle_at_top_center,rgba(251,191,36,0.4)_0,transparent_42%),linear-gradient(180deg,#120d08,#050507)]",
|
|
1530
1547
|
video: "bg-[radial-gradient(circle_at_top_center,rgba(56,189,248,0.38)_0,transparent_42%),linear-gradient(180deg,#07111c,#050608)]",
|
|
1531
1548
|
audio: "bg-[radial-gradient(circle_at_top_center,rgba(16,185,129,0.32)_0,transparent_42%),linear-gradient(180deg,#06120f,#040506)]",
|
|
1532
1549
|
other: "bg-[radial-gradient(circle_at_top_center,rgba(148,163,184,0.28)_0,transparent_42%),linear-gradient(180deg,#0d0c10,#040506)]"
|
|
1533
|
-
},
|
|
1550
|
+
}, Ut = {
|
|
1534
1551
|
image: "bg-[radial-gradient(circle_at_center,rgba(251,191,36,0.4)_0,transparent_42%),linear-gradient(180deg,#120d08,#050507)]",
|
|
1535
1552
|
video: "bg-[radial-gradient(circle_at_center,rgba(56,189,248,0.38)_0,transparent_42%),linear-gradient(180deg,#07111c,#050608)]",
|
|
1536
1553
|
audio: "bg-[radial-gradient(circle_at_center,rgba(16,185,129,0.32)_0,transparent_42%),linear-gradient(180deg,#06120f,#040506)]",
|
|
1537
1554
|
other: "bg-[radial-gradient(circle_at_center,rgba(148,163,184,0.28)_0,transparent_42%),linear-gradient(180deg,#0d0c10,#040506)]"
|
|
1538
1555
|
};
|
|
1539
|
-
function Ut(e) {
|
|
1540
|
-
return Vt[e];
|
|
1541
|
-
}
|
|
1542
1556
|
function Wt(e) {
|
|
1543
1557
|
return Ht[e];
|
|
1544
1558
|
}
|
|
1559
|
+
function Gt(e) {
|
|
1560
|
+
return Ut[e];
|
|
1561
|
+
}
|
|
1545
1562
|
//#endregion
|
|
1546
1563
|
//#region src/components/SurfaceEmptyState.vue?vue&type=script&setup=true&lang.ts
|
|
1547
|
-
var
|
|
1564
|
+
var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
|
|
1548
1565
|
inheritAttrs: !1,
|
|
1549
1566
|
__name: "SurfaceEmptyState",
|
|
1550
1567
|
props: {
|
|
@@ -1558,31 +1575,31 @@ var Gt = ["data-surface"], Kt = ["data-surface"], qt = /* @__PURE__ */ d({
|
|
|
1558
1575
|
"data-testid": "vibe-empty-state-inline",
|
|
1559
1576
|
"data-surface": e.surface,
|
|
1560
1577
|
class: ["pointer-events-none absolute z-[4] text-center", e.surface === "grid" ? "inset-x-0 top-[clamp(6rem,22vh,11rem)] flex justify-center px-6" : "inset-0 grid place-items-center px-[clamp(2rem,4vw,3rem)] py-[clamp(2rem,4vw,3rem)]"]
|
|
1561
|
-
}), [D(n.$slots, "default", {}, () => [c("p", { class: _(["m-0 text-[0.82rem] font-medium tracking-[0.08em]", e.surface === "grid" ? "text-[#f7f1ea]/58" : "text-[#f7f1ea]/64"]) }, k(e.message), 3)])], 16,
|
|
1578
|
+
}), [D(n.$slots, "default", {}, () => [c("p", { class: _(["m-0 text-[0.82rem] font-medium tracking-[0.08em]", e.surface === "grid" ? "text-[#f7f1ea]/58" : "text-[#f7f1ea]/64"]) }, k(e.message), 3)])], 16, Kt)) : (S(), s("div", h({ key: 1 }, j(t), { class: ["pointer-events-none absolute z-[4]", e.surface === "grid" ? "inset-x-0 bottom-0 flex justify-center px-6" : "bottom-[1.8rem] left-1/2 -translate-x-1/2 max-[720px]:bottom-[1.3rem]"] }), [D(n.$slots, "default", {}, () => [c("span", {
|
|
1562
1579
|
"data-testid": "vibe-empty-state-badge",
|
|
1563
1580
|
"data-surface": e.surface,
|
|
1564
1581
|
class: _(["inline-flex items-center border border-white/14 backdrop-blur-[18px]", e.surface === "grid" ? "bg-black/55 px-4 py-3 text-[0.82rem] font-medium tracking-[0.08em] text-[#f7f1ea]/72" : "w-auto bg-black/40 px-5 py-3 text-[0.82rem] font-medium tracking-[0.08em] text-[#f7f1ea]/74 max-[720px]:w-[calc(100%-2.5rem)] max-[720px]:justify-center"])
|
|
1565
|
-
}, k(e.message), 11,
|
|
1582
|
+
}, k(e.message), 11, qt)])], 16));
|
|
1566
1583
|
}
|
|
1567
|
-
}),
|
|
1584
|
+
}), Yt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f7f1ea]" }, Xt = {
|
|
1568
1585
|
key: 0,
|
|
1569
1586
|
class: "relative h-full min-h-0"
|
|
1570
|
-
},
|
|
1587
|
+
}, Zt = [
|
|
1571
1588
|
"data-item-id",
|
|
1572
1589
|
"data-occurrence-key",
|
|
1573
1590
|
"data-index",
|
|
1574
1591
|
"data-active",
|
|
1575
1592
|
"aria-hidden"
|
|
1576
|
-
],
|
|
1593
|
+
], Qt = {
|
|
1577
1594
|
key: 0,
|
|
1578
1595
|
"data-testid": "vibe-asset-spinner",
|
|
1579
1596
|
class: "pointer-events-none absolute inset-0 z-[2] grid place-items-center"
|
|
1580
|
-
},
|
|
1597
|
+
}, $t = { class: "inline-flex h-12 w-12 items-center justify-center rounded-full bg-black/45 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)] backdrop-blur-[18px]" }, en = ["data-kind"], tn = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/45 px-8 py-7 text-center backdrop-blur-[18px]" }, nn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, rn = ["onClick"], an = [
|
|
1581
1598
|
"src",
|
|
1582
1599
|
"alt",
|
|
1583
1600
|
"onLoad",
|
|
1584
1601
|
"onError"
|
|
1585
|
-
],
|
|
1602
|
+
], on = [
|
|
1586
1603
|
"src",
|
|
1587
1604
|
"preload",
|
|
1588
1605
|
"onClick",
|
|
@@ -1599,15 +1616,15 @@ var Gt = ["data-surface"], Kt = ["data-surface"], qt = /* @__PURE__ */ d({
|
|
|
1599
1616
|
"onStalled",
|
|
1600
1617
|
"onTimeupdate",
|
|
1601
1618
|
"onWaiting"
|
|
1602
|
-
],
|
|
1619
|
+
], sn = { class: "relative grid aspect-square w-[clamp(320px,46vw,560px)] max-w-[calc(100vw-2.5rem)] place-items-center" }, cn = [
|
|
1603
1620
|
"aria-label",
|
|
1604
1621
|
"disabled",
|
|
1605
1622
|
"onClick"
|
|
1606
|
-
],
|
|
1623
|
+
], ln = { class: "relative z-[1] inline-flex min-h-[4.25rem] min-w-[4.25rem] items-center justify-center border border-white/18 bg-emerald-500/12 p-4 backdrop-blur-[20px]" }, un = { class: "pointer-events-none absolute bottom-4 right-4 inline-flex h-10 w-10 items-center justify-center border border-white/14 bg-black/50 backdrop-blur-[18px]" }, dn = {
|
|
1607
1624
|
key: 0,
|
|
1608
1625
|
"data-testid": "vibe-asset-spinner",
|
|
1609
1626
|
class: "pointer-events-none absolute inset-0 z-[3] grid place-items-center"
|
|
1610
|
-
},
|
|
1627
|
+
}, fn = { class: "inline-flex h-12 w-12 items-center justify-center rounded-full bg-black/45 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)] backdrop-blur-[18px]" }, pn = ["data-kind"], mn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, hn = ["onClick"], gn = [
|
|
1611
1628
|
"src",
|
|
1612
1629
|
"preload",
|
|
1613
1630
|
"onCanplay",
|
|
@@ -1623,21 +1640,21 @@ var Gt = ["data-surface"], Kt = ["data-surface"], qt = /* @__PURE__ */ d({
|
|
|
1623
1640
|
"onStalled",
|
|
1624
1641
|
"onTimeupdate",
|
|
1625
1642
|
"onWaiting"
|
|
1626
|
-
],
|
|
1643
|
+
], _n = {
|
|
1627
1644
|
key: 2,
|
|
1628
1645
|
class: "relative z-[1] grid w-full max-w-[1100px] justify-items-center gap-6 px-[clamp(2rem,4vw,3rem)] py-[clamp(2rem,4vw,3rem)] text-center"
|
|
1629
|
-
},
|
|
1646
|
+
}, vn = { class: "inline-flex min-h-[4.25rem] min-w-[4.25rem] items-center justify-center border border-white/18 bg-white/8 p-4 backdrop-blur-[20px]" }, yn = {
|
|
1630
1647
|
key: 0,
|
|
1631
1648
|
class: "pointer-events-none absolute inset-0 z-[4]"
|
|
1632
|
-
},
|
|
1649
|
+
}, bn = { class: "h-full w-full" }, xn = {
|
|
1633
1650
|
key: 0,
|
|
1634
1651
|
"data-testid": "vibe-fullscreen-aside",
|
|
1635
1652
|
class: "h-full min-h-0 overflow-hidden border-l border-white/10 bg-black/45 backdrop-blur-[18px]"
|
|
1636
|
-
},
|
|
1653
|
+
}, Sn = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, Cn = {
|
|
1637
1654
|
key: 0,
|
|
1638
1655
|
"data-testid": "vibe-fullscreen-aside",
|
|
1639
1656
|
class: "absolute inset-y-0 right-0 z-[6] w-full max-w-[22rem] overflow-hidden border-l border-white/10 bg-black/82 backdrop-blur-[18px]"
|
|
1640
|
-
},
|
|
1657
|
+
}, wn = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, Tn = 1280, En = /* @__PURE__ */ d({
|
|
1641
1658
|
__name: "FullscreenSurface",
|
|
1642
1659
|
props: {
|
|
1643
1660
|
active: {
|
|
@@ -1681,17 +1698,17 @@ var Gt = ["data-surface"], Kt = ["data-surface"], qt = /* @__PURE__ */ d({
|
|
|
1681
1698
|
},
|
|
1682
1699
|
emits: ["back-to-list", "update:activeIndex"],
|
|
1683
1700
|
setup(e, { emit: n }) {
|
|
1684
|
-
let d = e, p = N(), m = n, g =
|
|
1701
|
+
let d = e, p = N(), m = n, g = Vt(d, (e, t) => {
|
|
1685
1702
|
m("update:activeIndex", t);
|
|
1686
1703
|
}, {
|
|
1687
1704
|
enabled: A(d, "active"),
|
|
1688
1705
|
onAssetError: d.reportAssetError ?? void 0,
|
|
1689
1706
|
onAssetLoad: d.reportAssetLoad ?? void 0
|
|
1690
|
-
}), C = T(typeof window > "u" ?
|
|
1707
|
+
}), C = T(typeof window > "u" ? Tn : window.innerWidth || Tn), w = ht({
|
|
1691
1708
|
active: A(d, "active"),
|
|
1692
1709
|
resolvedActiveIndex: g.resolvedActiveIndex,
|
|
1693
1710
|
viewer: g
|
|
1694
|
-
}), M = i(() =>
|
|
1711
|
+
}), M = i(() => Wt(g.activeItem.value?.type ?? "image")), P = i(() => g.activeMediaItem.value && !g.activeAssetErrorKind.value ? "bottom-[5.8rem] max-[720px]:bottom-[7.4rem]" : "bottom-[1.8rem] max-[720px]:bottom-[1.3rem]"), F = i(() => !!g.activeMediaItem.value && !g.activeAssetErrorKind.value), I = i(() => F.value ? "pb-[5.75rem] max-[720px]:pb-[7rem]" : ""), R = i(() => {
|
|
1695
1712
|
let e = g.activeItem.value;
|
|
1696
1713
|
return e ? {
|
|
1697
1714
|
hasNextPage: d.hasNextPage,
|
|
@@ -1706,9 +1723,9 @@ var Gt = ["data-surface"], Kt = ["data-surface"], qt = /* @__PURE__ */ d({
|
|
|
1706
1723
|
kind: g.statusKind.value,
|
|
1707
1724
|
message: g.statusMessage.value
|
|
1708
1725
|
}), U = i(() => !H.value || !p["fullscreen-status"] ? [] : p["fullscreen-status"](H.value)), W = i(() => ({
|
|
1709
|
-
gridTemplateColumns:
|
|
1726
|
+
gridTemplateColumns: K.value ? "minmax(0, 1fr) 22rem" : "minmax(0, 1fr) 0rem",
|
|
1710
1727
|
transition: "grid-template-columns 320ms cubic-bezier(0.22, 1, 0.36, 1)"
|
|
1711
|
-
})),
|
|
1728
|
+
})), ee = i(() => gt(B.value)), G = i(() => gt(V.value)), K = i(() => G.value && C.value >= Tn), q = i(() => G.value && !K.value), J = i(() => gt(U.value)), { emptyStateProps: Y, showBadgeEmptyState: X, showCustomEmptyState: te, showInlineEmptyState: ne } = yt({
|
|
1712
1729
|
emptyStateMode: A(d, "emptyStateMode"),
|
|
1713
1730
|
itemCount: i(() => d.items.length),
|
|
1714
1731
|
loading: A(d, "loading"),
|
|
@@ -1716,14 +1733,14 @@ var Gt = ["data-surface"], Kt = ["data-surface"], qt = /* @__PURE__ */ d({
|
|
|
1716
1733
|
surface: "fullscreen"
|
|
1717
1734
|
});
|
|
1718
1735
|
x(() => {
|
|
1719
|
-
window.addEventListener("resize",
|
|
1736
|
+
window.addEventListener("resize", se);
|
|
1720
1737
|
}), b(() => {
|
|
1721
|
-
window.removeEventListener("resize",
|
|
1738
|
+
window.removeEventListener("resize", se);
|
|
1722
1739
|
});
|
|
1723
|
-
function
|
|
1724
|
-
C.value = window.innerWidth ||
|
|
1740
|
+
function se() {
|
|
1741
|
+
C.value = window.innerWidth || Tn;
|
|
1725
1742
|
}
|
|
1726
|
-
return (e, n) => (S(), s("div",
|
|
1743
|
+
return (e, n) => (S(), s("div", Yt, [
|
|
1727
1744
|
c("div", { class: _(["absolute inset-0 transition-[background] duration-200", M.value]) }, null, 2),
|
|
1728
1745
|
c("div", {
|
|
1729
1746
|
class: "relative z-[1] grid h-full min-h-0",
|
|
@@ -1737,7 +1754,7 @@ var Gt = ["data-surface"], Kt = ["data-surface"], qt = /* @__PURE__ */ d({
|
|
|
1737
1754
|
onPointerup: n[3] ||= (...e) => j(g).onPointerUp && j(g).onPointerUp(...e),
|
|
1738
1755
|
onPointercancel: n[4] ||= (...e) => j(g).onPointerCancel && j(g).onPointerCancel(...e),
|
|
1739
1756
|
onWheel: n[5] ||= (...e) => j(g).onWheel && j(g).onWheel(...e)
|
|
1740
|
-
}, [j(g).items.value.length > 0 ? (S(), s("div",
|
|
1757
|
+
}, [j(g).items.value.length > 0 ? (S(), s("div", Xt, [
|
|
1741
1758
|
(S(!0), s(t, null, E(j(g).renderedItems.value, ({ item: r, index: i }) => (S(), s("article", {
|
|
1742
1759
|
key: j(w).getItemKey(r),
|
|
1743
1760
|
"data-testid": "vibe-slide",
|
|
@@ -1748,10 +1765,10 @@ var Gt = ["data-surface"], Kt = ["data-surface"], qt = /* @__PURE__ */ d({
|
|
|
1748
1765
|
"aria-hidden": i === j(g).resolvedActiveIndex.value ? "false" : "true",
|
|
1749
1766
|
class: _(["absolute inset-0 flex h-full min-h-full items-center justify-center will-change-transform", i === j(g).resolvedActiveIndex.value ? "pointer-events-auto" : "pointer-events-none"]),
|
|
1750
1767
|
style: y(j(g).getSlideStyle(i))
|
|
1751
|
-
}, [c("div", { class: _(["absolute inset-0 opacity-85", j(
|
|
1768
|
+
}, [c("div", { class: _(["absolute inset-0 opacity-85", j(Gt)(r.type)]) }, null, 2), j(g).isVisual(r) ? (S(), s("div", {
|
|
1752
1769
|
key: 0,
|
|
1753
1770
|
class: _(["relative z-[1] flex h-full w-full items-center justify-center overflow-hidden", i === j(g).resolvedActiveIndex.value ? I.value : ""])
|
|
1754
|
-
}, [j(w).isAssetLoading(i, r) ? (S(), s("div",
|
|
1771
|
+
}, [j(w).isAssetLoading(i, r) ? (S(), s("div", Qt, [c("span", $t, [u(j(re), {
|
|
1755
1772
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
1756
1773
|
"aria-hidden": "true"
|
|
1757
1774
|
})])])) : o("", !0), j(w).isAssetErrored(i, r) ? (S(), s("div", {
|
|
@@ -1759,19 +1776,19 @@ var Gt = ["data-surface"], Kt = ["data-surface"], qt = /* @__PURE__ */ d({
|
|
|
1759
1776
|
"data-testid": "vibe-asset-error",
|
|
1760
1777
|
"data-kind": j(w).getAssetErrorKind(r),
|
|
1761
1778
|
class: "grid h-full w-full place-items-center"
|
|
1762
|
-
}, [c("div",
|
|
1779
|
+
}, [c("div", tn, [
|
|
1763
1780
|
u(j(oe), {
|
|
1764
1781
|
class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
|
|
1765
1782
|
"aria-hidden": "true"
|
|
1766
1783
|
}),
|
|
1767
|
-
c("p",
|
|
1784
|
+
c("p", nn, k(j(w).getAssetErrorLabel(r)), 1),
|
|
1768
1785
|
j(g).canRetryAsset(j(w).getItemKey(r)) ? (S(), s("button", {
|
|
1769
1786
|
key: 0,
|
|
1770
1787
|
type: "button",
|
|
1771
1788
|
class: "inline-flex items-center justify-center border border-white/14 bg-black/35 px-4 py-2 text-[0.64rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/82 backdrop-blur-[18px] transition hover:border-white/28 hover:bg-black/50",
|
|
1772
1789
|
onClick: z((e) => j(g).retryAsset(j(w).getItemKey(r)), ["stop"])
|
|
1773
|
-
}, " Retry ", 8,
|
|
1774
|
-
])], 8,
|
|
1790
|
+
}, " Retry ", 8, rn)) : o("", !0)
|
|
1791
|
+
])], 8, en)) : r.type === "image" ? (S(), s("img", {
|
|
1775
1792
|
key: j(g).getAssetRenderKey(j(w).getItemKey(r)),
|
|
1776
1793
|
src: j(w).getFullscreenImageSource(i, r),
|
|
1777
1794
|
alt: r.title ?? "",
|
|
@@ -1781,7 +1798,7 @@ var Gt = ["data-surface"], Kt = ["data-surface"], qt = /* @__PURE__ */ d({
|
|
|
1781
1798
|
ref: (e) => j(g).registerImageElement(j(w).getItemKey(r), e),
|
|
1782
1799
|
onLoad: (e) => j(g).onImageLoad(j(w).getItemKey(r), r.url),
|
|
1783
1800
|
onError: (e) => j(g).onImageError(j(w).getItemKey(r), r.url)
|
|
1784
|
-
}, null, 42,
|
|
1801
|
+
}, null, 42, an)) : (S(), s("video", {
|
|
1785
1802
|
key: j(g).getAssetRenderKey(j(w).getItemKey(r)),
|
|
1786
1803
|
class: _(["block h-auto max-h-full w-auto max-w-full cursor-pointer object-contain shadow-[0_40px_120px_-60px_rgba(0,0,0,0.9)] transition-opacity duration-300", j(g).isMediaReady(j(w).getItemKey(r)) ? "opacity-100" : "opacity-0"]),
|
|
1787
1804
|
playsinline: "",
|
|
@@ -1804,10 +1821,10 @@ var Gt = ["data-surface"], Kt = ["data-surface"], qt = /* @__PURE__ */ d({
|
|
|
1804
1821
|
onStalled: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
|
|
1805
1822
|
onTimeupdate: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
|
|
1806
1823
|
onWaiting: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e)
|
|
1807
|
-
}, null, 42,
|
|
1824
|
+
}, null, 42, on))], 2)) : j(g).isAudio(r) ? (S(), s("div", {
|
|
1808
1825
|
key: 1,
|
|
1809
1826
|
class: _(["relative z-[1] grid w-full max-w-[1100px] justify-items-center gap-6 px-[clamp(2rem,4vw,3rem)] py-[clamp(2rem,4vw,3rem)] text-center", i === j(g).resolvedActiveIndex.value ? I.value : ""])
|
|
1810
|
-
}, [c("div",
|
|
1827
|
+
}, [c("div", sn, [
|
|
1811
1828
|
c("button", {
|
|
1812
1829
|
type: "button",
|
|
1813
1830
|
class: "relative grid h-full w-full place-items-center border border-white/12 bg-[linear-gradient(180deg,rgba(255,255,255,0.04),rgba(255,255,255,0.02)),radial-gradient(circle_at_center,rgba(16,185,129,0.14),transparent_58%)] text-[#f7f1ea] transition-[border-color,background] duration-200 hover:border-white/30 hover:bg-[linear-gradient(180deg,rgba(255,255,255,0.07),rgba(255,255,255,0.03)),radial-gradient(circle_at_center,rgba(16,185,129,0.18),transparent_58%)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-[#f7f1ea]",
|
|
@@ -1817,19 +1834,19 @@ var Gt = ["data-surface"], Kt = ["data-surface"], qt = /* @__PURE__ */ d({
|
|
|
1817
1834
|
}, [
|
|
1818
1835
|
n[6] ||= c("span", { class: "pointer-events-none absolute inset-0 border border-white/8 bg-[radial-gradient(circle,rgba(16,185,129,0.16),transparent_66%)]" }, null, -1),
|
|
1819
1836
|
n[7] ||= c("span", { class: "pointer-events-none absolute h-[clamp(220px,30vw,360px)] w-[clamp(220px,30vw,360px)] border border-white/8 bg-[radial-gradient(circle,rgba(255,255,255,0.08),transparent_62%)]" }, null, -1),
|
|
1820
|
-
c("span",
|
|
1821
|
-
icon: j(
|
|
1837
|
+
c("span", ln, [D(e.$slots, "item-icon", {
|
|
1838
|
+
icon: j(ft)(r.type),
|
|
1822
1839
|
item: r
|
|
1823
|
-
}, () => [(S(), a(O(j(
|
|
1840
|
+
}, () => [(S(), a(O(j(ft)(r.type)), {
|
|
1824
1841
|
class: "h-6 w-6 stroke-[1.9]",
|
|
1825
1842
|
"aria-hidden": "true"
|
|
1826
1843
|
}))])]),
|
|
1827
|
-
c("span",
|
|
1844
|
+
c("span", un, [(S(), a(O(j(g).mediaStates.value[j(w).getItemKey(r)]?.paused ?? !0 ? j(ae) : j(ie)), {
|
|
1828
1845
|
class: "h-4 w-4 stroke-2",
|
|
1829
1846
|
"aria-hidden": "true"
|
|
1830
1847
|
}))])
|
|
1831
|
-
], 8,
|
|
1832
|
-
j(w).isAssetLoading(i, r) ? (S(), s("div",
|
|
1848
|
+
], 8, cn),
|
|
1849
|
+
j(w).isAssetLoading(i, r) ? (S(), s("div", dn, [c("span", fn, [u(j(re), {
|
|
1833
1850
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
1834
1851
|
"aria-hidden": "true"
|
|
1835
1852
|
})])])) : o("", !0),
|
|
@@ -1842,14 +1859,14 @@ var Gt = ["data-surface"], Kt = ["data-surface"], qt = /* @__PURE__ */ d({
|
|
|
1842
1859
|
class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
|
|
1843
1860
|
"aria-hidden": "true"
|
|
1844
1861
|
}),
|
|
1845
|
-
c("p",
|
|
1862
|
+
c("p", mn, k(j(w).getAssetErrorLabel(r)), 1),
|
|
1846
1863
|
j(g).canRetryAsset(j(w).getItemKey(r)) ? (S(), s("button", {
|
|
1847
1864
|
key: 0,
|
|
1848
1865
|
type: "button",
|
|
1849
1866
|
class: "pointer-events-auto inline-flex items-center justify-center border border-white/14 bg-black/35 px-4 py-2 text-[0.64rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/82 backdrop-blur-[18px] transition hover:border-white/28 hover:bg-black/50",
|
|
1850
1867
|
onClick: z((e) => j(g).retryAsset(j(w).getItemKey(r)), ["stop"])
|
|
1851
|
-
}, " Retry ", 8,
|
|
1852
|
-
], 8,
|
|
1868
|
+
}, " Retry ", 8, hn)) : o("", !0)
|
|
1869
|
+
], 8, pn)], 64)) : o("", !0)
|
|
1853
1870
|
]), (S(), s("audio", {
|
|
1854
1871
|
key: j(g).getAssetRenderKey(j(w).getItemKey(r)),
|
|
1855
1872
|
src: j(w).getFullscreenMediaSource(i, r),
|
|
@@ -1870,15 +1887,15 @@ var Gt = ["data-surface"], Kt = ["data-surface"], qt = /* @__PURE__ */ d({
|
|
|
1870
1887
|
onStalled: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
|
|
1871
1888
|
onTimeupdate: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
|
|
1872
1889
|
onWaiting: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e)
|
|
1873
|
-
}, null, 40,
|
|
1874
|
-
icon: j(
|
|
1890
|
+
}, null, 40, gn))], 2)) : (S(), s("div", _n, [c("div", vn, [D(e.$slots, "item-icon", {
|
|
1891
|
+
icon: j(ft)(r.type),
|
|
1875
1892
|
item: r
|
|
1876
|
-
}, () => [(S(), a(O(j(
|
|
1893
|
+
}, () => [(S(), a(O(j(ft)(r.type)), {
|
|
1877
1894
|
class: "h-6 w-6 stroke-[1.9]",
|
|
1878
1895
|
"aria-hidden": "true"
|
|
1879
|
-
}))])])]))], 14,
|
|
1880
|
-
R.value && p["fullscreen-overlay"] ? (S(), s("div",
|
|
1881
|
-
j(g).activeItem.value ? (S(), a(
|
|
1896
|
+
}))])])]))], 14, Zt))), 128)),
|
|
1897
|
+
R.value && p["fullscreen-overlay"] ? (S(), s("div", yn, [c("div", bn, [D(e.$slots, "fullscreen-overlay", v(f(R.value)))])])) : o("", !0),
|
|
1898
|
+
j(g).activeItem.value ? (S(), a(lt, {
|
|
1882
1899
|
key: 1,
|
|
1883
1900
|
"current-index": j(g).resolvedActiveIndex.value,
|
|
1884
1901
|
"pagination-detail": j(g).paginationDetail.value,
|
|
@@ -1887,7 +1904,7 @@ var Gt = ["data-surface"], Kt = ["data-surface"], qt = /* @__PURE__ */ d({
|
|
|
1887
1904
|
title: j(g).activeItem.value.title ?? null,
|
|
1888
1905
|
total: j(g).items.value.length,
|
|
1889
1906
|
onBackToList: n[0] ||= (e) => m("back-to-list")
|
|
1890
|
-
}, l({ _: 2 }, [
|
|
1907
|
+
}, l({ _: 2 }, [ee.value && R.value ? {
|
|
1891
1908
|
name: "actions",
|
|
1892
1909
|
fn: L(() => [D(e.$slots, "fullscreen-header-actions", v(f(R.value)))]),
|
|
1893
1910
|
key: "0"
|
|
@@ -1899,7 +1916,7 @@ var Gt = ["data-surface"], Kt = ["data-surface"], qt = /* @__PURE__ */ d({
|
|
|
1899
1916
|
"title",
|
|
1900
1917
|
"total"
|
|
1901
1918
|
])) : o("", !0),
|
|
1902
|
-
F.value ? (S(), a(
|
|
1919
|
+
F.value ? (S(), a(Qe, {
|
|
1903
1920
|
key: 2,
|
|
1904
1921
|
"current-time": j(g).activeMediaState.value.currentTime,
|
|
1905
1922
|
"current-time-label": j(g).formatPlaybackTime(j(g).activeMediaState.value.currentTime),
|
|
@@ -1918,30 +1935,30 @@ var Gt = ["data-surface"], Kt = ["data-surface"], qt = /* @__PURE__ */ d({
|
|
|
1918
1935
|
H.value ? (S(), s("div", {
|
|
1919
1936
|
key: 3,
|
|
1920
1937
|
class: _(["absolute left-1/2 z-[4] -translate-x-1/2", P.value])
|
|
1921
|
-
}, [
|
|
1938
|
+
}, [J.value ? D(e.$slots, "fullscreen-status", v(h({ key: 0 }, H.value))) : (S(), s("div", {
|
|
1922
1939
|
key: 1,
|
|
1923
1940
|
"data-testid": "vibe-fullscreen-status-badge",
|
|
1924
1941
|
class: _(["inline-flex w-auto items-center border border-white/14 bg-black/40 px-5 py-3 text-[0.75rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74 backdrop-blur-[18px] max-[720px]:w-[calc(100%-2.5rem)] max-[720px]:justify-center", H.value.kind === "end" ? "border-amber-300/35 text-amber-200" : H.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
|
|
1925
1942
|
}, k(H.value.message), 3))], 2)) : o("", !0)
|
|
1926
|
-
])) : j(ne) && j(
|
|
1943
|
+
])) : j(ne) && j(Y) ? (S(), a(Jt, {
|
|
1927
1944
|
key: 1,
|
|
1928
|
-
message: j(
|
|
1929
|
-
mode: j(
|
|
1930
|
-
surface: j(
|
|
1945
|
+
message: j(Y).message,
|
|
1946
|
+
mode: j(Y).mode,
|
|
1947
|
+
surface: j(Y).surface
|
|
1931
1948
|
}, {
|
|
1932
|
-
default: L(() => [j(te) ? D(e.$slots, "empty-state", v(h({ key: 0 }, j(
|
|
1949
|
+
default: L(() => [j(te) ? D(e.$slots, "empty-state", v(h({ key: 0 }, j(Y)))) : o("", !0)]),
|
|
1933
1950
|
_: 3
|
|
1934
1951
|
}, 8, [
|
|
1935
1952
|
"message",
|
|
1936
1953
|
"mode",
|
|
1937
1954
|
"surface"
|
|
1938
|
-
])) : o("", !0), j(
|
|
1955
|
+
])) : o("", !0), j(X) && j(Y) ? (S(), a(Jt, {
|
|
1939
1956
|
key: 2,
|
|
1940
|
-
message: j(
|
|
1941
|
-
mode: j(
|
|
1942
|
-
surface: j(
|
|
1957
|
+
message: j(Y).message,
|
|
1958
|
+
mode: j(Y).mode,
|
|
1959
|
+
surface: j(Y).surface
|
|
1943
1960
|
}, {
|
|
1944
|
-
default: L(() => [j(te) ? D(e.$slots, "empty-state", v(h({ key: 0 }, j(
|
|
1961
|
+
default: L(() => [j(te) ? D(e.$slots, "empty-state", v(h({ key: 0 }, j(Y)))) : o("", !0)]),
|
|
1945
1962
|
_: 3
|
|
1946
1963
|
}, 8, [
|
|
1947
1964
|
"message",
|
|
@@ -1955,7 +1972,7 @@ var Gt = ["data-surface"], Kt = ["data-surface"], qt = /* @__PURE__ */ d({
|
|
|
1955
1972
|
"leave-from-class": "translate-x-0 opacity-100",
|
|
1956
1973
|
"leave-to-class": "translate-x-full opacity-0"
|
|
1957
1974
|
}, {
|
|
1958
|
-
default: L(() => [
|
|
1975
|
+
default: L(() => [K.value && R.value ? (S(), s("aside", xn, [c("div", Sn, [D(e.$slots, "fullscreen-aside", v(f(R.value)))])])) : o("", !0)]),
|
|
1959
1976
|
_: 3
|
|
1960
1977
|
})], 4),
|
|
1961
1978
|
u(r, {
|
|
@@ -1966,29 +1983,29 @@ var Gt = ["data-surface"], Kt = ["data-surface"], qt = /* @__PURE__ */ d({
|
|
|
1966
1983
|
"leave-from-class": "translate-x-0 opacity-100",
|
|
1967
1984
|
"leave-to-class": "translate-x-full opacity-0"
|
|
1968
1985
|
}, {
|
|
1969
|
-
default: L(() => [
|
|
1986
|
+
default: L(() => [q.value && R.value ? (S(), s("aside", Cn, [c("div", wn, [D(e.$slots, "fullscreen-aside", v(f(R.value)))])])) : o("", !0)]),
|
|
1970
1987
|
_: 3
|
|
1971
1988
|
})
|
|
1972
1989
|
]));
|
|
1973
1990
|
}
|
|
1974
|
-
}),
|
|
1975
|
-
function
|
|
1991
|
+
}), Dn = 1, On = .5;
|
|
1992
|
+
function kn(e) {
|
|
1976
1993
|
if (e.type !== "image" && e.type !== "video") return {
|
|
1977
|
-
width:
|
|
1978
|
-
height:
|
|
1994
|
+
width: Dn,
|
|
1995
|
+
height: Dn,
|
|
1979
1996
|
source: "fallback"
|
|
1980
1997
|
};
|
|
1981
1998
|
let t = e.preview?.width, n = e.preview?.height;
|
|
1982
|
-
if (
|
|
1983
|
-
let r =
|
|
1999
|
+
if (In(t) && In(n)) {
|
|
2000
|
+
let r = Ln(e, t, n);
|
|
1984
2001
|
return {
|
|
1985
2002
|
width: r.width,
|
|
1986
2003
|
height: r.height,
|
|
1987
2004
|
source: "preview"
|
|
1988
2005
|
};
|
|
1989
2006
|
}
|
|
1990
|
-
if (
|
|
1991
|
-
let t =
|
|
2007
|
+
if (In(e.width) && In(e.height)) {
|
|
2008
|
+
let t = Ln(e, e.width, e.height);
|
|
1992
2009
|
return {
|
|
1993
2010
|
width: t.width,
|
|
1994
2011
|
height: t.height,
|
|
@@ -1996,31 +2013,31 @@ function On(e) {
|
|
|
1996
2013
|
};
|
|
1997
2014
|
}
|
|
1998
2015
|
return {
|
|
1999
|
-
width:
|
|
2000
|
-
height:
|
|
2016
|
+
width: Dn,
|
|
2017
|
+
height: Dn,
|
|
2001
2018
|
source: "fallback"
|
|
2002
2019
|
};
|
|
2003
2020
|
}
|
|
2004
|
-
function
|
|
2021
|
+
function An(e, t) {
|
|
2005
2022
|
return !e || e <= 0 || !t || t <= 0 ? 1 : Math.max(1, Math.floor(e / t));
|
|
2006
2023
|
}
|
|
2007
|
-
function
|
|
2024
|
+
function jn(e, t, n, r = 0) {
|
|
2008
2025
|
if (!e || e <= 0 || !t || t <= 0) return n;
|
|
2009
2026
|
let i = typeof r == "number" && r > 0 ? r : 0, a = e - Math.max(0, t - 1) * i;
|
|
2010
2027
|
return !a || a <= 0 ? n : a / t;
|
|
2011
2028
|
}
|
|
2012
|
-
function
|
|
2013
|
-
let n =
|
|
2029
|
+
function Mn(e, t) {
|
|
2030
|
+
let n = kn(e);
|
|
2014
2031
|
return n.height / n.width * t;
|
|
2015
2032
|
}
|
|
2016
|
-
function
|
|
2033
|
+
function Nn(e, t) {
|
|
2017
2034
|
let n = Array.from({ length: t.columnCount }, () => 0), r = Array(e.length), i = Array(e.length), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = 0;
|
|
2018
2035
|
for (let c = 0; c < e.length; c += 1) {
|
|
2019
2036
|
let l = e[c];
|
|
2020
|
-
o.set(
|
|
2037
|
+
o.set(Q(l), c);
|
|
2021
2038
|
let u = 0;
|
|
2022
2039
|
for (let e = 1; e < n.length; e += 1) n[e] < n[u] && (u = e);
|
|
2023
|
-
let d = u * (t.columnWidth + t.gapX), f = n[u], p =
|
|
2040
|
+
let d = u * (t.columnWidth + t.gapX), f = n[u], p = Mn(l, t.columnWidth);
|
|
2024
2041
|
r[c] = {
|
|
2025
2042
|
x: d,
|
|
2026
2043
|
y: f
|
|
@@ -2039,7 +2056,7 @@ function Mn(e, t) {
|
|
|
2039
2056
|
indexById: o
|
|
2040
2057
|
};
|
|
2041
2058
|
}
|
|
2042
|
-
function
|
|
2059
|
+
function Pn(e) {
|
|
2043
2060
|
if (e.itemCount <= 0) return [];
|
|
2044
2061
|
if (e.viewportHeight <= 0) return Array.from({ length: e.itemCount }, (e, t) => t);
|
|
2045
2062
|
let t = Math.max(0, e.scrollTop - e.overscanPx), n = e.scrollTop + e.viewportHeight + e.overscanPx, r = Math.floor(t / e.bucketPx), i = Math.floor(n / e.bucketPx), a = /* @__PURE__ */ new Set();
|
|
@@ -2049,21 +2066,21 @@ function Nn(e) {
|
|
|
2049
2066
|
}
|
|
2050
2067
|
return Array.from(a).sort((e, t) => e - t);
|
|
2051
2068
|
}
|
|
2052
|
-
function
|
|
2069
|
+
function Fn(e, t, n) {
|
|
2053
2070
|
let r = /* @__PURE__ */ new Map();
|
|
2054
2071
|
for (let i of e) {
|
|
2055
|
-
let e = t.get(
|
|
2072
|
+
let e = t.get(Q(i));
|
|
2056
2073
|
if (e == null) continue;
|
|
2057
2074
|
let a = n[e];
|
|
2058
|
-
a && r.set(
|
|
2075
|
+
a && r.set(Q(i), a);
|
|
2059
2076
|
}
|
|
2060
2077
|
return r;
|
|
2061
2078
|
}
|
|
2062
|
-
function
|
|
2079
|
+
function In(e) {
|
|
2063
2080
|
return typeof e == "number" && Number.isFinite(e) && e > 0;
|
|
2064
2081
|
}
|
|
2065
|
-
function
|
|
2066
|
-
return e.type !== "image" || n / t >=
|
|
2082
|
+
function Ln(e, t, n) {
|
|
2083
|
+
return e.type !== "image" || n / t >= On ? {
|
|
2067
2084
|
width: t,
|
|
2068
2085
|
height: n
|
|
2069
2086
|
} : {
|
|
@@ -2073,46 +2090,46 @@ function In(e, t, n) {
|
|
|
2073
2090
|
}
|
|
2074
2091
|
//#endregion
|
|
2075
2092
|
//#region src/components/viewer-core/useMasonryMotion.ts
|
|
2076
|
-
var
|
|
2077
|
-
function
|
|
2093
|
+
var Rn = 300, zn = 600, Bn = 40, Vn = 300, Hn = 400;
|
|
2094
|
+
function Un(e, t) {
|
|
2078
2095
|
return t === "top" ? [...e].reverse() : e;
|
|
2079
2096
|
}
|
|
2080
|
-
function
|
|
2081
|
-
return e <= 0 ?
|
|
2097
|
+
function Wn(e) {
|
|
2098
|
+
return e <= 0 ? zn : zn + Math.min((e - 1) * Bn, Hn);
|
|
2082
2099
|
}
|
|
2083
|
-
function
|
|
2084
|
-
return
|
|
2100
|
+
function Gn() {
|
|
2101
|
+
return Vn;
|
|
2085
2102
|
}
|
|
2086
|
-
function
|
|
2103
|
+
function Kn(e) {
|
|
2087
2104
|
let t = e.itemHeight > 0 ? e.itemHeight : e.columnWidth;
|
|
2088
2105
|
return e.direction === "top" ? e.scrollTop - t : e.scrollTop + e.viewportHeight + t;
|
|
2089
2106
|
}
|
|
2090
|
-
function
|
|
2107
|
+
function qn(e) {
|
|
2091
2108
|
let t = T(/* @__PURE__ */ new Set()), n = T(/* @__PURE__ */ new Set()), r = T(/* @__PURE__ */ new Map()), a = T(/* @__PURE__ */ new Map()), o = T(/* @__PURE__ */ new Map()), s = T(/* @__PURE__ */ new Set()), c = T(/* @__PURE__ */ new Map()), l = T(/* @__PURE__ */ new Map()), u = T(/* @__PURE__ */ new Set()), d = /* @__PURE__ */ new Set(), f = /* @__PURE__ */ new Set(), p = i(() => Array.from(o.value.values()));
|
|
2092
2109
|
F(e.visibleIndices, (i) => {
|
|
2093
2110
|
if (!i.length) return;
|
|
2094
2111
|
let o = [];
|
|
2095
2112
|
for (let n of i) {
|
|
2096
|
-
let r = e.items.value[n] ?
|
|
2113
|
+
let r = e.items.value[n] ? Q(e.items.value[n]) : null;
|
|
2097
2114
|
!r || !t.value.has(r) || d.has(r) || (d.add(r), o.push(r));
|
|
2098
2115
|
}
|
|
2099
2116
|
if (!o.length) return;
|
|
2100
|
-
let s =
|
|
2101
|
-
for (let e = 0; e < s.length; e += 1) c.set(s[e], Math.min(e *
|
|
2102
|
-
r.value = c,
|
|
2117
|
+
let s = Un(o, a.value.get(o[0]) ?? "bottom"), c = new Map(r.value);
|
|
2118
|
+
for (let e = 0; e < s.length; e += 1) c.set(s[e], Math.min(e * Bn, Hn));
|
|
2119
|
+
r.value = c, Jn(() => {
|
|
2103
2120
|
let e = new Set(n.value);
|
|
2104
2121
|
for (let t of o) e.add(t);
|
|
2105
2122
|
n.value = e;
|
|
2106
|
-
}),
|
|
2123
|
+
}), Yn(() => {
|
|
2107
2124
|
let e = new Set(t.value);
|
|
2108
2125
|
for (let t of o) e.delete(t);
|
|
2109
2126
|
t.value = e, S(() => {
|
|
2110
2127
|
let e = new Set(n.value), t = new Map(r.value), i = new Map(a.value);
|
|
2111
2128
|
for (let n of o) e.delete(n), t.delete(n), i.delete(n), d.delete(n);
|
|
2112
2129
|
n.value = e, r.value = t, a.value = i;
|
|
2113
|
-
},
|
|
2130
|
+
}, Wn(o.length));
|
|
2114
2131
|
});
|
|
2115
|
-
}, { flush: "post" }), F(() => e.items.value.map((e) =>
|
|
2132
|
+
}, { flush: "post" }), F(() => e.items.value.map((e) => Q(e)), (e) => {
|
|
2116
2133
|
if (!e.length || !o.value.size) return;
|
|
2117
2134
|
let t = new Set(e), n = null, r = null;
|
|
2118
2135
|
for (let e of o.value.keys()) t.has(e) && (n ||= new Map(o.value), r ||= new Set(s.value), n.delete(e), r.delete(e));
|
|
@@ -2125,7 +2142,7 @@ function Kn(e) {
|
|
|
2125
2142
|
if (!e.length) return;
|
|
2126
2143
|
let r = new Set(t.value), i = new Map(a.value);
|
|
2127
2144
|
for (let t of e) {
|
|
2128
|
-
let e =
|
|
2145
|
+
let e = Q(t);
|
|
2129
2146
|
r.add(e), i.set(e, n);
|
|
2130
2147
|
}
|
|
2131
2148
|
t.value = r, a.value = i;
|
|
@@ -2134,10 +2151,10 @@ function Kn(e) {
|
|
|
2134
2151
|
if (!e.length) return;
|
|
2135
2152
|
let i = new Map(o.value), c = new Set(t.value), l = new Set(n.value), u = new Map(r.value), f = new Map(a.value), p = [];
|
|
2136
2153
|
for (let t of e) {
|
|
2137
|
-
let e =
|
|
2154
|
+
let e = Q(t.item);
|
|
2138
2155
|
p.push(e), i.set(e, t), c.delete(e), l.delete(e), u.delete(e), f.delete(e), d.delete(e);
|
|
2139
2156
|
}
|
|
2140
|
-
o.value = i, t.value = c, n.value = l, r.value = u, a.value = f,
|
|
2157
|
+
o.value = i, t.value = c, n.value = l, r.value = u, a.value = f, Jn(() => {
|
|
2141
2158
|
let e = new Set(s.value);
|
|
2142
2159
|
for (let t of p) e.add(t);
|
|
2143
2160
|
s.value = e;
|
|
@@ -2145,9 +2162,9 @@ function Kn(e) {
|
|
|
2145
2162
|
let e = new Map(o.value), t = new Set(s.value);
|
|
2146
2163
|
for (let n of p) e.delete(n), t.delete(n);
|
|
2147
2164
|
o.value = e, s.value = t;
|
|
2148
|
-
},
|
|
2165
|
+
}, Vn);
|
|
2149
2166
|
}
|
|
2150
|
-
function g(t, n, r =
|
|
2167
|
+
function g(t, n, r = Rn) {
|
|
2151
2168
|
if (!t.size) return;
|
|
2152
2169
|
let i = /* @__PURE__ */ new Map(), a = [];
|
|
2153
2170
|
for (let [r, o] of t.entries()) {
|
|
@@ -2166,8 +2183,8 @@ function Kn(e) {
|
|
|
2166
2183
|
c.value = i, u.value = /* @__PURE__ */ new Set();
|
|
2167
2184
|
let o = new Map(l.value);
|
|
2168
2185
|
for (let e of a) o.set(e, r);
|
|
2169
|
-
l.value = o,
|
|
2170
|
-
u.value = new Set(a),
|
|
2186
|
+
l.value = o, Jn(() => {
|
|
2187
|
+
u.value = new Set(a), Jn(() => {
|
|
2171
2188
|
c.value = /* @__PURE__ */ new Map();
|
|
2172
2189
|
});
|
|
2173
2190
|
}), S(() => {
|
|
@@ -2178,8 +2195,8 @@ function Kn(e) {
|
|
|
2178
2195
|
}, r);
|
|
2179
2196
|
}
|
|
2180
2197
|
function _(e) {
|
|
2181
|
-
if (n.value.has(e)) return `transform ${
|
|
2182
|
-
if (u.value.has(e)) return `transform ${l.value.get(e) ??
|
|
2198
|
+
if (n.value.has(e)) return `transform ${zn}ms ease-out`;
|
|
2199
|
+
if (u.value.has(e)) return `transform ${l.value.get(e) ?? Rn}ms ease-out`;
|
|
2183
2200
|
}
|
|
2184
2201
|
function v(e) {
|
|
2185
2202
|
if (!n.value.has(e)) return;
|
|
@@ -2190,13 +2207,13 @@ function Kn(e) {
|
|
|
2190
2207
|
let r = e.items.value[n], i = e.positions.value[n] ?? {
|
|
2191
2208
|
x: 0,
|
|
2192
2209
|
y: 0
|
|
2193
|
-
}, o = e.heights.value[n] ?? e.columnWidth.value, s = r ?
|
|
2210
|
+
}, o = e.heights.value[n] ?? e.columnWidth.value, s = r ? Q(r) : null, l = s ? c.value.get(s) ?? {
|
|
2194
2211
|
dx: 0,
|
|
2195
2212
|
dy: 0
|
|
2196
2213
|
} : {
|
|
2197
2214
|
dx: 0,
|
|
2198
2215
|
dy: 0
|
|
2199
|
-
}, u = s ? a.value.get(s) ?? "bottom" : "bottom", d = s && t.value.has(s) ?
|
|
2216
|
+
}, u = s ? a.value.get(s) ?? "bottom" : "bottom", d = s && t.value.has(s) ? Kn({
|
|
2200
2217
|
columnWidth: e.columnWidth.value,
|
|
2201
2218
|
direction: u,
|
|
2202
2219
|
itemHeight: o,
|
|
@@ -2206,18 +2223,18 @@ function Kn(e) {
|
|
|
2206
2223
|
return `translate3d(${i.x + l.dx}px, ${d + l.dy}px, 0)`;
|
|
2207
2224
|
}
|
|
2208
2225
|
function x(t) {
|
|
2209
|
-
let n =
|
|
2226
|
+
let n = Q(t), r = o.value.get(n);
|
|
2210
2227
|
if (!r) return {
|
|
2211
2228
|
opacity: "0",
|
|
2212
2229
|
transform: "translate3d(0, 0, 0) scale(0.96)",
|
|
2213
|
-
transition: `opacity ${
|
|
2230
|
+
transition: `opacity ${Vn}ms ease-out, transform ${Vn}ms ease-out`
|
|
2214
2231
|
};
|
|
2215
2232
|
let i = s.value.has(n);
|
|
2216
2233
|
return {
|
|
2217
2234
|
height: `${r.height}px`,
|
|
2218
2235
|
opacity: i ? "0" : "1",
|
|
2219
2236
|
transform: `translate3d(${r.position.x}px, ${r.position.y}px, 0) scale(${i ? "0.96" : "1"})`,
|
|
2220
|
-
transition: `opacity ${
|
|
2237
|
+
transition: `opacity ${Vn}ms ease-out, transform ${Vn}ms ease-out`,
|
|
2221
2238
|
width: `${e.columnWidth.value}px`
|
|
2222
2239
|
};
|
|
2223
2240
|
}
|
|
@@ -2238,28 +2255,28 @@ function Kn(e) {
|
|
|
2238
2255
|
playFlipMoveAnimation: g
|
|
2239
2256
|
};
|
|
2240
2257
|
}
|
|
2241
|
-
function
|
|
2258
|
+
function Jn(e) {
|
|
2242
2259
|
if (typeof requestAnimationFrame == "function") {
|
|
2243
2260
|
requestAnimationFrame(() => e());
|
|
2244
2261
|
return;
|
|
2245
2262
|
}
|
|
2246
2263
|
setTimeout(e, 0);
|
|
2247
2264
|
}
|
|
2248
|
-
function
|
|
2249
|
-
|
|
2265
|
+
function Yn(e) {
|
|
2266
|
+
Jn(() => Jn(e));
|
|
2250
2267
|
}
|
|
2251
2268
|
//#endregion
|
|
2252
2269
|
//#region src/components/viewer-core/masonryViewport.ts
|
|
2253
|
-
function
|
|
2270
|
+
function Xn(e, t) {
|
|
2254
2271
|
return e?.clientHeight || Math.round(e?.getBoundingClientRect().height ?? 0) || t || window.innerHeight || 1;
|
|
2255
2272
|
}
|
|
2256
|
-
function
|
|
2273
|
+
function Zn(e, t, n) {
|
|
2257
2274
|
return e?.clientWidth || Math.round(e?.getBoundingClientRect().width ?? 0) || t || window.innerWidth || n;
|
|
2258
2275
|
}
|
|
2259
|
-
function
|
|
2276
|
+
function Qn(e, t, n, r) {
|
|
2260
2277
|
return (e?.scrollHeight ?? r) - (t + n);
|
|
2261
2278
|
}
|
|
2262
|
-
function
|
|
2279
|
+
function $n(e, t) {
|
|
2263
2280
|
return {
|
|
2264
2281
|
height: `${e}px`,
|
|
2265
2282
|
transform: `translate3d(0, ${t}px, 0)`
|
|
@@ -2267,8 +2284,8 @@ function Qn(e, t) {
|
|
|
2267
2284
|
}
|
|
2268
2285
|
//#endregion
|
|
2269
2286
|
//#region src/components/viewer-core/useEdgeBoundary.ts
|
|
2270
|
-
var
|
|
2271
|
-
function
|
|
2287
|
+
var er = 250, tr = 1e3;
|
|
2288
|
+
function nr(e) {
|
|
2272
2289
|
let t = T(!1), n = T(!1), r = T(0), i = T(0), a = T(!1), o = T(!1), s = 0, c = null;
|
|
2273
2290
|
b(() => {
|
|
2274
2291
|
y();
|
|
@@ -2284,7 +2301,7 @@ function tr(e) {
|
|
|
2284
2301
|
function u(t) {
|
|
2285
2302
|
if (!x(t) || !e.isAtBoundary()) return;
|
|
2286
2303
|
let n = Date.now();
|
|
2287
|
-
n < s || (s = n +
|
|
2304
|
+
n < s || (s = n + er, m());
|
|
2288
2305
|
}
|
|
2289
2306
|
function d() {
|
|
2290
2307
|
if (!g()) return;
|
|
@@ -2318,7 +2335,7 @@ function tr(e) {
|
|
|
2318
2335
|
return e.hasPage.value && t.value && r.value > i.value && !e.interactionLocked?.value && !e.loading.value && !a.value && typeof e.requestPage.value == "function";
|
|
2319
2336
|
}
|
|
2320
2337
|
function _() {
|
|
2321
|
-
o.value = !1, v(
|
|
2338
|
+
o.value = !1, v(tr);
|
|
2322
2339
|
}
|
|
2323
2340
|
function v(e) {
|
|
2324
2341
|
y(), a.value = !0, c = setTimeout(() => {
|
|
@@ -2341,20 +2358,20 @@ function tr(e) {
|
|
|
2341
2358
|
}
|
|
2342
2359
|
//#endregion
|
|
2343
2360
|
//#region src/components/viewer-core/useMasonryList.ts
|
|
2344
|
-
var
|
|
2361
|
+
var rr = 600, $ = 24, ir = 16, ar = 300, or = 200, sr = 200, cr = 200, lr = 300, ur = 24, dr = 48, fr = 500, pr = 1e3;
|
|
2345
2362
|
function mr(e) {
|
|
2346
|
-
let t = T(null), n = T(0), r = T(typeof window > "u" ? 0 : window.innerHeight || 0), a = T(typeof window > "u" ? 0 : window.innerWidth || ar), o = T([]), s = T([]), c = T(/* @__PURE__ */ new Map()), l = T(0), u = T(/* @__PURE__ */ new Map()), d = T(null), f = T(null), p = T(!1), m = i(() => Math.max(ar, a.value -
|
|
2363
|
+
let t = T(null), n = T(0), r = T(typeof window > "u" ? 0 : window.innerHeight || 0), a = T(typeof window > "u" ? 0 : window.innerWidth || ar), o = T([]), s = T([]), c = T(/* @__PURE__ */ new Map()), l = T(0), u = T(/* @__PURE__ */ new Map()), d = T(null), f = T(null), p = T(!1), m = i(() => Math.max(ar, a.value - $ * 2)), h = i(() => An(m.value, ar)), _ = i(() => jn(m.value, h.value, ar, ir)), v = i(() => hr(e.activeIndex.value, 0, Math.max(0, e.items.value.length - 1))), y = i(() => Pn({
|
|
2347
2364
|
itemCount: e.items.value.length,
|
|
2348
2365
|
viewportHeight: r.value,
|
|
2349
2366
|
scrollTop: n.value,
|
|
2350
2367
|
overscanPx: or,
|
|
2351
|
-
bucketPx:
|
|
2368
|
+
bucketPx: rr,
|
|
2352
2369
|
buckets: c.value
|
|
2353
2370
|
})), S = i(() => y.value.map((t) => ({
|
|
2354
2371
|
item: e.items.value[t],
|
|
2355
2372
|
index: t
|
|
2356
2373
|
}))), C = i(() => {
|
|
2357
|
-
let e = l.value +
|
|
2374
|
+
let e = l.value + $ * 2, t = d.value ?? 0;
|
|
2358
2375
|
return Math.max(e, t, r.value) + cr;
|
|
2359
2376
|
}), w = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), E = i(() => e.items.value.length > 0 ? `${v.value + 1} / ${e.items.value.length}` : "0 / 0"), D = i(() => Math.max(0, r.value - ur * 2)), O = i(() => C.value > r.value + 1 && D.value > 0), k = i(() => {
|
|
2360
2377
|
if (!O.value) return 0;
|
|
@@ -2364,7 +2381,7 @@ function mr(e) {
|
|
|
2364
2381
|
if (!O.value) return ur;
|
|
2365
2382
|
let e = Math.max(0, C.value - r.value);
|
|
2366
2383
|
return ur + Math.max(0, D.value - k.value) * (e > 0 ? hr(n.value / e, 0, 1) : 0);
|
|
2367
|
-
}), j =
|
|
2384
|
+
}), j = qn({
|
|
2368
2385
|
items: e.items,
|
|
2369
2386
|
visibleIndices: y,
|
|
2370
2387
|
positions: o,
|
|
@@ -2373,22 +2390,22 @@ function mr(e) {
|
|
|
2373
2390
|
columnWidth: _,
|
|
2374
2391
|
scrollTop: n,
|
|
2375
2392
|
viewportHeight: r
|
|
2376
|
-
}), M =
|
|
2393
|
+
}), M = nr({
|
|
2377
2394
|
direction: "top",
|
|
2378
2395
|
getAnimationLockMs(e) {
|
|
2379
|
-
return Math.max(fr,
|
|
2396
|
+
return Math.max(fr, Wn(e)) + pr;
|
|
2380
2397
|
},
|
|
2381
2398
|
hasPage: e.hasPreviousPage,
|
|
2382
2399
|
interactionLocked: p,
|
|
2383
2400
|
isAtBoundary() {
|
|
2384
|
-
return n.value <=
|
|
2401
|
+
return n.value <= $ + ir;
|
|
2385
2402
|
},
|
|
2386
2403
|
loading: e.loading,
|
|
2387
2404
|
requestPage: e.requestPreviousPage
|
|
2388
|
-
}), N =
|
|
2405
|
+
}), N = nr({
|
|
2389
2406
|
direction: "bottom",
|
|
2390
2407
|
getAnimationLockMs(e) {
|
|
2391
|
-
return
|
|
2408
|
+
return Wn(e) + pr;
|
|
2392
2409
|
},
|
|
2393
2410
|
hasPage: w,
|
|
2394
2411
|
interactionLocked: p,
|
|
@@ -2403,8 +2420,8 @@ function mr(e) {
|
|
|
2403
2420
|
h,
|
|
2404
2421
|
_
|
|
2405
2422
|
], async ([t], [r = []]) => {
|
|
2406
|
-
let i = t.map((e) =>
|
|
2407
|
-
let t =
|
|
2423
|
+
let i = t.map((e) => Q(e)), a = r ?? [], s = a.map((e) => Q(e)), c = Fn(a, u.value, o.value), l = oe(a), d = new Set(s), f = new Set(i), p = t.filter((e) => !d.has(Q(e))), m = a.flatMap((e) => {
|
|
2424
|
+
let t = Q(e);
|
|
2408
2425
|
if (f.has(t)) return [];
|
|
2409
2426
|
let n = c.get(t), r = l.get(t);
|
|
2410
2427
|
return !n || r == null ? [] : [{
|
|
@@ -2412,15 +2429,15 @@ function mr(e) {
|
|
|
2412
2429
|
item: e,
|
|
2413
2430
|
position: n
|
|
2414
2431
|
}];
|
|
2415
|
-
}), h = i.length > s.length && s.length > 0 && i[0] !== s[0], _ = t.length === 0 && a.length > 0 && m.length > 0 && n.value > 0, y = h && n.value >
|
|
2416
|
-
_ && (
|
|
2432
|
+
}), h = i.length > s.length && s.length > 0 && i[0] !== s[0], _ = t.length === 0 && a.length > 0 && m.length > 0 && n.value > 0, y = h && n.value > $ + ir ? t[v.value] : null, b = y ? Q(y) : null;
|
|
2433
|
+
_ && (K(Gn()), G()), B(), m.length > 0 && j.markLeave(m), p.length > 0 && (j.markEnter(p, h ? "top" : "bottom"), h ? M.onItemsMutated(p.length) : N.onItemsMutated(p.length)), j.playFlipMoveAnimation(c, new Set(p.map((e) => Q(e))), h ? fr : void 0), b ? (await g(), ee(b, c)) : e.active.value && s.length > 0 && J();
|
|
2417
2434
|
}, { immediate: !0 }), F([
|
|
2418
|
-
() => e.pendingAppendItems.value.map((e) =>
|
|
2435
|
+
() => e.pendingAppendItems.value.map((e) => Q(e)),
|
|
2419
2436
|
h,
|
|
2420
2437
|
_,
|
|
2421
2438
|
r
|
|
2422
2439
|
], ([t]) => {
|
|
2423
|
-
|
|
2440
|
+
ce(), t.length && (d.value = ae([...e.items.value, ...e.pendingAppendItems.value]), se());
|
|
2424
2441
|
}, { immediate: !0 }), F(() => e.active.value, async (e, i) => {
|
|
2425
2442
|
let a = t.value;
|
|
2426
2443
|
if (!a) return;
|
|
@@ -2435,35 +2452,35 @@ function mr(e) {
|
|
|
2435
2452
|
}), F(() => e.loading.value, async (t) => {
|
|
2436
2453
|
!t && !e.pendingAppendItems.value.length && !L && !z && (d.value = null), M.onLoadingChange(t), N.onLoadingChange(t), await g();
|
|
2437
2454
|
}), x(async () => {
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
}), t.value && P.observe(t.value)) : window.addEventListener("resize",
|
|
2455
|
+
X(), await g(), v.value > 0 ? W(v.value, "center") : q(), M.syncBoundary(), N.syncBoundary(), typeof ResizeObserver < "u" ? (P = new ResizeObserver(() => {
|
|
2456
|
+
X();
|
|
2457
|
+
}), t.value && P.observe(t.value)) : window.addEventListener("resize", X);
|
|
2441
2458
|
}), b(() => {
|
|
2442
|
-
P?.disconnect(), P = null, window.removeEventListener("resize",
|
|
2459
|
+
P?.disconnect(), P = null, window.removeEventListener("resize", X), ce(), le(), I &&= (cancelAnimationFrame(I), 0);
|
|
2443
2460
|
});
|
|
2444
2461
|
function B() {
|
|
2445
|
-
let t =
|
|
2462
|
+
let t = Nn(e.items.value, {
|
|
2446
2463
|
columnCount: h.value,
|
|
2447
2464
|
columnWidth: _.value,
|
|
2448
2465
|
gapX: ir,
|
|
2449
2466
|
gapY: ir,
|
|
2450
|
-
bucketPx:
|
|
2467
|
+
bucketPx: rr
|
|
2451
2468
|
});
|
|
2452
2469
|
o.value = t.positions.map((e) => ({
|
|
2453
|
-
x: e.x +
|
|
2454
|
-
y: e.y +
|
|
2470
|
+
x: e.x + $,
|
|
2471
|
+
y: e.y + $
|
|
2455
2472
|
})), s.value = t.heights, c.value = t.buckets, l.value = t.contentHeight, u.value = t.indexById;
|
|
2456
2473
|
}
|
|
2457
2474
|
function V() {
|
|
2458
|
-
e.active.value && (n.value = t.value?.scrollTop ?? 0, r.value = te(), M.syncBoundary(), N.syncBoundary(),
|
|
2459
|
-
I = 0,
|
|
2475
|
+
e.active.value && (n.value = t.value?.scrollTop ?? 0, r.value = te(), M.syncBoundary(), N.syncBoundary(), Y(), !J() && (I ||= requestAnimationFrame(() => {
|
|
2476
|
+
I = 0, q();
|
|
2460
2477
|
})));
|
|
2461
2478
|
}
|
|
2462
2479
|
function H(t) {
|
|
2463
|
-
e.active.value && (M.onWheel(t), N.onWheel(t),
|
|
2480
|
+
e.active.value && (M.onWheel(t), N.onWheel(t), Y());
|
|
2464
2481
|
}
|
|
2465
2482
|
function U(t) {
|
|
2466
|
-
let n = e.items.value[t], r = n ?
|
|
2483
|
+
let n = e.items.value[t], r = n ? Q(n) : "";
|
|
2467
2484
|
return {
|
|
2468
2485
|
height: `${s.value[t] ?? _.value}px`,
|
|
2469
2486
|
width: `${_.value}px`,
|
|
@@ -2476,15 +2493,15 @@ function mr(e) {
|
|
|
2476
2493
|
let a = t.value, c = o.value[e], l = s.value[e];
|
|
2477
2494
|
if (!a || !c || !l) return;
|
|
2478
2495
|
let u = a.scrollTop, d = Math.max(0, C.value - r.value);
|
|
2479
|
-
i === "center" ? u = c.y - (r.value - l) / 2 : c.y < a.scrollTop ? u = c.y -
|
|
2496
|
+
i === "center" ? u = c.y - (r.value - l) / 2 : c.y < a.scrollTop ? u = c.y - $ : c.y + l > a.scrollTop + r.value && (u = c.y + l - r.value + $), a.scrollTop = hr(u, 0, d), n.value = a.scrollTop, q();
|
|
2480
2497
|
}
|
|
2481
|
-
function
|
|
2498
|
+
function ee(e, r) {
|
|
2482
2499
|
let i = t.value, a = r.get(e), s = u.value.get(e), c = s == null ? null : o.value[s];
|
|
2483
2500
|
if (!i || !a || !c) return;
|
|
2484
2501
|
let l = c.y - a.y;
|
|
2485
2502
|
i.scrollTop += l, n.value = i.scrollTop;
|
|
2486
2503
|
}
|
|
2487
|
-
function
|
|
2504
|
+
function G() {
|
|
2488
2505
|
let e = t.value;
|
|
2489
2506
|
if (!e) {
|
|
2490
2507
|
n.value = 0;
|
|
@@ -2492,13 +2509,13 @@ function mr(e) {
|
|
|
2492
2509
|
}
|
|
2493
2510
|
e.scrollTop = 0, n.value = 0, M.syncBoundary(), N.syncBoundary();
|
|
2494
2511
|
}
|
|
2495
|
-
function
|
|
2496
|
-
|
|
2512
|
+
function K(e) {
|
|
2513
|
+
le(), p.value = !0, R = setTimeout(() => {
|
|
2497
2514
|
R = null, p.value = !1;
|
|
2498
2515
|
}, Math.max(0, e));
|
|
2499
2516
|
}
|
|
2500
|
-
function
|
|
2501
|
-
if (!y.value.length ||
|
|
2517
|
+
function q() {
|
|
2518
|
+
if (!y.value.length || J()) return;
|
|
2502
2519
|
let t = n.value + r.value / 2, i = v.value, a = Infinity;
|
|
2503
2520
|
for (let e of y.value) {
|
|
2504
2521
|
let n = o.value[e], r = s.value[e];
|
|
@@ -2508,48 +2525,48 @@ function mr(e) {
|
|
|
2508
2525
|
}
|
|
2509
2526
|
e.setActiveIndex(i);
|
|
2510
2527
|
}
|
|
2511
|
-
function
|
|
2512
|
-
let t = n.value <=
|
|
2528
|
+
function J() {
|
|
2529
|
+
let t = n.value <= $ + ir, r = re() <= sr;
|
|
2513
2530
|
return t ? (e.setActiveIndex(0), !0) : r ? (e.setActiveIndex(Math.max(0, e.items.value.length - 1)), !0) : !1;
|
|
2514
2531
|
}
|
|
2515
|
-
function
|
|
2532
|
+
function Y() {
|
|
2516
2533
|
M.maybeRequestPage(), N.maybeRequestPage();
|
|
2517
2534
|
}
|
|
2518
|
-
function
|
|
2535
|
+
function X() {
|
|
2519
2536
|
r.value = te(), a.value = ne();
|
|
2520
2537
|
}
|
|
2521
2538
|
function te() {
|
|
2522
|
-
return
|
|
2539
|
+
return Xn(t.value, r.value);
|
|
2523
2540
|
}
|
|
2524
2541
|
function ne() {
|
|
2525
|
-
return
|
|
2542
|
+
return Zn(t.value, a.value, ar);
|
|
2526
2543
|
}
|
|
2527
2544
|
function re() {
|
|
2528
|
-
return
|
|
2545
|
+
return Qn(t.value, n.value, r.value, C.value);
|
|
2529
2546
|
}
|
|
2530
2547
|
function ie() {
|
|
2531
|
-
return
|
|
2548
|
+
return $n(k.value, A.value);
|
|
2532
2549
|
}
|
|
2533
2550
|
function ae(e) {
|
|
2534
|
-
return e.length ?
|
|
2551
|
+
return e.length ? Nn(e, {
|
|
2535
2552
|
columnCount: h.value,
|
|
2536
2553
|
columnWidth: _.value,
|
|
2537
2554
|
gapX: ir,
|
|
2538
2555
|
gapY: ir,
|
|
2539
|
-
bucketPx:
|
|
2540
|
-
}).contentHeight +
|
|
2556
|
+
bucketPx: rr
|
|
2557
|
+
}).contentHeight + $ * 2 : 0;
|
|
2541
2558
|
}
|
|
2542
2559
|
function oe(e) {
|
|
2543
2560
|
let t = /* @__PURE__ */ new Map();
|
|
2544
2561
|
for (let n of e) {
|
|
2545
|
-
let e =
|
|
2562
|
+
let e = Q(n), r = u.value.get(e);
|
|
2546
2563
|
if (r == null) continue;
|
|
2547
2564
|
let i = s.value[r];
|
|
2548
2565
|
i != null && t.set(e, i);
|
|
2549
2566
|
}
|
|
2550
2567
|
return t;
|
|
2551
2568
|
}
|
|
2552
|
-
function
|
|
2569
|
+
function se() {
|
|
2553
2570
|
let t = e.commitPendingAppend.value;
|
|
2554
2571
|
typeof t == "function" && (L = setTimeout(async () => {
|
|
2555
2572
|
L = null, z = !0;
|
|
@@ -2561,10 +2578,10 @@ function mr(e) {
|
|
|
2561
2578
|
}
|
|
2562
2579
|
}, lr));
|
|
2563
2580
|
}
|
|
2564
|
-
function
|
|
2581
|
+
function ce() {
|
|
2565
2582
|
L &&= (clearTimeout(L), null);
|
|
2566
2583
|
}
|
|
2567
|
-
function
|
|
2584
|
+
function le() {
|
|
2568
2585
|
R && (clearTimeout(R), R = null, p.value = !1);
|
|
2569
2586
|
}
|
|
2570
2587
|
return {
|
|
@@ -2622,7 +2639,7 @@ function yr(e) {
|
|
|
2622
2639
|
//#region src/components/viewer-core/listPreview.ts
|
|
2623
2640
|
var br = /\.(avif|gif|jpe?g|png|svg|webp)(\?|#|$)/i, xr = /\.(m4v|mov|mp4|mpeg|ogg|ogv|webm)(\?|#|$)/i;
|
|
2624
2641
|
function Sr(e) {
|
|
2625
|
-
let t = e.preview?.url ?? e.url, n =
|
|
2642
|
+
let t = e.preview?.url ?? e.url, n = kn(e), r = e.title?.trim() || pt(e.type);
|
|
2626
2643
|
return e.type !== "image" && e.type !== "video" ? {
|
|
2627
2644
|
kind: "fallback",
|
|
2628
2645
|
url: null,
|
|
@@ -2759,73 +2776,73 @@ var jr = ["aria-label"], Mr = {
|
|
|
2759
2776
|
},
|
|
2760
2777
|
emits: ["open"],
|
|
2761
2778
|
setup(e, { emit: t }) {
|
|
2762
|
-
let n = e, r = t, l = i(() => Sr(n.item)), d = T(!1), f = T(!1), p = T(!1), m = T(l.value.kind === "fallback"), h = T(null), g = T(null), v = T(null), y = T(null), C = T(null), w = T(l.value.kind === "fallback"), E = i(() => w.value ? n.surfaceActive ? d.value ? l.value.url : null : l.value.url : null), A = i(() => n.surfaceActive && d.value && (l.value.kind === "image" || l.value.kind === "video") && !!l.value.url), M = i(() => l.value.kind === "image" && !!E.value), N = i(() => l.value.kind === "video" && !!E.value), P = i(() => !!h.value), I = i(() =>
|
|
2779
|
+
let n = e, r = t, l = i(() => Sr(n.item)), d = T(!1), f = T(!1), p = T(!1), m = T(l.value.kind === "fallback"), h = T(null), g = T(null), v = T(null), y = T(null), C = T(null), w = T(l.value.kind === "fallback"), E = i(() => w.value ? n.surfaceActive ? d.value ? l.value.url : null : l.value.url : null), A = i(() => n.surfaceActive && d.value && (l.value.kind === "image" || l.value.kind === "video") && !!l.value.url), M = i(() => l.value.kind === "image" && !!E.value), N = i(() => l.value.kind === "video" && !!E.value), P = i(() => !!h.value), I = i(() => jt(h.value)), L = i(() => A.value && !h.value && (!w.value || !m.value)), R = null, B = null, V = /* @__PURE__ */ new Set();
|
|
2763
2780
|
F([E, () => l.value.kind], () => {
|
|
2764
2781
|
let e = l.value.kind === "fallback";
|
|
2765
2782
|
m.value = e, h.value = null, e && (w.value = !0);
|
|
2766
2783
|
}), F(A, () => {
|
|
2767
|
-
|
|
2784
|
+
G();
|
|
2768
2785
|
}), F([
|
|
2769
2786
|
d,
|
|
2770
2787
|
m,
|
|
2771
2788
|
E
|
|
2772
2789
|
], () => {
|
|
2773
|
-
|
|
2790
|
+
K();
|
|
2774
2791
|
}), F(() => n.surfaceActive, (e) => {
|
|
2775
2792
|
if (!e) {
|
|
2776
|
-
|
|
2793
|
+
J(), K();
|
|
2777
2794
|
return;
|
|
2778
2795
|
}
|
|
2779
2796
|
requestAnimationFrame(() => {
|
|
2780
|
-
|
|
2797
|
+
Y(), G(), K();
|
|
2781
2798
|
});
|
|
2782
2799
|
}), x(() => {
|
|
2783
2800
|
if (!v.value || typeof IntersectionObserver > "u") {
|
|
2784
|
-
y.value = null, d.value = !0,
|
|
2801
|
+
y.value = null, d.value = !0, G();
|
|
2785
2802
|
return;
|
|
2786
2803
|
}
|
|
2787
2804
|
y.value = v.value.closest("[data-testid=\"vibe-list-scroll\"]"), R = new IntersectionObserver((e) => {
|
|
2788
|
-
for (let t of e) t.target === v.value && (n.surfaceActive &&
|
|
2805
|
+
for (let t of e) t.target === v.value && (n.surfaceActive && Y(t), G(), K());
|
|
2789
2806
|
}, {
|
|
2790
2807
|
root: y.value,
|
|
2791
2808
|
threshold: [0, 1]
|
|
2792
2809
|
}), R.observe(v.value);
|
|
2793
2810
|
}), b(() => {
|
|
2794
|
-
|
|
2811
|
+
q(), R?.disconnect(), R = null;
|
|
2795
2812
|
});
|
|
2796
2813
|
function H() {
|
|
2797
|
-
|
|
2814
|
+
se(g.value) && (m.value = !0, h.value = null, X(E.value ?? n.item.url), J());
|
|
2798
2815
|
}
|
|
2799
2816
|
async function U() {
|
|
2800
|
-
if (!
|
|
2817
|
+
if (!se(g.value)) return;
|
|
2801
2818
|
let e = E.value ?? n.item.url;
|
|
2802
2819
|
m.value = !1, h.value = "generic";
|
|
2803
|
-
let t = await
|
|
2820
|
+
let t = await Mt(e);
|
|
2804
2821
|
h.value = t, n.reportAssetError?.({
|
|
2805
2822
|
item: n.item,
|
|
2806
|
-
occurrenceKey:
|
|
2823
|
+
occurrenceKey: Q(n.item),
|
|
2807
2824
|
url: e,
|
|
2808
2825
|
kind: t,
|
|
2809
2826
|
surface: "grid"
|
|
2810
|
-
}),
|
|
2827
|
+
}), J();
|
|
2811
2828
|
}
|
|
2812
2829
|
function W() {
|
|
2813
|
-
|
|
2830
|
+
se(C.value) && (m.value = !0, h.value = null, X(E.value ?? n.item.url), J(), K());
|
|
2814
2831
|
}
|
|
2815
|
-
function
|
|
2816
|
-
|
|
2832
|
+
function ee() {
|
|
2833
|
+
se(C.value) && (m.value = !1);
|
|
2817
2834
|
}
|
|
2818
|
-
function
|
|
2835
|
+
function G() {
|
|
2819
2836
|
if (l.value.kind === "fallback") {
|
|
2820
|
-
|
|
2837
|
+
q(!1);
|
|
2821
2838
|
return;
|
|
2822
2839
|
}
|
|
2823
2840
|
if (!n.surfaceActive) {
|
|
2824
|
-
|
|
2841
|
+
J();
|
|
2825
2842
|
return;
|
|
2826
2843
|
}
|
|
2827
2844
|
if (!A.value) {
|
|
2828
|
-
|
|
2845
|
+
q();
|
|
2829
2846
|
return;
|
|
2830
2847
|
}
|
|
2831
2848
|
if (w.value || B) {
|
|
@@ -2841,7 +2858,7 @@ var jr = ["aria-label"], Mr = {
|
|
|
2841
2858
|
url: l.value.url ?? n.item.url
|
|
2842
2859
|
});
|
|
2843
2860
|
}
|
|
2844
|
-
function
|
|
2861
|
+
function K() {
|
|
2845
2862
|
let e = C.value;
|
|
2846
2863
|
if (!(!e || l.value.kind !== "video")) {
|
|
2847
2864
|
if (h.value) {
|
|
@@ -2849,7 +2866,7 @@ var jr = ["aria-label"], Mr = {
|
|
|
2849
2866
|
return;
|
|
2850
2867
|
}
|
|
2851
2868
|
if (E.value && d.value && m.value) {
|
|
2852
|
-
e.muted = !0, e.loop = !0, e.playsInline = !0,
|
|
2869
|
+
e.muted = !0, e.loop = !0, e.playsInline = !0, Ft(e);
|
|
2853
2870
|
return;
|
|
2854
2871
|
}
|
|
2855
2872
|
try {
|
|
@@ -2858,13 +2875,13 @@ var jr = ["aria-label"], Mr = {
|
|
|
2858
2875
|
e.pause();
|
|
2859
2876
|
}
|
|
2860
2877
|
}
|
|
2861
|
-
function
|
|
2862
|
-
w.value = l.value.kind === "fallback", h.value = null, m.value = l.value.kind === "fallback", e && (ne(), ie()),
|
|
2878
|
+
function q(e = !0) {
|
|
2879
|
+
w.value = l.value.kind === "fallback", h.value = null, m.value = l.value.kind === "fallback", e && (ne(), ie()), J();
|
|
2863
2880
|
}
|
|
2864
|
-
function
|
|
2881
|
+
function J() {
|
|
2865
2882
|
B?.release(), B = null;
|
|
2866
2883
|
}
|
|
2867
|
-
function
|
|
2884
|
+
function Y(e) {
|
|
2868
2885
|
let t = v.value;
|
|
2869
2886
|
if (!t) {
|
|
2870
2887
|
d.value = !0;
|
|
@@ -2872,9 +2889,9 @@ var jr = ["aria-label"], Mr = {
|
|
|
2872
2889
|
}
|
|
2873
2890
|
d.value = vr(e?.boundingClientRect ?? t.getBoundingClientRect(), e?.rootBounds ?? y.value?.getBoundingClientRect() ?? null);
|
|
2874
2891
|
}
|
|
2875
|
-
function
|
|
2892
|
+
function X(e) {
|
|
2876
2893
|
if (!e) return;
|
|
2877
|
-
let t =
|
|
2894
|
+
let t = Q(n.item), r = `${t}|${e}`;
|
|
2878
2895
|
V.has(r) || (V.add(r), n.reportAssetLoad?.({
|
|
2879
2896
|
item: n.item,
|
|
2880
2897
|
occurrenceKey: t,
|
|
@@ -2884,10 +2901,10 @@ var jr = ["aria-label"], Mr = {
|
|
|
2884
2901
|
}
|
|
2885
2902
|
function te() {
|
|
2886
2903
|
if (!I.value) return;
|
|
2887
|
-
let e =
|
|
2904
|
+
let e = Q(n.item);
|
|
2888
2905
|
V.forEach((t) => {
|
|
2889
2906
|
t.startsWith(`${e}|`) && V.delete(t);
|
|
2890
|
-
}), h.value = null, m.value = !1, w.value = !1,
|
|
2907
|
+
}), h.value = null, m.value = !1, w.value = !1, J(), G();
|
|
2891
2908
|
}
|
|
2892
2909
|
function ne() {
|
|
2893
2910
|
gr(g.value);
|
|
@@ -2906,17 +2923,17 @@ var jr = ["aria-label"], Mr = {
|
|
|
2906
2923
|
let n = window.innerHeight / 2;
|
|
2907
2924
|
return Math.abs((t.top + t.bottom) / 2 - n);
|
|
2908
2925
|
}
|
|
2909
|
-
function
|
|
2926
|
+
function se(e) {
|
|
2910
2927
|
let t = yr(E.value);
|
|
2911
2928
|
return !e || !t ? !1 : yr("currentSrc" in e && e.currentSrc || e.getAttribute("src")) === t;
|
|
2912
2929
|
}
|
|
2913
|
-
function
|
|
2930
|
+
function ce() {
|
|
2914
2931
|
r("open");
|
|
2915
2932
|
}
|
|
2916
|
-
function
|
|
2933
|
+
function le() {
|
|
2917
2934
|
f.value = !0;
|
|
2918
2935
|
}
|
|
2919
|
-
function
|
|
2936
|
+
function ue(e) {
|
|
2920
2937
|
let t = e.relatedTarget;
|
|
2921
2938
|
v.value && t instanceof Node && v.value.contains(t) || (f.value = !1);
|
|
2922
2939
|
}
|
|
@@ -2925,8 +2942,8 @@ var jr = ["aria-label"], Mr = {
|
|
|
2925
2942
|
ref: v,
|
|
2926
2943
|
"data-testid": "vibe-list-card-inner",
|
|
2927
2944
|
class: _(["group relative h-full w-full overflow-hidden border bg-[#0a0b0f] text-[#f7f1ea] transition-[border-color,transform] duration-300", n.active ? "border-white/28" : "border-white/12 hover:border-white/24"]),
|
|
2928
|
-
onFocusin:
|
|
2929
|
-
onFocusout:
|
|
2945
|
+
onFocusin: le,
|
|
2946
|
+
onFocusout: ue,
|
|
2930
2947
|
onPointerenter: t[0] ||= (e) => p.value = !0,
|
|
2931
2948
|
onPointerleave: t[1] ||= (e) => p.value = !1
|
|
2932
2949
|
}, [
|
|
@@ -2935,7 +2952,7 @@ var jr = ["aria-label"], Mr = {
|
|
|
2935
2952
|
"data-testid": "vibe-list-card-open",
|
|
2936
2953
|
class: "absolute inset-0 z-[1] block h-full w-full cursor-pointer text-left focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-[#f7f1ea]",
|
|
2937
2954
|
"aria-label": n.item.title || `Open item ${n.index + 1}`,
|
|
2938
|
-
onClick:
|
|
2955
|
+
onClick: ce
|
|
2939
2956
|
}, null, 8, jr),
|
|
2940
2957
|
L.value ? (S(), s("div", Mr, [c("span", Nr, [u(j(re), {
|
|
2941
2958
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
@@ -2963,10 +2980,10 @@ var jr = ["aria-label"], Mr = {
|
|
|
2963
2980
|
class: _(["block h-full w-full object-cover transition-opacity duration-300", m.value ? "pointer-events-none opacity-100" : "pointer-events-none opacity-0"]),
|
|
2964
2981
|
onCanplay: W,
|
|
2965
2982
|
onError: U,
|
|
2966
|
-
onLoadstart:
|
|
2983
|
+
onLoadstart: ee,
|
|
2967
2984
|
onPlaying: W,
|
|
2968
|
-
onStalled:
|
|
2969
|
-
onWaiting:
|
|
2985
|
+
onStalled: ee,
|
|
2986
|
+
onWaiting: ee
|
|
2970
2987
|
}, null, 42, Fr)) : P.value ? (S(), s("div", {
|
|
2971
2988
|
key: 3,
|
|
2972
2989
|
"data-testid": "vibe-list-card-error",
|
|
@@ -2977,7 +2994,7 @@ var jr = ["aria-label"], Mr = {
|
|
|
2977
2994
|
class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
|
|
2978
2995
|
"aria-hidden": "true"
|
|
2979
2996
|
}),
|
|
2980
|
-
c("span", Rr, k(j(
|
|
2997
|
+
c("span", Rr, k(j(At)(h.value)), 1),
|
|
2981
2998
|
I.value ? (S(), s("button", {
|
|
2982
2999
|
key: 0,
|
|
2983
3000
|
type: "button",
|
|
@@ -2985,9 +3002,9 @@ var jr = ["aria-label"], Mr = {
|
|
|
2985
3002
|
onClick: z(te, ["stop"])
|
|
2986
3003
|
}, " Retry ")) : o("", !0)
|
|
2987
3004
|
])], 8, Ir)) : (S(), s("div", zr, [c("div", Br, [D(e.$slots, "item-icon", {
|
|
2988
|
-
icon: j(
|
|
3005
|
+
icon: j(ft)(n.item.type),
|
|
2989
3006
|
item: n.item
|
|
2990
|
-
}, () => [(S(), a(O(j(
|
|
3007
|
+
}, () => [(S(), a(O(j(ft)(n.item.type)), {
|
|
2991
3008
|
class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
|
|
2992
3009
|
"aria-hidden": "true"
|
|
2993
3010
|
}))])])])),
|
|
@@ -2997,7 +3014,7 @@ var jr = ["aria-label"], Mr = {
|
|
|
2997
3014
|
hovered: p.value,
|
|
2998
3015
|
index: n.index,
|
|
2999
3016
|
item: n.item,
|
|
3000
|
-
openFullscreen:
|
|
3017
|
+
openFullscreen: ce
|
|
3001
3018
|
})])
|
|
3002
3019
|
], 34));
|
|
3003
3020
|
}
|
|
@@ -3091,11 +3108,11 @@ var jr = ["aria-label"], Mr = {
|
|
|
3091
3108
|
setActiveIndex(e) {
|
|
3092
3109
|
f("update:activeIndex", e);
|
|
3093
3110
|
}
|
|
3094
|
-
}), m = i(() =>
|
|
3111
|
+
}), m = i(() => xt({
|
|
3095
3112
|
itemCount: r.items.length,
|
|
3096
3113
|
loading: r.loading,
|
|
3097
3114
|
phase: r.phase
|
|
3098
|
-
})), g = i(() =>
|
|
3115
|
+
})), g = i(() => St({
|
|
3099
3116
|
errorMessage: r.errorMessage,
|
|
3100
3117
|
hasItems: r.items.length > 0,
|
|
3101
3118
|
hasNextPage: r.hasNextPage,
|
|
@@ -3108,7 +3125,7 @@ var jr = ["aria-label"], Mr = {
|
|
|
3108
3125
|
message: g.value.message,
|
|
3109
3126
|
paginationDetail: r.paginationDetail,
|
|
3110
3127
|
total: r.items.length
|
|
3111
|
-
}), x = i(() => !b.value || !d["grid-status"] ? [] : d["grid-status"](b.value)), C = i(() =>
|
|
3128
|
+
}), x = i(() => !b.value || !d["grid-status"] ? [] : d["grid-status"](b.value)), C = i(() => gt(x.value)), w = i(() => r.items.length + p.leavingItems.value.length), { emptyStateProps: T, showBadgeEmptyState: O, showCustomEmptyState: M, showInlineEmptyState: P } = yt({
|
|
3112
3129
|
emptyStateMode: A(r, "emptyStateMode"),
|
|
3113
3130
|
itemCount: w,
|
|
3114
3131
|
loading: A(r, "loading"),
|
|
@@ -3129,12 +3146,12 @@ var jr = ["aria-label"], Mr = {
|
|
|
3129
3146
|
style: y({ height: `${j(p).containerHeight.value}px` })
|
|
3130
3147
|
}, [
|
|
3131
3148
|
(S(!0), s(t, null, E(j(p).renderedItems.value, ({ item: t, index: n }) => (S(), s("article", {
|
|
3132
|
-
key: j(
|
|
3149
|
+
key: j(Q)(t),
|
|
3133
3150
|
"data-testid": "vibe-list-card",
|
|
3134
3151
|
"data-active": n === j(p).resolvedActiveIndex.value ? "true" : "false",
|
|
3135
3152
|
"data-index": n,
|
|
3136
3153
|
"data-item-id": t.id,
|
|
3137
|
-
"data-occurrence-key": j(
|
|
3154
|
+
"data-occurrence-key": j(Q)(t),
|
|
3138
3155
|
class: "absolute will-change-transform",
|
|
3139
3156
|
style: y(j(p).getCardStyle(n))
|
|
3140
3157
|
}, [u(Hr, {
|
|
@@ -3163,7 +3180,7 @@ var jr = ["aria-label"], Mr = {
|
|
|
3163
3180
|
"onOpen"
|
|
3164
3181
|
])], 12, Jr))), 128)),
|
|
3165
3182
|
(S(!0), s(t, null, E(j(p).leavingItems.value, (t) => (S(), s("article", {
|
|
3166
|
-
key: `leaving-${j(
|
|
3183
|
+
key: `leaving-${j(Q)(t.item)}`,
|
|
3167
3184
|
"data-testid": "vibe-list-card-leaving",
|
|
3168
3185
|
"data-item-id": t.item.id,
|
|
3169
3186
|
class: "pointer-events-none absolute z-[2] will-change-[opacity,transform]",
|
|
@@ -3184,7 +3201,7 @@ var jr = ["aria-label"], Mr = {
|
|
|
3184
3201
|
"report-asset-error",
|
|
3185
3202
|
"report-asset-load"
|
|
3186
3203
|
])], 12, Yr))), 128)),
|
|
3187
|
-
j(P) && j(T) ? (S(), a(
|
|
3204
|
+
j(P) && j(T) ? (S(), a(Jt, {
|
|
3188
3205
|
key: 0,
|
|
3189
3206
|
message: j(T).message,
|
|
3190
3207
|
mode: j(T).mode,
|
|
@@ -3212,7 +3229,7 @@ var jr = ["aria-label"], Mr = {
|
|
|
3212
3229
|
"data-testid": "vibe-grid-status-badge",
|
|
3213
3230
|
class: _(["inline-flex items-center border border-white/14 bg-black/55 px-4 py-3 text-[0.7rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/72 backdrop-blur-[18px]", b.value.kind === "end" ? "border-amber-300/35 text-amber-200" : b.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
|
|
3214
3231
|
}, k(b.value.message), 3))], 2)) : o("", !0),
|
|
3215
|
-
j(O) && j(T) ? (S(), a(
|
|
3232
|
+
j(O) && j(T) ? (S(), a(Jt, {
|
|
3216
3233
|
key: 3,
|
|
3217
3234
|
class: _(["z-[3]", d["grid-footer"] ? "pb-24" : "pb-6"]),
|
|
3218
3235
|
message: j(T).message,
|
|
@@ -3259,9 +3276,9 @@ var jr = ["aria-label"], Mr = {
|
|
|
3259
3276
|
"update:surfaceMode"
|
|
3260
3277
|
],
|
|
3261
3278
|
setup(e, { expose: n, emit: i }) {
|
|
3262
|
-
let d = e, p = N(), m = i, h =
|
|
3279
|
+
let d = e, p = N(), m = i, h = Ge(d, m), g = se((e) => {
|
|
3263
3280
|
m("asset-errors", e);
|
|
3264
|
-
}), _ =
|
|
3281
|
+
}), _ = ce((e) => {
|
|
3265
3282
|
m("asset-loads", e);
|
|
3266
3283
|
});
|
|
3267
3284
|
return b(() => {
|
|
@@ -3270,13 +3287,15 @@ var jr = ["aria-label"], Mr = {
|
|
|
3270
3287
|
cancel: h.cancel,
|
|
3271
3288
|
clearRemoved: h.clearRemoved,
|
|
3272
3289
|
getRemovedIds: h.getRemovedIds,
|
|
3290
|
+
lockPageLoading: h.lockPageLoading,
|
|
3273
3291
|
loadNext: h.loadNext,
|
|
3274
3292
|
loadPrevious: h.loadPrevious,
|
|
3275
3293
|
remove: h.remove,
|
|
3276
3294
|
restore: h.restore,
|
|
3277
3295
|
retry: h.retry,
|
|
3278
3296
|
status: h.status,
|
|
3279
|
-
undo: h.undo
|
|
3297
|
+
undo: h.undo,
|
|
3298
|
+
unlockPageLoading: h.unlockPageLoading
|
|
3280
3299
|
}), (e, n) => (S(), s("section", {
|
|
3281
3300
|
"data-testid": "vibe",
|
|
3282
3301
|
"data-surface-mode": j(h).surfaceMode.value,
|
|
@@ -3384,7 +3403,7 @@ var jr = ["aria-label"], Mr = {
|
|
|
3384
3403
|
"data-visible": j(h).surfaceMode.value === "fullscreen" ? "true" : "false",
|
|
3385
3404
|
inert: j(h).surfaceMode.value !== "fullscreen",
|
|
3386
3405
|
class: "absolute inset-0 z-[3]"
|
|
3387
|
-
}, [u(
|
|
3406
|
+
}, [u(En, {
|
|
3388
3407
|
items: j(h).items.value,
|
|
3389
3408
|
active: j(h).surfaceMode.value === "fullscreen",
|
|
3390
3409
|
"active-index": j(h).activeIndex.value,
|
|
@@ -3454,7 +3473,7 @@ var jr = ["aria-label"], Mr = {
|
|
|
3454
3473
|
})], 64)) : j(h).items.value.length === 0 && j(h).loading.value ? (S(), s("div", ii, [u(j(re), {
|
|
3455
3474
|
class: "size-10 animate-spin text-[#f7f1ea]/82",
|
|
3456
3475
|
"aria-hidden": "true"
|
|
3457
|
-
}), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (S(), a(
|
|
3476
|
+
}), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (S(), a(En, {
|
|
3458
3477
|
key: 4,
|
|
3459
3478
|
items: j(h).items.value,
|
|
3460
3479
|
active: !0,
|