@wyxos/vibe 3.0.13 → 3.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/FullscreenSurface.vue.d.ts +4 -0
- package/lib/components/viewer-core/dominantImageTone.d.ts +6 -0
- package/lib/components/viewer-core/useDataSource.d.ts +2 -0
- package/lib/components/viewer-core/useFullscreenDominantTone.d.ts +12 -0
- package/lib/components/viewer-core/useMedia.d.ts +1 -0
- package/lib/components/viewer-core/useViewer.d.ts +1 -0
- package/lib/index.cjs +1 -1
- package/lib/index.js +591 -496
- package/lib/style.css +1 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -3,10 +3,10 @@ import { Comment as e, Fragment as t, Text as n, Transition as r, computed as i,
|
|
|
3
3
|
var B = (e) => {
|
|
4
4
|
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
|
|
5
5
|
return !1;
|
|
6
|
-
}, V = (e) => e === "", H = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(),
|
|
7
|
-
let t =
|
|
6
|
+
}, V = (e) => e === "", H = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), ee = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), U = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), W = (e) => {
|
|
7
|
+
let t = U(e);
|
|
8
8
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
9
|
-
},
|
|
9
|
+
}, G = {
|
|
10
10
|
xmlns: "http://www.w3.org/2000/svg",
|
|
11
11
|
width: 24,
|
|
12
12
|
height: 24,
|
|
@@ -16,27 +16,27 @@ var B = (e) => {
|
|
|
16
16
|
"stroke-width": 2,
|
|
17
17
|
"stroke-linecap": "round",
|
|
18
18
|
"stroke-linejoin": "round"
|
|
19
|
-
},
|
|
20
|
-
...
|
|
19
|
+
}, K = ({ name: e, iconNode: t, absoluteStrokeWidth: n, "absolute-stroke-width": r, strokeWidth: i, "stroke-width": a, size: o = G.width, color: s = G.stroke, ...c }, { slots: l }) => p("svg", {
|
|
20
|
+
...G,
|
|
21
21
|
...c,
|
|
22
22
|
width: o,
|
|
23
23
|
height: o,
|
|
24
24
|
stroke: s,
|
|
25
|
-
"stroke-width": V(n) || V(r) || n === !0 || r === !0 ? Number(i || a ||
|
|
26
|
-
class: H("lucide", c.class, ...e ? [`lucide-${
|
|
25
|
+
"stroke-width": V(n) || V(r) || n === !0 || r === !0 ? Number(i || a || G["stroke-width"]) * 24 / Number(o) : i || a || G["stroke-width"],
|
|
26
|
+
class: H("lucide", c.class, ...e ? [`lucide-${ee(W(e))}-icon`, `lucide-${ee(e)}`] : ["lucide-icon"]),
|
|
27
27
|
...!l.default && !B(c) && { "aria-hidden": "true" }
|
|
28
|
-
}, [...t.map((e) => p(...e)), ...l.default ? [l.default()] : []]),
|
|
28
|
+
}, [...t.map((e) => p(...e)), ...l.default ? [l.default()] : []]), q = (e, t) => (n, { slots: r, attrs: i }) => p(K, {
|
|
29
29
|
...i,
|
|
30
30
|
...n,
|
|
31
31
|
iconNode: t,
|
|
32
32
|
name: e
|
|
33
|
-
}, r),
|
|
33
|
+
}, r), J = q("arrow-left", [["path", {
|
|
34
34
|
d: "m12 19-7-7 7-7",
|
|
35
35
|
key: "1l729n"
|
|
36
36
|
}], ["path", {
|
|
37
37
|
d: "M19 12H5",
|
|
38
38
|
key: "x3x0zl"
|
|
39
|
-
}]]),
|
|
39
|
+
}]]), te = q("audio-lines", [
|
|
40
40
|
["path", {
|
|
41
41
|
d: "M2 10v3",
|
|
42
42
|
key: "1fnikh"
|
|
@@ -61,7 +61,7 @@ var B = (e) => {
|
|
|
61
61
|
d: "M22 10v3",
|
|
62
62
|
key: "154ddg"
|
|
63
63
|
}]
|
|
64
|
-
]),
|
|
64
|
+
]), Y = q("clapperboard", [
|
|
65
65
|
["path", {
|
|
66
66
|
d: "m12.296 3.464 3.02 3.956",
|
|
67
67
|
key: "qash78"
|
|
@@ -78,13 +78,13 @@ var B = (e) => {
|
|
|
78
78
|
d: "m6.18 5.276 3.1 3.899",
|
|
79
79
|
key: "zjj9t3"
|
|
80
80
|
}]
|
|
81
|
-
]),
|
|
81
|
+
]), ne = q("file", [["path", {
|
|
82
82
|
d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
|
|
83
83
|
key: "1oefj6"
|
|
84
84
|
}], ["path", {
|
|
85
85
|
d: "M14 2v5a1 1 0 0 0 1 1h5",
|
|
86
86
|
key: "wfsgrz"
|
|
87
|
-
}]]),
|
|
87
|
+
}]]), re = q("image-plus", [
|
|
88
88
|
["path", {
|
|
89
89
|
d: "M16 5h6",
|
|
90
90
|
key: "1vod17"
|
|
@@ -107,10 +107,10 @@ var B = (e) => {
|
|
|
107
107
|
r: "2",
|
|
108
108
|
key: "af1f0g"
|
|
109
109
|
}]
|
|
110
|
-
]),
|
|
110
|
+
]), ie = q("loader-circle", [["path", {
|
|
111
111
|
d: "M21 12a9 9 0 1 1-6.219-8.56",
|
|
112
112
|
key: "13zald"
|
|
113
|
-
}]]),
|
|
113
|
+
}]]), ae = q("pause", [["rect", {
|
|
114
114
|
x: "14",
|
|
115
115
|
y: "3",
|
|
116
116
|
width: "5",
|
|
@@ -124,10 +124,10 @@ var B = (e) => {
|
|
|
124
124
|
height: "18",
|
|
125
125
|
rx: "1",
|
|
126
126
|
key: "1wsw3u"
|
|
127
|
-
}]]),
|
|
127
|
+
}]]), oe = q("play", [["path", {
|
|
128
128
|
d: "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",
|
|
129
129
|
key: "10ikf1"
|
|
130
|
-
}]]),
|
|
130
|
+
}]]), se = q("triangle-alert", [
|
|
131
131
|
["path", {
|
|
132
132
|
d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
|
|
133
133
|
key: "wmoenq"
|
|
@@ -141,10 +141,10 @@ var B = (e) => {
|
|
|
141
141
|
key: "p32p05"
|
|
142
142
|
}]
|
|
143
143
|
]);
|
|
144
|
-
function
|
|
144
|
+
function ce(e, t = 150) {
|
|
145
145
|
return le(e, (e) => `${e.surface}|${e.occurrenceKey}|${e.url}|${e.kind}`, t);
|
|
146
146
|
}
|
|
147
|
-
function
|
|
147
|
+
function X(e, t = 150) {
|
|
148
148
|
return le(e, (e) => `${e.surface}|${e.occurrenceKey}|${e.url}`, t);
|
|
149
149
|
}
|
|
150
150
|
function le(e, t, n) {
|
|
@@ -399,7 +399,7 @@ function ze() {
|
|
|
399
399
|
//#endregion
|
|
400
400
|
//#region src/components/viewer-core/useAutoResolveSource.ts
|
|
401
401
|
function Be(e) {
|
|
402
|
-
let t = !!e.initialState?.items.length, n = T([]), r = T(0), a = T([]), o = T(!1), s = T(null), c = T(!t && typeof e.resolve == "function" ? "initializing" : "idle"), l = T(null), u = ze(), d = u.remainingMs, f = T(null), p = T(!1), m = T(!0), h = T(!1), g = /* @__PURE__ */ new Set(), _ = null, v = null, y = 0, S = 0, C = i(() => Re(e.fillDelayMs, Pe)), w = i(() => Re(e.fillDelayStepMs, Fe)), E = i(() => typeof e.resolve == "function"), D = i(() => e.mode ?? "dynamic"), O = i(() => pe(e.pageSize)), k = i(() => be(n.value)), A = i(() => xe(k.value, e.removedIds.value)), j = i(() => r.value), M = i(() => fe(c.value) || p.value), N = i(() => Ve(n.value, e.removedIds.value)), P = i(() => He(n.value, e.removedIds.value)), I = i(() => P.value?.nextCursor ?? null), L = i(() => o.value ? null : N.value?.previousCursor ?? null), R = i(() => !!I.value), z = i(() => !!L.value), B = i(() => E.value && n.value.length > 0), V = i(() => xe(be(a.value), e.removedIds.value)), H = i(() => we(n.value, e.removedIds.value, j.value)),
|
|
402
|
+
let t = !!e.initialState?.items.length, n = T([]), r = T(0), a = T([]), o = T(!1), s = T(null), c = T(!t && typeof e.resolve == "function" ? "initializing" : "idle"), l = T(null), u = ze(), d = u.remainingMs, f = T(null), p = T(!1), m = T(!0), h = T(!1), g = /* @__PURE__ */ new Set(), _ = null, v = null, y = 0, S = 0, C = i(() => Re(e.fillDelayMs, Pe)), w = i(() => Re(e.fillDelayStepMs, Fe)), E = i(() => typeof e.resolve == "function"), D = i(() => e.mode ?? "dynamic"), O = i(() => pe(e.pageSize)), k = i(() => be(n.value)), A = i(() => xe(k.value, e.removedIds.value)), j = i(() => r.value), M = i(() => fe(c.value) || p.value), N = i(() => Ve(n.value, e.removedIds.value)), P = i(() => He(n.value, e.removedIds.value)), I = i(() => P.value?.nextCursor ?? null), L = i(() => o.value ? null : N.value?.previousCursor ?? null), R = i(() => !!I.value), z = i(() => !!L.value), B = i(() => E.value && n.value.length > 0), V = i(() => xe(be(a.value), e.removedIds.value)), H = i(() => we(n.value, e.removedIds.value, j.value)), ee = i(() => !A.value.length && !M.value && !!s.value);
|
|
403
403
|
F(() => A.value.length, (e) => {
|
|
404
404
|
if (e === 0) {
|
|
405
405
|
r.value = 0;
|
|
@@ -407,14 +407,14 @@ function Be(e) {
|
|
|
407
407
|
}
|
|
408
408
|
o.value &&= (Se(), !1), r.value > e - 1 && (r.value = e - 1);
|
|
409
409
|
}), F(() => r.value, () => {
|
|
410
|
-
m.value &&
|
|
410
|
+
m.value && ce();
|
|
411
411
|
}), x(() => {
|
|
412
|
-
_e() || e.resolve &&
|
|
412
|
+
_e() || e.resolve && U();
|
|
413
413
|
}), b(() => {
|
|
414
414
|
_?.abort(), _ = null, u.clear(!0);
|
|
415
415
|
});
|
|
416
|
-
async function
|
|
417
|
-
v =
|
|
416
|
+
async function U() {
|
|
417
|
+
v = U;
|
|
418
418
|
let t = await de({
|
|
419
419
|
continueUntilFilled: D.value === "dynamic",
|
|
420
420
|
cursor: e.initialCursor ?? null,
|
|
@@ -423,58 +423,58 @@ function Be(e) {
|
|
|
423
423
|
});
|
|
424
424
|
t && (n.value = t.buckets, r.value = 0, Z());
|
|
425
425
|
}
|
|
426
|
-
async function
|
|
426
|
+
async function W() {
|
|
427
427
|
if (!(h.value || M.value)) {
|
|
428
428
|
if (!R.value) return B.value ? ue("trailing") : void 0;
|
|
429
429
|
if (D.value === "static" && ye("trailing")) return ue("trailing");
|
|
430
|
-
await
|
|
430
|
+
await X(I.value);
|
|
431
431
|
}
|
|
432
432
|
}
|
|
433
|
-
async function
|
|
433
|
+
async function G() {
|
|
434
434
|
if (!(h.value || !z.value || M.value)) {
|
|
435
435
|
if (D.value === "static" && ye("leading")) return ue("leading");
|
|
436
436
|
await le(L.value);
|
|
437
437
|
}
|
|
438
438
|
}
|
|
439
|
-
async function
|
|
440
|
-
if (
|
|
439
|
+
async function K() {
|
|
440
|
+
if (ee.value) {
|
|
441
441
|
if (n.value = [], r.value = 0, a.value = [], o.value = !1, s.value = null, c.value = E.value ? "initializing" : "idle", l.value = null, f.value = null, p.value = !1, g.clear(), _?.abort(), _ = null, u.clear(!0), _e()) {
|
|
442
442
|
Z();
|
|
443
443
|
return;
|
|
444
444
|
}
|
|
445
|
-
await
|
|
445
|
+
await U();
|
|
446
446
|
}
|
|
447
447
|
}
|
|
448
|
-
async function
|
|
449
|
-
if (
|
|
448
|
+
async function q() {
|
|
449
|
+
if (ee.value) return K();
|
|
450
450
|
h.value || c.value !== "failed" || !v || (s.value = null, await v());
|
|
451
451
|
}
|
|
452
|
-
async function
|
|
452
|
+
async function J() {
|
|
453
453
|
if (!a.value.length) return p.value = !1, Z();
|
|
454
454
|
n.value = [...n.value, ...a.value], a.value = [], p.value = !1, Z();
|
|
455
455
|
}
|
|
456
|
-
function
|
|
456
|
+
function te(t) {
|
|
457
457
|
let n = A.value;
|
|
458
458
|
if (!n.length) return;
|
|
459
459
|
let i = he(t, 0, n.length - 1);
|
|
460
460
|
i !== r.value && (r.value = i, e.emit("update:activeIndex", i));
|
|
461
461
|
}
|
|
462
|
-
function
|
|
462
|
+
function Y(e) {
|
|
463
463
|
m.value = e;
|
|
464
464
|
}
|
|
465
|
-
function
|
|
465
|
+
function ne() {
|
|
466
466
|
h.value = !0, u.clear(!0);
|
|
467
467
|
}
|
|
468
|
-
function
|
|
468
|
+
function re() {
|
|
469
469
|
h.value = !1;
|
|
470
470
|
}
|
|
471
|
-
function
|
|
471
|
+
function ie() {
|
|
472
472
|
y += 1, _?.abort(), _ = null, u.clear(!0), g.clear(), s.value = null, l.value = null, f.value = null, a.value.length > 0 && (n.value = [...n.value, ...a.value], a.value = []), p.value = !1, o.value = !1, Z();
|
|
473
473
|
}
|
|
474
|
-
function
|
|
474
|
+
function ae() {
|
|
475
475
|
return je(A.value, j.value);
|
|
476
476
|
}
|
|
477
|
-
function
|
|
477
|
+
function oe(e = null, t = {}) {
|
|
478
478
|
if (A.value.length === 0) {
|
|
479
479
|
r.value = 0, !t.preserveTrailingPlaceholder && n.value.length > 0 && (o.value = !0);
|
|
480
480
|
return;
|
|
@@ -492,21 +492,21 @@ function Be(e) {
|
|
|
492
492
|
}
|
|
493
493
|
r.value = Me(A.value, j.value, e);
|
|
494
494
|
}
|
|
495
|
-
function
|
|
496
|
-
a.value.length > 0 && !V.value.length &&
|
|
495
|
+
function se() {
|
|
496
|
+
a.value.length > 0 && !V.value.length && J();
|
|
497
497
|
}
|
|
498
|
-
async function
|
|
498
|
+
async function ce() {
|
|
499
499
|
if (!(!m.value || ve())) {
|
|
500
500
|
if (!A.value.length) {
|
|
501
|
-
R.value && await
|
|
501
|
+
R.value && await W();
|
|
502
502
|
return;
|
|
503
503
|
}
|
|
504
|
-
z.value && r.value < 3 && await
|
|
504
|
+
z.value && r.value < 3 && await G(), R.value && r.value >= A.value.length - 3 && await W();
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
|
-
async function
|
|
507
|
+
async function X(e) {
|
|
508
508
|
v = async () => {
|
|
509
|
-
await
|
|
509
|
+
await X(e);
|
|
510
510
|
};
|
|
511
511
|
let t = await de({
|
|
512
512
|
continueUntilFilled: D.value === "dynamic",
|
|
@@ -531,8 +531,8 @@ function Be(e) {
|
|
|
531
531
|
phase: "loading"
|
|
532
532
|
});
|
|
533
533
|
if (!t) return;
|
|
534
|
-
let r =
|
|
535
|
-
n.value = [...t.buckets, ...n.value],
|
|
534
|
+
let r = ae();
|
|
535
|
+
n.value = [...t.buckets, ...n.value], oe(r), Z();
|
|
536
536
|
}
|
|
537
537
|
async function ue(t) {
|
|
538
538
|
if (v = async () => {
|
|
@@ -558,8 +558,8 @@ function Be(e) {
|
|
|
558
558
|
nextItems: t.items,
|
|
559
559
|
previousCursor: t.previousPage ?? null,
|
|
560
560
|
previousItems: r.items
|
|
561
|
-
}), s =
|
|
562
|
-
n.value = Te(n.value, r.cursor, i),
|
|
561
|
+
}), s = ae();
|
|
562
|
+
n.value = Te(n.value, r.cursor, i), oe(s), Z();
|
|
563
563
|
} catch (e) {
|
|
564
564
|
if (De(e) || a !== y) {
|
|
565
565
|
Z();
|
|
@@ -656,10 +656,10 @@ function Be(e) {
|
|
|
656
656
|
}
|
|
657
657
|
return {
|
|
658
658
|
activeIndex: j,
|
|
659
|
-
canRetryInitialLoad:
|
|
660
|
-
cancel:
|
|
659
|
+
canRetryInitialLoad: ee,
|
|
660
|
+
cancel: ie,
|
|
661
661
|
canRefreshTrailingBoundary: B,
|
|
662
|
-
commitPendingAppend:
|
|
662
|
+
commitPendingAppend: J,
|
|
663
663
|
currentCursor: H,
|
|
664
664
|
errorMessage: s,
|
|
665
665
|
fillCollectedCount: l,
|
|
@@ -670,24 +670,24 @@ function Be(e) {
|
|
|
670
670
|
isAutoPrefetchEnabled: m,
|
|
671
671
|
isPageLoadingLocked: h,
|
|
672
672
|
items: A,
|
|
673
|
-
lockPageLoading:
|
|
673
|
+
lockPageLoading: ne,
|
|
674
674
|
loading: M,
|
|
675
675
|
mode: D,
|
|
676
|
-
maybePrefetchAround:
|
|
676
|
+
maybePrefetchAround: ce,
|
|
677
677
|
nextCursor: I,
|
|
678
678
|
pendingAppendItems: V,
|
|
679
679
|
phase: c,
|
|
680
|
-
prefetchNextPage:
|
|
681
|
-
prefetchPreviousPage:
|
|
680
|
+
prefetchNextPage: W,
|
|
681
|
+
prefetchPreviousPage: G,
|
|
682
682
|
previousCursor: L,
|
|
683
|
-
retryInitialLoad:
|
|
684
|
-
retry:
|
|
685
|
-
setActiveIndex:
|
|
686
|
-
setAutoPrefetchEnabled:
|
|
687
|
-
syncActiveIndexAfterVisibilityChange:
|
|
688
|
-
unlockPageLoading:
|
|
689
|
-
getActiveOccurrenceKey:
|
|
690
|
-
maybeCommitPendingAppendWhenFilteredOut:
|
|
683
|
+
retryInitialLoad: K,
|
|
684
|
+
retry: q,
|
|
685
|
+
setActiveIndex: te,
|
|
686
|
+
setAutoPrefetchEnabled: Y,
|
|
687
|
+
syncActiveIndexAfterVisibilityChange: oe,
|
|
688
|
+
unlockPageLoading: re,
|
|
689
|
+
getActiveOccurrenceKey: ae,
|
|
690
|
+
maybeCommitPendingAppendWhenFilteredOut: se
|
|
691
691
|
};
|
|
692
692
|
}
|
|
693
693
|
function Ve(e, t) {
|
|
@@ -945,11 +945,11 @@ var Ke = {
|
|
|
945
945
|
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",
|
|
946
946
|
"aria-label": "Back to list",
|
|
947
947
|
onClick: t[0] ||= (e) => r("back-to-list")
|
|
948
|
-
}, [u(j(
|
|
948
|
+
}, [u(j(J), {
|
|
949
949
|
class: "h-4 w-4 stroke-[2.2]",
|
|
950
950
|
"aria-hidden": "true"
|
|
951
951
|
})])) : o("", !0), n.title ? (S(), s("h2", rt, k(n.title), 1)) : o("", !0)]), c("div", it, [c("span", at, [
|
|
952
|
-
n.loading ? (S(), a(j(
|
|
952
|
+
n.loading ? (S(), a(j(ie), {
|
|
953
953
|
key: 0,
|
|
954
954
|
"data-testid": "vibe-pagination-spinner",
|
|
955
955
|
class: "h-3.5 w-3.5 animate-spin stroke-[1.9]",
|
|
@@ -960,10 +960,10 @@ var Ke = {
|
|
|
960
960
|
]), D(e.$slots, "actions")])])]), n.showEndBadge ? (S(), s("div", ct, [...t[1] ||= [c("span", { class: "inline-flex items-center border border-amber-300/35 bg-black/40 px-4 py-3 text-[0.74rem] font-bold uppercase tracking-[0.2em] text-amber-200 backdrop-blur-[18px]" }, " End reached ", -1)]])) : o("", !0)]));
|
|
961
961
|
}
|
|
962
962
|
}), ut = {
|
|
963
|
-
image:
|
|
964
|
-
video:
|
|
965
|
-
audio:
|
|
966
|
-
other:
|
|
963
|
+
image: re,
|
|
964
|
+
video: Y,
|
|
965
|
+
audio: te,
|
|
966
|
+
other: ne
|
|
967
967
|
}, dt = {
|
|
968
968
|
image: "Image",
|
|
969
969
|
video: "Video",
|
|
@@ -1189,6 +1189,8 @@ function It(e) {
|
|
|
1189
1189
|
await x();
|
|
1190
1190
|
}), F(() => e.itemCount.value, async () => {
|
|
1191
1191
|
await x();
|
|
1192
|
+
}), F(() => e.loopFullscreenVideo.value, async () => {
|
|
1193
|
+
await x();
|
|
1192
1194
|
});
|
|
1193
1195
|
function _(e, t) {
|
|
1194
1196
|
if (t instanceof HTMLVideoElement) {
|
|
@@ -1205,7 +1207,7 @@ function It(e) {
|
|
|
1205
1207
|
s.delete(e);
|
|
1206
1208
|
}
|
|
1207
1209
|
function y(e, r) {
|
|
1208
|
-
r instanceof HTMLImageElement && Et(r) && (t.value[e] = !0, n.value[e] = null,
|
|
1210
|
+
r instanceof HTMLImageElement && Et(r) && (t.value[e] = !0, n.value[e] = null, K(e, r.currentSrc || r.src || J(e)));
|
|
1209
1211
|
}
|
|
1210
1212
|
function b() {
|
|
1211
1213
|
B(), a.value = {}, n.value = {}, t.value = {}, r.value = {}, c.clear();
|
|
@@ -1217,12 +1219,12 @@ function It(e) {
|
|
|
1217
1219
|
}
|
|
1218
1220
|
await g();
|
|
1219
1221
|
let t = l.value;
|
|
1220
|
-
for (let [
|
|
1221
|
-
if (
|
|
1222
|
-
z(
|
|
1222
|
+
for (let [n, i] of o.entries()) {
|
|
1223
|
+
if (n !== t || r.value[n]?.errorKind) {
|
|
1224
|
+
z(i, n);
|
|
1223
1225
|
continue;
|
|
1224
1226
|
}
|
|
1225
|
-
|
|
1227
|
+
i.muted = !0, i.loop = e.loopFullscreenVideo.value, i.playsInline = !0, Ft(i), H(n, i);
|
|
1226
1228
|
}
|
|
1227
1229
|
for (let [e, n] of s.entries()) {
|
|
1228
1230
|
if (e !== t || r.value[e]?.errorKind) {
|
|
@@ -1238,14 +1240,14 @@ function It(e) {
|
|
|
1238
1240
|
let i = r.value[e]?.ready ?? !1;
|
|
1239
1241
|
H(e, n, t.type);
|
|
1240
1242
|
let a = r.value[e]?.ready ?? !1;
|
|
1241
|
-
!i && a &&
|
|
1243
|
+
!i && a && K(e, n.currentSrc || n.src || J(e));
|
|
1242
1244
|
}
|
|
1243
1245
|
}
|
|
1244
1246
|
function C(e, r) {
|
|
1245
|
-
t.value[e] = !0, n.value[e] = null,
|
|
1247
|
+
t.value[e] = !0, n.value[e] = null, K(e, r);
|
|
1246
1248
|
}
|
|
1247
1249
|
async function w(r, i) {
|
|
1248
|
-
let a =
|
|
1250
|
+
let a = q(r) ?? e.activeItem.value;
|
|
1249
1251
|
t.value[r] = !1, n.value[r] = "generic";
|
|
1250
1252
|
let o = await Mt(i);
|
|
1251
1253
|
n.value[r] = o, a && e.onAssetError?.({
|
|
@@ -1257,7 +1259,7 @@ function It(e) {
|
|
|
1257
1259
|
});
|
|
1258
1260
|
}
|
|
1259
1261
|
async function E(t, n) {
|
|
1260
|
-
let r =
|
|
1262
|
+
let r = U(t), i = V(t), a = q(t) ?? e.activeMediaItem.value ?? e.activeItem.value;
|
|
1261
1263
|
if (r) {
|
|
1262
1264
|
r.pause();
|
|
1263
1265
|
try {
|
|
@@ -1275,18 +1277,18 @@ function It(e) {
|
|
|
1275
1277
|
});
|
|
1276
1278
|
}
|
|
1277
1279
|
function D(e, t, n) {
|
|
1278
|
-
e.button !== 0 || Date.now() < n ||
|
|
1280
|
+
e.button !== 0 || Date.now() < n || G(o.get(t) ?? null);
|
|
1279
1281
|
}
|
|
1280
1282
|
function O(e, t, n) {
|
|
1281
|
-
e.button !== 0 || Date.now() < n ||
|
|
1283
|
+
e.button !== 0 || Date.now() < n || G(U(t));
|
|
1282
1284
|
}
|
|
1283
1285
|
function k(e) {
|
|
1284
|
-
let t =
|
|
1286
|
+
let t = W(), n = u.value;
|
|
1285
1287
|
if (!t || !n || !(e.target instanceof HTMLInputElement)) return;
|
|
1286
1288
|
let r = Number.parseFloat(e.target.value);
|
|
1287
1289
|
if (!Number.isFinite(r)) return;
|
|
1288
1290
|
let i = Lt(r, 0, p.value || 0);
|
|
1289
|
-
|
|
1291
|
+
ee(n, i, t), t.currentTime = i;
|
|
1290
1292
|
}
|
|
1291
1293
|
function A(e) {
|
|
1292
1294
|
return !!t.value[e] && !n.value[e];
|
|
@@ -1315,7 +1317,7 @@ function It(e) {
|
|
|
1315
1317
|
t.value[e] = !1, n.value[e] = null;
|
|
1316
1318
|
let r = V(e);
|
|
1317
1319
|
r.currentTime = 0, r.duration = 0, r.paused = !0, r.ready = !1, r.errorKind = null;
|
|
1318
|
-
let i =
|
|
1320
|
+
let i = U(e);
|
|
1319
1321
|
i && z(i, e), c.forEach((t) => {
|
|
1320
1322
|
t.startsWith(`${e}|`) && c.delete(t);
|
|
1321
1323
|
}), a.value[e] = (a.value[e] ?? 0) + 1, await g(), await x();
|
|
@@ -1337,17 +1339,17 @@ function It(e) {
|
|
|
1337
1339
|
function H(e, t, n) {
|
|
1338
1340
|
Dt(V(e), t, n);
|
|
1339
1341
|
}
|
|
1340
|
-
function
|
|
1342
|
+
function ee(e, t, n) {
|
|
1341
1343
|
let r = V(e);
|
|
1342
1344
|
r.currentTime = t, r.duration = Number.isFinite(n.duration) ? n.duration : r.duration, r.paused = n.paused;
|
|
1343
1345
|
}
|
|
1344
|
-
function
|
|
1346
|
+
function U(e) {
|
|
1345
1347
|
return o.get(e) ?? s.get(e) ?? null;
|
|
1346
1348
|
}
|
|
1347
|
-
function
|
|
1348
|
-
return u.value ?
|
|
1349
|
+
function W() {
|
|
1350
|
+
return u.value ? U(u.value) : null;
|
|
1349
1351
|
}
|
|
1350
|
-
function
|
|
1352
|
+
function G(e) {
|
|
1351
1353
|
if (e) {
|
|
1352
1354
|
if (e.paused) {
|
|
1353
1355
|
Ft(e);
|
|
@@ -1356,8 +1358,8 @@ function It(e) {
|
|
|
1356
1358
|
e.pause();
|
|
1357
1359
|
}
|
|
1358
1360
|
}
|
|
1359
|
-
function
|
|
1360
|
-
let r =
|
|
1361
|
+
function K(t, n) {
|
|
1362
|
+
let r = q(t) ?? e.activeMediaItem.value ?? e.activeItem.value;
|
|
1361
1363
|
if (!r || !n) return;
|
|
1362
1364
|
let i = `${t}|${n}`;
|
|
1363
1365
|
c.has(i) || (c.add(i), e.onAssetLoad?.({
|
|
@@ -1367,11 +1369,11 @@ function It(e) {
|
|
|
1367
1369
|
url: n
|
|
1368
1370
|
}));
|
|
1369
1371
|
}
|
|
1370
|
-
function
|
|
1372
|
+
function q(e) {
|
|
1371
1373
|
return d.value.get(e) ?? null;
|
|
1372
1374
|
}
|
|
1373
|
-
function
|
|
1374
|
-
return
|
|
1375
|
+
function J(e) {
|
|
1376
|
+
return q(e)?.url ?? null;
|
|
1375
1377
|
}
|
|
1376
1378
|
return {
|
|
1377
1379
|
activeAssetErrorKind: h,
|
|
@@ -1429,173 +1431,223 @@ function Bt(e, t, n, r, i) {
|
|
|
1429
1431
|
//#endregion
|
|
1430
1432
|
//#region src/components/viewer-core/useViewer.ts
|
|
1431
1433
|
function Vt(e, t, n = {}) {
|
|
1432
|
-
let r = i(() => e.items), a = i(() => e.activeIndex ?? 0), o = i(() => e.errorMessage ?? null), s = i(() => e.loading ?? !1), c = i(() => e.hasNextPage ?? !1), l = i(() => e.paginationDetail ?? null),
|
|
1434
|
+
let r = i(() => e.items), a = i(() => e.activeIndex ?? 0), o = i(() => e.errorMessage ?? null), s = i(() => e.loading ?? !1), c = i(() => e.hasNextPage ?? !1), l = i(() => e.loopFullscreenVideo ?? !0), u = i(() => e.paginationDetail ?? null), d = i(() => xt({
|
|
1433
1435
|
itemCount: r.value.length,
|
|
1434
1436
|
loading: s.value,
|
|
1435
1437
|
phase: e.phase
|
|
1436
|
-
})),
|
|
1438
|
+
})), f = i(() => !1), 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(() => r.value.length === 0 ? 0 : P(a.value, 0, r.value.length - 1)), C = i(() => r.value[S.value] ?? null), w = i(() => C.value?.type === "audio" || C.value?.type === "video" ? C.value : null), E = It({
|
|
1437
1439
|
items: r,
|
|
1438
|
-
activeItem:
|
|
1439
|
-
activeMediaItem:
|
|
1440
|
-
isEnabled:
|
|
1440
|
+
activeItem: C,
|
|
1441
|
+
activeMediaItem: w,
|
|
1442
|
+
isEnabled: _,
|
|
1441
1443
|
itemCount: i(() => r.value.length),
|
|
1444
|
+
loopFullscreenVideo: l,
|
|
1442
1445
|
onAssetError: n.onAssetError,
|
|
1443
1446
|
onAssetLoad: n.onAssetLoad
|
|
1444
|
-
}),
|
|
1447
|
+
}), D = i(() => r.value.length > 0 && S.value === r.value.length - 1), O = i(() => St({
|
|
1445
1448
|
errorMessage: o.value,
|
|
1446
1449
|
hasItems: r.value.length > 0,
|
|
1447
1450
|
hasNextPage: c.value,
|
|
1448
|
-
phase:
|
|
1451
|
+
phase: d.value,
|
|
1449
1452
|
surface: "fullscreen"
|
|
1450
|
-
})),
|
|
1453
|
+
})), k = i(() => O.value?.kind ?? null), A = i(() => O.value?.message ?? null), j = i(() => Math.min(96, g.value * .15 || 96)), M = i(() => Rt(S.value, r.value.length)), N = i(() => zt(r.value, S.value));
|
|
1451
1454
|
Ct({
|
|
1452
|
-
enabled:
|
|
1455
|
+
enabled: _,
|
|
1453
1456
|
onDisable() {
|
|
1454
|
-
U(),
|
|
1457
|
+
U(), E.resetMediaState();
|
|
1455
1458
|
},
|
|
1456
1459
|
onEnable() {
|
|
1457
|
-
return
|
|
1460
|
+
return E.syncMediaPlayback();
|
|
1458
1461
|
},
|
|
1459
1462
|
onKeydown: G,
|
|
1460
|
-
onResize:
|
|
1463
|
+
onResize: F
|
|
1461
1464
|
});
|
|
1462
|
-
function
|
|
1465
|
+
function P(e, t, n) {
|
|
1463
1466
|
return Math.min(Math.max(e, t), n);
|
|
1464
1467
|
}
|
|
1465
|
-
function
|
|
1466
|
-
|
|
1467
|
-
}
|
|
1468
|
-
function F(e) {
|
|
1469
|
-
return r.value.length === 0 ? !1 : N(x.value + e, 0, r.value.length - 1) !== x.value;
|
|
1468
|
+
function F() {
|
|
1469
|
+
g.value = p.value?.clientHeight || window.innerHeight || 1;
|
|
1470
1470
|
}
|
|
1471
1471
|
function I(e) {
|
|
1472
|
-
|
|
1473
|
-
let n = N(x.value + e, 0, r.value.length - 1);
|
|
1474
|
-
n !== x.value && t("update:activeIndex", n);
|
|
1472
|
+
return r.value.length === 0 ? !1 : P(S.value + e, 0, r.value.length - 1) !== S.value;
|
|
1475
1473
|
}
|
|
1476
1474
|
function L(e) {
|
|
1477
|
-
|
|
1478
|
-
|
|
1475
|
+
if (r.value.length === 0) return;
|
|
1476
|
+
let n = P(S.value + e, 0, r.value.length - 1);
|
|
1477
|
+
n !== S.value && t("update:activeIndex", n);
|
|
1479
1478
|
}
|
|
1480
1479
|
function R(e) {
|
|
1481
|
-
|
|
1480
|
+
let t = e > 0, n = e < 0;
|
|
1481
|
+
return t && !I(-1) || n && !I(1) ? e * .24 : e;
|
|
1482
1482
|
}
|
|
1483
1483
|
function z(e) {
|
|
1484
|
-
!
|
|
1484
|
+
!_.value || r.value.length === 0 || e.pointerType === "mouse" || de(e.target) || (v = e.pointerId, y = e.clientY, m.value = 0, h.value = !0, p.value?.setPointerCapture?.(e.pointerId));
|
|
1485
1485
|
}
|
|
1486
1486
|
function B(e) {
|
|
1487
|
-
!
|
|
1487
|
+
!_.value || !h.value || v !== e.pointerId || (m.value = R(e.clientY - y));
|
|
1488
1488
|
}
|
|
1489
1489
|
function V(e) {
|
|
1490
|
-
!
|
|
1490
|
+
!_.value || v !== e.pointerId || (p.value?.releasePointerCapture?.(e.pointerId), ee());
|
|
1491
1491
|
}
|
|
1492
|
-
function H() {
|
|
1493
|
-
|
|
1492
|
+
function H(e) {
|
|
1493
|
+
!_.value || v !== e.pointerId || (p.value?.releasePointerCapture?.(e.pointerId), U());
|
|
1494
|
+
}
|
|
1495
|
+
function ee() {
|
|
1496
|
+
Math.abs(m.value) >= j.value && (x = Date.now() + 250, L(m.value < 0 ? 1 : -1)), U();
|
|
1494
1497
|
}
|
|
1495
1498
|
function U() {
|
|
1496
|
-
|
|
1499
|
+
m.value = 0, h.value = !1, v = null;
|
|
1497
1500
|
}
|
|
1498
1501
|
function W(e) {
|
|
1499
|
-
if (!
|
|
1502
|
+
if (!_.value || r.value.length === 0 || h.value || de(e.target) || Math.abs(e.deltaY) < Math.max(Math.abs(e.deltaX), 24)) return;
|
|
1500
1503
|
e.preventDefault();
|
|
1501
1504
|
let t = Date.now();
|
|
1502
|
-
t <
|
|
1505
|
+
t < b || (b = t + 400, L(e.deltaY > 0 ? 1 : -1));
|
|
1503
1506
|
}
|
|
1504
1507
|
function G(e) {
|
|
1505
|
-
!
|
|
1508
|
+
!_.value || r.value.length === 0 || ue(e.target) || ((e.key === "ArrowDown" || e.key === "PageDown") && (e.preventDefault(), L(1)), (e.key === "ArrowUp" || e.key === "PageUp") && (e.preventDefault(), L(-1)));
|
|
1506
1509
|
}
|
|
1507
1510
|
function K(e, t) {
|
|
1508
|
-
|
|
1511
|
+
E.onVideoClick(e, t, x);
|
|
1509
1512
|
}
|
|
1510
1513
|
function q(e, t) {
|
|
1511
|
-
|
|
1514
|
+
E.onAudioCoverClick(e, t, x);
|
|
1512
1515
|
}
|
|
1513
1516
|
function J(e) {
|
|
1514
|
-
|
|
1517
|
+
E.onMediaSeekInput(e);
|
|
1515
1518
|
}
|
|
1516
|
-
function
|
|
1519
|
+
function te(e) {
|
|
1517
1520
|
return e.type === "image" || e.type === "video";
|
|
1518
1521
|
}
|
|
1519
|
-
function
|
|
1522
|
+
function Y(e) {
|
|
1520
1523
|
return e.type === "audio";
|
|
1521
1524
|
}
|
|
1522
|
-
function
|
|
1523
|
-
return Bt(e,
|
|
1525
|
+
function ne(e) {
|
|
1526
|
+
return Bt(e, S.value, g.value, m.value, h.value);
|
|
1524
1527
|
}
|
|
1525
1528
|
return {
|
|
1526
|
-
activeItem:
|
|
1527
|
-
activeAssetErrorKind:
|
|
1528
|
-
activeMediaDuration:
|
|
1529
|
-
activeMediaItem:
|
|
1530
|
-
activeMediaProgress:
|
|
1531
|
-
activeMediaState:
|
|
1532
|
-
canRetryAsset:
|
|
1533
|
-
canRetryInitialLoad:
|
|
1529
|
+
activeItem: C,
|
|
1530
|
+
activeAssetErrorKind: E.activeAssetErrorKind,
|
|
1531
|
+
activeMediaDuration: E.activeMediaDuration,
|
|
1532
|
+
activeMediaItem: w,
|
|
1533
|
+
activeMediaProgress: E.activeMediaProgress,
|
|
1534
|
+
activeMediaState: E.activeMediaState,
|
|
1535
|
+
canRetryAsset: E.canRetryAsset,
|
|
1536
|
+
canRetryInitialLoad: f,
|
|
1534
1537
|
errorMessage: o,
|
|
1535
|
-
getAssetErrorKind:
|
|
1536
|
-
getAssetErrorLabel:
|
|
1537
|
-
getAssetRenderKey:
|
|
1538
|
+
getAssetErrorKind: E.getAssetErrorKind,
|
|
1539
|
+
getAssetErrorLabel: E.getAssetErrorLabel,
|
|
1540
|
+
getAssetRenderKey: E.getAssetRenderKey,
|
|
1538
1541
|
formatPlaybackTime: bt,
|
|
1539
|
-
getImageSource:
|
|
1540
|
-
getSlideStyle:
|
|
1542
|
+
getImageSource: E.getImageSource,
|
|
1543
|
+
getSlideStyle: ne,
|
|
1541
1544
|
hasNextPage: c,
|
|
1542
|
-
isAtEnd:
|
|
1543
|
-
isAudio:
|
|
1544
|
-
isVisual:
|
|
1545
|
+
isAtEnd: D,
|
|
1546
|
+
isAudio: Y,
|
|
1547
|
+
isVisual: te,
|
|
1545
1548
|
items: r,
|
|
1546
1549
|
loading: s,
|
|
1547
|
-
mediaStates:
|
|
1548
|
-
isImageReady:
|
|
1549
|
-
isMediaReady:
|
|
1550
|
+
mediaStates: E.mediaStates,
|
|
1551
|
+
isImageReady: E.isImageReady,
|
|
1552
|
+
isMediaReady: E.isMediaReady,
|
|
1550
1553
|
onAudioCoverClick: q,
|
|
1551
|
-
onImageError:
|
|
1552
|
-
onImageLoad:
|
|
1553
|
-
onMediaEvent:
|
|
1554
|
-
onMediaError:
|
|
1554
|
+
onImageError: E.onImageError,
|
|
1555
|
+
onImageLoad: E.onImageLoad,
|
|
1556
|
+
onMediaEvent: E.onMediaEvent,
|
|
1557
|
+
onMediaError: E.onMediaError,
|
|
1555
1558
|
onMediaSeekInput: J,
|
|
1556
|
-
onPointerCancel:
|
|
1557
|
-
onPointerDown:
|
|
1558
|
-
onPointerMove:
|
|
1559
|
-
onPointerUp:
|
|
1559
|
+
onPointerCancel: H,
|
|
1560
|
+
onPointerDown: z,
|
|
1561
|
+
onPointerMove: B,
|
|
1562
|
+
onPointerUp: V,
|
|
1560
1563
|
onVideoClick: K,
|
|
1561
1564
|
onWheel: W,
|
|
1562
|
-
registerAudioElement:
|
|
1563
|
-
registerImageElement:
|
|
1564
|
-
registerVideoElement:
|
|
1565
|
-
renderedItems:
|
|
1566
|
-
renderedRange:
|
|
1567
|
-
resolvedActiveIndex:
|
|
1565
|
+
registerAudioElement: E.registerAudioElement,
|
|
1566
|
+
registerImageElement: E.registerImageElement,
|
|
1567
|
+
registerVideoElement: E.registerVideoElement,
|
|
1568
|
+
renderedItems: N,
|
|
1569
|
+
renderedRange: M,
|
|
1570
|
+
resolvedActiveIndex: S,
|
|
1568
1571
|
retryInitialLoad: async () => {},
|
|
1569
|
-
retryAsset:
|
|
1570
|
-
stageRef:
|
|
1571
|
-
statusKind:
|
|
1572
|
-
statusMessage:
|
|
1573
|
-
paginationDetail:
|
|
1574
|
-
phase:
|
|
1572
|
+
retryAsset: E.retryAsset,
|
|
1573
|
+
stageRef: p,
|
|
1574
|
+
statusKind: k,
|
|
1575
|
+
statusMessage: A,
|
|
1576
|
+
paginationDetail: u,
|
|
1577
|
+
phase: d
|
|
1575
1578
|
};
|
|
1576
1579
|
}
|
|
1577
1580
|
//#endregion
|
|
1578
1581
|
//#region src/components/viewer-core/theme.ts
|
|
1579
|
-
var Ht = {
|
|
1580
|
-
image:
|
|
1581
|
-
video:
|
|
1582
|
-
audio:
|
|
1583
|
-
other:
|
|
1584
|
-
}, Ut = {
|
|
1585
|
-
image: "bg-[radial-gradient(circle_at_center,rgba(251,191,36,0.4)_0,transparent_42%),linear-gradient(180deg,#120d08,#050507)]",
|
|
1586
|
-
video: "bg-[radial-gradient(circle_at_center,rgba(56,189,248,0.38)_0,transparent_42%),linear-gradient(180deg,#07111c,#050608)]",
|
|
1587
|
-
audio: "bg-[radial-gradient(circle_at_center,rgba(16,185,129,0.32)_0,transparent_42%),linear-gradient(180deg,#06120f,#040506)]",
|
|
1588
|
-
other: "bg-[radial-gradient(circle_at_center,rgba(148,163,184,0.28)_0,transparent_42%),linear-gradient(180deg,#0d0c10,#040506)]"
|
|
1582
|
+
var Ht = "bg-[linear-gradient(180deg,#0a0b10,#05060a)]", Ut = "bg-[linear-gradient(180deg,#0b0c11,#06070b)]", Wt = {
|
|
1583
|
+
image: !0,
|
|
1584
|
+
video: !0,
|
|
1585
|
+
audio: !0,
|
|
1586
|
+
other: !0
|
|
1589
1587
|
};
|
|
1590
|
-
function Wt(e) {
|
|
1591
|
-
return Ht[e];
|
|
1592
|
-
}
|
|
1593
1588
|
function Gt(e) {
|
|
1594
|
-
return
|
|
1589
|
+
return Wt[e], Ht;
|
|
1590
|
+
}
|
|
1591
|
+
function Kt(e) {
|
|
1592
|
+
return Wt[e], Ut;
|
|
1593
|
+
}
|
|
1594
|
+
//#endregion
|
|
1595
|
+
//#region src/components/viewer-core/dominantImageTone.ts
|
|
1596
|
+
function qt(e) {
|
|
1597
|
+
if (e.naturalWidth <= 0 || e.naturalHeight <= 0) return null;
|
|
1598
|
+
let t = document.createElement("canvas"), n = t.getContext("2d", { willReadFrequently: !0 });
|
|
1599
|
+
if (!n) return null;
|
|
1600
|
+
t.width = 24, t.height = 24;
|
|
1601
|
+
try {
|
|
1602
|
+
n.drawImage(e, 0, 0, 24, 24);
|
|
1603
|
+
let { data: t } = n.getImageData(0, 0, 24, 24), r = 0, i = 0, a = 0, o = 0;
|
|
1604
|
+
for (let e = 0; e < t.length; e += 4) {
|
|
1605
|
+
let n = t[e + 3] / 255;
|
|
1606
|
+
if (n <= .05) continue;
|
|
1607
|
+
let s = t[e], c = t[e + 1], l = t[e + 2], u = Math.max(s, c, l), d = n * (.65 + (u === 0 ? 0 : (u - Math.min(s, c, l)) / u) * .7);
|
|
1608
|
+
r += d, i += s * d, a += c * d, o += l * d;
|
|
1609
|
+
}
|
|
1610
|
+
return r <= 0 ? null : {
|
|
1611
|
+
r: Jt(Math.round(i / r)),
|
|
1612
|
+
g: Jt(Math.round(a / r)),
|
|
1613
|
+
b: Jt(Math.round(o / r))
|
|
1614
|
+
};
|
|
1615
|
+
} catch {
|
|
1616
|
+
return null;
|
|
1617
|
+
}
|
|
1618
|
+
}
|
|
1619
|
+
function Jt(e) {
|
|
1620
|
+
return Math.min(235, Math.max(26, e));
|
|
1621
|
+
}
|
|
1622
|
+
//#endregion
|
|
1623
|
+
//#region src/components/viewer-core/useFullscreenDominantTone.ts
|
|
1624
|
+
function Yt(e) {
|
|
1625
|
+
let t = T({}), n = i(() => e.activeItem.value ? e.getItemKey(e.activeItem.value) : null), r = i(() => !e.showDominantImageTone.value || e.activeItem.value?.type !== "image" || !n.value || !e.isImageReady(n.value) ? null : t.value[n.value] ?? null), a = i(() => {
|
|
1626
|
+
if (!r.value) return;
|
|
1627
|
+
let { r: e, g: t, b: n } = r.value;
|
|
1628
|
+
return { background: `radial-gradient(circle at top center, rgba(${e},${t},${n},0.34) 0%, transparent 44%), linear-gradient(180deg,#0a0b10,#05060a)` };
|
|
1629
|
+
}), o = i(() => {
|
|
1630
|
+
if (!r.value) return;
|
|
1631
|
+
let { r: e, g: t, b: n } = r.value;
|
|
1632
|
+
return { background: `radial-gradient(circle at center, rgba(${e},${t},${n},0.42) 0%, transparent 44%), linear-gradient(180deg,#0b0c11,#06070b)` };
|
|
1633
|
+
});
|
|
1634
|
+
F(() => e.showDominantImageTone.value, (e) => {
|
|
1635
|
+
e || (t.value = {});
|
|
1636
|
+
});
|
|
1637
|
+
function s(n, r) {
|
|
1638
|
+
if (!e.showDominantImageTone.value) return;
|
|
1639
|
+
let i = qt(r);
|
|
1640
|
+
i && (t.value[n] = i);
|
|
1641
|
+
}
|
|
1642
|
+
return {
|
|
1643
|
+
activeStageToneStyle: a,
|
|
1644
|
+
activeSlideToneStyle: o,
|
|
1645
|
+
updateFromImageElement: s
|
|
1646
|
+
};
|
|
1595
1647
|
}
|
|
1596
1648
|
//#endregion
|
|
1597
1649
|
//#region src/components/SurfaceEmptyState.vue?vue&type=script&setup=true&lang.ts
|
|
1598
|
-
var
|
|
1650
|
+
var Xt = ["data-surface"], Zt = ["data-surface"], Qt = /* @__PURE__ */ d({
|
|
1599
1651
|
inheritAttrs: !1,
|
|
1600
1652
|
__name: "SurfaceEmptyState",
|
|
1601
1653
|
props: {
|
|
@@ -1609,31 +1661,32 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
|
|
|
1609
1661
|
"data-testid": "vibe-empty-state-inline",
|
|
1610
1662
|
"data-surface": e.surface,
|
|
1611
1663
|
class: ["pointer-events-none absolute z-[4] text-center", e.surface === "grid" ? "inset-x-0 top-[clamp(6rem,22vh,11rem)] flex justify-center px-6" : "inset-0 grid place-items-center px-[clamp(2rem,4vw,3rem)] py-[clamp(2rem,4vw,3rem)]"]
|
|
1612
|
-
}), [D(n.$slots, "default", {}, () => [c("p", { class: _(["m-0 text-[0.82rem] font-medium tracking-[0.08em]", e.surface === "grid" ? "text-[#f7f1ea]/58" : "text-[#f7f1ea]/64"]) }, k(e.message), 3)])], 16,
|
|
1664
|
+
}), [D(n.$slots, "default", {}, () => [c("p", { class: _(["m-0 text-[0.82rem] font-medium tracking-[0.08em]", e.surface === "grid" ? "text-[#f7f1ea]/58" : "text-[#f7f1ea]/64"]) }, k(e.message), 3)])], 16, Xt)) : (S(), s("div", h({ key: 1 }, j(t), { class: ["pointer-events-none absolute z-[4]", e.surface === "grid" ? "inset-x-0 bottom-0 flex justify-center px-6" : "bottom-[1.8rem] left-1/2 -translate-x-1/2 max-[720px]:bottom-[1.3rem]"] }), [D(n.$slots, "default", {}, () => [c("span", {
|
|
1613
1665
|
"data-testid": "vibe-empty-state-badge",
|
|
1614
1666
|
"data-surface": e.surface,
|
|
1615
1667
|
class: _(["inline-flex items-center border border-white/14 backdrop-blur-[18px]", e.surface === "grid" ? "bg-black/55 px-4 py-3 text-[0.82rem] font-medium tracking-[0.08em] text-[#f7f1ea]/72" : "w-auto bg-black/40 px-5 py-3 text-[0.82rem] font-medium tracking-[0.08em] text-[#f7f1ea]/74 max-[720px]:w-[calc(100%-2.5rem)] max-[720px]:justify-center"])
|
|
1616
|
-
}, k(e.message), 11,
|
|
1668
|
+
}, k(e.message), 11, Zt)])], 16));
|
|
1617
1669
|
}
|
|
1618
|
-
}),
|
|
1670
|
+
}), $t = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f7f1ea]" }, en = {
|
|
1619
1671
|
key: 0,
|
|
1620
1672
|
class: "relative h-full min-h-0"
|
|
1621
|
-
},
|
|
1673
|
+
}, tn = [
|
|
1622
1674
|
"data-item-id",
|
|
1623
1675
|
"data-occurrence-key",
|
|
1624
1676
|
"data-index",
|
|
1625
1677
|
"data-active",
|
|
1626
1678
|
"aria-hidden"
|
|
1627
|
-
],
|
|
1679
|
+
], nn = {
|
|
1628
1680
|
key: 0,
|
|
1629
1681
|
"data-testid": "vibe-asset-spinner",
|
|
1630
1682
|
class: "pointer-events-none absolute inset-0 z-[2] grid place-items-center"
|
|
1631
|
-
},
|
|
1683
|
+
}, rn = { 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]" }, an = ["data-kind"], on = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/45 px-8 py-7 text-center backdrop-blur-[18px]" }, sn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, cn = ["onClick"], ln = [
|
|
1632
1684
|
"src",
|
|
1633
1685
|
"alt",
|
|
1634
1686
|
"onLoad",
|
|
1635
1687
|
"onError"
|
|
1636
|
-
],
|
|
1688
|
+
], un = [
|
|
1689
|
+
"loop",
|
|
1637
1690
|
"src",
|
|
1638
1691
|
"preload",
|
|
1639
1692
|
"onClick",
|
|
@@ -1650,15 +1703,15 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
|
|
|
1650
1703
|
"onStalled",
|
|
1651
1704
|
"onTimeupdate",
|
|
1652
1705
|
"onWaiting"
|
|
1653
|
-
],
|
|
1706
|
+
], dn = { class: "relative grid aspect-square w-[clamp(320px,46vw,560px)] max-w-[calc(100vw-2.5rem)] place-items-center" }, fn = [
|
|
1654
1707
|
"aria-label",
|
|
1655
1708
|
"disabled",
|
|
1656
1709
|
"onClick"
|
|
1657
|
-
],
|
|
1710
|
+
], pn = { 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]" }, mn = { 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]" }, hn = {
|
|
1658
1711
|
key: 0,
|
|
1659
1712
|
"data-testid": "vibe-asset-spinner",
|
|
1660
1713
|
class: "pointer-events-none absolute inset-0 z-[3] grid place-items-center"
|
|
1661
|
-
},
|
|
1714
|
+
}, gn = { 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]" }, _n = ["data-kind"], vn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, yn = ["onClick"], bn = [
|
|
1662
1715
|
"src",
|
|
1663
1716
|
"preload",
|
|
1664
1717
|
"onCanplay",
|
|
@@ -1674,25 +1727,25 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
|
|
|
1674
1727
|
"onStalled",
|
|
1675
1728
|
"onTimeupdate",
|
|
1676
1729
|
"onWaiting"
|
|
1677
|
-
],
|
|
1730
|
+
], xn = {
|
|
1678
1731
|
key: 2,
|
|
1679
1732
|
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"
|
|
1680
|
-
},
|
|
1733
|
+
}, Sn = { 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]" }, Cn = {
|
|
1681
1734
|
key: 0,
|
|
1682
1735
|
class: "pointer-events-none absolute inset-0 z-[4]"
|
|
1683
|
-
},
|
|
1736
|
+
}, wn = { class: "h-full w-full" }, Tn = {
|
|
1684
1737
|
key: 1,
|
|
1685
1738
|
"data-testid": "vibe-forward-fill-placeholder",
|
|
1686
1739
|
class: "grid h-full min-h-0 place-items-center px-6 text-center"
|
|
1687
|
-
},
|
|
1740
|
+
}, En = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/40 px-8 py-7 backdrop-blur-[18px]" }, Dn = { 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)]" }, On = { class: "m-0 text-[0.78rem] font-bold uppercase tracking-[0.24em] text-[#f7f1ea]/72" }, kn = {
|
|
1688
1741
|
key: 0,
|
|
1689
1742
|
"data-testid": "vibe-fullscreen-aside",
|
|
1690
1743
|
class: "h-full min-h-0 overflow-hidden border-l border-white/10 bg-black/45 backdrop-blur-[18px]"
|
|
1691
|
-
},
|
|
1744
|
+
}, An = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, jn = {
|
|
1692
1745
|
key: 0,
|
|
1693
1746
|
"data-testid": "vibe-fullscreen-aside",
|
|
1694
1747
|
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]"
|
|
1695
|
-
},
|
|
1748
|
+
}, Mn = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, Nn = 1280, Pn = /* @__PURE__ */ d({
|
|
1696
1749
|
__name: "FullscreenSurface",
|
|
1697
1750
|
props: {
|
|
1698
1751
|
active: {
|
|
@@ -1711,6 +1764,10 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
|
|
|
1711
1764
|
type: Boolean,
|
|
1712
1765
|
default: !1
|
|
1713
1766
|
},
|
|
1767
|
+
loopFullscreenVideo: {
|
|
1768
|
+
type: Boolean,
|
|
1769
|
+
default: !0
|
|
1770
|
+
},
|
|
1714
1771
|
paginationDetail: { default: null },
|
|
1715
1772
|
phase: { default: null },
|
|
1716
1773
|
reportAssetError: {
|
|
@@ -1721,6 +1778,10 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
|
|
|
1721
1778
|
type: [Function, null],
|
|
1722
1779
|
default: null
|
|
1723
1780
|
},
|
|
1781
|
+
showDominantImageTone: {
|
|
1782
|
+
type: Boolean,
|
|
1783
|
+
default: !0
|
|
1784
|
+
},
|
|
1724
1785
|
showBackToList: {
|
|
1725
1786
|
type: Boolean,
|
|
1726
1787
|
default: !1
|
|
@@ -1742,11 +1803,16 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
|
|
|
1742
1803
|
enabled: A(d, "active"),
|
|
1743
1804
|
onAssetError: d.reportAssetError ?? void 0,
|
|
1744
1805
|
onAssetLoad: d.reportAssetLoad ?? void 0
|
|
1745
|
-
}), C = T(typeof window > "u" ?
|
|
1806
|
+
}), C = T(typeof window > "u" ? Nn : window.innerWidth || Nn), w = ht({
|
|
1746
1807
|
active: A(d, "active"),
|
|
1747
1808
|
resolvedActiveIndex: g.resolvedActiveIndex,
|
|
1748
1809
|
viewer: g
|
|
1749
|
-
}), M = i(() =>
|
|
1810
|
+
}), M = i(() => Gt(g.activeItem.value?.type ?? "image")), { activeSlideToneStyle: P, activeStageToneStyle: F, updateFromImageElement: I } = Yt({
|
|
1811
|
+
activeItem: g.activeItem,
|
|
1812
|
+
getItemKey: w.getItemKey,
|
|
1813
|
+
isImageReady: g.isImageReady,
|
|
1814
|
+
showDominantImageTone: A(d, "showDominantImageTone")
|
|
1815
|
+
}), R = i(() => g.activeMediaItem.value && !g.activeAssetErrorKind.value ? "bottom-[5.8rem] max-[720px]:bottom-[7.4rem]" : "bottom-[1.8rem] max-[720px]:bottom-[1.3rem]"), B = i(() => !!g.activeMediaItem.value && !g.activeAssetErrorKind.value), V = i(() => B.value ? "pb-[5.75rem] max-[720px]:pb-[7rem]" : ""), H = i(() => d.activeIndex >= d.items.length && (d.loading || d.hasNextPage)), ee = i(() => d.hasNextPage ? "Loading more items" : g.statusMessage.value ?? "Loading more items"), U = i(() => {
|
|
1750
1816
|
let e = g.activeItem.value;
|
|
1751
1817
|
return e ? {
|
|
1752
1818
|
hasNextPage: d.hasNextPage,
|
|
@@ -1756,14 +1822,14 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
|
|
|
1756
1822
|
paginationDetail: d.paginationDetail,
|
|
1757
1823
|
total: d.items.length
|
|
1758
1824
|
} : null;
|
|
1759
|
-
}),
|
|
1760
|
-
...
|
|
1825
|
+
}), W = i(() => !U.value || !p["fullscreen-header-actions"] ? [] : p["fullscreen-header-actions"](U.value)), G = i(() => !U.value || !p["fullscreen-aside"] ? [] : p["fullscreen-aside"](U.value)), K = i(() => !d.showStatusBadges || !U.value || !g.statusKind.value || !g.statusMessage.value ? null : {
|
|
1826
|
+
...U.value,
|
|
1761
1827
|
kind: g.statusKind.value,
|
|
1762
1828
|
message: g.statusMessage.value
|
|
1763
|
-
}),
|
|
1764
|
-
gridTemplateColumns:
|
|
1829
|
+
}), q = i(() => !K.value || !p["fullscreen-status"] ? [] : p["fullscreen-status"](K.value)), J = i(() => ({
|
|
1830
|
+
gridTemplateColumns: ne.value ? "minmax(0, 1fr) 22rem" : "minmax(0, 1fr) 0rem",
|
|
1765
1831
|
transition: "grid-template-columns 320ms cubic-bezier(0.22, 1, 0.36, 1)"
|
|
1766
|
-
})),
|
|
1832
|
+
})), te = i(() => gt(W.value)), Y = i(() => gt(G.value)), ne = i(() => Y.value && C.value >= Nn), re = i(() => Y.value && !ne.value), ce = i(() => gt(q.value)), { emptyStateProps: X, showBadgeEmptyState: le, showCustomEmptyState: ue, showInlineEmptyState: de } = yt({
|
|
1767
1833
|
emptyStateMode: A(d, "emptyStateMode"),
|
|
1768
1834
|
itemCount: i(() => d.items.length),
|
|
1769
1835
|
loading: A(d, "loading"),
|
|
@@ -1771,18 +1837,32 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
|
|
|
1771
1837
|
surface: "fullscreen"
|
|
1772
1838
|
});
|
|
1773
1839
|
x(() => {
|
|
1774
|
-
window.addEventListener("resize",
|
|
1840
|
+
window.addEventListener("resize", fe);
|
|
1775
1841
|
}), b(() => {
|
|
1776
|
-
window.removeEventListener("resize",
|
|
1842
|
+
window.removeEventListener("resize", fe);
|
|
1777
1843
|
});
|
|
1778
|
-
function
|
|
1779
|
-
C.value = window.innerWidth ||
|
|
1844
|
+
function fe() {
|
|
1845
|
+
C.value = window.innerWidth || Nn;
|
|
1846
|
+
}
|
|
1847
|
+
function pe(e, t, n) {
|
|
1848
|
+
g.onImageLoad(t, n);
|
|
1849
|
+
let r = e.currentTarget;
|
|
1850
|
+
r instanceof HTMLImageElement && he(t, r);
|
|
1851
|
+
}
|
|
1852
|
+
function me(e, t) {
|
|
1853
|
+
g.registerImageElement(e, t), t instanceof HTMLImageElement && he(e, t);
|
|
1780
1854
|
}
|
|
1781
|
-
|
|
1782
|
-
|
|
1855
|
+
function he(e, t) {
|
|
1856
|
+
I(e, t);
|
|
1857
|
+
}
|
|
1858
|
+
return (e, n) => (S(), s("div", $t, [
|
|
1859
|
+
c("div", {
|
|
1860
|
+
class: _(["absolute inset-0 transition-[background] duration-200", M.value]),
|
|
1861
|
+
style: y(j(F))
|
|
1862
|
+
}, null, 6),
|
|
1783
1863
|
c("div", {
|
|
1784
1864
|
class: "relative z-[1] grid h-full min-h-0",
|
|
1785
|
-
style: y(
|
|
1865
|
+
style: y(J.value)
|
|
1786
1866
|
}, [c("div", {
|
|
1787
1867
|
ref: "viewer.stageRef",
|
|
1788
1868
|
"data-testid": "vibe-stage",
|
|
@@ -1792,7 +1872,7 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
|
|
|
1792
1872
|
onPointerup: n[3] ||= (...e) => j(g).onPointerUp && j(g).onPointerUp(...e),
|
|
1793
1873
|
onPointercancel: n[4] ||= (...e) => j(g).onPointerCancel && j(g).onPointerCancel(...e),
|
|
1794
1874
|
onWheel: n[5] ||= (...e) => j(g).onWheel && j(g).onWheel(...e)
|
|
1795
|
-
}, [j(g).activeItem.value ? (S(), s("div",
|
|
1875
|
+
}, [j(g).activeItem.value ? (S(), s("div", en, [
|
|
1796
1876
|
(S(!0), s(t, null, E(j(g).renderedItems.value, ({ item: r, index: i }) => (S(), s("article", {
|
|
1797
1877
|
key: j(w).getItemKey(r),
|
|
1798
1878
|
"data-testid": "vibe-slide",
|
|
@@ -1803,10 +1883,13 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
|
|
|
1803
1883
|
"aria-hidden": i === j(g).resolvedActiveIndex.value ? "false" : "true",
|
|
1804
1884
|
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"]),
|
|
1805
1885
|
style: y(j(g).getSlideStyle(i))
|
|
1806
|
-
}, [c("div", {
|
|
1886
|
+
}, [c("div", {
|
|
1887
|
+
class: _(["absolute inset-0 opacity-85", j(Kt)(r.type)]),
|
|
1888
|
+
style: y(i === j(g).resolvedActiveIndex.value && r.type === "image" ? j(P) : void 0)
|
|
1889
|
+
}, null, 6), j(g).isVisual(r) ? (S(), s("div", {
|
|
1807
1890
|
key: 0,
|
|
1808
|
-
class: _(["relative z-[1] flex h-full w-full items-center justify-center overflow-hidden", i === j(g).resolvedActiveIndex.value ?
|
|
1809
|
-
}, [j(w).isAssetLoading(i, r) ? (S(), s("div",
|
|
1891
|
+
class: _(["relative z-[1] flex h-full w-full items-center justify-center overflow-hidden", i === j(g).resolvedActiveIndex.value ? V.value : ""])
|
|
1892
|
+
}, [j(w).isAssetLoading(i, r) ? (S(), s("div", nn, [c("span", rn, [u(j(ie), {
|
|
1810
1893
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
1811
1894
|
"aria-hidden": "true"
|
|
1812
1895
|
})])])) : o("", !0), j(w).isAssetErrored(i, r) ? (S(), s("div", {
|
|
@@ -1814,33 +1897,35 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
|
|
|
1814
1897
|
"data-testid": "vibe-asset-error",
|
|
1815
1898
|
"data-kind": j(w).getAssetErrorKind(r),
|
|
1816
1899
|
class: "grid h-full w-full place-items-center"
|
|
1817
|
-
}, [c("div",
|
|
1818
|
-
u(j(
|
|
1900
|
+
}, [c("div", on, [
|
|
1901
|
+
u(j(se), {
|
|
1819
1902
|
class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
|
|
1820
1903
|
"aria-hidden": "true"
|
|
1821
1904
|
}),
|
|
1822
|
-
c("p",
|
|
1905
|
+
c("p", sn, k(j(w).getAssetErrorLabel(r)), 1),
|
|
1823
1906
|
j(g).canRetryAsset(j(w).getItemKey(r)) ? (S(), s("button", {
|
|
1824
1907
|
key: 0,
|
|
1825
1908
|
type: "button",
|
|
1826
1909
|
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",
|
|
1827
1910
|
onClick: z((e) => j(g).retryAsset(j(w).getItemKey(r)), ["stop"])
|
|
1828
|
-
}, " Retry ", 8,
|
|
1829
|
-
])], 8,
|
|
1911
|
+
}, " Retry ", 8, cn)) : o("", !0)
|
|
1912
|
+
])], 8, an)) : r.type === "image" ? (S(), s("img", {
|
|
1830
1913
|
key: j(g).getAssetRenderKey(j(w).getItemKey(r)),
|
|
1831
1914
|
src: j(w).getFullscreenImageSource(i, r),
|
|
1832
1915
|
alt: r.title ?? "",
|
|
1916
|
+
crossorigin: "anonymous",
|
|
1833
1917
|
draggable: "false",
|
|
1834
1918
|
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(j(w).getItemKey(r)) ? "opacity-100" : "opacity-0"]),
|
|
1835
1919
|
ref_for: !0,
|
|
1836
|
-
ref: (e) =>
|
|
1837
|
-
onLoad: (e) =>
|
|
1920
|
+
ref: (e) => me(j(w).getItemKey(r), e),
|
|
1921
|
+
onLoad: (e) => pe(e, j(w).getItemKey(r), r.url),
|
|
1838
1922
|
onError: (e) => j(g).onImageError(j(w).getItemKey(r), r.url)
|
|
1839
|
-
}, null, 42,
|
|
1923
|
+
}, null, 42, ln)) : (S(), s("video", {
|
|
1840
1924
|
key: j(g).getAssetRenderKey(j(w).getItemKey(r)),
|
|
1841
1925
|
class: _(["block h-auto max-h-full w-auto max-w-full cursor-pointer object-contain shadow-[0_40px_120px_-60px_rgba(0,0,0,0.9)] transition-opacity duration-300", j(g).isMediaReady(j(w).getItemKey(r)) ? "opacity-100" : "opacity-0"]),
|
|
1842
1926
|
playsinline: "",
|
|
1843
1927
|
muted: "",
|
|
1928
|
+
loop: d.loopFullscreenVideo,
|
|
1844
1929
|
src: j(w).getFullscreenMediaSource(i, r),
|
|
1845
1930
|
preload: j(w).shouldPreloadSlideAsset(i) ? "metadata" : "none",
|
|
1846
1931
|
ref_for: !0,
|
|
@@ -1859,10 +1944,10 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
|
|
|
1859
1944
|
onStalled: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
|
|
1860
1945
|
onTimeupdate: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
|
|
1861
1946
|
onWaiting: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e)
|
|
1862
|
-
}, null, 42,
|
|
1947
|
+
}, null, 42, un))], 2)) : j(g).isAudio(r) ? (S(), s("div", {
|
|
1863
1948
|
key: 1,
|
|
1864
|
-
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 ?
|
|
1865
|
-
}, [c("div",
|
|
1949
|
+
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 ? V.value : ""])
|
|
1950
|
+
}, [c("div", dn, [
|
|
1866
1951
|
c("button", {
|
|
1867
1952
|
type: "button",
|
|
1868
1953
|
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]",
|
|
@@ -1872,19 +1957,19 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
|
|
|
1872
1957
|
}, [
|
|
1873
1958
|
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),
|
|
1874
1959
|
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),
|
|
1875
|
-
c("span",
|
|
1960
|
+
c("span", pn, [D(e.$slots, "item-icon", {
|
|
1876
1961
|
icon: j(ft)(r.type),
|
|
1877
1962
|
item: r
|
|
1878
1963
|
}, () => [(S(), a(O(j(ft)(r.type)), {
|
|
1879
1964
|
class: "h-6 w-6 stroke-[1.9]",
|
|
1880
1965
|
"aria-hidden": "true"
|
|
1881
1966
|
}))])]),
|
|
1882
|
-
c("span",
|
|
1967
|
+
c("span", mn, [(S(), a(O(j(g).mediaStates.value[j(w).getItemKey(r)]?.paused ?? !0 ? j(oe) : j(ae)), {
|
|
1883
1968
|
class: "h-4 w-4 stroke-2",
|
|
1884
1969
|
"aria-hidden": "true"
|
|
1885
1970
|
}))])
|
|
1886
|
-
], 8,
|
|
1887
|
-
j(w).isAssetLoading(i, r) ? (S(), s("div",
|
|
1971
|
+
], 8, fn),
|
|
1972
|
+
j(w).isAssetLoading(i, r) ? (S(), s("div", hn, [c("span", gn, [u(j(ie), {
|
|
1888
1973
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
1889
1974
|
"aria-hidden": "true"
|
|
1890
1975
|
})])])) : o("", !0),
|
|
@@ -1893,18 +1978,18 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
|
|
|
1893
1978
|
"data-kind": j(w).getAssetErrorKind(r),
|
|
1894
1979
|
class: "relative z-[1] grid justify-items-center gap-4"
|
|
1895
1980
|
}, [
|
|
1896
|
-
u(j(
|
|
1981
|
+
u(j(se), {
|
|
1897
1982
|
class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
|
|
1898
1983
|
"aria-hidden": "true"
|
|
1899
1984
|
}),
|
|
1900
|
-
c("p",
|
|
1985
|
+
c("p", vn, k(j(w).getAssetErrorLabel(r)), 1),
|
|
1901
1986
|
j(g).canRetryAsset(j(w).getItemKey(r)) ? (S(), s("button", {
|
|
1902
1987
|
key: 0,
|
|
1903
1988
|
type: "button",
|
|
1904
1989
|
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",
|
|
1905
1990
|
onClick: z((e) => j(g).retryAsset(j(w).getItemKey(r)), ["stop"])
|
|
1906
|
-
}, " Retry ", 8,
|
|
1907
|
-
], 8,
|
|
1991
|
+
}, " Retry ", 8, yn)) : o("", !0)
|
|
1992
|
+
], 8, _n)], 64)) : o("", !0)
|
|
1908
1993
|
]), (S(), s("audio", {
|
|
1909
1994
|
key: j(g).getAssetRenderKey(j(w).getItemKey(r)),
|
|
1910
1995
|
src: j(w).getFullscreenMediaSource(i, r),
|
|
@@ -1925,14 +2010,14 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
|
|
|
1925
2010
|
onStalled: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
|
|
1926
2011
|
onTimeupdate: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
|
|
1927
2012
|
onWaiting: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e)
|
|
1928
|
-
}, null, 40,
|
|
2013
|
+
}, null, 40, bn))], 2)) : (S(), s("div", xn, [c("div", Sn, [D(e.$slots, "item-icon", {
|
|
1929
2014
|
icon: j(ft)(r.type),
|
|
1930
2015
|
item: r
|
|
1931
2016
|
}, () => [(S(), a(O(j(ft)(r.type)), {
|
|
1932
2017
|
class: "h-6 w-6 stroke-[1.9]",
|
|
1933
2018
|
"aria-hidden": "true"
|
|
1934
|
-
}))])])]))], 14,
|
|
1935
|
-
|
|
2019
|
+
}))])])]))], 14, tn))), 128)),
|
|
2020
|
+
U.value && p["fullscreen-overlay"] ? (S(), s("div", Cn, [c("div", wn, [D(e.$slots, "fullscreen-overlay", v(f(U.value)))])])) : o("", !0),
|
|
1936
2021
|
j(g).activeItem.value ? (S(), a(lt, {
|
|
1937
2022
|
key: 1,
|
|
1938
2023
|
"current-index": j(g).resolvedActiveIndex.value,
|
|
@@ -1943,9 +2028,9 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
|
|
|
1943
2028
|
title: j(g).activeItem.value.title ?? null,
|
|
1944
2029
|
total: j(g).items.value.length,
|
|
1945
2030
|
onBackToList: n[0] ||= (e) => m("back-to-list")
|
|
1946
|
-
}, l({ _: 2 }, [
|
|
2031
|
+
}, l({ _: 2 }, [te.value && U.value ? {
|
|
1947
2032
|
name: "actions",
|
|
1948
|
-
fn: L(() => [D(e.$slots, "fullscreen-header-actions", v(f(
|
|
2033
|
+
fn: L(() => [D(e.$slots, "fullscreen-header-actions", v(f(U.value)))]),
|
|
1949
2034
|
key: "0"
|
|
1950
2035
|
} : void 0]), 1032, [
|
|
1951
2036
|
"current-index",
|
|
@@ -1956,7 +2041,7 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
|
|
|
1956
2041
|
"title",
|
|
1957
2042
|
"total"
|
|
1958
2043
|
])) : o("", !0),
|
|
1959
|
-
|
|
2044
|
+
B.value ? (S(), a(Qe, {
|
|
1960
2045
|
key: 2,
|
|
1961
2046
|
"current-time": j(g).activeMediaState.value.currentTime,
|
|
1962
2047
|
"current-time-label": j(g).formatPlaybackTime(j(g).activeMediaState.value.currentTime),
|
|
@@ -1972,36 +2057,36 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
|
|
|
1972
2057
|
"progress",
|
|
1973
2058
|
"onSeekInput"
|
|
1974
2059
|
])) : o("", !0),
|
|
1975
|
-
|
|
2060
|
+
K.value ? (S(), s("div", {
|
|
1976
2061
|
key: 3,
|
|
1977
|
-
class: _(["absolute left-1/2 z-[4] -translate-x-1/2",
|
|
1978
|
-
}, [
|
|
2062
|
+
class: _(["absolute left-1/2 z-[4] -translate-x-1/2", R.value])
|
|
2063
|
+
}, [ce.value ? D(e.$slots, "fullscreen-status", v(h({ key: 0 }, K.value))) : (S(), s("div", {
|
|
1979
2064
|
key: 1,
|
|
1980
2065
|
"data-testid": "vibe-fullscreen-status-badge",
|
|
1981
|
-
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",
|
|
1982
|
-
}, k(
|
|
1983
|
-
])) :
|
|
2066
|
+
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", K.value.kind === "end" ? "border-amber-300/35 text-amber-200" : K.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
|
|
2067
|
+
}, k(K.value.message), 3))], 2)) : o("", !0)
|
|
2068
|
+
])) : H.value ? (S(), s("div", Tn, [c("div", En, [c("span", Dn, [u(j(ie), {
|
|
1984
2069
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
1985
2070
|
"aria-hidden": "true"
|
|
1986
|
-
})]), c("p",
|
|
2071
|
+
})]), c("p", On, k(ee.value), 1)])])) : j(de) && j(X) ? (S(), a(Qt, {
|
|
1987
2072
|
key: 2,
|
|
1988
2073
|
message: j(X).message,
|
|
1989
2074
|
mode: j(X).mode,
|
|
1990
2075
|
surface: j(X).surface
|
|
1991
2076
|
}, {
|
|
1992
|
-
default: L(() => [j(
|
|
2077
|
+
default: L(() => [j(ue) ? D(e.$slots, "empty-state", v(h({ key: 0 }, j(X)))) : o("", !0)]),
|
|
1993
2078
|
_: 3
|
|
1994
2079
|
}, 8, [
|
|
1995
2080
|
"message",
|
|
1996
2081
|
"mode",
|
|
1997
2082
|
"surface"
|
|
1998
|
-
])) : o("", !0), j(
|
|
2083
|
+
])) : o("", !0), j(le) && j(X) ? (S(), a(Qt, {
|
|
1999
2084
|
key: 3,
|
|
2000
2085
|
message: j(X).message,
|
|
2001
2086
|
mode: j(X).mode,
|
|
2002
2087
|
surface: j(X).surface
|
|
2003
2088
|
}, {
|
|
2004
|
-
default: L(() => [j(
|
|
2089
|
+
default: L(() => [j(ue) ? D(e.$slots, "empty-state", v(h({ key: 0 }, j(X)))) : o("", !0)]),
|
|
2005
2090
|
_: 3
|
|
2006
2091
|
}, 8, [
|
|
2007
2092
|
"message",
|
|
@@ -2015,7 +2100,7 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
|
|
|
2015
2100
|
"leave-from-class": "translate-x-0 opacity-100",
|
|
2016
2101
|
"leave-to-class": "translate-x-full opacity-0"
|
|
2017
2102
|
}, {
|
|
2018
|
-
default: L(() => [
|
|
2103
|
+
default: L(() => [ne.value && U.value ? (S(), s("aside", kn, [c("div", An, [D(e.$slots, "fullscreen-aside", v(f(U.value)))])])) : o("", !0)]),
|
|
2019
2104
|
_: 3
|
|
2020
2105
|
})], 4),
|
|
2021
2106
|
u(r, {
|
|
@@ -2026,29 +2111,29 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
|
|
|
2026
2111
|
"leave-from-class": "translate-x-0 opacity-100",
|
|
2027
2112
|
"leave-to-class": "translate-x-full opacity-0"
|
|
2028
2113
|
}, {
|
|
2029
|
-
default: L(() => [
|
|
2114
|
+
default: L(() => [re.value && U.value ? (S(), s("aside", jn, [c("div", Mn, [D(e.$slots, "fullscreen-aside", v(f(U.value)))])])) : o("", !0)]),
|
|
2030
2115
|
_: 3
|
|
2031
2116
|
})
|
|
2032
2117
|
]));
|
|
2033
2118
|
}
|
|
2034
|
-
}),
|
|
2035
|
-
function
|
|
2119
|
+
}), Fn = 1, In = .5;
|
|
2120
|
+
function Ln(e) {
|
|
2036
2121
|
if (e.type !== "image" && e.type !== "video") return {
|
|
2037
|
-
width:
|
|
2038
|
-
height:
|
|
2122
|
+
width: Fn,
|
|
2123
|
+
height: Fn,
|
|
2039
2124
|
source: "fallback"
|
|
2040
2125
|
};
|
|
2041
2126
|
let t = e.preview?.width, n = e.preview?.height;
|
|
2042
|
-
if (
|
|
2043
|
-
let r =
|
|
2127
|
+
if (Wn(t) && Wn(n)) {
|
|
2128
|
+
let r = Gn(e, t, n);
|
|
2044
2129
|
return {
|
|
2045
2130
|
width: r.width,
|
|
2046
2131
|
height: r.height,
|
|
2047
2132
|
source: "preview"
|
|
2048
2133
|
};
|
|
2049
2134
|
}
|
|
2050
|
-
if (
|
|
2051
|
-
let t =
|
|
2135
|
+
if (Wn(e.width) && Wn(e.height)) {
|
|
2136
|
+
let t = Gn(e, e.width, e.height);
|
|
2052
2137
|
return {
|
|
2053
2138
|
width: t.width,
|
|
2054
2139
|
height: t.height,
|
|
@@ -2056,31 +2141,31 @@ function Nn(e) {
|
|
|
2056
2141
|
};
|
|
2057
2142
|
}
|
|
2058
2143
|
return {
|
|
2059
|
-
width:
|
|
2060
|
-
height:
|
|
2144
|
+
width: Fn,
|
|
2145
|
+
height: Fn,
|
|
2061
2146
|
source: "fallback"
|
|
2062
2147
|
};
|
|
2063
2148
|
}
|
|
2064
|
-
function
|
|
2149
|
+
function Rn(e, t) {
|
|
2065
2150
|
return !e || e <= 0 || !t || t <= 0 ? 1 : Math.max(1, Math.floor(e / t));
|
|
2066
2151
|
}
|
|
2067
|
-
function
|
|
2152
|
+
function zn(e, t, n, r = 0) {
|
|
2068
2153
|
if (!e || e <= 0 || !t || t <= 0) return n;
|
|
2069
2154
|
let i = typeof r == "number" && r > 0 ? r : 0, a = e - Math.max(0, t - 1) * i;
|
|
2070
2155
|
return !a || a <= 0 ? n : a / t;
|
|
2071
2156
|
}
|
|
2072
|
-
function
|
|
2073
|
-
let n =
|
|
2157
|
+
function Bn(e, t) {
|
|
2158
|
+
let n = Ln(e);
|
|
2074
2159
|
return n.height / n.width * t;
|
|
2075
2160
|
}
|
|
2076
|
-
function
|
|
2161
|
+
function Vn(e, t) {
|
|
2077
2162
|
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;
|
|
2078
2163
|
for (let c = 0; c < e.length; c += 1) {
|
|
2079
2164
|
let l = e[c];
|
|
2080
2165
|
o.set(Q(l), c);
|
|
2081
2166
|
let u = 0;
|
|
2082
2167
|
for (let e = 1; e < n.length; e += 1) n[e] < n[u] && (u = e);
|
|
2083
|
-
let d = u * (t.columnWidth + t.gapX), f = n[u], p =
|
|
2168
|
+
let d = u * (t.columnWidth + t.gapX), f = n[u], p = Bn(l, t.columnWidth);
|
|
2084
2169
|
r[c] = {
|
|
2085
2170
|
x: d,
|
|
2086
2171
|
y: f
|
|
@@ -2099,7 +2184,7 @@ function Ln(e, t) {
|
|
|
2099
2184
|
indexById: o
|
|
2100
2185
|
};
|
|
2101
2186
|
}
|
|
2102
|
-
function
|
|
2187
|
+
function Hn(e) {
|
|
2103
2188
|
if (e.itemCount <= 0) return [];
|
|
2104
2189
|
if (e.viewportHeight <= 0) return Array.from({ length: e.itemCount }, (e, t) => t);
|
|
2105
2190
|
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();
|
|
@@ -2109,7 +2194,7 @@ function Rn(e) {
|
|
|
2109
2194
|
}
|
|
2110
2195
|
return Array.from(a).sort((e, t) => e - t);
|
|
2111
2196
|
}
|
|
2112
|
-
function
|
|
2197
|
+
function Un(e, t, n) {
|
|
2113
2198
|
let r = /* @__PURE__ */ new Map();
|
|
2114
2199
|
for (let i of e) {
|
|
2115
2200
|
let e = t.get(Q(i));
|
|
@@ -2119,11 +2204,11 @@ function zn(e, t, n) {
|
|
|
2119
2204
|
}
|
|
2120
2205
|
return r;
|
|
2121
2206
|
}
|
|
2122
|
-
function
|
|
2207
|
+
function Wn(e) {
|
|
2123
2208
|
return typeof e == "number" && Number.isFinite(e) && e > 0;
|
|
2124
2209
|
}
|
|
2125
|
-
function
|
|
2126
|
-
return e.type !== "image" || n / t >=
|
|
2210
|
+
function Gn(e, t, n) {
|
|
2211
|
+
return e.type !== "image" || n / t >= In ? {
|
|
2127
2212
|
width: t,
|
|
2128
2213
|
height: n
|
|
2129
2214
|
} : {
|
|
@@ -2133,21 +2218,21 @@ function Vn(e, t, n) {
|
|
|
2133
2218
|
}
|
|
2134
2219
|
//#endregion
|
|
2135
2220
|
//#region src/components/viewer-core/useMasonryMotion.ts
|
|
2136
|
-
var
|
|
2137
|
-
function
|
|
2221
|
+
var Kn = 300, qn = 600, Jn = 40, Yn = 300, Xn = 400;
|
|
2222
|
+
function Zn(e, t) {
|
|
2138
2223
|
return t === "top" ? [...e].reverse() : e;
|
|
2139
2224
|
}
|
|
2140
|
-
function
|
|
2141
|
-
return e <= 0 ?
|
|
2225
|
+
function Qn(e) {
|
|
2226
|
+
return e <= 0 ? qn : qn + Math.min((e - 1) * Jn, Xn);
|
|
2142
2227
|
}
|
|
2143
|
-
function
|
|
2144
|
-
return
|
|
2228
|
+
function $n() {
|
|
2229
|
+
return Yn;
|
|
2145
2230
|
}
|
|
2146
|
-
function
|
|
2231
|
+
function er(e) {
|
|
2147
2232
|
let t = e.itemHeight > 0 ? e.itemHeight : e.columnWidth;
|
|
2148
2233
|
return e.direction === "top" ? e.scrollTop - t : e.scrollTop + e.viewportHeight + t;
|
|
2149
2234
|
}
|
|
2150
|
-
function
|
|
2235
|
+
function tr(e) {
|
|
2151
2236
|
let t = T(/* @__PURE__ */ new Set()), n = T(/* @__PURE__ */ new Set()), r = T(/* @__PURE__ */ new Map()), a = T(/* @__PURE__ */ new Map()), o = T(/* @__PURE__ */ new Map()), s = T(/* @__PURE__ */ new Set()), c = T(/* @__PURE__ */ new Map()), l = T(/* @__PURE__ */ new Map()), u = T(/* @__PURE__ */ new Set()), d = /* @__PURE__ */ new Set(), f = /* @__PURE__ */ new Set(), p = i(() => Array.from(o.value.values()));
|
|
2152
2237
|
F(e.visibleIndices, (i) => {
|
|
2153
2238
|
if (!i.length) return;
|
|
@@ -2157,20 +2242,20 @@ function Zn(e) {
|
|
|
2157
2242
|
!r || !t.value.has(r) || d.has(r) || (d.add(r), o.push(r));
|
|
2158
2243
|
}
|
|
2159
2244
|
if (!o.length) return;
|
|
2160
|
-
let s =
|
|
2161
|
-
for (let e = 0; e < s.length; e += 1) c.set(s[e], Math.min(e *
|
|
2162
|
-
r.value = c,
|
|
2245
|
+
let s = Zn(o, a.value.get(o[0]) ?? "bottom"), c = new Map(r.value);
|
|
2246
|
+
for (let e = 0; e < s.length; e += 1) c.set(s[e], Math.min(e * Jn, Xn));
|
|
2247
|
+
r.value = c, nr(() => {
|
|
2163
2248
|
let e = new Set(n.value);
|
|
2164
2249
|
for (let t of o) e.add(t);
|
|
2165
2250
|
n.value = e;
|
|
2166
|
-
}),
|
|
2251
|
+
}), rr(() => {
|
|
2167
2252
|
let e = new Set(t.value);
|
|
2168
2253
|
for (let t of o) e.delete(t);
|
|
2169
2254
|
t.value = e, S(() => {
|
|
2170
2255
|
let e = new Set(n.value), t = new Map(r.value), i = new Map(a.value);
|
|
2171
2256
|
for (let n of o) e.delete(n), t.delete(n), i.delete(n), d.delete(n);
|
|
2172
2257
|
n.value = e, r.value = t, a.value = i;
|
|
2173
|
-
},
|
|
2258
|
+
}, Qn(o.length));
|
|
2174
2259
|
});
|
|
2175
2260
|
}, { flush: "post" }), F(() => e.items.value.map((e) => Q(e)), (e) => {
|
|
2176
2261
|
if (!e.length || !o.value.size) return;
|
|
@@ -2197,7 +2282,7 @@ function Zn(e) {
|
|
|
2197
2282
|
let e = Q(t.item);
|
|
2198
2283
|
p.push(e), i.set(e, t), c.delete(e), l.delete(e), u.delete(e), f.delete(e), d.delete(e);
|
|
2199
2284
|
}
|
|
2200
|
-
o.value = i, t.value = c, n.value = l, r.value = u, a.value = f,
|
|
2285
|
+
o.value = i, t.value = c, n.value = l, r.value = u, a.value = f, nr(() => {
|
|
2201
2286
|
let e = new Set(s.value);
|
|
2202
2287
|
for (let t of p) e.add(t);
|
|
2203
2288
|
s.value = e;
|
|
@@ -2205,9 +2290,9 @@ function Zn(e) {
|
|
|
2205
2290
|
let e = new Map(o.value), t = new Set(s.value);
|
|
2206
2291
|
for (let n of p) e.delete(n), t.delete(n);
|
|
2207
2292
|
o.value = e, s.value = t;
|
|
2208
|
-
},
|
|
2293
|
+
}, Yn);
|
|
2209
2294
|
}
|
|
2210
|
-
function g(t, n, r =
|
|
2295
|
+
function g(t, n, r = Kn) {
|
|
2211
2296
|
if (!t.size) return;
|
|
2212
2297
|
let i = /* @__PURE__ */ new Map(), a = [];
|
|
2213
2298
|
for (let [r, o] of t.entries()) {
|
|
@@ -2226,8 +2311,8 @@ function Zn(e) {
|
|
|
2226
2311
|
c.value = i, u.value = /* @__PURE__ */ new Set();
|
|
2227
2312
|
let o = new Map(l.value);
|
|
2228
2313
|
for (let e of a) o.set(e, r);
|
|
2229
|
-
l.value = o,
|
|
2230
|
-
u.value = new Set(a),
|
|
2314
|
+
l.value = o, nr(() => {
|
|
2315
|
+
u.value = new Set(a), nr(() => {
|
|
2231
2316
|
c.value = /* @__PURE__ */ new Map();
|
|
2232
2317
|
});
|
|
2233
2318
|
}), S(() => {
|
|
@@ -2238,8 +2323,8 @@ function Zn(e) {
|
|
|
2238
2323
|
}, r);
|
|
2239
2324
|
}
|
|
2240
2325
|
function _(e) {
|
|
2241
|
-
if (n.value.has(e)) return `transform ${
|
|
2242
|
-
if (u.value.has(e)) return `transform ${l.value.get(e) ??
|
|
2326
|
+
if (n.value.has(e)) return `transform ${qn}ms ease-out`;
|
|
2327
|
+
if (u.value.has(e)) return `transform ${l.value.get(e) ?? Kn}ms ease-out`;
|
|
2243
2328
|
}
|
|
2244
2329
|
function v(e) {
|
|
2245
2330
|
if (!n.value.has(e)) return;
|
|
@@ -2256,7 +2341,7 @@ function Zn(e) {
|
|
|
2256
2341
|
} : {
|
|
2257
2342
|
dx: 0,
|
|
2258
2343
|
dy: 0
|
|
2259
|
-
}, u = s ? a.value.get(s) ?? "bottom" : "bottom", d = s && t.value.has(s) ?
|
|
2344
|
+
}, u = s ? a.value.get(s) ?? "bottom" : "bottom", d = s && t.value.has(s) ? er({
|
|
2260
2345
|
columnWidth: e.columnWidth.value,
|
|
2261
2346
|
direction: u,
|
|
2262
2347
|
itemHeight: o,
|
|
@@ -2270,14 +2355,14 @@ function Zn(e) {
|
|
|
2270
2355
|
if (!r) return {
|
|
2271
2356
|
opacity: "0",
|
|
2272
2357
|
transform: "translate3d(0, 0, 0) scale(0.96)",
|
|
2273
|
-
transition: `opacity ${
|
|
2358
|
+
transition: `opacity ${Yn}ms ease-out, transform ${Yn}ms ease-out`
|
|
2274
2359
|
};
|
|
2275
2360
|
let i = s.value.has(n);
|
|
2276
2361
|
return {
|
|
2277
2362
|
height: `${r.height}px`,
|
|
2278
2363
|
opacity: i ? "0" : "1",
|
|
2279
2364
|
transform: `translate3d(${r.position.x}px, ${r.position.y}px, 0) scale(${i ? "0.96" : "1"})`,
|
|
2280
|
-
transition: `opacity ${
|
|
2365
|
+
transition: `opacity ${Yn}ms ease-out, transform ${Yn}ms ease-out`,
|
|
2281
2366
|
width: `${e.columnWidth.value}px`
|
|
2282
2367
|
};
|
|
2283
2368
|
}
|
|
@@ -2298,28 +2383,28 @@ function Zn(e) {
|
|
|
2298
2383
|
playFlipMoveAnimation: g
|
|
2299
2384
|
};
|
|
2300
2385
|
}
|
|
2301
|
-
function
|
|
2386
|
+
function nr(e) {
|
|
2302
2387
|
if (typeof requestAnimationFrame == "function") {
|
|
2303
2388
|
requestAnimationFrame(() => e());
|
|
2304
2389
|
return;
|
|
2305
2390
|
}
|
|
2306
2391
|
setTimeout(e, 0);
|
|
2307
2392
|
}
|
|
2308
|
-
function
|
|
2309
|
-
|
|
2393
|
+
function rr(e) {
|
|
2394
|
+
nr(() => nr(e));
|
|
2310
2395
|
}
|
|
2311
2396
|
//#endregion
|
|
2312
2397
|
//#region src/components/viewer-core/masonryViewport.ts
|
|
2313
|
-
function
|
|
2398
|
+
function ir(e, t) {
|
|
2314
2399
|
return e?.clientHeight || Math.round(e?.getBoundingClientRect().height ?? 0) || t || window.innerHeight || 1;
|
|
2315
2400
|
}
|
|
2316
|
-
function
|
|
2401
|
+
function ar(e, t, n) {
|
|
2317
2402
|
return e?.clientWidth || Math.round(e?.getBoundingClientRect().width ?? 0) || t || window.innerWidth || n;
|
|
2318
2403
|
}
|
|
2319
|
-
function
|
|
2404
|
+
function or(e, t, n, r) {
|
|
2320
2405
|
return (e?.scrollHeight ?? r) - (t + n);
|
|
2321
2406
|
}
|
|
2322
|
-
function
|
|
2407
|
+
function sr(e, t) {
|
|
2323
2408
|
return {
|
|
2324
2409
|
height: `${e}px`,
|
|
2325
2410
|
transform: `translate3d(0, ${t}px, 0)`
|
|
@@ -2327,8 +2412,8 @@ function rr(e, t) {
|
|
|
2327
2412
|
}
|
|
2328
2413
|
//#endregion
|
|
2329
2414
|
//#region src/components/viewer-core/useEdgeBoundary.ts
|
|
2330
|
-
var
|
|
2331
|
-
function
|
|
2415
|
+
var cr = 250, lr = 1e3;
|
|
2416
|
+
function ur(e) {
|
|
2332
2417
|
let t = T(!1), n = T(!1), r = T(0), i = T(0), a = T(!1), o = T(!1), s = 0, c = null;
|
|
2333
2418
|
b(() => {
|
|
2334
2419
|
y();
|
|
@@ -2344,7 +2429,7 @@ function or(e) {
|
|
|
2344
2429
|
function u(t) {
|
|
2345
2430
|
if (!x(t) || !e.isAtBoundary()) return;
|
|
2346
2431
|
let n = Date.now();
|
|
2347
|
-
n < s || (s = n +
|
|
2432
|
+
n < s || (s = n + cr, m());
|
|
2348
2433
|
}
|
|
2349
2434
|
function d() {
|
|
2350
2435
|
if (!g()) return;
|
|
@@ -2378,7 +2463,7 @@ function or(e) {
|
|
|
2378
2463
|
return e.hasPage.value && t.value && r.value > i.value && !e.interactionLocked?.value && !e.loading.value && !a.value && typeof e.requestPage.value == "function";
|
|
2379
2464
|
}
|
|
2380
2465
|
function _() {
|
|
2381
|
-
o.value = !1, v(
|
|
2466
|
+
o.value = !1, v(lr);
|
|
2382
2467
|
}
|
|
2383
2468
|
function v(e) {
|
|
2384
2469
|
y(), a.value = !0, c = setTimeout(() => {
|
|
@@ -2401,30 +2486,30 @@ function or(e) {
|
|
|
2401
2486
|
}
|
|
2402
2487
|
//#endregion
|
|
2403
2488
|
//#region src/components/viewer-core/useMasonryList.ts
|
|
2404
|
-
var
|
|
2405
|
-
function
|
|
2406
|
-
let t = T(null), n = T(0), r = T(typeof window > "u" ? 0 : window.innerHeight || 0), a = T(typeof window > "u" ? 0 : window.innerWidth ||
|
|
2489
|
+
var dr = 600, $ = 24, fr = 16, pr = 300, mr = 200, hr = 200, gr = 200, _r = 300, vr = 24, yr = 48, br = 500, xr = 1e3;
|
|
2490
|
+
function Sr(e) {
|
|
2491
|
+
let t = T(null), n = T(0), r = T(typeof window > "u" ? 0 : window.innerHeight || 0), a = T(typeof window > "u" ? 0 : window.innerWidth || pr), o = T([]), s = T([]), c = T(/* @__PURE__ */ new Map()), l = T(0), u = T(/* @__PURE__ */ new Map()), d = T(null), f = T(null), p = T(!1), m = i(() => Math.max(pr, a.value - $ * 2)), h = i(() => Rn(m.value, pr)), _ = i(() => zn(m.value, h.value, pr, fr)), v = i(() => Cr(e.activeIndex.value, 0, Math.max(0, e.items.value.length - 1))), y = i(() => Hn({
|
|
2407
2492
|
itemCount: e.items.value.length,
|
|
2408
2493
|
viewportHeight: r.value,
|
|
2409
2494
|
scrollTop: n.value,
|
|
2410
|
-
overscanPx:
|
|
2411
|
-
bucketPx:
|
|
2495
|
+
overscanPx: mr,
|
|
2496
|
+
bucketPx: dr,
|
|
2412
2497
|
buckets: c.value
|
|
2413
2498
|
})), S = i(() => y.value.map((t) => ({
|
|
2414
2499
|
item: e.items.value[t],
|
|
2415
2500
|
index: t
|
|
2416
2501
|
}))), C = i(() => {
|
|
2417
2502
|
let e = l.value + $ * 2, t = d.value ?? 0;
|
|
2418
|
-
return Math.max(e, t, r.value) +
|
|
2419
|
-
}), w = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), E = i(() => e.items.value.length > 0 ? `${v.value + 1} / ${e.items.value.length}` : "0 / 0"), D = i(() => Math.max(0, r.value -
|
|
2503
|
+
return Math.max(e, t, r.value) + gr;
|
|
2504
|
+
}), w = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), E = i(() => e.items.value.length > 0 ? `${v.value + 1} / ${e.items.value.length}` : "0 / 0"), D = i(() => Math.max(0, r.value - vr * 2)), O = i(() => C.value > r.value + 1 && D.value > 0), k = i(() => {
|
|
2420
2505
|
if (!O.value) return 0;
|
|
2421
2506
|
let e = r.value / C.value * D.value;
|
|
2422
|
-
return Math.min(D.value, Math.max(
|
|
2507
|
+
return Math.min(D.value, Math.max(yr, e));
|
|
2423
2508
|
}), A = i(() => {
|
|
2424
|
-
if (!O.value) return
|
|
2509
|
+
if (!O.value) return vr;
|
|
2425
2510
|
let e = Math.max(0, C.value - r.value);
|
|
2426
|
-
return
|
|
2427
|
-
}), j =
|
|
2511
|
+
return vr + Math.max(0, D.value - k.value) * (e > 0 ? Cr(n.value / e, 0, 1) : 0);
|
|
2512
|
+
}), j = tr({
|
|
2428
2513
|
items: e.items,
|
|
2429
2514
|
visibleIndices: y,
|
|
2430
2515
|
positions: o,
|
|
@@ -2433,27 +2518,27 @@ function vr(e) {
|
|
|
2433
2518
|
columnWidth: _,
|
|
2434
2519
|
scrollTop: n,
|
|
2435
2520
|
viewportHeight: r
|
|
2436
|
-
}), M =
|
|
2521
|
+
}), M = ur({
|
|
2437
2522
|
direction: "top",
|
|
2438
2523
|
getAnimationLockMs(e) {
|
|
2439
|
-
return Math.max(
|
|
2524
|
+
return Math.max(br, Qn(e)) + xr;
|
|
2440
2525
|
},
|
|
2441
2526
|
hasPage: e.hasPreviousPage,
|
|
2442
2527
|
interactionLocked: p,
|
|
2443
2528
|
isAtBoundary() {
|
|
2444
|
-
return n.value <= $ +
|
|
2529
|
+
return n.value <= $ + fr;
|
|
2445
2530
|
},
|
|
2446
2531
|
loading: e.loading,
|
|
2447
2532
|
requestPage: e.requestPreviousPage
|
|
2448
|
-
}), N =
|
|
2533
|
+
}), N = ur({
|
|
2449
2534
|
direction: "bottom",
|
|
2450
2535
|
getAnimationLockMs(e) {
|
|
2451
|
-
return
|
|
2536
|
+
return Qn(e) + xr;
|
|
2452
2537
|
},
|
|
2453
2538
|
hasPage: w,
|
|
2454
2539
|
interactionLocked: p,
|
|
2455
2540
|
isAtBoundary() {
|
|
2456
|
-
return
|
|
2541
|
+
return ie() <= hr;
|
|
2457
2542
|
},
|
|
2458
2543
|
loading: e.loading,
|
|
2459
2544
|
requestPage: e.requestNextPage
|
|
@@ -2463,7 +2548,7 @@ function vr(e) {
|
|
|
2463
2548
|
h,
|
|
2464
2549
|
_
|
|
2465
2550
|
], async ([t], [r = []]) => {
|
|
2466
|
-
let i = t.map((e) => Q(e)), a = r ?? [], s = a.map((e) => Q(e)), c =
|
|
2551
|
+
let i = t.map((e) => Q(e)), a = r ?? [], s = a.map((e) => Q(e)), c = Un(a, u.value, o.value), l = se(a), d = new Set(s), f = new Set(i), p = t.filter((e) => !d.has(Q(e))), m = a.flatMap((e) => {
|
|
2467
2552
|
let t = Q(e);
|
|
2468
2553
|
if (f.has(t)) return [];
|
|
2469
2554
|
let n = c.get(t), r = l.get(t);
|
|
@@ -2472,15 +2557,15 @@ function vr(e) {
|
|
|
2472
2557
|
item: e,
|
|
2473
2558
|
position: n
|
|
2474
2559
|
}];
|
|
2475
|
-
}), h = i.length > s.length && s.length > 0 && i[0] !== s[0], _ = t.length === 0 && a.length > 0 && m.length > 0 && n.value > 0, y = m.length > 0 && n.value > $ +
|
|
2476
|
-
y &&
|
|
2560
|
+
}), h = i.length > s.length && s.length > 0 && i[0] !== s[0], _ = t.length === 0 && a.length > 0 && m.length > 0 && n.value > 0, y = m.length > 0 && n.value > $ + fr, b = h && n.value > $ + fr ? t[v.value] : null, x = b ? Q(b) : null;
|
|
2561
|
+
y && K($n() + xr), _ && G(), B(), m.length > 0 && j.markLeave(m), p.length > 0 && (j.markEnter(p, h ? "top" : "bottom"), h ? M.onItemsMutated(p.length) : N.onItemsMutated(p.length)), j.playFlipMoveAnimation(c, new Set(p.map((e) => Q(e))), h ? br : void 0), x ? (await g(), W(x, c)) : e.active.value && s.length > 0 && J();
|
|
2477
2562
|
}, { immediate: !0 }), F([
|
|
2478
2563
|
() => e.pendingAppendItems.value.map((e) => Q(e)),
|
|
2479
2564
|
h,
|
|
2480
2565
|
_,
|
|
2481
2566
|
r
|
|
2482
2567
|
], ([t]) => {
|
|
2483
|
-
|
|
2568
|
+
X(), t.length && (d.value = oe([...e.items.value, ...e.pendingAppendItems.value]), ce());
|
|
2484
2569
|
}, { immediate: !0 }), F(() => e.active.value, async (e, i) => {
|
|
2485
2570
|
let a = t.value;
|
|
2486
2571
|
if (!a) return;
|
|
@@ -2490,24 +2575,24 @@ function vr(e) {
|
|
|
2490
2575
|
}
|
|
2491
2576
|
if (i !== !1 || f.value == null) return;
|
|
2492
2577
|
await g();
|
|
2493
|
-
let o = Math.max(0, C.value - r.value), s =
|
|
2578
|
+
let o = Math.max(0, C.value - r.value), s = Cr(f.value, 0, o);
|
|
2494
2579
|
a.scrollTop = s, n.value = s, M.syncBoundary(), N.syncBoundary();
|
|
2495
2580
|
}), F(() => e.loading.value, async (t) => {
|
|
2496
2581
|
!t && !e.pendingAppendItems.value.length && !L && !z && (d.value = null), M.onLoadingChange(t), N.onLoadingChange(t), await g();
|
|
2497
2582
|
}), x(async () => {
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
}), t.value && P.observe(t.value)) : window.addEventListener("resize",
|
|
2583
|
+
Y(), await g(), v.value > 0 ? U(v.value, "center") : q(), M.syncBoundary(), N.syncBoundary(), typeof ResizeObserver < "u" ? (P = new ResizeObserver(() => {
|
|
2584
|
+
Y();
|
|
2585
|
+
}), t.value && P.observe(t.value)) : window.addEventListener("resize", Y);
|
|
2501
2586
|
}), b(() => {
|
|
2502
|
-
P?.disconnect(), P = null, window.removeEventListener("resize",
|
|
2587
|
+
P?.disconnect(), P = null, window.removeEventListener("resize", Y), X(), le(), I &&= (cancelAnimationFrame(I), 0);
|
|
2503
2588
|
});
|
|
2504
2589
|
function B() {
|
|
2505
|
-
let t =
|
|
2590
|
+
let t = Vn(e.items.value, {
|
|
2506
2591
|
columnCount: h.value,
|
|
2507
2592
|
columnWidth: _.value,
|
|
2508
|
-
gapX:
|
|
2509
|
-
gapY:
|
|
2510
|
-
bucketPx:
|
|
2593
|
+
gapX: fr,
|
|
2594
|
+
gapY: fr,
|
|
2595
|
+
bucketPx: dr
|
|
2511
2596
|
});
|
|
2512
2597
|
o.value = t.positions.map((e) => ({
|
|
2513
2598
|
x: e.x + $,
|
|
@@ -2515,14 +2600,14 @@ function vr(e) {
|
|
|
2515
2600
|
})), s.value = t.heights, c.value = t.buckets, l.value = t.contentHeight, u.value = t.indexById;
|
|
2516
2601
|
}
|
|
2517
2602
|
function V() {
|
|
2518
|
-
e.active.value && (n.value = t.value?.scrollTop ?? 0, r.value =
|
|
2519
|
-
I = 0,
|
|
2603
|
+
e.active.value && (n.value = t.value?.scrollTop ?? 0, r.value = ne(), M.syncBoundary(), N.syncBoundary(), te(), !J() && (I ||= requestAnimationFrame(() => {
|
|
2604
|
+
I = 0, q();
|
|
2520
2605
|
})));
|
|
2521
2606
|
}
|
|
2522
2607
|
function H(t) {
|
|
2523
|
-
e.active.value && (M.onWheel(t), N.onWheel(t),
|
|
2608
|
+
e.active.value && (M.onWheel(t), N.onWheel(t), te());
|
|
2524
2609
|
}
|
|
2525
|
-
function
|
|
2610
|
+
function ee(t) {
|
|
2526
2611
|
let n = e.items.value[t], r = n ? Q(n) : "";
|
|
2527
2612
|
return {
|
|
2528
2613
|
height: `${s.value[t] ?? _.value}px`,
|
|
@@ -2532,19 +2617,19 @@ function vr(e) {
|
|
|
2532
2617
|
transform: j.getCardTransform(t)
|
|
2533
2618
|
};
|
|
2534
2619
|
}
|
|
2535
|
-
function
|
|
2620
|
+
function U(e, i) {
|
|
2536
2621
|
let a = t.value, c = o.value[e], l = s.value[e];
|
|
2537
2622
|
if (!a || !c || !l) return;
|
|
2538
2623
|
let u = a.scrollTop, d = Math.max(0, C.value - r.value);
|
|
2539
|
-
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 =
|
|
2624
|
+
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 = Cr(u, 0, d), n.value = a.scrollTop, q();
|
|
2540
2625
|
}
|
|
2541
|
-
function
|
|
2626
|
+
function W(e, r) {
|
|
2542
2627
|
let i = t.value, a = r.get(e), s = u.value.get(e), c = s == null ? null : o.value[s];
|
|
2543
2628
|
if (!i || !a || !c) return;
|
|
2544
2629
|
let l = c.y - a.y;
|
|
2545
2630
|
i.scrollTop += l, n.value = i.scrollTop;
|
|
2546
2631
|
}
|
|
2547
|
-
function
|
|
2632
|
+
function G() {
|
|
2548
2633
|
let e = t.value;
|
|
2549
2634
|
if (!e) {
|
|
2550
2635
|
n.value = 0;
|
|
@@ -2552,13 +2637,13 @@ function vr(e) {
|
|
|
2552
2637
|
}
|
|
2553
2638
|
e.scrollTop = 0, n.value = 0, M.syncBoundary(), N.syncBoundary();
|
|
2554
2639
|
}
|
|
2555
|
-
function
|
|
2640
|
+
function K(e) {
|
|
2556
2641
|
le(), p.value = !0, R = setTimeout(() => {
|
|
2557
2642
|
R = null, p.value = !1;
|
|
2558
2643
|
}, Math.max(0, e));
|
|
2559
2644
|
}
|
|
2560
|
-
function
|
|
2561
|
-
if (!y.value.length ||
|
|
2645
|
+
function q() {
|
|
2646
|
+
if (!y.value.length || J()) return;
|
|
2562
2647
|
let t = n.value + r.value / 2, i = v.value, a = Infinity;
|
|
2563
2648
|
for (let e of y.value) {
|
|
2564
2649
|
let n = o.value[e], r = s.value[e];
|
|
@@ -2568,38 +2653,38 @@ function vr(e) {
|
|
|
2568
2653
|
}
|
|
2569
2654
|
e.setActiveIndex(i);
|
|
2570
2655
|
}
|
|
2571
|
-
function
|
|
2572
|
-
let t = n.value <= $ +
|
|
2656
|
+
function J() {
|
|
2657
|
+
let t = n.value <= $ + fr, r = ie() <= hr;
|
|
2573
2658
|
return t ? (e.setActiveIndex(0), !0) : r ? (e.setActiveIndex(Math.max(0, e.items.value.length - 1)), !0) : !1;
|
|
2574
2659
|
}
|
|
2575
|
-
function ee() {
|
|
2576
|
-
M.maybeRequestPage(), N.maybeRequestPage();
|
|
2577
|
-
}
|
|
2578
2660
|
function te() {
|
|
2579
|
-
|
|
2661
|
+
M.maybeRequestPage(), N.maybeRequestPage();
|
|
2580
2662
|
}
|
|
2581
|
-
function
|
|
2582
|
-
|
|
2663
|
+
function Y() {
|
|
2664
|
+
r.value = ne(), a.value = re();
|
|
2583
2665
|
}
|
|
2584
2666
|
function ne() {
|
|
2585
|
-
return
|
|
2667
|
+
return ir(t.value, r.value);
|
|
2586
2668
|
}
|
|
2587
2669
|
function re() {
|
|
2588
|
-
return
|
|
2670
|
+
return ar(t.value, a.value, pr);
|
|
2589
2671
|
}
|
|
2590
2672
|
function ie() {
|
|
2591
|
-
return
|
|
2673
|
+
return or(t.value, n.value, r.value, C.value);
|
|
2674
|
+
}
|
|
2675
|
+
function ae() {
|
|
2676
|
+
return sr(k.value, A.value);
|
|
2592
2677
|
}
|
|
2593
|
-
function
|
|
2594
|
-
return e.length ?
|
|
2678
|
+
function oe(e) {
|
|
2679
|
+
return e.length ? Vn(e, {
|
|
2595
2680
|
columnCount: h.value,
|
|
2596
2681
|
columnWidth: _.value,
|
|
2597
|
-
gapX:
|
|
2598
|
-
gapY:
|
|
2599
|
-
bucketPx:
|
|
2682
|
+
gapX: fr,
|
|
2683
|
+
gapY: fr,
|
|
2684
|
+
bucketPx: dr
|
|
2600
2685
|
}).contentHeight + $ * 2 : 0;
|
|
2601
2686
|
}
|
|
2602
|
-
function
|
|
2687
|
+
function se(e) {
|
|
2603
2688
|
let t = /* @__PURE__ */ new Map();
|
|
2604
2689
|
for (let n of e) {
|
|
2605
2690
|
let e = Q(n), r = u.value.get(e);
|
|
@@ -2609,7 +2694,7 @@ function vr(e) {
|
|
|
2609
2694
|
}
|
|
2610
2695
|
return t;
|
|
2611
2696
|
}
|
|
2612
|
-
function
|
|
2697
|
+
function ce() {
|
|
2613
2698
|
let t = e.commitPendingAppend.value;
|
|
2614
2699
|
typeof t == "function" && (L = setTimeout(async () => {
|
|
2615
2700
|
L = null, z = !0;
|
|
@@ -2619,9 +2704,9 @@ function vr(e) {
|
|
|
2619
2704
|
} finally {
|
|
2620
2705
|
d.value = null, z = !1;
|
|
2621
2706
|
}
|
|
2622
|
-
},
|
|
2707
|
+
}, _r));
|
|
2623
2708
|
}
|
|
2624
|
-
function
|
|
2709
|
+
function X() {
|
|
2625
2710
|
L &&= (clearTimeout(L), null);
|
|
2626
2711
|
}
|
|
2627
2712
|
function le() {
|
|
@@ -2630,31 +2715,31 @@ function vr(e) {
|
|
|
2630
2715
|
return {
|
|
2631
2716
|
columnWidth: _,
|
|
2632
2717
|
containerHeight: C,
|
|
2633
|
-
getCardStyle:
|
|
2718
|
+
getCardStyle: ee,
|
|
2634
2719
|
getLeavingCardStyle: j.getLeavingCardStyle,
|
|
2635
|
-
getScrollbarThumbStyle:
|
|
2720
|
+
getScrollbarThumbStyle: ae,
|
|
2636
2721
|
leavingItems: j.leavingItems,
|
|
2637
2722
|
onScroll: V,
|
|
2638
2723
|
onWheel: H,
|
|
2639
2724
|
paginationLabel: E,
|
|
2640
2725
|
renderedItems: S,
|
|
2641
2726
|
resolvedActiveIndex: v,
|
|
2642
|
-
scrollToIndex:
|
|
2727
|
+
scrollToIndex: U,
|
|
2643
2728
|
showScrollbar: O,
|
|
2644
2729
|
scrollViewportRef: t
|
|
2645
2730
|
};
|
|
2646
2731
|
}
|
|
2647
|
-
function
|
|
2732
|
+
function Cr(e, t, n) {
|
|
2648
2733
|
return Math.min(Math.max(e, t), n);
|
|
2649
2734
|
}
|
|
2650
2735
|
//#endregion
|
|
2651
2736
|
//#region src/components/viewer-core/listCardAsset.ts
|
|
2652
|
-
function
|
|
2737
|
+
function wr(e) {
|
|
2653
2738
|
if (e) try {
|
|
2654
2739
|
e.removeAttribute("src"), e.src = "";
|
|
2655
2740
|
} catch {}
|
|
2656
2741
|
}
|
|
2657
|
-
function
|
|
2742
|
+
function Tr(e) {
|
|
2658
2743
|
if (e) {
|
|
2659
2744
|
try {
|
|
2660
2745
|
e.currentTime = 0;
|
|
@@ -2665,12 +2750,12 @@ function xr(e) {
|
|
|
2665
2750
|
} catch {}
|
|
2666
2751
|
}
|
|
2667
2752
|
}
|
|
2668
|
-
function
|
|
2753
|
+
function Er(e, t) {
|
|
2669
2754
|
if (t) return e.bottom > t.top && e.top < t.bottom;
|
|
2670
2755
|
let n = window.innerHeight || document.documentElement.clientHeight || 0;
|
|
2671
2756
|
return e.bottom > 0 && e.top < n;
|
|
2672
2757
|
}
|
|
2673
|
-
function
|
|
2758
|
+
function Dr(e) {
|
|
2674
2759
|
if (!e) return null;
|
|
2675
2760
|
try {
|
|
2676
2761
|
return new URL(e, window.location.href).href;
|
|
@@ -2680,22 +2765,22 @@ function Cr(e) {
|
|
|
2680
2765
|
}
|
|
2681
2766
|
//#endregion
|
|
2682
2767
|
//#region src/components/viewer-core/listPreview.ts
|
|
2683
|
-
var
|
|
2684
|
-
function
|
|
2685
|
-
let t = e.preview?.url ?? e.url, n =
|
|
2768
|
+
var Or = /\.(avif|gif|jpe?g|png|svg|webp)(\?|#|$)/i, kr = /\.(m4v|mov|mp4|mpeg|ogg|ogv|webm)(\?|#|$)/i;
|
|
2769
|
+
function Ar(e) {
|
|
2770
|
+
let t = e.preview?.url ?? e.url, n = Ln(e), r = e.title?.trim() || pt(e.type);
|
|
2686
2771
|
return e.type !== "image" && e.type !== "video" ? {
|
|
2687
2772
|
kind: "fallback",
|
|
2688
2773
|
url: null,
|
|
2689
2774
|
width: n.width,
|
|
2690
2775
|
height: n.height,
|
|
2691
2776
|
label: r
|
|
2692
|
-
} :
|
|
2777
|
+
} : Mr(e, t) ? {
|
|
2693
2778
|
kind: "video",
|
|
2694
2779
|
url: t,
|
|
2695
2780
|
width: n.width,
|
|
2696
2781
|
height: n.height,
|
|
2697
2782
|
label: r
|
|
2698
|
-
} :
|
|
2783
|
+
} : jr(e, t) ? {
|
|
2699
2784
|
kind: "image",
|
|
2700
2785
|
url: t,
|
|
2701
2786
|
width: n.width,
|
|
@@ -2709,28 +2794,28 @@ function Er(e) {
|
|
|
2709
2794
|
label: r
|
|
2710
2795
|
};
|
|
2711
2796
|
}
|
|
2712
|
-
function
|
|
2713
|
-
return e.type !== "image" || typeof t != "string" ? !1 :
|
|
2797
|
+
function jr(e, t) {
|
|
2798
|
+
return e.type !== "image" || typeof t != "string" ? !1 : Or.test(t) || Nr(t);
|
|
2714
2799
|
}
|
|
2715
|
-
function
|
|
2716
|
-
return e.type === "video" && typeof t == "string" &&
|
|
2800
|
+
function Mr(e, t) {
|
|
2801
|
+
return e.type === "video" && typeof t == "string" && kr.test(t);
|
|
2717
2802
|
}
|
|
2718
|
-
function
|
|
2803
|
+
function Nr(e) {
|
|
2719
2804
|
return /^(https?:\/\/|\/\/|\/(?!\/)|\.{1,2}\/|blob:|data:)/i.test(e);
|
|
2720
2805
|
}
|
|
2721
2806
|
//#endregion
|
|
2722
2807
|
//#region src/components/viewer-core/useAssetLoadQueue.ts
|
|
2723
|
-
var
|
|
2808
|
+
var Pr = {
|
|
2724
2809
|
maxGlobal: 10,
|
|
2725
2810
|
maxPerDomain: 4,
|
|
2726
2811
|
maxVideoPerDomain: 2
|
|
2727
2812
|
};
|
|
2728
|
-
function
|
|
2813
|
+
function Fr(e = Pr) {
|
|
2729
2814
|
let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = 0;
|
|
2730
2815
|
function i(e) {
|
|
2731
2816
|
let i = {
|
|
2732
2817
|
...e,
|
|
2733
|
-
domain:
|
|
2818
|
+
domain: Rr(e.url),
|
|
2734
2819
|
enqueuedAt: r,
|
|
2735
2820
|
id: `vibe-asset-load-${r += 1}`
|
|
2736
2821
|
};
|
|
@@ -2749,7 +2834,7 @@ function jr(e = Ar) {
|
|
|
2749
2834
|
function a() {
|
|
2750
2835
|
if (n.size === 0) return;
|
|
2751
2836
|
let r = [...n.values()].sort((e, t) => {
|
|
2752
|
-
let n =
|
|
2837
|
+
let n = Lr(e) - Lr(t);
|
|
2753
2838
|
return n === 0 ? e.enqueuedAt - t.enqueuedAt : n;
|
|
2754
2839
|
});
|
|
2755
2840
|
for (let i of r) {
|
|
@@ -2770,8 +2855,8 @@ function jr(e = Ar) {
|
|
|
2770
2855
|
}
|
|
2771
2856
|
return { request: i };
|
|
2772
2857
|
}
|
|
2773
|
-
var
|
|
2774
|
-
function
|
|
2858
|
+
var Ir = Fr();
|
|
2859
|
+
function Lr(e) {
|
|
2775
2860
|
try {
|
|
2776
2861
|
let t = e.getPriority();
|
|
2777
2862
|
return Number.isFinite(t) ? t : Infinity;
|
|
@@ -2779,7 +2864,7 @@ function Nr(e) {
|
|
|
2779
2864
|
return Infinity;
|
|
2780
2865
|
}
|
|
2781
2866
|
}
|
|
2782
|
-
function
|
|
2867
|
+
function Rr(e) {
|
|
2783
2868
|
try {
|
|
2784
2869
|
return new URL(e).hostname || "local";
|
|
2785
2870
|
} catch {
|
|
@@ -2788,14 +2873,14 @@ function Pr(e) {
|
|
|
2788
2873
|
}
|
|
2789
2874
|
//#endregion
|
|
2790
2875
|
//#region src/components/ListCard.vue?vue&type=script&setup=true&lang.ts
|
|
2791
|
-
var
|
|
2876
|
+
var zr = ["aria-label"], Br = {
|
|
2792
2877
|
key: 0,
|
|
2793
2878
|
"data-testid": "vibe-list-card-spinner",
|
|
2794
2879
|
class: "pointer-events-none absolute inset-0 z-[4] grid place-items-center bg-black/18"
|
|
2795
|
-
},
|
|
2880
|
+
}, Vr = { 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]" }, Hr = ["src", "alt"], Ur = ["src"], Wr = ["data-kind"], Gr = { class: "grid justify-items-center gap-3 px-4 text-center" }, Kr = { class: "text-[0.68rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, qr = {
|
|
2796
2881
|
key: 4,
|
|
2797
2882
|
class: "grid h-full w-full place-items-center bg-[radial-gradient(circle_at_center,rgba(255,255,255,0.08),transparent_65%),linear-gradient(180deg,rgba(255,255,255,0.04),rgba(255,255,255,0.02))]"
|
|
2798
|
-
},
|
|
2883
|
+
}, Jr = { class: "inline-flex h-14 w-14 items-center justify-center border border-white/16 bg-black/20" }, Yr = { class: "pointer-events-none absolute inset-0 z-[3]" }, Xr = /* @__PURE__ */ d({
|
|
2799
2884
|
__name: "ListCard",
|
|
2800
2885
|
props: {
|
|
2801
2886
|
active: {
|
|
@@ -2819,45 +2904,45 @@ var Fr = ["aria-label"], Ir = {
|
|
|
2819
2904
|
},
|
|
2820
2905
|
emits: ["open"],
|
|
2821
2906
|
setup(e, { emit: t }) {
|
|
2822
|
-
let n = e, r = t, l = i(() =>
|
|
2907
|
+
let n = e, r = t, l = i(() => Ar(n.item)), d = T(!1), f = T(!1), p = T(!1), m = T(l.value.kind === "fallback"), h = T(null), g = T(null), v = T(null), y = T(null), C = T(null), w = T(l.value.kind === "fallback"), E = i(() => w.value ? n.surfaceActive ? d.value ? l.value.url : null : l.value.url : null), A = i(() => n.surfaceActive && d.value && (l.value.kind === "image" || l.value.kind === "video") && !!l.value.url), M = i(() => l.value.kind === "image" && !!E.value), N = i(() => l.value.kind === "video" && !!E.value), P = i(() => !!h.value), I = i(() => jt(h.value)), L = i(() => A.value && !h.value && (!w.value || !m.value)), R = null, B = null, V = /* @__PURE__ */ new Set();
|
|
2823
2908
|
F([E, () => l.value.kind], () => {
|
|
2824
2909
|
let e = l.value.kind === "fallback";
|
|
2825
2910
|
m.value = e, h.value = null, e && (w.value = !0);
|
|
2826
2911
|
}), F(A, () => {
|
|
2827
|
-
|
|
2912
|
+
G();
|
|
2828
2913
|
}), F([
|
|
2829
2914
|
d,
|
|
2830
2915
|
m,
|
|
2831
2916
|
E
|
|
2832
2917
|
], () => {
|
|
2833
|
-
|
|
2918
|
+
K();
|
|
2834
2919
|
}), F(() => n.surfaceActive, (e) => {
|
|
2835
2920
|
if (!e) {
|
|
2836
|
-
|
|
2921
|
+
J(), K();
|
|
2837
2922
|
return;
|
|
2838
2923
|
}
|
|
2839
2924
|
requestAnimationFrame(() => {
|
|
2840
|
-
|
|
2925
|
+
te(), G(), K();
|
|
2841
2926
|
});
|
|
2842
2927
|
}), x(() => {
|
|
2843
2928
|
if (!v.value || typeof IntersectionObserver > "u") {
|
|
2844
|
-
y.value = null, d.value = !0,
|
|
2929
|
+
y.value = null, d.value = !0, G();
|
|
2845
2930
|
return;
|
|
2846
2931
|
}
|
|
2847
2932
|
y.value = v.value.closest("[data-testid=\"vibe-list-scroll\"]"), R = new IntersectionObserver((e) => {
|
|
2848
|
-
for (let t of e) t.target === v.value && (n.surfaceActive &&
|
|
2933
|
+
for (let t of e) t.target === v.value && (n.surfaceActive && te(t), G(), K());
|
|
2849
2934
|
}, {
|
|
2850
2935
|
root: y.value,
|
|
2851
2936
|
threshold: [0, 1]
|
|
2852
2937
|
}), R.observe(v.value);
|
|
2853
2938
|
}), b(() => {
|
|
2854
|
-
|
|
2939
|
+
q(), R?.disconnect(), R = null;
|
|
2855
2940
|
});
|
|
2856
2941
|
function H() {
|
|
2857
|
-
|
|
2942
|
+
ce(g.value) && (m.value = !0, h.value = null, Y(E.value ?? n.item.url), J());
|
|
2858
2943
|
}
|
|
2859
|
-
async function
|
|
2860
|
-
if (!
|
|
2944
|
+
async function ee() {
|
|
2945
|
+
if (!ce(g.value)) return;
|
|
2861
2946
|
let e = E.value ?? n.item.url;
|
|
2862
2947
|
m.value = !1, h.value = "generic";
|
|
2863
2948
|
let t = await Mt(e);
|
|
@@ -2867,41 +2952,41 @@ var Fr = ["aria-label"], Ir = {
|
|
|
2867
2952
|
url: e,
|
|
2868
2953
|
kind: t,
|
|
2869
2954
|
surface: "grid"
|
|
2870
|
-
}),
|
|
2955
|
+
}), J();
|
|
2956
|
+
}
|
|
2957
|
+
function U() {
|
|
2958
|
+
ce(C.value) && (m.value = !0, h.value = null, Y(E.value ?? n.item.url), J(), K());
|
|
2871
2959
|
}
|
|
2872
2960
|
function W() {
|
|
2873
|
-
|
|
2961
|
+
ce(C.value) && (m.value = !1);
|
|
2874
2962
|
}
|
|
2875
2963
|
function G() {
|
|
2876
|
-
se(C.value) && (m.value = !1);
|
|
2877
|
-
}
|
|
2878
|
-
function K() {
|
|
2879
2964
|
if (l.value.kind === "fallback") {
|
|
2880
|
-
|
|
2965
|
+
q(!1);
|
|
2881
2966
|
return;
|
|
2882
2967
|
}
|
|
2883
2968
|
if (!n.surfaceActive) {
|
|
2884
|
-
|
|
2969
|
+
J();
|
|
2885
2970
|
return;
|
|
2886
2971
|
}
|
|
2887
2972
|
if (!A.value) {
|
|
2888
|
-
|
|
2973
|
+
q();
|
|
2889
2974
|
return;
|
|
2890
2975
|
}
|
|
2891
2976
|
if (w.value || B) {
|
|
2892
2977
|
B?.refresh();
|
|
2893
2978
|
return;
|
|
2894
2979
|
}
|
|
2895
|
-
B =
|
|
2980
|
+
B = Ir.request({
|
|
2896
2981
|
assetType: l.value.kind,
|
|
2897
|
-
getPriority:
|
|
2982
|
+
getPriority: oe,
|
|
2898
2983
|
onGrant() {
|
|
2899
2984
|
w.value = !0, m.value = !1, h.value = null;
|
|
2900
2985
|
},
|
|
2901
2986
|
url: l.value.url ?? n.item.url
|
|
2902
2987
|
});
|
|
2903
2988
|
}
|
|
2904
|
-
function
|
|
2989
|
+
function K() {
|
|
2905
2990
|
let e = C.value;
|
|
2906
2991
|
if (!(!e || l.value.kind !== "video")) {
|
|
2907
2992
|
if (h.value) {
|
|
@@ -2918,21 +3003,21 @@ var Fr = ["aria-label"], Ir = {
|
|
|
2918
3003
|
e.pause();
|
|
2919
3004
|
}
|
|
2920
3005
|
}
|
|
2921
|
-
function
|
|
2922
|
-
w.value = l.value.kind === "fallback", h.value = null, m.value = l.value.kind === "fallback", e && (
|
|
3006
|
+
function q(e = !0) {
|
|
3007
|
+
w.value = l.value.kind === "fallback", h.value = null, m.value = l.value.kind === "fallback", e && (re(), ae()), J();
|
|
2923
3008
|
}
|
|
2924
|
-
function
|
|
3009
|
+
function J() {
|
|
2925
3010
|
B?.release(), B = null;
|
|
2926
3011
|
}
|
|
2927
|
-
function
|
|
3012
|
+
function te(e) {
|
|
2928
3013
|
let t = v.value;
|
|
2929
3014
|
if (!t) {
|
|
2930
3015
|
d.value = !0;
|
|
2931
3016
|
return;
|
|
2932
3017
|
}
|
|
2933
|
-
d.value =
|
|
3018
|
+
d.value = Er(e?.boundingClientRect ?? t.getBoundingClientRect(), e?.rootBounds ?? y.value?.getBoundingClientRect() ?? null);
|
|
2934
3019
|
}
|
|
2935
|
-
function
|
|
3020
|
+
function Y(e) {
|
|
2936
3021
|
if (!e) return;
|
|
2937
3022
|
let t = Q(n.item), r = `${t}|${e}`;
|
|
2938
3023
|
V.has(r) || (V.add(r), n.reportAssetLoad?.({
|
|
@@ -2942,20 +3027,20 @@ var Fr = ["aria-label"], Ir = {
|
|
|
2942
3027
|
url: e
|
|
2943
3028
|
}));
|
|
2944
3029
|
}
|
|
2945
|
-
function
|
|
3030
|
+
function ne() {
|
|
2946
3031
|
if (!I.value) return;
|
|
2947
3032
|
let e = Q(n.item);
|
|
2948
3033
|
V.forEach((t) => {
|
|
2949
3034
|
t.startsWith(`${e}|`) && V.delete(t);
|
|
2950
|
-
}), h.value = null, m.value = !1, w.value = !1,
|
|
3035
|
+
}), h.value = null, m.value = !1, w.value = !1, J(), G();
|
|
2951
3036
|
}
|
|
2952
|
-
function
|
|
2953
|
-
|
|
2954
|
-
}
|
|
2955
|
-
function ie() {
|
|
2956
|
-
xr(C.value);
|
|
3037
|
+
function re() {
|
|
3038
|
+
wr(g.value);
|
|
2957
3039
|
}
|
|
2958
3040
|
function ae() {
|
|
3041
|
+
Tr(C.value);
|
|
3042
|
+
}
|
|
3043
|
+
function oe() {
|
|
2959
3044
|
let e = v.value;
|
|
2960
3045
|
if (!e) return Infinity;
|
|
2961
3046
|
let t = e.getBoundingClientRect();
|
|
@@ -2966,11 +3051,11 @@ var Fr = ["aria-label"], Ir = {
|
|
|
2966
3051
|
let n = window.innerHeight / 2;
|
|
2967
3052
|
return Math.abs((t.top + t.bottom) / 2 - n);
|
|
2968
3053
|
}
|
|
2969
|
-
function
|
|
2970
|
-
let t =
|
|
2971
|
-
return !e || !t ? !1 :
|
|
3054
|
+
function ce(e) {
|
|
3055
|
+
let t = Dr(E.value);
|
|
3056
|
+
return !e || !t ? !1 : Dr("currentSrc" in e && e.currentSrc || e.getAttribute("src")) === t;
|
|
2972
3057
|
}
|
|
2973
|
-
function
|
|
3058
|
+
function X() {
|
|
2974
3059
|
r("open");
|
|
2975
3060
|
}
|
|
2976
3061
|
function le() {
|
|
@@ -2995,9 +3080,9 @@ var Fr = ["aria-label"], Ir = {
|
|
|
2995
3080
|
"data-testid": "vibe-list-card-open",
|
|
2996
3081
|
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]",
|
|
2997
3082
|
"aria-label": n.item.title || `Open item ${n.index + 1}`,
|
|
2998
|
-
onClick:
|
|
2999
|
-
}, null, 8,
|
|
3000
|
-
L.value ? (S(), s("div",
|
|
3083
|
+
onClick: X
|
|
3084
|
+
}, null, 8, zr),
|
|
3085
|
+
L.value ? (S(), s("div", Br, [c("span", Vr, [u(j(ie), {
|
|
3001
3086
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
3002
3087
|
"aria-hidden": "true"
|
|
3003
3088
|
})])])) : o("", !0),
|
|
@@ -3010,8 +3095,8 @@ var Fr = ["aria-label"], Ir = {
|
|
|
3010
3095
|
draggable: "false",
|
|
3011
3096
|
class: _(["block h-full w-full object-cover transition-opacity duration-300", m.value ? "pointer-events-none opacity-100" : "pointer-events-none opacity-0"]),
|
|
3012
3097
|
onLoad: H,
|
|
3013
|
-
onError:
|
|
3014
|
-
}, null, 42,
|
|
3098
|
+
onError: ee
|
|
3099
|
+
}, null, 42, Hr)) : N.value && E.value && !P.value ? (S(), s("video", {
|
|
3015
3100
|
key: 2,
|
|
3016
3101
|
ref_key: "videoRef",
|
|
3017
3102
|
ref: C,
|
|
@@ -3021,64 +3106,64 @@ var Fr = ["aria-label"], Ir = {
|
|
|
3021
3106
|
playsinline: "",
|
|
3022
3107
|
preload: "metadata",
|
|
3023
3108
|
class: _(["block h-full w-full object-cover transition-opacity duration-300", m.value ? "pointer-events-none opacity-100" : "pointer-events-none opacity-0"]),
|
|
3024
|
-
onCanplay:
|
|
3025
|
-
onError:
|
|
3026
|
-
onLoadstart:
|
|
3027
|
-
onPlaying:
|
|
3028
|
-
onStalled:
|
|
3029
|
-
onWaiting:
|
|
3030
|
-
}, null, 42,
|
|
3109
|
+
onCanplay: U,
|
|
3110
|
+
onError: ee,
|
|
3111
|
+
onLoadstart: W,
|
|
3112
|
+
onPlaying: U,
|
|
3113
|
+
onStalled: W,
|
|
3114
|
+
onWaiting: W
|
|
3115
|
+
}, null, 42, Ur)) : P.value ? (S(), s("div", {
|
|
3031
3116
|
key: 3,
|
|
3032
3117
|
"data-testid": "vibe-list-card-error",
|
|
3033
3118
|
"data-kind": h.value,
|
|
3034
3119
|
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))]"
|
|
3035
|
-
}, [c("div",
|
|
3036
|
-
u(j(
|
|
3120
|
+
}, [c("div", Gr, [
|
|
3121
|
+
u(j(se), {
|
|
3037
3122
|
class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
|
|
3038
3123
|
"aria-hidden": "true"
|
|
3039
3124
|
}),
|
|
3040
|
-
c("span",
|
|
3125
|
+
c("span", Kr, k(j(At)(h.value)), 1),
|
|
3041
3126
|
I.value ? (S(), s("button", {
|
|
3042
3127
|
key: 0,
|
|
3043
3128
|
type: "button",
|
|
3044
3129
|
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",
|
|
3045
|
-
onClick: z(
|
|
3130
|
+
onClick: z(ne, ["stop"])
|
|
3046
3131
|
}, " Retry ")) : o("", !0)
|
|
3047
|
-
])], 8,
|
|
3132
|
+
])], 8, Wr)) : (S(), s("div", qr, [c("div", Jr, [D(e.$slots, "item-icon", {
|
|
3048
3133
|
icon: j(ft)(n.item.type),
|
|
3049
3134
|
item: n.item
|
|
3050
3135
|
}, () => [(S(), a(O(j(ft)(n.item.type)), {
|
|
3051
3136
|
class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
|
|
3052
3137
|
"aria-hidden": "true"
|
|
3053
3138
|
}))])])])),
|
|
3054
|
-
c("div",
|
|
3139
|
+
c("div", Yr, [D(e.$slots, "grid-item-overlay", {
|
|
3055
3140
|
active: n.active,
|
|
3056
3141
|
focused: f.value,
|
|
3057
3142
|
hovered: p.value,
|
|
3058
3143
|
index: n.index,
|
|
3059
3144
|
item: n.item,
|
|
3060
|
-
openFullscreen:
|
|
3145
|
+
openFullscreen: X
|
|
3061
3146
|
})])
|
|
3062
3147
|
], 34));
|
|
3063
3148
|
}
|
|
3064
|
-
}),
|
|
3149
|
+
}), Zr = { class: "relative h-full min-h-0 bg-[radial-gradient(circle_at_top_center,rgba(255,255,255,0.04),transparent_28%),linear-gradient(180deg,#06070b,#05060a)]" }, Qr = { class: "pointer-events-none absolute inset-x-0 top-0 z-[2] flex justify-end p-6" }, $r = {
|
|
3065
3150
|
"data-testid": "vibe-pagination",
|
|
3066
3151
|
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]"
|
|
3067
|
-
},
|
|
3152
|
+
}, ei = { class: "whitespace-nowrap" }, ti = {
|
|
3068
3153
|
key: 0,
|
|
3069
3154
|
class: "whitespace-nowrap border-l border-white/12 pl-2 text-[#f7f1ea]/56 min-[721px]:pl-3"
|
|
3070
|
-
},
|
|
3155
|
+
}, ni = [
|
|
3071
3156
|
"data-active",
|
|
3072
3157
|
"data-index",
|
|
3073
3158
|
"data-item-id",
|
|
3074
3159
|
"data-occurrence-key"
|
|
3075
|
-
],
|
|
3160
|
+
], ri = ["data-item-id"], ii = {
|
|
3076
3161
|
key: 0,
|
|
3077
3162
|
class: "pointer-events-none absolute inset-y-0 right-0 z-[3] hidden w-8 min-[1024px]:block"
|
|
3078
|
-
},
|
|
3163
|
+
}, ai = {
|
|
3079
3164
|
key: 1,
|
|
3080
3165
|
class: "pointer-events-none absolute inset-x-0 bottom-0 z-[2] px-5 pb-5 sm:px-6"
|
|
3081
|
-
},
|
|
3166
|
+
}, oi = { class: "mx-auto flex w-full max-w-[1600px] justify-center" }, si = /* @__PURE__ */ d({
|
|
3082
3167
|
__name: "ListSurface",
|
|
3083
3168
|
props: {
|
|
3084
3169
|
active: {
|
|
@@ -3135,7 +3220,7 @@ var Fr = ["aria-label"], Ir = {
|
|
|
3135
3220
|
},
|
|
3136
3221
|
emits: ["open-fullscreen", "update:activeIndex"],
|
|
3137
3222
|
setup(e, { emit: n }) {
|
|
3138
|
-
let r = e, d = N(), f = n, p =
|
|
3223
|
+
let r = e, d = N(), f = n, p = Sr({
|
|
3139
3224
|
active: A(r, "active"),
|
|
3140
3225
|
allowExhaustedNextPageRefresh: A(r, "allowExhaustedNextPageRefresh"),
|
|
3141
3226
|
items: A(r, "items"),
|
|
@@ -3175,8 +3260,8 @@ var Fr = ["aria-label"], Ir = {
|
|
|
3175
3260
|
renderSlot: d["empty-state"],
|
|
3176
3261
|
surface: "grid"
|
|
3177
3262
|
});
|
|
3178
|
-
return (e, n) => (S(), s("div",
|
|
3179
|
-
c("div",
|
|
3263
|
+
return (e, n) => (S(), s("div", Zr, [
|
|
3264
|
+
c("div", Qr, [c("span", $r, [c("span", ei, k(j(p).paginationLabel.value), 1), r.paginationDetail ? (S(), s("span", ti, k(r.paginationDetail), 1)) : o("", !0)])]),
|
|
3180
3265
|
c("div", {
|
|
3181
3266
|
ref: j(p).scrollViewportRef,
|
|
3182
3267
|
"data-testid": "vibe-list-scroll",
|
|
@@ -3197,7 +3282,7 @@ var Fr = ["aria-label"], Ir = {
|
|
|
3197
3282
|
"data-occurrence-key": j(Q)(t),
|
|
3198
3283
|
class: "absolute will-change-transform",
|
|
3199
3284
|
style: y(j(p).getCardStyle(n))
|
|
3200
|
-
}, [u(
|
|
3285
|
+
}, [u(Xr, {
|
|
3201
3286
|
active: n === j(p).resolvedActiveIndex.value,
|
|
3202
3287
|
index: n,
|
|
3203
3288
|
item: t,
|
|
@@ -3221,14 +3306,14 @@ var Fr = ["aria-label"], Ir = {
|
|
|
3221
3306
|
"report-asset-load",
|
|
3222
3307
|
"surface-active",
|
|
3223
3308
|
"onOpen"
|
|
3224
|
-
])], 12,
|
|
3309
|
+
])], 12, ni))), 128)),
|
|
3225
3310
|
(S(!0), s(t, null, E(j(p).leavingItems.value, (t) => (S(), s("article", {
|
|
3226
3311
|
key: `leaving-${j(Q)(t.item)}`,
|
|
3227
3312
|
"data-testid": "vibe-list-card-leaving",
|
|
3228
3313
|
"data-item-id": t.item.id,
|
|
3229
3314
|
class: "pointer-events-none absolute z-[2] will-change-[opacity,transform]",
|
|
3230
3315
|
style: y(j(p).getLeavingCardStyle(t.item))
|
|
3231
|
-
}, [u(
|
|
3316
|
+
}, [u(Xr, {
|
|
3232
3317
|
active: !1,
|
|
3233
3318
|
index: -1,
|
|
3234
3319
|
item: t.item,
|
|
@@ -3243,8 +3328,8 @@ var Fr = ["aria-label"], Ir = {
|
|
|
3243
3328
|
"item",
|
|
3244
3329
|
"report-asset-error",
|
|
3245
3330
|
"report-asset-load"
|
|
3246
|
-
])], 12,
|
|
3247
|
-
j(P) && j(T) ? (S(), a(
|
|
3331
|
+
])], 12, ri))), 128)),
|
|
3332
|
+
j(P) && j(T) ? (S(), a(Qt, {
|
|
3248
3333
|
key: 0,
|
|
3249
3334
|
message: j(T).message,
|
|
3250
3335
|
mode: j(T).mode,
|
|
@@ -3258,12 +3343,12 @@ var Fr = ["aria-label"], Ir = {
|
|
|
3258
3343
|
"surface"
|
|
3259
3344
|
])) : o("", !0)
|
|
3260
3345
|
], 4)], 544),
|
|
3261
|
-
j(p).showScrollbar.value ? (S(), s("div",
|
|
3346
|
+
j(p).showScrollbar.value ? (S(), s("div", ii, [n[2] ||= c("div", { class: "absolute bottom-6 right-3 top-6 w-px bg-white/8" }, null, -1), c("div", {
|
|
3262
3347
|
"data-testid": "vibe-list-scrollbar-thumb",
|
|
3263
3348
|
class: _(["absolute right-[0.625rem] w-1 bg-white/34 transition-[height,transform,background-color,opacity] duration-300 ease-out", r.loading ? "bg-white/52" : "bg-white/34"]),
|
|
3264
3349
|
style: y(j(p).getScrollbarThumbStyle())
|
|
3265
3350
|
}, null, 6)])) : o("", !0),
|
|
3266
|
-
d["grid-footer"] ? (S(), s("div",
|
|
3351
|
+
d["grid-footer"] ? (S(), s("div", ai, [c("div", oi, [D(e.$slots, "grid-footer")])])) : o("", !0),
|
|
3267
3352
|
b.value ? (S(), s("div", {
|
|
3268
3353
|
key: 2,
|
|
3269
3354
|
class: _(["pointer-events-none absolute inset-x-0 bottom-0 z-[3] flex justify-center px-6", d["grid-footer"] ? "pb-24" : "pb-6"])
|
|
@@ -3272,7 +3357,7 @@ var Fr = ["aria-label"], Ir = {
|
|
|
3272
3357
|
"data-testid": "vibe-grid-status-badge",
|
|
3273
3358
|
class: _(["inline-flex items-center border border-white/14 bg-black/55 px-4 py-3 text-[0.7rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/72 backdrop-blur-[18px]", b.value.kind === "end" ? "border-amber-300/35 text-amber-200" : b.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
|
|
3274
3359
|
}, k(b.value.message), 3))], 2)) : o("", !0),
|
|
3275
|
-
j(O) && j(T) ? (S(), a(
|
|
3360
|
+
j(O) && j(T) ? (S(), a(Qt, {
|
|
3276
3361
|
key: 3,
|
|
3277
3362
|
class: _(["z-[3]", d["grid-footer"] ? "pb-24" : "pb-6"]),
|
|
3278
3363
|
message: j(T).message,
|
|
@@ -3289,13 +3374,13 @@ var Fr = ["aria-label"], Ir = {
|
|
|
3289
3374
|
])) : o("", !0)
|
|
3290
3375
|
]));
|
|
3291
3376
|
}
|
|
3292
|
-
}),
|
|
3377
|
+
}), ci = ["data-surface-mode"], li = {
|
|
3293
3378
|
key: 1,
|
|
3294
3379
|
class: "absolute left-5 top-5 z-30 border border-amber-400/45 bg-black/35 px-4 py-2 text-xs font-medium uppercase tracking-[0.24em] text-amber-100 backdrop-blur"
|
|
3295
|
-
},
|
|
3380
|
+
}, ui = ["data-visible", "inert"], di = ["data-visible", "inert"], fi = {
|
|
3296
3381
|
key: 3,
|
|
3297
3382
|
class: "relative z-[1] grid h-full w-full content-center justify-items-center gap-6 px-[clamp(2rem,4vw,3rem)] py-[clamp(2rem,4vw,3rem)] text-center"
|
|
3298
|
-
},
|
|
3383
|
+
}, pi = /* @__PURE__ */ d({
|
|
3299
3384
|
name: "VibeLayout",
|
|
3300
3385
|
__name: "Layout",
|
|
3301
3386
|
props: {
|
|
@@ -3304,10 +3389,12 @@ var Fr = ["aria-label"], Ir = {
|
|
|
3304
3389
|
fillDelayStepMs: {},
|
|
3305
3390
|
initialCursor: {},
|
|
3306
3391
|
initialState: {},
|
|
3392
|
+
loopFullscreenVideo: { type: Boolean },
|
|
3307
3393
|
mode: {},
|
|
3308
3394
|
pageSize: {},
|
|
3309
3395
|
paginationDetail: {},
|
|
3310
3396
|
resolve: { type: Function },
|
|
3397
|
+
showDominantImageTone: { type: Boolean },
|
|
3311
3398
|
showEndBadge: { type: Boolean },
|
|
3312
3399
|
showStatusBadges: { type: Boolean },
|
|
3313
3400
|
surfaceMode: {}
|
|
@@ -3319,9 +3406,9 @@ var Fr = ["aria-label"], Ir = {
|
|
|
3319
3406
|
"update:surfaceMode"
|
|
3320
3407
|
],
|
|
3321
3408
|
setup(e, { expose: n, emit: i }) {
|
|
3322
|
-
let d = e, p = N(), m = i, h = Ge(d, m), g =
|
|
3409
|
+
let d = e, p = N(), m = i, h = Ge(d, m), g = ce((e) => {
|
|
3323
3410
|
m("asset-errors", e);
|
|
3324
|
-
}), _ =
|
|
3411
|
+
}), _ = X((e) => {
|
|
3325
3412
|
m("asset-loads", e);
|
|
3326
3413
|
});
|
|
3327
3414
|
return b(() => {
|
|
@@ -3348,7 +3435,7 @@ var Fr = ["aria-label"], Ir = {
|
|
|
3348
3435
|
type: "button",
|
|
3349
3436
|
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",
|
|
3350
3437
|
onClick: n[0] ||= (...e) => j(h).retryInitialLoad && j(h).retryInitialLoad(...e)
|
|
3351
|
-
}, " Retry ")) : j(h).errorMessage.value && j(h).items.value.length > 0 ? (S(), s("div",
|
|
3438
|
+
}, " Retry ")) : j(h).errorMessage.value && j(h).items.value.length > 0 ? (S(), s("div", li, k(j(h).errorMessage.value), 1)) : o("", !0), j(h).isDesktop.value ? (S(), s(t, { key: 2 }, [u(r, {
|
|
3352
3439
|
appear: "",
|
|
3353
3440
|
"enter-active-class": "transition-[opacity,transform] duration-300 ease-out",
|
|
3354
3441
|
"enter-from-class": "translate-y-3 opacity-0",
|
|
@@ -3362,7 +3449,7 @@ var Fr = ["aria-label"], Ir = {
|
|
|
3362
3449
|
"data-visible": j(h).surfaceMode.value === "list" ? "true" : "false",
|
|
3363
3450
|
inert: j(h).surfaceMode.value !== "list",
|
|
3364
3451
|
class: "absolute inset-0 z-[2]"
|
|
3365
|
-
}, [u(
|
|
3452
|
+
}, [u(si, {
|
|
3366
3453
|
active: j(h).surfaceMode.value === "list",
|
|
3367
3454
|
"allow-exhausted-next-page-refresh": j(h).canRefreshExhaustedNextPage.value,
|
|
3368
3455
|
items: j(h).items.value,
|
|
@@ -3430,7 +3517,7 @@ var Fr = ["aria-label"], Ir = {
|
|
|
3430
3517
|
"show-status-badges",
|
|
3431
3518
|
"onOpenFullscreen",
|
|
3432
3519
|
"onUpdate:activeIndex"
|
|
3433
|
-
])], 8,
|
|
3520
|
+
])], 8, ui), [[P, j(h).surfaceMode.value === "list"]])]),
|
|
3434
3521
|
_: 3
|
|
3435
3522
|
}), u(r, {
|
|
3436
3523
|
appear: "",
|
|
@@ -3446,7 +3533,7 @@ var Fr = ["aria-label"], Ir = {
|
|
|
3446
3533
|
"data-visible": j(h).surfaceMode.value === "fullscreen" ? "true" : "false",
|
|
3447
3534
|
inert: j(h).surfaceMode.value !== "fullscreen",
|
|
3448
3535
|
class: "absolute inset-0 z-[3]"
|
|
3449
|
-
}, [u(
|
|
3536
|
+
}, [u(Pn, {
|
|
3450
3537
|
items: j(h).items.value,
|
|
3451
3538
|
active: j(h).surfaceMode.value === "fullscreen",
|
|
3452
3539
|
"active-index": j(h).activeIndex.value,
|
|
@@ -3458,6 +3545,8 @@ var Fr = ["aria-label"], Ir = {
|
|
|
3458
3545
|
"report-asset-error": j(g).report,
|
|
3459
3546
|
"report-asset-load": j(_).report,
|
|
3460
3547
|
"empty-state-mode": d.emptyStateMode,
|
|
3548
|
+
"loop-fullscreen-video": d.loopFullscreenVideo ?? !0,
|
|
3549
|
+
"show-dominant-image-tone": d.showDominantImageTone ?? !0,
|
|
3461
3550
|
"show-end-badge": d.showEndBadge ?? !0,
|
|
3462
3551
|
"show-status-badges": d.showStatusBadges ?? !0,
|
|
3463
3552
|
"show-back-to-list": j(h).showBackToList.value,
|
|
@@ -3506,17 +3595,19 @@ var Fr = ["aria-label"], Ir = {
|
|
|
3506
3595
|
"report-asset-error",
|
|
3507
3596
|
"report-asset-load",
|
|
3508
3597
|
"empty-state-mode",
|
|
3598
|
+
"loop-fullscreen-video",
|
|
3599
|
+
"show-dominant-image-tone",
|
|
3509
3600
|
"show-end-badge",
|
|
3510
3601
|
"show-status-badges",
|
|
3511
3602
|
"show-back-to-list",
|
|
3512
3603
|
"onBackToList",
|
|
3513
3604
|
"onUpdate:activeIndex"
|
|
3514
|
-
])], 8,
|
|
3605
|
+
])], 8, di), [[P, j(h).surfaceMode.value === "fullscreen"]])]),
|
|
3515
3606
|
_: 3
|
|
3516
|
-
})], 64)) : j(h).items.value.length === 0 && j(h).loading.value ? (S(), s("div",
|
|
3607
|
+
})], 64)) : j(h).items.value.length === 0 && j(h).loading.value ? (S(), s("div", fi, [u(j(ie), {
|
|
3517
3608
|
class: "size-10 animate-spin text-[#f7f1ea]/82",
|
|
3518
3609
|
"aria-hidden": "true"
|
|
3519
|
-
}), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (S(), a(
|
|
3610
|
+
}), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (S(), a(Pn, {
|
|
3520
3611
|
key: 4,
|
|
3521
3612
|
items: j(h).items.value,
|
|
3522
3613
|
active: !0,
|
|
@@ -3529,6 +3620,8 @@ var Fr = ["aria-label"], Ir = {
|
|
|
3529
3620
|
"report-asset-error": j(g).report,
|
|
3530
3621
|
"report-asset-load": j(_).report,
|
|
3531
3622
|
"empty-state-mode": d.emptyStateMode,
|
|
3623
|
+
"loop-fullscreen-video": d.loopFullscreenVideo ?? !0,
|
|
3624
|
+
"show-dominant-image-tone": d.showDominantImageTone ?? !0,
|
|
3532
3625
|
"show-end-badge": d.showEndBadge ?? !0,
|
|
3533
3626
|
"show-status-badges": d.showStatusBadges ?? !0,
|
|
3534
3627
|
"show-back-to-list": !1,
|
|
@@ -3576,14 +3669,16 @@ var Fr = ["aria-label"], Ir = {
|
|
|
3576
3669
|
"report-asset-error",
|
|
3577
3670
|
"report-asset-load",
|
|
3578
3671
|
"empty-state-mode",
|
|
3672
|
+
"loop-fullscreen-video",
|
|
3673
|
+
"show-dominant-image-tone",
|
|
3579
3674
|
"show-end-badge",
|
|
3580
3675
|
"show-status-badges",
|
|
3581
3676
|
"onBackToList",
|
|
3582
3677
|
"onUpdate:activeIndex"
|
|
3583
|
-
]))], 8,
|
|
3678
|
+
]))], 8, ci));
|
|
3584
3679
|
}
|
|
3585
|
-
}),
|
|
3586
|
-
e.component("VibeLayout",
|
|
3680
|
+
}), mi = { install(e) {
|
|
3681
|
+
e.component("VibeLayout", pi);
|
|
3587
3682
|
} };
|
|
3588
3683
|
//#endregion
|
|
3589
|
-
export {
|
|
3684
|
+
export { pi as VibeLayout, mi as VibePlugin, mi as default };
|