@wyxos/vibe 4.3.0 → 4.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/lib/components/CardRegion.vue.d.ts +2 -1
- package/lib/components/FeedFooter.vue.d.ts +0 -1
- package/lib/components/GalleryFooter.vue.d.ts +0 -1
- package/lib/components/MediaCard.vue.d.ts +2 -1
- package/lib/components/VibeSurface.vue.d.ts +2 -1
- package/lib/core/feed.d.ts +2 -1
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +323 -295
- package/lib/style.css +1 -1
- package/lib/types.d.ts +11 -0
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -50,18 +50,13 @@ var I = {
|
|
|
50
50
|
role: "status"
|
|
51
51
|
}, R = ["disabled"], z = {
|
|
52
52
|
key: 2,
|
|
53
|
-
class: "gallery-sentinel",
|
|
54
|
-
"aria-hidden": "true"
|
|
55
|
-
}, B = {
|
|
56
|
-
key: 3,
|
|
57
53
|
class: "end-feed"
|
|
58
|
-
},
|
|
54
|
+
}, B = ["disabled"], V = /* @__PURE__ */ u({
|
|
59
55
|
__name: "GalleryFooter",
|
|
60
56
|
props: {
|
|
61
57
|
canRetryEnd: { type: Boolean },
|
|
62
58
|
hasError: { type: Boolean },
|
|
63
59
|
hasNext: { type: Boolean },
|
|
64
|
-
infiniteScroll: { type: Boolean },
|
|
65
60
|
isLoading: { type: Boolean },
|
|
66
61
|
loadMoreLocked: { type: Boolean }
|
|
67
62
|
},
|
|
@@ -71,14 +66,14 @@ var I = {
|
|
|
71
66
|
function i() {
|
|
72
67
|
n.loadMoreLocked || (n.hasNext ? r("loadMore") : r("retryEnd"));
|
|
73
68
|
}
|
|
74
|
-
return (t, n) => e.hasNext || e.isLoading || e.hasError || e.canRetryEnd ? (y(), o("footer", I, [e.isLoading ? (y(), o("p", L, " Loading more… ")) : e.hasError || e.hasNext
|
|
69
|
+
return (t, n) => e.hasNext || e.isLoading || e.hasError || e.canRetryEnd ? (y(), o("footer", I, [e.isLoading ? (y(), o("p", L, " Loading more… ")) : e.hasError || e.hasNext ? (y(), o("button", {
|
|
75
70
|
key: 1,
|
|
76
71
|
"data-test": "load-more",
|
|
77
72
|
class: "load-more-button",
|
|
78
73
|
type: "button",
|
|
79
74
|
disabled: e.loadMoreLocked,
|
|
80
75
|
onClick: i
|
|
81
|
-
}, w(e.hasError ? "Try again" : e.loadMoreLocked ? "Loading paused" : "Load more"), 9, R)) :
|
|
76
|
+
}, w(e.hasError ? "Try again" : e.loadMoreLocked ? "Loading paused" : "Load more"), 9, R)) : (y(), o("div", z, [n[1] ||= s("p", {
|
|
82
77
|
class: "end-feed-message",
|
|
83
78
|
role: "status"
|
|
84
79
|
}, " You've reached the end. ", -1), s("button", {
|
|
@@ -87,9 +82,9 @@ var I = {
|
|
|
87
82
|
type: "button",
|
|
88
83
|
disabled: e.loadMoreLocked,
|
|
89
84
|
onClick: n[0] ||= (e) => t.$emit("retryEnd")
|
|
90
|
-
}, " Check for more ", 8,
|
|
85
|
+
}, " Check for more ", 8, B)]))])) : a("", !0);
|
|
91
86
|
}
|
|
92
|
-
}),
|
|
87
|
+
}), H = /* @__PURE__ */ u({
|
|
93
88
|
__name: "FeedFooter",
|
|
94
89
|
props: {
|
|
95
90
|
actions: {},
|
|
@@ -97,7 +92,6 @@ var I = {
|
|
|
97
92
|
feedFooter: {},
|
|
98
93
|
hasError: { type: Boolean },
|
|
99
94
|
hasNext: { type: Boolean },
|
|
100
|
-
infiniteScroll: { type: Boolean },
|
|
101
95
|
isLoading: { type: Boolean },
|
|
102
96
|
loadMoreLocked: { type: Boolean },
|
|
103
97
|
state: {}
|
|
@@ -114,17 +108,21 @@ var I = {
|
|
|
114
108
|
return (t, n) => e.feedFooter && e.actions && e.state ? (y(), i(S(e.feedFooter.component), {
|
|
115
109
|
key: 0,
|
|
116
110
|
actions: e.actions,
|
|
111
|
+
"can-retry-end": e.canRetryEnd,
|
|
117
112
|
state: e.state,
|
|
118
113
|
onAutofillCancel: a,
|
|
119
114
|
onLoadMore: n[0] ||= (e) => r("loadMore"),
|
|
120
115
|
onRetry: o,
|
|
121
116
|
onRetryEnd: n[1] ||= (e) => r("retryEnd")
|
|
122
|
-
}, null, 40, [
|
|
117
|
+
}, null, 40, [
|
|
118
|
+
"actions",
|
|
119
|
+
"can-retry-end",
|
|
120
|
+
"state"
|
|
121
|
+
])) : (y(), i(V, {
|
|
123
122
|
key: 1,
|
|
124
123
|
"can-retry-end": e.canRetryEnd,
|
|
125
124
|
"has-error": e.hasError,
|
|
126
125
|
"has-next": e.hasNext,
|
|
127
|
-
"infinite-scroll": e.infiniteScroll,
|
|
128
126
|
"is-loading": e.isLoading,
|
|
129
127
|
"load-more-locked": e.loadMoreLocked,
|
|
130
128
|
onLoadMore: n[2] ||= (e) => r("loadMore"),
|
|
@@ -133,12 +131,11 @@ var I = {
|
|
|
133
131
|
"can-retry-end",
|
|
134
132
|
"has-error",
|
|
135
133
|
"has-next",
|
|
136
|
-
"infinite-scroll",
|
|
137
134
|
"is-loading",
|
|
138
135
|
"load-more-locked"
|
|
139
136
|
]));
|
|
140
137
|
}
|
|
141
|
-
}),
|
|
138
|
+
}), U = ["role"], W = { class: "gallery-status" }, ee = /* @__PURE__ */ u({
|
|
142
139
|
__name: "FeedStatus",
|
|
143
140
|
props: {
|
|
144
141
|
actions: {},
|
|
@@ -152,14 +149,13 @@ var I = {
|
|
|
152
149
|
return (n, u) => (y(), o("main", {
|
|
153
150
|
class: "gallery-shell",
|
|
154
151
|
role: r.state.error ? "alert" : r.state.isLoading ? "status" : void 0
|
|
155
|
-
}, [s("p",
|
|
152
|
+
}, [s("p", W, [r.state.error ? (y(), o(e, { key: 0 }, [c(" Unable to load media. ")], 64)) : r.state.isLoading ? (y(), o(e, { key: 1 }, [c(" Loading media… ")], 64)) : (y(), o(e, { key: 2 }, [c(" No media found. ")], 64))]), t.feedFooter ? (y(), i(H, {
|
|
156
153
|
key: 0,
|
|
157
154
|
actions: t.actions,
|
|
158
155
|
"can-retry-end": t.canRetryEnd,
|
|
159
156
|
"feed-footer": t.feedFooter,
|
|
160
157
|
"has-error": !!t.state.nextPageError,
|
|
161
158
|
"has-next": t.state.next !== null,
|
|
162
|
-
"infinite-scroll": t.state.infiniteScroll,
|
|
163
159
|
"is-loading": t.state.isLoadingMore,
|
|
164
160
|
"load-more-locked": t.state.loadMoreLocked,
|
|
165
161
|
state: t.state,
|
|
@@ -171,11 +167,10 @@ var I = {
|
|
|
171
167
|
"feed-footer",
|
|
172
168
|
"has-error",
|
|
173
169
|
"has-next",
|
|
174
|
-
"infinite-scroll",
|
|
175
170
|
"is-loading",
|
|
176
171
|
"load-more-locked",
|
|
177
172
|
"state"
|
|
178
|
-
])) : a("", !0)], 8,
|
|
173
|
+
])) : a("", !0)], 8, U));
|
|
179
174
|
}
|
|
180
175
|
});
|
|
181
176
|
function G(e) {
|
|
@@ -183,28 +178,28 @@ function G(e) {
|
|
|
183
178
|
}
|
|
184
179
|
//#endregion
|
|
185
180
|
//#region src/core/masonry.ts
|
|
186
|
-
function
|
|
181
|
+
function te(e) {
|
|
187
182
|
let t = e.preview.width ?? e.width, n = e.preview.height ?? e.height;
|
|
188
183
|
return !t || !n || t <= 0 || n <= 0 ? 1 : n / t;
|
|
189
184
|
}
|
|
190
|
-
function
|
|
185
|
+
function ne(e) {
|
|
191
186
|
return e.reduce((t, n, r) => n < e[t] ? r : t, 0);
|
|
192
187
|
}
|
|
193
|
-
function
|
|
188
|
+
function K(e) {
|
|
194
189
|
return Math.max(0, e.containerHeight) + Math.max(0, e.gap);
|
|
195
190
|
}
|
|
196
|
-
function
|
|
191
|
+
function q(e, t) {
|
|
197
192
|
let n = Math.max(0, t.overscan), r = t.scrollTop - n, i = t.scrollTop + Math.max(0, t.viewportHeight) + n;
|
|
198
193
|
return e.reduce((e, t, n) => (t.y + t.height >= r && t.y <= i && e.push(n), e), []);
|
|
199
194
|
}
|
|
200
|
-
function
|
|
195
|
+
function J(e, t, n) {
|
|
201
196
|
if (t <= 0 || e.length === 0) return {
|
|
202
197
|
columns: 0,
|
|
203
198
|
height: 0,
|
|
204
199
|
items: []
|
|
205
200
|
};
|
|
206
201
|
let r = Math.max(0, n.gap), i = Number.isFinite(n.additionalHeight) ? Math.max(0, n.additionalHeight ?? 0) : 0, a = Math.max(1, n.minColumnWidth), o = Math.max(1, Math.floor((t + r) / (a + r))), s = (t - r * (o - 1)) / o, c = Array.from({ length: o }, () => 0), l = e.map((e) => {
|
|
207
|
-
let t =
|
|
202
|
+
let t = ne(c), n = s * te(e) + i, a = {
|
|
208
203
|
x: t * (s + r),
|
|
209
204
|
y: c[t],
|
|
210
205
|
width: s,
|
|
@@ -220,10 +215,10 @@ function Y(e, t, n) {
|
|
|
220
215
|
}
|
|
221
216
|
//#endregion
|
|
222
217
|
//#region src/core/scrollbar.ts
|
|
223
|
-
function
|
|
218
|
+
function Y(e, t, n) {
|
|
224
219
|
return Math.min(n, Math.max(t, e));
|
|
225
220
|
}
|
|
226
|
-
function
|
|
221
|
+
function X({ contentSize: e, minimumThumbSize: t, scrollPosition: n, trackSize: r, viewportSize: i }) {
|
|
227
222
|
let a = Math.max(0, e), o = Math.max(0, r), s = Math.max(0, i), c = Math.max(0, a - s);
|
|
228
223
|
if (!(c > 0 && o > 0)) return {
|
|
229
224
|
maximumScrollPosition: c,
|
|
@@ -232,23 +227,23 @@ function re({ contentSize: e, minimumThumbSize: t, scrollPosition: n, trackSize:
|
|
|
232
227
|
thumbSize: o,
|
|
233
228
|
thumbTravel: 0
|
|
234
229
|
};
|
|
235
|
-
let l =
|
|
230
|
+
let l = Y(s / a * o, Math.min(Math.max(0, t), o), o), u = Math.max(0, o - l);
|
|
236
231
|
return {
|
|
237
232
|
maximumScrollPosition: c,
|
|
238
233
|
scrollable: !0,
|
|
239
|
-
thumbOffset: u * (
|
|
234
|
+
thumbOffset: u * (Y(n, 0, c) / c),
|
|
240
235
|
thumbSize: l,
|
|
241
236
|
thumbTravel: u
|
|
242
237
|
};
|
|
243
238
|
}
|
|
244
239
|
//#endregion
|
|
245
240
|
//#region src/components/GalleryScrollbar.vue?vue&type=script&setup=true&lang.ts
|
|
246
|
-
var
|
|
241
|
+
var re = ["aria-hidden"], ie = [
|
|
247
242
|
"aria-controls",
|
|
248
243
|
"aria-valuemax",
|
|
249
244
|
"aria-valuenow",
|
|
250
245
|
"tabindex"
|
|
251
|
-
],
|
|
246
|
+
], ae = 32, Z = 40, oe = 120, se = /* @__PURE__ */ u({
|
|
252
247
|
__name: "GalleryScrollbar",
|
|
253
248
|
props: {
|
|
254
249
|
contentSize: {},
|
|
@@ -270,16 +265,16 @@ var ie = ["aria-hidden"], ae = [
|
|
|
270
265
|
function k() {
|
|
271
266
|
v !== null && clearTimeout(v), v = setTimeout(() => {
|
|
272
267
|
v = null, c.value || (l.value = !1);
|
|
273
|
-
},
|
|
268
|
+
}, oe);
|
|
274
269
|
}
|
|
275
270
|
function A() {
|
|
276
271
|
l.value = !0, k();
|
|
277
272
|
}
|
|
278
273
|
function j() {
|
|
279
274
|
let e = t.scrollElement, n = i.value;
|
|
280
|
-
return !e || !n ? r :
|
|
275
|
+
return !e || !n ? r : X({
|
|
281
276
|
contentSize: e.scrollHeight,
|
|
282
|
-
minimumThumbSize:
|
|
277
|
+
minimumThumbSize: ae,
|
|
283
278
|
scrollPosition: e.scrollTop,
|
|
284
279
|
trackSize: n.clientHeight,
|
|
285
280
|
viewportSize: e.clientHeight
|
|
@@ -332,7 +327,7 @@ var ie = ["aria-hidden"], ae = [
|
|
|
332
327
|
}
|
|
333
328
|
function z(e) {
|
|
334
329
|
if (!E.value) return;
|
|
335
|
-
let n = t.scrollElement?.clientHeight ?? 0, r = t.scrollElement?.scrollTop ?? 0, i = e.key === "ArrowUp" ? r -
|
|
330
|
+
let n = t.scrollElement?.clientHeight ?? 0, r = t.scrollElement?.scrollTop ?? 0, i = e.key === "ArrowUp" ? r - Z : e.key === "ArrowDown" ? r + Z : e.key === "PageUp" ? r - n : e.key === "PageDown" ? r + n : e.key === "Home" ? 0 : e.key === "End" ? a.value.maximumScrollPosition : null;
|
|
336
331
|
i !== null && (e.preventDefault(), A(), P(i));
|
|
337
332
|
}
|
|
338
333
|
function B(e) {
|
|
@@ -378,15 +373,15 @@ var ie = ["aria-hidden"], ae = [
|
|
|
378
373
|
onPointerdown: I,
|
|
379
374
|
onPointermove: L,
|
|
380
375
|
onPointerup: R
|
|
381
|
-
}, null, 44,
|
|
376
|
+
}, null, 44, ie)], 42, re));
|
|
382
377
|
}
|
|
383
|
-
}),
|
|
378
|
+
}), ce = (e) => {
|
|
384
379
|
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
|
|
385
380
|
return !1;
|
|
386
|
-
},
|
|
387
|
-
let t =
|
|
381
|
+
}, le = (e) => e === "", ue = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), de = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), fe = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), pe = (e) => {
|
|
382
|
+
let t = fe(e);
|
|
388
383
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
389
|
-
},
|
|
384
|
+
}, me = {
|
|
390
385
|
xmlns: "http://www.w3.org/2000/svg",
|
|
391
386
|
width: 24,
|
|
392
387
|
height: 24,
|
|
@@ -396,27 +391,27 @@ var ie = ["aria-hidden"], ae = [
|
|
|
396
391
|
"stroke-width": 2,
|
|
397
392
|
"stroke-linecap": "round",
|
|
398
393
|
"stroke-linejoin": "round"
|
|
399
|
-
},
|
|
400
|
-
...
|
|
394
|
+
}, he = ({ name: e, iconNode: t, absoluteStrokeWidth: n, "absolute-stroke-width": r, strokeWidth: i, "stroke-width": a, size: o = me.width, color: s = me.stroke, ...c }, { slots: l }) => f("svg", {
|
|
395
|
+
...me,
|
|
401
396
|
...c,
|
|
402
397
|
width: o,
|
|
403
398
|
height: o,
|
|
404
399
|
stroke: s,
|
|
405
|
-
"stroke-width":
|
|
406
|
-
class:
|
|
407
|
-
...!l.default && !
|
|
408
|
-
}, [...t.map((e) => f(...e)), ...l.default ? [l.default()] : []]),
|
|
400
|
+
"stroke-width": le(n) || le(r) || n === !0 || r === !0 ? Number(i || a || me["stroke-width"]) * 24 / Number(o) : i || a || me["stroke-width"],
|
|
401
|
+
class: ue("lucide", c.class, ...e ? [`lucide-${de(pe(e))}-icon`, `lucide-${de(e)}`] : ["lucide-icon"]),
|
|
402
|
+
...!l.default && !ce(c) && { "aria-hidden": "true" }
|
|
403
|
+
}, [...t.map((e) => f(...e)), ...l.default ? [l.default()] : []]), ge = (e, t) => (n, { slots: r, attrs: i }) => f(he, {
|
|
409
404
|
...i,
|
|
410
405
|
...n,
|
|
411
406
|
iconNode: t,
|
|
412
407
|
name: e
|
|
413
|
-
}, r),
|
|
408
|
+
}, r), _e = ge("chevron-left", [["path", {
|
|
414
409
|
d: "m15 18-6-6 6-6",
|
|
415
410
|
key: "1wnfg3"
|
|
416
|
-
}]]),
|
|
411
|
+
}]]), ve = ge("chevron-right", [["path", {
|
|
417
412
|
d: "m9 18 6-6-6-6",
|
|
418
413
|
key: "mthhwq"
|
|
419
|
-
}]]),
|
|
414
|
+
}]]), ye = ge("pause", [["rect", {
|
|
420
415
|
x: "14",
|
|
421
416
|
y: "3",
|
|
422
417
|
width: "5",
|
|
@@ -430,10 +425,10 @@ var ie = ["aria-hidden"], ae = [
|
|
|
430
425
|
height: "18",
|
|
431
426
|
rx: "1",
|
|
432
427
|
key: "1wsw3u"
|
|
433
|
-
}]]),
|
|
428
|
+
}]]), be = ge("play", [["path", {
|
|
434
429
|
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",
|
|
435
430
|
key: "10ikf1"
|
|
436
|
-
}]]),
|
|
431
|
+
}]]), xe = ge("volume-2", [
|
|
437
432
|
["path", {
|
|
438
433
|
d: "M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",
|
|
439
434
|
key: "uqj9uw"
|
|
@@ -446,7 +441,7 @@ var ie = ["aria-hidden"], ae = [
|
|
|
446
441
|
d: "M19.364 18.364a9 9 0 0 0 0-12.728",
|
|
447
442
|
key: "ijwkga"
|
|
448
443
|
}]
|
|
449
|
-
]),
|
|
444
|
+
]), Se = ge("volume-x", [
|
|
450
445
|
["path", {
|
|
451
446
|
d: "M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",
|
|
452
447
|
key: "uqj9uw"
|
|
@@ -465,32 +460,32 @@ var ie = ["aria-hidden"], ae = [
|
|
|
465
460
|
y2: "15",
|
|
466
461
|
key: "5ykzw1"
|
|
467
462
|
}]
|
|
468
|
-
]),
|
|
463
|
+
]), Ce = {
|
|
469
464
|
401: "Authentication required",
|
|
470
465
|
403: "Access forbidden",
|
|
471
466
|
404: "Preview not found",
|
|
472
467
|
419: "Session expired",
|
|
473
468
|
500: "Server error"
|
|
474
469
|
};
|
|
475
|
-
function
|
|
470
|
+
function we(e) {
|
|
476
471
|
return e.match(/\/demo-errors\/(401|403|404|419|500)\//)?.[1] ?? "Error";
|
|
477
472
|
}
|
|
478
|
-
function
|
|
479
|
-
return we
|
|
473
|
+
function Te(e) {
|
|
474
|
+
return Ce[we(e)] ?? "Preview unavailable";
|
|
480
475
|
}
|
|
481
476
|
//#endregion
|
|
482
477
|
//#region src/core/mediaType.ts
|
|
483
|
-
var
|
|
484
|
-
function
|
|
478
|
+
var Ee = /\.(aac|flac|m4a|mp3|mp4|mov|ogg|opus|wav|webm)$/i;
|
|
479
|
+
function De(e) {
|
|
485
480
|
try {
|
|
486
|
-
return
|
|
481
|
+
return Ee.test(new URL(e).pathname);
|
|
487
482
|
} catch {
|
|
488
|
-
return
|
|
483
|
+
return Ee.test(e.split("?")[0] ?? e);
|
|
489
484
|
}
|
|
490
485
|
}
|
|
491
486
|
//#endregion
|
|
492
487
|
//#region src/components/CardRegion.vue
|
|
493
|
-
var
|
|
488
|
+
var Oe = /* @__PURE__ */ u({
|
|
494
489
|
__name: "CardRegion",
|
|
495
490
|
props: {
|
|
496
491
|
index: {},
|
|
@@ -501,13 +496,18 @@ var ke = /* @__PURE__ */ u({
|
|
|
501
496
|
mediaSource: {},
|
|
502
497
|
placement: {},
|
|
503
498
|
region: {},
|
|
499
|
+
style: {},
|
|
504
500
|
total: {}
|
|
505
501
|
},
|
|
506
502
|
setup(e) {
|
|
507
|
-
let t = e, r = n(() => M(t.item, t.mediaIndex)), a = n(() => j(t.item)), s = n(() => N(t.item, r.value))
|
|
503
|
+
let t = e, r = n(() => M(t.item, t.mediaIndex)), a = n(() => j(t.item)), s = n(() => N(t.item, r.value)), c = n(() => ({
|
|
504
|
+
height: `${t.region.height}px`,
|
|
505
|
+
paddingBlock: t.style?.paddingY === void 0 ? void 0 : `${t.style.paddingY}px`,
|
|
506
|
+
paddingInline: t.style?.paddingX === void 0 ? void 0 : `${t.style.paddingX}px`
|
|
507
|
+
})), l = n(() => t.style?.background ?? t.region.background);
|
|
508
508
|
return (t, n) => (y(), o("div", {
|
|
509
|
-
class: m(["media-card-region", [`media-card-${e.placement}`, { "media-card-region--transparent":
|
|
510
|
-
style: g(
|
|
509
|
+
class: m(["media-card-region", [`media-card-${e.placement}`, { "media-card-region--transparent": l.value === "transparent" }]]),
|
|
510
|
+
style: g(c.value),
|
|
511
511
|
onClick: n[0] ||= A(() => {}, ["stop"]),
|
|
512
512
|
onKeydown: n[1] ||= A(() => {}, ["stop"])
|
|
513
513
|
}, [(y(), i(S(e.region.component), {
|
|
@@ -532,18 +532,18 @@ var ke = /* @__PURE__ */ u({
|
|
|
532
532
|
"total"
|
|
533
533
|
]))], 38));
|
|
534
534
|
}
|
|
535
|
-
}),
|
|
535
|
+
}), ke = [
|
|
536
536
|
"max",
|
|
537
537
|
"value",
|
|
538
538
|
"aria-valuetext",
|
|
539
539
|
"disabled"
|
|
540
|
-
],
|
|
540
|
+
], Ae = {
|
|
541
541
|
key: 0,
|
|
542
542
|
class: "media-controls-row"
|
|
543
|
-
},
|
|
543
|
+
}, je = ["aria-label", "title"], Me = { class: "media-controls-audio" }, Ne = ["aria-label", "title"], Pe = ["value", "aria-valuetext"], Fe = {
|
|
544
544
|
class: "media-control-time",
|
|
545
545
|
"aria-live": "off"
|
|
546
|
-
},
|
|
546
|
+
}, Ie = /* @__PURE__ */ u({
|
|
547
547
|
__name: "MediaControls",
|
|
548
548
|
props: {
|
|
549
549
|
currentTime: {},
|
|
@@ -591,35 +591,35 @@ var ke = /* @__PURE__ */ u({
|
|
|
591
591
|
"aria-valuetext": `${u(p.value)} of ${u(f.value)}`,
|
|
592
592
|
disabled: f.value <= 0,
|
|
593
593
|
onInput: n[0] ||= (e) => c("seek", d(e))
|
|
594
|
-
}, null, 44,
|
|
594
|
+
}, null, 44, ke), e.layout === "reel" ? (y(), o("div", Ae, [
|
|
595
595
|
s("button", {
|
|
596
596
|
type: "button",
|
|
597
597
|
class: "media-control-button media-control-playback",
|
|
598
598
|
"aria-label": e.playing ? "Pause video" : "Play video",
|
|
599
599
|
title: e.playing ? "Pause" : "Play",
|
|
600
600
|
onClick: n[1] ||= (e) => c("togglePlayback")
|
|
601
|
-
}, [e.playing ? (y(), i(T(
|
|
601
|
+
}, [e.playing ? (y(), i(T(ye), {
|
|
602
602
|
key: 0,
|
|
603
603
|
size: 18,
|
|
604
604
|
fill: "currentColor"
|
|
605
|
-
})) : (y(), i(T(
|
|
605
|
+
})) : (y(), i(T(be), {
|
|
606
606
|
key: 1,
|
|
607
607
|
size: 18,
|
|
608
608
|
fill: "currentColor"
|
|
609
|
-
}))], 8,
|
|
610
|
-
s("div",
|
|
609
|
+
}))], 8, je),
|
|
610
|
+
s("div", Me, [s("button", {
|
|
611
611
|
type: "button",
|
|
612
612
|
class: "media-control-button",
|
|
613
613
|
"aria-label": e.muted ? "Unmute video" : "Mute video",
|
|
614
614
|
title: e.muted ? "Unmute" : "Mute",
|
|
615
615
|
onClick: n[2] ||= (e) => c("toggleMute")
|
|
616
|
-
}, [e.muted || e.volume === 0 ? (y(), i(T(
|
|
616
|
+
}, [e.muted || e.volume === 0 ? (y(), i(T(Se), {
|
|
617
617
|
key: 0,
|
|
618
618
|
size: 18
|
|
619
|
-
})) : (y(), i(T(
|
|
619
|
+
})) : (y(), i(T(xe), {
|
|
620
620
|
key: 1,
|
|
621
621
|
size: 18
|
|
622
|
-
}))], 8,
|
|
622
|
+
}))], 8, Ne), s("input", {
|
|
623
623
|
class: "media-control-range media-control-volume",
|
|
624
624
|
type: "range",
|
|
625
625
|
min: "0",
|
|
@@ -630,11 +630,11 @@ var ke = /* @__PURE__ */ u({
|
|
|
630
630
|
"aria-label": "Video volume",
|
|
631
631
|
"aria-valuetext": `${Math.round(e.volume * 100)} percent`,
|
|
632
632
|
onInput: n[3] ||= (e) => c("volumeChange", d(e))
|
|
633
|
-
}, null, 44,
|
|
634
|
-
s("output",
|
|
633
|
+
}, null, 44, Pe)]),
|
|
634
|
+
s("output", Fe, w(u(p.value)) + " / " + w(u(f.value)), 1)
|
|
635
635
|
])) : a("", !0)], 34));
|
|
636
636
|
}
|
|
637
|
-
}),
|
|
637
|
+
}), Le = [
|
|
638
638
|
"data-post-id",
|
|
639
639
|
"data-media-index",
|
|
640
640
|
"aria-hidden",
|
|
@@ -642,24 +642,24 @@ var ke = /* @__PURE__ */ u({
|
|
|
642
642
|
"inert",
|
|
643
643
|
"role",
|
|
644
644
|
"tabindex"
|
|
645
|
-
],
|
|
645
|
+
], Re = { class: "media-card-content" }, ze = ["data-media-direction"], Be = ["data-media-index"], Ve = {
|
|
646
646
|
key: 0,
|
|
647
647
|
"data-test": "media-loading",
|
|
648
648
|
class: "media-loading",
|
|
649
649
|
"aria-hidden": "true"
|
|
650
|
-
},
|
|
650
|
+
}, He = ["aria-label"], Ue = { class: "media-error-code" }, We = [
|
|
651
651
|
"src",
|
|
652
652
|
"width",
|
|
653
653
|
"height",
|
|
654
654
|
"loop",
|
|
655
655
|
"muted",
|
|
656
656
|
"preload"
|
|
657
|
-
],
|
|
657
|
+
], Ge = [
|
|
658
658
|
"src",
|
|
659
659
|
"width",
|
|
660
660
|
"height",
|
|
661
661
|
"fetchpriority"
|
|
662
|
-
],
|
|
662
|
+
], Ke = ["aria-label"], qe = ["aria-label"], Je = ["aria-label"], Ye = 40, Xe = 160, Ze = 24, Qe = /* @__PURE__ */ u({
|
|
663
663
|
__name: "MediaCard",
|
|
664
664
|
props: {
|
|
665
665
|
advanceOnMediaEnd: { type: Boolean },
|
|
@@ -675,6 +675,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
675
675
|
layout: {},
|
|
676
676
|
loadedCount: {},
|
|
677
677
|
mediaIndex: {},
|
|
678
|
+
mediaCard: {},
|
|
678
679
|
mediaSource: {},
|
|
679
680
|
previewState: {},
|
|
680
681
|
total: {}
|
|
@@ -695,25 +696,25 @@ var ke = /* @__PURE__ */ u({
|
|
|
695
696
|
function ee(e) {
|
|
696
697
|
return e.detail === 0 ? "keyboard" : "pointer";
|
|
697
698
|
}
|
|
698
|
-
function
|
|
699
|
+
function G(e, t) {
|
|
699
700
|
let n = S.value.length, r = (e + n) % n;
|
|
700
701
|
r !== E.value && (v.value = e < E.value ? "previous" : "next", b("mediaChange", r), t && t.detail > 0 && t.currentTarget?.blur());
|
|
701
702
|
}
|
|
702
|
-
function
|
|
703
|
+
function te(e, t, n) {
|
|
703
704
|
return t === 1 ? e * 16 : t === 2 ? e * n : e;
|
|
704
705
|
}
|
|
705
706
|
function ne() {
|
|
706
707
|
d = 0, f = !1, u !== null && clearTimeout(u), u = null;
|
|
707
708
|
}
|
|
708
709
|
function K() {
|
|
709
|
-
u !== null && clearTimeout(u), u = setTimeout(ne,
|
|
710
|
+
u !== null && clearTimeout(u), u = setTimeout(ne, Xe);
|
|
710
711
|
}
|
|
711
712
|
function q(e) {
|
|
712
713
|
if (S.value.length <= 1) return;
|
|
713
|
-
let t = e.currentTarget?.clientWidth || 1, n =
|
|
714
|
-
if (n === 0 || (e.preventDefault(), K(), f) || (d += n, Math.abs(d) <
|
|
714
|
+
let t = e.currentTarget?.clientWidth || 1, n = te(e.deltaX, e.deltaMode, t);
|
|
715
|
+
if (n === 0 || (e.preventDefault(), K(), f) || (d += n, Math.abs(d) < Ze)) return;
|
|
715
716
|
let r = Math.sign(d);
|
|
716
|
-
d = 0, f = !0,
|
|
717
|
+
d = 0, f = !0, G(E.value + r);
|
|
717
718
|
}
|
|
718
719
|
function J(e) {
|
|
719
720
|
let t = e.touches[0];
|
|
@@ -723,9 +724,9 @@ var ke = /* @__PURE__ */ u({
|
|
|
723
724
|
let t = e.changedTouches[0];
|
|
724
725
|
if (p === null || h === null || !t) return;
|
|
725
726
|
let n = p - t.clientX, r = h - t.clientY;
|
|
726
|
-
p = null, h = null, !(Math.abs(n) <= Math.abs(r)) && (Math.abs(n) <
|
|
727
|
+
p = null, h = null, !(Math.abs(n) <= Math.abs(r)) && (Math.abs(n) < Ye || G(E.value + Math.sign(n)));
|
|
727
728
|
}
|
|
728
|
-
let X = n(() =>
|
|
729
|
+
let X = n(() => De(P.value));
|
|
729
730
|
function re(e) {
|
|
730
731
|
c.layout === "reel" && (e.stopPropagation(), ie());
|
|
731
732
|
}
|
|
@@ -778,7 +779,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
778
779
|
"media-card--entering": e.entering,
|
|
779
780
|
"media-card--leaving": e.leaving,
|
|
780
781
|
"media-card--error": e.previewState === "error",
|
|
781
|
-
"media-card--transparent-chrome": e.cardHeader?.background === "transparent" || e.cardFooter?.background === "transparent"
|
|
782
|
+
"media-card--transparent-chrome": e.mediaCard?.header?.background === "transparent" || e.mediaCard?.footer?.background === "transparent" || e.cardHeader?.background === "transparent" || e.cardFooter?.background === "transparent"
|
|
782
783
|
}]),
|
|
783
784
|
style: g(e.itemStyle),
|
|
784
785
|
"aria-hidden": e.leaving || void 0,
|
|
@@ -788,8 +789,8 @@ var ke = /* @__PURE__ */ u({
|
|
|
788
789
|
tabindex: e.interactive && !e.leaving && !W.value ? 0 : void 0,
|
|
789
790
|
onClick: r[11] ||= (t) => x(e.interactive && !W.value, ee(t)),
|
|
790
791
|
onKeydown: [r[12] ||= k((t) => x(e.interactive && !W.value, "keyboard"), ["enter"]), r[13] ||= k(A((t) => x(e.interactive && !W.value, "keyboard"), ["prevent"]), ["space"])]
|
|
791
|
-
}, [s("div",
|
|
792
|
-
e.cardHeader ? (y(), i(
|
|
792
|
+
}, [s("div", Re, [
|
|
793
|
+
e.cardHeader ? (y(), i(Oe, {
|
|
793
794
|
key: 0,
|
|
794
795
|
index: e.index,
|
|
795
796
|
item: e.item,
|
|
@@ -799,6 +800,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
799
800
|
"media-source": e.mediaSource,
|
|
800
801
|
placement: "header",
|
|
801
802
|
region: e.cardHeader,
|
|
803
|
+
style: g(e.mediaCard?.header),
|
|
802
804
|
total: e.total
|
|
803
805
|
}, null, 8, [
|
|
804
806
|
"index",
|
|
@@ -808,6 +810,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
808
810
|
"media-index",
|
|
809
811
|
"media-source",
|
|
810
812
|
"region",
|
|
813
|
+
"style",
|
|
811
814
|
"total"
|
|
812
815
|
])) : a("", !0),
|
|
813
816
|
s("div", {
|
|
@@ -822,13 +825,13 @@ var ke = /* @__PURE__ */ u({
|
|
|
822
825
|
key: `${e.item.postId}:${E.value}:${e.mediaSource ?? "preview"}`,
|
|
823
826
|
class: "media-card-frame",
|
|
824
827
|
"data-media-index": E.value
|
|
825
|
-
}, [e.previewState === "loading" ? (y(), o("div",
|
|
828
|
+
}, [e.previewState === "loading" ? (y(), o("div", Ve, [...r[14] ||= [s("span", { class: "media-loading-shimmer" }, null, -1)]])) : e.previewState === "error" ? (y(), o("div", {
|
|
826
829
|
key: 1,
|
|
827
830
|
"data-test": "media-error",
|
|
828
831
|
class: "media-error",
|
|
829
832
|
role: "img",
|
|
830
|
-
"aria-label": `${T(
|
|
831
|
-
}, [s("strong",
|
|
833
|
+
"aria-label": `${T(we)(P.value)} ${T(Te)(P.value)}`
|
|
834
|
+
}, [s("strong", Ue, w(T(we)(P.value)), 1), s("span", null, w(T(Te)(P.value)), 1)], 8, He)) : a("", !0), X.value ? (y(), o("video", {
|
|
832
835
|
key: 2,
|
|
833
836
|
ref_key: "videoElement",
|
|
834
837
|
ref: L,
|
|
@@ -853,7 +856,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
853
856
|
onEnded: se,
|
|
854
857
|
onClick: re,
|
|
855
858
|
onError: r[2] ||= (e) => n.$emit("error", E.value)
|
|
856
|
-
}, null, 42,
|
|
859
|
+
}, null, 42, We)) : (y(), o("img", {
|
|
857
860
|
key: 3,
|
|
858
861
|
class: m(["media-preview", { "media-preview--ready": e.previewState === "ready" }]),
|
|
859
862
|
src: P.value,
|
|
@@ -865,10 +868,10 @@ var ke = /* @__PURE__ */ u({
|
|
|
865
868
|
loading: "eager",
|
|
866
869
|
onLoad: r[3] ||= (e) => n.$emit("ready", E.value),
|
|
867
870
|
onError: r[4] ||= (e) => n.$emit("error", E.value)
|
|
868
|
-
}, null, 42,
|
|
871
|
+
}, null, 42, Ge))], 8, Be))]),
|
|
869
872
|
_: 1
|
|
870
873
|
}, 8, ["name"]),
|
|
871
|
-
X.value && e.previewState === "ready" ? (y(), i(
|
|
874
|
+
X.value && e.previewState === "ready" ? (y(), i(Ie, {
|
|
872
875
|
key: 0,
|
|
873
876
|
"current-time": R.value,
|
|
874
877
|
duration: z.value,
|
|
@@ -896,15 +899,15 @@ var ke = /* @__PURE__ */ u({
|
|
|
896
899
|
type: "button",
|
|
897
900
|
class: "media-carousel-control media-carousel-control--previous",
|
|
898
901
|
"aria-label": `Previous media for post ${e.item.postId}`,
|
|
899
|
-
onClick: r[5] ||= A((e) =>
|
|
902
|
+
onClick: r[5] ||= A((e) => G(E.value - 1, e), ["stop"]),
|
|
900
903
|
onKeydown: r[6] ||= A(() => {}, ["stop"])
|
|
901
|
-
}, [l(T(
|
|
904
|
+
}, [l(T(_e), { size: 20 })], 40, Ke), s("button", {
|
|
902
905
|
type: "button",
|
|
903
906
|
class: "media-carousel-control media-carousel-control--next",
|
|
904
907
|
"aria-label": `Next media for post ${e.item.postId}`,
|
|
905
|
-
onClick: r[7] ||= A((e) =>
|
|
908
|
+
onClick: r[7] ||= A((e) => G(E.value + 1, e), ["stop"]),
|
|
906
909
|
onKeydown: r[8] ||= A(() => {}, ["stop"])
|
|
907
|
-
}, [l(T(
|
|
910
|
+
}, [l(T(ve), { size: 20 })], 40, qe)], 2)) : a("", !0),
|
|
908
911
|
W.value ? (y(), o("button", {
|
|
909
912
|
key: 2,
|
|
910
913
|
class: "media-card-activator",
|
|
@@ -912,9 +915,9 @@ var ke = /* @__PURE__ */ u({
|
|
|
912
915
|
"aria-label": `Open post ${e.item.postId}`,
|
|
913
916
|
onClick: r[9] ||= A((e) => n.$emit("activate", ee(e)), ["stop"]),
|
|
914
917
|
onKeydown: r[10] ||= A(() => {}, ["stop"])
|
|
915
|
-
}, null, 40,
|
|
916
|
-
], 42,
|
|
917
|
-
e.cardFooter ? (y(), i(
|
|
918
|
+
}, null, 40, Je)) : a("", !0)
|
|
919
|
+
], 42, ze),
|
|
920
|
+
e.cardFooter ? (y(), i(Oe, {
|
|
918
921
|
key: 1,
|
|
919
922
|
index: e.index,
|
|
920
923
|
item: e.item,
|
|
@@ -924,6 +927,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
924
927
|
"media-source": e.mediaSource,
|
|
925
928
|
placement: "footer",
|
|
926
929
|
region: e.cardFooter,
|
|
930
|
+
style: g(e.mediaCard?.footer),
|
|
927
931
|
total: e.total
|
|
928
932
|
}, null, 8, [
|
|
929
933
|
"index",
|
|
@@ -933,11 +937,12 @@ var ke = /* @__PURE__ */ u({
|
|
|
933
937
|
"media-index",
|
|
934
938
|
"media-source",
|
|
935
939
|
"region",
|
|
940
|
+
"style",
|
|
936
941
|
"total"
|
|
937
942
|
])) : a("", !0)
|
|
938
|
-
])], 46,
|
|
943
|
+
])], 46, Le));
|
|
939
944
|
}
|
|
940
|
-
}),
|
|
945
|
+
}), $e = { class: "masonry-feed-shell" }, et = ["aria-hidden", "inert"], tt = 240, nt = 6, rt = 12, it = 800, at = 1.5, ot = /* @__PURE__ */ u({
|
|
941
946
|
__name: "MasonryFeed",
|
|
942
947
|
props: {
|
|
943
948
|
enteringPostIds: {},
|
|
@@ -955,6 +960,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
955
960
|
isLoadingMore: { type: Boolean },
|
|
956
961
|
items: {},
|
|
957
962
|
loadMoreLocked: { type: Boolean },
|
|
963
|
+
mediaCard: {},
|
|
958
964
|
mediaIndices: {},
|
|
959
965
|
nextPageError: { type: Boolean },
|
|
960
966
|
previewStates: {},
|
|
@@ -970,36 +976,36 @@ var ke = /* @__PURE__ */ u({
|
|
|
970
976
|
"retryEnd"
|
|
971
977
|
],
|
|
972
978
|
setup(t, { expose: r, emit: a }) {
|
|
973
|
-
let c = t, u = a, d = C(null), f = `vibe-masonry-${E()}`, p = C(null), h = C(0), v = C(
|
|
979
|
+
let c = t, u = a, d = C(null), f = `vibe-masonry-${E()}`, p = C(null), h = C(0), v = C(nt), b = C(0), S = C(0), w = C(0), O = null, k = null, A = null, j = n(() => J(c.items, h.value, {
|
|
974
980
|
additionalHeight: (c.cardHeader?.height ?? 0) + (c.cardFooter?.height ?? 0),
|
|
975
981
|
gap: v.value,
|
|
976
|
-
minColumnWidth:
|
|
982
|
+
minColumnWidth: tt
|
|
977
983
|
})), M = n(() => {
|
|
978
984
|
let e = j.value;
|
|
979
985
|
if (c.leavingPostIds.size === 0) return e;
|
|
980
|
-
let t = c.items.filter((e) => !c.leavingPostIds.has(e.postId)), n =
|
|
986
|
+
let t = c.items.filter((e) => !c.leavingPostIds.has(e.postId)), n = J(t, h.value, {
|
|
981
987
|
additionalHeight: (c.cardHeader?.height ?? 0) + (c.cardFooter?.height ?? 0),
|
|
982
988
|
gap: v.value,
|
|
983
|
-
minColumnWidth:
|
|
989
|
+
minColumnWidth: tt
|
|
984
990
|
}), r = new Map(t.map((e, t) => [e.postId, n.items[t]]));
|
|
985
991
|
return {
|
|
986
992
|
...n,
|
|
987
993
|
items: c.items.map((t, n) => c.leavingPostIds.has(t.postId) ? e.items[n] : r.get(t.postId) ?? e.items[n])
|
|
988
994
|
};
|
|
989
995
|
}), N = n(() => ({ height: `${c.leavingPostIds.size === 0 ? M.value.height : j.value.height}px` })), F = n(() => {
|
|
990
|
-
let e = Math.max(
|
|
996
|
+
let e = Math.max(it, S.value * at), t = {
|
|
991
997
|
scrollTop: b.value - w.value,
|
|
992
998
|
viewportHeight: S.value
|
|
993
|
-
}, n =
|
|
999
|
+
}, n = q(M.value.items, {
|
|
994
1000
|
...t,
|
|
995
1001
|
overscan: e
|
|
996
|
-
}), r = c.leavingPostIds.size === 0 ? [] :
|
|
1002
|
+
}), r = c.leavingPostIds.size === 0 ? [] : q(j.value.items, {
|
|
997
1003
|
...t,
|
|
998
1004
|
overscan: e
|
|
999
|
-
}), i = [...new Set([...n, ...r])].sort((e, t) => e - t), a =
|
|
1005
|
+
}), i = [...new Set([...n, ...r])].sort((e, t) => e - t), a = q(M.value.items, {
|
|
1000
1006
|
...t,
|
|
1001
1007
|
overscan: 0
|
|
1002
|
-
}), o = c.leavingPostIds.size === 0 ? [] :
|
|
1008
|
+
}), o = c.leavingPostIds.size === 0 ? [] : q(j.value.items, {
|
|
1003
1009
|
...t,
|
|
1004
1010
|
overscan: 0
|
|
1005
1011
|
}), s = new Set([...a, ...o]);
|
|
@@ -1015,7 +1021,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
1015
1021
|
function I(e) {
|
|
1016
1022
|
let t = M.value.items[e], n = c.items[e]?.postId;
|
|
1017
1023
|
if (!t) return {};
|
|
1018
|
-
let r = n !== void 0 && c.enteringPostIds.has(n), i = n !== void 0 && c.leavingPostIds.has(n), a = r || i ?
|
|
1024
|
+
let r = n !== void 0 && c.enteringPostIds.has(n), i = n !== void 0 && c.leavingPostIds.has(n), a = r || i ? K({
|
|
1019
1025
|
containerHeight: j.value.height,
|
|
1020
1026
|
gap: v.value
|
|
1021
1027
|
}) : 0, o = n === void 0 ? 0 : i ? c.removalDelays.get(n) ?? 0 : r ? c.entryDelays.get(n) ?? 0 : 0;
|
|
@@ -1035,7 +1041,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
1035
1041
|
}
|
|
1036
1042
|
function R(e) {
|
|
1037
1043
|
let t = e.ownerDocument.documentElement.clientWidth;
|
|
1038
|
-
h.value = e.clientWidth, v.value = Math.min(
|
|
1044
|
+
h.value = e.clientWidth, v.value = Math.min(rt, Math.max(nt, t * .0075)), L();
|
|
1039
1045
|
}
|
|
1040
1046
|
function z(e) {
|
|
1041
1047
|
let t = e.currentTarget;
|
|
@@ -1062,7 +1068,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
1062
1068
|
}), r({
|
|
1063
1069
|
getScrollElement: V,
|
|
1064
1070
|
loadIfNearBottom: B
|
|
1065
|
-
}), (n, r) => (y(), o("div",
|
|
1071
|
+
}), (n, r) => (y(), o("div", $e, [s("main", {
|
|
1066
1072
|
id: f,
|
|
1067
1073
|
ref_key: "galleryElement",
|
|
1068
1074
|
ref: d,
|
|
@@ -1077,7 +1083,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
1077
1083
|
class: m(["masonry", { "masonry--ready": h.value > 0 }]),
|
|
1078
1084
|
style: g(N.value),
|
|
1079
1085
|
"aria-label": "Media gallery"
|
|
1080
|
-
}, [(y(!0), o(e, null, x(F.value, ({ fetchPriority: e, item: n, index: r }) => (y(), i(
|
|
1086
|
+
}, [(y(!0), o(e, null, x(F.value, ({ fetchPriority: e, item: n, index: r }) => (y(), i(Qe, {
|
|
1081
1087
|
key: n.postId,
|
|
1082
1088
|
class: "masonry-item",
|
|
1083
1089
|
entering: t.enteringPostIds.has(n.postId),
|
|
@@ -1085,6 +1091,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
1085
1091
|
"fetch-priority": e,
|
|
1086
1092
|
"card-footer": t.cardFooter,
|
|
1087
1093
|
"card-header": t.cardHeader,
|
|
1094
|
+
"media-card": t.mediaCard,
|
|
1088
1095
|
index: r,
|
|
1089
1096
|
item: n,
|
|
1090
1097
|
"item-style": I(r),
|
|
@@ -1104,6 +1111,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
1104
1111
|
"fetch-priority",
|
|
1105
1112
|
"card-footer",
|
|
1106
1113
|
"card-header",
|
|
1114
|
+
"media-card",
|
|
1107
1115
|
"index",
|
|
1108
1116
|
"item",
|
|
1109
1117
|
"item-style",
|
|
@@ -1115,13 +1123,12 @@ var ke = /* @__PURE__ */ u({
|
|
|
1115
1123
|
"onMediaChange",
|
|
1116
1124
|
"onReady",
|
|
1117
1125
|
"onError"
|
|
1118
|
-
]))), 128))], 6), l(
|
|
1126
|
+
]))), 128))], 6), l(H, {
|
|
1119
1127
|
actions: t.feedFooterActions,
|
|
1120
1128
|
"can-retry-end": t.canRetryEnd,
|
|
1121
1129
|
"feed-footer": t.feedFooter,
|
|
1122
1130
|
"has-error": t.nextPageError,
|
|
1123
1131
|
"has-next": t.hasNext,
|
|
1124
|
-
"infinite-scroll": t.infiniteScroll,
|
|
1125
1132
|
"is-loading": t.isLoadingMore,
|
|
1126
1133
|
"load-more-locked": t.loadMoreLocked,
|
|
1127
1134
|
state: t.state,
|
|
@@ -1133,11 +1140,10 @@ var ke = /* @__PURE__ */ u({
|
|
|
1133
1140
|
"feed-footer",
|
|
1134
1141
|
"has-error",
|
|
1135
1142
|
"has-next",
|
|
1136
|
-
"infinite-scroll",
|
|
1137
1143
|
"is-loading",
|
|
1138
1144
|
"load-more-locked",
|
|
1139
1145
|
"state"
|
|
1140
|
-
])], 42,
|
|
1146
|
+
])], 42, et), l(se, {
|
|
1141
1147
|
"content-size": M.value.height,
|
|
1142
1148
|
"controls-id": f,
|
|
1143
1149
|
"scroll-element": d.value,
|
|
@@ -1148,7 +1154,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
1148
1154
|
"suspended"
|
|
1149
1155
|
])]));
|
|
1150
1156
|
}
|
|
1151
|
-
}),
|
|
1157
|
+
}), st = ["aria-label"], ct = /* @__PURE__ */ u({
|
|
1152
1158
|
__name: "ReelAutoAdvanceProgress",
|
|
1153
1159
|
props: {
|
|
1154
1160
|
durationMs: {},
|
|
@@ -1166,9 +1172,9 @@ var ke = /* @__PURE__ */ u({
|
|
|
1166
1172
|
class: "reel-auto-advance-progress",
|
|
1167
1173
|
style: g(a.value),
|
|
1168
1174
|
onAnimationend: n[0] ||= (e) => i("complete")
|
|
1169
|
-
}, null, 36)], 8,
|
|
1175
|
+
}, null, 36)], 8, st));
|
|
1170
1176
|
}
|
|
1171
|
-
}),
|
|
1177
|
+
}), lt = ["data-active-post-id", "data-active-media-index"], ut = 2, dt = /* @__PURE__ */ u({
|
|
1172
1178
|
__name: "ReelFeed",
|
|
1173
1179
|
props: {
|
|
1174
1180
|
initialPostId: {},
|
|
@@ -1184,6 +1190,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
1184
1190
|
isLoadingMore: { type: Boolean },
|
|
1185
1191
|
items: {},
|
|
1186
1192
|
loadMoreLocked: { type: Boolean },
|
|
1193
|
+
mediaCard: {},
|
|
1187
1194
|
mediaIndices: {},
|
|
1188
1195
|
nextPageError: { type: Boolean },
|
|
1189
1196
|
previewStates: {},
|
|
@@ -1200,7 +1207,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
1200
1207
|
],
|
|
1201
1208
|
setup(t, { expose: r, emit: c }) {
|
|
1202
1209
|
let u = t, d = c, f = C(null), h = u.initialPostId === null || u.initialPostId === void 0 ? -1 : u.items.findIndex((e) => e.postId === u.initialPostId), b = C(Math.max(0, h)), S = C(!1), w = 0, E = null, O = null, k = null, A = n(() => ({ gridTemplateRows: `repeat(${u.items.length}, 100cqh)` })), M = n(() => {
|
|
1203
|
-
let e = Math.max(0, b.value -
|
|
1210
|
+
let e = Math.max(0, b.value - ut), t = Math.min(u.items.length - 1, b.value + ut);
|
|
1204
1211
|
return u.items.slice(e, t + 1).map((t, n) => ({
|
|
1205
1212
|
fetchPriority: e + n === b.value ? "high" : "low",
|
|
1206
1213
|
index: e + n,
|
|
@@ -1217,7 +1224,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
1217
1224
|
if (!e) return "";
|
|
1218
1225
|
let t = N(e, L.value);
|
|
1219
1226
|
return u.mediaSource === "original" ? t.src : t.preview.src;
|
|
1220
|
-
}), B = n(() => R.value === "ready" &&
|
|
1227
|
+
}), B = n(() => R.value === "ready" && De(z.value)), V = n(() => [
|
|
1221
1228
|
F.value,
|
|
1222
1229
|
L.value,
|
|
1223
1230
|
u.items.length,
|
|
@@ -1225,7 +1232,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
1225
1232
|
u.reelAutoAdvance.enabled,
|
|
1226
1233
|
u.reelAutoAdvance.includePostItems,
|
|
1227
1234
|
u.reelAutoAdvance.intervalMs
|
|
1228
|
-
].join(":")),
|
|
1235
|
+
].join(":")), U = n(() => {
|
|
1229
1236
|
let e = I.value, t = !!(e && u.reelAutoAdvance.includePostItems && L.value < j(e).length - 1), n = u.reelAutoAdvance.intervalMs / 1e3;
|
|
1230
1237
|
return `Auto advance to the next ${t ? "post item" : "post"} in ${n}s`;
|
|
1231
1238
|
}), W = n(() => u.reelAutoAdvance.enabled && I.value !== void 0 && R.value !== "loading" && !B.value);
|
|
@@ -1334,7 +1341,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
1334
1341
|
}]),
|
|
1335
1342
|
"data-layout-mode": "reel"
|
|
1336
1343
|
}, [
|
|
1337
|
-
t.cardHeader && I.value ? (y(), i(
|
|
1344
|
+
t.cardHeader && I.value ? (y(), i(Oe, {
|
|
1338
1345
|
key: 0,
|
|
1339
1346
|
index: b.value,
|
|
1340
1347
|
item: I.value,
|
|
@@ -1344,6 +1351,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
1344
1351
|
"media-source": t.mediaSource,
|
|
1345
1352
|
placement: "header",
|
|
1346
1353
|
region: t.cardHeader,
|
|
1354
|
+
style: g(t.mediaCard?.header),
|
|
1347
1355
|
total: t.total
|
|
1348
1356
|
}, null, 8, [
|
|
1349
1357
|
"index",
|
|
@@ -1352,6 +1360,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
1352
1360
|
"media-index",
|
|
1353
1361
|
"media-source",
|
|
1354
1362
|
"region",
|
|
1363
|
+
"style",
|
|
1355
1364
|
"total"
|
|
1356
1365
|
])) : a("", !0),
|
|
1357
1366
|
s("div", {
|
|
@@ -1365,7 +1374,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
1365
1374
|
class: "reel-track",
|
|
1366
1375
|
style: g(A.value),
|
|
1367
1376
|
"aria-label": "Media gallery"
|
|
1368
|
-
}, [(y(!0), o(e, null, x(M.value, ({ fetchPriority: e, item: n, index: r }) => (y(), i(
|
|
1377
|
+
}, [(y(!0), o(e, null, x(M.value, ({ fetchPriority: e, item: n, index: r }) => (y(), i(Qe, {
|
|
1369
1378
|
key: n.postId,
|
|
1370
1379
|
"advance-on-media-end": u.reelAutoAdvance.enabled && r === b.value,
|
|
1371
1380
|
class: "reel-item",
|
|
@@ -1374,6 +1383,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
1374
1383
|
index: r,
|
|
1375
1384
|
item: n,
|
|
1376
1385
|
"item-style": ee(r),
|
|
1386
|
+
"media-card": t.mediaCard,
|
|
1377
1387
|
layout: "reel",
|
|
1378
1388
|
"loaded-count": t.items.length,
|
|
1379
1389
|
"media-index": t.mediaIndices.get(n.postId) ?? 0,
|
|
@@ -1390,6 +1400,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
1390
1400
|
"index",
|
|
1391
1401
|
"item",
|
|
1392
1402
|
"item-style",
|
|
1403
|
+
"media-card",
|
|
1393
1404
|
"loaded-count",
|
|
1394
1405
|
"media-index",
|
|
1395
1406
|
"media-source",
|
|
@@ -1399,13 +1410,12 @@ var ke = /* @__PURE__ */ u({
|
|
|
1399
1410
|
"onEnded",
|
|
1400
1411
|
"onReady",
|
|
1401
1412
|
"onError"
|
|
1402
|
-
]))), 128))], 4), l(
|
|
1413
|
+
]))), 128))], 4), l(H, {
|
|
1403
1414
|
actions: t.feedFooterActions,
|
|
1404
1415
|
"can-retry-end": t.canRetryEnd,
|
|
1405
1416
|
"feed-footer": t.feedFooter,
|
|
1406
1417
|
"has-error": t.nextPageError,
|
|
1407
1418
|
"has-next": t.hasNext,
|
|
1408
|
-
"infinite-scroll": t.infiniteScroll,
|
|
1409
1419
|
"is-loading": t.isLoadingMore,
|
|
1410
1420
|
"load-more-locked": t.loadMoreLocked,
|
|
1411
1421
|
state: t.state,
|
|
@@ -1417,12 +1427,11 @@ var ke = /* @__PURE__ */ u({
|
|
|
1417
1427
|
"feed-footer",
|
|
1418
1428
|
"has-error",
|
|
1419
1429
|
"has-next",
|
|
1420
|
-
"infinite-scroll",
|
|
1421
1430
|
"is-loading",
|
|
1422
1431
|
"load-more-locked",
|
|
1423
1432
|
"state"
|
|
1424
|
-
])], 40,
|
|
1425
|
-
t.cardFooter && I.value ? (y(), i(
|
|
1433
|
+
])], 40, lt),
|
|
1434
|
+
t.cardFooter && I.value ? (y(), i(Oe, {
|
|
1426
1435
|
key: 1,
|
|
1427
1436
|
index: b.value,
|
|
1428
1437
|
item: I.value,
|
|
@@ -1432,6 +1441,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
1432
1441
|
"media-source": t.mediaSource,
|
|
1433
1442
|
placement: "footer",
|
|
1434
1443
|
region: t.cardFooter,
|
|
1444
|
+
style: g(t.mediaCard?.footer),
|
|
1435
1445
|
total: t.total
|
|
1436
1446
|
}, null, 8, [
|
|
1437
1447
|
"index",
|
|
@@ -1440,26 +1450,27 @@ var ke = /* @__PURE__ */ u({
|
|
|
1440
1450
|
"media-index",
|
|
1441
1451
|
"media-source",
|
|
1442
1452
|
"region",
|
|
1453
|
+
"style",
|
|
1443
1454
|
"total"
|
|
1444
1455
|
])) : a("", !0),
|
|
1445
|
-
W.value ? (y(), i(
|
|
1456
|
+
W.value ? (y(), i(ct, {
|
|
1446
1457
|
key: V.value,
|
|
1447
1458
|
"duration-ms": t.reelAutoAdvance.intervalMs,
|
|
1448
|
-
label:
|
|
1459
|
+
label: U.value,
|
|
1449
1460
|
onComplete: oe
|
|
1450
1461
|
}, null, 8, ["duration-ms", "label"])) : a("", !0)
|
|
1451
1462
|
], 2));
|
|
1452
1463
|
}
|
|
1453
|
-
}),
|
|
1464
|
+
}), ft = ["data-info-sheet-open", "data-info-sheet-mode"], pt = ["aria-hidden", "inert"], mt = {
|
|
1454
1465
|
key: 0,
|
|
1455
1466
|
class: "reel-info-sheet-layer",
|
|
1456
1467
|
"data-test": "reel-info-sheet"
|
|
1457
|
-
},
|
|
1468
|
+
}, ht = [
|
|
1458
1469
|
"role",
|
|
1459
1470
|
"aria-modal",
|
|
1460
1471
|
"tabindex",
|
|
1461
1472
|
"data-active-post-id"
|
|
1462
|
-
],
|
|
1473
|
+
], gt = /* @__PURE__ */ u({
|
|
1463
1474
|
__name: "ReelLayout",
|
|
1464
1475
|
props: {
|
|
1465
1476
|
infoSheet: {},
|
|
@@ -1479,6 +1490,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
1479
1490
|
isLoadingMore: { type: Boolean },
|
|
1480
1491
|
items: {},
|
|
1481
1492
|
loadMoreLocked: { type: Boolean },
|
|
1493
|
+
mediaCard: {},
|
|
1482
1494
|
mediaIndices: {},
|
|
1483
1495
|
nextPageError: { type: Boolean },
|
|
1484
1496
|
previewStates: {},
|
|
@@ -1564,7 +1576,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
1564
1576
|
class: "reel-layout-main",
|
|
1565
1577
|
"aria-hidden": e.infoSheetOverlay && E.value || void 0,
|
|
1566
1578
|
inert: e.infoSheetOverlay && E.value || void 0
|
|
1567
|
-
}, [l(
|
|
1579
|
+
}, [l(dt, {
|
|
1568
1580
|
ref_key: "reelFeed",
|
|
1569
1581
|
ref: g,
|
|
1570
1582
|
"can-retry-end": e.canRetryEnd,
|
|
@@ -1572,6 +1584,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
1572
1584
|
"card-header": e.cardHeader,
|
|
1573
1585
|
"feed-footer": e.feedFooter,
|
|
1574
1586
|
"feed-footer-actions": e.feedFooterActions,
|
|
1587
|
+
"media-card": e.mediaCard,
|
|
1575
1588
|
"has-next": e.hasNext,
|
|
1576
1589
|
"infinite-scroll": e.infiniteScroll,
|
|
1577
1590
|
"initial-post-id": e.initialPostId,
|
|
@@ -1597,6 +1610,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
1597
1610
|
"card-header",
|
|
1598
1611
|
"feed-footer",
|
|
1599
1612
|
"feed-footer-actions",
|
|
1613
|
+
"media-card",
|
|
1600
1614
|
"has-next",
|
|
1601
1615
|
"infinite-scroll",
|
|
1602
1616
|
"initial-post-id",
|
|
@@ -1610,8 +1624,8 @@ var ke = /* @__PURE__ */ u({
|
|
|
1610
1624
|
"reel-auto-advance",
|
|
1611
1625
|
"state",
|
|
1612
1626
|
"total"
|
|
1613
|
-
])], 8,
|
|
1614
|
-
default: O(() => [E.value && e.infoSheet && k.value ? (y(), o("div",
|
|
1627
|
+
])], 8, pt), l(t, { name: "vibe-info-sheet" }, {
|
|
1628
|
+
default: O(() => [E.value && e.infoSheet && k.value ? (y(), o("div", mt, [s("aside", {
|
|
1615
1629
|
ref_key: "sheetElement",
|
|
1616
1630
|
ref: v,
|
|
1617
1631
|
class: "reel-info-sheet",
|
|
@@ -1620,11 +1634,11 @@ var ke = /* @__PURE__ */ u({
|
|
|
1620
1634
|
"aria-modal": e.infoSheetOverlay ? "true" : void 0,
|
|
1621
1635
|
tabindex: e.infoSheetOverlay ? -1 : void 0,
|
|
1622
1636
|
"data-active-post-id": w.value?.postId
|
|
1623
|
-
}, [(y(), i(S(e.infoSheet.component), h(d(k.value)), null, 16))], 8,
|
|
1637
|
+
}, [(y(), i(S(e.infoSheet.component), h(d(k.value)), null, 16))], 8, ht)])) : a("", !0)]),
|
|
1624
1638
|
_: 1
|
|
1625
|
-
})], 10,
|
|
1639
|
+
})], 10, ft));
|
|
1626
1640
|
}
|
|
1627
|
-
}),
|
|
1641
|
+
}), _t = 35, vt = 420, yt = /* @__PURE__ */ u({
|
|
1628
1642
|
__name: "VibeSurface",
|
|
1629
1643
|
props: {
|
|
1630
1644
|
canRetryEnd: { type: Boolean },
|
|
@@ -1632,6 +1646,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
1632
1646
|
cardHeader: {},
|
|
1633
1647
|
feedFooter: {},
|
|
1634
1648
|
feedFooterActions: {},
|
|
1649
|
+
mediaCard: {},
|
|
1635
1650
|
reelInfoSheet: {},
|
|
1636
1651
|
state: {}
|
|
1637
1652
|
},
|
|
@@ -1659,28 +1674,28 @@ var ke = /* @__PURE__ */ u({
|
|
|
1659
1674
|
let r = P(e, t);
|
|
1660
1675
|
j.value.get(r) !== n && (j.value = new Map(j.value).set(r, n));
|
|
1661
1676
|
}
|
|
1662
|
-
function
|
|
1677
|
+
function G(e, t, n) {
|
|
1663
1678
|
let r = P(e, t);
|
|
1664
1679
|
N.value.get(r) !== n && (N.value = new Map(N.value).set(r, n));
|
|
1665
1680
|
}
|
|
1666
|
-
function
|
|
1681
|
+
function te(e, t) {
|
|
1667
1682
|
W(e, t, "error");
|
|
1668
1683
|
}
|
|
1669
1684
|
function ne(e, t) {
|
|
1670
1685
|
W(e, t, "ready");
|
|
1671
1686
|
}
|
|
1672
1687
|
function K(e, t) {
|
|
1673
|
-
|
|
1688
|
+
G(e, t, "error");
|
|
1674
1689
|
}
|
|
1675
1690
|
function q(e, t) {
|
|
1676
|
-
|
|
1691
|
+
G(e, t, "ready");
|
|
1677
1692
|
}
|
|
1678
1693
|
function J(e, t) {
|
|
1679
1694
|
if (u.state.reelMediaSource === "original") {
|
|
1680
1695
|
K(e, t);
|
|
1681
1696
|
return;
|
|
1682
1697
|
}
|
|
1683
|
-
|
|
1698
|
+
te(e, t);
|
|
1684
1699
|
}
|
|
1685
1700
|
function Y(e, t) {
|
|
1686
1701
|
if (u.state.reelMediaSource === "original") {
|
|
@@ -1720,8 +1735,8 @@ var ke = /* @__PURE__ */ u({
|
|
|
1720
1735
|
if (n.length === 0) return 0;
|
|
1721
1736
|
let r = new Map(k.value);
|
|
1722
1737
|
return n.forEach((e, t) => {
|
|
1723
|
-
r.set(e, t *
|
|
1724
|
-
}), w.value = new Set([...w.value].filter((e) => !n.includes(e))), E.value = new Set([...E.value, ...t]), k.value = r,
|
|
1738
|
+
r.set(e, t * _t);
|
|
1739
|
+
}), w.value = new Set([...w.value].filter((e) => !n.includes(e))), E.value = new Set([...E.value, ...t]), k.value = r, vt + (n.length - 1) * _t;
|
|
1725
1740
|
}
|
|
1726
1741
|
function le(e, t) {
|
|
1727
1742
|
let n = se(e), r = n?.querySelector(".media-card-activator") ?? n;
|
|
@@ -1777,7 +1792,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
1777
1792
|
let t = T.value.get(e);
|
|
1778
1793
|
t !== void 0 && r.set(e, t);
|
|
1779
1794
|
}), t.forEach((e, t) => {
|
|
1780
|
-
r.set(e, t *
|
|
1795
|
+
r.set(e, t * _t);
|
|
1781
1796
|
}), T.value = r, w.value = new Set([...w.value, ...t]), U();
|
|
1782
1797
|
}, { flush: "sync" }), v(() => window.addEventListener("keydown", pe)), _(() => {
|
|
1783
1798
|
window.removeEventListener("keydown", pe), z !== null && cancelAnimationFrame(z);
|
|
@@ -1791,7 +1806,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
1791
1806
|
ref_key: "surfaceElement",
|
|
1792
1807
|
ref: b,
|
|
1793
1808
|
class: "vibe-surface"
|
|
1794
|
-
}, [r.state.error || r.state.isLoading || r.state.items.length === 0 ? (y(), i(
|
|
1809
|
+
}, [r.state.error || r.state.isLoading || r.state.items.length === 0 ? (y(), i(ee, {
|
|
1795
1810
|
key: 0,
|
|
1796
1811
|
actions: r.feedFooterActions,
|
|
1797
1812
|
"can-retry-end": r.canRetryEnd,
|
|
@@ -1804,7 +1819,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
1804
1819
|
"can-retry-end",
|
|
1805
1820
|
"feed-footer",
|
|
1806
1821
|
"state"
|
|
1807
|
-
])) : r.state.layout === "reel" ? (y(), i(
|
|
1822
|
+
])) : r.state.layout === "reel" ? (y(), i(gt, {
|
|
1808
1823
|
key: 1,
|
|
1809
1824
|
ref_key: "reelRenderer",
|
|
1810
1825
|
ref: m,
|
|
@@ -1814,6 +1829,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
1814
1829
|
"card-header": r.cardHeader,
|
|
1815
1830
|
"feed-footer": r.feedFooter,
|
|
1816
1831
|
"feed-footer-actions": r.feedFooterActions,
|
|
1832
|
+
"media-card": r.mediaCard,
|
|
1817
1833
|
"infinite-scroll": r.state.infiniteScroll,
|
|
1818
1834
|
"is-loading-more": r.state.isLoadingMore,
|
|
1819
1835
|
items: r.state.items,
|
|
@@ -1844,6 +1860,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
1844
1860
|
"card-header",
|
|
1845
1861
|
"feed-footer",
|
|
1846
1862
|
"feed-footer-actions",
|
|
1863
|
+
"media-card",
|
|
1847
1864
|
"infinite-scroll",
|
|
1848
1865
|
"is-loading-more",
|
|
1849
1866
|
"items",
|
|
@@ -1859,7 +1876,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
1859
1876
|
"reel-auto-advance",
|
|
1860
1877
|
"state",
|
|
1861
1878
|
"total"
|
|
1862
|
-
])) : (y(), o(e, { key: 2 }, [l(
|
|
1879
|
+
])) : (y(), o(e, { key: 2 }, [l(ot, {
|
|
1863
1880
|
ref_key: "masonryRenderer",
|
|
1864
1881
|
ref: f,
|
|
1865
1882
|
"can-retry-end": r.canRetryEnd,
|
|
@@ -1871,6 +1888,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
1871
1888
|
"card-header": r.cardHeader,
|
|
1872
1889
|
"feed-footer": r.feedFooter,
|
|
1873
1890
|
"feed-footer-actions": r.feedFooterActions,
|
|
1891
|
+
"media-card": r.mediaCard,
|
|
1874
1892
|
"has-next": r.state.next !== null,
|
|
1875
1893
|
"infinite-scroll": r.state.infiniteScroll,
|
|
1876
1894
|
"is-loading-more": r.state.isLoadingMore,
|
|
@@ -1883,7 +1901,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
1883
1901
|
state: I.value,
|
|
1884
1902
|
total: r.state.total,
|
|
1885
1903
|
onActivate: oe,
|
|
1886
|
-
onError:
|
|
1904
|
+
onError: te,
|
|
1887
1905
|
onLoadMore: s[6] ||= (e) => d("loadMore"),
|
|
1888
1906
|
onMediaChange: X,
|
|
1889
1907
|
onReady: ne,
|
|
@@ -1898,6 +1916,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
1898
1916
|
"card-header",
|
|
1899
1917
|
"feed-footer",
|
|
1900
1918
|
"feed-footer-actions",
|
|
1919
|
+
"media-card",
|
|
1901
1920
|
"has-next",
|
|
1902
1921
|
"infinite-scroll",
|
|
1903
1922
|
"is-loading-more",
|
|
@@ -1923,7 +1942,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
1923
1942
|
"aria-modal": "true",
|
|
1924
1943
|
tabindex: "-1",
|
|
1925
1944
|
style: g(x.value)
|
|
1926
|
-
}, [l(
|
|
1945
|
+
}, [l(gt, {
|
|
1927
1946
|
ref_key: "reelRenderer",
|
|
1928
1947
|
ref: m,
|
|
1929
1948
|
"can-retry-end": r.canRetryEnd,
|
|
@@ -1931,6 +1950,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
1931
1950
|
"card-header": r.cardHeader,
|
|
1932
1951
|
"feed-footer": r.feedFooter,
|
|
1933
1952
|
"feed-footer-actions": r.feedFooterActions,
|
|
1953
|
+
"media-card": r.mediaCard,
|
|
1934
1954
|
"has-next": r.state.next !== null,
|
|
1935
1955
|
"infinite-scroll": r.state.infiniteScroll,
|
|
1936
1956
|
"initial-post-id": r.state.activeReelPostId,
|
|
@@ -1961,6 +1981,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
1961
1981
|
"card-header",
|
|
1962
1982
|
"feed-footer",
|
|
1963
1983
|
"feed-footer-actions",
|
|
1984
|
+
"media-card",
|
|
1964
1985
|
"has-next",
|
|
1965
1986
|
"infinite-scroll",
|
|
1966
1987
|
"initial-post-id",
|
|
@@ -1983,7 +2004,7 @@ var ke = /* @__PURE__ */ u({
|
|
|
1983
2004
|
});
|
|
1984
2005
|
//#endregion
|
|
1985
2006
|
//#region src/core/page.ts
|
|
1986
|
-
function
|
|
2007
|
+
function bt(e) {
|
|
1987
2008
|
if (!e || typeof e != "object" || !Array.isArray(e.items)) throw TypeError("Vibe loadPage must resolve to a page with an items array.");
|
|
1988
2009
|
if (e.next !== null && typeof e.next != "string" && typeof e.next != "number") throw TypeError("Vibe page next must be a string, number, or null.");
|
|
1989
2010
|
if (e.total !== void 0 && (!Number.isFinite(e.total) || e.total < 0)) throw TypeError("Vibe page total must be a non-negative number when provided.");
|
|
@@ -1995,32 +2016,32 @@ function Q(e, t) {
|
|
|
1995
2016
|
}
|
|
1996
2017
|
//#endregion
|
|
1997
2018
|
//#region src/core/requestDelay.ts
|
|
1998
|
-
var
|
|
2019
|
+
var xt = 2e3, St = 1e4, Ct = 250, wt = {
|
|
1999
2020
|
delayRemainingMs: null,
|
|
2000
2021
|
nextRequestAt: null
|
|
2001
2022
|
};
|
|
2002
|
-
function
|
|
2023
|
+
function Tt(e, t) {
|
|
2003
2024
|
return e === void 0 ? t : Math.floor(e);
|
|
2004
2025
|
}
|
|
2005
|
-
function
|
|
2026
|
+
function Et(e, t) {
|
|
2006
2027
|
for (let [n, r] of [["delayStepMs", e.delayStepMs], ["delayMaxMs", e.delayMaxMs]]) if (r !== void 0 && (!Number.isFinite(r) || r < 0)) throw TypeError(`Vibe ${t} ${n} must be a non-negative number.`);
|
|
2007
2028
|
}
|
|
2008
|
-
function
|
|
2009
|
-
let n =
|
|
2029
|
+
function Dt(e, t = {}) {
|
|
2030
|
+
let n = Tt(t.delayStepMs, xt), r = Tt(t.delayMaxMs, St);
|
|
2010
2031
|
return Math.min(Math.max(0, e) * n, r);
|
|
2011
2032
|
}
|
|
2012
2033
|
function $(e) {
|
|
2013
|
-
if (e == null || !Number.isFinite(e)) return { ...
|
|
2034
|
+
if (e == null || !Number.isFinite(e)) return { ...wt };
|
|
2014
2035
|
let t = Math.max(0, Math.floor(e - Date.now()));
|
|
2015
2036
|
return t > 0 ? {
|
|
2016
2037
|
delayRemainingMs: t,
|
|
2017
2038
|
nextRequestAt: e
|
|
2018
|
-
} : { ...
|
|
2039
|
+
} : { ...wt };
|
|
2019
2040
|
}
|
|
2020
|
-
async function
|
|
2041
|
+
async function Ot({ delayMs: e, onChange: t, signal: n }) {
|
|
2021
2042
|
if (n.aborted) throw new DOMException("Aborted", "AbortError");
|
|
2022
2043
|
if (e <= 0) {
|
|
2023
|
-
t({ ...
|
|
2044
|
+
t({ ...wt });
|
|
2024
2045
|
return;
|
|
2025
2046
|
}
|
|
2026
2047
|
let r = Date.now() + e;
|
|
@@ -2028,9 +2049,9 @@ async function kt({ delayMs: e, onChange: t, signal: n }) {
|
|
|
2028
2049
|
delayRemainingMs: e,
|
|
2029
2050
|
nextRequestAt: r
|
|
2030
2051
|
}), await new Promise((i, a) => {
|
|
2031
|
-
let o = !1, s = setInterval(f,
|
|
2052
|
+
let o = !1, s = setInterval(f, Ct), c = setTimeout(() => u(), e);
|
|
2032
2053
|
function l() {
|
|
2033
|
-
clearInterval(s), clearTimeout(c), n.removeEventListener("abort", d), t({ ...
|
|
2054
|
+
clearInterval(s), clearTimeout(c), n.removeEventListener("abort", d), t({ ...wt });
|
|
2034
2055
|
}
|
|
2035
2056
|
function u(e) {
|
|
2036
2057
|
o || (o = !0, l(), e ? a(e) : i());
|
|
@@ -2045,13 +2066,13 @@ async function kt({ delayMs: e, onChange: t, signal: n }) {
|
|
|
2045
2066
|
n.addEventListener("abort", d, { once: !0 });
|
|
2046
2067
|
});
|
|
2047
2068
|
}
|
|
2048
|
-
var
|
|
2069
|
+
var kt = class {
|
|
2049
2070
|
interval = null;
|
|
2050
2071
|
constructor(e) {
|
|
2051
2072
|
this.onChange = e;
|
|
2052
2073
|
}
|
|
2053
2074
|
clear() {
|
|
2054
|
-
this.interval !== null && clearInterval(this.interval), this.interval = null, this.onChange({ ...
|
|
2075
|
+
this.interval !== null && clearInterval(this.interval), this.interval = null, this.onChange({ ...wt });
|
|
2055
2076
|
}
|
|
2056
2077
|
sync(e) {
|
|
2057
2078
|
this.clear();
|
|
@@ -2059,22 +2080,22 @@ var At = class {
|
|
|
2059
2080
|
this.onChange(t), t.delayRemainingMs !== null && (this.interval = setInterval(() => {
|
|
2060
2081
|
let t = $(e);
|
|
2061
2082
|
this.onChange(t), t.delayRemainingMs === null && this.clear();
|
|
2062
|
-
},
|
|
2083
|
+
}, Ct));
|
|
2063
2084
|
}
|
|
2064
2085
|
};
|
|
2065
|
-
function
|
|
2086
|
+
function At(e, t = !0) {
|
|
2066
2087
|
return e.maxAdditionalPages === "unlimited" ? Infinity : (e.maxAdditionalPages ?? 10) + (t ? 1 : 0);
|
|
2067
2088
|
}
|
|
2068
|
-
function
|
|
2089
|
+
function jt(e) {
|
|
2069
2090
|
return `${typeof e}:${String(e)}`;
|
|
2070
2091
|
}
|
|
2071
|
-
function
|
|
2092
|
+
function Mt(e, t) {
|
|
2072
2093
|
if (!Number.isInteger(e) || e <= 0) throw TypeError(`Vibe ${t} must be a positive integer.`);
|
|
2073
2094
|
}
|
|
2074
|
-
function
|
|
2095
|
+
function Nt(e) {
|
|
2075
2096
|
if (!e) return;
|
|
2076
|
-
if (
|
|
2077
|
-
|
|
2097
|
+
if (Mt(e.pageSize, "autofill pageSize"), e.strategy === "frontend") {
|
|
2098
|
+
Et(e, "frontend autofill");
|
|
2078
2099
|
let t = e.maxAdditionalPages;
|
|
2079
2100
|
if (t !== void 0 && t !== "unlimited" && (!Number.isInteger(t) || t < 0)) throw TypeError("Vibe autofill maxAdditionalPages must be a non-negative integer or \"unlimited\".");
|
|
2080
2101
|
return;
|
|
@@ -2086,7 +2107,7 @@ function Pt(e) {
|
|
|
2086
2107
|
if (t.pageSize !== e.pageSize) throw TypeError("Vibe backend autofill initialSession pageSize must match autofill pageSize.");
|
|
2087
2108
|
}
|
|
2088
2109
|
}
|
|
2089
|
-
function
|
|
2110
|
+
function Pt(e, t, n = !0) {
|
|
2090
2111
|
if (!e) return {
|
|
2091
2112
|
cycleId: null,
|
|
2092
2113
|
delayRemainingMs: null,
|
|
@@ -2120,7 +2141,7 @@ function Ft(e, t, n = !0) {
|
|
|
2120
2141
|
strategy: e.strategy
|
|
2121
2142
|
};
|
|
2122
2143
|
}
|
|
2123
|
-
function
|
|
2144
|
+
function Ft(e) {
|
|
2124
2145
|
return [
|
|
2125
2146
|
"cancelling",
|
|
2126
2147
|
"filling",
|
|
@@ -2128,9 +2149,9 @@ function It(e) {
|
|
|
2128
2149
|
"waiting"
|
|
2129
2150
|
].includes(e.status);
|
|
2130
2151
|
}
|
|
2131
|
-
async function
|
|
2152
|
+
async function It(e, t, n) {
|
|
2132
2153
|
let r = t.autofill;
|
|
2133
|
-
if (!
|
|
2154
|
+
if (!Ft(r) || !r.cycleId) return;
|
|
2134
2155
|
let i = {
|
|
2135
2156
|
cycleId: r.cycleId,
|
|
2136
2157
|
feedKey: r.feedKey ?? "",
|
|
@@ -2143,20 +2164,20 @@ async function Lt(e, t, n) {
|
|
|
2143
2164
|
throw r.error = e, r.status = "error", e;
|
|
2144
2165
|
}
|
|
2145
2166
|
}
|
|
2146
|
-
function
|
|
2167
|
+
function Lt(e, t, n) {
|
|
2147
2168
|
return e?.strategy === "backend" && t.feedKey === e.feedKey && t.sessionId === n.sessionId;
|
|
2148
2169
|
}
|
|
2149
|
-
async function
|
|
2150
|
-
let u = [], d = [...e], f = /* @__PURE__ */ new Set(), p = r ??
|
|
2170
|
+
async function Rt({ existingItems: e, initialCursor: t, loadPage: n, maximumRequests: r, onDelayChange: i, onProgress: a, options: o, receivedOffset: s = 0, requestOffset: c = 0, signal: l }) {
|
|
2171
|
+
let u = [], d = [...e], f = /* @__PURE__ */ new Set(), p = r ?? At(o), m = t, h = t, g = 0, _;
|
|
2151
2172
|
for (; g < p;) {
|
|
2152
|
-
let e =
|
|
2173
|
+
let e = jt(m);
|
|
2153
2174
|
if (f.has(e)) throw Error("Vibe autofill received a repeated cursor.");
|
|
2154
|
-
f.add(e), await
|
|
2155
|
-
delayMs:
|
|
2175
|
+
f.add(e), await Ot({
|
|
2176
|
+
delayMs: Dt(c + g, o),
|
|
2156
2177
|
onChange: i,
|
|
2157
2178
|
signal: l
|
|
2158
2179
|
});
|
|
2159
|
-
let t =
|
|
2180
|
+
let t = bt(await n({
|
|
2160
2181
|
cursor: m,
|
|
2161
2182
|
signal: l
|
|
2162
2183
|
}));
|
|
@@ -2196,30 +2217,30 @@ async function zt({ existingItems: e, initialCursor: t, loadPage: n, maximumRequ
|
|
|
2196
2217
|
total: _
|
|
2197
2218
|
};
|
|
2198
2219
|
}
|
|
2199
|
-
var
|
|
2200
|
-
function
|
|
2220
|
+
var zt = 100;
|
|
2221
|
+
function Bt(e, t) {
|
|
2201
2222
|
if (!Number.isFinite(t) || t <= 0) throw TypeError(`Vibe ${e} must be a positive number.`);
|
|
2202
2223
|
}
|
|
2203
|
-
function
|
|
2224
|
+
function Vt(e, t, n) {
|
|
2204
2225
|
return Math.min(n, Math.max(t, e));
|
|
2205
2226
|
}
|
|
2206
|
-
function
|
|
2227
|
+
function Ht(e) {
|
|
2207
2228
|
if (!e) return;
|
|
2208
2229
|
let t = e.minSpeedPxPerSecond ?? 20, n = e.maxSpeedPxPerSecond ?? 240;
|
|
2209
|
-
if (
|
|
2210
|
-
e.speedPxPerSecond !== void 0 &&
|
|
2230
|
+
if (Bt("autoScroll.minSpeedPxPerSecond", t), Bt("autoScroll.maxSpeedPxPerSecond", n), t > n) throw TypeError("Vibe autoScroll.minSpeedPxPerSecond cannot exceed maxSpeedPxPerSecond.");
|
|
2231
|
+
e.speedPxPerSecond !== void 0 && Bt("autoScroll.speedPxPerSecond", e.speedPxPerSecond);
|
|
2211
2232
|
}
|
|
2212
|
-
function
|
|
2233
|
+
function Ut(e) {
|
|
2213
2234
|
let t = e?.minSpeedPxPerSecond ?? 20, n = e?.maxSpeedPxPerSecond ?? 240;
|
|
2214
2235
|
return {
|
|
2215
2236
|
enabled: e?.enabled ?? !1,
|
|
2216
2237
|
maxSpeedPxPerSecond: n,
|
|
2217
2238
|
minSpeedPxPerSecond: t,
|
|
2218
2239
|
paused: !1,
|
|
2219
|
-
speedPxPerSecond:
|
|
2240
|
+
speedPxPerSecond: Vt(e?.speedPxPerSecond ?? 80, t, n)
|
|
2220
2241
|
};
|
|
2221
2242
|
}
|
|
2222
|
-
var
|
|
2243
|
+
var Wt = class {
|
|
2223
2244
|
frame = null;
|
|
2224
2245
|
lastTimestamp = null;
|
|
2225
2246
|
mounted = !1;
|
|
@@ -2239,9 +2260,9 @@ var Gt = class {
|
|
|
2239
2260
|
this.options.state.enabled && (this.options.state.paused = e, this.lastTimestamp = null, e ? this.cancelFrame() : this.schedule());
|
|
2240
2261
|
}
|
|
2241
2262
|
setSpeed(e) {
|
|
2242
|
-
|
|
2263
|
+
Bt("auto-scroll speed", e);
|
|
2243
2264
|
let t = this.options.state;
|
|
2244
|
-
t.speedPxPerSecond =
|
|
2265
|
+
t.speedPxPerSecond = Vt(e, t.minSpeedPxPerSecond, t.maxSpeedPxPerSecond);
|
|
2245
2266
|
}
|
|
2246
2267
|
tick = (e) => {
|
|
2247
2268
|
this.frame = null;
|
|
@@ -2253,7 +2274,7 @@ var Gt = class {
|
|
|
2253
2274
|
return;
|
|
2254
2275
|
}
|
|
2255
2276
|
if (this.lastTimestamp !== null) {
|
|
2256
|
-
let r = Math.min(
|
|
2277
|
+
let r = Math.min(zt, Math.max(0, e - this.lastTimestamp)), i = Math.max(0, n.scrollHeight - n.clientHeight);
|
|
2257
2278
|
n.scrollTop = Math.min(i, n.scrollTop + t.speedPxPerSecond * r / 1e3);
|
|
2258
2279
|
}
|
|
2259
2280
|
this.lastTimestamp = e, this.schedule();
|
|
@@ -2267,7 +2288,7 @@ var Gt = class {
|
|
|
2267
2288
|
};
|
|
2268
2289
|
//#endregion
|
|
2269
2290
|
//#region src/core/backendAutofill.ts
|
|
2270
|
-
async function
|
|
2291
|
+
async function Gt(e, t, n, r) {
|
|
2271
2292
|
let i = await e.onUnderfilled(n);
|
|
2272
2293
|
if (!r()) return;
|
|
2273
2294
|
if (!i.sessionId.trim()) throw TypeError("Vibe backend autofill requires a sessionId.");
|
|
@@ -2281,19 +2302,19 @@ async function Kt(e, t, n, r) {
|
|
|
2281
2302
|
status: "waiting"
|
|
2282
2303
|
});
|
|
2283
2304
|
}
|
|
2284
|
-
function
|
|
2305
|
+
function Kt(e, t) {
|
|
2285
2306
|
["complete", "exhausted"].includes(t.status) && t.items && (e.items = Q(e.items, t.items)), t.next !== void 0 && (e.next = t.next), t.total !== void 0 && (e.total = t.total);
|
|
2286
2307
|
}
|
|
2287
|
-
function
|
|
2308
|
+
function qt(e, t, n) {
|
|
2288
2309
|
let r = t.autofill;
|
|
2289
|
-
return !
|
|
2310
|
+
return !Lt(e, n, r) || n.sequence <= r.sequence || ["cancelled", "cancelling"].includes(r.status) || ["complete", "exhausted"].includes(n.status) && n.next === void 0 ? !1 : (Kt(t, n), Object.assign(r, $(n.status === "waiting" ? n.nextRequestAt : null)), r.error = n.error ?? null, r.missing = Math.max(0, (r.pageSize ?? 0) - n.received), r.received = n.received, n.requests !== void 0 && (r.requests = n.requests), r.sequence = n.sequence, r.status = n.status, !0);
|
|
2290
2311
|
}
|
|
2291
|
-
function
|
|
2292
|
-
return e?.strategy !== "backend" || n.feedKey !== e.feedKey || n.pageSize !== e.pageSize ? !1 : (t.autofill =
|
|
2312
|
+
function Jt(e, t, n) {
|
|
2313
|
+
return e?.strategy !== "backend" || n.feedKey !== e.feedKey || n.pageSize !== e.pageSize ? !1 : (t.autofill = Pt(e, n), Kt(t, n), !0);
|
|
2293
2314
|
}
|
|
2294
2315
|
//#endregion
|
|
2295
2316
|
//#region src/core/initialAutofill.ts
|
|
2296
|
-
async function
|
|
2317
|
+
async function Yt({ cycleId: e, isCurrent: t, onLastCursor: n, options: r, signal: i, state: a }) {
|
|
2297
2318
|
let o = r.autofill;
|
|
2298
2319
|
if (!o) return;
|
|
2299
2320
|
let s = a.items.length;
|
|
@@ -2306,7 +2327,7 @@ async function Xt({ cycleId: e, isCurrent: t, onLastCursor: n, options: r, signa
|
|
|
2306
2327
|
return;
|
|
2307
2328
|
}
|
|
2308
2329
|
if (o.strategy === "backend") {
|
|
2309
|
-
await
|
|
2330
|
+
await Gt(o, a, {
|
|
2310
2331
|
cycleId: e,
|
|
2311
2332
|
feedKey: o.feedKey,
|
|
2312
2333
|
items: [...a.items],
|
|
@@ -2323,11 +2344,11 @@ async function Xt({ cycleId: e, isCurrent: t, onLastCursor: n, options: r, signa
|
|
|
2323
2344
|
a.autofill.status = "exhausted";
|
|
2324
2345
|
return;
|
|
2325
2346
|
}
|
|
2326
|
-
let c = await
|
|
2347
|
+
let c = await Rt({
|
|
2327
2348
|
existingItems: a.items,
|
|
2328
2349
|
initialCursor: a.next,
|
|
2329
2350
|
loadPage: r.loadPage,
|
|
2330
|
-
maximumRequests:
|
|
2351
|
+
maximumRequests: At(o, !1),
|
|
2331
2352
|
onDelayChange: (e) => {
|
|
2332
2353
|
t() && Object.assign(a.autofill, e);
|
|
2333
2354
|
},
|
|
@@ -2348,13 +2369,13 @@ async function Xt({ cycleId: e, isCurrent: t, onLastCursor: n, options: r, signa
|
|
|
2348
2369
|
}
|
|
2349
2370
|
//#endregion
|
|
2350
2371
|
//#region src/core/fill.ts
|
|
2351
|
-
function
|
|
2372
|
+
function Xt(e) {
|
|
2352
2373
|
return "pages" in e ? { pages: e.pages } : { until: "end" };
|
|
2353
2374
|
}
|
|
2354
|
-
function
|
|
2375
|
+
function Zt(e) {
|
|
2355
2376
|
return `${typeof e}:${String(e)}`;
|
|
2356
2377
|
}
|
|
2357
|
-
function
|
|
2378
|
+
function Qt(e) {
|
|
2358
2379
|
if (!e || typeof e != "object") throw TypeError("Vibe fill target must be an object.");
|
|
2359
2380
|
if ("pages" in e) {
|
|
2360
2381
|
if (!Number.isInteger(e.pages) || e.pages <= 0) throw TypeError("Vibe fill pages must be a positive integer.");
|
|
@@ -2363,20 +2384,20 @@ function $t(e) {
|
|
|
2363
2384
|
if ("until" in e && e.until === "end") return { until: "end" };
|
|
2364
2385
|
throw TypeError("Vibe fill target must be { pages } or { until: 'end' }.");
|
|
2365
2386
|
}
|
|
2366
|
-
function
|
|
2387
|
+
function $t(e) {
|
|
2367
2388
|
if (!e) return;
|
|
2368
2389
|
if (e.strategy === "frontend") {
|
|
2369
|
-
|
|
2390
|
+
Et(e, "frontend fill");
|
|
2370
2391
|
return;
|
|
2371
2392
|
}
|
|
2372
2393
|
if (!e.feedKey.trim()) throw TypeError("Vibe backend fill requires a feedKey.");
|
|
2373
2394
|
let t = e.initialSession;
|
|
2374
2395
|
if (t) {
|
|
2375
2396
|
if (t.feedKey !== e.feedKey) throw TypeError("Vibe backend fill initialSession feedKey must match fill feedKey.");
|
|
2376
|
-
|
|
2397
|
+
Qt(t.target);
|
|
2377
2398
|
}
|
|
2378
2399
|
}
|
|
2379
|
-
function
|
|
2400
|
+
function en(e, t, n = !0) {
|
|
2380
2401
|
let r = e?.strategy === "backend" && n ? e.initialSession : void 0, i = t ?? r, a = $(i?.nextRequestAt);
|
|
2381
2402
|
return {
|
|
2382
2403
|
completedPages: i?.completedPages ?? 0,
|
|
@@ -2390,10 +2411,10 @@ function tn(e, t, n = !0) {
|
|
|
2390
2411
|
sessionId: i?.sessionId ?? null,
|
|
2391
2412
|
status: i?.status ?? "idle",
|
|
2392
2413
|
strategy: e?.strategy ?? null,
|
|
2393
|
-
target: i ?
|
|
2414
|
+
target: i ? Xt(i.target) : null
|
|
2394
2415
|
};
|
|
2395
2416
|
}
|
|
2396
|
-
function
|
|
2417
|
+
function tn(e) {
|
|
2397
2418
|
return [
|
|
2398
2419
|
"cancelling",
|
|
2399
2420
|
"filling",
|
|
@@ -2401,17 +2422,17 @@ function nn(e) {
|
|
|
2401
2422
|
"waiting"
|
|
2402
2423
|
].includes(e.status);
|
|
2403
2424
|
}
|
|
2404
|
-
async function
|
|
2425
|
+
async function nn({ existingItems: e, initialCursor: t, loadPage: n, onDelayChange: r, onProgress: i, options: a, signal: o, target: s }) {
|
|
2405
2426
|
let c = [], l = [...e], u = /* @__PURE__ */ new Set(), d = 0, f = t, p = t, m = 0, h;
|
|
2406
2427
|
for (; p !== null;) {
|
|
2407
|
-
let e =
|
|
2428
|
+
let e = Zt(f);
|
|
2408
2429
|
if (u.has(e)) throw Error("Vibe fill received a repeated cursor.");
|
|
2409
|
-
u.add(e), await
|
|
2410
|
-
delayMs:
|
|
2430
|
+
u.add(e), await Ot({
|
|
2431
|
+
delayMs: Dt(d, a),
|
|
2411
2432
|
onChange: r,
|
|
2412
2433
|
signal: o
|
|
2413
2434
|
});
|
|
2414
|
-
let t =
|
|
2435
|
+
let t = bt(await n({
|
|
2415
2436
|
cursor: f,
|
|
2416
2437
|
signal: o
|
|
2417
2438
|
}));
|
|
@@ -2453,7 +2474,7 @@ async function rn({ existingItems: e, initialCursor: t, loadPage: n, onDelayChan
|
|
|
2453
2474
|
}
|
|
2454
2475
|
//#endregion
|
|
2455
2476
|
//#region src/core/backendFill.ts
|
|
2456
|
-
async function
|
|
2477
|
+
async function rn(e, t, n, r) {
|
|
2457
2478
|
let i = await e.onStart(n);
|
|
2458
2479
|
if (r()) {
|
|
2459
2480
|
if (!i.sessionId.trim()) throw TypeError("Vibe backend fill requires a sessionId.");
|
|
@@ -2467,22 +2488,22 @@ async function an(e, t, n, r) {
|
|
|
2467
2488
|
});
|
|
2468
2489
|
}
|
|
2469
2490
|
}
|
|
2470
|
-
function
|
|
2491
|
+
function an(e, t, n) {
|
|
2471
2492
|
return e?.strategy === "backend" && n.feedKey === e.feedKey && n.sessionId === t.fill.sessionId;
|
|
2472
2493
|
}
|
|
2473
|
-
function
|
|
2494
|
+
function on(e) {
|
|
2474
2495
|
return Number.isInteger(e.completedPages) && e.completedPages >= 0 && Number.isInteger(e.received) && e.received >= 0 && Number.isInteger(e.sequence) && e.sequence >= 0;
|
|
2475
2496
|
}
|
|
2476
|
-
function
|
|
2497
|
+
function sn(e, t) {
|
|
2477
2498
|
if (!["complete", "exhausted"].includes(t.status)) return !0;
|
|
2478
2499
|
let n = e.fill.target;
|
|
2479
2500
|
return !n || !Array.isArray(t.items) || t.next === void 0 || t.lastCursor === void 0 ? !1 : t.status === "exhausted" ? "pages" in n && t.completedPages < n.pages && t.next === null : "pages" in n ? t.completedPages === n.pages : t.next === null;
|
|
2480
2501
|
}
|
|
2481
|
-
function
|
|
2502
|
+
function cn(e, t, n) {
|
|
2482
2503
|
t.total !== void 0 && (e.total = t.total), ["complete", "exhausted"].includes(t.status) && (e.items = Q(e.items, t.items ?? []), e.next = t.next ?? null, n(t.lastCursor ?? null));
|
|
2483
2504
|
}
|
|
2484
|
-
function
|
|
2485
|
-
return !
|
|
2505
|
+
function ln(e, t, n, r) {
|
|
2506
|
+
return !an(e, t, n) || !on(n) || n.sequence <= t.fill.sequence || ["cancelled", "cancelling"].includes(t.fill.status) || !sn(t, n) ? !1 : (cn(t, n, r), Object.assign(t.fill, {
|
|
2486
2507
|
...$(n.status === "waiting" ? n.nextRequestAt : null),
|
|
2487
2508
|
completedPages: n.completedPages,
|
|
2488
2509
|
error: n.error ?? null,
|
|
@@ -2491,41 +2512,41 @@ function un(e, t, n, r) {
|
|
|
2491
2512
|
status: n.status
|
|
2492
2513
|
}), !0);
|
|
2493
2514
|
}
|
|
2494
|
-
function
|
|
2515
|
+
function un(e, t, n, r) {
|
|
2495
2516
|
if (e?.strategy !== "backend" || n.feedKey !== e.feedKey) return !1;
|
|
2496
2517
|
let i = t.fill;
|
|
2497
|
-
return t.fill =
|
|
2518
|
+
return t.fill = en(e, n), !on(n) || !sn(t, n) ? (t.fill = i, !1) : (cn(t, n, r), !0);
|
|
2498
2519
|
}
|
|
2499
2520
|
//#endregion
|
|
2500
2521
|
//#region src/core/fillController.ts
|
|
2501
|
-
var
|
|
2522
|
+
var dn = class {
|
|
2502
2523
|
abortController = null;
|
|
2503
2524
|
cycle = 0;
|
|
2504
2525
|
delayCountdown;
|
|
2505
2526
|
requestVersion = 0;
|
|
2506
2527
|
constructor(e) {
|
|
2507
|
-
this.options = e, this.delayCountdown = new
|
|
2528
|
+
this.options = e, this.delayCountdown = new kt((e) => {
|
|
2508
2529
|
Object.assign(this.options.state.fill, e);
|
|
2509
2530
|
}), this.syncBackendCountdown();
|
|
2510
2531
|
}
|
|
2511
2532
|
isActive() {
|
|
2512
|
-
return
|
|
2533
|
+
return tn(this.options.state.fill);
|
|
2513
2534
|
}
|
|
2514
2535
|
applyUpdate(e) {
|
|
2515
|
-
let t =
|
|
2536
|
+
let t = ln(this.options.fill, this.options.state, e, this.options.onLastCursor);
|
|
2516
2537
|
return t && this.syncBackendCountdown(), t;
|
|
2517
2538
|
}
|
|
2518
2539
|
restoreSession(e) {
|
|
2519
|
-
let t =
|
|
2540
|
+
let t = un(this.options.fill, this.options.state, e, this.options.onLastCursor);
|
|
2520
2541
|
return t && this.syncBackendCountdown(), t;
|
|
2521
2542
|
}
|
|
2522
2543
|
async start(e) {
|
|
2523
2544
|
let t = this.options.fill;
|
|
2524
2545
|
if (!t) throw Error("Vibe fill is not configured.");
|
|
2525
2546
|
if (this.isActive()) throw Error("Vibe fill is already active.");
|
|
2526
|
-
let n =
|
|
2547
|
+
let n = Qt(e), r = `vibe-fill-${Date.now().toString(36)}-${++this.cycle}`;
|
|
2527
2548
|
if (this.options.state.fill = {
|
|
2528
|
-
...
|
|
2549
|
+
...en(t, void 0, !1),
|
|
2529
2550
|
cycleId: r,
|
|
2530
2551
|
status: "filling",
|
|
2531
2552
|
target: n
|
|
@@ -2536,7 +2557,7 @@ var fn = class {
|
|
|
2536
2557
|
let i = ++this.requestVersion, a = new AbortController();
|
|
2537
2558
|
this.abortController = a;
|
|
2538
2559
|
try {
|
|
2539
|
-
t.strategy === "frontend" ? await this.startFrontend(t, n, a, i) : (await
|
|
2560
|
+
t.strategy === "frontend" ? await this.startFrontend(t, n, a, i) : (await rn(t, this.options.state, {
|
|
2540
2561
|
cycleId: r,
|
|
2541
2562
|
feedKey: t.feedKey,
|
|
2542
2563
|
items: [...this.options.state.items],
|
|
@@ -2554,7 +2575,7 @@ var fn = class {
|
|
|
2554
2575
|
}
|
|
2555
2576
|
async cancel() {
|
|
2556
2577
|
let { fill: e, state: t } = this.options;
|
|
2557
|
-
if (!
|
|
2578
|
+
if (!tn(t.fill) || !t.fill.cycleId) return;
|
|
2558
2579
|
let n = {
|
|
2559
2580
|
cycleId: t.fill.cycleId,
|
|
2560
2581
|
feedKey: t.fill.feedKey ?? "",
|
|
@@ -2568,7 +2589,7 @@ var fn = class {
|
|
|
2568
2589
|
}
|
|
2569
2590
|
}
|
|
2570
2591
|
reset() {
|
|
2571
|
-
this.abortLocalRequest(), this.delayCountdown.clear(), this.options.state.fill =
|
|
2592
|
+
this.abortLocalRequest(), this.delayCountdown.clear(), this.options.state.fill = en(this.options.fill, void 0, !1);
|
|
2572
2593
|
}
|
|
2573
2594
|
destroy() {
|
|
2574
2595
|
this.abortLocalRequest(), this.delayCountdown.clear();
|
|
@@ -2584,7 +2605,7 @@ var fn = class {
|
|
|
2584
2605
|
if (!i) throw Error("Vibe frontend fill requires loadPage.");
|
|
2585
2606
|
let a = this.options.state;
|
|
2586
2607
|
a.isLoadingMore = !0;
|
|
2587
|
-
let o = await
|
|
2608
|
+
let o = await nn({
|
|
2588
2609
|
existingItems: a.items,
|
|
2589
2610
|
initialCursor: a.next,
|
|
2590
2611
|
loadPage: i,
|
|
@@ -2611,7 +2632,7 @@ var fn = class {
|
|
|
2611
2632
|
};
|
|
2612
2633
|
//#endregion
|
|
2613
2634
|
//#region src/core/feedFooter.ts
|
|
2614
|
-
function
|
|
2635
|
+
function fn(e) {
|
|
2615
2636
|
return {
|
|
2616
2637
|
cancelAutofill: () => e.cancelAutofill(),
|
|
2617
2638
|
loadMore: () => e.loadNext(),
|
|
@@ -2619,45 +2640,45 @@ function pn(e) {
|
|
|
2619
2640
|
retryEnd: () => e.retryEnd()
|
|
2620
2641
|
};
|
|
2621
2642
|
}
|
|
2622
|
-
function
|
|
2643
|
+
function pn(e) {
|
|
2623
2644
|
if (!Number.isFinite(e) || e <= 0) throw TypeError("Vibe reelAutoAdvance.intervalMs must be a positive number.");
|
|
2624
2645
|
}
|
|
2625
|
-
function
|
|
2626
|
-
e?.intervalMs !== void 0 &&
|
|
2646
|
+
function mn(e) {
|
|
2647
|
+
e?.intervalMs !== void 0 && pn(e.intervalMs);
|
|
2627
2648
|
}
|
|
2628
|
-
function
|
|
2649
|
+
function hn(e) {
|
|
2629
2650
|
return {
|
|
2630
2651
|
enabled: e?.enabled ?? !1,
|
|
2631
2652
|
includePostItems: e?.includePostItems ?? !1,
|
|
2632
2653
|
intervalMs: e?.intervalMs ?? 5e3
|
|
2633
2654
|
};
|
|
2634
2655
|
}
|
|
2635
|
-
function
|
|
2656
|
+
function gn(e, t) {
|
|
2636
2657
|
if (typeof t == "boolean") {
|
|
2637
2658
|
e.enabled = t;
|
|
2638
2659
|
return;
|
|
2639
2660
|
}
|
|
2640
|
-
|
|
2661
|
+
mn(t), t.enabled !== void 0 && (e.enabled = t.enabled), t.includePostItems !== void 0 && (e.includePostItems = t.includePostItems), t.intervalMs !== void 0 && (e.intervalMs = t.intervalMs);
|
|
2641
2662
|
}
|
|
2642
2663
|
//#endregion
|
|
2643
2664
|
//#region src/core/reelInfoSheet.ts
|
|
2644
|
-
function
|
|
2665
|
+
function _n(e) {
|
|
2645
2666
|
return { enabled: e?.enabled ?? !1 };
|
|
2646
2667
|
}
|
|
2647
|
-
function
|
|
2668
|
+
function vn(e, t, n) {
|
|
2648
2669
|
if (n && !t) throw Error("Vibe cannot enable reelInfoSheet without a configured component.");
|
|
2649
2670
|
e.enabled = n;
|
|
2650
2671
|
}
|
|
2651
2672
|
//#endregion
|
|
2652
2673
|
//#region src/core/initialRuntimeState.ts
|
|
2653
|
-
function
|
|
2674
|
+
function yn(e, t) {
|
|
2654
2675
|
let n = e.initialPage;
|
|
2655
2676
|
return {
|
|
2656
2677
|
activeReelPostId: null,
|
|
2657
|
-
autoScroll:
|
|
2658
|
-
autofill:
|
|
2678
|
+
autoScroll: Ut(e.autoScroll),
|
|
2679
|
+
autofill: Pt(e.autofill),
|
|
2659
2680
|
error: null,
|
|
2660
|
-
fill:
|
|
2681
|
+
fill: en(e.fill),
|
|
2661
2682
|
infiniteScroll: e.infiniteScroll ?? !0,
|
|
2662
2683
|
isLoading: !n,
|
|
2663
2684
|
isLoadingMore: !1,
|
|
@@ -2666,8 +2687,8 @@ function bn(e, t) {
|
|
|
2666
2687
|
loadMoreLocked: !1,
|
|
2667
2688
|
next: n?.next ?? null,
|
|
2668
2689
|
nextPageError: null,
|
|
2669
|
-
reelAutoAdvance:
|
|
2670
|
-
reelInfoSheet:
|
|
2690
|
+
reelAutoAdvance: hn(e.reelAutoAdvance),
|
|
2691
|
+
reelInfoSheet: _n(e.reelInfoSheet),
|
|
2671
2692
|
reelInfoSheetOverlay: !1,
|
|
2672
2693
|
reelMediaSource: "original",
|
|
2673
2694
|
reelOrigin: null,
|
|
@@ -2676,18 +2697,18 @@ function bn(e, t) {
|
|
|
2676
2697
|
}
|
|
2677
2698
|
//#endregion
|
|
2678
2699
|
//#region src/core/itemPlacement.ts
|
|
2679
|
-
function
|
|
2700
|
+
function bn(e, t) {
|
|
2680
2701
|
let n = new Set(t);
|
|
2681
2702
|
return e.flatMap((e, t) => n.has(e.postId) ? [{
|
|
2682
2703
|
index: t,
|
|
2683
2704
|
item: e
|
|
2684
2705
|
}] : []);
|
|
2685
2706
|
}
|
|
2686
|
-
function
|
|
2707
|
+
function xn(e, t) {
|
|
2687
2708
|
let n = new Set(t.map(({ item: e }) => e.postId));
|
|
2688
2709
|
return e.filter((e) => !n.has(e.postId));
|
|
2689
2710
|
}
|
|
2690
|
-
function
|
|
2711
|
+
function Sn(e, t) {
|
|
2691
2712
|
t.forEach(({ index: e }) => {
|
|
2692
2713
|
if (!Number.isInteger(e) || e < 0) throw Error("Vibe item restore indexes must be non-negative integers.");
|
|
2693
2714
|
});
|
|
@@ -2698,7 +2719,7 @@ function Cn(e, t) {
|
|
|
2698
2719
|
}
|
|
2699
2720
|
//#endregion
|
|
2700
2721
|
//#region src/core/itemRemovalController.ts
|
|
2701
|
-
var
|
|
2722
|
+
var Cn = 20, wn = class {
|
|
2702
2723
|
generation = 0;
|
|
2703
2724
|
historyLimit;
|
|
2704
2725
|
metadata = /* @__PURE__ */ new WeakMap();
|
|
@@ -2707,7 +2728,7 @@ var wn = 20, Tn = class {
|
|
|
2707
2728
|
itemOrder;
|
|
2708
2729
|
stopItemsWatcher;
|
|
2709
2730
|
constructor(e) {
|
|
2710
|
-
this.options = e, this.historyLimit = e.historyLimit ??
|
|
2731
|
+
this.options = e, this.historyLimit = e.historyLimit ?? Cn, this.state = e.state, this.itemOrder = this.state.items.map(({ postId: e }) => e), this.stopItemsWatcher = D(() => this.state.items, (e) => this.appendUnknownItems(e), { flush: "sync" });
|
|
2711
2732
|
}
|
|
2712
2733
|
destroy() {
|
|
2713
2734
|
this.reset(), this.stopItemsWatcher();
|
|
@@ -2718,7 +2739,7 @@ var wn = 20, Tn = class {
|
|
|
2718
2739
|
let r = t.map(({ item: e }) => e.postId), i = this.options.startRemoval(r);
|
|
2719
2740
|
if (i > 0 && await new Promise((e) => setTimeout(e, i)), this.metadata.get(n)?.generation !== this.generation) return n;
|
|
2720
2741
|
let a = this.state.items.findIndex((e) => e.postId === this.state.activeReelPostId);
|
|
2721
|
-
return this.state.items =
|
|
2742
|
+
return this.state.items = xn(this.state.items, t), this.options.onItemsRemoved(t, a), this.record(n), n;
|
|
2722
2743
|
}
|
|
2723
2744
|
reset() {
|
|
2724
2745
|
this.generation += 1, this.history = [], this.itemOrder = [];
|
|
@@ -2729,7 +2750,7 @@ var wn = 20, Tn = class {
|
|
|
2729
2750
|
this.restoreRemoval(t);
|
|
2730
2751
|
return;
|
|
2731
2752
|
}
|
|
2732
|
-
let n =
|
|
2753
|
+
let n = Sn(this.state.items, e);
|
|
2733
2754
|
this.registerExternalPlacements(e), this.state.items = n;
|
|
2734
2755
|
}
|
|
2735
2756
|
restoreRemoval(e) {
|
|
@@ -2752,7 +2773,7 @@ var wn = 20, Tn = class {
|
|
|
2752
2773
|
}
|
|
2753
2774
|
collectOrderedPlacements(e) {
|
|
2754
2775
|
let t = new Map(this.itemOrder.map((e, t) => [e, t]));
|
|
2755
|
-
return
|
|
2776
|
+
return bn(this.state.items, e).map((e) => ({
|
|
2756
2777
|
index: t.get(e.item.postId) ?? e.index,
|
|
2757
2778
|
item: e.item
|
|
2758
2779
|
}));
|
|
@@ -2786,14 +2807,20 @@ var wn = 20, Tn = class {
|
|
|
2786
2807
|
};
|
|
2787
2808
|
//#endregion
|
|
2788
2809
|
//#region src/core/options.ts
|
|
2789
|
-
function
|
|
2810
|
+
function Tn(e, t) {
|
|
2790
2811
|
if (t) {
|
|
2791
2812
|
if (!Number.isFinite(t.height) || t.height <= 0) throw TypeError(`Vibe ${e} height must be a positive number.`);
|
|
2792
2813
|
if (t.background !== void 0 && t.background !== "default" && t.background !== "transparent") throw TypeError(`Vibe ${e} background must be "default" or "transparent".`);
|
|
2793
2814
|
}
|
|
2794
2815
|
}
|
|
2816
|
+
function En(e, t) {
|
|
2817
|
+
if (t) {
|
|
2818
|
+
if (t.background !== void 0 && t.background !== "default" && t.background !== "transparent") throw TypeError(`Vibe mediaCard ${e} background must be "default" or "transparent".`);
|
|
2819
|
+
for (let [n, r] of [["paddingX", t.paddingX], ["paddingY", t.paddingY]]) if (r !== void 0 && (!Number.isFinite(r) || r < 0)) throw TypeError(`Vibe mediaCard ${e} ${n} must be a non-negative number.`);
|
|
2820
|
+
}
|
|
2821
|
+
}
|
|
2795
2822
|
function Dn(e) {
|
|
2796
|
-
if (
|
|
2823
|
+
if (Ht(e.autoScroll), Tn("cardHeader", e.cardHeader), Tn("cardFooter", e.cardFooter), En("header", e.mediaCard?.header), En("footer", e.mediaCard?.footer), Nt(e.autofill), $t(e.fill), mn(e.reelAutoAdvance), e.removalHistoryLimit !== void 0 && (!Number.isInteger(e.removalHistoryLimit) || e.removalHistoryLimit < 0)) throw TypeError("Vibe removalHistoryLimit must be a non-negative integer.");
|
|
2797
2824
|
if (!e.initialPage && !e.loadPage) throw TypeError("Vibe requires either initialPage or loadPage.");
|
|
2798
2825
|
if (e.initialPage?.next !== null && !e.loadPage) throw TypeError("Vibe requires loadPage when initialPage has a next cursor.");
|
|
2799
2826
|
if (e.fill?.strategy === "frontend" && !e.loadPage) throw TypeError("Vibe frontend fill requires loadPage.");
|
|
@@ -2908,17 +2935,17 @@ var Fn = class {
|
|
|
2908
2935
|
constructor(e) {
|
|
2909
2936
|
this.options = e, Dn(e);
|
|
2910
2937
|
let t = e.layout ?? "masonry";
|
|
2911
|
-
this.state = b(
|
|
2938
|
+
this.state = b(yn(e, t)), this.autoScroll = new Wt({
|
|
2912
2939
|
getScrollElement: () => this.surface?.getAutoScrollElement() ?? null,
|
|
2913
2940
|
state: this.state.autoScroll
|
|
2914
|
-
}), this.autofillDelayCountdown = new
|
|
2941
|
+
}), this.autofillDelayCountdown = new kt((e) => Object.assign(this.state.autofill, e)), this.syncAutofillCountdown(), this.fillController = new dn({
|
|
2915
2942
|
fill: e.fill,
|
|
2916
2943
|
loadPage: e.loadPage,
|
|
2917
2944
|
onLastCursor: (e) => {
|
|
2918
2945
|
this.lastLoadedCursor = e;
|
|
2919
2946
|
},
|
|
2920
2947
|
state: this.state
|
|
2921
|
-
}), this.routing = new In(e.routing, this.state), this.itemRemoval = new
|
|
2948
|
+
}), this.routing = new In(e.routing, this.state), this.itemRemoval = new wn({
|
|
2922
2949
|
historyLimit: e.removalHistoryLimit,
|
|
2923
2950
|
onItemsRemoved: (e, t) => {
|
|
2924
2951
|
this.restoreActiveItemAfterRemoval(e, t);
|
|
@@ -2933,12 +2960,13 @@ var Fn = class {
|
|
|
2933
2960
|
if (this.app) throw Error("Vibe is already mounted.");
|
|
2934
2961
|
this.startStateNotifications();
|
|
2935
2962
|
let e = On(this.options.target);
|
|
2936
|
-
this.responsiveLayout.mount(e), this.app = r(
|
|
2963
|
+
this.responsiveLayout.mount(e), this.app = r(yt, {
|
|
2937
2964
|
canRetryEnd: !!this.options.loadPage,
|
|
2938
2965
|
cardFooter: this.options.cardFooter,
|
|
2939
2966
|
cardHeader: this.options.cardHeader,
|
|
2940
2967
|
feedFooter: this.options.feedFooter,
|
|
2941
|
-
feedFooterActions:
|
|
2968
|
+
feedFooterActions: fn(this),
|
|
2969
|
+
mediaCard: this.options.mediaCard,
|
|
2942
2970
|
reelInfoSheet: this.options.reelInfoSheet,
|
|
2943
2971
|
state: this.state,
|
|
2944
2972
|
onActiveReelChange: (e) => this.setActiveReelPost(e),
|
|
@@ -2996,11 +3024,11 @@ var Fn = class {
|
|
|
2996
3024
|
this.autoScroll.setSpeed(e);
|
|
2997
3025
|
}
|
|
2998
3026
|
applyAutofillUpdate(e) {
|
|
2999
|
-
let t =
|
|
3027
|
+
let t = qt(this.options.autofill, this.state, e);
|
|
3000
3028
|
return t && this.syncAutofillCountdown(), t;
|
|
3001
3029
|
}
|
|
3002
3030
|
async cancelAutofill() {
|
|
3003
|
-
await
|
|
3031
|
+
await It(this.options.autofill, this.state, () => this.cancelRequest());
|
|
3004
3032
|
}
|
|
3005
3033
|
applyFillUpdate(e) {
|
|
3006
3034
|
return this.fillController.applyUpdate(e);
|
|
@@ -3009,11 +3037,11 @@ var Fn = class {
|
|
|
3009
3037
|
return this.fillController.cancel();
|
|
3010
3038
|
}
|
|
3011
3039
|
async fill(e) {
|
|
3012
|
-
if (this.pendingRequest ||
|
|
3040
|
+
if (this.pendingRequest || Ft(this.state.autofill)) throw Error("Vibe cannot fill while another page operation is active.");
|
|
3013
3041
|
await this.fillController.start(e);
|
|
3014
3042
|
}
|
|
3015
3043
|
restoreAutofillSession(e) {
|
|
3016
|
-
let t =
|
|
3044
|
+
let t = Jt(this.options.autofill, this.state, e);
|
|
3017
3045
|
return t && this.syncAutofillCountdown(), t;
|
|
3018
3046
|
}
|
|
3019
3047
|
restoreFillSession(e) {
|
|
@@ -3021,15 +3049,15 @@ var Fn = class {
|
|
|
3021
3049
|
}
|
|
3022
3050
|
async loadNext() {
|
|
3023
3051
|
if (this.pendingRequest) return this.pendingRequest;
|
|
3024
|
-
if (!this.state.loadMoreLocked && !(
|
|
3052
|
+
if (!this.state.loadMoreLocked && !(Ft(this.state.autofill) || this.fillController.isActive()) && !(this.state.next === null || !this.options.loadPage)) return this.state.isLoadingMore = !0, this.state.nextPageError = null, this.startRequest(this.state.next, !0);
|
|
3025
3053
|
}
|
|
3026
3054
|
async reload() {
|
|
3027
3055
|
if (!this.options.loadPage) throw Error("Vibe cannot reload without loadPage.");
|
|
3028
|
-
return
|
|
3056
|
+
return Ft(this.state.autofill) && await this.cancelAutofill(), this.fillController.isActive() && await this.cancelFill(), this.cancelRequest(), this.state.autofill = Pt(this.options.autofill, void 0, !1), this.fillController.reset(), this.itemRemoval.reset(), this.state.error = null, this.state.isLoading = !0, this.state.items = [], this.state.next = null, this.state.nextPageError = null, this.state.total = null, this.startRequest(null, !1);
|
|
3029
3057
|
}
|
|
3030
3058
|
async retryEnd() {
|
|
3031
3059
|
if (this.pendingRequest) return this.pendingRequest;
|
|
3032
|
-
if (!this.state.loadMoreLocked && !(
|
|
3060
|
+
if (!this.state.loadMoreLocked && !(Ft(this.state.autofill) || this.fillController.isActive()) && !(this.state.next !== null || !this.options.loadPage)) return this.state.isLoadingMore = !0, this.state.nextPageError = null, this.startRequest(this.lastLoadedCursor, !0);
|
|
3033
3061
|
}
|
|
3034
3062
|
setInfiniteScroll(e) {
|
|
3035
3063
|
this.state.infiniteScroll = e, e && p(() => this.surface?.loadIfNearBottom());
|
|
@@ -3038,10 +3066,10 @@ var Fn = class {
|
|
|
3038
3066
|
this.state.loadMoreLocked !== e && (this.state.loadMoreLocked = e, !e && this.state.infiniteScroll && p(() => this.surface?.loadIfNearBottom()));
|
|
3039
3067
|
}
|
|
3040
3068
|
setReelAutoAdvance(e) {
|
|
3041
|
-
|
|
3069
|
+
gn(this.state.reelAutoAdvance, e);
|
|
3042
3070
|
}
|
|
3043
3071
|
setReelInfoSheet(e) {
|
|
3044
|
-
|
|
3072
|
+
vn(this.state.reelInfoSheet, this.options.reelInfoSheet, e);
|
|
3045
3073
|
}
|
|
3046
3074
|
setLayout(e) {
|
|
3047
3075
|
this.responsiveLayout.setLayout(e);
|
|
@@ -3075,7 +3103,7 @@ var Fn = class {
|
|
|
3075
3103
|
this.abortController = i;
|
|
3076
3104
|
try {
|
|
3077
3105
|
if (a?.strategy === "frontend") {
|
|
3078
|
-
let o = await
|
|
3106
|
+
let o = await Rt({
|
|
3079
3107
|
existingItems: t ? this.state.items : [],
|
|
3080
3108
|
initialCursor: e,
|
|
3081
3109
|
loadPage: n,
|
|
@@ -3097,7 +3125,7 @@ var Fn = class {
|
|
|
3097
3125
|
});
|
|
3098
3126
|
return;
|
|
3099
3127
|
}
|
|
3100
|
-
let c =
|
|
3128
|
+
let c = bt(await n({
|
|
3101
3129
|
cursor: e,
|
|
3102
3130
|
signal: i.signal
|
|
3103
3131
|
}));
|
|
@@ -3112,7 +3140,7 @@ var Fn = class {
|
|
|
3112
3140
|
this.state.autofill.status = "complete";
|
|
3113
3141
|
return;
|
|
3114
3142
|
}
|
|
3115
|
-
await
|
|
3143
|
+
await Gt(a, this.state, {
|
|
3116
3144
|
cycleId: o,
|
|
3117
3145
|
feedKey: a.feedKey,
|
|
3118
3146
|
items: u.slice(l.length),
|
|
@@ -3137,7 +3165,7 @@ var Fn = class {
|
|
|
3137
3165
|
this.autofillDelayCountdown.clear();
|
|
3138
3166
|
let t = `vibe-autofill-${Date.now().toString(36)}-${++this.autofillCycle}`;
|
|
3139
3167
|
return this.state.autofill = {
|
|
3140
|
-
...
|
|
3168
|
+
...Pt(e, void 0, !1),
|
|
3141
3169
|
cycleId: t,
|
|
3142
3170
|
status: "filling"
|
|
3143
3171
|
}, t;
|
|
@@ -3155,7 +3183,7 @@ var Fn = class {
|
|
|
3155
3183
|
startInitialAutofill() {
|
|
3156
3184
|
let e = ++this.requestVersion, t = new AbortController(), n = this.beginAutofillCycle();
|
|
3157
3185
|
this.abortController = t, this.state.isLoadingMore = !0;
|
|
3158
|
-
let r =
|
|
3186
|
+
let r = Yt({
|
|
3159
3187
|
cycleId: n,
|
|
3160
3188
|
isCurrent: () => e === this.requestVersion,
|
|
3161
3189
|
onLastCursor: (e) => {
|