@wyxos/vibe 1.6.27 → 1.6.28
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/index.js +922 -893
- package/lib/vibe.css +1 -1
- package/package.json +1 -1
- package/src/Masonry.vue +1020 -1008
- package/src/components/MasonryItem.vue +4 -6
- package/src/createMasonryTransitions.ts +18 -27
- package/src/types.ts +101 -38
- package/src/useMasonryItems.ts +231 -234
- package/src/useMasonryLayout.ts +164 -164
- package/src/useMasonryPagination.ts +83 -19
- package/src/useMasonryVirtualization.ts +1 -1
- package/src/views/Home.vue +2 -2
package/lib/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { nextTick as
|
|
1
|
+
import { nextTick as C, ref as F, computed as Q, defineComponent as Xe, onMounted as Ge, onUnmounted as qe, watch as te, createElementBlock as U, openBlock as _, createCommentVNode as ae, createElementVNode as G, normalizeStyle as he, renderSlot as J, normalizeClass as ie, withModifiers as Re, toDisplayString as Ee, unref as q, Fragment as Ce, renderList as Oe, createVNode as Le, withCtx as ve, mergeProps as fe, TransitionGroup as Pt } from "vue";
|
|
2
2
|
let ke = null;
|
|
3
|
-
function
|
|
3
|
+
function It() {
|
|
4
4
|
if (ke != null) return ke;
|
|
5
5
|
const e = document.createElement("div");
|
|
6
6
|
e.style.visibility = "hidden", e.style.overflow = "scroll", e.style.msOverflowStyle = "scrollbar", e.style.width = "100px", e.style.height = "100px", document.body.appendChild(e);
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
const i = e.offsetWidth -
|
|
7
|
+
const l = document.createElement("div");
|
|
8
|
+
l.style.width = "100%", e.appendChild(l);
|
|
9
|
+
const i = e.offsetWidth - l.offsetWidth;
|
|
10
10
|
return document.body.removeChild(e), ke = i, i;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function Ae(e, l, i, a = {}) {
|
|
13
13
|
const {
|
|
14
|
-
gutterX:
|
|
14
|
+
gutterX: g = 0,
|
|
15
15
|
gutterY: d = 0,
|
|
16
|
-
header:
|
|
16
|
+
header: v = 0,
|
|
17
17
|
footer: o = 0,
|
|
18
|
-
paddingLeft:
|
|
19
|
-
paddingRight:
|
|
18
|
+
paddingLeft: s = 0,
|
|
19
|
+
paddingRight: w = 0,
|
|
20
20
|
sizes: t = {
|
|
21
21
|
base: 1,
|
|
22
22
|
sm: 2,
|
|
@@ -25,190 +25,190 @@ function Ce(e, n, i, a = {}) {
|
|
|
25
25
|
xl: 5,
|
|
26
26
|
"2xl": 6
|
|
27
27
|
},
|
|
28
|
-
placement:
|
|
28
|
+
placement: x = "masonry"
|
|
29
29
|
} = a;
|
|
30
|
-
let T = 0,
|
|
30
|
+
let T = 0, y = 0;
|
|
31
31
|
try {
|
|
32
|
-
if (
|
|
33
|
-
const k = window.getComputedStyle(
|
|
34
|
-
T = parseFloat(k.paddingLeft) || 0,
|
|
32
|
+
if (l && l.nodeType === 1 && typeof window < "u" && window.getComputedStyle) {
|
|
33
|
+
const k = window.getComputedStyle(l);
|
|
34
|
+
T = parseFloat(k.paddingLeft) || 0, y = parseFloat(k.paddingRight) || 0;
|
|
35
35
|
}
|
|
36
36
|
} catch {
|
|
37
37
|
}
|
|
38
|
-
const h = (
|
|
39
|
-
const
|
|
40
|
-
return Math.round(L *
|
|
38
|
+
const h = (s || 0) + T, P = (w || 0) + y, I = l.offsetWidth - l.clientWidth, f = I > 0 ? I + 2 : It() + 2, r = l.offsetWidth - f - h - P, u = g * (i - 1), L = Math.floor((r - u) / i), M = e.map((k) => {
|
|
39
|
+
const B = k.width, R = k.height;
|
|
40
|
+
return Math.round(L * R / B) + o + v;
|
|
41
41
|
});
|
|
42
|
-
if (
|
|
42
|
+
if (x === "sequential-balanced") {
|
|
43
43
|
const k = M.length;
|
|
44
44
|
if (k === 0) return [];
|
|
45
|
-
const
|
|
46
|
-
let
|
|
47
|
-
const
|
|
48
|
-
let
|
|
49
|
-
for (let
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
52
|
-
|
|
53
|
-
else if (
|
|
45
|
+
const B = (b, E, O) => b + (E > 0 ? d : 0) + O;
|
|
46
|
+
let R = Math.max(...M), $ = M.reduce((b, E) => b + E, 0) + d * Math.max(0, k - 1);
|
|
47
|
+
const W = (b) => {
|
|
48
|
+
let E = 1, O = 0, ne = 0;
|
|
49
|
+
for (let X = 0; X < k; X++) {
|
|
50
|
+
const Z = M[X], K = B(O, ne, Z);
|
|
51
|
+
if (K <= b)
|
|
52
|
+
O = K, ne++;
|
|
53
|
+
else if (E++, O = Z, ne = 1, Z > b || E > i) return !1;
|
|
54
54
|
}
|
|
55
|
-
return
|
|
55
|
+
return E <= i;
|
|
56
56
|
};
|
|
57
|
-
for (;
|
|
58
|
-
const b = Math.floor((
|
|
59
|
-
|
|
57
|
+
for (; R < $; ) {
|
|
58
|
+
const b = Math.floor((R + $) / 2);
|
|
59
|
+
W(b) ? $ = b : R = b + 1;
|
|
60
60
|
}
|
|
61
|
-
const
|
|
62
|
-
let
|
|
61
|
+
const H = $, n = new Array(i).fill(0);
|
|
62
|
+
let p = i - 1, S = 0, z = 0;
|
|
63
63
|
for (let b = k - 1; b >= 0; b--) {
|
|
64
|
-
const
|
|
65
|
-
!(
|
|
64
|
+
const E = M[b], O = b < p;
|
|
65
|
+
!(B(S, z, E) <= H) || O ? (n[p] = b + 1, p--, S = E, z = 1) : (S = B(S, z, E), z++);
|
|
66
66
|
}
|
|
67
|
-
|
|
68
|
-
const V = [],
|
|
67
|
+
n[0] = 0;
|
|
68
|
+
const V = [], Y = new Array(i).fill(0);
|
|
69
69
|
for (let b = 0; b < i; b++) {
|
|
70
|
-
const
|
|
71
|
-
for (let
|
|
72
|
-
const
|
|
73
|
-
...e[
|
|
70
|
+
const E = n[b], O = b + 1 < i ? n[b + 1] : k, ne = b * (L + g);
|
|
71
|
+
for (let X = E; X < O; X++) {
|
|
72
|
+
const K = {
|
|
73
|
+
...e[X],
|
|
74
74
|
columnWidth: L,
|
|
75
75
|
imageHeight: 0,
|
|
76
76
|
columnHeight: 0,
|
|
77
77
|
left: 0,
|
|
78
78
|
top: 0
|
|
79
79
|
};
|
|
80
|
-
|
|
80
|
+
K.imageHeight = M[X] - (o + v), K.columnHeight = M[X], K.left = ne, K.top = Y[b], Y[b] += K.columnHeight + (X + 1 < O ? d : 0), V.push(K);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
return V;
|
|
84
84
|
}
|
|
85
|
-
const
|
|
85
|
+
const m = new Array(i).fill(0), N = [];
|
|
86
86
|
for (let k = 0; k < e.length; k++) {
|
|
87
|
-
const
|
|
88
|
-
...
|
|
87
|
+
const B = e[k], R = {
|
|
88
|
+
...B,
|
|
89
89
|
columnWidth: 0,
|
|
90
90
|
imageHeight: 0,
|
|
91
91
|
columnHeight: 0,
|
|
92
92
|
left: 0,
|
|
93
93
|
top: 0
|
|
94
|
-
},
|
|
95
|
-
|
|
94
|
+
}, $ = m.indexOf(Math.min(...m)), W = B.width, H = B.height;
|
|
95
|
+
R.columnWidth = L, R.left = $ * (L + g), R.imageHeight = Math.round(L * H / W), R.columnHeight = R.imageHeight + o + v, R.top = m[$], m[$] += R.columnHeight + d, N.push(R);
|
|
96
96
|
}
|
|
97
|
-
return
|
|
97
|
+
return N;
|
|
98
98
|
}
|
|
99
|
-
var
|
|
99
|
+
var Lt = typeof global == "object" && global && global.Object === Object && global, kt = typeof self == "object" && self && self.Object === Object && self, Je = Lt || kt || Function("return this")(), we = Je.Symbol, Ke = Object.prototype, St = Ke.hasOwnProperty, Et = Ke.toString, de = we ? we.toStringTag : void 0;
|
|
100
100
|
function Ht(e) {
|
|
101
|
-
var
|
|
101
|
+
var l = St.call(e, de), i = e[de];
|
|
102
102
|
try {
|
|
103
103
|
e[de] = void 0;
|
|
104
104
|
var a = !0;
|
|
105
105
|
} catch {
|
|
106
106
|
}
|
|
107
|
-
var
|
|
108
|
-
return a && (
|
|
107
|
+
var g = Et.call(e);
|
|
108
|
+
return a && (l ? e[de] = i : delete e[de]), g;
|
|
109
109
|
}
|
|
110
|
-
var $t = Object.prototype,
|
|
110
|
+
var $t = Object.prototype, Nt = $t.toString;
|
|
111
111
|
function zt(e) {
|
|
112
|
-
return
|
|
112
|
+
return Nt.call(e);
|
|
113
113
|
}
|
|
114
114
|
var Dt = "[object Null]", Bt = "[object Undefined]", Ve = we ? we.toStringTag : void 0;
|
|
115
|
-
function
|
|
115
|
+
function Wt(e) {
|
|
116
116
|
return e == null ? e === void 0 ? Bt : Dt : Ve && Ve in Object(e) ? Ht(e) : zt(e);
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function Ft(e) {
|
|
119
119
|
return e != null && typeof e == "object";
|
|
120
120
|
}
|
|
121
|
-
var
|
|
122
|
-
function
|
|
123
|
-
return typeof e == "symbol" ||
|
|
121
|
+
var Rt = "[object Symbol]";
|
|
122
|
+
function Ct(e) {
|
|
123
|
+
return typeof e == "symbol" || Ft(e) && Wt(e) == Rt;
|
|
124
124
|
}
|
|
125
125
|
var Ot = /\s/;
|
|
126
|
-
function
|
|
127
|
-
for (var
|
|
126
|
+
function At(e) {
|
|
127
|
+
for (var l = e.length; l-- && Ot.test(e.charAt(l)); )
|
|
128
128
|
;
|
|
129
|
-
return
|
|
129
|
+
return l;
|
|
130
130
|
}
|
|
131
131
|
var Vt = /^\s+/;
|
|
132
132
|
function jt(e) {
|
|
133
|
-
return e && e.slice(0,
|
|
133
|
+
return e && e.slice(0, At(e) + 1).replace(Vt, "");
|
|
134
134
|
}
|
|
135
135
|
function He(e) {
|
|
136
|
-
var
|
|
137
|
-
return e != null && (
|
|
136
|
+
var l = typeof e;
|
|
137
|
+
return e != null && (l == "object" || l == "function");
|
|
138
138
|
}
|
|
139
|
-
var je = NaN,
|
|
140
|
-
function
|
|
139
|
+
var je = NaN, Yt = /^[-+]0x[0-9a-f]+$/i, Ut = /^0b[01]+$/i, _t = /^0o[0-7]+$/i, Xt = parseInt;
|
|
140
|
+
function Ye(e) {
|
|
141
141
|
if (typeof e == "number")
|
|
142
142
|
return e;
|
|
143
|
-
if (
|
|
143
|
+
if (Ct(e))
|
|
144
144
|
return je;
|
|
145
145
|
if (He(e)) {
|
|
146
|
-
var
|
|
147
|
-
e = He(
|
|
146
|
+
var l = typeof e.valueOf == "function" ? e.valueOf() : e;
|
|
147
|
+
e = He(l) ? l + "" : l;
|
|
148
148
|
}
|
|
149
149
|
if (typeof e != "string")
|
|
150
150
|
return e === 0 ? e : +e;
|
|
151
151
|
e = jt(e);
|
|
152
|
-
var i =
|
|
153
|
-
return i ||
|
|
152
|
+
var i = Ut.test(e);
|
|
153
|
+
return i || _t.test(e) ? Xt(e.slice(2), i ? 2 : 8) : Yt.test(e) ? je : +e;
|
|
154
154
|
}
|
|
155
|
-
var
|
|
155
|
+
var Se = function() {
|
|
156
156
|
return Je.Date.now();
|
|
157
|
-
},
|
|
158
|
-
function
|
|
159
|
-
var a,
|
|
157
|
+
}, Gt = "Expected a function", qt = Math.max, Jt = Math.min;
|
|
158
|
+
function Ue(e, l, i) {
|
|
159
|
+
var a, g, d, v, o, s, w = 0, t = !1, x = !1, T = !0;
|
|
160
160
|
if (typeof e != "function")
|
|
161
|
-
throw new TypeError(
|
|
162
|
-
|
|
163
|
-
function
|
|
164
|
-
var
|
|
165
|
-
return a =
|
|
161
|
+
throw new TypeError(Gt);
|
|
162
|
+
l = Ye(l) || 0, He(i) && (t = !!i.leading, x = "maxWait" in i, d = x ? qt(Ye(i.maxWait) || 0, l) : d, T = "trailing" in i ? !!i.trailing : T);
|
|
163
|
+
function y(m) {
|
|
164
|
+
var N = a, k = g;
|
|
165
|
+
return a = g = void 0, w = m, v = e.apply(k, N), v;
|
|
166
166
|
}
|
|
167
|
-
function h(
|
|
168
|
-
return
|
|
167
|
+
function h(m) {
|
|
168
|
+
return w = m, o = setTimeout(f, l), t ? y(m) : v;
|
|
169
169
|
}
|
|
170
|
-
function
|
|
171
|
-
var
|
|
172
|
-
return
|
|
170
|
+
function P(m) {
|
|
171
|
+
var N = m - s, k = m - w, B = l - N;
|
|
172
|
+
return x ? Jt(B, d - k) : B;
|
|
173
173
|
}
|
|
174
|
-
function
|
|
175
|
-
var
|
|
176
|
-
return
|
|
174
|
+
function I(m) {
|
|
175
|
+
var N = m - s, k = m - w;
|
|
176
|
+
return s === void 0 || N >= l || N < 0 || x && k >= d;
|
|
177
177
|
}
|
|
178
|
-
function
|
|
179
|
-
var
|
|
180
|
-
if (
|
|
181
|
-
return r(
|
|
182
|
-
o = setTimeout(
|
|
178
|
+
function f() {
|
|
179
|
+
var m = Se();
|
|
180
|
+
if (I(m))
|
|
181
|
+
return r(m);
|
|
182
|
+
o = setTimeout(f, P(m));
|
|
183
183
|
}
|
|
184
|
-
function r(
|
|
185
|
-
return o = void 0, T && a ?
|
|
184
|
+
function r(m) {
|
|
185
|
+
return o = void 0, T && a ? y(m) : (a = g = void 0, v);
|
|
186
186
|
}
|
|
187
|
-
function
|
|
188
|
-
o !== void 0 && clearTimeout(o),
|
|
187
|
+
function u() {
|
|
188
|
+
o !== void 0 && clearTimeout(o), w = 0, a = s = g = o = void 0;
|
|
189
189
|
}
|
|
190
190
|
function L() {
|
|
191
|
-
return o === void 0 ?
|
|
191
|
+
return o === void 0 ? v : r(Se());
|
|
192
192
|
}
|
|
193
193
|
function M() {
|
|
194
|
-
var
|
|
195
|
-
if (a = arguments,
|
|
194
|
+
var m = Se(), N = I(m);
|
|
195
|
+
if (a = arguments, g = this, s = m, N) {
|
|
196
196
|
if (o === void 0)
|
|
197
|
-
return h(
|
|
198
|
-
if (
|
|
199
|
-
return clearTimeout(o), o = setTimeout(
|
|
197
|
+
return h(s);
|
|
198
|
+
if (x)
|
|
199
|
+
return clearTimeout(o), o = setTimeout(f, l), y(s);
|
|
200
200
|
}
|
|
201
|
-
return o === void 0 && (o = setTimeout(
|
|
201
|
+
return o === void 0 && (o = setTimeout(f, l)), v;
|
|
202
202
|
}
|
|
203
|
-
return M.cancel =
|
|
203
|
+
return M.cancel = u, M.flush = L, M;
|
|
204
204
|
}
|
|
205
|
-
function se(e,
|
|
206
|
-
const i =
|
|
205
|
+
function se(e, l) {
|
|
206
|
+
const i = l ?? (typeof window < "u" ? window.innerWidth : 1024), a = e.sizes;
|
|
207
207
|
return i >= 1536 && a["2xl"] ? a["2xl"] : i >= 1280 && a.xl ? a.xl : i >= 1024 && a.lg ? a.lg : i >= 768 && a.md ? a.md : i >= 640 && a.sm ? a.sm : a.base;
|
|
208
208
|
}
|
|
209
209
|
function Kt(e) {
|
|
210
|
-
const
|
|
211
|
-
return
|
|
210
|
+
const l = e ?? (typeof window < "u" ? window.innerWidth : 1024);
|
|
211
|
+
return l >= 1536 ? "2xl" : l >= 1280 ? "xl" : l >= 1024 ? "lg" : l >= 768 ? "md" : l >= 640 ? "sm" : "base";
|
|
212
212
|
}
|
|
213
213
|
function Qt(e) {
|
|
214
214
|
return e.reduce((i, a) => Math.max(i, a.top + a.columnHeight), 0) + 500;
|
|
@@ -222,673 +222,706 @@ function Zt(e) {
|
|
|
222
222
|
height: `${e.columnHeight}px`
|
|
223
223
|
};
|
|
224
224
|
}
|
|
225
|
-
function ea(e,
|
|
225
|
+
function ea(e, l = 0) {
|
|
226
226
|
return {
|
|
227
227
|
style: Zt(e),
|
|
228
228
|
"data-top": e.top,
|
|
229
229
|
"data-left": e.left,
|
|
230
230
|
"data-id": `${e.page}-${e.id}`,
|
|
231
|
-
"data-index":
|
|
231
|
+
"data-index": l
|
|
232
232
|
};
|
|
233
233
|
}
|
|
234
|
-
function $e(e,
|
|
235
|
-
if (!e.length ||
|
|
236
|
-
return new Array(Math.max(1,
|
|
237
|
-
const a = Array.from(new Set(e.map((
|
|
238
|
-
for (let
|
|
234
|
+
function $e(e, l) {
|
|
235
|
+
if (!e.length || l <= 0)
|
|
236
|
+
return new Array(Math.max(1, l)).fill(0);
|
|
237
|
+
const a = Array.from(new Set(e.map((v) => v.left))).sort((v, o) => v - o).slice(0, l), g = /* @__PURE__ */ new Map();
|
|
238
|
+
for (let v = 0; v < a.length; v++) g.set(a[v], v);
|
|
239
239
|
const d = new Array(a.length).fill(0);
|
|
240
|
-
for (const
|
|
241
|
-
const o =
|
|
242
|
-
o != null && (d[o] = Math.max(d[o],
|
|
240
|
+
for (const v of e) {
|
|
241
|
+
const o = g.get(v.left);
|
|
242
|
+
o != null && (d[o] = Math.max(d[o], v.top + v.columnHeight));
|
|
243
243
|
}
|
|
244
|
-
for (; d.length <
|
|
244
|
+
for (; d.length < l; ) d.push(0);
|
|
245
245
|
return d;
|
|
246
246
|
}
|
|
247
|
-
function ta(e,
|
|
247
|
+
function ta(e, l) {
|
|
248
248
|
let i = 0, a = 0;
|
|
249
|
-
const
|
|
250
|
-
function d(t,
|
|
249
|
+
const g = 1e3;
|
|
250
|
+
function d(t, x) {
|
|
251
251
|
var h;
|
|
252
252
|
const T = (h = e.container) == null ? void 0 : h.value;
|
|
253
253
|
if (T) {
|
|
254
|
-
const
|
|
255
|
-
i =
|
|
254
|
+
const P = T.scrollTop, I = T.clientHeight;
|
|
255
|
+
i = P - g, a = P + I + g;
|
|
256
256
|
}
|
|
257
|
-
return t +
|
|
257
|
+
return t + x >= i && t <= a;
|
|
258
258
|
}
|
|
259
|
-
function
|
|
260
|
-
var
|
|
261
|
-
const T = parseInt(t.dataset.left || "0", 10),
|
|
262
|
-
if ((
|
|
263
|
-
t.style.transition = "none", t.style.opacity = "1", t.style.transform = `translate3d(${T}px, ${
|
|
264
|
-
t.style.transition = "", w();
|
|
265
|
-
});
|
|
259
|
+
function v(t, x) {
|
|
260
|
+
var u;
|
|
261
|
+
const T = parseInt(t.dataset.left || "0", 10), y = parseInt(t.dataset.top || "0", 10), h = parseInt(t.dataset.index || "0", 10), P = t.offsetHeight || parseInt(getComputedStyle(t).height || "200", 10) || 200;
|
|
262
|
+
if ((u = l == null ? void 0 : l.virtualizing) != null && u.value) {
|
|
263
|
+
t.style.transition = "none", t.style.opacity = "1", t.style.transform = `translate3d(${T}px, ${y}px, 0) scale(1)`, t.style.removeProperty("--masonry-opacity-delay"), t.style.transition = "", x();
|
|
266
264
|
return;
|
|
267
265
|
}
|
|
268
|
-
if (!d(
|
|
269
|
-
t.style.opacity = "1", t.style.transform = `translate3d(${T}px, ${
|
|
266
|
+
if (!d(y, P)) {
|
|
267
|
+
t.style.opacity = "1", t.style.transform = `translate3d(${T}px, ${y}px, 0) scale(1)`, t.style.transition = "none", x();
|
|
270
268
|
return;
|
|
271
269
|
}
|
|
272
|
-
const
|
|
273
|
-
t.style.setProperty("--masonry-opacity-delay", `${
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
t.addEventListener("transitionend", s);
|
|
279
|
-
});
|
|
270
|
+
const I = Math.min(h * 20, 160), f = t.style.getPropertyValue("--masonry-opacity-delay");
|
|
271
|
+
t.style.setProperty("--masonry-opacity-delay", `${I}ms`), t.style.opacity = "1", t.style.transform = `translate3d(${T}px, ${y}px, 0) scale(1)`;
|
|
272
|
+
const r = () => {
|
|
273
|
+
f ? t.style.setProperty("--masonry-opacity-delay", f) : t.style.removeProperty("--masonry-opacity-delay"), t.removeEventListener("transitionend", r), x();
|
|
274
|
+
};
|
|
275
|
+
t.addEventListener("transitionend", r);
|
|
280
276
|
}
|
|
281
277
|
function o(t) {
|
|
282
|
-
var
|
|
283
|
-
const
|
|
284
|
-
if ((
|
|
285
|
-
t.style.transition = "none", t.style.opacity = "1", t.style.transform = `translate3d(${
|
|
278
|
+
var y;
|
|
279
|
+
const x = parseInt(t.dataset.left || "0", 10), T = parseInt(t.dataset.top || "0", 10);
|
|
280
|
+
if ((y = l == null ? void 0 : l.virtualizing) != null && y.value) {
|
|
281
|
+
t.style.transition = "none", t.style.opacity = "1", t.style.transform = `translate3d(${x}px, ${T}px, 0) scale(1)`, t.style.removeProperty("--masonry-opacity-delay");
|
|
286
282
|
return;
|
|
287
283
|
}
|
|
288
|
-
t.style.opacity = "0", t.style.transform = `translate3d(${
|
|
284
|
+
t.style.opacity = "0", t.style.transform = `translate3d(${x}px, ${T + 10}px, 0) scale(0.985)`;
|
|
289
285
|
}
|
|
290
|
-
function
|
|
286
|
+
function s(t) {
|
|
291
287
|
var h;
|
|
292
|
-
const
|
|
293
|
-
if (!((h =
|
|
294
|
-
if (!d(T,
|
|
288
|
+
const x = parseInt(t.dataset.left || "0", 10), T = parseInt(t.dataset.top || "0", 10), y = t.offsetHeight || parseInt(getComputedStyle(t).height || "200", 10) || 200;
|
|
289
|
+
if (!((h = l == null ? void 0 : l.virtualizing) != null && h.value)) {
|
|
290
|
+
if (!d(T, y)) {
|
|
295
291
|
t.style.transition = "none";
|
|
296
292
|
return;
|
|
297
293
|
}
|
|
298
|
-
t.style.transition = "none", t.style.opacity = "1", t.style.transform = `translate3d(${
|
|
299
|
-
t.style.transition = "";
|
|
300
|
-
});
|
|
294
|
+
t.style.transition = "none", t.style.opacity = "1", t.style.transform = `translate3d(${x}px, ${T}px, 0) scale(1)`, t.style.removeProperty("--masonry-opacity-delay"), t.style.transition = "";
|
|
301
295
|
}
|
|
302
296
|
}
|
|
303
|
-
function
|
|
297
|
+
function w(t, x) {
|
|
304
298
|
var M;
|
|
305
|
-
const T = parseInt(t.dataset.left || "0", 10),
|
|
306
|
-
if ((M =
|
|
307
|
-
|
|
299
|
+
const T = parseInt(t.dataset.left || "0", 10), y = parseInt(t.dataset.top || "0", 10), h = t.offsetHeight || parseInt(getComputedStyle(t).height || "200", 10) || 200;
|
|
300
|
+
if ((M = l == null ? void 0 : l.virtualizing) != null && M.value) {
|
|
301
|
+
x();
|
|
308
302
|
return;
|
|
309
303
|
}
|
|
310
|
-
if (!d(
|
|
311
|
-
t.style.transition = "none", t.style.opacity = "0",
|
|
304
|
+
if (!d(y, h)) {
|
|
305
|
+
t.style.transition = "none", t.style.opacity = "0", x();
|
|
312
306
|
return;
|
|
313
307
|
}
|
|
314
|
-
const
|
|
315
|
-
let
|
|
316
|
-
if (!Number.isFinite(
|
|
317
|
-
const
|
|
318
|
-
|
|
308
|
+
const P = typeof (l == null ? void 0 : l.leaveDurationMs) == "number" ? l.leaveDurationMs : Number.NaN;
|
|
309
|
+
let I = Number.isFinite(P) && P > 0 ? P : Number.NaN;
|
|
310
|
+
if (!Number.isFinite(I)) {
|
|
311
|
+
const N = getComputedStyle(t).getPropertyValue("--masonry-leave-duration") || "", k = parseFloat(N);
|
|
312
|
+
I = Number.isFinite(k) && k > 0 ? k : 200;
|
|
319
313
|
}
|
|
320
|
-
const
|
|
321
|
-
t.removeEventListener("transitionend",
|
|
322
|
-
},
|
|
323
|
-
(!
|
|
314
|
+
const f = t.style.transitionDuration, r = () => {
|
|
315
|
+
t.removeEventListener("transitionend", u), clearTimeout(L), t.style.transitionDuration = f || "";
|
|
316
|
+
}, u = (m) => {
|
|
317
|
+
(!m || m.target === t) && (r(), x());
|
|
324
318
|
}, L = setTimeout(() => {
|
|
325
|
-
r(),
|
|
326
|
-
},
|
|
327
|
-
|
|
328
|
-
t.style.transitionDuration = `${S}ms`, t.style.opacity = "0", t.style.transform = `translate3d(${T}px, ${p + 10}px, 0) scale(0.985)`, t.addEventListener("transitionend", s);
|
|
329
|
-
});
|
|
319
|
+
r(), x();
|
|
320
|
+
}, I + 100);
|
|
321
|
+
t.style.transitionDuration = `${I}ms`, t.style.opacity = "0", t.style.transform = `translate3d(${T}px, ${y + 10}px, 0) scale(0.985)`, t.addEventListener("transitionend", u);
|
|
330
322
|
}
|
|
331
323
|
return {
|
|
332
|
-
onEnter:
|
|
324
|
+
onEnter: v,
|
|
333
325
|
onBeforeEnter: o,
|
|
334
|
-
onBeforeLeave:
|
|
335
|
-
onLeave:
|
|
326
|
+
onBeforeLeave: s,
|
|
327
|
+
onLeave: w
|
|
336
328
|
};
|
|
337
329
|
}
|
|
338
330
|
function aa({
|
|
339
331
|
container: e,
|
|
340
|
-
masonry:
|
|
332
|
+
masonry: l,
|
|
341
333
|
columns: i,
|
|
342
334
|
containerHeight: a,
|
|
343
|
-
isLoading:
|
|
335
|
+
isLoading: g,
|
|
344
336
|
pageSize: d,
|
|
345
|
-
refreshLayout:
|
|
337
|
+
refreshLayout: v,
|
|
346
338
|
setItemsRaw: o,
|
|
347
|
-
loadNext:
|
|
348
|
-
loadThresholdPx:
|
|
339
|
+
loadNext: s,
|
|
340
|
+
loadThresholdPx: w
|
|
349
341
|
}) {
|
|
350
342
|
let t = 0;
|
|
351
|
-
async function
|
|
343
|
+
async function x(T, y = !1) {
|
|
352
344
|
if (!e.value) return;
|
|
353
|
-
const h = T ?? $e(
|
|
345
|
+
const h = T ?? $e(l.value, i.value), P = h.length ? Math.max(...h) : 0, I = e.value.scrollTop + e.value.clientHeight, f = e.value.scrollTop > t + 1;
|
|
354
346
|
t = e.value.scrollTop;
|
|
355
|
-
const r = typeof
|
|
356
|
-
if (
|
|
357
|
-
await
|
|
347
|
+
const r = typeof w == "number" ? w : 200, u = r >= 0 ? Math.max(0, P - r) : Math.max(0, P + r);
|
|
348
|
+
if (I >= u && (f || y) && !g.value) {
|
|
349
|
+
await s(), await C();
|
|
358
350
|
return;
|
|
359
351
|
}
|
|
360
352
|
}
|
|
361
353
|
return {
|
|
362
|
-
handleScroll:
|
|
354
|
+
handleScroll: x
|
|
363
355
|
};
|
|
364
356
|
}
|
|
365
357
|
function na(e) {
|
|
366
|
-
const { useSwipeMode:
|
|
367
|
-
if (!
|
|
368
|
-
const
|
|
369
|
-
return i.value[
|
|
370
|
-
}), h =
|
|
371
|
-
if (!
|
|
372
|
-
const
|
|
373
|
-
return
|
|
374
|
-
}),
|
|
375
|
-
if (!
|
|
376
|
-
const
|
|
377
|
-
return
|
|
358
|
+
const { useSwipeMode: l, masonry: i, isLoading: a, loadNext: g, loadPage: d, paginationHistory: v } = e, o = F(0), s = F(0), w = F(!1), t = F(0), x = F(0), T = F(null), y = Q(() => {
|
|
359
|
+
if (!l.value || i.value.length === 0) return null;
|
|
360
|
+
const $ = Math.max(0, Math.min(o.value, i.value.length - 1));
|
|
361
|
+
return i.value[$] || null;
|
|
362
|
+
}), h = Q(() => {
|
|
363
|
+
if (!l.value || !y.value) return null;
|
|
364
|
+
const $ = o.value + 1;
|
|
365
|
+
return $ >= i.value.length ? null : i.value[$] || null;
|
|
366
|
+
}), P = Q(() => {
|
|
367
|
+
if (!l.value || !y.value) return null;
|
|
368
|
+
const $ = o.value - 1;
|
|
369
|
+
return $ < 0 ? null : i.value[$] || null;
|
|
378
370
|
});
|
|
379
|
-
function
|
|
371
|
+
function I() {
|
|
380
372
|
if (!T.value) return;
|
|
381
|
-
const
|
|
382
|
-
|
|
373
|
+
const $ = T.value.clientHeight;
|
|
374
|
+
s.value = -o.value * $;
|
|
383
375
|
}
|
|
384
|
-
function
|
|
376
|
+
function f() {
|
|
385
377
|
if (!h.value) {
|
|
386
|
-
|
|
378
|
+
g();
|
|
387
379
|
return;
|
|
388
380
|
}
|
|
389
|
-
o.value++,
|
|
381
|
+
o.value++, I(), o.value >= i.value.length - 5 && g();
|
|
390
382
|
}
|
|
391
383
|
function r() {
|
|
392
|
-
|
|
384
|
+
P.value && (o.value--, I());
|
|
393
385
|
}
|
|
394
|
-
function
|
|
395
|
-
|
|
386
|
+
function u($) {
|
|
387
|
+
l.value && (w.value = !0, t.value = $.touches[0].clientY, x.value = s.value, $.preventDefault());
|
|
396
388
|
}
|
|
397
|
-
function L(
|
|
398
|
-
if (!
|
|
399
|
-
const
|
|
400
|
-
|
|
389
|
+
function L($) {
|
|
390
|
+
if (!l.value || !w.value) return;
|
|
391
|
+
const W = $.touches[0].clientY - t.value;
|
|
392
|
+
s.value = x.value + W, $.preventDefault();
|
|
401
393
|
}
|
|
402
|
-
function M(
|
|
403
|
-
if (!
|
|
404
|
-
|
|
405
|
-
const
|
|
406
|
-
Math.abs(
|
|
394
|
+
function M($) {
|
|
395
|
+
if (!l.value || !w.value) return;
|
|
396
|
+
w.value = !1;
|
|
397
|
+
const W = s.value - x.value;
|
|
398
|
+
Math.abs(W) > 100 ? W > 0 && P.value ? r() : W < 0 && h.value ? f() : I() : I(), $.preventDefault();
|
|
407
399
|
}
|
|
408
|
-
function
|
|
409
|
-
|
|
400
|
+
function m($) {
|
|
401
|
+
l.value && (w.value = !0, t.value = $.clientY, x.value = s.value, $.preventDefault());
|
|
410
402
|
}
|
|
411
|
-
function $
|
|
412
|
-
if (!
|
|
413
|
-
const
|
|
414
|
-
|
|
403
|
+
function N($) {
|
|
404
|
+
if (!l.value || !w.value) return;
|
|
405
|
+
const W = $.clientY - t.value;
|
|
406
|
+
s.value = x.value + W, $.preventDefault();
|
|
415
407
|
}
|
|
416
|
-
function k(
|
|
417
|
-
if (!
|
|
418
|
-
|
|
419
|
-
const
|
|
420
|
-
Math.abs(
|
|
408
|
+
function k($) {
|
|
409
|
+
if (!l.value || !w.value) return;
|
|
410
|
+
w.value = !1;
|
|
411
|
+
const W = s.value - x.value;
|
|
412
|
+
Math.abs(W) > 100 ? W > 0 && P.value ? r() : W < 0 && h.value ? f() : I() : I(), $.preventDefault();
|
|
421
413
|
}
|
|
422
|
-
function
|
|
423
|
-
!
|
|
414
|
+
function B() {
|
|
415
|
+
!l.value && o.value > 0 && (o.value = 0, s.value = 0), l.value && i.value.length === 0 && !a.value && d(v.value[0]), l.value && I();
|
|
424
416
|
}
|
|
425
|
-
function
|
|
426
|
-
o.value = 0,
|
|
417
|
+
function R() {
|
|
418
|
+
o.value = 0, s.value = 0, w.value = !1;
|
|
427
419
|
}
|
|
428
420
|
return {
|
|
429
421
|
// State
|
|
430
422
|
currentSwipeIndex: o,
|
|
431
|
-
swipeOffset:
|
|
432
|
-
isDragging:
|
|
423
|
+
swipeOffset: s,
|
|
424
|
+
isDragging: w,
|
|
433
425
|
swipeContainer: T,
|
|
434
426
|
// Computed
|
|
435
|
-
currentItem:
|
|
427
|
+
currentItem: y,
|
|
436
428
|
nextItem: h,
|
|
437
|
-
previousItem:
|
|
429
|
+
previousItem: P,
|
|
438
430
|
// Functions
|
|
439
|
-
handleTouchStart:
|
|
431
|
+
handleTouchStart: u,
|
|
440
432
|
handleTouchMove: L,
|
|
441
433
|
handleTouchEnd: M,
|
|
442
|
-
handleMouseDown:
|
|
443
|
-
handleMouseMove:
|
|
434
|
+
handleMouseDown: m,
|
|
435
|
+
handleMouseMove: N,
|
|
444
436
|
handleMouseUp: k,
|
|
445
|
-
goToNextItem:
|
|
437
|
+
goToNextItem: f,
|
|
446
438
|
goToPreviousItem: r,
|
|
447
|
-
snapToCurrentItem:
|
|
448
|
-
handleWindowResize:
|
|
449
|
-
reset:
|
|
439
|
+
snapToCurrentItem: I,
|
|
440
|
+
handleWindowResize: B,
|
|
441
|
+
reset: R
|
|
450
442
|
};
|
|
451
443
|
}
|
|
452
|
-
function
|
|
444
|
+
function ge(e) {
|
|
453
445
|
return e instanceof Error ? e : new Error(String(e));
|
|
454
446
|
}
|
|
455
447
|
function la(e) {
|
|
456
448
|
const {
|
|
457
|
-
getPage:
|
|
449
|
+
getPage: l,
|
|
458
450
|
context: i,
|
|
459
451
|
masonry: a,
|
|
460
|
-
isLoading:
|
|
452
|
+
isLoading: g,
|
|
461
453
|
hasReachedEnd: d,
|
|
462
|
-
loadError:
|
|
454
|
+
loadError: v,
|
|
463
455
|
currentPage: o,
|
|
464
|
-
paginationHistory:
|
|
465
|
-
refreshLayout:
|
|
456
|
+
paginationHistory: s,
|
|
457
|
+
refreshLayout: w,
|
|
466
458
|
retryMaxAttempts: t,
|
|
467
|
-
retryInitialDelayMs:
|
|
459
|
+
retryInitialDelayMs: x,
|
|
468
460
|
retryBackoffStepMs: T,
|
|
469
|
-
mode:
|
|
461
|
+
mode: y,
|
|
470
462
|
backfillDelayMs: h,
|
|
471
|
-
backfillMaxCalls:
|
|
472
|
-
pageSize:
|
|
473
|
-
emits:
|
|
474
|
-
} = e, r =
|
|
475
|
-
let
|
|
476
|
-
function L(
|
|
477
|
-
return a.value.filter((
|
|
463
|
+
backfillMaxCalls: P,
|
|
464
|
+
pageSize: I,
|
|
465
|
+
emits: f
|
|
466
|
+
} = e, r = F(!1);
|
|
467
|
+
let u = !1;
|
|
468
|
+
function L(H) {
|
|
469
|
+
return a.value.filter((n) => n.page === H).length;
|
|
478
470
|
}
|
|
479
|
-
function M(
|
|
480
|
-
return new Promise((
|
|
481
|
-
const
|
|
482
|
-
|
|
471
|
+
function M(H, n) {
|
|
472
|
+
return new Promise((p) => {
|
|
473
|
+
const S = Math.max(0, H | 0), z = Date.now();
|
|
474
|
+
n(S, S);
|
|
483
475
|
const V = setInterval(() => {
|
|
484
476
|
if (r.value) {
|
|
485
|
-
clearInterval(V),
|
|
477
|
+
clearInterval(V), p();
|
|
486
478
|
return;
|
|
487
479
|
}
|
|
488
|
-
const
|
|
489
|
-
|
|
480
|
+
const Y = Date.now() - z, b = Math.max(0, S - Y);
|
|
481
|
+
n(b, S), b <= 0 && (clearInterval(V), p());
|
|
490
482
|
}, 100);
|
|
491
483
|
});
|
|
492
484
|
}
|
|
493
|
-
async function
|
|
494
|
-
let
|
|
495
|
-
const
|
|
496
|
-
let
|
|
485
|
+
async function m(H) {
|
|
486
|
+
let n = 0;
|
|
487
|
+
const p = t;
|
|
488
|
+
let S = x;
|
|
497
489
|
for (; ; )
|
|
498
490
|
try {
|
|
499
|
-
const
|
|
500
|
-
return
|
|
501
|
-
} catch (
|
|
502
|
-
if (
|
|
503
|
-
throw
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
}),
|
|
491
|
+
const z = await H();
|
|
492
|
+
return n > 0 && f("retry:stop", { attempt: n, success: !0 }), z;
|
|
493
|
+
} catch (z) {
|
|
494
|
+
if (n++, n > p)
|
|
495
|
+
throw f("retry:stop", { attempt: n - 1, success: !1 }), z;
|
|
496
|
+
f("retry:start", { attempt: n, max: p, totalMs: S }), await M(S, (V, Y) => {
|
|
497
|
+
f("retry:tick", { attempt: n, remainingMs: V, totalMs: Y });
|
|
498
|
+
}), S += T;
|
|
507
499
|
}
|
|
508
500
|
}
|
|
509
|
-
async function
|
|
501
|
+
async function N(H) {
|
|
510
502
|
try {
|
|
511
|
-
const
|
|
512
|
-
return
|
|
513
|
-
} catch (
|
|
514
|
-
throw
|
|
503
|
+
const n = await m(() => l(H, i == null ? void 0 : i.value)), p = [...a.value, ...n.items];
|
|
504
|
+
return a.value = p, await C(), await C(), await C(), w(p), n;
|
|
505
|
+
} catch (n) {
|
|
506
|
+
throw n;
|
|
515
507
|
}
|
|
516
508
|
}
|
|
517
|
-
async function k(
|
|
518
|
-
if (!
|
|
519
|
-
const
|
|
520
|
-
if (!
|
|
521
|
-
if (
|
|
509
|
+
async function k(H, n = !1) {
|
|
510
|
+
if (!n && y !== "backfill" || u || r.value || d.value) return;
|
|
511
|
+
const p = (H || 0) + (I || 0);
|
|
512
|
+
if (!I || I <= 0) return;
|
|
513
|
+
if (s.value[s.value.length - 1] == null) {
|
|
522
514
|
d.value = !0;
|
|
523
515
|
return;
|
|
524
516
|
}
|
|
525
|
-
if (!(a.value.length >=
|
|
526
|
-
|
|
517
|
+
if (!(a.value.length >= p)) {
|
|
518
|
+
u = !0, g.value || (g.value = !0, f("loading:start"));
|
|
527
519
|
try {
|
|
528
|
-
let
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
520
|
+
let z = 0;
|
|
521
|
+
const V = o.value, Y = s.value[s.value.length - 1];
|
|
522
|
+
for (f("backfill:start", {
|
|
523
|
+
target: p,
|
|
524
|
+
fetched: a.value.length,
|
|
525
|
+
calls: z,
|
|
526
|
+
currentPage: V,
|
|
527
|
+
nextPage: Y
|
|
528
|
+
}); a.value.length < p && z < P && s.value[s.value.length - 1] != null && !r.value && !d.value && u; ) {
|
|
529
|
+
const O = o.value, ne = s.value[s.value.length - 1];
|
|
530
|
+
if (await M(h, (Z, K) => {
|
|
531
|
+
f("backfill:tick", {
|
|
532
|
+
fetched: a.value.length,
|
|
533
|
+
target: p,
|
|
534
|
+
calls: z,
|
|
535
|
+
remainingMs: Z,
|
|
536
|
+
totalMs: K,
|
|
537
|
+
currentPage: O,
|
|
538
|
+
nextPage: ne
|
|
539
|
+
});
|
|
540
|
+
}), r.value || !u) break;
|
|
541
|
+
const X = s.value[s.value.length - 1];
|
|
542
|
+
if (X == null) {
|
|
540
543
|
d.value = !0;
|
|
541
544
|
break;
|
|
542
545
|
}
|
|
543
546
|
try {
|
|
544
|
-
if (r.value || !
|
|
545
|
-
const
|
|
546
|
-
if (r.value || !
|
|
547
|
-
|
|
548
|
-
} catch (
|
|
549
|
-
if (r.value || !
|
|
550
|
-
|
|
547
|
+
if (r.value || !u) break;
|
|
548
|
+
const Z = await N(X);
|
|
549
|
+
if (r.value || !u) break;
|
|
550
|
+
v.value = null, o.value = X, s.value.push(Z.nextPage), Z.nextPage == null && (d.value = !0);
|
|
551
|
+
} catch (Z) {
|
|
552
|
+
if (r.value || !u) break;
|
|
553
|
+
v.value = ge(Z);
|
|
551
554
|
}
|
|
552
|
-
|
|
555
|
+
z++;
|
|
553
556
|
}
|
|
554
|
-
|
|
557
|
+
const b = o.value, E = s.value[s.value.length - 1];
|
|
558
|
+
f("backfill:stop", {
|
|
559
|
+
fetched: a.value.length,
|
|
560
|
+
calls: z,
|
|
561
|
+
currentPage: b,
|
|
562
|
+
nextPage: E
|
|
563
|
+
});
|
|
555
564
|
} finally {
|
|
556
|
-
|
|
565
|
+
u = !1, g.value = !1;
|
|
566
|
+
const z = o.value, V = s.value[s.value.length - 1];
|
|
567
|
+
f("loading:stop", {
|
|
568
|
+
fetched: a.value.length,
|
|
569
|
+
currentPage: z,
|
|
570
|
+
nextPage: V
|
|
571
|
+
});
|
|
557
572
|
}
|
|
558
573
|
}
|
|
559
574
|
}
|
|
560
|
-
async function
|
|
561
|
-
if (!
|
|
562
|
-
r.value = !1,
|
|
575
|
+
async function B(H) {
|
|
576
|
+
if (!g.value) {
|
|
577
|
+
r.value = !1, g.value || (g.value = !0, f("loading:start")), d.value = !1, v.value = null;
|
|
563
578
|
try {
|
|
564
|
-
const
|
|
579
|
+
const n = a.value.length;
|
|
565
580
|
if (r.value) return;
|
|
566
|
-
const
|
|
567
|
-
return r.value ? void 0 : (
|
|
568
|
-
} catch (
|
|
569
|
-
throw
|
|
581
|
+
const p = await N(H);
|
|
582
|
+
return r.value ? void 0 : (v.value = null, o.value = H, s.value.push(p.nextPage), p.nextPage == null && (d.value = !0), await k(n), p);
|
|
583
|
+
} catch (n) {
|
|
584
|
+
throw v.value = ge(n), n;
|
|
570
585
|
} finally {
|
|
571
|
-
|
|
586
|
+
g.value = !1;
|
|
572
587
|
}
|
|
573
588
|
}
|
|
574
589
|
}
|
|
575
|
-
async function
|
|
576
|
-
if (!
|
|
577
|
-
r.value = !1,
|
|
590
|
+
async function R() {
|
|
591
|
+
if (!g.value && !d.value) {
|
|
592
|
+
r.value = !1, g.value || (g.value = !0, f("loading:start")), v.value = null;
|
|
578
593
|
try {
|
|
579
|
-
const
|
|
594
|
+
const H = a.value.length;
|
|
580
595
|
if (r.value) return;
|
|
581
|
-
if (
|
|
582
|
-
const
|
|
596
|
+
if (y === "refresh" && o.value != null && L(o.value) < I) {
|
|
597
|
+
const z = await m(() => l(o.value, i == null ? void 0 : i.value));
|
|
583
598
|
if (r.value) return;
|
|
584
|
-
const V = [...a.value],
|
|
585
|
-
if (
|
|
586
|
-
const
|
|
587
|
-
|
|
599
|
+
const V = [...a.value], Y = z.items.filter((E) => !E || E.id == null || E.page == null ? !1 : !V.some((O) => O && O.id === E.id && O.page === E.page));
|
|
600
|
+
if (Y.length > 0) {
|
|
601
|
+
const E = [...a.value, ...Y];
|
|
602
|
+
a.value = E, await C(), await C(), await C(), w(E);
|
|
588
603
|
}
|
|
589
|
-
if (
|
|
590
|
-
const
|
|
591
|
-
if (
|
|
604
|
+
if (v.value = null, Y.length === 0) {
|
|
605
|
+
const E = s.value[s.value.length - 1];
|
|
606
|
+
if (E == null) {
|
|
592
607
|
d.value = !0;
|
|
593
608
|
return;
|
|
594
609
|
}
|
|
595
|
-
const
|
|
596
|
-
return r.value ? void 0 : (
|
|
610
|
+
const O = await N(E);
|
|
611
|
+
return r.value ? void 0 : (v.value = null, o.value = E, s.value.push(O.nextPage), O.nextPage == null && (d.value = !0), await k(H), O);
|
|
597
612
|
}
|
|
598
|
-
if (L(o.value) >=
|
|
599
|
-
const
|
|
600
|
-
if (
|
|
613
|
+
if (L(o.value) >= I) {
|
|
614
|
+
const E = s.value[s.value.length - 1];
|
|
615
|
+
if (E == null) {
|
|
601
616
|
d.value = !0;
|
|
602
617
|
return;
|
|
603
618
|
}
|
|
604
|
-
const
|
|
605
|
-
return r.value ? void 0 : (
|
|
619
|
+
const O = await N(E);
|
|
620
|
+
return r.value ? void 0 : (v.value = null, o.value = E, s.value.push(O.nextPage), O.nextPage == null && (d.value = !0), await k(H), O);
|
|
606
621
|
} else
|
|
607
|
-
return
|
|
622
|
+
return z;
|
|
608
623
|
}
|
|
609
|
-
const
|
|
610
|
-
if (
|
|
624
|
+
const n = s.value[s.value.length - 1];
|
|
625
|
+
if (n == null) {
|
|
611
626
|
d.value = !0;
|
|
612
627
|
return;
|
|
613
628
|
}
|
|
614
|
-
const
|
|
615
|
-
return r.value ? void 0 : (
|
|
616
|
-
} catch (
|
|
617
|
-
throw
|
|
629
|
+
const p = await N(n);
|
|
630
|
+
return r.value ? void 0 : (v.value = null, o.value = n, s.value.push(p.nextPage), p.nextPage == null && (d.value = !0), await k(H), p);
|
|
631
|
+
} catch (H) {
|
|
632
|
+
throw v.value = ge(H), H;
|
|
618
633
|
} finally {
|
|
619
|
-
|
|
634
|
+
g.value = !1;
|
|
635
|
+
const H = o.value, n = s.value[s.value.length - 1];
|
|
636
|
+
f("loading:stop", {
|
|
637
|
+
fetched: a.value.length,
|
|
638
|
+
currentPage: H,
|
|
639
|
+
nextPage: n
|
|
640
|
+
});
|
|
620
641
|
}
|
|
621
642
|
}
|
|
622
643
|
}
|
|
623
|
-
async function
|
|
624
|
-
if (!
|
|
625
|
-
r.value = !1,
|
|
644
|
+
async function $() {
|
|
645
|
+
if (!g.value) {
|
|
646
|
+
r.value = !1, g.value = !0, f("loading:start");
|
|
626
647
|
try {
|
|
627
|
-
const
|
|
628
|
-
if (
|
|
629
|
-
console.warn("[Masonry] No current page to refresh - currentPage:", o.value, "paginationHistory:",
|
|
648
|
+
const H = o.value;
|
|
649
|
+
if (H == null) {
|
|
650
|
+
console.warn("[Masonry] No current page to refresh - currentPage:", o.value, "paginationHistory:", s.value);
|
|
630
651
|
return;
|
|
631
652
|
}
|
|
632
|
-
a.value = [], d.value = !1,
|
|
633
|
-
const
|
|
653
|
+
a.value = [], d.value = !1, v.value = null, s.value = [H];
|
|
654
|
+
const n = await N(H);
|
|
634
655
|
if (r.value) return;
|
|
635
|
-
|
|
636
|
-
const
|
|
637
|
-
return await k(
|
|
638
|
-
} catch (
|
|
639
|
-
throw
|
|
656
|
+
v.value = null, o.value = H, s.value.push(n.nextPage), n.nextPage == null && (d.value = !0);
|
|
657
|
+
const p = a.value.length;
|
|
658
|
+
return await k(p), n;
|
|
659
|
+
} catch (H) {
|
|
660
|
+
throw v.value = ge(H), H;
|
|
640
661
|
} finally {
|
|
641
|
-
|
|
662
|
+
g.value = !1;
|
|
663
|
+
const H = o.value, n = s.value[s.value.length - 1];
|
|
664
|
+
f("loading:stop", {
|
|
665
|
+
fetched: a.value.length,
|
|
666
|
+
currentPage: H,
|
|
667
|
+
nextPage: n
|
|
668
|
+
});
|
|
642
669
|
}
|
|
643
670
|
}
|
|
644
671
|
}
|
|
645
|
-
function
|
|
646
|
-
const
|
|
647
|
-
r.value = !0,
|
|
672
|
+
function W() {
|
|
673
|
+
const H = u;
|
|
674
|
+
r.value = !0, g.value = !1, u = !1;
|
|
675
|
+
const n = o.value, p = s.value[s.value.length - 1];
|
|
676
|
+
H && f("backfill:stop", {
|
|
677
|
+
fetched: a.value.length,
|
|
678
|
+
calls: 0,
|
|
679
|
+
cancelled: !0,
|
|
680
|
+
currentPage: n,
|
|
681
|
+
nextPage: p
|
|
682
|
+
}), f("loading:stop", {
|
|
683
|
+
fetched: a.value.length,
|
|
684
|
+
currentPage: n,
|
|
685
|
+
nextPage: p
|
|
686
|
+
});
|
|
648
687
|
}
|
|
649
688
|
return {
|
|
650
|
-
loadPage:
|
|
651
|
-
loadNext:
|
|
652
|
-
refreshCurrentPage:
|
|
653
|
-
cancelLoad:
|
|
689
|
+
loadPage: B,
|
|
690
|
+
loadNext: R,
|
|
691
|
+
refreshCurrentPage: $,
|
|
692
|
+
cancelLoad: W,
|
|
654
693
|
maybeBackfillToTarget: k,
|
|
655
|
-
getContent:
|
|
694
|
+
getContent: N
|
|
656
695
|
};
|
|
657
696
|
}
|
|
658
697
|
function oa(e) {
|
|
659
698
|
const {
|
|
660
|
-
masonry:
|
|
699
|
+
masonry: l,
|
|
661
700
|
useSwipeMode: i,
|
|
662
701
|
refreshLayout: a,
|
|
663
|
-
loadNext:
|
|
702
|
+
loadNext: g,
|
|
664
703
|
maybeBackfillToTarget: d,
|
|
665
|
-
paginationHistory:
|
|
704
|
+
paginationHistory: v
|
|
666
705
|
} = e;
|
|
667
|
-
let o = /* @__PURE__ */ new Set(),
|
|
706
|
+
let o = /* @__PURE__ */ new Set(), s = null, w = !1;
|
|
668
707
|
async function t() {
|
|
669
|
-
if (o.size === 0 ||
|
|
670
|
-
|
|
671
|
-
const
|
|
672
|
-
o.clear(),
|
|
708
|
+
if (o.size === 0 || w) return;
|
|
709
|
+
w = !0;
|
|
710
|
+
const f = Array.from(o);
|
|
711
|
+
o.clear(), s = null, await T(f), w = !1;
|
|
673
712
|
}
|
|
674
|
-
async function
|
|
675
|
-
o.add(
|
|
713
|
+
async function x(f) {
|
|
714
|
+
o.add(f), s && clearTimeout(s), s = setTimeout(() => {
|
|
676
715
|
t();
|
|
677
716
|
}, 16);
|
|
678
717
|
}
|
|
679
|
-
async function T(
|
|
680
|
-
if (!
|
|
681
|
-
const r = new Set(
|
|
682
|
-
if (
|
|
718
|
+
async function T(f) {
|
|
719
|
+
if (!f || f.length === 0) return;
|
|
720
|
+
const r = new Set(f.map((L) => L.id)), u = l.value.filter((L) => !r.has(L.id));
|
|
721
|
+
if (l.value = u, await C(), u.length === 0 && v.value.length > 0) {
|
|
683
722
|
try {
|
|
684
|
-
await
|
|
723
|
+
await g(), await d(0, !0);
|
|
685
724
|
} catch {
|
|
686
725
|
}
|
|
687
726
|
return;
|
|
688
727
|
}
|
|
689
|
-
await
|
|
690
|
-
a(s);
|
|
691
|
-
});
|
|
728
|
+
await C(), await C(), a(u);
|
|
692
729
|
}
|
|
693
|
-
async function
|
|
694
|
-
!
|
|
730
|
+
async function y(f) {
|
|
731
|
+
!f || f.length === 0 || (f.forEach((r) => o.add(r)), s && clearTimeout(s), s = setTimeout(() => {
|
|
695
732
|
t();
|
|
696
733
|
}, 16));
|
|
697
734
|
}
|
|
698
|
-
async function h(
|
|
699
|
-
if (!
|
|
700
|
-
const
|
|
701
|
-
if (
|
|
702
|
-
const M = [...
|
|
703
|
-
M.splice(
|
|
704
|
-
a(M);
|
|
705
|
-
}));
|
|
735
|
+
async function h(f, r) {
|
|
736
|
+
if (!f) return;
|
|
737
|
+
const u = l.value;
|
|
738
|
+
if (u.findIndex((N) => N.id === f.id) !== -1) return;
|
|
739
|
+
const M = [...u], m = Math.min(r, M.length);
|
|
740
|
+
M.splice(m, 0, f), l.value = M, await C(), i.value || (await C(), await C(), a(M));
|
|
706
741
|
}
|
|
707
|
-
async function
|
|
708
|
-
var
|
|
709
|
-
if (!
|
|
710
|
-
if (!r || r.length !==
|
|
742
|
+
async function P(f, r) {
|
|
743
|
+
var $;
|
|
744
|
+
if (!f || f.length === 0) return;
|
|
745
|
+
if (!r || r.length !== f.length) {
|
|
711
746
|
console.warn("[Masonry] restoreMany: items and indices arrays must have the same length");
|
|
712
747
|
return;
|
|
713
748
|
}
|
|
714
|
-
const
|
|
715
|
-
for (let
|
|
716
|
-
L.has((
|
|
749
|
+
const u = l.value, L = new Set(u.map((W) => W.id)), M = [];
|
|
750
|
+
for (let W = 0; W < f.length; W++)
|
|
751
|
+
L.has(($ = f[W]) == null ? void 0 : $.id) || M.push({ item: f[W], index: r[W] });
|
|
717
752
|
if (M.length === 0) return;
|
|
718
|
-
const
|
|
719
|
-
for (const { item:
|
|
720
|
-
|
|
721
|
-
const
|
|
722
|
-
let
|
|
723
|
-
for (let
|
|
724
|
-
|
|
725
|
-
for (;
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
a(N);
|
|
729
|
-
}));
|
|
753
|
+
const m = /* @__PURE__ */ new Map();
|
|
754
|
+
for (const { item: W, index: H } of M)
|
|
755
|
+
m.set(H, W);
|
|
756
|
+
const N = M.length > 0 ? Math.max(...M.map(({ index: W }) => W)) : -1, k = Math.max(u.length - 1, N), B = [];
|
|
757
|
+
let R = 0;
|
|
758
|
+
for (let W = 0; W <= k; W++)
|
|
759
|
+
m.has(W) ? B.push(m.get(W)) : R < u.length && (B.push(u[R]), R++);
|
|
760
|
+
for (; R < u.length; )
|
|
761
|
+
B.push(u[R]), R++;
|
|
762
|
+
l.value = B, await C(), i.value || (await C(), await C(), a(B));
|
|
730
763
|
}
|
|
731
|
-
async function
|
|
732
|
-
|
|
764
|
+
async function I() {
|
|
765
|
+
l.value = [];
|
|
733
766
|
}
|
|
734
767
|
return {
|
|
735
|
-
remove:
|
|
736
|
-
removeMany:
|
|
768
|
+
remove: x,
|
|
769
|
+
removeMany: y,
|
|
737
770
|
restore: h,
|
|
738
|
-
restoreMany:
|
|
739
|
-
removeAll:
|
|
771
|
+
restoreMany: P,
|
|
772
|
+
removeAll: I
|
|
740
773
|
};
|
|
741
774
|
}
|
|
742
775
|
function ra(e) {
|
|
743
776
|
const {
|
|
744
|
-
masonry:
|
|
777
|
+
masonry: l,
|
|
745
778
|
useSwipeMode: i,
|
|
746
779
|
container: a,
|
|
747
|
-
columns:
|
|
780
|
+
columns: g,
|
|
748
781
|
containerWidth: d,
|
|
749
|
-
masonryContentHeight:
|
|
782
|
+
masonryContentHeight: v,
|
|
750
783
|
layout: o,
|
|
751
|
-
fixedDimensions:
|
|
752
|
-
checkItemDimensions:
|
|
784
|
+
fixedDimensions: s,
|
|
785
|
+
checkItemDimensions: w
|
|
753
786
|
} = e;
|
|
754
787
|
let t = [];
|
|
755
|
-
function
|
|
756
|
-
const
|
|
757
|
-
let
|
|
788
|
+
function x(P) {
|
|
789
|
+
const I = Qt(P);
|
|
790
|
+
let f = 0;
|
|
758
791
|
if (a.value) {
|
|
759
|
-
const { scrollTop: r, clientHeight:
|
|
760
|
-
|
|
792
|
+
const { scrollTop: r, clientHeight: u } = a.value;
|
|
793
|
+
f = r + u + 100;
|
|
761
794
|
}
|
|
762
|
-
|
|
795
|
+
v.value = Math.max(I, f);
|
|
763
796
|
}
|
|
764
|
-
function T(
|
|
765
|
-
var
|
|
797
|
+
function T(P) {
|
|
798
|
+
var u, L;
|
|
766
799
|
if (i.value) {
|
|
767
|
-
|
|
800
|
+
l.value = P;
|
|
768
801
|
return;
|
|
769
802
|
}
|
|
770
|
-
if (
|
|
771
|
-
if (
|
|
803
|
+
if (l.value = P, !a.value) return;
|
|
804
|
+
if (w(P, "refreshLayout"), P.length > 1e3 && t.length > P.length && t.length - P.length < 100) {
|
|
772
805
|
let M = !0;
|
|
773
|
-
for (let
|
|
774
|
-
if (((
|
|
806
|
+
for (let m = 0; m < P.length; m++)
|
|
807
|
+
if (((u = P[m]) == null ? void 0 : u.id) !== ((L = t[m]) == null ? void 0 : L.id)) {
|
|
775
808
|
M = !1;
|
|
776
809
|
break;
|
|
777
810
|
}
|
|
778
811
|
if (M) {
|
|
779
|
-
const
|
|
812
|
+
const m = P.map((N, k) => ({
|
|
780
813
|
...t[k],
|
|
781
814
|
originalIndex: k
|
|
782
815
|
}));
|
|
783
|
-
|
|
816
|
+
x(m), l.value = m, t = m;
|
|
784
817
|
return;
|
|
785
818
|
}
|
|
786
819
|
}
|
|
787
|
-
const
|
|
820
|
+
const f = P.map((M, m) => ({
|
|
788
821
|
...M,
|
|
789
|
-
originalIndex:
|
|
822
|
+
originalIndex: m
|
|
790
823
|
})), r = a.value;
|
|
791
|
-
if (
|
|
792
|
-
const M = r.style.width,
|
|
793
|
-
r.style.boxSizing = "border-box", r.style.width = `${
|
|
794
|
-
const
|
|
795
|
-
r.style.width = M, r.style.boxSizing =
|
|
824
|
+
if (s.value && s.value.width !== void 0) {
|
|
825
|
+
const M = r.style.width, m = r.style.boxSizing;
|
|
826
|
+
r.style.boxSizing = "border-box", r.style.width = `${s.value.width}px`, r.offsetWidth;
|
|
827
|
+
const N = Ae(f, r, g.value, o.value);
|
|
828
|
+
r.style.width = M, r.style.boxSizing = m, x(N), l.value = N, t = N;
|
|
796
829
|
} else {
|
|
797
|
-
const M =
|
|
798
|
-
|
|
830
|
+
const M = Ae(f, r, g.value, o.value);
|
|
831
|
+
x(M), l.value = M, t = M;
|
|
799
832
|
}
|
|
800
833
|
}
|
|
801
|
-
function
|
|
802
|
-
|
|
803
|
-
|
|
834
|
+
function y(P, I) {
|
|
835
|
+
s.value = P, P && (P.width !== void 0 && (d.value = P.width), !i.value && a.value && l.value.length > 0 && C(() => {
|
|
836
|
+
g.value = se(o.value, d.value), T(l.value), I && I();
|
|
804
837
|
}));
|
|
805
838
|
}
|
|
806
839
|
function h() {
|
|
807
|
-
|
|
840
|
+
g.value = se(o.value, d.value), T(l.value);
|
|
808
841
|
}
|
|
809
842
|
return {
|
|
810
843
|
refreshLayout: T,
|
|
811
|
-
setFixedDimensions:
|
|
844
|
+
setFixedDimensions: y,
|
|
812
845
|
onResize: h,
|
|
813
|
-
calculateHeight:
|
|
846
|
+
calculateHeight: x
|
|
814
847
|
};
|
|
815
848
|
}
|
|
816
849
|
function ia(e) {
|
|
817
850
|
const {
|
|
818
|
-
masonry:
|
|
851
|
+
masonry: l,
|
|
819
852
|
container: i,
|
|
820
853
|
columns: a,
|
|
821
|
-
virtualBufferPx:
|
|
854
|
+
virtualBufferPx: g,
|
|
822
855
|
loadThresholdPx: d
|
|
823
|
-
} = e,
|
|
856
|
+
} = e, v = F(e.handleScroll), o = F(0), s = F(0), w = g, t = F(!1), x = F({
|
|
824
857
|
distanceToTrigger: 0,
|
|
825
858
|
isNearTrigger: !1
|
|
826
|
-
}), T =
|
|
827
|
-
const
|
|
859
|
+
}), T = Q(() => {
|
|
860
|
+
const I = o.value - w, f = o.value + s.value + w, r = l.value;
|
|
828
861
|
return !r || r.length === 0 ? [] : r.filter((L) => {
|
|
829
862
|
if (typeof L.top != "number" || typeof L.columnHeight != "number")
|
|
830
863
|
return !0;
|
|
831
864
|
const M = L.top;
|
|
832
|
-
return L.top + L.columnHeight >=
|
|
865
|
+
return L.top + L.columnHeight >= I && M <= f;
|
|
833
866
|
});
|
|
834
867
|
});
|
|
835
|
-
function
|
|
868
|
+
function y(I) {
|
|
836
869
|
if (!i.value) return;
|
|
837
|
-
const { scrollTop:
|
|
838
|
-
|
|
870
|
+
const { scrollTop: f, clientHeight: r } = i.value, u = f + r, L = I ?? $e(l.value, a.value), M = L.length ? Math.max(...L) : 0, m = typeof d == "number" ? d : 200, N = m >= 0 ? Math.max(0, M - m) : Math.max(0, M + m), k = Math.max(0, N - u), B = k <= 100;
|
|
871
|
+
x.value = {
|
|
839
872
|
distanceToTrigger: Math.round(k),
|
|
840
|
-
isNearTrigger:
|
|
873
|
+
isNearTrigger: B
|
|
841
874
|
};
|
|
842
875
|
}
|
|
843
876
|
async function h() {
|
|
844
877
|
if (i.value) {
|
|
845
|
-
const
|
|
846
|
-
o.value =
|
|
878
|
+
const f = i.value.scrollTop, r = i.value.clientHeight || window.innerHeight, u = r > 0 ? r : window.innerHeight;
|
|
879
|
+
o.value = f, s.value = u;
|
|
847
880
|
}
|
|
848
|
-
t.value = !0, await
|
|
849
|
-
const
|
|
850
|
-
|
|
881
|
+
t.value = !0, await C(), await C(), t.value = !1;
|
|
882
|
+
const I = $e(l.value, a.value);
|
|
883
|
+
v.value(I), y(I);
|
|
851
884
|
}
|
|
852
|
-
function
|
|
853
|
-
o.value = 0,
|
|
885
|
+
function P() {
|
|
886
|
+
o.value = 0, s.value = 0, t.value = !1, x.value = {
|
|
854
887
|
distanceToTrigger: 0,
|
|
855
888
|
isNearTrigger: !1
|
|
856
889
|
};
|
|
857
890
|
}
|
|
858
891
|
return {
|
|
859
892
|
viewportTop: o,
|
|
860
|
-
viewportHeight:
|
|
893
|
+
viewportHeight: s,
|
|
861
894
|
virtualizing: t,
|
|
862
|
-
scrollProgress:
|
|
895
|
+
scrollProgress: x,
|
|
863
896
|
visibleMasonry: T,
|
|
864
|
-
updateScrollProgress:
|
|
897
|
+
updateScrollProgress: y,
|
|
865
898
|
updateViewport: h,
|
|
866
|
-
reset:
|
|
867
|
-
handleScroll:
|
|
899
|
+
reset: P,
|
|
900
|
+
handleScroll: v
|
|
868
901
|
};
|
|
869
902
|
}
|
|
870
903
|
function sa(e) {
|
|
871
|
-
const { masonry:
|
|
872
|
-
function a(
|
|
873
|
-
return typeof
|
|
904
|
+
const { masonry: l } = e, i = F(/* @__PURE__ */ new Set());
|
|
905
|
+
function a(v) {
|
|
906
|
+
return typeof v == "number" && v > 0 && Number.isFinite(v);
|
|
874
907
|
}
|
|
875
|
-
function
|
|
908
|
+
function g(v, o) {
|
|
876
909
|
try {
|
|
877
|
-
if (!Array.isArray(
|
|
878
|
-
const
|
|
879
|
-
if (
|
|
880
|
-
const
|
|
881
|
-
for (const t of
|
|
882
|
-
const
|
|
883
|
-
i.value.has(
|
|
910
|
+
if (!Array.isArray(v) || v.length === 0) return;
|
|
911
|
+
const s = v.filter((t) => !a(t == null ? void 0 : t.width) || !a(t == null ? void 0 : t.height));
|
|
912
|
+
if (s.length === 0) return;
|
|
913
|
+
const w = [];
|
|
914
|
+
for (const t of s) {
|
|
915
|
+
const x = (t == null ? void 0 : t.id) ?? `idx:${l.value.indexOf(t)}`;
|
|
916
|
+
i.value.has(x) || (i.value.add(x), w.push(x));
|
|
884
917
|
}
|
|
885
|
-
if (
|
|
886
|
-
const t =
|
|
918
|
+
if (w.length > 0) {
|
|
919
|
+
const t = w.slice(0, 10);
|
|
887
920
|
console.warn(
|
|
888
921
|
"[Masonry] Items missing width/height detected:",
|
|
889
922
|
{
|
|
890
923
|
context: o,
|
|
891
|
-
count:
|
|
924
|
+
count: w.length,
|
|
892
925
|
sampleIds: t,
|
|
893
926
|
hint: "Ensure each item has positive width and height. Consider providing fallbacks (e.g., 512x512) at the data layer."
|
|
894
927
|
}
|
|
@@ -901,7 +934,7 @@ function sa(e) {
|
|
|
901
934
|
i.value.clear();
|
|
902
935
|
}
|
|
903
936
|
return {
|
|
904
|
-
checkItemDimensions:
|
|
937
|
+
checkItemDimensions: g,
|
|
905
938
|
invalidDimensionIds: i,
|
|
906
939
|
reset: d
|
|
907
940
|
};
|
|
@@ -912,13 +945,13 @@ const ua = { class: "flex-1 relative min-h-0" }, ca = { class: "w-full h-full ro
|
|
|
912
945
|
}, fa = {
|
|
913
946
|
key: 1,
|
|
914
947
|
class: "relative w-full h-full"
|
|
915
|
-
}, da = ["src"],
|
|
948
|
+
}, da = ["src"], ga = ["src", "autoplay", "controls"], ha = { class: "w-12 h-12 rounded-full bg-white/80 backdrop-blur-sm flex items-center justify-center shadow-sm" }, ma = {
|
|
916
949
|
key: 3,
|
|
917
950
|
class: "absolute bottom-2 left-1/2 transform -translate-x-1/2 flex items-center justify-center z-10"
|
|
918
951
|
}, pa = {
|
|
919
952
|
key: 4,
|
|
920
953
|
class: "absolute inset-0 flex flex-col items-center justify-center bg-slate-50 text-slate-400 text-sm p-4 text-center"
|
|
921
|
-
}, xe = /* @__PURE__ */
|
|
954
|
+
}, xe = /* @__PURE__ */ Xe({
|
|
922
955
|
__name: "MasonryItem",
|
|
923
956
|
props: {
|
|
924
957
|
item: {},
|
|
@@ -932,230 +965,226 @@ const ua = { class: "flex-1 relative min-h-0" }, ca = { class: "w-full h-full ro
|
|
|
932
965
|
preloadThreshold: { default: 1 }
|
|
933
966
|
},
|
|
934
967
|
emits: ["preload:success", "preload:error", "mouse-enter", "mouse-leave", "in-view", "in-view-and-loaded"],
|
|
935
|
-
setup(e, { emit:
|
|
936
|
-
const i = e, a =
|
|
937
|
-
let
|
|
938
|
-
const r =
|
|
939
|
-
var
|
|
940
|
-
return i.type ?? ((
|
|
941
|
-
}),
|
|
942
|
-
var
|
|
943
|
-
return i.notFound ?? ((
|
|
944
|
-
}), L =
|
|
945
|
-
function M(
|
|
946
|
-
const
|
|
947
|
-
|
|
968
|
+
setup(e, { emit: l }) {
|
|
969
|
+
const i = e, a = l, g = F(!1), d = F(!1), v = F(null), o = F(!1), s = F(!1), w = F(null), t = F(!1), x = F(!1), T = F(!1), y = F(!1), h = F(!1), P = F(null), I = F(null);
|
|
970
|
+
let f = null;
|
|
971
|
+
const r = Q(() => {
|
|
972
|
+
var n;
|
|
973
|
+
return i.type ?? ((n = i.item) == null ? void 0 : n.type) ?? "image";
|
|
974
|
+
}), u = Q(() => {
|
|
975
|
+
var n;
|
|
976
|
+
return i.notFound ?? ((n = i.item) == null ? void 0 : n.notFound) ?? !1;
|
|
977
|
+
}), L = Q(() => !!i.inSwipeMode);
|
|
978
|
+
function M(n, p) {
|
|
979
|
+
const S = n === "image" ? g.value : o.value;
|
|
980
|
+
x.value && S && !T.value && (T.value = !0, a("in-view-and-loaded", { item: i.item, type: n, src: p }));
|
|
948
981
|
}
|
|
949
|
-
function
|
|
950
|
-
a("mouse-enter", { item: i.item, type:
|
|
982
|
+
function m(n) {
|
|
983
|
+
a("mouse-enter", { item: i.item, type: n });
|
|
951
984
|
}
|
|
952
|
-
function
|
|
953
|
-
a("mouse-leave", { item: i.item, type:
|
|
985
|
+
function N(n) {
|
|
986
|
+
a("mouse-leave", { item: i.item, type: n });
|
|
954
987
|
}
|
|
955
|
-
function k(
|
|
988
|
+
function k(n) {
|
|
956
989
|
if (L.value) return;
|
|
957
|
-
const
|
|
958
|
-
|
|
990
|
+
const p = n.target;
|
|
991
|
+
p && (p.paused ? p.play() : p.pause());
|
|
959
992
|
}
|
|
960
|
-
function
|
|
961
|
-
const
|
|
962
|
-
|
|
993
|
+
function B(n) {
|
|
994
|
+
const p = n.target;
|
|
995
|
+
p && (L.value || p.play(), m("video"));
|
|
963
996
|
}
|
|
964
|
-
function
|
|
965
|
-
const
|
|
966
|
-
|
|
997
|
+
function R(n) {
|
|
998
|
+
const p = n.target;
|
|
999
|
+
p && (L.value || p.pause(), N("video"));
|
|
967
1000
|
}
|
|
968
|
-
function
|
|
969
|
-
return new Promise((
|
|
970
|
-
if (!
|
|
1001
|
+
function $(n) {
|
|
1002
|
+
return new Promise((p, S) => {
|
|
1003
|
+
if (!n) {
|
|
971
1004
|
const b = new Error("No image source provided");
|
|
972
|
-
a("preload:error", { item: i.item, type: "image", src:
|
|
1005
|
+
a("preload:error", { item: i.item, type: "image", src: n, error: b }), S(b);
|
|
973
1006
|
return;
|
|
974
1007
|
}
|
|
975
|
-
const
|
|
976
|
-
|
|
977
|
-
const b = Date.now() - V,
|
|
1008
|
+
const z = new Image(), V = Date.now(), Y = 300;
|
|
1009
|
+
z.onload = () => {
|
|
1010
|
+
const b = Date.now() - V, E = Math.max(0, Y - b);
|
|
978
1011
|
setTimeout(async () => {
|
|
979
|
-
|
|
980
|
-
},
|
|
981
|
-
},
|
|
982
|
-
d.value = !0,
|
|
1012
|
+
g.value = !0, d.value = !1, y.value = !1, await C(), await new Promise((O) => setTimeout(O, 100)), h.value = !0, a("preload:success", { item: i.item, type: "image", src: n }), M("image", n), p();
|
|
1013
|
+
}, E);
|
|
1014
|
+
}, z.onerror = () => {
|
|
1015
|
+
d.value = !0, g.value = !1, y.value = !1;
|
|
983
1016
|
const b = new Error("Failed to load image");
|
|
984
|
-
a("preload:error", { item: i.item, type: "image", src:
|
|
985
|
-
},
|
|
1017
|
+
a("preload:error", { item: i.item, type: "image", src: n, error: b }), S(b);
|
|
1018
|
+
}, z.src = n;
|
|
986
1019
|
});
|
|
987
1020
|
}
|
|
988
|
-
function
|
|
989
|
-
return new Promise((
|
|
990
|
-
if (!
|
|
1021
|
+
function W(n) {
|
|
1022
|
+
return new Promise((p, S) => {
|
|
1023
|
+
if (!n) {
|
|
991
1024
|
const b = new Error("No video source provided");
|
|
992
|
-
a("preload:error", { item: i.item, type: "video", src:
|
|
1025
|
+
a("preload:error", { item: i.item, type: "video", src: n, error: b }), S(b);
|
|
993
1026
|
return;
|
|
994
1027
|
}
|
|
995
|
-
const
|
|
996
|
-
|
|
997
|
-
const b = Date.now() - V,
|
|
1028
|
+
const z = document.createElement("video"), V = Date.now(), Y = 300;
|
|
1029
|
+
z.preload = "metadata", z.muted = !0, z.onloadedmetadata = () => {
|
|
1030
|
+
const b = Date.now() - V, E = Math.max(0, Y - b);
|
|
998
1031
|
setTimeout(async () => {
|
|
999
|
-
o.value = !0,
|
|
1000
|
-
},
|
|
1001
|
-
},
|
|
1002
|
-
|
|
1032
|
+
o.value = !0, s.value = !1, y.value = !1, await C(), await new Promise((O) => setTimeout(O, 100)), h.value = !0, a("preload:success", { item: i.item, type: "video", src: n }), M("video", n), p();
|
|
1033
|
+
}, E);
|
|
1034
|
+
}, z.onerror = () => {
|
|
1035
|
+
s.value = !0, o.value = !1, y.value = !1;
|
|
1003
1036
|
const b = new Error("Failed to load video");
|
|
1004
|
-
a("preload:error", { item: i.item, type: "video", src:
|
|
1005
|
-
},
|
|
1037
|
+
a("preload:error", { item: i.item, type: "video", src: n, error: b }), S(b);
|
|
1038
|
+
}, z.src = n;
|
|
1006
1039
|
});
|
|
1007
1040
|
}
|
|
1008
|
-
async function
|
|
1009
|
-
var
|
|
1010
|
-
if (!t.value ||
|
|
1041
|
+
async function H() {
|
|
1042
|
+
var p;
|
|
1043
|
+
if (!t.value || y.value || u.value || r.value === "video" && o.value || r.value === "image" && g.value)
|
|
1011
1044
|
return;
|
|
1012
|
-
const
|
|
1013
|
-
if (
|
|
1014
|
-
if (
|
|
1015
|
-
|
|
1045
|
+
const n = (p = i.item) == null ? void 0 : p.src;
|
|
1046
|
+
if (n)
|
|
1047
|
+
if (y.value = !0, h.value = !1, r.value === "video") {
|
|
1048
|
+
w.value = n, o.value = !1, s.value = !1;
|
|
1016
1049
|
try {
|
|
1017
|
-
await
|
|
1050
|
+
await W(n);
|
|
1018
1051
|
} catch {
|
|
1019
1052
|
}
|
|
1020
1053
|
} else {
|
|
1021
|
-
|
|
1054
|
+
v.value = n, g.value = !1, d.value = !1;
|
|
1022
1055
|
try {
|
|
1023
|
-
await
|
|
1056
|
+
await $(n);
|
|
1024
1057
|
} catch {
|
|
1025
1058
|
}
|
|
1026
1059
|
}
|
|
1027
1060
|
}
|
|
1028
|
-
return
|
|
1029
|
-
if (!
|
|
1030
|
-
const
|
|
1031
|
-
|
|
1032
|
-
(
|
|
1033
|
-
|
|
1034
|
-
const V =
|
|
1035
|
-
if (
|
|
1036
|
-
|
|
1037
|
-
const
|
|
1038
|
-
|
|
1061
|
+
return Ge(async () => {
|
|
1062
|
+
if (!P.value) return;
|
|
1063
|
+
const n = [i.preloadThreshold, 1].filter((S, z, V) => V.indexOf(S) === z).sort((S, z) => S - z);
|
|
1064
|
+
f = new IntersectionObserver(
|
|
1065
|
+
(S) => {
|
|
1066
|
+
S.forEach((z) => {
|
|
1067
|
+
const V = z.intersectionRatio, Y = V >= 1, b = V >= i.preloadThreshold;
|
|
1068
|
+
if (Y && !x.value) {
|
|
1069
|
+
x.value = !0, a("in-view", { item: i.item, type: r.value });
|
|
1070
|
+
const E = r.value === "image" ? v.value : w.value, O = r.value === "image" ? g.value : o.value;
|
|
1071
|
+
E && O && M(r.value, E);
|
|
1039
1072
|
}
|
|
1040
|
-
b && !t.value ? (t.value = !0,
|
|
1073
|
+
b && !t.value ? (t.value = !0, H()) : z.isIntersecting;
|
|
1041
1074
|
});
|
|
1042
1075
|
},
|
|
1043
1076
|
{
|
|
1044
1077
|
// Trigger at both preloadThreshold and 1.0 (fully in view)
|
|
1045
|
-
threshold:
|
|
1078
|
+
threshold: n
|
|
1046
1079
|
}
|
|
1047
|
-
),
|
|
1048
|
-
|
|
1049
|
-
x();
|
|
1050
|
-
});
|
|
1051
|
-
}), setTimeout(() => {
|
|
1052
|
-
x();
|
|
1080
|
+
), f.observe(P.value), await C(), await C(), await C(), p(), setTimeout(() => {
|
|
1081
|
+
p();
|
|
1053
1082
|
}, 100);
|
|
1054
|
-
function
|
|
1055
|
-
if (!
|
|
1056
|
-
const
|
|
1057
|
-
if (
|
|
1058
|
-
|
|
1059
|
-
const b = r.value === "image" ?
|
|
1060
|
-
b &&
|
|
1083
|
+
function p() {
|
|
1084
|
+
if (!P.value || x.value) return;
|
|
1085
|
+
const S = P.value.getBoundingClientRect(), z = window.innerHeight, V = window.innerWidth;
|
|
1086
|
+
if (S.top >= 0 && S.bottom <= z && S.left >= 0 && S.right <= V && S.height > 0 && S.width > 0) {
|
|
1087
|
+
x.value = !0, a("in-view", { item: i.item, type: r.value });
|
|
1088
|
+
const b = r.value === "image" ? v.value : w.value, E = r.value === "image" ? g.value : o.value;
|
|
1089
|
+
b && E && M(r.value, b);
|
|
1061
1090
|
}
|
|
1062
1091
|
}
|
|
1063
|
-
}),
|
|
1064
|
-
|
|
1065
|
-
}),
|
|
1092
|
+
}), qe(() => {
|
|
1093
|
+
f && (f.disconnect(), f = null);
|
|
1094
|
+
}), te(
|
|
1066
1095
|
() => {
|
|
1067
|
-
var
|
|
1068
|
-
return (
|
|
1096
|
+
var n;
|
|
1097
|
+
return (n = i.item) == null ? void 0 : n.src;
|
|
1069
1098
|
},
|
|
1070
|
-
async (
|
|
1071
|
-
if (!(!
|
|
1099
|
+
async (n) => {
|
|
1100
|
+
if (!(!n || u.value)) {
|
|
1072
1101
|
if (r.value === "video") {
|
|
1073
|
-
if (
|
|
1074
|
-
|
|
1102
|
+
if (n !== w.value && (o.value = !1, s.value = !1, w.value = n, t.value)) {
|
|
1103
|
+
y.value = !0;
|
|
1075
1104
|
try {
|
|
1076
|
-
await
|
|
1105
|
+
await W(n);
|
|
1077
1106
|
} catch {
|
|
1078
1107
|
}
|
|
1079
1108
|
}
|
|
1080
|
-
} else if (
|
|
1081
|
-
|
|
1109
|
+
} else if (n !== v.value && (g.value = !1, d.value = !1, v.value = n, t.value)) {
|
|
1110
|
+
y.value = !0;
|
|
1082
1111
|
try {
|
|
1083
|
-
await
|
|
1112
|
+
await $(n);
|
|
1084
1113
|
} catch {
|
|
1085
1114
|
}
|
|
1086
1115
|
}
|
|
1087
1116
|
}
|
|
1088
1117
|
}
|
|
1089
|
-
),
|
|
1118
|
+
), te(
|
|
1090
1119
|
() => i.isActive,
|
|
1091
|
-
(
|
|
1092
|
-
!L.value || !
|
|
1120
|
+
(n) => {
|
|
1121
|
+
!L.value || !I.value || (n ? I.value.play() : I.value.pause());
|
|
1093
1122
|
}
|
|
1094
|
-
), (
|
|
1123
|
+
), (n, p) => (_(), U("div", {
|
|
1095
1124
|
ref_key: "containerRef",
|
|
1096
|
-
ref:
|
|
1125
|
+
ref: P,
|
|
1097
1126
|
class: "relative w-full h-full flex flex-col"
|
|
1098
1127
|
}, [
|
|
1099
|
-
|
|
1128
|
+
n.headerHeight > 0 ? (_(), U("div", {
|
|
1100
1129
|
key: 0,
|
|
1101
1130
|
class: "relative z-10",
|
|
1102
|
-
style: he({ height: `${
|
|
1131
|
+
style: he({ height: `${n.headerHeight}px` })
|
|
1103
1132
|
}, [
|
|
1104
|
-
J(
|
|
1105
|
-
item:
|
|
1106
|
-
remove:
|
|
1107
|
-
imageLoaded:
|
|
1133
|
+
J(n.$slots, "header", {
|
|
1134
|
+
item: n.item,
|
|
1135
|
+
remove: n.remove,
|
|
1136
|
+
imageLoaded: g.value,
|
|
1108
1137
|
imageError: d.value,
|
|
1109
1138
|
videoLoaded: o.value,
|
|
1110
|
-
videoError:
|
|
1111
|
-
showNotFound:
|
|
1112
|
-
isLoading:
|
|
1139
|
+
videoError: s.value,
|
|
1140
|
+
showNotFound: u.value,
|
|
1141
|
+
isLoading: y.value,
|
|
1113
1142
|
mediaType: r.value,
|
|
1114
|
-
isFullyInView:
|
|
1143
|
+
isFullyInView: x.value
|
|
1115
1144
|
})
|
|
1116
|
-
], 4)) :
|
|
1117
|
-
|
|
1118
|
-
J(
|
|
1119
|
-
item:
|
|
1120
|
-
remove:
|
|
1121
|
-
imageLoaded:
|
|
1145
|
+
], 4)) : ae("", !0),
|
|
1146
|
+
G("div", ua, [
|
|
1147
|
+
J(n.$slots, "default", {
|
|
1148
|
+
item: n.item,
|
|
1149
|
+
remove: n.remove,
|
|
1150
|
+
imageLoaded: g.value,
|
|
1122
1151
|
imageError: d.value,
|
|
1123
1152
|
videoLoaded: o.value,
|
|
1124
|
-
videoError:
|
|
1125
|
-
showNotFound:
|
|
1126
|
-
isLoading:
|
|
1153
|
+
videoError: s.value,
|
|
1154
|
+
showNotFound: u.value,
|
|
1155
|
+
isLoading: y.value,
|
|
1127
1156
|
mediaType: r.value,
|
|
1128
|
-
imageSrc:
|
|
1129
|
-
videoSrc:
|
|
1157
|
+
imageSrc: v.value,
|
|
1158
|
+
videoSrc: w.value,
|
|
1130
1159
|
showMedia: h.value,
|
|
1131
|
-
isFullyInView:
|
|
1160
|
+
isFullyInView: x.value
|
|
1132
1161
|
}, () => [
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
]))) : (
|
|
1139
|
-
r.value === "image" &&
|
|
1162
|
+
G("div", ca, [
|
|
1163
|
+
u.value ? (_(), U("div", va, p[3] || (p[3] = [
|
|
1164
|
+
G("i", { class: "fas fa-search text-3xl mb-3 opacity-50" }, null, -1),
|
|
1165
|
+
G("span", { class: "font-medium" }, "Not Found", -1),
|
|
1166
|
+
G("span", { class: "text-xs mt-1 opacity-75" }, "This item could not be located", -1)
|
|
1167
|
+
]))) : (_(), U("div", fa, [
|
|
1168
|
+
r.value === "image" && v.value ? (_(), U("img", {
|
|
1140
1169
|
key: 0,
|
|
1141
|
-
src:
|
|
1142
|
-
class:
|
|
1170
|
+
src: v.value,
|
|
1171
|
+
class: ie([
|
|
1143
1172
|
"w-full h-full object-cover transition-opacity duration-700 ease-in-out",
|
|
1144
|
-
|
|
1173
|
+
g.value && h.value ? "opacity-100" : "opacity-0"
|
|
1145
1174
|
]),
|
|
1146
1175
|
style: { position: "absolute", top: "0", left: "0" },
|
|
1147
1176
|
loading: "lazy",
|
|
1148
1177
|
decoding: "async",
|
|
1149
1178
|
alt: "",
|
|
1150
|
-
onMouseenter:
|
|
1151
|
-
onMouseleave:
|
|
1152
|
-
}, null, 42, da)) :
|
|
1153
|
-
r.value === "video" &&
|
|
1179
|
+
onMouseenter: p[0] || (p[0] = (S) => m("image")),
|
|
1180
|
+
onMouseleave: p[1] || (p[1] = (S) => N("image"))
|
|
1181
|
+
}, null, 42, da)) : ae("", !0),
|
|
1182
|
+
r.value === "video" && w.value ? (_(), U("video", {
|
|
1154
1183
|
key: 1,
|
|
1155
1184
|
ref_key: "videoEl",
|
|
1156
|
-
ref:
|
|
1157
|
-
src:
|
|
1158
|
-
class:
|
|
1185
|
+
ref: I,
|
|
1186
|
+
src: w.value,
|
|
1187
|
+
class: ie([
|
|
1159
1188
|
"w-full h-full object-cover transition-opacity duration-700 ease-in-out",
|
|
1160
1189
|
o.value && h.value ? "opacity-100" : "opacity-0"
|
|
1161
1190
|
]),
|
|
@@ -1165,60 +1194,60 @@ const ua = { class: "flex-1 relative min-h-0" }, ca = { class: "w-full h-full ro
|
|
|
1165
1194
|
playsinline: "",
|
|
1166
1195
|
autoplay: L.value && i.isActive,
|
|
1167
1196
|
controls: L.value,
|
|
1168
|
-
onClick:
|
|
1169
|
-
onTouchend:
|
|
1170
|
-
onMouseenter:
|
|
1171
|
-
onMouseleave:
|
|
1172
|
-
onError:
|
|
1173
|
-
}, null, 42,
|
|
1174
|
-
!
|
|
1197
|
+
onClick: Re(k, ["stop"]),
|
|
1198
|
+
onTouchend: Re(k, ["stop", "prevent"]),
|
|
1199
|
+
onMouseenter: B,
|
|
1200
|
+
onMouseleave: R,
|
|
1201
|
+
onError: p[2] || (p[2] = (S) => s.value = !0)
|
|
1202
|
+
}, null, 42, ga)) : ae("", !0),
|
|
1203
|
+
!g.value && !o.value && !d.value && !s.value ? (_(), U("div", {
|
|
1175
1204
|
key: 2,
|
|
1176
|
-
class:
|
|
1205
|
+
class: ie([
|
|
1177
1206
|
"absolute inset-0 bg-slate-100 flex items-center justify-center transition-opacity duration-500",
|
|
1178
1207
|
h.value ? "opacity-0 pointer-events-none" : "opacity-100"
|
|
1179
1208
|
])
|
|
1180
1209
|
}, [
|
|
1181
|
-
|
|
1182
|
-
J(
|
|
1183
|
-
|
|
1184
|
-
class:
|
|
1210
|
+
G("div", ha, [
|
|
1211
|
+
J(n.$slots, "placeholder-icon", { mediaType: r.value }, () => [
|
|
1212
|
+
G("i", {
|
|
1213
|
+
class: ie(r.value === "video" ? "fas fa-video text-xl text-slate-400" : "fas fa-image text-xl text-slate-400")
|
|
1185
1214
|
}, null, 2)
|
|
1186
1215
|
])
|
|
1187
1216
|
])
|
|
1188
|
-
], 2)) :
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1217
|
+
], 2)) : ae("", !0),
|
|
1218
|
+
y.value ? (_(), U("div", ma, p[4] || (p[4] = [
|
|
1219
|
+
G("div", { class: "bg-white/90 backdrop-blur-sm rounded-full px-3 py-1.5 shadow-sm" }, [
|
|
1220
|
+
G("div", { class: "animate-spin rounded-full h-4 w-4 border-b-2 border-blue-500" })
|
|
1192
1221
|
], -1)
|
|
1193
|
-
]))) :
|
|
1194
|
-
r.value === "image" && d.value || r.value === "video" &&
|
|
1195
|
-
|
|
1196
|
-
class:
|
|
1222
|
+
]))) : ae("", !0),
|
|
1223
|
+
r.value === "image" && d.value || r.value === "video" && s.value ? (_(), U("div", pa, [
|
|
1224
|
+
G("i", {
|
|
1225
|
+
class: ie(r.value === "video" ? "fas fa-video text-2xl mb-2 opacity-50" : "fas fa-image text-2xl mb-2 opacity-50")
|
|
1197
1226
|
}, null, 2),
|
|
1198
|
-
|
|
1199
|
-
])) :
|
|
1227
|
+
G("span", null, "Failed to load " + Ee(r.value), 1)
|
|
1228
|
+
])) : ae("", !0)
|
|
1200
1229
|
]))
|
|
1201
1230
|
])
|
|
1202
1231
|
])
|
|
1203
1232
|
]),
|
|
1204
|
-
|
|
1233
|
+
n.footerHeight > 0 ? (_(), U("div", {
|
|
1205
1234
|
key: 1,
|
|
1206
1235
|
class: "relative z-10",
|
|
1207
|
-
style: he({ height: `${
|
|
1236
|
+
style: he({ height: `${n.footerHeight}px` })
|
|
1208
1237
|
}, [
|
|
1209
|
-
J(
|
|
1210
|
-
item:
|
|
1211
|
-
remove:
|
|
1212
|
-
imageLoaded:
|
|
1238
|
+
J(n.$slots, "footer", {
|
|
1239
|
+
item: n.item,
|
|
1240
|
+
remove: n.remove,
|
|
1241
|
+
imageLoaded: g.value,
|
|
1213
1242
|
imageError: d.value,
|
|
1214
1243
|
videoLoaded: o.value,
|
|
1215
|
-
videoError:
|
|
1216
|
-
showNotFound:
|
|
1217
|
-
isLoading:
|
|
1244
|
+
videoError: s.value,
|
|
1245
|
+
showNotFound: u.value,
|
|
1246
|
+
isLoading: y.value,
|
|
1218
1247
|
mediaType: r.value,
|
|
1219
|
-
isFullyInView:
|
|
1248
|
+
isFullyInView: x.value
|
|
1220
1249
|
})
|
|
1221
|
-
], 4)) :
|
|
1250
|
+
], 4)) : ae("", !0)
|
|
1222
1251
|
], 512));
|
|
1223
1252
|
}
|
|
1224
1253
|
}), ya = {
|
|
@@ -1230,13 +1259,13 @@ const ua = { class: "flex-1 relative min-h-0" }, ca = { class: "w-full h-full ro
|
|
|
1230
1259
|
}, Ma = {
|
|
1231
1260
|
key: 1,
|
|
1232
1261
|
class: "w-full py-8 text-center"
|
|
1233
|
-
}, Ta = { class: "text-red-500 dark:text-red-400" },
|
|
1262
|
+
}, Ta = { class: "text-red-500 dark:text-red-400" }, Pa = {
|
|
1234
1263
|
key: 0,
|
|
1235
1264
|
class: "w-full py-8 text-center"
|
|
1236
|
-
},
|
|
1265
|
+
}, Ia = {
|
|
1237
1266
|
key: 1,
|
|
1238
1267
|
class: "w-full py-8 text-center"
|
|
1239
|
-
},
|
|
1268
|
+
}, La = { class: "text-red-500 dark:text-red-400" }, ka = /* @__PURE__ */ Xe({
|
|
1240
1269
|
__name: "Masonry",
|
|
1241
1270
|
props: {
|
|
1242
1271
|
getPage: {
|
|
@@ -1361,8 +1390,8 @@ const ua = { class: "flex-1 relative min-h-0" }, ca = { class: "w-full h-full ro
|
|
|
1361
1390
|
"item:mouse-leave",
|
|
1362
1391
|
"update:context"
|
|
1363
1392
|
],
|
|
1364
|
-
setup(e, { expose:
|
|
1365
|
-
const a = e,
|
|
1393
|
+
setup(e, { expose: l, emit: i }) {
|
|
1394
|
+
const a = e, g = {
|
|
1366
1395
|
sizes: { base: 1, sm: 2, md: 3, lg: 4, xl: 5, "2xl": 6 },
|
|
1367
1396
|
gutterX: 10,
|
|
1368
1397
|
gutterY: 10,
|
|
@@ -1371,79 +1400,79 @@ const ua = { class: "flex-1 relative min-h-0" }, ca = { class: "w-full h-full ro
|
|
|
1371
1400
|
paddingLeft: 0,
|
|
1372
1401
|
paddingRight: 0,
|
|
1373
1402
|
placement: "masonry"
|
|
1374
|
-
}, d =
|
|
1375
|
-
var
|
|
1403
|
+
}, d = Q(() => {
|
|
1404
|
+
var c;
|
|
1376
1405
|
return {
|
|
1377
|
-
...
|
|
1406
|
+
...g,
|
|
1378
1407
|
...a.layout,
|
|
1379
1408
|
sizes: {
|
|
1380
|
-
...
|
|
1381
|
-
...((
|
|
1409
|
+
...g.sizes,
|
|
1410
|
+
...((c = a.layout) == null ? void 0 : c.sizes) || {}
|
|
1382
1411
|
}
|
|
1383
1412
|
};
|
|
1384
|
-
}),
|
|
1413
|
+
}), v = F(null), o = F(typeof window < "u" ? window.innerWidth : 1024), s = F(typeof window < "u" ? window.innerHeight : 768), w = F(null);
|
|
1385
1414
|
let t = null;
|
|
1386
|
-
function
|
|
1415
|
+
function x(c) {
|
|
1387
1416
|
return {
|
|
1388
1417
|
sm: 640,
|
|
1389
1418
|
md: 768,
|
|
1390
1419
|
lg: 1024,
|
|
1391
1420
|
xl: 1280,
|
|
1392
1421
|
"2xl": 1536
|
|
1393
|
-
}[
|
|
1422
|
+
}[c] || 768;
|
|
1394
1423
|
}
|
|
1395
|
-
const T =
|
|
1424
|
+
const T = Q(() => {
|
|
1396
1425
|
if (a.layoutMode === "masonry") return !1;
|
|
1397
1426
|
if (a.layoutMode === "swipe") return !0;
|
|
1398
|
-
const
|
|
1399
|
-
return o.value <
|
|
1400
|
-
}),
|
|
1427
|
+
const c = typeof a.mobileBreakpoint == "string" ? x(a.mobileBreakpoint) : a.mobileBreakpoint;
|
|
1428
|
+
return o.value < c;
|
|
1429
|
+
}), y = i, h = Q({
|
|
1401
1430
|
get: () => a.items,
|
|
1402
|
-
set: (
|
|
1403
|
-
}),
|
|
1431
|
+
set: (c) => y("update:items", c)
|
|
1432
|
+
}), P = Q({
|
|
1404
1433
|
get: () => a.context,
|
|
1405
|
-
set: (
|
|
1434
|
+
set: (c) => y("update:context", c)
|
|
1406
1435
|
});
|
|
1407
|
-
function
|
|
1408
|
-
|
|
1436
|
+
function I(c) {
|
|
1437
|
+
P.value = c;
|
|
1409
1438
|
}
|
|
1410
|
-
const
|
|
1411
|
-
const
|
|
1412
|
-
return (
|
|
1413
|
-
}), r =
|
|
1439
|
+
const f = Q(() => {
|
|
1440
|
+
const c = h.value;
|
|
1441
|
+
return (c == null ? void 0 : c.length) ?? 0;
|
|
1442
|
+
}), r = F(7), u = F(null), L = F([]), M = F(null), m = F(!1), N = F(0), k = F(!1), B = F(null), R = F(!1), $ = Q(() => Kt(o.value)), W = sa({
|
|
1414
1443
|
masonry: h
|
|
1415
|
-
}), { checkItemDimensions:
|
|
1444
|
+
}), { checkItemDimensions: H, reset: n } = W, p = ra({
|
|
1416
1445
|
masonry: h,
|
|
1417
1446
|
useSwipeMode: T,
|
|
1418
|
-
container:
|
|
1447
|
+
container: u,
|
|
1419
1448
|
columns: r,
|
|
1420
1449
|
containerWidth: o,
|
|
1421
|
-
masonryContentHeight:
|
|
1450
|
+
masonryContentHeight: N,
|
|
1422
1451
|
layout: d,
|
|
1423
|
-
fixedDimensions:
|
|
1424
|
-
checkItemDimensions:
|
|
1425
|
-
}), { refreshLayout:
|
|
1452
|
+
fixedDimensions: w,
|
|
1453
|
+
checkItemDimensions: H
|
|
1454
|
+
}), { refreshLayout: S, setFixedDimensions: z, onResize: V } = p, Y = ia({
|
|
1426
1455
|
masonry: h,
|
|
1427
|
-
container:
|
|
1456
|
+
container: u,
|
|
1428
1457
|
columns: r,
|
|
1429
1458
|
virtualBufferPx: a.virtualBufferPx,
|
|
1430
1459
|
loadThresholdPx: a.loadThresholdPx,
|
|
1431
1460
|
handleScroll: () => {
|
|
1432
1461
|
}
|
|
1433
1462
|
// Will be set after pagination is initialized
|
|
1434
|
-
}), { viewportTop: b, viewportHeight:
|
|
1435
|
-
{ container:
|
|
1436
|
-
{ leaveDurationMs: a.leaveDurationMs, virtualizing:
|
|
1463
|
+
}), { viewportTop: b, viewportHeight: E, virtualizing: O, visibleMasonry: ne, updateScrollProgress: X, updateViewport: Z, reset: K } = Y, { onEnter: Qe, onBeforeEnter: Ze, onBeforeLeave: et, onLeave: tt } = ta(
|
|
1464
|
+
{ container: u },
|
|
1465
|
+
{ leaveDurationMs: a.leaveDurationMs, virtualizing: O }
|
|
1437
1466
|
), at = Qe, nt = Ze, lt = et, ot = tt, rt = la({
|
|
1438
1467
|
getPage: a.getPage,
|
|
1439
|
-
context:
|
|
1468
|
+
context: P,
|
|
1440
1469
|
masonry: h,
|
|
1441
|
-
isLoading:
|
|
1470
|
+
isLoading: m,
|
|
1442
1471
|
hasReachedEnd: k,
|
|
1443
|
-
loadError:
|
|
1472
|
+
loadError: B,
|
|
1444
1473
|
currentPage: M,
|
|
1445
1474
|
paginationHistory: L,
|
|
1446
|
-
refreshLayout:
|
|
1475
|
+
refreshLayout: S,
|
|
1447
1476
|
retryMaxAttempts: a.retryMaxAttempts,
|
|
1448
1477
|
retryInitialDelayMs: a.retryInitialDelayMs,
|
|
1449
1478
|
retryBackoffStepMs: a.retryBackoffStepMs,
|
|
@@ -1451,51 +1480,51 @@ const ua = { class: "flex-1 relative min-h-0" }, ca = { class: "w-full h-full ro
|
|
|
1451
1480
|
backfillDelayMs: a.backfillDelayMs,
|
|
1452
1481
|
backfillMaxCalls: a.backfillMaxCalls,
|
|
1453
1482
|
pageSize: a.pageSize,
|
|
1454
|
-
emits:
|
|
1455
|
-
}), { loadPage: be, loadNext:
|
|
1483
|
+
emits: y
|
|
1484
|
+
}), { loadPage: be, loadNext: me, refreshCurrentPage: it, cancelLoad: Me, maybeBackfillToTarget: st } = rt, ee = na({
|
|
1456
1485
|
useSwipeMode: T,
|
|
1457
1486
|
masonry: h,
|
|
1458
|
-
isLoading:
|
|
1459
|
-
loadNext:
|
|
1487
|
+
isLoading: m,
|
|
1488
|
+
loadNext: me,
|
|
1460
1489
|
loadPage: be,
|
|
1461
1490
|
paginationHistory: L
|
|
1462
1491
|
}), { handleScroll: ut } = aa({
|
|
1463
|
-
container:
|
|
1492
|
+
container: u,
|
|
1464
1493
|
masonry: h,
|
|
1465
1494
|
columns: r,
|
|
1466
|
-
containerHeight:
|
|
1467
|
-
isLoading:
|
|
1495
|
+
containerHeight: N,
|
|
1496
|
+
isLoading: m,
|
|
1468
1497
|
pageSize: a.pageSize,
|
|
1469
|
-
refreshLayout:
|
|
1470
|
-
setItemsRaw: (
|
|
1471
|
-
h.value =
|
|
1498
|
+
refreshLayout: S,
|
|
1499
|
+
setItemsRaw: (c) => {
|
|
1500
|
+
h.value = c;
|
|
1472
1501
|
},
|
|
1473
|
-
loadNext:
|
|
1502
|
+
loadNext: me,
|
|
1474
1503
|
loadThresholdPx: a.loadThresholdPx
|
|
1475
1504
|
});
|
|
1476
|
-
|
|
1505
|
+
Y.handleScroll.value = ut;
|
|
1477
1506
|
const ct = oa({
|
|
1478
1507
|
masonry: h,
|
|
1479
1508
|
useSwipeMode: T,
|
|
1480
|
-
refreshLayout:
|
|
1481
|
-
loadNext:
|
|
1509
|
+
refreshLayout: S,
|
|
1510
|
+
loadNext: me,
|
|
1482
1511
|
maybeBackfillToTarget: st,
|
|
1483
1512
|
paginationHistory: L
|
|
1484
|
-
}), { remove: ue, removeMany: vt, restore: ft, restoreMany: dt, removeAll:
|
|
1485
|
-
function ht(
|
|
1486
|
-
|
|
1513
|
+
}), { remove: ue, removeMany: vt, restore: ft, restoreMany: dt, removeAll: gt } = ct;
|
|
1514
|
+
function ht(c) {
|
|
1515
|
+
z(c, X), !c && v.value && (o.value = v.value.clientWidth, s.value = v.value.clientHeight);
|
|
1487
1516
|
}
|
|
1488
|
-
|
|
1517
|
+
l({
|
|
1489
1518
|
// Cancels any ongoing load operations (page loads, backfills, etc.)
|
|
1490
1519
|
cancelLoad: Me,
|
|
1491
1520
|
// Opaque caller context passed through to getPage(page, context). Useful for including filters, service selection, tabId, etc.
|
|
1492
|
-
context:
|
|
1521
|
+
context: P,
|
|
1493
1522
|
// Container height (wrapper element) in pixels
|
|
1494
|
-
containerHeight:
|
|
1523
|
+
containerHeight: s,
|
|
1495
1524
|
// Container width (wrapper element) in pixels
|
|
1496
1525
|
containerWidth: o,
|
|
1497
1526
|
// Current Tailwind breakpoint name (base, sm, md, lg, xl, 2xl) based on containerWidth
|
|
1498
|
-
currentBreakpoint:
|
|
1527
|
+
currentBreakpoint: $,
|
|
1499
1528
|
// Current page number or cursor being displayed
|
|
1500
1529
|
currentPage: M,
|
|
1501
1530
|
// Completely destroys the component, clearing all state and resetting to initial state
|
|
@@ -1505,13 +1534,13 @@ const ua = { class: "flex-1 relative min-h-0" }, ca = { class: "w-full h-full ro
|
|
|
1505
1534
|
// Initializes the component with items, page, and next page cursor. Use this for manual init mode.
|
|
1506
1535
|
initialize: Tt,
|
|
1507
1536
|
// Boolean indicating if the component has been initialized (first content has loaded)
|
|
1508
|
-
isInitialized:
|
|
1537
|
+
isInitialized: R,
|
|
1509
1538
|
// Boolean indicating if a page load or backfill operation is currently in progress
|
|
1510
|
-
isLoading:
|
|
1539
|
+
isLoading: m,
|
|
1511
1540
|
// Error object if the last load operation failed, null otherwise
|
|
1512
|
-
loadError:
|
|
1541
|
+
loadError: B,
|
|
1513
1542
|
// Loads the next page of items asynchronously
|
|
1514
|
-
loadNext:
|
|
1543
|
+
loadNext: me,
|
|
1515
1544
|
// Loads a specific page number or cursor asynchronously
|
|
1516
1545
|
loadPage: be,
|
|
1517
1546
|
// Array tracking pagination history (pages/cursors that have been loaded)
|
|
@@ -1519,11 +1548,11 @@ const ua = { class: "flex-1 relative min-h-0" }, ca = { class: "w-full h-full ro
|
|
|
1519
1548
|
// Refreshes the current page by clearing items and reloading from the current page
|
|
1520
1549
|
refreshCurrentPage: it,
|
|
1521
1550
|
// Recalculates the layout positions for all items. Call this after manually modifying items.
|
|
1522
|
-
refreshLayout:
|
|
1551
|
+
refreshLayout: S,
|
|
1523
1552
|
// Removes a single item from the masonry
|
|
1524
1553
|
remove: ue,
|
|
1525
1554
|
// Removes all items from the masonry
|
|
1526
|
-
removeAll:
|
|
1555
|
+
removeAll: gt,
|
|
1527
1556
|
// Removes multiple items from the masonry in a single operation
|
|
1528
1557
|
removeMany: vt,
|
|
1529
1558
|
// Resets the component to initial state (clears items, resets pagination, scrolls to top)
|
|
@@ -1537,171 +1566,171 @@ const ua = { class: "flex-1 relative min-h-0" }, ca = { class: "w-full h-full ro
|
|
|
1537
1566
|
// Scrolls the container to the top
|
|
1538
1567
|
scrollToTop: yt,
|
|
1539
1568
|
// Sets the opaque caller context (alternative to v-model:context)
|
|
1540
|
-
setContext:
|
|
1569
|
+
setContext: I,
|
|
1541
1570
|
// Sets fixed dimensions for the container, overriding ResizeObserver. Pass null to restore automatic sizing.
|
|
1542
1571
|
setFixedDimensions: ht,
|
|
1543
1572
|
// Computed property returning the total number of items currently in the masonry
|
|
1544
|
-
totalItems:
|
|
1573
|
+
totalItems: Q(() => h.value.length)
|
|
1545
1574
|
});
|
|
1546
|
-
const ce =
|
|
1547
|
-
function
|
|
1548
|
-
const
|
|
1549
|
-
return
|
|
1575
|
+
const ce = ee.currentSwipeIndex, pe = ee.swipeOffset, ye = ee.isDragging, oe = ee.swipeContainer, Ne = ee.handleTouchStart, ze = ee.handleTouchMove, De = ee.handleTouchEnd, Be = ee.handleMouseDown, Te = ee.handleMouseMove, Pe = ee.handleMouseUp, Ie = ee.snapToCurrentItem;
|
|
1576
|
+
function mt(c) {
|
|
1577
|
+
const D = f.value, j = typeof c == "string" ? parseInt(c, 10) : c;
|
|
1578
|
+
return D > 0 ? `${j * (100 / D)}%` : "0%";
|
|
1550
1579
|
}
|
|
1551
1580
|
function pt() {
|
|
1552
|
-
const
|
|
1553
|
-
return
|
|
1581
|
+
const c = f.value;
|
|
1582
|
+
return c > 0 ? `${100 / c}%` : "0%";
|
|
1554
1583
|
}
|
|
1555
|
-
function yt(
|
|
1556
|
-
|
|
1584
|
+
function yt(c) {
|
|
1585
|
+
u.value && u.value.scrollTo({
|
|
1557
1586
|
top: 0,
|
|
1558
|
-
behavior: (
|
|
1559
|
-
...
|
|
1587
|
+
behavior: (c == null ? void 0 : c.behavior) ?? "smooth",
|
|
1588
|
+
...c
|
|
1560
1589
|
});
|
|
1561
1590
|
}
|
|
1562
|
-
function wt(
|
|
1563
|
-
|
|
1564
|
-
top:
|
|
1565
|
-
left:
|
|
1566
|
-
behavior:
|
|
1567
|
-
}),
|
|
1591
|
+
function wt(c) {
|
|
1592
|
+
u.value && (u.value.scrollTo({
|
|
1593
|
+
top: c.top ?? u.value.scrollTop,
|
|
1594
|
+
left: c.left ?? u.value.scrollLeft,
|
|
1595
|
+
behavior: c.behavior ?? "auto"
|
|
1596
|
+
}), u.value && (b.value = u.value.scrollTop, E.value = u.value.clientHeight || window.innerHeight));
|
|
1568
1597
|
}
|
|
1569
1598
|
function xt() {
|
|
1570
|
-
V(),
|
|
1599
|
+
V(), u.value && (b.value = u.value.scrollTop, E.value = u.value.clientHeight);
|
|
1571
1600
|
}
|
|
1572
1601
|
function bt() {
|
|
1573
|
-
Me(),
|
|
1602
|
+
Me(), u.value && u.value.scrollTo({
|
|
1574
1603
|
top: 0,
|
|
1575
1604
|
behavior: "smooth"
|
|
1576
|
-
}), h.value = [],
|
|
1605
|
+
}), h.value = [], s.value = 0, M.value = a.loadAtPage, L.value = [a.loadAtPage], k.value = !1, B.value = null, R.value = !1, K();
|
|
1577
1606
|
}
|
|
1578
1607
|
function Mt() {
|
|
1579
|
-
Me(), h.value = [],
|
|
1608
|
+
Me(), h.value = [], N.value = 0, M.value = null, L.value = [], k.value = !1, B.value = null, m.value = !1, R.value = !1, ce.value = 0, pe.value = 0, ye.value = !1, K(), n(), u.value && u.value.scrollTo({
|
|
1580
1609
|
top: 0,
|
|
1581
1610
|
behavior: "auto"
|
|
1582
1611
|
// Instant scroll for destroy
|
|
1583
1612
|
});
|
|
1584
1613
|
}
|
|
1585
|
-
const
|
|
1586
|
-
T.value || await
|
|
1587
|
-
}, 200),
|
|
1588
|
-
function
|
|
1589
|
-
|
|
1614
|
+
const re = Ue(async () => {
|
|
1615
|
+
T.value || await Z();
|
|
1616
|
+
}, 200), We = Ue(xt, 200);
|
|
1617
|
+
function Fe() {
|
|
1618
|
+
ee.handleWindowResize();
|
|
1590
1619
|
}
|
|
1591
|
-
function Tt(
|
|
1592
|
-
M.value =
|
|
1593
|
-
const
|
|
1594
|
-
h.value =
|
|
1595
|
-
|
|
1596
|
-
})),
|
|
1620
|
+
async function Tt(c, D, j) {
|
|
1621
|
+
M.value = D, L.value = [D], j != null && L.value.push(j), k.value = j === null, H(c, "initialize");
|
|
1622
|
+
const le = h.value, A = le.length === 0 ? c : [...le, ...c];
|
|
1623
|
+
h.value = A, await C(), T.value ? ce.value === 0 && h.value.length > 0 && (pe.value = 0) : (await C(), await C(), S(A), u.value && (b.value = u.value.scrollTop, E.value = u.value.clientHeight || window.innerHeight), C(() => {
|
|
1624
|
+
u.value && (b.value = u.value.scrollTop, E.value = u.value.clientHeight || window.innerHeight, X());
|
|
1625
|
+
})), c && c.length > 0 && (R.value = !0);
|
|
1597
1626
|
}
|
|
1598
|
-
return
|
|
1627
|
+
return te(
|
|
1599
1628
|
d,
|
|
1600
1629
|
() => {
|
|
1601
|
-
T.value ||
|
|
1630
|
+
T.value || u.value && (r.value = se(d.value, o.value), S(h.value));
|
|
1602
1631
|
},
|
|
1603
1632
|
{ deep: !0 }
|
|
1604
|
-
),
|
|
1605
|
-
|
|
1606
|
-
}),
|
|
1607
|
-
|
|
1608
|
-
}, { immediate: !0 }),
|
|
1633
|
+
), te(() => a.layoutMode, () => {
|
|
1634
|
+
w.value && w.value.width !== void 0 ? o.value = w.value.width : v.value && (o.value = v.value.clientWidth);
|
|
1635
|
+
}), te(u, (c) => {
|
|
1636
|
+
c && !T.value ? (c.removeEventListener("scroll", re), c.addEventListener("scroll", re, { passive: !0 })) : c && c.removeEventListener("scroll", re);
|
|
1637
|
+
}, { immediate: !0 }), te(
|
|
1609
1638
|
() => h.value.length,
|
|
1610
|
-
(
|
|
1611
|
-
a.init === "manual" && !
|
|
1639
|
+
(c, D) => {
|
|
1640
|
+
a.init === "manual" && !R.value && c > 0 && D === 0 && (R.value = !0);
|
|
1612
1641
|
},
|
|
1613
1642
|
{ immediate: !1 }
|
|
1614
|
-
),
|
|
1615
|
-
|
|
1616
|
-
|
|
1643
|
+
), te(T, (c, D) => {
|
|
1644
|
+
D === void 0 && c === !1 || C(() => {
|
|
1645
|
+
c ? (document.addEventListener("mousemove", Te), document.addEventListener("mouseup", Pe), u.value && u.value.removeEventListener("scroll", re), ce.value = 0, pe.value = 0, h.value.length > 0 && Ie()) : (document.removeEventListener("mousemove", Te), document.removeEventListener("mouseup", Pe), u.value && v.value && (w.value && w.value.width !== void 0 ? o.value = w.value.width : o.value = v.value.clientWidth, u.value.removeEventListener("scroll", re), u.value.addEventListener("scroll", re, { passive: !0 }), h.value.length > 0 && (r.value = se(d.value, o.value), S(h.value), b.value = u.value.scrollTop, E.value = u.value.clientHeight, X())));
|
|
1617
1646
|
});
|
|
1618
|
-
}, { immediate: !0 }),
|
|
1619
|
-
|
|
1620
|
-
}),
|
|
1621
|
-
T.value &&
|
|
1622
|
-
}),
|
|
1623
|
-
t && (t.disconnect(), t = null),
|
|
1624
|
-
if (!
|
|
1625
|
-
for (const j of
|
|
1626
|
-
const
|
|
1627
|
-
o.value !==
|
|
1647
|
+
}, { immediate: !0 }), te(oe, (c) => {
|
|
1648
|
+
c && (c.addEventListener("touchstart", Ne, { passive: !1 }), c.addEventListener("touchmove", ze, { passive: !1 }), c.addEventListener("touchend", De), c.addEventListener("mousedown", Be));
|
|
1649
|
+
}), te(() => h.value.length, (c, D) => {
|
|
1650
|
+
T.value && c > 0 && D === 0 && (ce.value = 0, C(() => Ie()));
|
|
1651
|
+
}), te(v, (c) => {
|
|
1652
|
+
t && (t.disconnect(), t = null), c && typeof ResizeObserver < "u" ? (t = new ResizeObserver((D) => {
|
|
1653
|
+
if (!w.value)
|
|
1654
|
+
for (const j of D) {
|
|
1655
|
+
const le = j.contentRect.width, A = j.contentRect.height;
|
|
1656
|
+
o.value !== le && (o.value = le), s.value !== A && (s.value = A);
|
|
1628
1657
|
}
|
|
1629
|
-
}), t.observe(
|
|
1630
|
-
}, { immediate: !0 }),
|
|
1631
|
-
|
|
1632
|
-
r.value = se(d.value,
|
|
1658
|
+
}), t.observe(c), w.value || (o.value = c.clientWidth, s.value = c.clientHeight)) : c && (w.value || (o.value = c.clientWidth, s.value = c.clientHeight));
|
|
1659
|
+
}, { immediate: !0 }), te(o, (c, D) => {
|
|
1660
|
+
c !== D && c > 0 && !T.value && u.value && h.value.length > 0 && C(() => {
|
|
1661
|
+
r.value = se(d.value, c), S(h.value), X();
|
|
1633
1662
|
});
|
|
1634
|
-
}),
|
|
1663
|
+
}), Ge(async () => {
|
|
1635
1664
|
try {
|
|
1636
|
-
await
|
|
1637
|
-
const
|
|
1638
|
-
if (L.value = [
|
|
1639
|
-
|
|
1665
|
+
await C(), v.value && !t && (o.value = v.value.clientWidth, s.value = v.value.clientHeight), T.value || (r.value = se(d.value, o.value), u.value && (b.value = u.value.scrollTop, E.value = u.value.clientHeight));
|
|
1666
|
+
const c = a.loadAtPage;
|
|
1667
|
+
if (a.init === "auto" && L.value.length === 0 && (L.value = [c]), a.init === "auto") {
|
|
1668
|
+
R.value = !0, await C();
|
|
1640
1669
|
try {
|
|
1641
|
-
await be(
|
|
1670
|
+
await be(c);
|
|
1642
1671
|
} catch {
|
|
1643
1672
|
}
|
|
1644
1673
|
}
|
|
1645
|
-
T.value ?
|
|
1646
|
-
} catch (
|
|
1647
|
-
|
|
1674
|
+
T.value ? C(() => Ie()) : X();
|
|
1675
|
+
} catch (c) {
|
|
1676
|
+
B.value || (console.error("Error during component initialization:", c), B.value = ge(c)), m.value = !1;
|
|
1648
1677
|
}
|
|
1649
|
-
window.addEventListener("resize",
|
|
1650
|
-
}),
|
|
1651
|
-
var
|
|
1652
|
-
t && (t.disconnect(), t = null), (
|
|
1653
|
-
}), (
|
|
1678
|
+
window.addEventListener("resize", We), window.addEventListener("resize", Fe);
|
|
1679
|
+
}), qe(() => {
|
|
1680
|
+
var c;
|
|
1681
|
+
t && (t.disconnect(), t = null), (c = u.value) == null || c.removeEventListener("scroll", re), window.removeEventListener("resize", We), window.removeEventListener("resize", Fe), oe.value && (oe.value.removeEventListener("touchstart", Ne), oe.value.removeEventListener("touchmove", ze), oe.value.removeEventListener("touchend", De), oe.value.removeEventListener("mousedown", Be)), document.removeEventListener("mousemove", Te), document.removeEventListener("mouseup", Pe);
|
|
1682
|
+
}), (c, D) => (_(), U("div", {
|
|
1654
1683
|
ref_key: "wrapper",
|
|
1655
|
-
ref:
|
|
1684
|
+
ref: v,
|
|
1656
1685
|
class: "w-full h-full flex flex-col relative"
|
|
1657
1686
|
}, [
|
|
1658
|
-
|
|
1687
|
+
R.value ? T.value ? (_(), U("div", {
|
|
1659
1688
|
key: 1,
|
|
1660
|
-
class:
|
|
1689
|
+
class: ie(["overflow-hidden w-full flex-1 swipe-container touch-none select-none", { "force-motion": a.forceMotion, "cursor-grab": !q(ye), "cursor-grabbing": q(ye) }]),
|
|
1661
1690
|
ref_key: "swipeContainer",
|
|
1662
|
-
ref:
|
|
1691
|
+
ref: oe,
|
|
1663
1692
|
style: { height: "100%", "max-height": "100%", position: "relative" }
|
|
1664
1693
|
}, [
|
|
1665
|
-
|
|
1694
|
+
G("div", {
|
|
1666
1695
|
class: "relative w-full",
|
|
1667
1696
|
style: he({
|
|
1668
|
-
transform: `translateY(${
|
|
1669
|
-
transition:
|
|
1670
|
-
height: `${
|
|
1697
|
+
transform: `translateY(${q(pe)}px)`,
|
|
1698
|
+
transition: q(ye) ? "none" : `transform ${e.transitionDurationMs}ms ${e.transitionEasing}`,
|
|
1699
|
+
height: `${f.value * 100}%`
|
|
1671
1700
|
})
|
|
1672
1701
|
}, [
|
|
1673
|
-
(
|
|
1702
|
+
(_(!0), U(Ce, null, Oe(h.value, (j, le) => (_(), U("div", {
|
|
1674
1703
|
key: `${j.page}-${j.id}`,
|
|
1675
1704
|
class: "absolute top-0 left-0 w-full",
|
|
1676
1705
|
style: he({
|
|
1677
|
-
top:
|
|
1706
|
+
top: mt(le),
|
|
1678
1707
|
height: pt()
|
|
1679
1708
|
})
|
|
1680
1709
|
}, [
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
J(
|
|
1710
|
+
G("div", wa, [
|
|
1711
|
+
G("div", xa, [
|
|
1712
|
+
J(c.$slots, "default", {
|
|
1684
1713
|
item: j,
|
|
1685
|
-
remove:
|
|
1714
|
+
remove: q(ue),
|
|
1686
1715
|
index: j.originalIndex ?? h.value.indexOf(j)
|
|
1687
1716
|
}, () => [
|
|
1688
|
-
|
|
1717
|
+
Le(xe, {
|
|
1689
1718
|
item: j,
|
|
1690
|
-
remove:
|
|
1719
|
+
remove: q(ue),
|
|
1691
1720
|
"header-height": d.value.header,
|
|
1692
1721
|
"footer-height": d.value.footer,
|
|
1693
1722
|
"in-swipe-mode": !0,
|
|
1694
|
-
"is-active":
|
|
1695
|
-
"onPreload:success":
|
|
1696
|
-
"onPreload:error":
|
|
1697
|
-
onMouseEnter:
|
|
1698
|
-
onMouseLeave:
|
|
1723
|
+
"is-active": le === q(ce),
|
|
1724
|
+
"onPreload:success": D[0] || (D[0] = (A) => y("item:preload:success", A)),
|
|
1725
|
+
"onPreload:error": D[1] || (D[1] = (A) => y("item:preload:error", A)),
|
|
1726
|
+
onMouseEnter: D[2] || (D[2] = (A) => y("item:mouse-enter", A)),
|
|
1727
|
+
onMouseLeave: D[3] || (D[3] = (A) => y("item:mouse-leave", A))
|
|
1699
1728
|
}, {
|
|
1700
|
-
header: ve((
|
|
1701
|
-
J(
|
|
1729
|
+
header: ve((A) => [
|
|
1730
|
+
J(c.$slots, "item-header", fe({ ref_for: !0 }, A), void 0, !0)
|
|
1702
1731
|
]),
|
|
1703
|
-
footer: ve((
|
|
1704
|
-
J(
|
|
1732
|
+
footer: ve((A) => [
|
|
1733
|
+
J(c.$slots, "item-footer", fe({ ref_for: !0 }, A), void 0, !0)
|
|
1705
1734
|
]),
|
|
1706
1735
|
_: 2
|
|
1707
1736
|
}, 1032, ["item", "remove", "header-height", "footer-height", "is-active"])
|
|
@@ -1710,62 +1739,62 @@ const ua = { class: "flex-1 relative min-h-0" }, ca = { class: "w-full h-full ro
|
|
|
1710
1739
|
])
|
|
1711
1740
|
], 4))), 128))
|
|
1712
1741
|
], 4),
|
|
1713
|
-
k.value && h.value.length > 0 ? (
|
|
1714
|
-
J(
|
|
1715
|
-
|
|
1742
|
+
k.value && h.value.length > 0 ? (_(), U("div", ba, [
|
|
1743
|
+
J(c.$slots, "end-message", {}, () => [
|
|
1744
|
+
D[9] || (D[9] = G("p", { class: "text-gray-500 dark:text-gray-400" }, "You've reached the end", -1))
|
|
1716
1745
|
], !0)
|
|
1717
|
-
])) :
|
|
1718
|
-
|
|
1719
|
-
J(
|
|
1720
|
-
|
|
1746
|
+
])) : ae("", !0),
|
|
1747
|
+
B.value && h.value.length > 0 ? (_(), U("div", Ma, [
|
|
1748
|
+
J(c.$slots, "error-message", { error: B.value }, () => [
|
|
1749
|
+
G("p", Ta, "Failed to load content: " + Ee(B.value.message), 1)
|
|
1721
1750
|
], !0)
|
|
1722
|
-
])) :
|
|
1723
|
-
], 2)) : (
|
|
1751
|
+
])) : ae("", !0)
|
|
1752
|
+
], 2)) : (_(), U("div", {
|
|
1724
1753
|
key: 2,
|
|
1725
|
-
class:
|
|
1754
|
+
class: ie(["overflow-auto w-full flex-1 masonry-container", { "force-motion": a.forceMotion }]),
|
|
1726
1755
|
ref_key: "container",
|
|
1727
|
-
ref:
|
|
1756
|
+
ref: u
|
|
1728
1757
|
}, [
|
|
1729
|
-
|
|
1758
|
+
G("div", {
|
|
1730
1759
|
class: "relative",
|
|
1731
|
-
style: he({ height: `${
|
|
1760
|
+
style: he({ height: `${N.value}px`, "--masonry-duration": `${e.transitionDurationMs}ms`, "--masonry-leave-duration": `${e.leaveDurationMs}ms`, "--masonry-ease": e.transitionEasing })
|
|
1732
1761
|
}, [
|
|
1733
|
-
|
|
1762
|
+
Le(Pt, {
|
|
1734
1763
|
name: "masonry",
|
|
1735
1764
|
css: !1,
|
|
1736
|
-
onEnter:
|
|
1737
|
-
onBeforeEnter:
|
|
1738
|
-
onLeave:
|
|
1739
|
-
onBeforeLeave:
|
|
1765
|
+
onEnter: q(at),
|
|
1766
|
+
onBeforeEnter: q(nt),
|
|
1767
|
+
onLeave: q(ot),
|
|
1768
|
+
onBeforeLeave: q(lt)
|
|
1740
1769
|
}, {
|
|
1741
1770
|
default: ve(() => [
|
|
1742
|
-
(
|
|
1771
|
+
(_(!0), U(Ce, null, Oe(q(ne), (j, le) => (_(), U("div", fe({
|
|
1743
1772
|
key: `${j.page}-${j.id}`,
|
|
1744
1773
|
class: "absolute masonry-item",
|
|
1745
1774
|
ref_for: !0
|
|
1746
|
-
},
|
|
1747
|
-
J(
|
|
1775
|
+
}, q(ea)(j, le)), [
|
|
1776
|
+
J(c.$slots, "default", {
|
|
1748
1777
|
item: j,
|
|
1749
|
-
remove:
|
|
1778
|
+
remove: q(ue),
|
|
1750
1779
|
index: j.originalIndex ?? h.value.indexOf(j)
|
|
1751
1780
|
}, () => [
|
|
1752
|
-
|
|
1781
|
+
Le(xe, {
|
|
1753
1782
|
item: j,
|
|
1754
|
-
remove:
|
|
1783
|
+
remove: q(ue),
|
|
1755
1784
|
"header-height": d.value.header,
|
|
1756
1785
|
"footer-height": d.value.footer,
|
|
1757
1786
|
"in-swipe-mode": !1,
|
|
1758
1787
|
"is-active": !1,
|
|
1759
|
-
"onPreload:success":
|
|
1760
|
-
"onPreload:error":
|
|
1761
|
-
onMouseEnter:
|
|
1762
|
-
onMouseLeave:
|
|
1788
|
+
"onPreload:success": D[4] || (D[4] = (A) => y("item:preload:success", A)),
|
|
1789
|
+
"onPreload:error": D[5] || (D[5] = (A) => y("item:preload:error", A)),
|
|
1790
|
+
onMouseEnter: D[6] || (D[6] = (A) => y("item:mouse-enter", A)),
|
|
1791
|
+
onMouseLeave: D[7] || (D[7] = (A) => y("item:mouse-leave", A))
|
|
1763
1792
|
}, {
|
|
1764
|
-
header: ve((
|
|
1765
|
-
J(
|
|
1793
|
+
header: ve((A) => [
|
|
1794
|
+
J(c.$slots, "item-header", fe({ ref_for: !0 }, A), void 0, !0)
|
|
1766
1795
|
]),
|
|
1767
|
-
footer: ve((
|
|
1768
|
-
J(
|
|
1796
|
+
footer: ve((A) => [
|
|
1797
|
+
J(c.$slots, "item-footer", fe({ ref_for: !0 }, A), void 0, !0)
|
|
1769
1798
|
]),
|
|
1770
1799
|
_: 2
|
|
1771
1800
|
}, 1032, ["item", "remove", "header-height", "footer-height"])
|
|
@@ -1775,35 +1804,35 @@ const ua = { class: "flex-1 relative min-h-0" }, ca = { class: "w-full h-full ro
|
|
|
1775
1804
|
_: 3
|
|
1776
1805
|
}, 8, ["onEnter", "onBeforeEnter", "onLeave", "onBeforeLeave"])
|
|
1777
1806
|
], 4),
|
|
1778
|
-
k.value && h.value.length > 0 ? (
|
|
1779
|
-
J(
|
|
1780
|
-
|
|
1807
|
+
k.value && h.value.length > 0 ? (_(), U("div", Pa, [
|
|
1808
|
+
J(c.$slots, "end-message", {}, () => [
|
|
1809
|
+
D[10] || (D[10] = G("p", { class: "text-gray-500 dark:text-gray-400" }, "You've reached the end", -1))
|
|
1781
1810
|
], !0)
|
|
1782
|
-
])) :
|
|
1783
|
-
|
|
1784
|
-
J(
|
|
1785
|
-
|
|
1811
|
+
])) : ae("", !0),
|
|
1812
|
+
B.value && h.value.length > 0 ? (_(), U("div", Ia, [
|
|
1813
|
+
J(c.$slots, "error-message", { error: B.value }, () => [
|
|
1814
|
+
G("p", La, "Failed to load content: " + Ee(B.value.message), 1)
|
|
1786
1815
|
], !0)
|
|
1787
|
-
])) :
|
|
1788
|
-
], 2)) : (
|
|
1789
|
-
J(
|
|
1790
|
-
|
|
1816
|
+
])) : ae("", !0)
|
|
1817
|
+
], 2)) : (_(), U("div", ya, [
|
|
1818
|
+
J(c.$slots, "loading-message", {}, () => [
|
|
1819
|
+
D[8] || (D[8] = G("p", { class: "text-gray-500 dark:text-gray-400" }, "Waiting for content to load...", -1))
|
|
1791
1820
|
], !0)
|
|
1792
1821
|
]))
|
|
1793
1822
|
], 512));
|
|
1794
1823
|
}
|
|
1795
|
-
}),
|
|
1824
|
+
}), Sa = (e, l) => {
|
|
1796
1825
|
const i = e.__vccOpts || e;
|
|
1797
|
-
for (const [a,
|
|
1798
|
-
i[a] =
|
|
1826
|
+
for (const [a, g] of l)
|
|
1827
|
+
i[a] = g;
|
|
1799
1828
|
return i;
|
|
1800
|
-
},
|
|
1829
|
+
}, _e = /* @__PURE__ */ Sa(ka, [["__scopeId", "data-v-a7ad9844"]]), Ha = {
|
|
1801
1830
|
install(e) {
|
|
1802
|
-
e.component("WyxosMasonry",
|
|
1831
|
+
e.component("WyxosMasonry", _e), e.component("WMasonry", _e), e.component("WyxosMasonryItem", xe), e.component("WMasonryItem", xe);
|
|
1803
1832
|
}
|
|
1804
1833
|
};
|
|
1805
1834
|
export {
|
|
1806
|
-
|
|
1835
|
+
_e as Masonry,
|
|
1807
1836
|
xe as MasonryItem,
|
|
1808
1837
|
Ha as default
|
|
1809
1838
|
};
|