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