@wyxos/vibe 3.0.2 → 3.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -2
- package/lib/components/FullscreenSurface.vue.d.ts +1 -1
- package/lib/components/Layout.vue.d.ts +11 -1
- package/lib/components/ListCard.vue.d.ts +0 -3
- package/lib/components/ListSurface.vue.d.ts +2 -3
- package/lib/components/viewer-core/fillDelay.d.ts +2 -2
- package/lib/components/viewer-core/removalState.d.ts +1 -2
- package/lib/components/viewer-core/useAssetLoadQueue.d.ts +5 -6
- package/lib/components/viewer-core/useAutoResolveSource.d.ts +1 -0
- package/lib/components/viewer-core/useController.d.ts +5 -5
- package/lib/components/viewer-core/useDataSource.d.ts +2 -4
- package/lib/components/viewer-core/useMasonryList.d.ts +1 -0
- package/lib/components/viewer-core/useViewer.d.ts +1 -2
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +34 -2
- package/lib/index.js +835 -882
- package/package.json +1 -1
- package/lib/components/viewer-core/createFrameScheduler.d.ts +0 -4
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 R = (e) => {
|
|
4
4
|
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
|
|
5
5
|
return !1;
|
|
6
|
-
}, z = (e) => e === "", B = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), V = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(),
|
|
7
|
-
let t =
|
|
6
|
+
}, z = (e) => e === "", B = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), V = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), te = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), H = (e) => {
|
|
7
|
+
let t = te(e);
|
|
8
8
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
9
|
-
},
|
|
9
|
+
}, U = {
|
|
10
10
|
xmlns: "http://www.w3.org/2000/svg",
|
|
11
11
|
width: 24,
|
|
12
12
|
height: 24,
|
|
@@ -16,27 +16,27 @@ var R = (e) => {
|
|
|
16
16
|
"stroke-width": 2,
|
|
17
17
|
"stroke-linecap": "round",
|
|
18
18
|
"stroke-linejoin": "round"
|
|
19
|
-
},
|
|
20
|
-
...
|
|
19
|
+
}, W = ({ name: e, iconNode: t, absoluteStrokeWidth: n, "absolute-stroke-width": r, strokeWidth: i, "stroke-width": a, size: o = U.width, color: s = U.stroke, ...c }, { slots: l }) => p("svg", {
|
|
20
|
+
...U,
|
|
21
21
|
...c,
|
|
22
22
|
width: o,
|
|
23
23
|
height: o,
|
|
24
24
|
stroke: s,
|
|
25
|
-
"stroke-width": z(n) || z(r) || n === !0 || r === !0 ? Number(i || a ||
|
|
26
|
-
class: B("lucide", c.class, ...e ? [`lucide-${V(
|
|
25
|
+
"stroke-width": z(n) || z(r) || n === !0 || r === !0 ? Number(i || a || U["stroke-width"]) * 24 / Number(o) : i || a || U["stroke-width"],
|
|
26
|
+
class: B("lucide", c.class, ...e ? [`lucide-${V(H(e))}-icon`, `lucide-${V(e)}`] : ["lucide-icon"]),
|
|
27
27
|
...!l.default && !R(c) && { "aria-hidden": "true" }
|
|
28
|
-
}, [...t.map((e) => p(...e)), ...l.default ? [l.default()] : []]),
|
|
28
|
+
}, [...t.map((e) => p(...e)), ...l.default ? [l.default()] : []]), G = (e, t) => (n, { slots: r, attrs: i }) => p(W, {
|
|
29
29
|
...i,
|
|
30
30
|
...n,
|
|
31
31
|
iconNode: t,
|
|
32
32
|
name: e
|
|
33
|
-
}, r),
|
|
33
|
+
}, r), K = G("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
|
+
}]]), q = G("audio-lines", [
|
|
40
40
|
["path", {
|
|
41
41
|
d: "M2 10v3",
|
|
42
42
|
key: "1fnikh"
|
|
@@ -61,7 +61,7 @@ var R = (e) => {
|
|
|
61
61
|
d: "M22 10v3",
|
|
62
62
|
key: "154ddg"
|
|
63
63
|
}]
|
|
64
|
-
]),
|
|
64
|
+
]), J = G("clapperboard", [
|
|
65
65
|
["path", {
|
|
66
66
|
d: "m12.296 3.464 3.02 3.956",
|
|
67
67
|
key: "qash78"
|
|
@@ -78,13 +78,13 @@ var R = (e) => {
|
|
|
78
78
|
d: "m6.18 5.276 3.1 3.899",
|
|
79
79
|
key: "zjj9t3"
|
|
80
80
|
}]
|
|
81
|
-
]), Y =
|
|
81
|
+
]), Y = G("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
|
-
}]]),
|
|
87
|
+
}]]), ne = G("image-plus", [
|
|
88
88
|
["path", {
|
|
89
89
|
d: "M16 5h6",
|
|
90
90
|
key: "1vod17"
|
|
@@ -107,10 +107,10 @@ var R = (e) => {
|
|
|
107
107
|
r: "2",
|
|
108
108
|
key: "af1f0g"
|
|
109
109
|
}]
|
|
110
|
-
]),
|
|
110
|
+
]), re = G("loader-circle", [["path", {
|
|
111
111
|
d: "M21 12a9 9 0 1 1-6.219-8.56",
|
|
112
112
|
key: "13zald"
|
|
113
|
-
}]]),
|
|
113
|
+
}]]), ie = G("pause", [["rect", {
|
|
114
114
|
x: "14",
|
|
115
115
|
y: "3",
|
|
116
116
|
width: "5",
|
|
@@ -124,10 +124,10 @@ var R = (e) => {
|
|
|
124
124
|
height: "18",
|
|
125
125
|
rx: "1",
|
|
126
126
|
key: "1wsw3u"
|
|
127
|
-
}]]),
|
|
127
|
+
}]]), ae = G("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
|
-
}]]),
|
|
130
|
+
}]]), oe = G("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 R = (e) => {
|
|
|
141
141
|
key: "p32p05"
|
|
142
142
|
}]
|
|
143
143
|
]);
|
|
144
|
-
function
|
|
145
|
-
return
|
|
144
|
+
function se(e, t = 150) {
|
|
145
|
+
return ce(e, (e) => `${e.surface}|${e.occurrenceKey}|${e.url}|${e.kind}`, t);
|
|
146
146
|
}
|
|
147
|
-
function
|
|
148
|
-
return
|
|
147
|
+
function X(e, t = 150) {
|
|
148
|
+
return ce(e, (e) => `${e.surface}|${e.occurrenceKey}|${e.url}`, t);
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function ce(e, t, n) {
|
|
151
151
|
let r = [], i = /* @__PURE__ */ new Set(), a = null;
|
|
152
152
|
function o(e) {
|
|
153
153
|
let o = t(e);
|
|
@@ -170,142 +170,58 @@ function se(e, t, n) {
|
|
|
170
170
|
};
|
|
171
171
|
}
|
|
172
172
|
//#endregion
|
|
173
|
-
//#region src/components/viewer-core/useAssetLoadQueue.ts
|
|
174
|
-
var ce = {
|
|
175
|
-
maxGlobal: 10,
|
|
176
|
-
maxPerDomain: 4,
|
|
177
|
-
maxVideoPerDomain: 2
|
|
178
|
-
};
|
|
179
|
-
function le(e) {
|
|
180
|
-
return {
|
|
181
|
-
maxGlobal: e?.maxGlobal ?? ce.maxGlobal,
|
|
182
|
-
maxPerDomain: e?.maxPerDomain ?? ce.maxPerDomain,
|
|
183
|
-
maxVideoPerDomain: e?.maxVideoPerDomain ?? ce.maxVideoPerDomain
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
function Q(e) {
|
|
187
|
-
let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = le(e), i = 0;
|
|
188
|
-
function a(e) {
|
|
189
|
-
let r = {
|
|
190
|
-
...e,
|
|
191
|
-
domain: de(e.url),
|
|
192
|
-
enqueuedAt: i,
|
|
193
|
-
id: `vibe-asset-load-${i += 1}`
|
|
194
|
-
};
|
|
195
|
-
return n.set(r.id, r), o(), {
|
|
196
|
-
cancel() {
|
|
197
|
-
(n.delete(r.id) || t.delete(r.id)) && o();
|
|
198
|
-
},
|
|
199
|
-
refresh() {
|
|
200
|
-
o();
|
|
201
|
-
},
|
|
202
|
-
release() {
|
|
203
|
-
(t.delete(r.id) || n.delete(r.id)) && o();
|
|
204
|
-
}
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
function o() {
|
|
208
|
-
if (n.size === 0) return;
|
|
209
|
-
let e = [...n.values()].sort((e, t) => {
|
|
210
|
-
let n = ue(e) - ue(t);
|
|
211
|
-
return n === 0 ? e.enqueuedAt - t.enqueuedAt : n;
|
|
212
|
-
});
|
|
213
|
-
for (let i of e) {
|
|
214
|
-
if (t.size >= r.maxGlobal) return;
|
|
215
|
-
if (l(i)) {
|
|
216
|
-
n.delete(i.id), t.set(i.id, i);
|
|
217
|
-
try {
|
|
218
|
-
i.onGrant();
|
|
219
|
-
} catch {
|
|
220
|
-
t.delete(i.id);
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
function s() {
|
|
226
|
-
return { ...r };
|
|
227
|
-
}
|
|
228
|
-
function c(e) {
|
|
229
|
-
r = le(e), o();
|
|
230
|
-
}
|
|
231
|
-
function l(e) {
|
|
232
|
-
let n = [...t.values()].filter((t) => t.domain === e.domain);
|
|
233
|
-
return !(n.length >= r.maxPerDomain || e.assetType === "video" && n.filter((e) => e.assetType === "video").length >= r.maxVideoPerDomain);
|
|
234
|
-
}
|
|
235
|
-
return {
|
|
236
|
-
getLimits: s,
|
|
237
|
-
request: a,
|
|
238
|
-
setLimits: c
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
function ue(e) {
|
|
242
|
-
try {
|
|
243
|
-
let t = e.getPriority();
|
|
244
|
-
return Number.isFinite(t) ? t : Infinity;
|
|
245
|
-
} catch {
|
|
246
|
-
return Infinity;
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
function de(e) {
|
|
250
|
-
try {
|
|
251
|
-
return new URL(e).hostname || "local";
|
|
252
|
-
} catch {
|
|
253
|
-
return "local";
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
//#endregion
|
|
257
173
|
//#region src/components/viewer-core/dom.ts
|
|
258
|
-
function
|
|
174
|
+
function le(e) {
|
|
259
175
|
return e instanceof HTMLElement && [
|
|
260
176
|
"INPUT",
|
|
261
177
|
"TEXTAREA",
|
|
262
178
|
"SELECT"
|
|
263
179
|
].includes(e.tagName);
|
|
264
180
|
}
|
|
265
|
-
function
|
|
181
|
+
function Z(e) {
|
|
266
182
|
return e instanceof HTMLElement && !!e.closest("[data-swipe-lock], input, textarea, select, a");
|
|
267
183
|
}
|
|
268
184
|
//#endregion
|
|
269
185
|
//#region src/components/viewer-core/itemIdentity.ts
|
|
270
|
-
var
|
|
271
|
-
function
|
|
272
|
-
let t = e[
|
|
186
|
+
var ue = "__vibeOccurrenceKey";
|
|
187
|
+
function Q(e) {
|
|
188
|
+
let t = e[ue];
|
|
273
189
|
return typeof t == "string" && t.length > 0 ? t : e.id;
|
|
274
190
|
}
|
|
275
|
-
function
|
|
191
|
+
function de(e, t, n) {
|
|
276
192
|
let r = /* @__PURE__ */ new Map(), i = [], a = n;
|
|
277
193
|
for (let e of t) {
|
|
278
|
-
let t = r.get(e.id), n =
|
|
194
|
+
let t = r.get(e.id), n = Q(e);
|
|
279
195
|
t ? t.push(n) : r.set(e.id, [n]);
|
|
280
196
|
}
|
|
281
197
|
for (let t of e) {
|
|
282
198
|
let e = r.get(t.id)?.shift() ?? `vibe-occurrence-${a += 1}`;
|
|
283
|
-
i.push(
|
|
199
|
+
i.push(fe(t, e));
|
|
284
200
|
}
|
|
285
201
|
return {
|
|
286
202
|
items: i,
|
|
287
203
|
nextSequence: a
|
|
288
204
|
};
|
|
289
205
|
}
|
|
290
|
-
function
|
|
291
|
-
return
|
|
206
|
+
function fe(e, t) {
|
|
207
|
+
return Q(e) === t ? e : {
|
|
292
208
|
...e,
|
|
293
|
-
[
|
|
209
|
+
[ue]: t
|
|
294
210
|
};
|
|
295
211
|
}
|
|
296
212
|
//#endregion
|
|
297
213
|
//#region src/components/viewer-core/removalState.ts
|
|
298
|
-
function
|
|
214
|
+
function pe() {
|
|
299
215
|
let e = T(/* @__PURE__ */ new Set()), t = T([]);
|
|
300
216
|
function n(n) {
|
|
301
|
-
let r =
|
|
217
|
+
let r = me(n).filter((t) => !e.value.has(t));
|
|
302
218
|
if (!r.length) return { ids: [] };
|
|
303
219
|
let i = new Set(e.value);
|
|
304
220
|
for (let e of r) i.add(e);
|
|
305
221
|
return e.value = i, t.value = [...t.value, r], { ids: r };
|
|
306
222
|
}
|
|
307
223
|
function r(t) {
|
|
308
|
-
let n =
|
|
224
|
+
let n = me(t).filter((t) => e.value.has(t));
|
|
309
225
|
if (!n.length) return { ids: [] };
|
|
310
226
|
let r = new Set(e.value);
|
|
311
227
|
for (let e of n) r.delete(e);
|
|
@@ -336,64 +252,64 @@ function _e() {
|
|
|
336
252
|
undo: i
|
|
337
253
|
};
|
|
338
254
|
}
|
|
339
|
-
function
|
|
255
|
+
function me(e) {
|
|
340
256
|
let t = Array.isArray(e) ? e : [e];
|
|
341
257
|
return Array.from(new Set(t.filter((e) => typeof e == "string" && e.length > 0)));
|
|
342
258
|
}
|
|
343
259
|
//#endregion
|
|
344
260
|
//#region src/components/viewer-core/autoBuckets.ts
|
|
345
|
-
function
|
|
261
|
+
function he(e) {
|
|
346
262
|
return e.flatMap((e) => e.items);
|
|
347
263
|
}
|
|
348
|
-
function
|
|
264
|
+
function ge(e, t) {
|
|
349
265
|
return t.size ? e.filter((e) => !t.has(e.id)) : e;
|
|
350
266
|
}
|
|
351
|
-
function
|
|
352
|
-
return
|
|
267
|
+
function _e(e, t) {
|
|
268
|
+
return ge(e.items, t);
|
|
353
269
|
}
|
|
354
|
-
function
|
|
355
|
-
return
|
|
270
|
+
function ve(e, t) {
|
|
271
|
+
return _e(e, t).length;
|
|
356
272
|
}
|
|
357
|
-
function
|
|
273
|
+
function ye(e, t, n) {
|
|
358
274
|
if (n < 0) return null;
|
|
359
275
|
let r = 0;
|
|
360
276
|
for (let i of e) {
|
|
361
|
-
let e =
|
|
277
|
+
let e = _e(i, t), a = r + e.length;
|
|
362
278
|
if (n < a) return i.cursor;
|
|
363
279
|
r = a;
|
|
364
280
|
}
|
|
365
281
|
return null;
|
|
366
282
|
}
|
|
367
|
-
function
|
|
283
|
+
function be(e, t, n) {
|
|
368
284
|
let r = [...e], i = r.findIndex((e) => e.cursor === t);
|
|
369
285
|
return i >= 0 && r.splice(i, 1, n), r;
|
|
370
286
|
}
|
|
371
|
-
function
|
|
372
|
-
let r =
|
|
287
|
+
function xe(e, t, n) {
|
|
288
|
+
let r = de(e, t, n);
|
|
373
289
|
return {
|
|
374
290
|
items: r.items,
|
|
375
291
|
nextSequence: r.nextSequence
|
|
376
292
|
};
|
|
377
293
|
}
|
|
378
|
-
function
|
|
294
|
+
function Se(e) {
|
|
379
295
|
return e === "filling" || e === "loading" || e === "reloading";
|
|
380
296
|
}
|
|
381
|
-
function
|
|
297
|
+
function Ce(e) {
|
|
382
298
|
return !e || !Number.isFinite(e) || e < 1 ? 25 : Math.floor(e);
|
|
383
299
|
}
|
|
384
|
-
function
|
|
300
|
+
function we(e) {
|
|
385
301
|
return e ?? "__vibe_initial_cursor__";
|
|
386
302
|
}
|
|
387
|
-
function
|
|
303
|
+
function Te(e, t, n) {
|
|
388
304
|
return Math.min(Math.max(e, t), n);
|
|
389
305
|
}
|
|
390
306
|
//#endregion
|
|
391
307
|
//#region src/components/viewer-core/autoResolveState.ts
|
|
392
|
-
function
|
|
308
|
+
function Ee(e) {
|
|
393
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";
|
|
394
310
|
}
|
|
395
|
-
function
|
|
396
|
-
let t =
|
|
311
|
+
function De(e) {
|
|
312
|
+
let t = xe(e.nextItems, e.previousItems, e.sequence);
|
|
397
313
|
return {
|
|
398
314
|
bucket: {
|
|
399
315
|
cursor: e.cursor,
|
|
@@ -404,7 +320,7 @@ function je(e) {
|
|
|
404
320
|
nextSequence: t.nextSequence
|
|
405
321
|
};
|
|
406
322
|
}
|
|
407
|
-
function
|
|
323
|
+
function Oe(e, t, n, r) {
|
|
408
324
|
if (!e.length) return r ? null : {
|
|
409
325
|
buckets: [],
|
|
410
326
|
canceled: r,
|
|
@@ -414,46 +330,46 @@ function Me(e, t, n, r) {
|
|
|
414
330
|
return {
|
|
415
331
|
buckets: i,
|
|
416
332
|
canceled: r,
|
|
417
|
-
visibleCount: i.reduce((e, t) => e +
|
|
333
|
+
visibleCount: i.reduce((e, t) => e + ve(t, n), 0)
|
|
418
334
|
};
|
|
419
335
|
}
|
|
420
|
-
function
|
|
421
|
-
let t =
|
|
336
|
+
function ke(e) {
|
|
337
|
+
let t = De({
|
|
422
338
|
cursor: e.initialState.cursor,
|
|
423
339
|
nextCursor: e.initialState.nextCursor ?? null,
|
|
424
340
|
nextItems: e.initialState.items,
|
|
425
341
|
previousCursor: e.initialState.previousCursor ?? null,
|
|
426
342
|
previousItems: [],
|
|
427
343
|
sequence: e.sequence
|
|
428
|
-
}), n =
|
|
344
|
+
}), n = ge(t.bucket.items, e.removedIds);
|
|
429
345
|
return {
|
|
430
|
-
activeIndex:
|
|
346
|
+
activeIndex: Te(e.initialState.activeIndex ?? 0, 0, Math.max(0, n.length - 1)),
|
|
431
347
|
buckets: [t.bucket],
|
|
432
348
|
nextSequence: t.nextSequence
|
|
433
349
|
};
|
|
434
350
|
}
|
|
435
|
-
function
|
|
436
|
-
let n = e[
|
|
437
|
-
return n ?
|
|
351
|
+
function Ae(e, t) {
|
|
352
|
+
let n = e[Te(t, 0, Math.max(0, e.length - 1))];
|
|
353
|
+
return n ? Q(n) : null;
|
|
438
354
|
}
|
|
439
|
-
function
|
|
355
|
+
function je(e, t, n = null) {
|
|
440
356
|
if (!e.length) return 0;
|
|
441
|
-
let r = n ? e.findIndex((e) =>
|
|
442
|
-
return r >= 0 ? r :
|
|
357
|
+
let r = n ? e.findIndex((e) => Q(e) === n) : -1;
|
|
358
|
+
return r >= 0 ? r : Te(t, 0, e.length - 1);
|
|
443
359
|
}
|
|
444
|
-
function
|
|
445
|
-
return e ?
|
|
360
|
+
function Me(e, t, n) {
|
|
361
|
+
return e ? ve(e, t) < n : !1;
|
|
446
362
|
}
|
|
447
363
|
//#endregion
|
|
448
364
|
//#region src/components/viewer-core/fillDelay.ts
|
|
449
|
-
var
|
|
450
|
-
function
|
|
365
|
+
var Ne = 2e3, Pe = 1e3, Fe = 100;
|
|
366
|
+
function Ie(e, t = Ne, n = Pe) {
|
|
451
367
|
return t + Math.max(0, e - 1) * n;
|
|
452
368
|
}
|
|
453
|
-
function
|
|
369
|
+
function Le(e, t) {
|
|
454
370
|
return !Number.isFinite(e) || e == null || e < 0 ? t : Math.floor(e);
|
|
455
371
|
}
|
|
456
|
-
function
|
|
372
|
+
function Re() {
|
|
457
373
|
let e = T(null), t = null, n = null, r = null;
|
|
458
374
|
function i(i = !1) {
|
|
459
375
|
if (t &&= (clearInterval(t), null), n &&= (clearTimeout(n), null), e.value = null, i && r) {
|
|
@@ -471,7 +387,7 @@ function Ve() {
|
|
|
471
387
|
let t = Math.max(0, a - (Date.now() - s));
|
|
472
388
|
e.value = t, t <= 0 && l();
|
|
473
389
|
};
|
|
474
|
-
t = setInterval(u,
|
|
390
|
+
t = setInterval(u, Fe), n = setTimeout(l, a), u();
|
|
475
391
|
}));
|
|
476
392
|
}
|
|
477
393
|
return {
|
|
@@ -482,8 +398,8 @@ function Ve() {
|
|
|
482
398
|
}
|
|
483
399
|
//#endregion
|
|
484
400
|
//#region src/components/viewer-core/useAutoResolveSource.ts
|
|
485
|
-
function
|
|
486
|
-
let t = T([]), n = T(0), r = T([]), a = T(null), o = T("idle"), s = T(null), c =
|
|
401
|
+
function ze(e) {
|
|
402
|
+
let t = T([]), n = T(0), r = T([]), a = T(null), o = T("idle"), s = T(null), c = Re(), l = c.remainingMs, u = T(null), d = T(!1), f = T(!0), p = /* @__PURE__ */ new Set(), m = null, h = null, g = 0, _ = 0, v = i(() => Le(e.fillDelayMs, Ne)), y = i(() => Le(e.fillDelayStepMs, Pe)), S = i(() => e.mode ?? "dynamic"), C = i(() => Ce(e.pageSize)), w = i(() => he(t.value)), E = i(() => ge(w.value, e.removedIds.value)), D = i(() => n.value), O = i(() => Se(o.value) || d.value), k = i(() => t.value[0] ?? null), A = i(() => t.value[t.value.length - 1] ?? null), j = i(() => A.value?.nextCursor ?? null), M = i(() => k.value?.previousCursor ?? null), N = i(() => !!j.value), F = i(() => !!M.value), I = i(() => t.value.length > 0), L = i(() => ge(he(r.value), e.removedIds.value)), ee = i(() => ye(t.value, e.removedIds.value, D.value)), R = i(() => !E.value.length && !O.value && !!a.value);
|
|
487
403
|
P(() => E.value.length, (e) => {
|
|
488
404
|
if (e === 0) {
|
|
489
405
|
n.value = 0;
|
|
@@ -491,96 +407,97 @@ function He(e) {
|
|
|
491
407
|
}
|
|
492
408
|
n.value > e - 1 && (n.value = e - 1);
|
|
493
409
|
}), P(() => n.value, () => {
|
|
494
|
-
f.value &&
|
|
410
|
+
f.value && ne();
|
|
495
411
|
}), x(() => {
|
|
496
|
-
e.resolve && (
|
|
412
|
+
e.resolve && (ce() || z());
|
|
497
413
|
}), b(() => {
|
|
498
414
|
m?.abort(), m = null, c.clear(!0);
|
|
499
415
|
});
|
|
500
|
-
async function
|
|
501
|
-
h =
|
|
502
|
-
let r = await
|
|
416
|
+
async function z() {
|
|
417
|
+
h = z;
|
|
418
|
+
let r = await oe({
|
|
503
419
|
continueUntilFilled: S.value === "dynamic",
|
|
504
420
|
cursor: e.initialCursor ?? null,
|
|
505
421
|
direction: "forward",
|
|
506
422
|
phase: "loading"
|
|
507
423
|
});
|
|
508
|
-
r && (t.value = r.buckets, n.value = 0,
|
|
424
|
+
r && (t.value = r.buckets, n.value = 0, X());
|
|
509
425
|
}
|
|
510
|
-
async function
|
|
511
|
-
if (!
|
|
512
|
-
if (
|
|
513
|
-
|
|
426
|
+
async function B() {
|
|
427
|
+
if (!O.value) {
|
|
428
|
+
if (!N.value) return I.value ? ae("trailing") : void 0;
|
|
429
|
+
if (S.value === "static" && Z("trailing")) return ae("trailing");
|
|
430
|
+
await re(j.value);
|
|
514
431
|
}
|
|
515
432
|
}
|
|
516
|
-
async function
|
|
433
|
+
async function V() {
|
|
517
434
|
if (!(!F.value || O.value)) {
|
|
518
|
-
if (S.value === "static" &&
|
|
519
|
-
await
|
|
435
|
+
if (S.value === "static" && Z("leading")) return ae("leading");
|
|
436
|
+
await ie(M.value);
|
|
520
437
|
}
|
|
521
438
|
}
|
|
522
|
-
async function
|
|
523
|
-
if (
|
|
524
|
-
if (t.value = [], n.value = 0, r.value = [], a.value = null, o.value = "idle", s.value = null, u.value = null, d.value = !1, p.clear(), m?.abort(), m = null, c.clear(!0),
|
|
525
|
-
|
|
439
|
+
async function te() {
|
|
440
|
+
if (R.value) {
|
|
441
|
+
if (t.value = [], n.value = 0, r.value = [], a.value = null, o.value = "idle", s.value = null, u.value = null, d.value = !1, p.clear(), m?.abort(), m = null, c.clear(!0), ce()) {
|
|
442
|
+
X();
|
|
526
443
|
return;
|
|
527
444
|
}
|
|
528
|
-
await
|
|
445
|
+
await z();
|
|
529
446
|
}
|
|
530
447
|
}
|
|
531
448
|
async function H() {
|
|
532
|
-
if (
|
|
449
|
+
if (R.value) return te();
|
|
533
450
|
o.value !== "failed" || !h || (a.value = null, await h());
|
|
534
451
|
}
|
|
535
452
|
async function U() {
|
|
536
|
-
if (!r.value.length) return d.value = !1,
|
|
537
|
-
t.value = [...t.value, ...r.value], r.value = [], d.value = !1,
|
|
453
|
+
if (!r.value.length) return d.value = !1, X();
|
|
454
|
+
t.value = [...t.value, ...r.value], r.value = [], d.value = !1, X();
|
|
538
455
|
}
|
|
539
456
|
function W(t) {
|
|
540
457
|
let r = E.value;
|
|
541
458
|
if (!r.length) return;
|
|
542
|
-
let i =
|
|
459
|
+
let i = Te(t, 0, r.length - 1);
|
|
543
460
|
i !== n.value && (n.value = i, e.emit("update:activeIndex", i));
|
|
544
461
|
}
|
|
545
462
|
function G(e) {
|
|
546
463
|
f.value = e;
|
|
547
464
|
}
|
|
548
465
|
function K() {
|
|
549
|
-
g += 1, m?.abort(), m = null, c.clear(!0), p.clear(), a.value = null, s.value = null, u.value = null, r.value.length > 0 && (t.value = [...t.value, ...r.value], r.value = []), d.value = !1,
|
|
466
|
+
g += 1, m?.abort(), m = null, c.clear(!0), p.clear(), a.value = null, s.value = null, u.value = null, r.value.length > 0 && (t.value = [...t.value, ...r.value], r.value = []), d.value = !1, X();
|
|
550
467
|
}
|
|
551
468
|
function q() {
|
|
552
|
-
return
|
|
469
|
+
return Ae(E.value, D.value);
|
|
553
470
|
}
|
|
554
471
|
function J(e = null) {
|
|
555
|
-
n.value =
|
|
472
|
+
n.value = je(E.value, D.value, e);
|
|
556
473
|
}
|
|
557
|
-
function
|
|
558
|
-
r.value.length > 0 && !
|
|
474
|
+
function Y() {
|
|
475
|
+
r.value.length > 0 && !L.value.length && U();
|
|
559
476
|
}
|
|
560
|
-
async function
|
|
561
|
-
!E.value.length ||
|
|
477
|
+
async function ne() {
|
|
478
|
+
!E.value.length || le() || (F.value && n.value < 3 && await V(), N.value && n.value >= E.value.length - 3 && await B());
|
|
562
479
|
}
|
|
563
|
-
async function
|
|
480
|
+
async function re(e) {
|
|
564
481
|
h = async () => {
|
|
565
|
-
await
|
|
482
|
+
await re(e);
|
|
566
483
|
};
|
|
567
|
-
let n = await
|
|
484
|
+
let n = await oe({
|
|
568
485
|
continueUntilFilled: S.value === "dynamic",
|
|
569
486
|
cursor: e,
|
|
570
487
|
direction: "forward",
|
|
571
488
|
phase: "loading"
|
|
572
489
|
});
|
|
573
490
|
if (n) {
|
|
574
|
-
if (n.canceled) return t.value = [...t.value, ...n.buckets], r.value = [], d.value = !1,
|
|
575
|
-
if (r.value = n.buckets, !
|
|
491
|
+
if (n.canceled) return t.value = [...t.value, ...n.buckets], r.value = [], d.value = !1, X();
|
|
492
|
+
if (r.value = n.buckets, !L.value.length) return t.value = [...t.value, ...r.value], r.value = [], d.value = !1, X();
|
|
576
493
|
d.value = !0;
|
|
577
494
|
}
|
|
578
495
|
}
|
|
579
|
-
async function
|
|
496
|
+
async function ie(e) {
|
|
580
497
|
h = async () => {
|
|
581
|
-
await
|
|
498
|
+
await ie(e);
|
|
582
499
|
};
|
|
583
|
-
let n = await
|
|
500
|
+
let n = await oe({
|
|
584
501
|
continueUntilFilled: S.value === "dynamic",
|
|
585
502
|
cursor: e,
|
|
586
503
|
direction: "backward",
|
|
@@ -588,15 +505,15 @@ function He(e) {
|
|
|
588
505
|
});
|
|
589
506
|
if (!n) return;
|
|
590
507
|
let r = q();
|
|
591
|
-
t.value = [...n.buckets, ...t.value], J(r),
|
|
508
|
+
t.value = [...n.buckets, ...t.value], J(r), X();
|
|
592
509
|
}
|
|
593
|
-
async function
|
|
510
|
+
async function ae(n) {
|
|
594
511
|
if (h = async () => {
|
|
595
|
-
await
|
|
512
|
+
await ae(n);
|
|
596
513
|
}, !e.resolve) return;
|
|
597
514
|
let r = n === "leading" ? k.value : A.value;
|
|
598
515
|
if (!r) return;
|
|
599
|
-
let i =
|
|
516
|
+
let i = we(r.cursor);
|
|
600
517
|
if (p.has(i)) return;
|
|
601
518
|
p.add(i), a.value = null, o.value = "reloading", s.value = null, u.value = null;
|
|
602
519
|
let c = ++g, l = typeof AbortController > "u" ? null : new AbortController();
|
|
@@ -607,18 +524,18 @@ function He(e) {
|
|
|
607
524
|
pageSize: C.value,
|
|
608
525
|
signal: l?.signal
|
|
609
526
|
});
|
|
610
|
-
if (c !== g) return
|
|
611
|
-
let i =
|
|
527
|
+
if (c !== g) return X();
|
|
528
|
+
let i = se({
|
|
612
529
|
cursor: r.cursor,
|
|
613
530
|
nextCursor: n.nextPage,
|
|
614
531
|
nextItems: n.items,
|
|
615
532
|
previousCursor: n.previousPage ?? null,
|
|
616
533
|
previousItems: r.items
|
|
617
534
|
}), a = q();
|
|
618
|
-
t.value =
|
|
535
|
+
t.value = be(t.value, r.cursor, i), J(a), X();
|
|
619
536
|
} catch (e) {
|
|
620
|
-
if (
|
|
621
|
-
|
|
537
|
+
if (Ee(e) || c !== g) {
|
|
538
|
+
X();
|
|
622
539
|
return;
|
|
623
540
|
}
|
|
624
541
|
a.value = e instanceof Error ? e.message : "The viewer could not load items.", o.value = "failed", s.value = null, u.value = null;
|
|
@@ -626,12 +543,12 @@ function He(e) {
|
|
|
626
543
|
m === l && (m = null), p.delete(i);
|
|
627
544
|
}
|
|
628
545
|
}
|
|
629
|
-
async function
|
|
546
|
+
async function oe(t) {
|
|
630
547
|
if (!e.resolve) return null;
|
|
631
548
|
let n = ++g, r = /* @__PURE__ */ new Set(), i = [], l = t.cursor, d = 0;
|
|
632
549
|
for (a.value = null, o.value = t.phase, s.value = null, u.value = null;;) {
|
|
633
|
-
if (n !== g) return
|
|
634
|
-
let f =
|
|
550
|
+
if (n !== g) return Oe(i, t.direction, e.removedIds.value, !0);
|
|
551
|
+
let f = we(l);
|
|
635
552
|
if (r.has(f) || p.has(f)) break;
|
|
636
553
|
r.add(f), p.add(f);
|
|
637
554
|
let h = typeof AbortController > "u" ? null : new AbortController();
|
|
@@ -642,8 +559,8 @@ function He(e) {
|
|
|
642
559
|
pageSize: C.value,
|
|
643
560
|
signal: h?.signal
|
|
644
561
|
});
|
|
645
|
-
if (n !== g) return
|
|
646
|
-
let a =
|
|
562
|
+
if (n !== g) return Oe(i, t.direction, e.removedIds.value, !0);
|
|
563
|
+
let a = se({
|
|
647
564
|
cursor: l,
|
|
648
565
|
nextCursor: r.nextPage,
|
|
649
566
|
nextItems: r.items,
|
|
@@ -651,26 +568,26 @@ function He(e) {
|
|
|
651
568
|
previousItems: []
|
|
652
569
|
});
|
|
653
570
|
i.push(a);
|
|
654
|
-
let f = i.reduce((t, n) => t +
|
|
571
|
+
let f = i.reduce((t, n) => t + ve(n, e.removedIds.value), 0), p = t.direction === "forward" ? a.nextCursor : a.previousCursor;
|
|
655
572
|
if (!t.continueUntilFilled || f >= C.value || !p) return {
|
|
656
573
|
canceled: !1,
|
|
657
574
|
buckets: t.direction === "backward" ? [...i].reverse() : i,
|
|
658
575
|
visibleCount: f
|
|
659
576
|
};
|
|
660
577
|
o.value = "filling", s.value = f, u.value = C.value, d += 1;
|
|
661
|
-
let m =
|
|
662
|
-
if (await c.wait(m), n !== g) return
|
|
578
|
+
let m = Ie(d, v.value, y.value);
|
|
579
|
+
if (await c.wait(m), n !== g) return Oe(i, t.direction, e.removedIds.value, !0);
|
|
663
580
|
l = p;
|
|
664
581
|
} catch (r) {
|
|
665
|
-
return
|
|
582
|
+
return Ee(r) || n !== g ? Oe(i, t.direction, e.removedIds.value, !0) : (a.value = r instanceof Error ? r.message : "The viewer could not load items.", o.value = "failed", s.value = null, u.value = null, null);
|
|
666
583
|
} finally {
|
|
667
584
|
m === h && (m = null), p.delete(f);
|
|
668
585
|
}
|
|
669
586
|
}
|
|
670
|
-
return
|
|
587
|
+
return Oe(i, t.direction, e.removedIds.value, !1);
|
|
671
588
|
}
|
|
672
|
-
function
|
|
673
|
-
let t =
|
|
589
|
+
function se(e) {
|
|
590
|
+
let t = De({
|
|
674
591
|
cursor: e.cursor,
|
|
675
592
|
nextCursor: e.nextCursor,
|
|
676
593
|
nextItems: e.nextItems,
|
|
@@ -680,30 +597,31 @@ function He(e) {
|
|
|
680
597
|
});
|
|
681
598
|
return _ = t.nextSequence, t.bucket;
|
|
682
599
|
}
|
|
683
|
-
function
|
|
600
|
+
function X() {
|
|
684
601
|
o.value = "idle", s.value = null, u.value = null, c.clear();
|
|
685
602
|
}
|
|
686
|
-
function
|
|
603
|
+
function ce() {
|
|
687
604
|
if (!e.initialState || !e.initialState.items.length) return !1;
|
|
688
|
-
let i =
|
|
605
|
+
let i = ke({
|
|
689
606
|
initialState: e.initialState,
|
|
690
607
|
removedIds: e.removedIds.value,
|
|
691
608
|
sequence: _
|
|
692
609
|
});
|
|
693
610
|
return t.value = i.buckets, n.value = i.activeIndex, _ = i.nextSequence, a.value = null, r.value = [], d.value = !1, !0;
|
|
694
611
|
}
|
|
695
|
-
function
|
|
612
|
+
function le() {
|
|
696
613
|
return o.value === "loading" && t.value.length === 0 && r.value.length === 0;
|
|
697
614
|
}
|
|
698
|
-
function
|
|
699
|
-
return
|
|
615
|
+
function Z(t) {
|
|
616
|
+
return Me(t === "leading" ? k.value : A.value, e.removedIds.value, C.value);
|
|
700
617
|
}
|
|
701
618
|
return {
|
|
702
619
|
activeIndex: D,
|
|
703
|
-
canRetryInitialLoad:
|
|
620
|
+
canRetryInitialLoad: R,
|
|
704
621
|
cancel: K,
|
|
622
|
+
canRefreshTrailingBoundary: I,
|
|
705
623
|
commitPendingAppend: U,
|
|
706
|
-
currentCursor:
|
|
624
|
+
currentCursor: ee,
|
|
707
625
|
errorMessage: a,
|
|
708
626
|
fillCollectedCount: s,
|
|
709
627
|
fillDelayRemainingMs: l,
|
|
@@ -714,24 +632,24 @@ function He(e) {
|
|
|
714
632
|
loading: O,
|
|
715
633
|
mode: S,
|
|
716
634
|
nextCursor: j,
|
|
717
|
-
pendingAppendItems:
|
|
635
|
+
pendingAppendItems: L,
|
|
718
636
|
phase: o,
|
|
719
|
-
prefetchNextPage:
|
|
720
|
-
prefetchPreviousPage:
|
|
637
|
+
prefetchNextPage: B,
|
|
638
|
+
prefetchPreviousPage: V,
|
|
721
639
|
previousCursor: M,
|
|
722
|
-
retryInitialLoad:
|
|
640
|
+
retryInitialLoad: te,
|
|
723
641
|
retry: H,
|
|
724
642
|
setActiveIndex: W,
|
|
725
643
|
setAutoPrefetchEnabled: G,
|
|
726
644
|
syncActiveIndexAfterVisibilityChange: J,
|
|
727
645
|
getActiveOccurrenceKey: q,
|
|
728
|
-
maybeCommitPendingAppendWhenFilteredOut:
|
|
646
|
+
maybeCommitPendingAppendWhenFilteredOut: Y
|
|
729
647
|
};
|
|
730
648
|
}
|
|
731
649
|
//#endregion
|
|
732
650
|
//#region src/components/viewer-core/useDataSource.ts
|
|
733
|
-
function
|
|
734
|
-
let n = e, r = e, { clearRemoved: a, getRemovedIds: o, remove: s, removedIds: c, restore: l, undo: u } =
|
|
651
|
+
function Be(e, t) {
|
|
652
|
+
let n = e, r = e, { clearRemoved: a, getRemovedIds: o, remove: s, removedIds: c, restore: l, undo: u } = pe(), d = ze({
|
|
735
653
|
emit: t,
|
|
736
654
|
fillDelayMs: r.fillDelayMs,
|
|
737
655
|
fillDelayStepMs: r.fillDelayStepMs,
|
|
@@ -741,84 +659,85 @@ function Ue(e, t) {
|
|
|
741
659
|
pageSize: r.pageSize,
|
|
742
660
|
removedIds: c,
|
|
743
661
|
resolve: r.resolve
|
|
744
|
-
}), f = !1, p = 0, m = T([]), h = i(() => typeof r.resolve == "function"), g = i(() => c.value.size ? m.value.filter((e) => !c.value.has(e.id)) : m.value), _ = i(() => h.value ? d.items.value : g.value), v = i(() => h.value ? d.activeIndex.value : n.activeIndex ?? 0), y = i(() => h.value ? d.loading.value : n.loading ?? !1), b = i(() => h.value ? d.hasNextPage.value : n.hasNextPage ?? !1), x = i(() => h.value ? d.hasPreviousPage.value : n.hasPreviousPage ?? !1), S = i(() => c.value.size), C = i(() => n.paginationDetail ?? null);
|
|
662
|
+
}), f = !1, p = 0, m = T([]), h = i(() => typeof r.resolve == "function"), g = i(() => c.value.size ? m.value.filter((e) => !c.value.has(e.id)) : m.value), _ = i(() => h.value ? d.items.value : g.value), v = i(() => h.value ? d.activeIndex.value : n.activeIndex ?? 0), y = i(() => h.value ? d.loading.value : n.loading ?? !1), b = i(() => h.value ? d.hasNextPage.value : n.hasNextPage ?? !1), x = i(() => h.value ? d.hasPreviousPage.value : n.hasPreviousPage ?? !1), S = i(() => c.value.size), C = i(() => n.paginationDetail ?? null), w = i(() => h.value ? !d.hasNextPage.value && d.canRefreshTrailingBoundary.value : !1);
|
|
745
663
|
P([() => n.items, () => r.resolve], ([e, t]) => {
|
|
746
664
|
!Array.isArray(e) || typeof t != "function" || f || (f = !0, console.warn("[Vibe] `resolve` and `items` were both provided. `resolve` mode will be used."));
|
|
747
665
|
}, { immediate: !0 }), P(() => n.items ?? [], (e) => {
|
|
748
666
|
if (h.value) return;
|
|
749
|
-
let t =
|
|
667
|
+
let t = de(e, m.value, p);
|
|
750
668
|
m.value = t.items, p = t.nextSequence;
|
|
751
669
|
}, {
|
|
752
670
|
deep: !0,
|
|
753
671
|
immediate: !0
|
|
754
672
|
});
|
|
755
|
-
function
|
|
673
|
+
function E(e) {
|
|
756
674
|
let r = _.value;
|
|
757
675
|
if (!r.length) return;
|
|
758
|
-
let i =
|
|
676
|
+
let i = N(e, 0, r.length - 1);
|
|
759
677
|
if (h.value) {
|
|
760
678
|
d.setActiveIndex(i);
|
|
761
679
|
return;
|
|
762
680
|
}
|
|
763
681
|
i !== (n.activeIndex ?? 0) && t("update:activeIndex", i);
|
|
764
682
|
}
|
|
765
|
-
function E(e) {
|
|
766
|
-
let t = A(), n = s(e);
|
|
767
|
-
return n.ids.length ? h.value ? (d.maybeCommitPendingAppendWhenFilteredOut(), d.syncActiveIndexAfterVisibilityChange(t), n) : (j(t), n) : n;
|
|
768
|
-
}
|
|
769
683
|
function D(e) {
|
|
770
|
-
let t =
|
|
771
|
-
return n.ids.length ? h.value ? (d.syncActiveIndexAfterVisibilityChange(t), n) : (
|
|
684
|
+
let t = j(), n = s(e);
|
|
685
|
+
return n.ids.length ? h.value ? (d.maybeCommitPendingAppendWhenFilteredOut(), d.syncActiveIndexAfterVisibilityChange(t), n) : (M(t), n) : n;
|
|
772
686
|
}
|
|
773
|
-
function O() {
|
|
774
|
-
let
|
|
775
|
-
return
|
|
687
|
+
function O(e) {
|
|
688
|
+
let t = j(), n = l(e);
|
|
689
|
+
return n.ids.length ? h.value ? (d.syncActiveIndexAfterVisibilityChange(t), n) : (M(t), n) : n;
|
|
776
690
|
}
|
|
777
691
|
function k() {
|
|
778
|
-
let e =
|
|
692
|
+
let e = j(), t = u();
|
|
693
|
+
return t?.ids.length ? h.value ? (d.syncActiveIndexAfterVisibilityChange(e), t) : (M(e), t) : t;
|
|
694
|
+
}
|
|
695
|
+
function A() {
|
|
696
|
+
let e = j();
|
|
779
697
|
if (a(), h.value) {
|
|
780
698
|
d.syncActiveIndexAfterVisibilityChange(e);
|
|
781
699
|
return;
|
|
782
700
|
}
|
|
783
|
-
|
|
701
|
+
M(e);
|
|
784
702
|
}
|
|
785
|
-
function
|
|
786
|
-
let e = _.value[
|
|
787
|
-
return e ?
|
|
703
|
+
function j() {
|
|
704
|
+
let e = _.value[N(v.value, 0, Math.max(0, _.value.length - 1))];
|
|
705
|
+
return e ? Q(e) : null;
|
|
788
706
|
}
|
|
789
|
-
function
|
|
707
|
+
function M(e = null) {
|
|
790
708
|
if (!_.value.length) return;
|
|
791
|
-
let r = e ? _.value.findIndex((t) =>
|
|
709
|
+
let r = e ? _.value.findIndex((t) => Q(t) === e) : -1, i = r >= 0 ? r : N(v.value, 0, _.value.length - 1);
|
|
792
710
|
i !== (n.activeIndex ?? 0) && t("update:activeIndex", i);
|
|
793
711
|
}
|
|
794
|
-
function
|
|
712
|
+
function N(e, t, n) {
|
|
795
713
|
return Math.min(Math.max(e, t), n);
|
|
796
714
|
}
|
|
797
|
-
function
|
|
715
|
+
function F() {
|
|
798
716
|
h.value && d.cancel();
|
|
799
717
|
}
|
|
800
|
-
async function
|
|
718
|
+
async function I() {
|
|
801
719
|
if (h.value) {
|
|
802
720
|
await d.prefetchNextPage();
|
|
803
721
|
return;
|
|
804
722
|
}
|
|
805
723
|
y.value || typeof n.requestNextPage != "function" || await n.requestNextPage();
|
|
806
724
|
}
|
|
807
|
-
async function
|
|
725
|
+
async function L() {
|
|
808
726
|
if (h.value) {
|
|
809
727
|
await d.prefetchPreviousPage();
|
|
810
728
|
return;
|
|
811
729
|
}
|
|
812
730
|
y.value || typeof n.requestPreviousPage != "function" || await n.requestPreviousPage();
|
|
813
731
|
}
|
|
814
|
-
async function
|
|
732
|
+
async function ee() {
|
|
815
733
|
h.value && await d.retry();
|
|
816
734
|
}
|
|
817
735
|
return {
|
|
818
736
|
activeIndex: v,
|
|
737
|
+
canRefreshExhaustedNextPage: w,
|
|
819
738
|
canRetryInitialLoad: i(() => h.value ? d.canRetryInitialLoad.value : !1),
|
|
820
|
-
cancel:
|
|
821
|
-
clearRemoved:
|
|
739
|
+
cancel: F,
|
|
740
|
+
clearRemoved: A,
|
|
822
741
|
commitPendingAppend: d.commitPendingAppend,
|
|
823
742
|
currentCursor: i(() => h.value ? d.currentCursor.value : null),
|
|
824
743
|
errorMessage: i(() => h.value ? d.errorMessage.value : null),
|
|
@@ -831,8 +750,8 @@ function Ue(e, t) {
|
|
|
831
750
|
isAutoMode: h,
|
|
832
751
|
items: _,
|
|
833
752
|
loading: y,
|
|
834
|
-
loadNext:
|
|
835
|
-
loadPrevious:
|
|
753
|
+
loadNext: I,
|
|
754
|
+
loadPrevious: L,
|
|
836
755
|
mode: i(() => h.value ? d.mode.value : null),
|
|
837
756
|
nextCursor: i(() => h.value ? d.nextCursor.value : null),
|
|
838
757
|
paginationDetail: C,
|
|
@@ -846,20 +765,20 @@ function Ue(e, t) {
|
|
|
846
765
|
},
|
|
847
766
|
previousCursor: i(() => h.value ? d.previousCursor.value : null),
|
|
848
767
|
removedCount: S,
|
|
849
|
-
remove:
|
|
850
|
-
restore:
|
|
851
|
-
retry:
|
|
768
|
+
remove: D,
|
|
769
|
+
restore: O,
|
|
770
|
+
retry: ee,
|
|
852
771
|
retryInitialLoad: d.retryInitialLoad,
|
|
853
|
-
setActiveIndex:
|
|
772
|
+
setActiveIndex: E,
|
|
854
773
|
setAutoPrefetchEnabled: d.setAutoPrefetchEnabled,
|
|
855
|
-
undo:
|
|
774
|
+
undo: k
|
|
856
775
|
};
|
|
857
776
|
}
|
|
858
777
|
//#endregion
|
|
859
778
|
//#region src/components/viewer-core/useController.ts
|
|
860
|
-
var
|
|
861
|
-
function
|
|
862
|
-
let n =
|
|
779
|
+
var Ve = 1024;
|
|
780
|
+
function He(e, t) {
|
|
781
|
+
let n = Be(e, t), r = T(0), a = T("list"), o = T(0), s = C({
|
|
863
782
|
activeIndex: 0,
|
|
864
783
|
currentCursor: null,
|
|
865
784
|
errorMessage: null,
|
|
@@ -877,47 +796,32 @@ function Ge(e, t) {
|
|
|
877
796
|
previousCursor: null,
|
|
878
797
|
removedCount: 0,
|
|
879
798
|
surfaceMode: "list"
|
|
880
|
-
}), c = i(() => r.value >=
|
|
881
|
-
P(
|
|
882
|
-
e && (a.value = e, c.value && t === "fullscreen" && e === "list" && (o.value += 1));
|
|
883
|
-
}, { immediate: !0 }), P(c, (e, t) => {
|
|
799
|
+
}), c = i(() => r.value >= Ve), l = i(() => c.value ? a.value : "fullscreen"), u = i(() => c.value && l.value === "fullscreen");
|
|
800
|
+
P(c, (e, t) => {
|
|
884
801
|
e && !t && a.value === "list" && (o.value += 1);
|
|
885
|
-
}), P([
|
|
802
|
+
}), P([l, () => n.pendingAppendItems.value.length], ([e, t]) => {
|
|
886
803
|
e === "list" || t <= 0 || n.commitPendingAppend();
|
|
887
|
-
}), P(
|
|
804
|
+
}), P(l, (e) => {
|
|
888
805
|
n.setAutoPrefetchEnabled(e === "fullscreen");
|
|
889
806
|
}, { immediate: !0 }), F(() => {
|
|
890
|
-
s.activeIndex = n.activeIndex.value, s.currentCursor = n.currentCursor.value, s.errorMessage = n.errorMessage.value, s.fillCollectedCount = n.fillCollectedCount.value, s.fillDelayRemainingMs = n.fillDelayRemainingMs.value, s.fillTargetCount = n.fillTargetCount.value, s.hasNextPage = n.hasNextPage.value, s.hasPreviousPage = n.hasPreviousPage.value, s.isAutoMode = n.isAutoMode.value, s.itemCount = n.items.value.length, s.loadState = n.loading.value ? "loading" : n.errorMessage.value ? "failed" : "loaded", s.mode = n.mode.value, s.nextCursor = n.nextCursor.value, s.phase = n.phase.value, s.previousCursor = n.previousCursor.value, s.removedCount = n.removedCount.value, s.surfaceMode =
|
|
807
|
+
s.activeIndex = n.activeIndex.value, s.currentCursor = n.currentCursor.value, s.errorMessage = n.errorMessage.value, s.fillCollectedCount = n.fillCollectedCount.value, s.fillDelayRemainingMs = n.fillDelayRemainingMs.value, s.fillTargetCount = n.fillTargetCount.value, s.hasNextPage = n.hasNextPage.value, s.hasPreviousPage = n.hasPreviousPage.value, s.isAutoMode = n.isAutoMode.value, s.itemCount = n.items.value.length, s.loadState = n.loading.value ? "loading" : n.errorMessage.value ? "failed" : "loaded", s.mode = n.mode.value, s.nextCursor = n.nextCursor.value, s.phase = n.phase.value, s.previousCursor = n.previousCursor.value, s.removedCount = n.removedCount.value, s.surfaceMode = l.value;
|
|
891
808
|
}), x(() => {
|
|
892
|
-
|
|
809
|
+
m(), window.addEventListener("keydown", p), window.addEventListener("resize", m);
|
|
893
810
|
}), b(() => {
|
|
894
|
-
window.removeEventListener("keydown",
|
|
811
|
+
window.removeEventListener("keydown", p), window.removeEventListener("resize", m);
|
|
895
812
|
});
|
|
896
|
-
function
|
|
897
|
-
n.setActiveIndex(e), c.value &&
|
|
813
|
+
function d(e) {
|
|
814
|
+
n.setActiveIndex(e), c.value && (a.value = "fullscreen");
|
|
898
815
|
}
|
|
899
|
-
function
|
|
900
|
-
|
|
901
|
-
if (l.value) {
|
|
902
|
-
u.value !== "list" && t("update:surfaceMode", "list");
|
|
903
|
-
return;
|
|
904
|
-
}
|
|
905
|
-
a.value = "list", o.value += 1;
|
|
906
|
-
}
|
|
816
|
+
function f() {
|
|
817
|
+
c.value && (a.value = "list", o.value += 1);
|
|
907
818
|
}
|
|
908
|
-
function
|
|
909
|
-
e.defaultPrevented || e.key !== "Escape" || !c.value ||
|
|
819
|
+
function p(e) {
|
|
820
|
+
e.defaultPrevented || e.key !== "Escape" || !c.value || l.value !== "fullscreen" || le(e.target) || (e.preventDefault(), f());
|
|
910
821
|
}
|
|
911
|
-
function
|
|
822
|
+
function m() {
|
|
912
823
|
r.value = window.innerWidth || 0;
|
|
913
824
|
}
|
|
914
|
-
function g(n) {
|
|
915
|
-
if (l.value) {
|
|
916
|
-
e.surfaceMode !== n && t("update:surfaceMode", n);
|
|
917
|
-
return;
|
|
918
|
-
}
|
|
919
|
-
a.value = n;
|
|
920
|
-
}
|
|
921
825
|
return {
|
|
922
826
|
...n,
|
|
923
827
|
cancel: n.cancel,
|
|
@@ -925,24 +829,24 @@ function Ge(e, t) {
|
|
|
925
829
|
listRestoreToken: o,
|
|
926
830
|
loadNext: n.loadNext,
|
|
927
831
|
loadPrevious: n.loadPrevious,
|
|
928
|
-
openFullscreen:
|
|
929
|
-
returnToList:
|
|
832
|
+
openFullscreen: d,
|
|
833
|
+
returnToList: f,
|
|
930
834
|
retry: n.retry,
|
|
931
|
-
showBackToList:
|
|
835
|
+
showBackToList: u,
|
|
932
836
|
status: w(s),
|
|
933
|
-
surfaceMode:
|
|
837
|
+
surfaceMode: l
|
|
934
838
|
};
|
|
935
839
|
}
|
|
936
840
|
//#endregion
|
|
937
841
|
//#region src/components/FullscreenMediaBar.vue?vue&type=script&setup=true&lang.ts
|
|
938
|
-
var
|
|
842
|
+
var Ue = {
|
|
939
843
|
"data-testid": "vibe-media-bar",
|
|
940
844
|
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]"
|
|
941
|
-
},
|
|
845
|
+
}, We = { 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]" }, Ge = { class: "text-[0.76rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74" }, Ke = { class: "relative h-4 w-full" }, qe = [
|
|
942
846
|
"max",
|
|
943
847
|
"value",
|
|
944
848
|
"disabled"
|
|
945
|
-
],
|
|
849
|
+
], Je = { class: "text-[0.76rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74" }, Ye = /* @__PURE__ */ d({
|
|
946
850
|
__name: "FullscreenMediaBar",
|
|
947
851
|
props: {
|
|
948
852
|
currentTime: {},
|
|
@@ -954,9 +858,9 @@ var Ke = {
|
|
|
954
858
|
emits: ["seek-input"],
|
|
955
859
|
setup(e, { emit: t }) {
|
|
956
860
|
let n = e, r = t;
|
|
957
|
-
return (e, t) => (S(), s("div",
|
|
958
|
-
c("span",
|
|
959
|
-
c("div",
|
|
861
|
+
return (e, t) => (S(), s("div", Ue, [c("div", We, [
|
|
862
|
+
c("span", Ge, k(n.currentTimeLabel), 1),
|
|
863
|
+
c("div", Ke, [
|
|
960
864
|
t[1] ||= c("div", { class: "absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-white/12" }, null, -1),
|
|
961
865
|
c("div", {
|
|
962
866
|
class: "absolute left-0 top-1/2 h-px -translate-y-1/2 bg-[#f7f1ea]",
|
|
@@ -973,25 +877,25 @@ var Ke = {
|
|
|
973
877
|
disabled: n.duration <= 0,
|
|
974
878
|
class: "vibe-media-slider absolute inset-0 z-10 h-4 w-full cursor-pointer bg-transparent disabled:cursor-default disabled:opacity-50",
|
|
975
879
|
onInput: t[0] ||= (e) => r("seek-input", e)
|
|
976
|
-
}, null, 40,
|
|
880
|
+
}, null, 40, qe)
|
|
977
881
|
]),
|
|
978
|
-
c("span",
|
|
882
|
+
c("span", Je, k(n.durationLabel), 1)
|
|
979
883
|
])]));
|
|
980
884
|
}
|
|
981
|
-
}),
|
|
885
|
+
}), Xe = { class: "pointer-events-none absolute inset-0 z-[3] flex flex-col justify-between p-[clamp(1.25rem,2.6vw,2.25rem)]" }, Ze = { class: "grid gap-4" }, Qe = { class: "flex min-h-11 items-center justify-between gap-4" }, $e = { class: "min-w-0 flex flex-1 items-center gap-3" }, et = {
|
|
982
886
|
key: 1,
|
|
983
887
|
"data-testid": "vibe-title",
|
|
984
888
|
class: "m-0 truncate text-left text-[0.82rem] leading-none tracking-[-0.04em] min-[721px]:text-[1.2rem]"
|
|
985
|
-
},
|
|
889
|
+
}, tt = { class: "pointer-events-auto flex shrink-0 items-center gap-2" }, nt = {
|
|
986
890
|
"data-testid": "vibe-pagination",
|
|
987
891
|
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]"
|
|
988
|
-
},
|
|
892
|
+
}, rt = { class: "whitespace-nowrap" }, it = {
|
|
989
893
|
key: 0,
|
|
990
894
|
class: "whitespace-nowrap border-l border-white/12 pl-2 text-[#f7f1ea]/56 min-[721px]:pl-3"
|
|
991
|
-
},
|
|
895
|
+
}, at = {
|
|
992
896
|
key: 0,
|
|
993
897
|
class: "grid gap-2 max-[720px]:justify-items-start"
|
|
994
|
-
},
|
|
898
|
+
}, ot = /* @__PURE__ */ d({
|
|
995
899
|
__name: "FullscreenHeader",
|
|
996
900
|
props: {
|
|
997
901
|
currentIndex: {},
|
|
@@ -1004,29 +908,29 @@ var Ke = {
|
|
|
1004
908
|
emits: ["back-to-list"],
|
|
1005
909
|
setup(e, { emit: t }) {
|
|
1006
910
|
let n = e, r = t;
|
|
1007
|
-
return (e, t) => (S(), s("div",
|
|
911
|
+
return (e, t) => (S(), s("div", Xe, [c("div", Ze, [c("div", Qe, [c("div", $e, [n.showBackToList ? (S(), s("button", {
|
|
1008
912
|
key: 0,
|
|
1009
913
|
type: "button",
|
|
1010
914
|
"data-testid": "vibe-back-to-list",
|
|
1011
915
|
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",
|
|
1012
916
|
"aria-label": "Back to list",
|
|
1013
917
|
onClick: t[0] ||= (e) => r("back-to-list")
|
|
1014
|
-
}, [u(j(
|
|
918
|
+
}, [u(j(K), {
|
|
1015
919
|
class: "h-4 w-4 stroke-[2.2]",
|
|
1016
920
|
"aria-hidden": "true"
|
|
1017
|
-
})])) : o("", !0), n.title ? (S(), s("h2",
|
|
921
|
+
})])) : o("", !0), n.title ? (S(), s("h2", et, k(n.title), 1)) : o("", !0)]), c("div", tt, [c("span", nt, [c("span", rt, k(n.currentIndex + 1) + " / " + k(n.total), 1), n.paginationDetail ? (S(), s("span", it, k(n.paginationDetail), 1)) : o("", !0)]), D(e.$slots, "actions")])])]), n.showEndBadge ? (S(), s("div", at, [...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)]));
|
|
1018
922
|
}
|
|
1019
923
|
});
|
|
1020
924
|
//#endregion
|
|
1021
925
|
//#region src/components/viewer-core/format.ts
|
|
1022
|
-
function
|
|
926
|
+
function st(e) {
|
|
1023
927
|
if (!Number.isFinite(e) || e <= 0) return "0:00";
|
|
1024
928
|
let t = Math.floor(e), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), i = t % 60;
|
|
1025
929
|
return n > 0 ? `${n}:${String(r).padStart(2, "0")}:${String(i).padStart(2, "0")}` : `${r}:${String(i).padStart(2, "0")}`;
|
|
1026
930
|
}
|
|
1027
931
|
//#endregion
|
|
1028
932
|
//#region src/components/viewer-core/useActivation.ts
|
|
1029
|
-
function
|
|
933
|
+
function ct(e) {
|
|
1030
934
|
let t = !1;
|
|
1031
935
|
P(e.enabled, async (t) => {
|
|
1032
936
|
if (n(t), t) {
|
|
@@ -1049,42 +953,42 @@ function dt(e) {
|
|
|
1049
953
|
}
|
|
1050
954
|
//#endregion
|
|
1051
955
|
//#region src/components/viewer-core/assetState.ts
|
|
1052
|
-
var
|
|
956
|
+
var lt = {
|
|
1053
957
|
currentTime: 0,
|
|
1054
958
|
duration: 0,
|
|
1055
959
|
errorKind: null,
|
|
1056
960
|
paused: !0,
|
|
1057
961
|
ready: !1
|
|
1058
962
|
};
|
|
1059
|
-
function
|
|
1060
|
-
return { ...
|
|
963
|
+
function ut() {
|
|
964
|
+
return { ...lt };
|
|
1061
965
|
}
|
|
1062
|
-
function
|
|
966
|
+
function dt(e) {
|
|
1063
967
|
return e.complete && !!(e.currentSrc || e.getAttribute("src"));
|
|
1064
968
|
}
|
|
1065
|
-
function
|
|
1066
|
-
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 =
|
|
969
|
+
function ft(e, t, n) {
|
|
970
|
+
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 = pt(t, n);
|
|
1067
971
|
}
|
|
1068
|
-
function
|
|
972
|
+
function pt(e, t) {
|
|
1069
973
|
return t === "error" || t === "loadstart" || t === "waiting" || t === "stalled" ? !1 : t === "canplay" || t === "canplaythrough" || t === "playing" ? !0 : e.readyState >= HTMLMediaElement.HAVE_CURRENT_DATA;
|
|
1070
974
|
}
|
|
1071
975
|
//#endregion
|
|
1072
976
|
//#region src/components/viewer-core/loadError.ts
|
|
1073
|
-
var
|
|
1074
|
-
function
|
|
977
|
+
var mt = /* @__PURE__ */ new Map();
|
|
978
|
+
function ht(e) {
|
|
1075
979
|
return e === "not-found" ? "404" : "Load error";
|
|
1076
980
|
}
|
|
1077
|
-
function
|
|
981
|
+
function gt(e) {
|
|
1078
982
|
return e === "generic";
|
|
1079
983
|
}
|
|
1080
|
-
function
|
|
1081
|
-
let t =
|
|
984
|
+
function _t(e) {
|
|
985
|
+
let t = mt.get(e);
|
|
1082
986
|
if (t) return t;
|
|
1083
|
-
let n =
|
|
1084
|
-
return
|
|
987
|
+
let n = vt(e);
|
|
988
|
+
return mt.set(e, n), n;
|
|
1085
989
|
}
|
|
1086
|
-
async function
|
|
1087
|
-
if (!
|
|
990
|
+
async function vt(e) {
|
|
991
|
+
if (!yt(e)) return "generic";
|
|
1088
992
|
try {
|
|
1089
993
|
let t = await fetch(e, { method: "HEAD" });
|
|
1090
994
|
if (!t.ok && t.status === 404) return "not-found";
|
|
@@ -1093,12 +997,12 @@ async function xt(e) {
|
|
|
1093
997
|
}
|
|
1094
998
|
return "generic";
|
|
1095
999
|
}
|
|
1096
|
-
function
|
|
1000
|
+
function yt(e) {
|
|
1097
1001
|
return /^(https?:\/\/|\/)/i.test(e);
|
|
1098
1002
|
}
|
|
1099
1003
|
//#endregion
|
|
1100
1004
|
//#region src/components/viewer-core/mediaPlayback.ts
|
|
1101
|
-
function
|
|
1005
|
+
function bt(e) {
|
|
1102
1006
|
try {
|
|
1103
1007
|
let t = e.play();
|
|
1104
1008
|
t && typeof t.catch == "function" && t.catch(() => {});
|
|
@@ -1106,12 +1010,12 @@ function Ct(e) {
|
|
|
1106
1010
|
}
|
|
1107
1011
|
//#endregion
|
|
1108
1012
|
//#region src/components/viewer-core/useMedia.ts
|
|
1109
|
-
function
|
|
1110
|
-
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 ?
|
|
1013
|
+
function xt(e) {
|
|
1014
|
+
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(() => {
|
|
1111
1015
|
let t = /* @__PURE__ */ new Map();
|
|
1112
|
-
for (let n of e.items.value) t.set(
|
|
1016
|
+
for (let n of e.items.value) t.set(Q(n), n);
|
|
1113
1017
|
return t;
|
|
1114
|
-
}), f = i(() => u.value ? r.value[u.value] ??
|
|
1018
|
+
}), f = i(() => u.value ? r.value[u.value] ?? lt : lt), p = i(() => u.value ? f.value.duration : 0), m = i(() => p.value <= 0 ? 0 : St(f.value.currentTime / p.value * 100, 0, 100)), h = i(() => l.value ? N(l.value) : null);
|
|
1115
1019
|
P(() => l.value, async () => {
|
|
1116
1020
|
await x();
|
|
1117
1021
|
}), P(() => e.itemCount.value, async () => {
|
|
@@ -1132,7 +1036,7 @@ function wt(e) {
|
|
|
1132
1036
|
s.delete(e);
|
|
1133
1037
|
}
|
|
1134
1038
|
function y(e, r) {
|
|
1135
|
-
r instanceof HTMLImageElement &&
|
|
1039
|
+
r instanceof HTMLImageElement && dt(r) && (t.value[e] = !0, n.value[e] = null, G(e, r.currentSrc || r.src || q(e)));
|
|
1136
1040
|
}
|
|
1137
1041
|
function b() {
|
|
1138
1042
|
z(), a.value = {}, n.value = {}, t.value = {}, r.value = {}, c.clear();
|
|
@@ -1149,14 +1053,14 @@ function wt(e) {
|
|
|
1149
1053
|
R(n, e);
|
|
1150
1054
|
continue;
|
|
1151
1055
|
}
|
|
1152
|
-
n.muted = !0, n.loop = !1, n.playsInline = !0,
|
|
1056
|
+
n.muted = !0, n.loop = !1, n.playsInline = !0, bt(n), V(e, n);
|
|
1153
1057
|
}
|
|
1154
1058
|
for (let [e, n] of s.entries()) {
|
|
1155
1059
|
if (e !== t || r.value[e]?.errorKind) {
|
|
1156
1060
|
R(n, e);
|
|
1157
1061
|
continue;
|
|
1158
1062
|
}
|
|
1159
|
-
|
|
1063
|
+
bt(n), V(e, n);
|
|
1160
1064
|
}
|
|
1161
1065
|
}
|
|
1162
1066
|
function S(e, t) {
|
|
@@ -1165,16 +1069,16 @@ function wt(e) {
|
|
|
1165
1069
|
let i = r.value[e]?.ready ?? !1;
|
|
1166
1070
|
V(e, n, t.type);
|
|
1167
1071
|
let a = r.value[e]?.ready ?? !1;
|
|
1168
|
-
!i && a &&
|
|
1072
|
+
!i && a && G(e, n.currentSrc || n.src || q(e));
|
|
1169
1073
|
}
|
|
1170
1074
|
}
|
|
1171
1075
|
function C(e, r) {
|
|
1172
|
-
t.value[e] = !0, n.value[e] = null,
|
|
1076
|
+
t.value[e] = !0, n.value[e] = null, G(e, r);
|
|
1173
1077
|
}
|
|
1174
1078
|
async function w(r, i) {
|
|
1175
|
-
let a =
|
|
1079
|
+
let a = K(r) ?? e.activeItem.value;
|
|
1176
1080
|
t.value[r] = !1, n.value[r] = "generic";
|
|
1177
|
-
let o = await
|
|
1081
|
+
let o = await _t(i);
|
|
1178
1082
|
n.value[r] = o, a && e.onAssetError?.({
|
|
1179
1083
|
item: a,
|
|
1180
1084
|
occurrenceKey: r,
|
|
@@ -1184,7 +1088,7 @@ function wt(e) {
|
|
|
1184
1088
|
});
|
|
1185
1089
|
}
|
|
1186
1090
|
async function E(t, n) {
|
|
1187
|
-
let r =
|
|
1091
|
+
let r = H(t), i = B(t), a = K(t) ?? e.activeMediaItem.value ?? e.activeItem.value;
|
|
1188
1092
|
if (r) {
|
|
1189
1093
|
r.pause();
|
|
1190
1094
|
try {
|
|
@@ -1192,7 +1096,7 @@ function wt(e) {
|
|
|
1192
1096
|
} catch {}
|
|
1193
1097
|
}
|
|
1194
1098
|
i.currentTime = 0, i.duration = 0, i.paused = !0, i.ready = !1, i.errorKind = "generic";
|
|
1195
|
-
let o = await
|
|
1099
|
+
let o = await _t(n);
|
|
1196
1100
|
i.errorKind = o, a && e.onAssetError?.({
|
|
1197
1101
|
item: a,
|
|
1198
1102
|
occurrenceKey: t,
|
|
@@ -1202,18 +1106,18 @@ function wt(e) {
|
|
|
1202
1106
|
});
|
|
1203
1107
|
}
|
|
1204
1108
|
function D(e, t, n) {
|
|
1205
|
-
e.button !== 0 || Date.now() < n ||
|
|
1109
|
+
e.button !== 0 || Date.now() < n || W(o.get(t) ?? null);
|
|
1206
1110
|
}
|
|
1207
1111
|
function O(e, t, n) {
|
|
1208
|
-
e.button !== 0 || Date.now() < n ||
|
|
1112
|
+
e.button !== 0 || Date.now() < n || W(H(t));
|
|
1209
1113
|
}
|
|
1210
1114
|
function k(e) {
|
|
1211
|
-
let t =
|
|
1115
|
+
let t = U(), n = u.value;
|
|
1212
1116
|
if (!t || !n || !(e.target instanceof HTMLInputElement)) return;
|
|
1213
1117
|
let r = Number.parseFloat(e.target.value);
|
|
1214
1118
|
if (!Number.isFinite(r)) return;
|
|
1215
|
-
let i =
|
|
1216
|
-
|
|
1119
|
+
let i = St(r, 0, p.value || 0);
|
|
1120
|
+
te(n, i, t), t.currentTime = i;
|
|
1217
1121
|
}
|
|
1218
1122
|
function A(e) {
|
|
1219
1123
|
return !!t.value[e] && !n.value[e];
|
|
@@ -1229,10 +1133,10 @@ function wt(e) {
|
|
|
1229
1133
|
}
|
|
1230
1134
|
function F(e) {
|
|
1231
1135
|
let t = N(e);
|
|
1232
|
-
return t ?
|
|
1136
|
+
return t ? ht(t) : null;
|
|
1233
1137
|
}
|
|
1234
1138
|
function I(e) {
|
|
1235
|
-
return
|
|
1139
|
+
return gt(N(e));
|
|
1236
1140
|
}
|
|
1237
1141
|
function L(e) {
|
|
1238
1142
|
return `${e}:${a.value[e] ?? 0}`;
|
|
@@ -1242,7 +1146,7 @@ function wt(e) {
|
|
|
1242
1146
|
t.value[e] = !1, n.value[e] = null;
|
|
1243
1147
|
let r = B(e);
|
|
1244
1148
|
r.currentTime = 0, r.duration = 0, r.paused = !0, r.ready = !1, r.errorKind = null;
|
|
1245
|
-
let i =
|
|
1149
|
+
let i = H(e);
|
|
1246
1150
|
i && R(i, e), c.forEach((t) => {
|
|
1247
1151
|
t.startsWith(`${e}|`) && c.delete(t);
|
|
1248
1152
|
}), a.value[e] = (a.value[e] ?? 0) + 1, await g(), await x();
|
|
@@ -1259,32 +1163,32 @@ function wt(e) {
|
|
|
1259
1163
|
for (let [e, t] of s.entries()) R(t, e);
|
|
1260
1164
|
}
|
|
1261
1165
|
function B(e) {
|
|
1262
|
-
return r.value[e] || (r.value[e] =
|
|
1166
|
+
return r.value[e] || (r.value[e] = ut()), r.value[e];
|
|
1263
1167
|
}
|
|
1264
1168
|
function V(e, t, n) {
|
|
1265
|
-
|
|
1169
|
+
ft(B(e), t, n);
|
|
1266
1170
|
}
|
|
1267
|
-
function
|
|
1171
|
+
function te(e, t, n) {
|
|
1268
1172
|
let r = B(e);
|
|
1269
1173
|
r.currentTime = t, r.duration = Number.isFinite(n.duration) ? n.duration : r.duration, r.paused = n.paused;
|
|
1270
1174
|
}
|
|
1271
|
-
function
|
|
1175
|
+
function H(e) {
|
|
1272
1176
|
return o.get(e) ?? s.get(e) ?? null;
|
|
1273
1177
|
}
|
|
1274
|
-
function
|
|
1275
|
-
return u.value ?
|
|
1178
|
+
function U() {
|
|
1179
|
+
return u.value ? H(u.value) : null;
|
|
1276
1180
|
}
|
|
1277
|
-
function
|
|
1181
|
+
function W(e) {
|
|
1278
1182
|
if (e) {
|
|
1279
1183
|
if (e.paused) {
|
|
1280
|
-
|
|
1184
|
+
bt(e);
|
|
1281
1185
|
return;
|
|
1282
1186
|
}
|
|
1283
1187
|
e.pause();
|
|
1284
1188
|
}
|
|
1285
1189
|
}
|
|
1286
|
-
function
|
|
1287
|
-
let r =
|
|
1190
|
+
function G(t, n) {
|
|
1191
|
+
let r = K(t) ?? e.activeMediaItem.value ?? e.activeItem.value;
|
|
1288
1192
|
if (!r || !n) return;
|
|
1289
1193
|
let i = `${t}|${n}`;
|
|
1290
1194
|
c.has(i) || (c.add(i), e.onAssetLoad?.({
|
|
@@ -1294,11 +1198,11 @@ function wt(e) {
|
|
|
1294
1198
|
url: n
|
|
1295
1199
|
}));
|
|
1296
1200
|
}
|
|
1297
|
-
function
|
|
1201
|
+
function K(e) {
|
|
1298
1202
|
return d.value.get(e) ?? null;
|
|
1299
1203
|
}
|
|
1300
|
-
function
|
|
1301
|
-
return
|
|
1204
|
+
function q(e) {
|
|
1205
|
+
return K(e)?.url ?? null;
|
|
1302
1206
|
}
|
|
1303
1207
|
return {
|
|
1304
1208
|
activeAssetErrorKind: h,
|
|
@@ -1328,10 +1232,10 @@ function wt(e) {
|
|
|
1328
1232
|
syncMediaPlayback: x
|
|
1329
1233
|
};
|
|
1330
1234
|
}
|
|
1331
|
-
function
|
|
1235
|
+
function St(e, t, n) {
|
|
1332
1236
|
return Math.min(Math.max(e, t), n);
|
|
1333
1237
|
}
|
|
1334
|
-
function
|
|
1238
|
+
function Ct(e, t, n = 2) {
|
|
1335
1239
|
return t <= 0 ? {
|
|
1336
1240
|
start: 0,
|
|
1337
1241
|
end: -1
|
|
@@ -1340,14 +1244,14 @@ function Et(e, t, n = 2) {
|
|
|
1340
1244
|
end: Math.min(t - 1, e + n)
|
|
1341
1245
|
};
|
|
1342
1246
|
}
|
|
1343
|
-
function
|
|
1344
|
-
let r =
|
|
1247
|
+
function wt(e, t, n = 2) {
|
|
1248
|
+
let r = Ct(t, e.length, n);
|
|
1345
1249
|
return r.end < r.start ? [] : e.slice(r.start, r.end + 1).map((e, t) => ({
|
|
1346
1250
|
item: e,
|
|
1347
1251
|
index: r.start + t
|
|
1348
1252
|
}));
|
|
1349
1253
|
}
|
|
1350
|
-
function
|
|
1254
|
+
function Tt(e, t, n, r, i) {
|
|
1351
1255
|
return {
|
|
1352
1256
|
transform: `translate3d(0, ${(e - t) * n + r}px, 0)`,
|
|
1353
1257
|
transition: i ? "none" : "transform 320ms cubic-bezier(0.22, 1, 0.36, 1)"
|
|
@@ -1355,8 +1259,8 @@ function Ot(e, t, n, r, i) {
|
|
|
1355
1259
|
}
|
|
1356
1260
|
//#endregion
|
|
1357
1261
|
//#region src/components/viewer-core/useViewer.ts
|
|
1358
|
-
function
|
|
1359
|
-
let { activeIndex: r, canRetryInitialLoad: a, errorMessage: o, hasNextPage: s, items: c, loading: l, paginationDetail: u, retryInitialLoad: d, setActiveIndex: f } =
|
|
1262
|
+
function Et(e, t, n = {}) {
|
|
1263
|
+
let { activeIndex: r, canRetryInitialLoad: a, errorMessage: o, hasNextPage: s, items: c, loading: l, paginationDetail: u, retryInitialLoad: d, setActiveIndex: f } = Be(e, t), p = T(null), m = T(0), h = T(!1), g = T(1), _ = n.enabled ?? i(() => !0), v = null, y = 0, b = 0, x = 0, S = i(() => c.value.length === 0 ? 0 : M(r.value, 0, c.value.length - 1)), C = i(() => c.value[S.value] ?? null), w = i(() => C.value?.type === "audio" || C.value?.type === "video" ? C.value : null), E = xt({
|
|
1360
1264
|
items: c,
|
|
1361
1265
|
activeItem: C,
|
|
1362
1266
|
activeMediaItem: w,
|
|
@@ -1364,8 +1268,8 @@ function kt(e, t, n = {}) {
|
|
|
1364
1268
|
itemCount: i(() => c.value.length),
|
|
1365
1269
|
onAssetError: n.onAssetError,
|
|
1366
1270
|
onAssetLoad: n.onAssetLoad
|
|
1367
|
-
}), D = i(() => c.value.length > 0 && S.value === c.value.length - 1), O = i(() => c.value.length === 0 && l.value ? "Loading the first page" : l.value && s.value ? "Loading more items" : D.value && !s.value && !l.value ? "End of feed" : null), k = i(() => Math.min(96, g.value * .15 || 96)), A = i(() =>
|
|
1368
|
-
|
|
1271
|
+
}), D = i(() => c.value.length > 0 && S.value === c.value.length - 1), O = i(() => c.value.length === 0 && l.value ? "Loading the first page" : l.value && s.value ? "Loading more items" : D.value && !s.value && !l.value ? "End of feed" : null), k = i(() => Math.min(96, g.value * .15 || 96)), A = i(() => Ct(S.value, c.value.length)), j = i(() => wt(c.value, S.value));
|
|
1272
|
+
ct({
|
|
1369
1273
|
enabled: _,
|
|
1370
1274
|
onDisable() {
|
|
1371
1275
|
V(), E.resetMediaState();
|
|
@@ -1373,7 +1277,7 @@ function kt(e, t, n = {}) {
|
|
|
1373
1277
|
onEnable() {
|
|
1374
1278
|
return E.syncMediaPlayback();
|
|
1375
1279
|
},
|
|
1376
|
-
onKeydown:
|
|
1280
|
+
onKeydown: H,
|
|
1377
1281
|
onResize: N
|
|
1378
1282
|
});
|
|
1379
1283
|
function M(e, t, n) {
|
|
@@ -1395,7 +1299,7 @@ function kt(e, t, n = {}) {
|
|
|
1395
1299
|
return t && !P(-1) || n && !P(1) ? e * .24 : e;
|
|
1396
1300
|
}
|
|
1397
1301
|
function L(e) {
|
|
1398
|
-
!_.value || c.value.length === 0 || e.pointerType === "mouse" ||
|
|
1302
|
+
!_.value || c.value.length === 0 || e.pointerType === "mouse" || Z(e.target) || (v = e.pointerId, y = e.clientY, m.value = 0, h.value = !0, p.value?.setPointerCapture?.(e.pointerId));
|
|
1399
1303
|
}
|
|
1400
1304
|
function ee(e) {
|
|
1401
1305
|
!_.value || !h.value || v !== e.pointerId || (m.value = I(e.clientY - y));
|
|
@@ -1412,32 +1316,32 @@ function kt(e, t, n = {}) {
|
|
|
1412
1316
|
function V() {
|
|
1413
1317
|
m.value = 0, h.value = !1, v = null;
|
|
1414
1318
|
}
|
|
1415
|
-
function
|
|
1416
|
-
if (!_.value || c.value.length === 0 || h.value ||
|
|
1319
|
+
function te(e) {
|
|
1320
|
+
if (!_.value || c.value.length === 0 || h.value || Z(e.target) || Math.abs(e.deltaY) < Math.max(Math.abs(e.deltaX), 24)) return;
|
|
1417
1321
|
e.preventDefault();
|
|
1418
1322
|
let t = Date.now();
|
|
1419
1323
|
t < b || (b = t + 400, F(e.deltaY > 0 ? 1 : -1));
|
|
1420
1324
|
}
|
|
1421
|
-
function
|
|
1422
|
-
!_.value || c.value.length === 0 ||
|
|
1325
|
+
function H(e) {
|
|
1326
|
+
!_.value || c.value.length === 0 || le(e.target) || ((e.key === "ArrowDown" || e.key === "PageDown") && (e.preventDefault(), F(1)), (e.key === "ArrowUp" || e.key === "PageUp") && (e.preventDefault(), F(-1)));
|
|
1423
1327
|
}
|
|
1424
|
-
function
|
|
1328
|
+
function U(e, t) {
|
|
1425
1329
|
E.onVideoClick(e, t, x);
|
|
1426
1330
|
}
|
|
1427
|
-
function
|
|
1331
|
+
function W(e, t) {
|
|
1428
1332
|
E.onAudioCoverClick(e, t, x);
|
|
1429
1333
|
}
|
|
1430
|
-
function
|
|
1334
|
+
function G(e) {
|
|
1431
1335
|
E.onMediaSeekInput(e);
|
|
1432
1336
|
}
|
|
1433
|
-
function
|
|
1337
|
+
function K(e) {
|
|
1434
1338
|
return e.type === "image" || e.type === "video";
|
|
1435
1339
|
}
|
|
1436
|
-
function
|
|
1340
|
+
function q(e) {
|
|
1437
1341
|
return e.type === "audio";
|
|
1438
1342
|
}
|
|
1439
|
-
function
|
|
1440
|
-
return
|
|
1343
|
+
function J(e) {
|
|
1344
|
+
return Tt(e, S.value, g.value, m.value, h.value);
|
|
1441
1345
|
}
|
|
1442
1346
|
return {
|
|
1443
1347
|
activeItem: C,
|
|
@@ -1452,30 +1356,30 @@ function kt(e, t, n = {}) {
|
|
|
1452
1356
|
getAssetErrorKind: E.getAssetErrorKind,
|
|
1453
1357
|
getAssetErrorLabel: E.getAssetErrorLabel,
|
|
1454
1358
|
getAssetRenderKey: E.getAssetRenderKey,
|
|
1455
|
-
formatPlaybackTime:
|
|
1359
|
+
formatPlaybackTime: st,
|
|
1456
1360
|
getImageSource: E.getImageSource,
|
|
1457
|
-
getSlideStyle:
|
|
1361
|
+
getSlideStyle: J,
|
|
1458
1362
|
hasNextPage: s,
|
|
1459
1363
|
isAtEnd: D,
|
|
1460
|
-
isAudio:
|
|
1461
|
-
isVisual:
|
|
1364
|
+
isAudio: q,
|
|
1365
|
+
isVisual: K,
|
|
1462
1366
|
items: c,
|
|
1463
1367
|
loading: l,
|
|
1464
1368
|
mediaStates: E.mediaStates,
|
|
1465
1369
|
isImageReady: E.isImageReady,
|
|
1466
1370
|
isMediaReady: E.isMediaReady,
|
|
1467
|
-
onAudioCoverClick:
|
|
1371
|
+
onAudioCoverClick: W,
|
|
1468
1372
|
onImageError: E.onImageError,
|
|
1469
1373
|
onImageLoad: E.onImageLoad,
|
|
1470
1374
|
onMediaEvent: E.onMediaEvent,
|
|
1471
1375
|
onMediaError: E.onMediaError,
|
|
1472
|
-
onMediaSeekInput:
|
|
1376
|
+
onMediaSeekInput: G,
|
|
1473
1377
|
onPointerCancel: z,
|
|
1474
1378
|
onPointerDown: L,
|
|
1475
1379
|
onPointerMove: ee,
|
|
1476
1380
|
onPointerUp: R,
|
|
1477
|
-
onVideoClick:
|
|
1478
|
-
onWheel:
|
|
1381
|
+
onVideoClick: U,
|
|
1382
|
+
onWheel: te,
|
|
1479
1383
|
registerAudioElement: E.registerAudioElement,
|
|
1480
1384
|
registerImageElement: E.registerImageElement,
|
|
1481
1385
|
registerVideoElement: E.registerVideoElement,
|
|
@@ -1491,30 +1395,30 @@ function kt(e, t, n = {}) {
|
|
|
1491
1395
|
}
|
|
1492
1396
|
//#endregion
|
|
1493
1397
|
//#region src/components/viewer-core/media.ts
|
|
1494
|
-
var
|
|
1495
|
-
image:
|
|
1496
|
-
video:
|
|
1497
|
-
audio:
|
|
1398
|
+
var Dt = {
|
|
1399
|
+
image: ne,
|
|
1400
|
+
video: J,
|
|
1401
|
+
audio: q,
|
|
1498
1402
|
other: Y
|
|
1499
|
-
},
|
|
1403
|
+
}, Ot = {
|
|
1500
1404
|
image: "Image",
|
|
1501
1405
|
video: "Video",
|
|
1502
1406
|
audio: "Audio",
|
|
1503
1407
|
other: "File"
|
|
1504
1408
|
};
|
|
1505
|
-
function
|
|
1506
|
-
return
|
|
1409
|
+
function kt(e) {
|
|
1410
|
+
return Dt[e];
|
|
1507
1411
|
}
|
|
1508
|
-
function
|
|
1509
|
-
return
|
|
1412
|
+
function At(e) {
|
|
1413
|
+
return Ot[e];
|
|
1510
1414
|
}
|
|
1511
1415
|
//#endregion
|
|
1512
1416
|
//#region src/components/viewer-core/slotContent.ts
|
|
1513
|
-
function
|
|
1417
|
+
function jt(e) {
|
|
1514
1418
|
if (!Array.isArray(e)) return !1;
|
|
1515
1419
|
for (let t of e) {
|
|
1516
1420
|
if (Array.isArray(t)) {
|
|
1517
|
-
if (
|
|
1421
|
+
if (jt(t)) return !0;
|
|
1518
1422
|
continue;
|
|
1519
1423
|
}
|
|
1520
1424
|
if (!m(t)) {
|
|
@@ -1525,53 +1429,53 @@ function Pt(e) {
|
|
|
1525
1429
|
if (t != null && t !== !1) return !0;
|
|
1526
1430
|
continue;
|
|
1527
1431
|
}
|
|
1528
|
-
if (!
|
|
1432
|
+
if (!Mt(t)) return !0;
|
|
1529
1433
|
}
|
|
1530
1434
|
return !1;
|
|
1531
1435
|
}
|
|
1532
|
-
function
|
|
1533
|
-
return r.type === e ? !0 : r.type === n ? typeof r.children == "string" ? r.children.trim().length === 0 : !0 : r.type === t ? !
|
|
1436
|
+
function Mt(r) {
|
|
1437
|
+
return r.type === e ? !0 : r.type === n ? typeof r.children == "string" ? r.children.trim().length === 0 : !0 : r.type === t ? !jt(r.children) : !1;
|
|
1534
1438
|
}
|
|
1535
1439
|
//#endregion
|
|
1536
1440
|
//#region src/components/viewer-core/theme.ts
|
|
1537
|
-
var
|
|
1441
|
+
var Nt = {
|
|
1538
1442
|
image: "bg-[radial-gradient(circle_at_top_center,rgba(251,191,36,0.4)_0,transparent_42%),linear-gradient(180deg,#120d08,#050507)]",
|
|
1539
1443
|
video: "bg-[radial-gradient(circle_at_top_center,rgba(56,189,248,0.38)_0,transparent_42%),linear-gradient(180deg,#07111c,#050608)]",
|
|
1540
1444
|
audio: "bg-[radial-gradient(circle_at_top_center,rgba(16,185,129,0.32)_0,transparent_42%),linear-gradient(180deg,#06120f,#040506)]",
|
|
1541
1445
|
other: "bg-[radial-gradient(circle_at_top_center,rgba(148,163,184,0.28)_0,transparent_42%),linear-gradient(180deg,#0d0c10,#040506)]"
|
|
1542
|
-
},
|
|
1446
|
+
}, Pt = {
|
|
1543
1447
|
image: "bg-[radial-gradient(circle_at_center,rgba(251,191,36,0.4)_0,transparent_42%),linear-gradient(180deg,#120d08,#050507)]",
|
|
1544
1448
|
video: "bg-[radial-gradient(circle_at_center,rgba(56,189,248,0.38)_0,transparent_42%),linear-gradient(180deg,#07111c,#050608)]",
|
|
1545
1449
|
audio: "bg-[radial-gradient(circle_at_center,rgba(16,185,129,0.32)_0,transparent_42%),linear-gradient(180deg,#06120f,#040506)]",
|
|
1546
1450
|
other: "bg-[radial-gradient(circle_at_center,rgba(148,163,184,0.28)_0,transparent_42%),linear-gradient(180deg,#0d0c10,#040506)]"
|
|
1547
1451
|
};
|
|
1548
|
-
function
|
|
1549
|
-
return
|
|
1452
|
+
function Ft(e) {
|
|
1453
|
+
return Nt[e];
|
|
1550
1454
|
}
|
|
1551
|
-
function
|
|
1552
|
-
return
|
|
1455
|
+
function It(e) {
|
|
1456
|
+
return Pt[e];
|
|
1553
1457
|
}
|
|
1554
1458
|
//#endregion
|
|
1555
1459
|
//#region src/components/FullscreenSurface.vue?vue&type=script&setup=true&lang.ts
|
|
1556
|
-
var
|
|
1460
|
+
var Lt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f7f1ea]" }, Rt = {
|
|
1557
1461
|
key: 0,
|
|
1558
1462
|
class: "relative h-full min-h-0"
|
|
1559
|
-
},
|
|
1463
|
+
}, zt = [
|
|
1560
1464
|
"data-item-id",
|
|
1561
1465
|
"data-occurrence-key",
|
|
1562
1466
|
"data-index",
|
|
1563
1467
|
"data-active",
|
|
1564
1468
|
"aria-hidden"
|
|
1565
|
-
],
|
|
1469
|
+
], Bt = {
|
|
1566
1470
|
key: 0,
|
|
1567
1471
|
"data-testid": "vibe-asset-spinner",
|
|
1568
1472
|
class: "pointer-events-none absolute inset-0 z-[2] grid place-items-center"
|
|
1569
|
-
},
|
|
1473
|
+
}, Vt = { 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]" }, Ht = ["data-kind"], Ut = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/45 px-8 py-7 text-center backdrop-blur-[18px]" }, Wt = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, Gt = ["onClick"], Kt = [
|
|
1570
1474
|
"src",
|
|
1571
1475
|
"alt",
|
|
1572
1476
|
"onLoad",
|
|
1573
1477
|
"onError"
|
|
1574
|
-
],
|
|
1478
|
+
], qt = [
|
|
1575
1479
|
"src",
|
|
1576
1480
|
"preload",
|
|
1577
1481
|
"onClick",
|
|
@@ -1588,15 +1492,15 @@ var Bt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f
|
|
|
1588
1492
|
"onStalled",
|
|
1589
1493
|
"onTimeupdate",
|
|
1590
1494
|
"onWaiting"
|
|
1591
|
-
],
|
|
1495
|
+
], Jt = { class: "relative grid aspect-square w-[clamp(320px,46vw,560px)] max-w-[calc(100vw-2.5rem)] place-items-center" }, Yt = [
|
|
1592
1496
|
"aria-label",
|
|
1593
1497
|
"disabled",
|
|
1594
1498
|
"onClick"
|
|
1595
|
-
],
|
|
1499
|
+
], Xt = { 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]" }, Zt = { 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]" }, Qt = {
|
|
1596
1500
|
key: 0,
|
|
1597
1501
|
"data-testid": "vibe-asset-spinner",
|
|
1598
1502
|
class: "pointer-events-none absolute inset-0 z-[3] grid place-items-center"
|
|
1599
|
-
},
|
|
1503
|
+
}, $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: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, nn = ["onClick"], rn = [
|
|
1600
1504
|
"src",
|
|
1601
1505
|
"preload",
|
|
1602
1506
|
"onCanplay",
|
|
@@ -1612,21 +1516,21 @@ var Bt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f
|
|
|
1612
1516
|
"onStalled",
|
|
1613
1517
|
"onTimeupdate",
|
|
1614
1518
|
"onWaiting"
|
|
1615
|
-
],
|
|
1519
|
+
], an = {
|
|
1616
1520
|
key: 2,
|
|
1617
1521
|
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"
|
|
1618
|
-
},
|
|
1522
|
+
}, on = { 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]" }, sn = {
|
|
1619
1523
|
key: 0,
|
|
1620
1524
|
class: "pointer-events-none absolute inset-0 z-[4]"
|
|
1621
|
-
},
|
|
1525
|
+
}, cn = { class: "h-full w-full" }, ln = {
|
|
1622
1526
|
key: 0,
|
|
1623
1527
|
"data-testid": "vibe-fullscreen-aside",
|
|
1624
1528
|
class: "h-full min-h-0 overflow-hidden border-l border-white/10 bg-black/45 backdrop-blur-[18px]"
|
|
1625
|
-
},
|
|
1529
|
+
}, un = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, dn = {
|
|
1626
1530
|
key: 0,
|
|
1627
1531
|
"data-testid": "vibe-fullscreen-aside",
|
|
1628
1532
|
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]"
|
|
1629
|
-
},
|
|
1533
|
+
}, fn = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, pn = 1280, mn = 2, hn = /* @__PURE__ */ d({
|
|
1630
1534
|
__name: "FullscreenSurface",
|
|
1631
1535
|
props: {
|
|
1632
1536
|
items: {},
|
|
@@ -1646,16 +1550,18 @@ var Bt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f
|
|
|
1646
1550
|
resolve: {},
|
|
1647
1551
|
initialCursor: {},
|
|
1648
1552
|
pageSize: {},
|
|
1649
|
-
assetLoadLimits: {},
|
|
1650
1553
|
hasPreviousPage: { type: Boolean },
|
|
1651
1554
|
paginationDetail: { default: null },
|
|
1652
1555
|
requestNextPage: {},
|
|
1653
1556
|
requestPreviousPage: {},
|
|
1557
|
+
showEndBadge: {
|
|
1558
|
+
type: Boolean,
|
|
1559
|
+
default: !0
|
|
1560
|
+
},
|
|
1654
1561
|
showStatusBadges: {
|
|
1655
1562
|
type: Boolean,
|
|
1656
1563
|
default: !0
|
|
1657
1564
|
},
|
|
1658
|
-
surfaceMode: {},
|
|
1659
1565
|
active: {
|
|
1660
1566
|
type: Boolean,
|
|
1661
1567
|
default: !0
|
|
@@ -1675,13 +1581,13 @@ var Bt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f
|
|
|
1675
1581
|
},
|
|
1676
1582
|
emits: ["back-to-list", "update:activeIndex"],
|
|
1677
1583
|
setup(e, { emit: n }) {
|
|
1678
|
-
let d = e, p = M(), m = n, g =
|
|
1584
|
+
let d = e, p = M(), m = n, g = Et(d, (e, t) => {
|
|
1679
1585
|
m("update:activeIndex", t);
|
|
1680
1586
|
}, {
|
|
1681
1587
|
enabled: A(d, "active"),
|
|
1682
1588
|
onAssetError: d.reportAssetError ?? void 0,
|
|
1683
1589
|
onAssetLoad: d.reportAssetLoad ?? void 0
|
|
1684
|
-
}), C = T(typeof window > "u" ?
|
|
1590
|
+
}), C = T(typeof window > "u" ? pn : window.innerWidth || pn), w = i(() => Ft(g.activeItem.value?.type ?? "image")), N = i(() => g.activeMediaItem.value && !g.activeAssetErrorKind.value ? "bottom-[5.8rem] max-[720px]:bottom-[7.4rem]" : "bottom-[1.8rem] max-[720px]:bottom-[1.3rem]"), P = i(() => !!g.activeMediaItem.value && !g.activeAssetErrorKind.value), F = i(() => P.value ? "pb-[5.75rem] max-[720px]:pb-[7rem]" : ""), L = i(() => {
|
|
1685
1591
|
let e = g.activeItem.value;
|
|
1686
1592
|
return e ? {
|
|
1687
1593
|
hasNextPage: d.hasNextPage,
|
|
@@ -1691,57 +1597,57 @@ var Bt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f
|
|
|
1691
1597
|
paginationDetail: d.paginationDetail,
|
|
1692
1598
|
total: d.items.length
|
|
1693
1599
|
} : null;
|
|
1694
|
-
}), R = i(() => !L.value || !p["fullscreen-header-actions"] ? [] : p["fullscreen-header-actions"](L.value)), z = i(() => !L.value || !p["fullscreen-aside"] ? [] : p["fullscreen-aside"](L.value)), B = i(() =>
|
|
1600
|
+
}), R = i(() => !L.value || !p["fullscreen-header-actions"] ? [] : p["fullscreen-header-actions"](L.value)), z = i(() => !L.value || !p["fullscreen-aside"] ? [] : p["fullscreen-aside"](L.value)), B = i(() => !d.showStatusBadges || !L.value || !g.statusMessage.value ? null : {
|
|
1695
1601
|
...L.value,
|
|
1696
1602
|
kind: g.isAtEnd.value && !g.hasNextPage.value && !g.loading.value ? "end" : "loading-more",
|
|
1697
|
-
message:
|
|
1698
|
-
}),
|
|
1699
|
-
gridTemplateColumns:
|
|
1603
|
+
message: g.statusMessage.value
|
|
1604
|
+
}), V = i(() => !B.value || !p["fullscreen-status"] ? [] : p["fullscreen-status"](B.value)), te = i(() => ({
|
|
1605
|
+
gridTemplateColumns: W.value ? "minmax(0, 1fr) 22rem" : "minmax(0, 1fr) 0rem",
|
|
1700
1606
|
transition: "grid-template-columns 320ms cubic-bezier(0.22, 1, 0.36, 1)"
|
|
1701
|
-
})),
|
|
1607
|
+
})), H = i(() => jt(R.value)), U = i(() => jt(z.value)), W = i(() => U.value && C.value >= pn), G = i(() => U.value && !W.value), K = i(() => jt(V.value));
|
|
1702
1608
|
x(() => {
|
|
1703
1609
|
window.addEventListener("resize", ue);
|
|
1704
1610
|
}), b(() => {
|
|
1705
1611
|
window.removeEventListener("resize", ue);
|
|
1706
1612
|
});
|
|
1707
|
-
function
|
|
1613
|
+
function q(e, t) {
|
|
1708
1614
|
let n = t.title?.trim();
|
|
1709
|
-
return n ? `${e} ${n}` : `${e} ${
|
|
1615
|
+
return n ? `${e} ${n}` : `${e} ${At(t.type).toLowerCase()}`;
|
|
1710
1616
|
}
|
|
1711
|
-
function
|
|
1712
|
-
let n =
|
|
1713
|
-
return !
|
|
1617
|
+
function J(e, t) {
|
|
1618
|
+
let n = Z(t);
|
|
1619
|
+
return !X(e) || e !== g.resolvedActiveIndex.value || g.getAssetErrorKind(n) ? !1 : t.type === "image" ? !g.isImageReady(n) : t.type === "video" || t.type === "audio" ? !g.isMediaReady(n) : !1;
|
|
1714
1620
|
}
|
|
1715
|
-
function
|
|
1716
|
-
return g.getAssetErrorKind(
|
|
1621
|
+
function Y(e) {
|
|
1622
|
+
return g.getAssetErrorKind(Z(e));
|
|
1717
1623
|
}
|
|
1718
|
-
function
|
|
1719
|
-
return g.getAssetErrorLabel(
|
|
1624
|
+
function ne(e) {
|
|
1625
|
+
return g.getAssetErrorLabel(Z(e)) ?? "Load error";
|
|
1720
1626
|
}
|
|
1721
|
-
function
|
|
1722
|
-
return
|
|
1627
|
+
function se(e, t) {
|
|
1628
|
+
return X(e) && e === g.resolvedActiveIndex.value && !!Y(t);
|
|
1723
1629
|
}
|
|
1724
|
-
function
|
|
1630
|
+
function X(e) {
|
|
1725
1631
|
let t = g.resolvedActiveIndex.value;
|
|
1726
|
-
return d.active && e >= t && e <= t +
|
|
1632
|
+
return d.active && e >= t && e <= t + mn;
|
|
1727
1633
|
}
|
|
1728
1634
|
function ce(e, t) {
|
|
1729
|
-
return
|
|
1635
|
+
return X(e) ? g.getImageSource(t) : void 0;
|
|
1730
1636
|
}
|
|
1731
1637
|
function le(e, t) {
|
|
1732
|
-
return
|
|
1638
|
+
return X(e) ? t.url : void 0;
|
|
1733
1639
|
}
|
|
1734
|
-
function
|
|
1735
|
-
return
|
|
1640
|
+
function Z(e) {
|
|
1641
|
+
return Q(e);
|
|
1736
1642
|
}
|
|
1737
1643
|
function ue() {
|
|
1738
|
-
C.value = window.innerWidth ||
|
|
1644
|
+
C.value = window.innerWidth || pn;
|
|
1739
1645
|
}
|
|
1740
|
-
return (e, n) => (S(), s("div",
|
|
1646
|
+
return (e, n) => (S(), s("div", Lt, [
|
|
1741
1647
|
c("div", { class: _(["absolute inset-0 transition-[background] duration-200", w.value]) }, null, 2),
|
|
1742
1648
|
c("div", {
|
|
1743
1649
|
class: "relative z-[1] grid h-full min-h-0",
|
|
1744
|
-
style: y(
|
|
1650
|
+
style: y(te.value)
|
|
1745
1651
|
}, [c("div", {
|
|
1746
1652
|
ref: "viewer.stageRef",
|
|
1747
1653
|
"data-testid": "vibe-stage",
|
|
@@ -1751,157 +1657,157 @@ var Bt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f
|
|
|
1751
1657
|
onPointerup: n[3] ||= (...e) => j(g).onPointerUp && j(g).onPointerUp(...e),
|
|
1752
1658
|
onPointercancel: n[4] ||= (...e) => j(g).onPointerCancel && j(g).onPointerCancel(...e),
|
|
1753
1659
|
onWheel: n[5] ||= (...e) => j(g).onWheel && j(g).onWheel(...e)
|
|
1754
|
-
}, [j(g).items.value.length > 0 ? (S(), s("div",
|
|
1660
|
+
}, [j(g).items.value.length > 0 ? (S(), s("div", Rt, [
|
|
1755
1661
|
(S(!0), s(t, null, E(j(g).renderedItems.value, ({ item: r, index: i }) => (S(), s("article", {
|
|
1756
|
-
key:
|
|
1662
|
+
key: Z(r),
|
|
1757
1663
|
"data-testid": "vibe-slide",
|
|
1758
1664
|
"data-item-id": r.id,
|
|
1759
|
-
"data-occurrence-key":
|
|
1665
|
+
"data-occurrence-key": Z(r),
|
|
1760
1666
|
"data-index": i,
|
|
1761
1667
|
"data-active": i === j(g).resolvedActiveIndex.value,
|
|
1762
1668
|
"aria-hidden": i === j(g).resolvedActiveIndex.value ? "false" : "true",
|
|
1763
1669
|
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"]),
|
|
1764
1670
|
style: y(j(g).getSlideStyle(i))
|
|
1765
|
-
}, [c("div", { class: _(["absolute inset-0 opacity-85", j(
|
|
1671
|
+
}, [c("div", { class: _(["absolute inset-0 opacity-85", j(It)(r.type)]) }, null, 2), j(g).isVisual(r) ? (S(), s("div", {
|
|
1766
1672
|
key: 0,
|
|
1767
1673
|
class: _(["relative z-[1] flex h-full w-full items-center justify-center overflow-hidden", i === j(g).resolvedActiveIndex.value ? F.value : ""])
|
|
1768
|
-
}, [
|
|
1674
|
+
}, [J(i, r) ? (S(), s("div", Bt, [c("span", Vt, [u(j(re), {
|
|
1769
1675
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
1770
1676
|
"aria-hidden": "true"
|
|
1771
|
-
})])])) : o("", !0),
|
|
1677
|
+
})])])) : o("", !0), se(i, r) ? (S(), s("div", {
|
|
1772
1678
|
key: 1,
|
|
1773
1679
|
"data-testid": "vibe-asset-error",
|
|
1774
|
-
"data-kind":
|
|
1680
|
+
"data-kind": Y(r),
|
|
1775
1681
|
class: "grid h-full w-full place-items-center"
|
|
1776
|
-
}, [c("div",
|
|
1777
|
-
u(j(
|
|
1682
|
+
}, [c("div", Ut, [
|
|
1683
|
+
u(j(oe), {
|
|
1778
1684
|
class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
|
|
1779
1685
|
"aria-hidden": "true"
|
|
1780
1686
|
}),
|
|
1781
|
-
c("p",
|
|
1782
|
-
j(g).canRetryAsset(
|
|
1687
|
+
c("p", Wt, k(ne(r)), 1),
|
|
1688
|
+
j(g).canRetryAsset(Z(r)) ? (S(), s("button", {
|
|
1783
1689
|
key: 0,
|
|
1784
1690
|
type: "button",
|
|
1785
1691
|
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",
|
|
1786
|
-
onClick: ee((e) => j(g).retryAsset(
|
|
1787
|
-
}, " Retry ", 8,
|
|
1788
|
-
])], 8,
|
|
1789
|
-
key: j(g).getAssetRenderKey(
|
|
1692
|
+
onClick: ee((e) => j(g).retryAsset(Z(r)), ["stop"])
|
|
1693
|
+
}, " Retry ", 8, Gt)) : o("", !0)
|
|
1694
|
+
])], 8, Ht)) : r.type === "image" ? (S(), s("img", {
|
|
1695
|
+
key: j(g).getAssetRenderKey(Z(r)),
|
|
1790
1696
|
src: ce(i, r),
|
|
1791
1697
|
alt: r.title ?? "",
|
|
1792
1698
|
draggable: "false",
|
|
1793
|
-
class: _(["block h-auto max-h-full w-auto max-w-full object-contain shadow-[0_40px_120px_-60px_rgba(0,0,0,0.9)] transition-opacity duration-300", j(g).isImageReady(
|
|
1699
|
+
class: _(["block h-auto max-h-full w-auto max-w-full object-contain shadow-[0_40px_120px_-60px_rgba(0,0,0,0.9)] transition-opacity duration-300", j(g).isImageReady(Z(r)) ? "opacity-100" : "opacity-0"]),
|
|
1794
1700
|
ref_for: !0,
|
|
1795
|
-
ref: (e) => j(g).registerImageElement(
|
|
1796
|
-
onLoad: (e) => j(g).onImageLoad(
|
|
1797
|
-
onError: (e) => j(g).onImageError(
|
|
1798
|
-
}, null, 42,
|
|
1799
|
-
key: j(g).getAssetRenderKey(
|
|
1800
|
-
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(
|
|
1701
|
+
ref: (e) => j(g).registerImageElement(Z(r), e),
|
|
1702
|
+
onLoad: (e) => j(g).onImageLoad(Z(r), r.url),
|
|
1703
|
+
onError: (e) => j(g).onImageError(Z(r), r.url)
|
|
1704
|
+
}, null, 42, Kt)) : (S(), s("video", {
|
|
1705
|
+
key: j(g).getAssetRenderKey(Z(r)),
|
|
1706
|
+
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(Z(r)) ? "opacity-100" : "opacity-0"]),
|
|
1801
1707
|
playsinline: "",
|
|
1802
1708
|
muted: "",
|
|
1803
1709
|
src: le(i, r),
|
|
1804
|
-
preload:
|
|
1710
|
+
preload: X(i) ? "metadata" : "none",
|
|
1805
1711
|
ref_for: !0,
|
|
1806
|
-
ref: (e) => j(g).registerVideoElement(
|
|
1807
|
-
onClick: ee((e) => j(g).onVideoClick(e,
|
|
1808
|
-
onCanplay: (e) => j(g).onMediaEvent(
|
|
1809
|
-
onDurationchange: (e) => j(g).onMediaEvent(
|
|
1810
|
-
onError: (e) => j(g).onMediaError(
|
|
1811
|
-
onLoadstart: (e) => j(g).onMediaEvent(
|
|
1812
|
-
onLoadedmetadata: (e) => j(g).onMediaEvent(
|
|
1813
|
-
onPause: (e) => j(g).onMediaEvent(
|
|
1814
|
-
onPlay: (e) => j(g).onMediaEvent(
|
|
1815
|
-
onPlaying: (e) => j(g).onMediaEvent(
|
|
1816
|
-
onSeeking: (e) => j(g).onMediaEvent(
|
|
1817
|
-
onSeeked: (e) => j(g).onMediaEvent(
|
|
1818
|
-
onStalled: (e) => j(g).onMediaEvent(
|
|
1819
|
-
onTimeupdate: (e) => j(g).onMediaEvent(
|
|
1820
|
-
onWaiting: (e) => j(g).onMediaEvent(
|
|
1821
|
-
}, null, 42,
|
|
1712
|
+
ref: (e) => j(g).registerVideoElement(Z(r), e),
|
|
1713
|
+
onClick: ee((e) => j(g).onVideoClick(e, Z(r)), ["stop"]),
|
|
1714
|
+
onCanplay: (e) => j(g).onMediaEvent(Z(r), e),
|
|
1715
|
+
onDurationchange: (e) => j(g).onMediaEvent(Z(r), e),
|
|
1716
|
+
onError: (e) => j(g).onMediaError(Z(r), r.url),
|
|
1717
|
+
onLoadstart: (e) => j(g).onMediaEvent(Z(r), e),
|
|
1718
|
+
onLoadedmetadata: (e) => j(g).onMediaEvent(Z(r), e),
|
|
1719
|
+
onPause: (e) => j(g).onMediaEvent(Z(r), e),
|
|
1720
|
+
onPlay: (e) => j(g).onMediaEvent(Z(r), e),
|
|
1721
|
+
onPlaying: (e) => j(g).onMediaEvent(Z(r), e),
|
|
1722
|
+
onSeeking: (e) => j(g).onMediaEvent(Z(r), e),
|
|
1723
|
+
onSeeked: (e) => j(g).onMediaEvent(Z(r), e),
|
|
1724
|
+
onStalled: (e) => j(g).onMediaEvent(Z(r), e),
|
|
1725
|
+
onTimeupdate: (e) => j(g).onMediaEvent(Z(r), e),
|
|
1726
|
+
onWaiting: (e) => j(g).onMediaEvent(Z(r), e)
|
|
1727
|
+
}, null, 42, qt))], 2)) : j(g).isAudio(r) ? (S(), s("div", {
|
|
1822
1728
|
key: 1,
|
|
1823
1729
|
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 ? F.value : ""])
|
|
1824
|
-
}, [c("div",
|
|
1730
|
+
}, [c("div", Jt, [
|
|
1825
1731
|
c("button", {
|
|
1826
1732
|
type: "button",
|
|
1827
1733
|
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]",
|
|
1828
|
-
"aria-label": j(g).mediaStates.value[
|
|
1829
|
-
disabled: !!
|
|
1830
|
-
onClick: (e) => j(g).onAudioCoverClick(e,
|
|
1734
|
+
"aria-label": j(g).mediaStates.value[Z(r)]?.paused ?? !0 ? q("Play", r) : q("Pause", r),
|
|
1735
|
+
disabled: !!Y(r),
|
|
1736
|
+
onClick: (e) => j(g).onAudioCoverClick(e, Z(r))
|
|
1831
1737
|
}, [
|
|
1832
1738
|
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),
|
|
1833
1739
|
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),
|
|
1834
|
-
c("span",
|
|
1835
|
-
icon: j(
|
|
1740
|
+
c("span", Xt, [D(e.$slots, "item-icon", {
|
|
1741
|
+
icon: j(kt)(r.type),
|
|
1836
1742
|
item: r
|
|
1837
|
-
}, () => [(S(), a(O(j(
|
|
1743
|
+
}, () => [(S(), a(O(j(kt)(r.type)), {
|
|
1838
1744
|
class: "h-6 w-6 stroke-[1.9]",
|
|
1839
1745
|
"aria-hidden": "true"
|
|
1840
1746
|
}))])]),
|
|
1841
|
-
c("span",
|
|
1747
|
+
c("span", Zt, [(S(), a(O(j(g).mediaStates.value[Z(r)]?.paused ?? !0 ? j(ae) : j(ie)), {
|
|
1842
1748
|
class: "h-4 w-4 stroke-2",
|
|
1843
1749
|
"aria-hidden": "true"
|
|
1844
1750
|
}))])
|
|
1845
|
-
], 8,
|
|
1846
|
-
|
|
1751
|
+
], 8, Yt),
|
|
1752
|
+
J(i, r) ? (S(), s("div", Qt, [c("span", $t, [u(j(re), {
|
|
1847
1753
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
1848
1754
|
"aria-hidden": "true"
|
|
1849
1755
|
})])])) : o("", !0),
|
|
1850
|
-
|
|
1756
|
+
Y(r) ? (S(), s(t, { key: 1 }, [n[8] ||= c("div", { class: "pointer-events-none absolute inset-0 border border-white/8 bg-[radial-gradient(circle,rgba(239,68,68,0.12),transparent_66%)]" }, null, -1), c("div", {
|
|
1851
1757
|
"data-testid": "vibe-asset-error",
|
|
1852
|
-
"data-kind":
|
|
1758
|
+
"data-kind": Y(r),
|
|
1853
1759
|
class: "relative z-[1] grid justify-items-center gap-4"
|
|
1854
1760
|
}, [
|
|
1855
|
-
u(j(
|
|
1761
|
+
u(j(oe), {
|
|
1856
1762
|
class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
|
|
1857
1763
|
"aria-hidden": "true"
|
|
1858
1764
|
}),
|
|
1859
|
-
c("p",
|
|
1860
|
-
j(g).canRetryAsset(
|
|
1765
|
+
c("p", tn, k(ne(r)), 1),
|
|
1766
|
+
j(g).canRetryAsset(Z(r)) ? (S(), s("button", {
|
|
1861
1767
|
key: 0,
|
|
1862
1768
|
type: "button",
|
|
1863
1769
|
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",
|
|
1864
|
-
onClick: ee((e) => j(g).retryAsset(
|
|
1865
|
-
}, " Retry ", 8,
|
|
1866
|
-
], 8,
|
|
1770
|
+
onClick: ee((e) => j(g).retryAsset(Z(r)), ["stop"])
|
|
1771
|
+
}, " Retry ", 8, nn)) : o("", !0)
|
|
1772
|
+
], 8, en)], 64)) : o("", !0)
|
|
1867
1773
|
]), (S(), s("audio", {
|
|
1868
|
-
key: j(g).getAssetRenderKey(
|
|
1774
|
+
key: j(g).getAssetRenderKey(Z(r)),
|
|
1869
1775
|
src: le(i, r),
|
|
1870
|
-
preload:
|
|
1776
|
+
preload: X(i) ? "metadata" : "none",
|
|
1871
1777
|
class: "pointer-events-none absolute h-px w-px opacity-0",
|
|
1872
1778
|
ref_for: !0,
|
|
1873
|
-
ref: (e) => j(g).registerAudioElement(
|
|
1874
|
-
onCanplay: (e) => j(g).onMediaEvent(
|
|
1875
|
-
onDurationchange: (e) => j(g).onMediaEvent(
|
|
1876
|
-
onError: (e) => j(g).onMediaError(
|
|
1877
|
-
onLoadstart: (e) => j(g).onMediaEvent(
|
|
1878
|
-
onLoadedmetadata: (e) => j(g).onMediaEvent(
|
|
1879
|
-
onPause: (e) => j(g).onMediaEvent(
|
|
1880
|
-
onPlay: (e) => j(g).onMediaEvent(
|
|
1881
|
-
onPlaying: (e) => j(g).onMediaEvent(
|
|
1882
|
-
onSeeking: (e) => j(g).onMediaEvent(
|
|
1883
|
-
onSeeked: (e) => j(g).onMediaEvent(
|
|
1884
|
-
onStalled: (e) => j(g).onMediaEvent(
|
|
1885
|
-
onTimeupdate: (e) => j(g).onMediaEvent(
|
|
1886
|
-
onWaiting: (e) => j(g).onMediaEvent(
|
|
1887
|
-
}, null, 40,
|
|
1888
|
-
icon: j(
|
|
1779
|
+
ref: (e) => j(g).registerAudioElement(Z(r), e),
|
|
1780
|
+
onCanplay: (e) => j(g).onMediaEvent(Z(r), e),
|
|
1781
|
+
onDurationchange: (e) => j(g).onMediaEvent(Z(r), e),
|
|
1782
|
+
onError: (e) => j(g).onMediaError(Z(r), r.url),
|
|
1783
|
+
onLoadstart: (e) => j(g).onMediaEvent(Z(r), e),
|
|
1784
|
+
onLoadedmetadata: (e) => j(g).onMediaEvent(Z(r), e),
|
|
1785
|
+
onPause: (e) => j(g).onMediaEvent(Z(r), e),
|
|
1786
|
+
onPlay: (e) => j(g).onMediaEvent(Z(r), e),
|
|
1787
|
+
onPlaying: (e) => j(g).onMediaEvent(Z(r), e),
|
|
1788
|
+
onSeeking: (e) => j(g).onMediaEvent(Z(r), e),
|
|
1789
|
+
onSeeked: (e) => j(g).onMediaEvent(Z(r), e),
|
|
1790
|
+
onStalled: (e) => j(g).onMediaEvent(Z(r), e),
|
|
1791
|
+
onTimeupdate: (e) => j(g).onMediaEvent(Z(r), e),
|
|
1792
|
+
onWaiting: (e) => j(g).onMediaEvent(Z(r), e)
|
|
1793
|
+
}, null, 40, rn))], 2)) : (S(), s("div", an, [c("div", on, [D(e.$slots, "item-icon", {
|
|
1794
|
+
icon: j(kt)(r.type),
|
|
1889
1795
|
item: r
|
|
1890
|
-
}, () => [(S(), a(O(j(
|
|
1796
|
+
}, () => [(S(), a(O(j(kt)(r.type)), {
|
|
1891
1797
|
class: "h-6 w-6 stroke-[1.9]",
|
|
1892
1798
|
"aria-hidden": "true"
|
|
1893
|
-
}))])])]))], 14,
|
|
1894
|
-
L.value && p["fullscreen-overlay"] ? (S(), s("div",
|
|
1895
|
-
j(g).activeItem.value ? (S(), a(
|
|
1799
|
+
}))])])]))], 14, zt))), 128)),
|
|
1800
|
+
L.value && p["fullscreen-overlay"] ? (S(), s("div", sn, [c("div", cn, [D(e.$slots, "fullscreen-overlay", v(f(L.value)))])])) : o("", !0),
|
|
1801
|
+
j(g).activeItem.value ? (S(), a(ot, {
|
|
1896
1802
|
key: 1,
|
|
1897
1803
|
"current-index": j(g).resolvedActiveIndex.value,
|
|
1898
1804
|
"pagination-detail": j(g).paginationDetail.value,
|
|
1899
1805
|
"show-back-to-list": d.showBackToList,
|
|
1900
|
-
"show-end-badge": d.
|
|
1806
|
+
"show-end-badge": d.showEndBadge && j(g).isAtEnd.value && !j(g).hasNextPage.value && !j(g).loading.value,
|
|
1901
1807
|
title: j(g).activeItem.value.title ?? null,
|
|
1902
1808
|
total: j(g).items.value.length,
|
|
1903
1809
|
onBackToList: n[0] ||= (e) => m("back-to-list")
|
|
1904
|
-
}, l({ _: 2 }, [
|
|
1810
|
+
}, l({ _: 2 }, [H.value && L.value ? {
|
|
1905
1811
|
name: "actions",
|
|
1906
1812
|
fn: I(() => [D(e.$slots, "fullscreen-header-actions", v(f(L.value)))]),
|
|
1907
1813
|
key: "0"
|
|
@@ -1913,7 +1819,7 @@ var Bt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f
|
|
|
1913
1819
|
"title",
|
|
1914
1820
|
"total"
|
|
1915
1821
|
])) : o("", !0),
|
|
1916
|
-
P.value ? (S(), a(
|
|
1822
|
+
P.value ? (S(), a(Ye, {
|
|
1917
1823
|
key: 2,
|
|
1918
1824
|
"current-time": j(g).activeMediaState.value.currentTime,
|
|
1919
1825
|
"current-time-label": j(g).formatPlaybackTime(j(g).activeMediaState.value.currentTime),
|
|
@@ -1929,13 +1835,13 @@ var Bt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f
|
|
|
1929
1835
|
"progress",
|
|
1930
1836
|
"onSeekInput"
|
|
1931
1837
|
])) : o("", !0),
|
|
1932
|
-
|
|
1838
|
+
B.value ? (S(), s("div", {
|
|
1933
1839
|
key: 3,
|
|
1934
1840
|
class: _(["absolute left-1/2 z-[4] -translate-x-1/2", N.value])
|
|
1935
|
-
}, [
|
|
1841
|
+
}, [K.value ? D(e.$slots, "fullscreen-status", v(h({ key: 0 }, B.value))) : (S(), s("div", {
|
|
1936
1842
|
key: 1,
|
|
1937
|
-
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",
|
|
1938
|
-
}, k(
|
|
1843
|
+
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", B.value.kind === "end" ? "border-amber-300/35 text-amber-200" : ""])
|
|
1844
|
+
}, k(B.value.message), 3))], 2)) : o("", !0)
|
|
1939
1845
|
])) : o("", !0)], 544), u(r, {
|
|
1940
1846
|
"enter-active-class": "transform-gpu transition-all duration-320 ease-out",
|
|
1941
1847
|
"enter-from-class": "translate-x-full opacity-0",
|
|
@@ -1944,7 +1850,7 @@ var Bt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f
|
|
|
1944
1850
|
"leave-from-class": "translate-x-0 opacity-100",
|
|
1945
1851
|
"leave-to-class": "translate-x-full opacity-0"
|
|
1946
1852
|
}, {
|
|
1947
|
-
default: I(() => [
|
|
1853
|
+
default: I(() => [W.value && L.value ? (S(), s("aside", ln, [c("div", un, [D(e.$slots, "fullscreen-aside", v(f(L.value)))])])) : o("", !0)]),
|
|
1948
1854
|
_: 3
|
|
1949
1855
|
})], 4),
|
|
1950
1856
|
u(r, {
|
|
@@ -1955,29 +1861,29 @@ var Bt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f
|
|
|
1955
1861
|
"leave-from-class": "translate-x-0 opacity-100",
|
|
1956
1862
|
"leave-to-class": "translate-x-full opacity-0"
|
|
1957
1863
|
}, {
|
|
1958
|
-
default: I(() => [
|
|
1864
|
+
default: I(() => [G.value && L.value ? (S(), s("aside", dn, [c("div", fn, [D(e.$slots, "fullscreen-aside", v(f(L.value)))])])) : o("", !0)]),
|
|
1959
1865
|
_: 3
|
|
1960
1866
|
})
|
|
1961
1867
|
]));
|
|
1962
1868
|
}
|
|
1963
|
-
}),
|
|
1964
|
-
function
|
|
1869
|
+
}), gn = 1, _n = .5;
|
|
1870
|
+
function vn(e) {
|
|
1965
1871
|
if (e.type !== "image" && e.type !== "video") return {
|
|
1966
|
-
width:
|
|
1967
|
-
height:
|
|
1872
|
+
width: gn,
|
|
1873
|
+
height: gn,
|
|
1968
1874
|
source: "fallback"
|
|
1969
1875
|
};
|
|
1970
1876
|
let t = e.preview?.width, n = e.preview?.height;
|
|
1971
|
-
if (
|
|
1972
|
-
let r =
|
|
1877
|
+
if (Tn(t) && Tn(n)) {
|
|
1878
|
+
let r = En(e, t, n);
|
|
1973
1879
|
return {
|
|
1974
1880
|
width: r.width,
|
|
1975
1881
|
height: r.height,
|
|
1976
1882
|
source: "preview"
|
|
1977
1883
|
};
|
|
1978
1884
|
}
|
|
1979
|
-
if (
|
|
1980
|
-
let t =
|
|
1885
|
+
if (Tn(e.width) && Tn(e.height)) {
|
|
1886
|
+
let t = En(e, e.width, e.height);
|
|
1981
1887
|
return {
|
|
1982
1888
|
width: t.width,
|
|
1983
1889
|
height: t.height,
|
|
@@ -1985,31 +1891,31 @@ function xn(e) {
|
|
|
1985
1891
|
};
|
|
1986
1892
|
}
|
|
1987
1893
|
return {
|
|
1988
|
-
width:
|
|
1989
|
-
height:
|
|
1894
|
+
width: gn,
|
|
1895
|
+
height: gn,
|
|
1990
1896
|
source: "fallback"
|
|
1991
1897
|
};
|
|
1992
1898
|
}
|
|
1993
|
-
function
|
|
1899
|
+
function yn(e, t) {
|
|
1994
1900
|
return !e || e <= 0 || !t || t <= 0 ? 1 : Math.max(1, Math.floor(e / t));
|
|
1995
1901
|
}
|
|
1996
|
-
function
|
|
1902
|
+
function bn(e, t, n, r = 0) {
|
|
1997
1903
|
if (!e || e <= 0 || !t || t <= 0) return n;
|
|
1998
1904
|
let i = typeof r == "number" && r > 0 ? r : 0, a = e - Math.max(0, t - 1) * i;
|
|
1999
1905
|
return !a || a <= 0 ? n : a / t;
|
|
2000
1906
|
}
|
|
2001
|
-
function
|
|
2002
|
-
let n =
|
|
1907
|
+
function xn(e, t) {
|
|
1908
|
+
let n = vn(e);
|
|
2003
1909
|
return n.height / n.width * t;
|
|
2004
1910
|
}
|
|
2005
|
-
function
|
|
1911
|
+
function Sn(e, t) {
|
|
2006
1912
|
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;
|
|
2007
1913
|
for (let c = 0; c < e.length; c += 1) {
|
|
2008
1914
|
let l = e[c];
|
|
2009
|
-
o.set(
|
|
1915
|
+
o.set(Q(l), c);
|
|
2010
1916
|
let u = 0;
|
|
2011
1917
|
for (let e = 1; e < n.length; e += 1) n[e] < n[u] && (u = e);
|
|
2012
|
-
let d = u * (t.columnWidth + t.gapX), f = n[u], p =
|
|
1918
|
+
let d = u * (t.columnWidth + t.gapX), f = n[u], p = xn(l, t.columnWidth);
|
|
2013
1919
|
r[c] = {
|
|
2014
1920
|
x: d,
|
|
2015
1921
|
y: f
|
|
@@ -2028,7 +1934,7 @@ function Tn(e, t) {
|
|
|
2028
1934
|
indexById: o
|
|
2029
1935
|
};
|
|
2030
1936
|
}
|
|
2031
|
-
function
|
|
1937
|
+
function Cn(e) {
|
|
2032
1938
|
if (e.itemCount <= 0) return [];
|
|
2033
1939
|
if (e.viewportHeight <= 0) return Array.from({ length: e.itemCount }, (e, t) => t);
|
|
2034
1940
|
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();
|
|
@@ -2038,21 +1944,21 @@ function En(e) {
|
|
|
2038
1944
|
}
|
|
2039
1945
|
return Array.from(a).sort((e, t) => e - t);
|
|
2040
1946
|
}
|
|
2041
|
-
function
|
|
1947
|
+
function wn(e, t, n) {
|
|
2042
1948
|
let r = /* @__PURE__ */ new Map();
|
|
2043
1949
|
for (let i of e) {
|
|
2044
|
-
let e = t.get(
|
|
1950
|
+
let e = t.get(Q(i));
|
|
2045
1951
|
if (e == null) continue;
|
|
2046
1952
|
let a = n[e];
|
|
2047
|
-
a && r.set(
|
|
1953
|
+
a && r.set(Q(i), a);
|
|
2048
1954
|
}
|
|
2049
1955
|
return r;
|
|
2050
1956
|
}
|
|
2051
|
-
function
|
|
1957
|
+
function Tn(e) {
|
|
2052
1958
|
return typeof e == "number" && Number.isFinite(e) && e > 0;
|
|
2053
1959
|
}
|
|
2054
|
-
function
|
|
2055
|
-
return e.type !== "image" || n / t >=
|
|
1960
|
+
function En(e, t, n) {
|
|
1961
|
+
return e.type !== "image" || n / t >= _n ? {
|
|
2056
1962
|
width: t,
|
|
2057
1963
|
height: n
|
|
2058
1964
|
} : {
|
|
@@ -2062,41 +1968,41 @@ function kn(e, t, n) {
|
|
|
2062
1968
|
}
|
|
2063
1969
|
//#endregion
|
|
2064
1970
|
//#region src/components/viewer-core/useMasonryMotion.ts
|
|
2065
|
-
var
|
|
2066
|
-
function
|
|
1971
|
+
var Dn = 300, On = 600, kn = 40, An = 400;
|
|
1972
|
+
function jn(e, t) {
|
|
2067
1973
|
return t === "top" ? [...e].reverse() : e;
|
|
2068
1974
|
}
|
|
2069
|
-
function
|
|
2070
|
-
return e <= 0 ?
|
|
1975
|
+
function Mn(e) {
|
|
1976
|
+
return e <= 0 ? On : On + Math.min((e - 1) * kn, An);
|
|
2071
1977
|
}
|
|
2072
|
-
function
|
|
1978
|
+
function Nn(e) {
|
|
2073
1979
|
let t = e.itemHeight > 0 ? e.itemHeight : e.columnWidth;
|
|
2074
1980
|
return e.direction === "top" ? e.scrollTop - t : e.scrollTop + e.viewportHeight + t;
|
|
2075
1981
|
}
|
|
2076
|
-
function
|
|
1982
|
+
function Pn(e) {
|
|
2077
1983
|
let t = T(/* @__PURE__ */ new Set()), n = T(/* @__PURE__ */ new Set()), r = T(/* @__PURE__ */ new Map()), i = T(/* @__PURE__ */ new Map()), a = T(/* @__PURE__ */ new Map()), o = T(/* @__PURE__ */ new Map()), s = T(/* @__PURE__ */ new Set()), c = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set();
|
|
2078
1984
|
P(e.visibleIndices, (a) => {
|
|
2079
1985
|
if (!a.length) return;
|
|
2080
1986
|
let o = [];
|
|
2081
1987
|
for (let n of a) {
|
|
2082
|
-
let r = e.items.value[n] ?
|
|
1988
|
+
let r = e.items.value[n] ? Q(e.items.value[n]) : null;
|
|
2083
1989
|
!r || !t.value.has(r) || c.has(r) || (c.add(r), o.push(r));
|
|
2084
1990
|
}
|
|
2085
1991
|
if (!o.length) return;
|
|
2086
|
-
let s =
|
|
2087
|
-
for (let e = 0; e < s.length; e += 1) l.set(s[e], Math.min(e *
|
|
2088
|
-
r.value = l,
|
|
1992
|
+
let s = jn(o, i.value.get(o[0]) ?? "bottom"), l = new Map(r.value);
|
|
1993
|
+
for (let e = 0; e < s.length; e += 1) l.set(s[e], Math.min(e * kn, An));
|
|
1994
|
+
r.value = l, Fn(() => {
|
|
2089
1995
|
let e = new Set(n.value);
|
|
2090
1996
|
for (let t of o) e.add(t);
|
|
2091
1997
|
n.value = e;
|
|
2092
|
-
}),
|
|
1998
|
+
}), In(() => {
|
|
2093
1999
|
let e = new Set(t.value);
|
|
2094
2000
|
for (let t of o) e.delete(t);
|
|
2095
2001
|
t.value = e, h(() => {
|
|
2096
2002
|
let e = new Set(n.value), t = new Map(r.value), a = new Map(i.value);
|
|
2097
2003
|
for (let n of o) e.delete(n), t.delete(n), a.delete(n), c.delete(n);
|
|
2098
2004
|
n.value = e, r.value = t, i.value = a;
|
|
2099
|
-
},
|
|
2005
|
+
}, Mn(o.length));
|
|
2100
2006
|
});
|
|
2101
2007
|
}, { flush: "post" }), b(() => {
|
|
2102
2008
|
for (let e of l) clearTimeout(e);
|
|
@@ -2106,12 +2012,12 @@ function Ln(e) {
|
|
|
2106
2012
|
if (!e.length) return;
|
|
2107
2013
|
let r = new Set(t.value), a = new Map(i.value);
|
|
2108
2014
|
for (let t of e) {
|
|
2109
|
-
let e =
|
|
2015
|
+
let e = Q(t);
|
|
2110
2016
|
r.add(e), a.set(e, n);
|
|
2111
2017
|
}
|
|
2112
2018
|
t.value = r, i.value = a;
|
|
2113
2019
|
}
|
|
2114
|
-
function d(t, n, r =
|
|
2020
|
+
function d(t, n, r = Dn) {
|
|
2115
2021
|
if (!t.size) return;
|
|
2116
2022
|
let i = /* @__PURE__ */ new Map(), c = [];
|
|
2117
2023
|
for (let [r, a] of t.entries()) {
|
|
@@ -2130,8 +2036,8 @@ function Ln(e) {
|
|
|
2130
2036
|
a.value = i, s.value = /* @__PURE__ */ new Set();
|
|
2131
2037
|
let l = new Map(o.value);
|
|
2132
2038
|
for (let e of c) l.set(e, r);
|
|
2133
|
-
o.value = l,
|
|
2134
|
-
s.value = new Set(c),
|
|
2039
|
+
o.value = l, Fn(() => {
|
|
2040
|
+
s.value = new Set(c), Fn(() => {
|
|
2135
2041
|
a.value = /* @__PURE__ */ new Map();
|
|
2136
2042
|
});
|
|
2137
2043
|
}), h(() => {
|
|
@@ -2142,8 +2048,8 @@ function Ln(e) {
|
|
|
2142
2048
|
}, r);
|
|
2143
2049
|
}
|
|
2144
2050
|
function f(e) {
|
|
2145
|
-
if (n.value.has(e)) return `transform ${
|
|
2146
|
-
if (s.value.has(e)) return `transform ${o.value.get(e) ??
|
|
2051
|
+
if (n.value.has(e)) return `transform ${On}ms ease-out`;
|
|
2052
|
+
if (s.value.has(e)) return `transform ${o.value.get(e) ?? Dn}ms ease-out`;
|
|
2147
2053
|
}
|
|
2148
2054
|
function p(e) {
|
|
2149
2055
|
if (!n.value.has(e)) return;
|
|
@@ -2154,13 +2060,13 @@ function Ln(e) {
|
|
|
2154
2060
|
let r = e.items.value[n], o = e.positions.value[n] ?? {
|
|
2155
2061
|
x: 0,
|
|
2156
2062
|
y: 0
|
|
2157
|
-
}, s = e.heights.value[n] ?? e.columnWidth.value, c = r ?
|
|
2063
|
+
}, s = e.heights.value[n] ?? e.columnWidth.value, c = r ? Q(r) : null, l = c ? a.value.get(c) ?? {
|
|
2158
2064
|
dx: 0,
|
|
2159
2065
|
dy: 0
|
|
2160
2066
|
} : {
|
|
2161
2067
|
dx: 0,
|
|
2162
2068
|
dy: 0
|
|
2163
|
-
}, u = c ? i.value.get(c) ?? "bottom" : "bottom", d = c && t.value.has(c) ?
|
|
2069
|
+
}, u = c ? i.value.get(c) ?? "bottom" : "bottom", d = c && t.value.has(c) ? Nn({
|
|
2164
2070
|
columnWidth: e.columnWidth.value,
|
|
2165
2071
|
direction: u,
|
|
2166
2072
|
itemHeight: s,
|
|
@@ -2183,28 +2089,28 @@ function Ln(e) {
|
|
|
2183
2089
|
playFlipMoveAnimation: d
|
|
2184
2090
|
};
|
|
2185
2091
|
}
|
|
2186
|
-
function
|
|
2092
|
+
function Fn(e) {
|
|
2187
2093
|
if (typeof requestAnimationFrame == "function") {
|
|
2188
2094
|
requestAnimationFrame(() => e());
|
|
2189
2095
|
return;
|
|
2190
2096
|
}
|
|
2191
2097
|
setTimeout(e, 0);
|
|
2192
2098
|
}
|
|
2193
|
-
function
|
|
2194
|
-
|
|
2099
|
+
function In(e) {
|
|
2100
|
+
Fn(() => Fn(e));
|
|
2195
2101
|
}
|
|
2196
2102
|
//#endregion
|
|
2197
2103
|
//#region src/components/viewer-core/masonryViewport.ts
|
|
2198
|
-
function
|
|
2104
|
+
function Ln(e, t) {
|
|
2199
2105
|
return e?.clientHeight || Math.round(e?.getBoundingClientRect().height ?? 0) || window.innerHeight || t || 1;
|
|
2200
2106
|
}
|
|
2201
|
-
function
|
|
2107
|
+
function Rn(e, t, n) {
|
|
2202
2108
|
return e?.clientWidth || Math.round(e?.getBoundingClientRect().width ?? 0) || window.innerWidth || t || n;
|
|
2203
2109
|
}
|
|
2204
|
-
function
|
|
2110
|
+
function zn(e, t, n, r) {
|
|
2205
2111
|
return (e?.scrollHeight ?? r) - (t + n);
|
|
2206
2112
|
}
|
|
2207
|
-
function
|
|
2113
|
+
function Bn(e, t) {
|
|
2208
2114
|
return {
|
|
2209
2115
|
height: `${e}px`,
|
|
2210
2116
|
transform: `translate3d(0, ${t}px, 0)`
|
|
@@ -2212,8 +2118,8 @@ function Un(e, t) {
|
|
|
2212
2118
|
}
|
|
2213
2119
|
//#endregion
|
|
2214
2120
|
//#region src/components/viewer-core/useEdgeBoundary.ts
|
|
2215
|
-
var
|
|
2216
|
-
function
|
|
2121
|
+
var Vn = 250, Hn = 1e3;
|
|
2122
|
+
function Un(e) {
|
|
2217
2123
|
let t = T(!1), n = T(!1), r = T(0), i = T(0), a = T(!1), o = T(!1), s = 0, c = null;
|
|
2218
2124
|
b(() => {
|
|
2219
2125
|
y();
|
|
@@ -2229,7 +2135,7 @@ function Kn(e) {
|
|
|
2229
2135
|
function u(t) {
|
|
2230
2136
|
if (!x(t) || !e.isAtBoundary()) return;
|
|
2231
2137
|
let n = Date.now();
|
|
2232
|
-
n < s || (s = n +
|
|
2138
|
+
n < s || (s = n + Vn, m());
|
|
2233
2139
|
}
|
|
2234
2140
|
function d() {
|
|
2235
2141
|
if (!g()) return;
|
|
@@ -2263,7 +2169,7 @@ function Kn(e) {
|
|
|
2263
2169
|
return e.hasPage.value && t.value && r.value > i.value && !e.loading.value && !a.value && typeof e.requestPage.value == "function";
|
|
2264
2170
|
}
|
|
2265
2171
|
function _() {
|
|
2266
|
-
o.value = !1, v(
|
|
2172
|
+
o.value = !1, v(Hn);
|
|
2267
2173
|
}
|
|
2268
2174
|
function v(e) {
|
|
2269
2175
|
y(), a.value = !0, c = setTimeout(() => {
|
|
@@ -2286,30 +2192,30 @@ function Kn(e) {
|
|
|
2286
2192
|
}
|
|
2287
2193
|
//#endregion
|
|
2288
2194
|
//#region src/components/viewer-core/useMasonryList.ts
|
|
2289
|
-
var
|
|
2290
|
-
function
|
|
2291
|
-
let t = T(null), n = T(0), r = T(typeof window > "u" ? 0 : window.innerHeight || 0), a = T(typeof window > "u" ? 0 : window.innerWidth ||
|
|
2195
|
+
var Wn = 600, $ = 24, Gn = 16, Kn = 300, qn = 200, Jn = 200, Yn = 200, Xn = 300, Zn = 24, Qn = 48, $n = 500, er = 1e3;
|
|
2196
|
+
function tr(e) {
|
|
2197
|
+
let t = T(null), n = T(0), r = T(typeof window > "u" ? 0 : window.innerHeight || 0), a = T(typeof window > "u" ? 0 : window.innerWidth || Kn), o = T([]), s = T([]), c = T(/* @__PURE__ */ new Map()), l = T(0), u = T(/* @__PURE__ */ new Map()), d = T(null), f = i(() => Math.max(Kn, a.value - $ * 2)), p = i(() => yn(f.value, Kn)), m = i(() => bn(f.value, p.value, Kn, Gn)), h = i(() => nr(e.activeIndex.value, 0, Math.max(0, e.items.value.length - 1))), _ = i(() => Cn({
|
|
2292
2198
|
itemCount: e.items.value.length,
|
|
2293
2199
|
viewportHeight: r.value,
|
|
2294
2200
|
scrollTop: n.value,
|
|
2295
|
-
overscanPx:
|
|
2296
|
-
bucketPx:
|
|
2201
|
+
overscanPx: qn,
|
|
2202
|
+
bucketPx: Wn,
|
|
2297
2203
|
buckets: c.value
|
|
2298
2204
|
})), v = i(() => _.value.map((t) => ({
|
|
2299
2205
|
item: e.items.value[t],
|
|
2300
2206
|
index: t
|
|
2301
2207
|
}))), y = i(() => {
|
|
2302
|
-
let e = l.value +
|
|
2303
|
-
return Math.max(e, t, r.value) +
|
|
2304
|
-
}), S = i(() => e.loading.value ? e.items.value.length > 0 ? "Loading more items" : "Loading the first page" : !e.hasNextPage.value && e.items.value.length > 0 ? "End of list" : null), C = i(() => `${h.value + 1} / ${e.items.value.length}`),
|
|
2305
|
-
if (!
|
|
2306
|
-
let e = r.value / y.value *
|
|
2307
|
-
return Math.min(
|
|
2308
|
-
}),
|
|
2309
|
-
if (!
|
|
2208
|
+
let e = l.value + $ * 2, t = d.value ?? 0;
|
|
2209
|
+
return Math.max(e, t, r.value) + Yn;
|
|
2210
|
+
}), S = i(() => e.loading.value ? e.items.value.length > 0 ? "Loading more items" : "Loading the first page" : !e.hasNextPage.value && e.items.value.length > 0 ? "End of list" : null), C = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), w = i(() => `${h.value + 1} / ${e.items.value.length}`), E = i(() => Math.max(0, r.value - Zn * 2)), D = i(() => y.value > r.value + 1 && E.value > 0), O = i(() => {
|
|
2211
|
+
if (!D.value) return 0;
|
|
2212
|
+
let e = r.value / y.value * E.value;
|
|
2213
|
+
return Math.min(E.value, Math.max(Qn, e));
|
|
2214
|
+
}), k = i(() => {
|
|
2215
|
+
if (!D.value) return Zn;
|
|
2310
2216
|
let e = Math.max(0, y.value - r.value);
|
|
2311
|
-
return
|
|
2312
|
-
}),
|
|
2217
|
+
return Zn + Math.max(0, E.value - O.value) * (e > 0 ? nr(n.value / e, 0, 1) : 0);
|
|
2218
|
+
}), A = Pn({
|
|
2313
2219
|
items: e.items,
|
|
2314
2220
|
visibleIndices: _,
|
|
2315
2221
|
positions: o,
|
|
@@ -2318,92 +2224,92 @@ function ar(e) {
|
|
|
2318
2224
|
columnWidth: m,
|
|
2319
2225
|
scrollTop: n,
|
|
2320
2226
|
viewportHeight: r
|
|
2321
|
-
}),
|
|
2227
|
+
}), j = Un({
|
|
2322
2228
|
direction: "top",
|
|
2323
2229
|
getAnimationLockMs(e) {
|
|
2324
|
-
return Math.max(
|
|
2230
|
+
return Math.max($n, Mn(e)) + er;
|
|
2325
2231
|
},
|
|
2326
2232
|
hasPage: e.hasPreviousPage,
|
|
2327
2233
|
isAtBoundary() {
|
|
2328
|
-
return n.value <=
|
|
2234
|
+
return n.value <= $ + Gn;
|
|
2329
2235
|
},
|
|
2330
2236
|
loading: e.loading,
|
|
2331
2237
|
requestPage: e.requestPreviousPage
|
|
2332
|
-
}),
|
|
2238
|
+
}), M = Un({
|
|
2333
2239
|
direction: "bottom",
|
|
2334
2240
|
getAnimationLockMs(e) {
|
|
2335
|
-
return
|
|
2241
|
+
return Mn(e) + er;
|
|
2336
2242
|
},
|
|
2337
|
-
hasPage:
|
|
2243
|
+
hasPage: C,
|
|
2338
2244
|
isAtBoundary() {
|
|
2339
|
-
return J() <=
|
|
2245
|
+
return J() <= Jn;
|
|
2340
2246
|
},
|
|
2341
2247
|
loading: e.loading,
|
|
2342
2248
|
requestPage: e.requestNextPage
|
|
2343
|
-
}),
|
|
2249
|
+
}), N = null, F = 0, I = null, L = !1;
|
|
2344
2250
|
P([
|
|
2345
|
-
() => e.items.value.map((e) =>
|
|
2251
|
+
() => e.items.value.map((e) => Q(e)),
|
|
2346
2252
|
p,
|
|
2347
2253
|
m
|
|
2348
2254
|
], async ([t], [r = []]) => {
|
|
2349
|
-
let i =
|
|
2350
|
-
|
|
2255
|
+
let i = wn(e.items.value, u.value, o.value), a = new Set(r), s = e.items.value.filter((e) => !a.has(Q(e))), c = t.length > r.length && r.length > 0 && t[0] !== r[0], l = c && n.value > $ + Gn ? e.items.value[h.value] : null, d = l ? Q(l) : null;
|
|
2256
|
+
ee(), s.length > 0 && (A.markEnter(s, c ? "top" : "bottom"), c ? j.onItemsMutated(s.length) : M.onItemsMutated(s.length)), A.playFlipMoveAnimation(i, new Set(s.map((e) => Q(e))), c ? $n : void 0), d ? (await g(), te(d, i)) : e.active.value && r.length > 0 && U();
|
|
2351
2257
|
}, { immediate: !0 }), P([
|
|
2352
|
-
() => e.pendingAppendItems.value.map((e) =>
|
|
2258
|
+
() => e.pendingAppendItems.value.map((e) => Q(e)),
|
|
2353
2259
|
p,
|
|
2354
2260
|
m,
|
|
2355
2261
|
r
|
|
2356
2262
|
], ([t]) => {
|
|
2357
|
-
|
|
2263
|
+
ie(), t.length && (d.value = ne([...e.items.value, ...e.pendingAppendItems.value]), re());
|
|
2358
2264
|
}, { immediate: !0 }), P(() => e.restoreToken.value, async () => {
|
|
2359
|
-
await g(),
|
|
2265
|
+
await g(), V(h.value, "center");
|
|
2360
2266
|
}), P(() => e.loading.value, async (t) => {
|
|
2361
|
-
!t && !e.pendingAppendItems.value.length && !
|
|
2267
|
+
!t && !e.pendingAppendItems.value.length && !I && !L && (d.value = null), j.onLoadingChange(t), M.onLoadingChange(t), await g();
|
|
2362
2268
|
}), x(async () => {
|
|
2363
|
-
G(), await g(), h.value > 0 ?
|
|
2269
|
+
G(), await g(), h.value > 0 ? V(h.value, "center") : H(), j.syncBoundary(), M.syncBoundary(), typeof ResizeObserver < "u" ? (N = new ResizeObserver(() => {
|
|
2364
2270
|
G();
|
|
2365
|
-
}), t.value &&
|
|
2271
|
+
}), t.value && N.observe(t.value)) : window.addEventListener("resize", G);
|
|
2366
2272
|
}), b(() => {
|
|
2367
|
-
|
|
2273
|
+
N?.disconnect(), N = null, window.removeEventListener("resize", G), ie(), F &&= (cancelAnimationFrame(F), 0);
|
|
2368
2274
|
});
|
|
2369
|
-
function
|
|
2370
|
-
let t =
|
|
2275
|
+
function ee() {
|
|
2276
|
+
let t = Sn(e.items.value, {
|
|
2371
2277
|
columnCount: p.value,
|
|
2372
2278
|
columnWidth: m.value,
|
|
2373
|
-
gapX:
|
|
2374
|
-
gapY:
|
|
2375
|
-
bucketPx:
|
|
2279
|
+
gapX: Gn,
|
|
2280
|
+
gapY: Gn,
|
|
2281
|
+
bucketPx: Wn
|
|
2376
2282
|
});
|
|
2377
2283
|
o.value = t.positions.map((e) => ({
|
|
2378
|
-
x: e.x +
|
|
2379
|
-
y: e.y +
|
|
2284
|
+
x: e.x + $,
|
|
2285
|
+
y: e.y + $
|
|
2380
2286
|
})), s.value = t.heights, c.value = t.buckets, l.value = t.contentHeight, u.value = t.indexById;
|
|
2381
2287
|
}
|
|
2382
|
-
function
|
|
2383
|
-
e.active.value && (n.value = t.value?.scrollTop ?? 0, r.value = K(),
|
|
2384
|
-
|
|
2288
|
+
function R() {
|
|
2289
|
+
e.active.value && (n.value = t.value?.scrollTop ?? 0, r.value = K(), j.syncBoundary(), M.syncBoundary(), W(), !U() && (F ||= requestAnimationFrame(() => {
|
|
2290
|
+
F = 0, H();
|
|
2385
2291
|
})));
|
|
2386
2292
|
}
|
|
2387
|
-
function R(t) {
|
|
2388
|
-
e.active.value && (A.onWheel(t), j.onWheel(t), W());
|
|
2389
|
-
}
|
|
2390
2293
|
function z(t) {
|
|
2391
|
-
|
|
2294
|
+
e.active.value && (j.onWheel(t), M.onWheel(t), W());
|
|
2295
|
+
}
|
|
2296
|
+
function B(t) {
|
|
2297
|
+
let n = e.items.value[t], r = n ? Q(n) : "";
|
|
2392
2298
|
return {
|
|
2393
2299
|
height: `${s.value[t] ?? m.value}px`,
|
|
2394
2300
|
width: `${m.value}px`,
|
|
2395
|
-
transition: r ?
|
|
2396
|
-
transitionDelay: r ?
|
|
2397
|
-
transform:
|
|
2301
|
+
transition: r ? A.getCardTransition(r) : void 0,
|
|
2302
|
+
transitionDelay: r ? A.getCardTransitionDelay(r) : void 0,
|
|
2303
|
+
transform: A.getCardTransform(t)
|
|
2398
2304
|
};
|
|
2399
2305
|
}
|
|
2400
|
-
function
|
|
2306
|
+
function V(e, i) {
|
|
2401
2307
|
let a = t.value, c = o.value[e], l = s.value[e];
|
|
2402
2308
|
if (!a || !c || !l) return;
|
|
2403
2309
|
let u = a.scrollTop, d = Math.max(0, y.value - r.value);
|
|
2404
|
-
i === "center" ? u = c.y - (r.value - l) / 2 : c.y < a.scrollTop ? u = c.y -
|
|
2310
|
+
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 = nr(u, 0, d), n.value = a.scrollTop, H();
|
|
2405
2311
|
}
|
|
2406
|
-
function
|
|
2312
|
+
function te(e, r) {
|
|
2407
2313
|
let i = t.value, a = r.get(e), s = u.value.get(e), c = s == null ? null : o.value[s];
|
|
2408
2314
|
if (!i || !a || !c) return;
|
|
2409
2315
|
let l = c.y - a.y;
|
|
@@ -2421,78 +2327,78 @@ function ar(e) {
|
|
|
2421
2327
|
e.setActiveIndex(i);
|
|
2422
2328
|
}
|
|
2423
2329
|
function U() {
|
|
2424
|
-
let t = n.value <=
|
|
2330
|
+
let t = n.value <= $ + Gn, r = J() <= Jn;
|
|
2425
2331
|
return t ? (e.setActiveIndex(0), !0) : r ? (e.setActiveIndex(Math.max(0, e.items.value.length - 1)), !0) : !1;
|
|
2426
2332
|
}
|
|
2427
2333
|
function W() {
|
|
2428
|
-
|
|
2334
|
+
j.maybeRequestPage(), M.maybeRequestPage();
|
|
2429
2335
|
}
|
|
2430
2336
|
function G() {
|
|
2431
2337
|
r.value = K(), a.value = q();
|
|
2432
2338
|
}
|
|
2433
2339
|
function K() {
|
|
2434
|
-
return
|
|
2340
|
+
return Ln(t.value, r.value);
|
|
2435
2341
|
}
|
|
2436
2342
|
function q() {
|
|
2437
|
-
return
|
|
2343
|
+
return Rn(t.value, a.value, Kn);
|
|
2438
2344
|
}
|
|
2439
2345
|
function J() {
|
|
2440
|
-
return
|
|
2346
|
+
return zn(t.value, n.value, r.value, y.value);
|
|
2441
2347
|
}
|
|
2442
|
-
function
|
|
2443
|
-
return
|
|
2348
|
+
function Y() {
|
|
2349
|
+
return Bn(O.value, k.value);
|
|
2444
2350
|
}
|
|
2445
|
-
function
|
|
2446
|
-
return e.length ?
|
|
2351
|
+
function ne(e) {
|
|
2352
|
+
return e.length ? Sn(e, {
|
|
2447
2353
|
columnCount: p.value,
|
|
2448
2354
|
columnWidth: m.value,
|
|
2449
|
-
gapX:
|
|
2450
|
-
gapY:
|
|
2451
|
-
bucketPx:
|
|
2452
|
-
}).contentHeight +
|
|
2355
|
+
gapX: Gn,
|
|
2356
|
+
gapY: Gn,
|
|
2357
|
+
bucketPx: Wn
|
|
2358
|
+
}).contentHeight + $ * 2 : 0;
|
|
2453
2359
|
}
|
|
2454
|
-
function
|
|
2360
|
+
function re() {
|
|
2455
2361
|
let t = e.commitPendingAppend.value;
|
|
2456
|
-
typeof t == "function" && (
|
|
2457
|
-
|
|
2362
|
+
typeof t == "function" && (I = setTimeout(async () => {
|
|
2363
|
+
I = null, L = !0;
|
|
2458
2364
|
try {
|
|
2459
2365
|
if (!e.pendingAppendItems.value.length) return;
|
|
2460
2366
|
await t(), await g(), await g();
|
|
2461
2367
|
} finally {
|
|
2462
|
-
d.value = null,
|
|
2368
|
+
d.value = null, L = !1;
|
|
2463
2369
|
}
|
|
2464
|
-
},
|
|
2370
|
+
}, Xn));
|
|
2465
2371
|
}
|
|
2466
|
-
function
|
|
2467
|
-
|
|
2372
|
+
function ie() {
|
|
2373
|
+
I &&= (clearTimeout(I), null);
|
|
2468
2374
|
}
|
|
2469
2375
|
return {
|
|
2470
2376
|
columnWidth: m,
|
|
2471
2377
|
containerHeight: y,
|
|
2472
2378
|
footerStatusMessage: S,
|
|
2473
|
-
getCardStyle:
|
|
2474
|
-
getScrollbarThumbStyle:
|
|
2475
|
-
onScroll:
|
|
2476
|
-
onWheel:
|
|
2477
|
-
paginationLabel:
|
|
2379
|
+
getCardStyle: B,
|
|
2380
|
+
getScrollbarThumbStyle: Y,
|
|
2381
|
+
onScroll: R,
|
|
2382
|
+
onWheel: z,
|
|
2383
|
+
paginationLabel: w,
|
|
2478
2384
|
renderedItems: v,
|
|
2479
2385
|
resolvedActiveIndex: h,
|
|
2480
|
-
scrollToIndex:
|
|
2481
|
-
showScrollbar:
|
|
2386
|
+
scrollToIndex: V,
|
|
2387
|
+
showScrollbar: D,
|
|
2482
2388
|
scrollViewportRef: t
|
|
2483
2389
|
};
|
|
2484
2390
|
}
|
|
2485
|
-
function
|
|
2391
|
+
function nr(e, t, n) {
|
|
2486
2392
|
return Math.min(Math.max(e, t), n);
|
|
2487
2393
|
}
|
|
2488
2394
|
//#endregion
|
|
2489
2395
|
//#region src/components/viewer-core/listCardAsset.ts
|
|
2490
|
-
function
|
|
2396
|
+
function rr(e) {
|
|
2491
2397
|
if (e) try {
|
|
2492
2398
|
e.removeAttribute("src"), e.src = "";
|
|
2493
2399
|
} catch {}
|
|
2494
2400
|
}
|
|
2495
|
-
function
|
|
2401
|
+
function ir(e) {
|
|
2496
2402
|
if (e) {
|
|
2497
2403
|
try {
|
|
2498
2404
|
e.currentTime = 0;
|
|
@@ -2503,12 +2409,12 @@ function cr(e) {
|
|
|
2503
2409
|
} catch {}
|
|
2504
2410
|
}
|
|
2505
2411
|
}
|
|
2506
|
-
function
|
|
2412
|
+
function ar(e, t) {
|
|
2507
2413
|
if (t) return e.bottom > t.top && e.top < t.bottom;
|
|
2508
2414
|
let n = window.innerHeight || document.documentElement.clientHeight || 0;
|
|
2509
2415
|
return e.bottom > 0 && e.top < n;
|
|
2510
2416
|
}
|
|
2511
|
-
function
|
|
2417
|
+
function or(e) {
|
|
2512
2418
|
if (!e) return null;
|
|
2513
2419
|
try {
|
|
2514
2420
|
return new URL(e, window.location.href).href;
|
|
@@ -2518,22 +2424,22 @@ function ur(e) {
|
|
|
2518
2424
|
}
|
|
2519
2425
|
//#endregion
|
|
2520
2426
|
//#region src/components/viewer-core/listPreview.ts
|
|
2521
|
-
var
|
|
2522
|
-
function
|
|
2523
|
-
let t = e.preview?.url ?? e.url, n =
|
|
2427
|
+
var sr = /\.(avif|gif|jpe?g|png|svg|webp)(\?|#|$)/i, cr = /\.(m4v|mov|mp4|mpeg|ogg|ogv|webm)(\?|#|$)/i;
|
|
2428
|
+
function lr(e) {
|
|
2429
|
+
let t = e.preview?.url ?? e.url, n = vn(e), r = e.title?.trim() || At(e.type);
|
|
2524
2430
|
return e.type !== "image" && e.type !== "video" ? {
|
|
2525
2431
|
kind: "fallback",
|
|
2526
2432
|
url: null,
|
|
2527
2433
|
width: n.width,
|
|
2528
2434
|
height: n.height,
|
|
2529
2435
|
label: r
|
|
2530
|
-
} :
|
|
2436
|
+
} : dr(e, t) ? {
|
|
2531
2437
|
kind: "video",
|
|
2532
2438
|
url: t,
|
|
2533
2439
|
width: n.width,
|
|
2534
2440
|
height: n.height,
|
|
2535
2441
|
label: r
|
|
2536
|
-
} :
|
|
2442
|
+
} : ur(e, t) ? {
|
|
2537
2443
|
kind: "image",
|
|
2538
2444
|
url: t,
|
|
2539
2445
|
width: n.width,
|
|
@@ -2547,33 +2453,82 @@ function pr(e) {
|
|
|
2547
2453
|
label: r
|
|
2548
2454
|
};
|
|
2549
2455
|
}
|
|
2550
|
-
function
|
|
2551
|
-
return e.type !== "image" || typeof t != "string" ? !1 :
|
|
2456
|
+
function ur(e, t) {
|
|
2457
|
+
return e.type !== "image" || typeof t != "string" ? !1 : sr.test(t) || fr(t);
|
|
2552
2458
|
}
|
|
2553
|
-
function
|
|
2554
|
-
return e.type === "video" && typeof t == "string" &&
|
|
2459
|
+
function dr(e, t) {
|
|
2460
|
+
return e.type === "video" && typeof t == "string" && cr.test(t);
|
|
2555
2461
|
}
|
|
2556
|
-
function
|
|
2462
|
+
function fr(e) {
|
|
2557
2463
|
return /^https?:\/\//i.test(e);
|
|
2558
2464
|
}
|
|
2559
2465
|
//#endregion
|
|
2560
|
-
//#region src/components/viewer-core/
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2466
|
+
//#region src/components/viewer-core/useAssetLoadQueue.ts
|
|
2467
|
+
var pr = {
|
|
2468
|
+
maxGlobal: 10,
|
|
2469
|
+
maxPerDomain: 4,
|
|
2470
|
+
maxVideoPerDomain: 2
|
|
2471
|
+
};
|
|
2472
|
+
function mr(e = pr) {
|
|
2473
|
+
let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = 0;
|
|
2474
|
+
function i(e) {
|
|
2475
|
+
let i = {
|
|
2476
|
+
...e,
|
|
2477
|
+
domain: _r(e.url),
|
|
2478
|
+
enqueuedAt: r,
|
|
2479
|
+
id: `vibe-asset-load-${r += 1}`
|
|
2480
|
+
};
|
|
2481
|
+
return n.set(i.id, i), a(), {
|
|
2482
|
+
cancel() {
|
|
2483
|
+
(n.delete(i.id) || t.delete(i.id)) && a();
|
|
2484
|
+
},
|
|
2485
|
+
refresh() {
|
|
2486
|
+
a();
|
|
2487
|
+
},
|
|
2488
|
+
release() {
|
|
2489
|
+
(t.delete(i.id) || n.delete(i.id)) && a();
|
|
2490
|
+
}
|
|
2491
|
+
};
|
|
2492
|
+
}
|
|
2493
|
+
function a() {
|
|
2494
|
+
if (n.size === 0) return;
|
|
2495
|
+
let r = [...n.values()].sort((e, t) => {
|
|
2496
|
+
let n = gr(e) - gr(t);
|
|
2497
|
+
return n === 0 ? e.enqueuedAt - t.enqueuedAt : n;
|
|
2498
|
+
});
|
|
2499
|
+
for (let i of r) {
|
|
2500
|
+
if (t.size >= e.maxGlobal) return;
|
|
2501
|
+
if (o(i)) {
|
|
2502
|
+
n.delete(i.id), t.set(i.id, i);
|
|
2503
|
+
try {
|
|
2504
|
+
i.onGrant();
|
|
2505
|
+
} catch {
|
|
2506
|
+
t.delete(i.id);
|
|
2507
|
+
}
|
|
2571
2508
|
}
|
|
2572
|
-
t ||= requestAnimationFrame(() => {
|
|
2573
|
-
t = 0, e();
|
|
2574
|
-
});
|
|
2575
2509
|
}
|
|
2576
|
-
}
|
|
2510
|
+
}
|
|
2511
|
+
function o(n) {
|
|
2512
|
+
let r = [...t.values()].filter((e) => e.domain === n.domain);
|
|
2513
|
+
return !(r.length >= e.maxPerDomain || n.assetType === "video" && r.filter((e) => e.assetType === "video").length >= e.maxVideoPerDomain);
|
|
2514
|
+
}
|
|
2515
|
+
return { request: i };
|
|
2516
|
+
}
|
|
2517
|
+
var hr = mr();
|
|
2518
|
+
function gr(e) {
|
|
2519
|
+
try {
|
|
2520
|
+
let t = e.getPriority();
|
|
2521
|
+
return Number.isFinite(t) ? t : Infinity;
|
|
2522
|
+
} catch {
|
|
2523
|
+
return Infinity;
|
|
2524
|
+
}
|
|
2525
|
+
}
|
|
2526
|
+
function _r(e) {
|
|
2527
|
+
try {
|
|
2528
|
+
return new URL(e).hostname || "local";
|
|
2529
|
+
} catch {
|
|
2530
|
+
return "local";
|
|
2531
|
+
}
|
|
2577
2532
|
}
|
|
2578
2533
|
//#endregion
|
|
2579
2534
|
//#region src/components/ListCard.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -2591,7 +2546,6 @@ var vr = ["aria-label"], yr = {
|
|
|
2591
2546
|
type: Boolean,
|
|
2592
2547
|
default: !1
|
|
2593
2548
|
},
|
|
2594
|
-
assetLoadQueue: { default: null },
|
|
2595
2549
|
index: { default: 0 },
|
|
2596
2550
|
item: {},
|
|
2597
2551
|
reportAssetError: {
|
|
@@ -2609,80 +2563,80 @@ var vr = ["aria-label"], yr = {
|
|
|
2609
2563
|
},
|
|
2610
2564
|
emits: ["open"],
|
|
2611
2565
|
setup(e, { emit: t }) {
|
|
2612
|
-
let n = e, r = t, l = i(() =>
|
|
2613
|
-
n.surfaceActive && (X(), q(), J());
|
|
2614
|
-
});
|
|
2566
|
+
let n = e, r = t, l = i(() => lr(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), F = i(() => !!h.value), I = i(() => gt(h.value)), L = i(() => A.value && !h.value && (!w.value || !m.value)), R = null, z = null, B = /* @__PURE__ */ new Set();
|
|
2615
2567
|
P([E, () => l.value.kind], () => {
|
|
2616
2568
|
let e = l.value.kind === "fallback";
|
|
2617
2569
|
m.value = e, h.value = null, e && (w.value = !0);
|
|
2618
2570
|
}), P(A, () => {
|
|
2619
|
-
|
|
2571
|
+
W();
|
|
2620
2572
|
}), P([
|
|
2621
2573
|
d,
|
|
2622
2574
|
m,
|
|
2623
2575
|
E
|
|
2624
2576
|
], () => {
|
|
2625
|
-
|
|
2577
|
+
G();
|
|
2626
2578
|
}), P(() => n.surfaceActive, (e) => {
|
|
2627
2579
|
if (!e) {
|
|
2628
|
-
|
|
2580
|
+
q(), G();
|
|
2629
2581
|
return;
|
|
2630
2582
|
}
|
|
2631
|
-
|
|
2583
|
+
requestAnimationFrame(() => {
|
|
2584
|
+
J(), W(), G();
|
|
2585
|
+
});
|
|
2632
2586
|
}), x(() => {
|
|
2633
2587
|
if (!v.value || typeof IntersectionObserver > "u") {
|
|
2634
|
-
y.value = null, d.value = !0,
|
|
2588
|
+
y.value = null, d.value = !0, W();
|
|
2635
2589
|
return;
|
|
2636
2590
|
}
|
|
2637
|
-
y.value = v.value.closest("[data-testid=\"vibe-list-scroll\"]"),
|
|
2638
|
-
for (let t of e) t.target === v.value && (n.surfaceActive &&
|
|
2591
|
+
y.value = v.value.closest("[data-testid=\"vibe-list-scroll\"]"), R = new IntersectionObserver((e) => {
|
|
2592
|
+
for (let t of e) t.target === v.value && (n.surfaceActive && J(t), W(), G());
|
|
2639
2593
|
}, {
|
|
2640
2594
|
root: y.value,
|
|
2641
2595
|
threshold: [0, 1]
|
|
2642
2596
|
}), R.observe(v.value);
|
|
2643
2597
|
}), b(() => {
|
|
2644
|
-
|
|
2598
|
+
K(), R?.disconnect(), R = null;
|
|
2645
2599
|
});
|
|
2646
|
-
function
|
|
2647
|
-
|
|
2600
|
+
function V() {
|
|
2601
|
+
X(g.value) && (m.value = !0, h.value = null, Y(E.value ?? n.item.url), q());
|
|
2648
2602
|
}
|
|
2649
|
-
async function
|
|
2650
|
-
if (!
|
|
2603
|
+
async function te() {
|
|
2604
|
+
if (!X(g.value)) return;
|
|
2651
2605
|
let e = E.value ?? n.item.url;
|
|
2652
2606
|
m.value = !1, h.value = "generic";
|
|
2653
|
-
let t = await
|
|
2607
|
+
let t = await _t(e);
|
|
2654
2608
|
h.value = t, n.reportAssetError?.({
|
|
2655
2609
|
item: n.item,
|
|
2656
|
-
occurrenceKey:
|
|
2610
|
+
occurrenceKey: Q(n.item),
|
|
2657
2611
|
url: e,
|
|
2658
2612
|
kind: t,
|
|
2659
2613
|
surface: "grid"
|
|
2660
|
-
}),
|
|
2614
|
+
}), q();
|
|
2661
2615
|
}
|
|
2662
|
-
function
|
|
2663
|
-
|
|
2616
|
+
function H() {
|
|
2617
|
+
X(C.value) && (m.value = !0, h.value = null, Y(E.value ?? n.item.url), q(), G());
|
|
2664
2618
|
}
|
|
2665
|
-
function
|
|
2666
|
-
|
|
2619
|
+
function U() {
|
|
2620
|
+
X(C.value) && (m.value = !1);
|
|
2667
2621
|
}
|
|
2668
|
-
function
|
|
2622
|
+
function W() {
|
|
2669
2623
|
if (l.value.kind === "fallback") {
|
|
2670
|
-
|
|
2624
|
+
K(!1);
|
|
2671
2625
|
return;
|
|
2672
2626
|
}
|
|
2673
2627
|
if (!n.surfaceActive) {
|
|
2674
|
-
|
|
2628
|
+
q();
|
|
2675
2629
|
return;
|
|
2676
2630
|
}
|
|
2677
2631
|
if (!A.value) {
|
|
2678
|
-
|
|
2632
|
+
K();
|
|
2679
2633
|
return;
|
|
2680
2634
|
}
|
|
2681
2635
|
if (w.value || z) {
|
|
2682
2636
|
z?.refresh();
|
|
2683
2637
|
return;
|
|
2684
2638
|
}
|
|
2685
|
-
z =
|
|
2639
|
+
z = hr.request({
|
|
2686
2640
|
assetType: l.value.kind,
|
|
2687
2641
|
getPriority: se,
|
|
2688
2642
|
onGrant() {
|
|
@@ -2691,7 +2645,7 @@ var vr = ["aria-label"], yr = {
|
|
|
2691
2645
|
url: l.value.url ?? n.item.url
|
|
2692
2646
|
});
|
|
2693
2647
|
}
|
|
2694
|
-
function
|
|
2648
|
+
function G() {
|
|
2695
2649
|
let e = C.value;
|
|
2696
2650
|
if (!(!e || l.value.kind !== "video")) {
|
|
2697
2651
|
if (h.value) {
|
|
@@ -2699,7 +2653,7 @@ var vr = ["aria-label"], yr = {
|
|
|
2699
2653
|
return;
|
|
2700
2654
|
}
|
|
2701
2655
|
if (E.value && d.value && m.value) {
|
|
2702
|
-
e.muted = !0, e.loop = !0, e.playsInline = !0,
|
|
2656
|
+
e.muted = !0, e.loop = !0, e.playsInline = !0, bt(e);
|
|
2703
2657
|
return;
|
|
2704
2658
|
}
|
|
2705
2659
|
try {
|
|
@@ -2708,23 +2662,23 @@ var vr = ["aria-label"], yr = {
|
|
|
2708
2662
|
e.pause();
|
|
2709
2663
|
}
|
|
2710
2664
|
}
|
|
2711
|
-
function
|
|
2712
|
-
w.value = l.value.kind === "fallback", h.value = null, m.value = l.value.kind === "fallback", e && (
|
|
2665
|
+
function K(e = !0) {
|
|
2666
|
+
w.value = l.value.kind === "fallback", h.value = null, m.value = l.value.kind === "fallback", e && (ie(), ae()), q();
|
|
2713
2667
|
}
|
|
2714
|
-
function
|
|
2668
|
+
function q() {
|
|
2715
2669
|
z?.release(), z = null;
|
|
2716
2670
|
}
|
|
2717
|
-
function
|
|
2671
|
+
function J(e) {
|
|
2718
2672
|
let t = v.value;
|
|
2719
2673
|
if (!t) {
|
|
2720
2674
|
d.value = !0;
|
|
2721
2675
|
return;
|
|
2722
2676
|
}
|
|
2723
|
-
d.value =
|
|
2677
|
+
d.value = ar(e?.boundingClientRect ?? t.getBoundingClientRect(), e?.rootBounds ?? y.value?.getBoundingClientRect() ?? null);
|
|
2724
2678
|
}
|
|
2725
|
-
function
|
|
2679
|
+
function Y(e) {
|
|
2726
2680
|
if (!e) return;
|
|
2727
|
-
let t =
|
|
2681
|
+
let t = Q(n.item), r = `${t}|${e}`;
|
|
2728
2682
|
B.has(r) || (B.add(r), n.reportAssetLoad?.({
|
|
2729
2683
|
item: n.item,
|
|
2730
2684
|
occurrenceKey: t,
|
|
@@ -2732,18 +2686,18 @@ var vr = ["aria-label"], yr = {
|
|
|
2732
2686
|
url: e
|
|
2733
2687
|
}));
|
|
2734
2688
|
}
|
|
2735
|
-
function
|
|
2689
|
+
function ne() {
|
|
2736
2690
|
if (!I.value) return;
|
|
2737
|
-
let e =
|
|
2691
|
+
let e = Q(n.item);
|
|
2738
2692
|
B.forEach((t) => {
|
|
2739
2693
|
t.startsWith(`${e}|`) && B.delete(t);
|
|
2740
|
-
}), h.value = null, m.value = !1, w.value = !1,
|
|
2694
|
+
}), h.value = null, m.value = !1, w.value = !1, q(), W();
|
|
2741
2695
|
}
|
|
2742
|
-
function
|
|
2743
|
-
|
|
2696
|
+
function ie() {
|
|
2697
|
+
rr(g.value);
|
|
2744
2698
|
}
|
|
2745
|
-
function
|
|
2746
|
-
|
|
2699
|
+
function ae() {
|
|
2700
|
+
ir(C.value);
|
|
2747
2701
|
}
|
|
2748
2702
|
function se() {
|
|
2749
2703
|
let e = v.value;
|
|
@@ -2756,17 +2710,17 @@ var vr = ["aria-label"], yr = {
|
|
|
2756
2710
|
let n = window.innerHeight / 2;
|
|
2757
2711
|
return Math.abs((t.top + t.bottom) / 2 - n);
|
|
2758
2712
|
}
|
|
2759
|
-
function
|
|
2760
|
-
let t =
|
|
2761
|
-
return !e || !t ? !1 :
|
|
2713
|
+
function X(e) {
|
|
2714
|
+
let t = or(E.value);
|
|
2715
|
+
return !e || !t ? !1 : or("currentSrc" in e && e.currentSrc || e.getAttribute("src")) === t;
|
|
2762
2716
|
}
|
|
2763
|
-
function
|
|
2717
|
+
function ce() {
|
|
2764
2718
|
r("open");
|
|
2765
2719
|
}
|
|
2766
|
-
function
|
|
2720
|
+
function le() {
|
|
2767
2721
|
f.value = !0;
|
|
2768
2722
|
}
|
|
2769
|
-
function
|
|
2723
|
+
function Z(e) {
|
|
2770
2724
|
let t = e.relatedTarget;
|
|
2771
2725
|
v.value && t instanceof Node && v.value.contains(t) || (f.value = !1);
|
|
2772
2726
|
}
|
|
@@ -2775,8 +2729,8 @@ var vr = ["aria-label"], yr = {
|
|
|
2775
2729
|
ref: v,
|
|
2776
2730
|
"data-testid": "vibe-list-card-inner",
|
|
2777
2731
|
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"]),
|
|
2778
|
-
onFocusin:
|
|
2779
|
-
onFocusout:
|
|
2732
|
+
onFocusin: le,
|
|
2733
|
+
onFocusout: Z,
|
|
2780
2734
|
onPointerenter: t[0] ||= (e) => p.value = !0,
|
|
2781
2735
|
onPointerleave: t[1] ||= (e) => p.value = !1
|
|
2782
2736
|
}, [
|
|
@@ -2785,9 +2739,9 @@ var vr = ["aria-label"], yr = {
|
|
|
2785
2739
|
"data-testid": "vibe-list-card-open",
|
|
2786
2740
|
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]",
|
|
2787
2741
|
"aria-label": n.item.title || `Open item ${n.index + 1}`,
|
|
2788
|
-
onClick:
|
|
2742
|
+
onClick: ce
|
|
2789
2743
|
}, null, 8, vr),
|
|
2790
|
-
L.value ? (S(), s("div", yr, [c("span", br, [u(j(
|
|
2744
|
+
L.value ? (S(), s("div", yr, [c("span", br, [u(j(re), {
|
|
2791
2745
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
2792
2746
|
"aria-hidden": "true"
|
|
2793
2747
|
})])])) : o("", !0),
|
|
@@ -2799,8 +2753,8 @@ var vr = ["aria-label"], yr = {
|
|
|
2799
2753
|
alt: l.value.label,
|
|
2800
2754
|
draggable: "false",
|
|
2801
2755
|
class: _(["block h-full w-full object-cover transition-opacity duration-300", m.value ? "pointer-events-none opacity-100" : "pointer-events-none opacity-0"]),
|
|
2802
|
-
onLoad:
|
|
2803
|
-
onError:
|
|
2756
|
+
onLoad: V,
|
|
2757
|
+
onError: te
|
|
2804
2758
|
}, null, 42, xr)) : N.value && E.value && !F.value ? (S(), s("video", {
|
|
2805
2759
|
key: 2,
|
|
2806
2760
|
ref_key: "videoRef",
|
|
@@ -2811,33 +2765,33 @@ var vr = ["aria-label"], yr = {
|
|
|
2811
2765
|
playsinline: "",
|
|
2812
2766
|
preload: "metadata",
|
|
2813
2767
|
class: _(["block h-full w-full object-cover transition-opacity duration-300", m.value ? "pointer-events-none opacity-100" : "pointer-events-none opacity-0"]),
|
|
2814
|
-
onCanplay:
|
|
2815
|
-
onError:
|
|
2816
|
-
onLoadstart:
|
|
2817
|
-
onPlaying:
|
|
2818
|
-
onStalled:
|
|
2819
|
-
onWaiting:
|
|
2768
|
+
onCanplay: H,
|
|
2769
|
+
onError: te,
|
|
2770
|
+
onLoadstart: U,
|
|
2771
|
+
onPlaying: H,
|
|
2772
|
+
onStalled: U,
|
|
2773
|
+
onWaiting: U
|
|
2820
2774
|
}, null, 42, Sr)) : F.value ? (S(), s("div", {
|
|
2821
2775
|
key: 3,
|
|
2822
2776
|
"data-testid": "vibe-list-card-error",
|
|
2823
2777
|
"data-kind": h.value,
|
|
2824
2778
|
class: "relative z-[2] grid h-full w-full place-items-center bg-[radial-gradient(circle_at_center,rgba(239,68,68,0.12),transparent_65%),linear-gradient(180deg,rgba(255,255,255,0.04),rgba(255,255,255,0.02))]"
|
|
2825
2779
|
}, [c("div", wr, [
|
|
2826
|
-
u(j(
|
|
2780
|
+
u(j(oe), {
|
|
2827
2781
|
class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
|
|
2828
2782
|
"aria-hidden": "true"
|
|
2829
2783
|
}),
|
|
2830
|
-
c("span", Tr, k(j(
|
|
2784
|
+
c("span", Tr, k(j(ht)(h.value)), 1),
|
|
2831
2785
|
I.value ? (S(), s("button", {
|
|
2832
2786
|
key: 0,
|
|
2833
2787
|
type: "button",
|
|
2834
2788
|
class: "pointer-events-auto inline-flex items-center justify-center border border-white/14 bg-black/35 px-3 py-2 text-[0.62rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/82 backdrop-blur-[18px] transition hover:border-white/28 hover:bg-black/50",
|
|
2835
|
-
onClick: ee(
|
|
2789
|
+
onClick: ee(ne, ["stop"])
|
|
2836
2790
|
}, " Retry ")) : o("", !0)
|
|
2837
2791
|
])], 8, Cr)) : (S(), s("div", Er, [c("div", Dr, [D(e.$slots, "item-icon", {
|
|
2838
|
-
icon: j(
|
|
2792
|
+
icon: j(kt)(n.item.type),
|
|
2839
2793
|
item: n.item
|
|
2840
|
-
}, () => [(S(), a(O(j(
|
|
2794
|
+
}, () => [(S(), a(O(j(kt)(n.item.type)), {
|
|
2841
2795
|
class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
|
|
2842
2796
|
"aria-hidden": "true"
|
|
2843
2797
|
}))])])])),
|
|
@@ -2847,7 +2801,7 @@ var vr = ["aria-label"], yr = {
|
|
|
2847
2801
|
hovered: p.value,
|
|
2848
2802
|
index: n.index,
|
|
2849
2803
|
item: n.item,
|
|
2850
|
-
openFullscreen:
|
|
2804
|
+
openFullscreen: ce
|
|
2851
2805
|
})])
|
|
2852
2806
|
], 34));
|
|
2853
2807
|
}
|
|
@@ -2879,7 +2833,10 @@ var vr = ["aria-label"], yr = {
|
|
|
2879
2833
|
default: !0
|
|
2880
2834
|
},
|
|
2881
2835
|
activeIndex: { default: 0 },
|
|
2882
|
-
|
|
2836
|
+
allowExhaustedNextPageRefresh: {
|
|
2837
|
+
type: Boolean,
|
|
2838
|
+
default: !1
|
|
2839
|
+
},
|
|
2883
2840
|
commitPendingAppend: {
|
|
2884
2841
|
type: [Function, null],
|
|
2885
2842
|
default: null
|
|
@@ -2923,8 +2880,9 @@ var vr = ["aria-label"], yr = {
|
|
|
2923
2880
|
},
|
|
2924
2881
|
emits: ["open-fullscreen", "update:activeIndex"],
|
|
2925
2882
|
setup(e, { emit: n }) {
|
|
2926
|
-
let r = e, a = M(), d = n, f =
|
|
2883
|
+
let r = e, a = M(), d = n, f = tr({
|
|
2927
2884
|
active: A(r, "active"),
|
|
2885
|
+
allowExhaustedNextPageRefresh: A(r, "allowExhaustedNextPageRefresh"),
|
|
2928
2886
|
items: A(r, "items"),
|
|
2929
2887
|
activeIndex: A(r, "activeIndex"),
|
|
2930
2888
|
loading: A(r, "loading"),
|
|
@@ -2939,14 +2897,14 @@ var vr = ["aria-label"], yr = {
|
|
|
2939
2897
|
setActiveIndex(e) {
|
|
2940
2898
|
d("update:activeIndex", e);
|
|
2941
2899
|
}
|
|
2942
|
-
}), p = i(() =>
|
|
2900
|
+
}), p = i(() => !r.showStatusBadges || !f.footerStatusMessage.value ? null : {
|
|
2943
2901
|
activeIndex: f.resolvedActiveIndex.value,
|
|
2944
2902
|
kind: r.loading ? "loading-more" : "end",
|
|
2945
2903
|
loading: r.loading,
|
|
2946
|
-
message:
|
|
2904
|
+
message: f.footerStatusMessage.value,
|
|
2947
2905
|
paginationDetail: r.paginationDetail,
|
|
2948
2906
|
total: r.items.length
|
|
2949
|
-
}),
|
|
2907
|
+
}), m = i(() => !p.value || !a["grid-status"] ? [] : a["grid-status"](p.value)), g = i(() => jt(m.value));
|
|
2950
2908
|
return (e, n) => (S(), s("div", Ar, [
|
|
2951
2909
|
c("div", jr, [c("span", Mr, [c("span", Nr, k(j(f).paginationLabel.value), 1), r.paginationDetail ? (S(), s("span", Pr, k(r.paginationDetail), 1)) : o("", !0)])]),
|
|
2952
2910
|
c("div", {
|
|
@@ -2960,17 +2918,16 @@ var vr = ["aria-label"], yr = {
|
|
|
2960
2918
|
class: "relative",
|
|
2961
2919
|
style: y({ height: `${j(f).containerHeight.value}px` })
|
|
2962
2920
|
}, [(S(!0), s(t, null, E(j(f).renderedItems.value, ({ item: t, index: n }) => (S(), s("article", {
|
|
2963
|
-
key: j(
|
|
2921
|
+
key: j(Q)(t),
|
|
2964
2922
|
"data-testid": "vibe-list-card",
|
|
2965
2923
|
"data-active": n === j(f).resolvedActiveIndex.value ? "true" : "false",
|
|
2966
2924
|
"data-index": n,
|
|
2967
2925
|
"data-item-id": t.id,
|
|
2968
|
-
"data-occurrence-key": j(
|
|
2926
|
+
"data-occurrence-key": j(Q)(t),
|
|
2969
2927
|
class: "absolute will-change-transform",
|
|
2970
2928
|
style: y(j(f).getCardStyle(n))
|
|
2971
2929
|
}, [u(kr, {
|
|
2972
2930
|
active: n === j(f).resolvedActiveIndex.value,
|
|
2973
|
-
"asset-load-queue": r.assetLoadQueue,
|
|
2974
2931
|
index: n,
|
|
2975
2932
|
item: t,
|
|
2976
2933
|
"report-asset-error": r.reportAssetError,
|
|
@@ -2987,7 +2944,6 @@ var vr = ["aria-label"], yr = {
|
|
|
2987
2944
|
key: "1"
|
|
2988
2945
|
} : void 0]), 1032, [
|
|
2989
2946
|
"active",
|
|
2990
|
-
"asset-load-queue",
|
|
2991
2947
|
"index",
|
|
2992
2948
|
"item",
|
|
2993
2949
|
"report-asset-error",
|
|
@@ -3001,10 +2957,10 @@ var vr = ["aria-label"], yr = {
|
|
|
3001
2957
|
style: y(j(f).getScrollbarThumbStyle())
|
|
3002
2958
|
}, null, 6)])) : o("", !0),
|
|
3003
2959
|
a["grid-footer"] ? (S(), s("div", Lr, [c("div", Rr, [D(e.$slots, "grid-footer")])])) : o("", !0),
|
|
3004
|
-
|
|
2960
|
+
p.value ? (S(), s("div", {
|
|
3005
2961
|
key: 2,
|
|
3006
2962
|
class: _(["pointer-events-none absolute inset-x-0 bottom-0 z-[3] flex justify-center px-6", a["grid-footer"] ? "pb-24" : "pb-6"])
|
|
3007
|
-
}, [
|
|
2963
|
+
}, [g.value ? D(e.$slots, "grid-status", v(h({ key: 0 }, p.value))) : (S(), s("span", zr, k(p.value.message), 1))], 2)) : o("", !0)
|
|
3008
2964
|
]));
|
|
3009
2965
|
}
|
|
3010
2966
|
}), Vr = ["data-surface-mode"], Hr = {
|
|
@@ -3025,64 +2981,57 @@ var vr = ["aria-label"], yr = {
|
|
|
3025
2981
|
loading: { type: Boolean },
|
|
3026
2982
|
hasNextPage: { type: Boolean },
|
|
3027
2983
|
mode: {},
|
|
3028
|
-
resolve: {},
|
|
2984
|
+
resolve: { type: Function },
|
|
3029
2985
|
initialCursor: {},
|
|
3030
2986
|
pageSize: {},
|
|
3031
|
-
assetLoadLimits: {},
|
|
3032
2987
|
hasPreviousPage: { type: Boolean },
|
|
3033
2988
|
paginationDetail: {},
|
|
3034
|
-
requestNextPage: {},
|
|
3035
|
-
requestPreviousPage: {},
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
default: !0
|
|
3039
|
-
},
|
|
3040
|
-
surfaceMode: {}
|
|
2989
|
+
requestNextPage: { type: [Function, null] },
|
|
2990
|
+
requestPreviousPage: { type: [Function, null] },
|
|
2991
|
+
showEndBadge: { type: Boolean },
|
|
2992
|
+
showStatusBadges: { type: Boolean }
|
|
3041
2993
|
},
|
|
3042
2994
|
emits: [
|
|
3043
2995
|
"asset-errors",
|
|
3044
2996
|
"asset-loads",
|
|
3045
|
-
"update:activeIndex"
|
|
3046
|
-
"update:surfaceMode"
|
|
2997
|
+
"update:activeIndex"
|
|
3047
2998
|
],
|
|
3048
2999
|
setup(e, { expose: n, emit: i }) {
|
|
3049
|
-
let d = e, p = M(), m = i, h =
|
|
3000
|
+
let d = e, p = M(), m = i, h = He(d, m), g = se((e) => {
|
|
3050
3001
|
m("asset-errors", e);
|
|
3051
|
-
}),
|
|
3002
|
+
}), _ = X((e) => {
|
|
3052
3003
|
m("asset-loads", e);
|
|
3053
3004
|
});
|
|
3054
3005
|
return b(() => {
|
|
3055
|
-
|
|
3056
|
-
}),
|
|
3057
|
-
h.
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
status: g.status,
|
|
3068
|
-
undo: g.undo
|
|
3006
|
+
g.stop(), _.stop();
|
|
3007
|
+
}), n({
|
|
3008
|
+
cancel: h.cancel,
|
|
3009
|
+
clearRemoved: h.clearRemoved,
|
|
3010
|
+
getRemovedIds: h.getRemovedIds,
|
|
3011
|
+
loadNext: h.loadNext,
|
|
3012
|
+
loadPrevious: h.loadPrevious,
|
|
3013
|
+
remove: h.remove,
|
|
3014
|
+
restore: h.restore,
|
|
3015
|
+
retry: h.retry,
|
|
3016
|
+
status: h.status,
|
|
3017
|
+
undo: h.undo
|
|
3069
3018
|
}), (e, n) => (S(), s("section", {
|
|
3070
3019
|
"data-testid": "vibe",
|
|
3071
|
-
"data-surface-mode": j(
|
|
3020
|
+
"data-surface-mode": j(h).surfaceMode.value,
|
|
3072
3021
|
class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f7f1ea]"
|
|
3073
|
-
}, [j(
|
|
3022
|
+
}, [j(h).canRetryInitialLoad.value ? (S(), s("button", {
|
|
3074
3023
|
key: 0,
|
|
3075
3024
|
type: "button",
|
|
3076
3025
|
class: "absolute left-5 top-5 z-30 inline-flex items-center border border-rose-400/55 bg-rose-500/18 px-4 py-2 text-xs font-medium uppercase tracking-[0.24em] text-white backdrop-blur transition hover:bg-rose-500/28",
|
|
3077
|
-
onClick: n[0] ||= (...e) => j(
|
|
3078
|
-
}, " Retry ")) : j(
|
|
3026
|
+
onClick: n[0] ||= (...e) => j(h).retryInitialLoad && j(h).retryInitialLoad(...e)
|
|
3027
|
+
}, " Retry ")) : j(h).errorMessage.value && j(h).items.value.length > 0 ? (S(), s("div", Hr, k(j(h).errorMessage.value), 1)) : o("", !0), j(h).items.value.length === 0 ? (S(), s("div", Ur, [j(h).loading.value ? (S(), s(t, { key: 0 }, [u(j(re), {
|
|
3079
3028
|
class: "size-10 animate-spin text-[#f7f1ea]/82",
|
|
3080
3029
|
"aria-hidden": "true"
|
|
3081
3030
|
}), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)], 64)) : (S(), s(t, { key: 1 }, [
|
|
3082
3031
|
n[2] ||= c("p", { class: "m-0 text-[0.78rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/68" }, " Viewer ready ", -1),
|
|
3083
3032
|
n[3] ||= c("h2", { class: "m-0 text-[clamp(2rem,4.4vw,3.6rem)] leading-[0.95] tracking-[-0.05em]" }, " No items available ", -1),
|
|
3084
3033
|
n[4] ||= c("p", { class: "m-0 text-[clamp(0.98rem,1.3vw,1.12rem)] leading-[1.8] text-[#f7f1ea]/70" }, " Attach items to VibeLayout to turn this screen into the viewer. ", -1)
|
|
3085
|
-
], 64))])) : j(
|
|
3034
|
+
], 64))])) : j(h).isDesktop.value ? (S(), s(t, { key: 3 }, [u(r, {
|
|
3086
3035
|
appear: "",
|
|
3087
3036
|
"enter-active-class": "transition-[opacity,transform] duration-300 ease-out",
|
|
3088
3037
|
"enter-from-class": "translate-y-3 opacity-0",
|
|
@@ -3093,28 +3042,28 @@ var vr = ["aria-label"], yr = {
|
|
|
3093
3042
|
}, {
|
|
3094
3043
|
default: I(() => [L(c("div", {
|
|
3095
3044
|
"data-testid": "vibe-list-surface",
|
|
3096
|
-
"data-visible": j(
|
|
3097
|
-
inert: j(
|
|
3045
|
+
"data-visible": j(h).surfaceMode.value === "list" ? "true" : "false",
|
|
3046
|
+
inert: j(h).surfaceMode.value !== "list",
|
|
3098
3047
|
class: "absolute inset-0 z-[2]"
|
|
3099
3048
|
}, [u(Br, {
|
|
3100
|
-
active: j(
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
"
|
|
3104
|
-
loading: j(
|
|
3105
|
-
"has-next-page": j(
|
|
3106
|
-
"has-previous-page": j(
|
|
3107
|
-
"pending-append-items": j(
|
|
3108
|
-
"commit-pending-append": j(
|
|
3109
|
-
"pagination-detail": j(
|
|
3110
|
-
"report-asset-error": j(
|
|
3111
|
-
"report-asset-load": j(
|
|
3112
|
-
"request-next-page": j(
|
|
3113
|
-
"request-previous-page": j(
|
|
3114
|
-
"restore-token": j(
|
|
3115
|
-
"show-status-badges": d.showStatusBadges
|
|
3116
|
-
onOpenFullscreen: j(
|
|
3117
|
-
"onUpdate:activeIndex": j(
|
|
3049
|
+
active: j(h).surfaceMode.value === "list",
|
|
3050
|
+
"allow-exhausted-next-page-refresh": j(h).canRefreshExhaustedNextPage.value,
|
|
3051
|
+
items: j(h).items.value,
|
|
3052
|
+
"active-index": j(h).activeIndex.value,
|
|
3053
|
+
loading: j(h).loading.value,
|
|
3054
|
+
"has-next-page": j(h).hasNextPage.value,
|
|
3055
|
+
"has-previous-page": j(h).hasPreviousPage.value,
|
|
3056
|
+
"pending-append-items": j(h).pendingAppendItems.value,
|
|
3057
|
+
"commit-pending-append": j(h).commitPendingAppend,
|
|
3058
|
+
"pagination-detail": j(h).paginationDetail.value,
|
|
3059
|
+
"report-asset-error": j(g).report,
|
|
3060
|
+
"report-asset-load": j(_).report,
|
|
3061
|
+
"request-next-page": j(h).prefetchNextPage,
|
|
3062
|
+
"request-previous-page": j(h).prefetchPreviousPage,
|
|
3063
|
+
"restore-token": j(h).listRestoreToken.value,
|
|
3064
|
+
"show-status-badges": d.showStatusBadges ?? !0,
|
|
3065
|
+
onOpenFullscreen: j(h).openFullscreen,
|
|
3066
|
+
"onUpdate:activeIndex": j(h).setActiveIndex
|
|
3118
3067
|
}, l({ _: 2 }, [
|
|
3119
3068
|
p["grid-footer"] ? {
|
|
3120
3069
|
name: "grid-footer",
|
|
@@ -3126,7 +3075,7 @@ var vr = ["aria-label"], yr = {
|
|
|
3126
3075
|
fn: I((t) => [D(e.$slots, "grid-item-overlay", v(f(t)))]),
|
|
3127
3076
|
key: "1"
|
|
3128
3077
|
} : void 0,
|
|
3129
|
-
|
|
3078
|
+
p["grid-status"] ? {
|
|
3130
3079
|
name: "grid-status",
|
|
3131
3080
|
fn: I((t) => [D(e.$slots, "grid-status", v(f(t)))]),
|
|
3132
3081
|
key: "2"
|
|
@@ -3138,9 +3087,9 @@ var vr = ["aria-label"], yr = {
|
|
|
3138
3087
|
} : void 0
|
|
3139
3088
|
]), 1032, [
|
|
3140
3089
|
"active",
|
|
3090
|
+
"allow-exhausted-next-page-refresh",
|
|
3141
3091
|
"items",
|
|
3142
3092
|
"active-index",
|
|
3143
|
-
"asset-load-queue",
|
|
3144
3093
|
"loading",
|
|
3145
3094
|
"has-next-page",
|
|
3146
3095
|
"has-previous-page",
|
|
@@ -3155,7 +3104,7 @@ var vr = ["aria-label"], yr = {
|
|
|
3155
3104
|
"show-status-badges",
|
|
3156
3105
|
"onOpenFullscreen",
|
|
3157
3106
|
"onUpdate:activeIndex"
|
|
3158
|
-
])], 8, Wr), [[N, j(
|
|
3107
|
+
])], 8, Wr), [[N, j(h).surfaceMode.value === "list"]])]),
|
|
3159
3108
|
_: 3
|
|
3160
3109
|
}), u(r, {
|
|
3161
3110
|
appear: "",
|
|
@@ -3168,22 +3117,23 @@ var vr = ["aria-label"], yr = {
|
|
|
3168
3117
|
}, {
|
|
3169
3118
|
default: I(() => [L(c("div", {
|
|
3170
3119
|
"data-testid": "vibe-fullscreen-surface",
|
|
3171
|
-
"data-visible": j(
|
|
3172
|
-
inert: j(
|
|
3120
|
+
"data-visible": j(h).surfaceMode.value === "fullscreen" ? "true" : "false",
|
|
3121
|
+
inert: j(h).surfaceMode.value !== "fullscreen",
|
|
3173
3122
|
class: "absolute inset-0 z-[3]"
|
|
3174
|
-
}, [u(
|
|
3175
|
-
items: j(
|
|
3176
|
-
active: j(
|
|
3177
|
-
"active-index": j(
|
|
3178
|
-
loading: j(
|
|
3179
|
-
"has-next-page": j(
|
|
3180
|
-
"pagination-detail": j(
|
|
3181
|
-
"report-asset-error": j(
|
|
3182
|
-
"report-asset-load": j(
|
|
3183
|
-
"show-
|
|
3184
|
-
"show-status-badges": d.showStatusBadges
|
|
3185
|
-
|
|
3186
|
-
|
|
3123
|
+
}, [u(hn, {
|
|
3124
|
+
items: j(h).items.value,
|
|
3125
|
+
active: j(h).surfaceMode.value === "fullscreen",
|
|
3126
|
+
"active-index": j(h).activeIndex.value,
|
|
3127
|
+
loading: j(h).loading.value,
|
|
3128
|
+
"has-next-page": j(h).hasNextPage.value,
|
|
3129
|
+
"pagination-detail": j(h).paginationDetail.value,
|
|
3130
|
+
"report-asset-error": j(g).report,
|
|
3131
|
+
"report-asset-load": j(_).report,
|
|
3132
|
+
"show-end-badge": d.showEndBadge ?? !0,
|
|
3133
|
+
"show-status-badges": d.showStatusBadges ?? !0,
|
|
3134
|
+
"show-back-to-list": j(h).showBackToList.value,
|
|
3135
|
+
onBackToList: j(h).returnToList,
|
|
3136
|
+
"onUpdate:activeIndex": j(h).setActiveIndex
|
|
3187
3137
|
}, l({ _: 2 }, [
|
|
3188
3138
|
p["fullscreen-overlay"] ? {
|
|
3189
3139
|
name: "fullscreen-overlay",
|
|
@@ -3200,7 +3150,7 @@ var vr = ["aria-label"], yr = {
|
|
|
3200
3150
|
fn: I((t) => [D(e.$slots, "fullscreen-header-actions", v(f(t)))]),
|
|
3201
3151
|
key: "2"
|
|
3202
3152
|
} : void 0,
|
|
3203
|
-
|
|
3153
|
+
p["fullscreen-status"] ? {
|
|
3204
3154
|
name: "fullscreen-status",
|
|
3205
3155
|
fn: I((t) => [D(e.$slots, "fullscreen-status", v(f(t)))]),
|
|
3206
3156
|
key: "3"
|
|
@@ -3219,26 +3169,28 @@ var vr = ["aria-label"], yr = {
|
|
|
3219
3169
|
"pagination-detail",
|
|
3220
3170
|
"report-asset-error",
|
|
3221
3171
|
"report-asset-load",
|
|
3222
|
-
"show-
|
|
3172
|
+
"show-end-badge",
|
|
3223
3173
|
"show-status-badges",
|
|
3174
|
+
"show-back-to-list",
|
|
3224
3175
|
"onBackToList",
|
|
3225
3176
|
"onUpdate:activeIndex"
|
|
3226
|
-
])], 8, Gr), [[N, j(
|
|
3177
|
+
])], 8, Gr), [[N, j(h).surfaceMode.value === "fullscreen"]])]),
|
|
3227
3178
|
_: 3
|
|
3228
|
-
})], 64)) : (S(), a(
|
|
3179
|
+
})], 64)) : (S(), a(hn, {
|
|
3229
3180
|
key: 4,
|
|
3230
|
-
items: j(
|
|
3181
|
+
items: j(h).items.value,
|
|
3231
3182
|
active: !0,
|
|
3232
|
-
"active-index": j(
|
|
3233
|
-
loading: j(
|
|
3234
|
-
"has-next-page": j(
|
|
3235
|
-
"pagination-detail": j(
|
|
3236
|
-
"report-asset-error": j(
|
|
3237
|
-
"report-asset-load": j(
|
|
3183
|
+
"active-index": j(h).activeIndex.value,
|
|
3184
|
+
loading: j(h).loading.value,
|
|
3185
|
+
"has-next-page": j(h).hasNextPage.value,
|
|
3186
|
+
"pagination-detail": j(h).paginationDetail.value,
|
|
3187
|
+
"report-asset-error": j(g).report,
|
|
3188
|
+
"report-asset-load": j(_).report,
|
|
3189
|
+
"show-end-badge": d.showEndBadge ?? !0,
|
|
3190
|
+
"show-status-badges": d.showStatusBadges ?? !0,
|
|
3238
3191
|
"show-back-to-list": !1,
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
"onUpdate:activeIndex": j(g).setActiveIndex
|
|
3192
|
+
onBackToList: j(h).returnToList,
|
|
3193
|
+
"onUpdate:activeIndex": j(h).setActiveIndex
|
|
3242
3194
|
}, l({ _: 2 }, [
|
|
3243
3195
|
p["fullscreen-overlay"] ? {
|
|
3244
3196
|
name: "fullscreen-overlay",
|
|
@@ -3255,7 +3207,7 @@ var vr = ["aria-label"], yr = {
|
|
|
3255
3207
|
fn: I((t) => [D(e.$slots, "fullscreen-header-actions", v(f(t)))]),
|
|
3256
3208
|
key: "2"
|
|
3257
3209
|
} : void 0,
|
|
3258
|
-
|
|
3210
|
+
p["fullscreen-status"] ? {
|
|
3259
3211
|
name: "fullscreen-status",
|
|
3260
3212
|
fn: I((t) => [D(e.$slots, "fullscreen-status", v(f(t)))]),
|
|
3261
3213
|
key: "3"
|
|
@@ -3273,6 +3225,7 @@ var vr = ["aria-label"], yr = {
|
|
|
3273
3225
|
"pagination-detail",
|
|
3274
3226
|
"report-asset-error",
|
|
3275
3227
|
"report-asset-load",
|
|
3228
|
+
"show-end-badge",
|
|
3276
3229
|
"show-status-badges",
|
|
3277
3230
|
"onBackToList",
|
|
3278
3231
|
"onUpdate:activeIndex"
|