@wyxos/vibe 1.6.24 → 1.6.25
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 +488 -482
- package/lib/vibe.css +1 -1
- package/package.json +1 -1
- package/src/Masonry.vue +1037 -1014
- package/src/useMasonryScroll.ts +3 -2
package/lib/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { nextTick as q, ref as
|
|
2
|
-
let
|
|
3
|
-
function
|
|
4
|
-
if (
|
|
1
|
+
import { nextTick as q, ref as B, computed as Z, defineComponent as et, onMounted as tt, onUnmounted as at, watch as te, createElementBlock as R, openBlock as O, createCommentVNode as ae, createElementVNode as V, normalizeStyle as ge, renderSlot as X, normalizeClass as re, withModifiers as Ye, toDisplayString as Be, unref as U, Fragment as Ue, renderList as _e, createVNode as He, withCtx as fe, mergeProps as de, TransitionGroup as Tt } from "vue";
|
|
2
|
+
let $e = null;
|
|
3
|
+
function It() {
|
|
4
|
+
if ($e != null) return $e;
|
|
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
7
|
const l = document.createElement("div");
|
|
8
8
|
l.style.width = "100%", e.appendChild(l);
|
|
9
9
|
const r = e.offsetWidth - l.offsetWidth;
|
|
10
|
-
return document.body.removeChild(e),
|
|
10
|
+
return document.body.removeChild(e), $e = r, r;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function Xe(e, l, r, t = {}) {
|
|
13
13
|
const {
|
|
14
14
|
gutterX: y = 0,
|
|
15
|
-
gutterY:
|
|
16
|
-
header:
|
|
15
|
+
gutterY: g = 0,
|
|
16
|
+
header: h = 0,
|
|
17
17
|
footer: i = 0,
|
|
18
18
|
paddingLeft: w = 0,
|
|
19
19
|
paddingRight: b = 0,
|
|
@@ -27,57 +27,57 @@ function Ye(e, l, r, t = {}) {
|
|
|
27
27
|
},
|
|
28
28
|
placement: p = "masonry"
|
|
29
29
|
} = t;
|
|
30
|
-
let x = 0,
|
|
30
|
+
let x = 0, T = 0;
|
|
31
31
|
try {
|
|
32
32
|
if (l && l.nodeType === 1 && typeof window < "u" && window.getComputedStyle) {
|
|
33
33
|
const L = window.getComputedStyle(l);
|
|
34
|
-
x = parseFloat(L.paddingLeft) || 0,
|
|
34
|
+
x = parseFloat(L.paddingLeft) || 0, T = parseFloat(L.paddingRight) || 0;
|
|
35
35
|
}
|
|
36
36
|
} catch {
|
|
37
37
|
}
|
|
38
|
-
const s = (w || 0) + x,
|
|
38
|
+
const s = (w || 0) + x, m = (b || 0) + T, a = l.offsetWidth - l.clientWidth, d = a > 0 ? a + 2 : It() + 2, v = l.offsetWidth - d - s - m, M = y * (r - 1), P = Math.floor((v - M) / r), I = e.map((L) => {
|
|
39
39
|
const k = L.width, W = L.height;
|
|
40
|
-
return Math.round(P * W / k) + i +
|
|
40
|
+
return Math.round(P * W / k) + i + h;
|
|
41
41
|
});
|
|
42
42
|
if (p === "sequential-balanced") {
|
|
43
43
|
const L = I.length;
|
|
44
44
|
if (L === 0) return [];
|
|
45
|
-
const k = (
|
|
46
|
-
let W = Math.max(...I), o = I.reduce((
|
|
47
|
-
const u = (
|
|
48
|
-
let Y = 1,
|
|
49
|
-
for (let
|
|
50
|
-
const ie = I[
|
|
51
|
-
if (
|
|
52
|
-
|
|
53
|
-
else if (Y++,
|
|
45
|
+
const k = (D, Y, J) => D + (Y > 0 ? g : 0) + J;
|
|
46
|
+
let W = Math.max(...I), o = I.reduce((D, Y) => D + Y, 0) + g * Math.max(0, L - 1);
|
|
47
|
+
const u = (D) => {
|
|
48
|
+
let Y = 1, J = 0, ne = 0;
|
|
49
|
+
for (let K = 0; K < L; K++) {
|
|
50
|
+
const ie = I[K], ee = k(J, ne, ie);
|
|
51
|
+
if (ee <= D)
|
|
52
|
+
J = ee, ne++;
|
|
53
|
+
else if (Y++, J = ie, ne = 1, ie > D || Y > r) return !1;
|
|
54
54
|
}
|
|
55
55
|
return Y <= r;
|
|
56
56
|
};
|
|
57
57
|
for (; W < o; ) {
|
|
58
|
-
const
|
|
59
|
-
u(
|
|
58
|
+
const D = Math.floor((W + o) / 2);
|
|
59
|
+
u(D) ? o = D : W = D + 1;
|
|
60
60
|
}
|
|
61
61
|
const E = o, $ = new Array(r).fill(0);
|
|
62
|
-
let C = r - 1,
|
|
63
|
-
for (let
|
|
64
|
-
const Y = I[
|
|
65
|
-
!(k(
|
|
62
|
+
let C = r - 1, A = 0, N = 0;
|
|
63
|
+
for (let D = L - 1; D >= 0; D--) {
|
|
64
|
+
const Y = I[D], J = D < C;
|
|
65
|
+
!(k(A, N, Y) <= E) || J ? ($[C] = D + 1, C--, A = Y, N = 1) : (A = k(A, N, Y), N++);
|
|
66
66
|
}
|
|
67
67
|
$[0] = 0;
|
|
68
|
-
const j = [],
|
|
69
|
-
for (let
|
|
70
|
-
const Y = $[
|
|
71
|
-
for (let
|
|
72
|
-
const
|
|
73
|
-
...e[
|
|
68
|
+
const j = [], G = new Array(r).fill(0);
|
|
69
|
+
for (let D = 0; D < r; D++) {
|
|
70
|
+
const Y = $[D], J = D + 1 < r ? $[D + 1] : L, ne = D * (P + y);
|
|
71
|
+
for (let K = Y; K < J; K++) {
|
|
72
|
+
const ee = {
|
|
73
|
+
...e[K],
|
|
74
74
|
columnWidth: P,
|
|
75
75
|
imageHeight: 0,
|
|
76
76
|
columnHeight: 0,
|
|
77
77
|
left: 0,
|
|
78
78
|
top: 0
|
|
79
79
|
};
|
|
80
|
-
|
|
80
|
+
ee.imageHeight = I[K] - (i + h), ee.columnHeight = I[K], ee.left = ne, ee.top = G[D], G[D] += ee.columnHeight + (K + 1 < J ? g : 0), j.push(ee);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
return j;
|
|
@@ -92,128 +92,128 @@ function Ye(e, l, r, t = {}) {
|
|
|
92
92
|
left: 0,
|
|
93
93
|
top: 0
|
|
94
94
|
}, o = f.indexOf(Math.min(...f)), u = k.width, E = k.height;
|
|
95
|
-
W.columnWidth = P, W.left = o * (P + y), W.imageHeight = Math.round(P * E / u), W.columnHeight = W.imageHeight + i +
|
|
95
|
+
W.columnWidth = P, W.left = o * (P + y), W.imageHeight = Math.round(P * E / u), W.columnHeight = W.imageHeight + i + h, W.top = f[o], f[o] += W.columnHeight + g, H.push(W);
|
|
96
96
|
}
|
|
97
97
|
return H;
|
|
98
98
|
}
|
|
99
|
-
var
|
|
100
|
-
function
|
|
101
|
-
var l =
|
|
99
|
+
var Et = typeof global == "object" && global && global.Object === Object && global, kt = typeof self == "object" && self && self.Object === Object && self, nt = Et || kt || Function("return this")(), xe = nt.Symbol, lt = Object.prototype, Pt = lt.hasOwnProperty, Lt = lt.toString, he = xe ? xe.toStringTag : void 0;
|
|
100
|
+
function St(e) {
|
|
101
|
+
var l = Pt.call(e, he), r = e[he];
|
|
102
102
|
try {
|
|
103
|
-
e[
|
|
103
|
+
e[he] = void 0;
|
|
104
104
|
var t = !0;
|
|
105
105
|
} catch {
|
|
106
106
|
}
|
|
107
|
-
var y =
|
|
108
|
-
return t && (l ? e[
|
|
109
|
-
}
|
|
110
|
-
var Lt = Object.prototype, Pt = Lt.toString;
|
|
111
|
-
function St(e) {
|
|
112
|
-
return Pt.call(e);
|
|
107
|
+
var y = Lt.call(e);
|
|
108
|
+
return t && (l ? e[he] = r : delete e[he]), y;
|
|
113
109
|
}
|
|
114
|
-
var Ht =
|
|
110
|
+
var Ht = Object.prototype, $t = Ht.toString;
|
|
115
111
|
function Nt(e) {
|
|
116
|
-
return
|
|
112
|
+
return $t.call(e);
|
|
113
|
+
}
|
|
114
|
+
var Bt = "[object Null]", Dt = "[object Undefined]", Ge = xe ? xe.toStringTag : void 0;
|
|
115
|
+
function zt(e) {
|
|
116
|
+
return e == null ? e === void 0 ? Dt : Bt : Ge && Ge in Object(e) ? St(e) : Nt(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 At = "[object Symbol]";
|
|
122
|
+
function Wt(e) {
|
|
123
|
+
return typeof e == "symbol" || Ft(e) && zt(e) == At;
|
|
124
124
|
}
|
|
125
|
-
var
|
|
126
|
-
function
|
|
127
|
-
for (var l = e.length; l-- &&
|
|
125
|
+
var Rt = /\s/;
|
|
126
|
+
function Ot(e) {
|
|
127
|
+
for (var l = e.length; l-- && Rt.test(e.charAt(l)); )
|
|
128
128
|
;
|
|
129
129
|
return l;
|
|
130
130
|
}
|
|
131
|
-
var
|
|
132
|
-
function
|
|
133
|
-
return e && e.slice(0,
|
|
131
|
+
var Ct = /^\s+/;
|
|
132
|
+
function jt(e) {
|
|
133
|
+
return e && e.slice(0, Ot(e) + 1).replace(Ct, "");
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function De(e) {
|
|
136
136
|
var l = typeof e;
|
|
137
137
|
return e != null && (l == "object" || l == "function");
|
|
138
138
|
}
|
|
139
|
-
var
|
|
140
|
-
function
|
|
139
|
+
var Je = NaN, Vt = /^[-+]0x[0-9a-f]+$/i, qt = /^0b[01]+$/i, Yt = /^0o[0-7]+$/i, Ut = parseInt;
|
|
140
|
+
function Ke(e) {
|
|
141
141
|
if (typeof e == "number")
|
|
142
142
|
return e;
|
|
143
|
-
if (
|
|
144
|
-
return
|
|
145
|
-
if (
|
|
143
|
+
if (Wt(e))
|
|
144
|
+
return Je;
|
|
145
|
+
if (De(e)) {
|
|
146
146
|
var l = typeof e.valueOf == "function" ? e.valueOf() : e;
|
|
147
|
-
e =
|
|
147
|
+
e = De(l) ? l + "" : l;
|
|
148
148
|
}
|
|
149
149
|
if (typeof e != "string")
|
|
150
150
|
return e === 0 ? e : +e;
|
|
151
|
-
e =
|
|
152
|
-
var r =
|
|
153
|
-
return r ||
|
|
151
|
+
e = jt(e);
|
|
152
|
+
var r = qt.test(e);
|
|
153
|
+
return r || Yt.test(e) ? Ut(e.slice(2), r ? 2 : 8) : Vt.test(e) ? Je : +e;
|
|
154
154
|
}
|
|
155
|
-
var
|
|
156
|
-
return
|
|
157
|
-
},
|
|
158
|
-
function
|
|
159
|
-
var t, y,
|
|
155
|
+
var Ne = function() {
|
|
156
|
+
return nt.Date.now();
|
|
157
|
+
}, _t = "Expected a function", Xt = Math.max, Gt = Math.min;
|
|
158
|
+
function Qe(e, l, r) {
|
|
159
|
+
var t, y, g, h, i, w, b = 0, n = !1, p = !1, x = !0;
|
|
160
160
|
if (typeof e != "function")
|
|
161
|
-
throw new TypeError(
|
|
162
|
-
l =
|
|
163
|
-
function
|
|
161
|
+
throw new TypeError(_t);
|
|
162
|
+
l = Ke(l) || 0, De(r) && (n = !!r.leading, p = "maxWait" in r, g = p ? Xt(Ke(r.maxWait) || 0, l) : g, x = "trailing" in r ? !!r.trailing : x);
|
|
163
|
+
function T(f) {
|
|
164
164
|
var H = t, L = y;
|
|
165
|
-
return t = y = void 0, b = f,
|
|
165
|
+
return t = y = void 0, b = f, h = e.apply(L, H), h;
|
|
166
166
|
}
|
|
167
167
|
function s(f) {
|
|
168
|
-
return b = f, i = setTimeout(d, l), n ?
|
|
168
|
+
return b = f, i = setTimeout(d, l), n ? T(f) : h;
|
|
169
169
|
}
|
|
170
|
-
function
|
|
170
|
+
function m(f) {
|
|
171
171
|
var H = f - w, L = f - b, k = l - H;
|
|
172
|
-
return p ?
|
|
172
|
+
return p ? Gt(k, g - L) : k;
|
|
173
173
|
}
|
|
174
174
|
function a(f) {
|
|
175
175
|
var H = f - w, L = f - b;
|
|
176
|
-
return w === void 0 || H >= l || H < 0 || p && L >=
|
|
176
|
+
return w === void 0 || H >= l || H < 0 || p && L >= g;
|
|
177
177
|
}
|
|
178
178
|
function d() {
|
|
179
|
-
var f =
|
|
179
|
+
var f = Ne();
|
|
180
180
|
if (a(f))
|
|
181
181
|
return v(f);
|
|
182
|
-
i = setTimeout(d,
|
|
182
|
+
i = setTimeout(d, m(f));
|
|
183
183
|
}
|
|
184
184
|
function v(f) {
|
|
185
|
-
return i = void 0, x && t ?
|
|
185
|
+
return i = void 0, x && t ? T(f) : (t = y = void 0, h);
|
|
186
186
|
}
|
|
187
|
-
function
|
|
187
|
+
function M() {
|
|
188
188
|
i !== void 0 && clearTimeout(i), b = 0, t = w = y = i = void 0;
|
|
189
189
|
}
|
|
190
190
|
function P() {
|
|
191
|
-
return i === void 0 ?
|
|
191
|
+
return i === void 0 ? h : v(Ne());
|
|
192
192
|
}
|
|
193
193
|
function I() {
|
|
194
|
-
var f =
|
|
194
|
+
var f = Ne(), H = a(f);
|
|
195
195
|
if (t = arguments, y = this, w = f, H) {
|
|
196
196
|
if (i === void 0)
|
|
197
197
|
return s(w);
|
|
198
198
|
if (p)
|
|
199
|
-
return clearTimeout(i), i = setTimeout(d, l),
|
|
199
|
+
return clearTimeout(i), i = setTimeout(d, l), T(w);
|
|
200
200
|
}
|
|
201
|
-
return i === void 0 && (i = setTimeout(d, l)),
|
|
201
|
+
return i === void 0 && (i = setTimeout(d, l)), h;
|
|
202
202
|
}
|
|
203
|
-
return I.cancel =
|
|
203
|
+
return I.cancel = M, I.flush = P, I;
|
|
204
204
|
}
|
|
205
205
|
function ue(e, l) {
|
|
206
206
|
const r = l ?? (typeof window < "u" ? window.innerWidth : 1024), t = e.sizes;
|
|
207
207
|
return r >= 1536 && t["2xl"] ? t["2xl"] : r >= 1280 && t.xl ? t.xl : r >= 1024 && t.lg ? t.lg : r >= 768 && t.md ? t.md : r >= 640 && t.sm ? t.sm : t.base;
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function Jt(e) {
|
|
210
210
|
const l = e ?? (typeof window < "u" ? window.innerWidth : 1024);
|
|
211
211
|
return l >= 1536 ? "2xl" : l >= 1280 ? "xl" : l >= 1024 ? "lg" : l >= 768 ? "md" : l >= 640 ? "sm" : "base";
|
|
212
212
|
}
|
|
213
|
-
function
|
|
213
|
+
function Kt(e) {
|
|
214
214
|
return e.reduce((r, t) => Math.max(r, t.top + t.columnHeight), 0) + 500;
|
|
215
215
|
}
|
|
216
|
-
function
|
|
216
|
+
function Qt(e) {
|
|
217
217
|
return {
|
|
218
218
|
transform: `translate3d(${e.left}px, ${e.top}px, 0)`,
|
|
219
219
|
top: "0px",
|
|
@@ -222,66 +222,66 @@ function Gt(e) {
|
|
|
222
222
|
height: `${e.columnHeight}px`
|
|
223
223
|
};
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function Zt(e, l = 0) {
|
|
226
226
|
return {
|
|
227
|
-
style:
|
|
227
|
+
style: Qt(e),
|
|
228
228
|
"data-top": e.top,
|
|
229
229
|
"data-left": e.left,
|
|
230
230
|
"data-id": `${e.page}-${e.id}`,
|
|
231
231
|
"data-index": l
|
|
232
232
|
};
|
|
233
233
|
}
|
|
234
|
-
function
|
|
234
|
+
function be(e, l) {
|
|
235
235
|
if (!e.length || l <= 0)
|
|
236
236
|
return new Array(Math.max(1, l)).fill(0);
|
|
237
|
-
const t = Array.from(new Set(e.map((
|
|
238
|
-
for (let
|
|
239
|
-
const
|
|
240
|
-
for (const
|
|
241
|
-
const i = y.get(
|
|
242
|
-
i != null && (
|
|
237
|
+
const t = Array.from(new Set(e.map((h) => h.left))).sort((h, i) => h - i).slice(0, l), y = /* @__PURE__ */ new Map();
|
|
238
|
+
for (let h = 0; h < t.length; h++) y.set(t[h], h);
|
|
239
|
+
const g = new Array(t.length).fill(0);
|
|
240
|
+
for (const h of e) {
|
|
241
|
+
const i = y.get(h.left);
|
|
242
|
+
i != null && (g[i] = Math.max(g[i], h.top + h.columnHeight));
|
|
243
243
|
}
|
|
244
|
-
for (;
|
|
245
|
-
return
|
|
244
|
+
for (; g.length < l; ) g.push(0);
|
|
245
|
+
return g;
|
|
246
246
|
}
|
|
247
|
-
function
|
|
247
|
+
function ea(e, l) {
|
|
248
248
|
let r = 0, t = 0;
|
|
249
249
|
const y = 1e3;
|
|
250
|
-
function
|
|
250
|
+
function g(n, p) {
|
|
251
251
|
var s;
|
|
252
252
|
const x = (s = e.container) == null ? void 0 : s.value;
|
|
253
253
|
if (x) {
|
|
254
|
-
const
|
|
255
|
-
r =
|
|
254
|
+
const m = x.scrollTop, a = x.clientHeight;
|
|
255
|
+
r = m - y, t = m + a + y;
|
|
256
256
|
}
|
|
257
257
|
return n + p >= r && n <= t;
|
|
258
258
|
}
|
|
259
|
-
function
|
|
259
|
+
function h(n, p) {
|
|
260
260
|
var v;
|
|
261
|
-
const x = parseInt(n.dataset.left || "0", 10),
|
|
261
|
+
const x = parseInt(n.dataset.left || "0", 10), T = parseInt(n.dataset.top || "0", 10), s = parseInt(n.dataset.index || "0", 10), m = n.offsetHeight || parseInt(getComputedStyle(n).height || "200", 10) || 200;
|
|
262
262
|
if ((v = l == null ? void 0 : l.virtualizing) != null && v.value) {
|
|
263
|
-
n.style.transition = "none", n.style.opacity = "1", n.style.transform = `translate3d(${x}px, ${
|
|
263
|
+
n.style.transition = "none", n.style.opacity = "1", n.style.transform = `translate3d(${x}px, ${T}px, 0) scale(1)`, n.style.removeProperty("--masonry-opacity-delay"), requestAnimationFrame(() => {
|
|
264
264
|
n.style.transition = "", p();
|
|
265
265
|
});
|
|
266
266
|
return;
|
|
267
267
|
}
|
|
268
|
-
if (!
|
|
269
|
-
n.style.opacity = "1", n.style.transform = `translate3d(${x}px, ${
|
|
268
|
+
if (!g(T, m)) {
|
|
269
|
+
n.style.opacity = "1", n.style.transform = `translate3d(${x}px, ${T}px, 0) scale(1)`, n.style.transition = "none", p();
|
|
270
270
|
return;
|
|
271
271
|
}
|
|
272
272
|
const a = Math.min(s * 20, 160), d = n.style.getPropertyValue("--masonry-opacity-delay");
|
|
273
273
|
n.style.setProperty("--masonry-opacity-delay", `${a}ms`), requestAnimationFrame(() => {
|
|
274
|
-
n.style.opacity = "1", n.style.transform = `translate3d(${x}px, ${
|
|
275
|
-
const
|
|
276
|
-
d ? n.style.setProperty("--masonry-opacity-delay", d) : n.style.removeProperty("--masonry-opacity-delay"), n.removeEventListener("transitionend",
|
|
274
|
+
n.style.opacity = "1", n.style.transform = `translate3d(${x}px, ${T}px, 0) scale(1)`;
|
|
275
|
+
const M = () => {
|
|
276
|
+
d ? n.style.setProperty("--masonry-opacity-delay", d) : n.style.removeProperty("--masonry-opacity-delay"), n.removeEventListener("transitionend", M), p();
|
|
277
277
|
};
|
|
278
|
-
n.addEventListener("transitionend",
|
|
278
|
+
n.addEventListener("transitionend", M);
|
|
279
279
|
});
|
|
280
280
|
}
|
|
281
281
|
function i(n) {
|
|
282
|
-
var
|
|
282
|
+
var T;
|
|
283
283
|
const p = parseInt(n.dataset.left || "0", 10), x = parseInt(n.dataset.top || "0", 10);
|
|
284
|
-
if ((
|
|
284
|
+
if ((T = l == null ? void 0 : l.virtualizing) != null && T.value) {
|
|
285
285
|
n.style.transition = "none", n.style.opacity = "1", n.style.transform = `translate3d(${p}px, ${x}px, 0) scale(1)`, n.style.removeProperty("--masonry-opacity-delay");
|
|
286
286
|
return;
|
|
287
287
|
}
|
|
@@ -289,9 +289,9 @@ function Kt(e, l) {
|
|
|
289
289
|
}
|
|
290
290
|
function w(n) {
|
|
291
291
|
var s;
|
|
292
|
-
const p = parseInt(n.dataset.left || "0", 10), x = parseInt(n.dataset.top || "0", 10),
|
|
292
|
+
const p = parseInt(n.dataset.left || "0", 10), x = parseInt(n.dataset.top || "0", 10), T = n.offsetHeight || parseInt(getComputedStyle(n).height || "200", 10) || 200;
|
|
293
293
|
if (!((s = l == null ? void 0 : l.virtualizing) != null && s.value)) {
|
|
294
|
-
if (!
|
|
294
|
+
if (!g(x, T)) {
|
|
295
295
|
n.style.transition = "none";
|
|
296
296
|
return;
|
|
297
297
|
}
|
|
@@ -302,58 +302,58 @@ function Kt(e, l) {
|
|
|
302
302
|
}
|
|
303
303
|
function b(n, p) {
|
|
304
304
|
var I;
|
|
305
|
-
const x = parseInt(n.dataset.left || "0", 10),
|
|
305
|
+
const x = parseInt(n.dataset.left || "0", 10), T = parseInt(n.dataset.top || "0", 10), s = n.offsetHeight || parseInt(getComputedStyle(n).height || "200", 10) || 200;
|
|
306
306
|
if ((I = l == null ? void 0 : l.virtualizing) != null && I.value) {
|
|
307
307
|
p();
|
|
308
308
|
return;
|
|
309
309
|
}
|
|
310
|
-
if (!
|
|
310
|
+
if (!g(T, s)) {
|
|
311
311
|
n.style.transition = "none", n.style.opacity = "0", p();
|
|
312
312
|
return;
|
|
313
313
|
}
|
|
314
|
-
const
|
|
315
|
-
let a = Number.isFinite(
|
|
314
|
+
const m = typeof (l == null ? void 0 : l.leaveDurationMs) == "number" ? l.leaveDurationMs : NaN;
|
|
315
|
+
let a = Number.isFinite(m) && m > 0 ? m : NaN;
|
|
316
316
|
if (!Number.isFinite(a)) {
|
|
317
317
|
const H = getComputedStyle(n).getPropertyValue("--masonry-leave-duration") || "", L = parseFloat(H);
|
|
318
318
|
a = Number.isFinite(L) && L > 0 ? L : 200;
|
|
319
319
|
}
|
|
320
320
|
const d = n.style.transitionDuration, v = () => {
|
|
321
|
-
n.removeEventListener("transitionend",
|
|
322
|
-
},
|
|
321
|
+
n.removeEventListener("transitionend", M), clearTimeout(P), n.style.transitionDuration = d || "";
|
|
322
|
+
}, M = (f) => {
|
|
323
323
|
(!f || f.target === n) && (v(), p());
|
|
324
324
|
}, P = setTimeout(() => {
|
|
325
325
|
v(), p();
|
|
326
326
|
}, a + 100);
|
|
327
327
|
requestAnimationFrame(() => {
|
|
328
|
-
n.style.transitionDuration = `${a}ms`, n.style.opacity = "0", n.style.transform = `translate3d(${x}px, ${
|
|
328
|
+
n.style.transitionDuration = `${a}ms`, n.style.opacity = "0", n.style.transform = `translate3d(${x}px, ${T + 10}px, 0) scale(0.985)`, n.addEventListener("transitionend", M);
|
|
329
329
|
});
|
|
330
330
|
}
|
|
331
331
|
return {
|
|
332
|
-
onEnter:
|
|
332
|
+
onEnter: h,
|
|
333
333
|
onBeforeEnter: i,
|
|
334
334
|
onBeforeLeave: w,
|
|
335
335
|
onLeave: b
|
|
336
336
|
};
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function ta({
|
|
339
339
|
container: e,
|
|
340
340
|
masonry: l,
|
|
341
341
|
columns: r,
|
|
342
342
|
containerHeight: t,
|
|
343
343
|
isLoading: y,
|
|
344
|
-
pageSize:
|
|
345
|
-
refreshLayout:
|
|
344
|
+
pageSize: g,
|
|
345
|
+
refreshLayout: h,
|
|
346
346
|
setItemsRaw: i,
|
|
347
347
|
loadNext: w,
|
|
348
348
|
loadThresholdPx: b
|
|
349
349
|
}) {
|
|
350
350
|
let n = 0;
|
|
351
|
-
async function p(x) {
|
|
351
|
+
async function p(x, T = !1) {
|
|
352
352
|
if (!e.value) return;
|
|
353
|
-
const
|
|
353
|
+
const s = x ?? be(l.value, r.value), m = s.length ? Math.max(...s) : 0, a = e.value.scrollTop + e.value.clientHeight, d = e.value.scrollTop > n + 1;
|
|
354
354
|
n = e.value.scrollTop;
|
|
355
|
-
const
|
|
356
|
-
if (
|
|
355
|
+
const v = typeof b == "number" ? b : 200, M = v >= 0 ? Math.max(0, m - v) : Math.max(0, m + v);
|
|
356
|
+
if (a >= M && (d || T) && !y.value) {
|
|
357
357
|
await w(), await q();
|
|
358
358
|
return;
|
|
359
359
|
}
|
|
@@ -362,17 +362,17 @@ function Qt({
|
|
|
362
362
|
handleScroll: p
|
|
363
363
|
};
|
|
364
364
|
}
|
|
365
|
-
function
|
|
366
|
-
const { useSwipeMode: l, masonry: r, isLoading: t, loadNext: y, loadPage:
|
|
365
|
+
function aa(e) {
|
|
366
|
+
const { useSwipeMode: l, masonry: r, isLoading: t, loadNext: y, loadPage: g, paginationHistory: h } = e, i = B(0), w = B(0), b = B(!1), n = B(0), p = B(0), x = B(null), T = Z(() => {
|
|
367
367
|
if (!l.value || r.value.length === 0) return null;
|
|
368
368
|
const o = Math.max(0, Math.min(i.value, r.value.length - 1));
|
|
369
369
|
return r.value[o] || null;
|
|
370
|
-
}), s =
|
|
371
|
-
if (!l.value || !
|
|
370
|
+
}), s = Z(() => {
|
|
371
|
+
if (!l.value || !T.value) return null;
|
|
372
372
|
const o = i.value + 1;
|
|
373
373
|
return o >= r.value.length ? null : r.value[o] || null;
|
|
374
|
-
}),
|
|
375
|
-
if (!l.value || !
|
|
374
|
+
}), m = Z(() => {
|
|
375
|
+
if (!l.value || !T.value) return null;
|
|
376
376
|
const o = i.value - 1;
|
|
377
377
|
return o < 0 ? null : r.value[o] || null;
|
|
378
378
|
});
|
|
@@ -389,9 +389,9 @@ function Zt(e) {
|
|
|
389
389
|
i.value++, a(), i.value >= r.value.length - 5 && y();
|
|
390
390
|
}
|
|
391
391
|
function v() {
|
|
392
|
-
|
|
392
|
+
m.value && (i.value--, a());
|
|
393
393
|
}
|
|
394
|
-
function
|
|
394
|
+
function M(o) {
|
|
395
395
|
l.value && (b.value = !0, n.value = o.touches[0].clientY, p.value = w.value, o.preventDefault());
|
|
396
396
|
}
|
|
397
397
|
function P(o) {
|
|
@@ -403,7 +403,7 @@ function Zt(e) {
|
|
|
403
403
|
if (!l.value || !b.value) return;
|
|
404
404
|
b.value = !1;
|
|
405
405
|
const u = w.value - p.value;
|
|
406
|
-
Math.abs(u) > 100 ? u > 0 &&
|
|
406
|
+
Math.abs(u) > 100 ? u > 0 && m.value ? v() : u < 0 && s.value ? d() : a() : a(), o.preventDefault();
|
|
407
407
|
}
|
|
408
408
|
function f(o) {
|
|
409
409
|
l.value && (b.value = !0, n.value = o.clientY, p.value = w.value, o.preventDefault());
|
|
@@ -417,10 +417,10 @@ function Zt(e) {
|
|
|
417
417
|
if (!l.value || !b.value) return;
|
|
418
418
|
b.value = !1;
|
|
419
419
|
const u = w.value - p.value;
|
|
420
|
-
Math.abs(u) > 100 ? u > 0 &&
|
|
420
|
+
Math.abs(u) > 100 ? u > 0 && m.value ? v() : u < 0 && s.value ? d() : a() : a(), o.preventDefault();
|
|
421
421
|
}
|
|
422
422
|
function k() {
|
|
423
|
-
!l.value && i.value > 0 && (i.value = 0, w.value = 0), l.value && r.value.length === 0 && !t.value && h
|
|
423
|
+
!l.value && i.value > 0 && (i.value = 0, w.value = 0), l.value && r.value.length === 0 && !t.value && g(h.value[0]), l.value && a();
|
|
424
424
|
}
|
|
425
425
|
function W() {
|
|
426
426
|
i.value = 0, w.value = 0, b.value = !1;
|
|
@@ -432,11 +432,11 @@ function Zt(e) {
|
|
|
432
432
|
isDragging: b,
|
|
433
433
|
swipeContainer: x,
|
|
434
434
|
// Computed
|
|
435
|
-
currentItem:
|
|
435
|
+
currentItem: T,
|
|
436
436
|
nextItem: s,
|
|
437
|
-
previousItem:
|
|
437
|
+
previousItem: m,
|
|
438
438
|
// Functions
|
|
439
|
-
handleTouchStart:
|
|
439
|
+
handleTouchStart: M,
|
|
440
440
|
handleTouchMove: P,
|
|
441
441
|
handleTouchEnd: I,
|
|
442
442
|
handleMouseDown: f,
|
|
@@ -449,41 +449,41 @@ function Zt(e) {
|
|
|
449
449
|
reset: W
|
|
450
450
|
};
|
|
451
451
|
}
|
|
452
|
-
function
|
|
452
|
+
function me(e) {
|
|
453
453
|
return e instanceof Error ? e : new Error(String(e));
|
|
454
454
|
}
|
|
455
|
-
function
|
|
455
|
+
function na(e) {
|
|
456
456
|
const {
|
|
457
457
|
getNextPage: l,
|
|
458
458
|
masonry: r,
|
|
459
459
|
isLoading: t,
|
|
460
460
|
hasReachedEnd: y,
|
|
461
|
-
loadError:
|
|
462
|
-
currentPage:
|
|
461
|
+
loadError: g,
|
|
462
|
+
currentPage: h,
|
|
463
463
|
paginationHistory: i,
|
|
464
464
|
refreshLayout: w,
|
|
465
465
|
retryMaxAttempts: b,
|
|
466
466
|
retryInitialDelayMs: n,
|
|
467
467
|
retryBackoffStepMs: p,
|
|
468
468
|
backfillEnabled: x,
|
|
469
|
-
backfillDelayMs:
|
|
469
|
+
backfillDelayMs: T,
|
|
470
470
|
backfillMaxCalls: s,
|
|
471
|
-
pageSize:
|
|
471
|
+
pageSize: m,
|
|
472
472
|
autoRefreshOnEmpty: a,
|
|
473
473
|
emits: d
|
|
474
|
-
} = e, v =
|
|
475
|
-
let
|
|
474
|
+
} = e, v = B(!1);
|
|
475
|
+
let M = !1;
|
|
476
476
|
function P(u, E) {
|
|
477
477
|
return new Promise(($) => {
|
|
478
|
-
const C = Math.max(0, u | 0),
|
|
478
|
+
const C = Math.max(0, u | 0), A = Date.now();
|
|
479
479
|
E(C, C);
|
|
480
480
|
const N = setInterval(() => {
|
|
481
481
|
if (v.value) {
|
|
482
482
|
clearInterval(N), $();
|
|
483
483
|
return;
|
|
484
484
|
}
|
|
485
|
-
const j = Date.now() -
|
|
486
|
-
E(
|
|
485
|
+
const j = Date.now() - A, G = Math.max(0, C - j);
|
|
486
|
+
E(G, C), G <= 0 && (clearInterval(N), $());
|
|
487
487
|
}, 100);
|
|
488
488
|
});
|
|
489
489
|
}
|
|
@@ -493,11 +493,11 @@ function ea(e) {
|
|
|
493
493
|
let C = n;
|
|
494
494
|
for (; ; )
|
|
495
495
|
try {
|
|
496
|
-
const
|
|
497
|
-
return E > 0 && d("retry:stop", { attempt: E, success: !0 }),
|
|
498
|
-
} catch (
|
|
496
|
+
const A = await u();
|
|
497
|
+
return E > 0 && d("retry:stop", { attempt: E, success: !0 }), A;
|
|
498
|
+
} catch (A) {
|
|
499
499
|
if (E++, E > $)
|
|
500
|
-
throw d("retry:stop", { attempt: E - 1, success: !1 }),
|
|
500
|
+
throw d("retry:stop", { attempt: E - 1, success: !1 }), A;
|
|
501
501
|
d("retry:start", { attempt: E, max: $, totalMs: C }), await P(C, (N, j) => {
|
|
502
502
|
d("retry:tick", { attempt: E, remainingMs: N, totalMs: j });
|
|
503
503
|
}), C += p;
|
|
@@ -512,58 +512,58 @@ function ea(e) {
|
|
|
512
512
|
}
|
|
513
513
|
}
|
|
514
514
|
async function H(u, E = !1) {
|
|
515
|
-
if (!E && !x ||
|
|
516
|
-
const $ = (u || 0) + (
|
|
517
|
-
if (!
|
|
515
|
+
if (!E && !x || M || v.value || y.value) return;
|
|
516
|
+
const $ = (u || 0) + (m || 0);
|
|
517
|
+
if (!m || m <= 0) return;
|
|
518
518
|
if (i.value[i.value.length - 1] == null) {
|
|
519
519
|
y.value = !0;
|
|
520
520
|
return;
|
|
521
521
|
}
|
|
522
522
|
if (!(r.value.length >= $)) {
|
|
523
|
-
|
|
523
|
+
M = !0, t.value = !0;
|
|
524
524
|
try {
|
|
525
|
-
let
|
|
526
|
-
for (d("backfill:start", { target: $, fetched: r.value.length, calls:
|
|
525
|
+
let A = 0;
|
|
526
|
+
for (d("backfill:start", { target: $, fetched: r.value.length, calls: A }); r.value.length < $ && A < s && i.value[i.value.length - 1] != null && !v.value && !y.value && M && (await P(T, (j, G) => {
|
|
527
527
|
d("backfill:tick", {
|
|
528
528
|
fetched: r.value.length,
|
|
529
529
|
target: $,
|
|
530
|
-
calls:
|
|
530
|
+
calls: A,
|
|
531
531
|
remainingMs: j,
|
|
532
|
-
totalMs:
|
|
532
|
+
totalMs: G
|
|
533
533
|
});
|
|
534
|
-
}), !(v.value || !
|
|
534
|
+
}), !(v.value || !M)); ) {
|
|
535
535
|
const N = i.value[i.value.length - 1];
|
|
536
536
|
if (N == null) {
|
|
537
537
|
y.value = !0;
|
|
538
538
|
break;
|
|
539
539
|
}
|
|
540
540
|
try {
|
|
541
|
-
if (v.value || !
|
|
541
|
+
if (v.value || !M) break;
|
|
542
542
|
const j = await f(N);
|
|
543
|
-
if (v.value || !
|
|
544
|
-
|
|
543
|
+
if (v.value || !M) break;
|
|
544
|
+
g.value = null, i.value.push(j.nextPage), j.nextPage == null && (y.value = !0);
|
|
545
545
|
} catch (j) {
|
|
546
|
-
if (v.value || !
|
|
547
|
-
|
|
546
|
+
if (v.value || !M) break;
|
|
547
|
+
g.value = me(j);
|
|
548
548
|
}
|
|
549
|
-
|
|
549
|
+
A++;
|
|
550
550
|
}
|
|
551
|
-
d("backfill:stop", { fetched: r.value.length, calls:
|
|
551
|
+
d("backfill:stop", { fetched: r.value.length, calls: A });
|
|
552
552
|
} finally {
|
|
553
|
-
|
|
553
|
+
M = !1, t.value = !1;
|
|
554
554
|
}
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
557
|
async function L(u) {
|
|
558
558
|
if (!t.value) {
|
|
559
|
-
v.value = !1, t.value = !0, y.value = !1,
|
|
559
|
+
v.value = !1, t.value = !0, y.value = !1, g.value = null;
|
|
560
560
|
try {
|
|
561
561
|
const E = r.value.length;
|
|
562
562
|
if (v.value) return;
|
|
563
563
|
const $ = await f(u);
|
|
564
|
-
return v.value ? void 0 : (
|
|
564
|
+
return v.value ? void 0 : (g.value = null, h.value = u, i.value.push($.nextPage), $.nextPage == null && (y.value = !0), await H(E), $);
|
|
565
565
|
} catch (E) {
|
|
566
|
-
throw
|
|
566
|
+
throw g.value = me(E), E;
|
|
567
567
|
} finally {
|
|
568
568
|
t.value = !1;
|
|
569
569
|
}
|
|
@@ -571,7 +571,7 @@ function ea(e) {
|
|
|
571
571
|
}
|
|
572
572
|
async function k() {
|
|
573
573
|
if (!t.value && !y.value) {
|
|
574
|
-
v.value = !1, t.value = !0,
|
|
574
|
+
v.value = !1, t.value = !0, g.value = null;
|
|
575
575
|
try {
|
|
576
576
|
const u = r.value.length;
|
|
577
577
|
if (v.value) return;
|
|
@@ -581,9 +581,9 @@ function ea(e) {
|
|
|
581
581
|
return;
|
|
582
582
|
}
|
|
583
583
|
const $ = await f(E);
|
|
584
|
-
return v.value ? void 0 : (
|
|
584
|
+
return v.value ? void 0 : (g.value = null, h.value = E, i.value.push($.nextPage), $.nextPage == null && (y.value = !0), await H(u), $);
|
|
585
585
|
} catch (u) {
|
|
586
|
-
throw
|
|
586
|
+
throw g.value = me(u), u;
|
|
587
587
|
} finally {
|
|
588
588
|
t.value = !1;
|
|
589
589
|
}
|
|
@@ -593,27 +593,27 @@ function ea(e) {
|
|
|
593
593
|
if (!t.value) {
|
|
594
594
|
v.value = !1, t.value = !0;
|
|
595
595
|
try {
|
|
596
|
-
const u =
|
|
596
|
+
const u = h.value;
|
|
597
597
|
if (u == null) {
|
|
598
|
-
console.warn("[Masonry] No current page to refresh - currentPage:",
|
|
598
|
+
console.warn("[Masonry] No current page to refresh - currentPage:", h.value, "paginationHistory:", i.value);
|
|
599
599
|
return;
|
|
600
600
|
}
|
|
601
|
-
r.value = [], y.value = !1,
|
|
601
|
+
r.value = [], y.value = !1, g.value = null, i.value = [u];
|
|
602
602
|
const E = await f(u);
|
|
603
603
|
if (v.value) return;
|
|
604
|
-
|
|
604
|
+
g.value = null, h.value = u, i.value.push(E.nextPage), E.nextPage == null && (y.value = !0);
|
|
605
605
|
const $ = r.value.length;
|
|
606
606
|
return await H($), E;
|
|
607
607
|
} catch (u) {
|
|
608
|
-
throw
|
|
608
|
+
throw g.value = me(u), u;
|
|
609
609
|
} finally {
|
|
610
610
|
t.value = !1;
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
613
|
}
|
|
614
614
|
function o() {
|
|
615
|
-
const u =
|
|
616
|
-
v.value = !0, t.value = !1,
|
|
615
|
+
const u = M;
|
|
616
|
+
v.value = !0, t.value = !1, M = !1, u && d("backfill:stop", { fetched: r.value.length, calls: 0, cancelled: !0 });
|
|
617
617
|
}
|
|
618
618
|
return {
|
|
619
619
|
loadPage: L,
|
|
@@ -624,42 +624,42 @@ function ea(e) {
|
|
|
624
624
|
getContent: f
|
|
625
625
|
};
|
|
626
626
|
}
|
|
627
|
-
function
|
|
627
|
+
function la(e) {
|
|
628
628
|
const {
|
|
629
629
|
masonry: l,
|
|
630
630
|
useSwipeMode: r,
|
|
631
631
|
refreshLayout: t,
|
|
632
632
|
refreshCurrentPage: y,
|
|
633
|
-
loadNext:
|
|
634
|
-
maybeBackfillToTarget:
|
|
633
|
+
loadNext: g,
|
|
634
|
+
maybeBackfillToTarget: h,
|
|
635
635
|
autoRefreshOnEmpty: i,
|
|
636
636
|
paginationHistory: w
|
|
637
637
|
} = e;
|
|
638
638
|
async function b(s) {
|
|
639
|
-
const
|
|
640
|
-
if (l.value =
|
|
639
|
+
const m = l.value.filter((a) => a.id !== s.id);
|
|
640
|
+
if (l.value = m, await q(), m.length === 0 && w.value.length > 0) {
|
|
641
641
|
if (i)
|
|
642
642
|
await y();
|
|
643
643
|
else
|
|
644
644
|
try {
|
|
645
|
-
await
|
|
645
|
+
await g(), await h(0, !0);
|
|
646
646
|
} catch {
|
|
647
647
|
}
|
|
648
648
|
return;
|
|
649
649
|
}
|
|
650
650
|
await new Promise((a) => requestAnimationFrame(() => a())), requestAnimationFrame(() => {
|
|
651
|
-
t(
|
|
651
|
+
t(m);
|
|
652
652
|
});
|
|
653
653
|
}
|
|
654
654
|
async function n(s) {
|
|
655
655
|
if (!s || s.length === 0) return;
|
|
656
|
-
const
|
|
656
|
+
const m = new Set(s.map((d) => d.id)), a = l.value.filter((d) => !m.has(d.id));
|
|
657
657
|
if (l.value = a, await q(), a.length === 0 && w.value.length > 0) {
|
|
658
658
|
if (i)
|
|
659
659
|
await y();
|
|
660
660
|
else
|
|
661
661
|
try {
|
|
662
|
-
await
|
|
662
|
+
await g(), await h(0, !0);
|
|
663
663
|
} catch {
|
|
664
664
|
}
|
|
665
665
|
return;
|
|
@@ -668,40 +668,40 @@ function ta(e) {
|
|
|
668
668
|
t(a);
|
|
669
669
|
});
|
|
670
670
|
}
|
|
671
|
-
async function p(s,
|
|
671
|
+
async function p(s, m) {
|
|
672
672
|
if (!s) return;
|
|
673
673
|
const a = l.value;
|
|
674
674
|
if (a.findIndex((P) => P.id === s.id) !== -1) return;
|
|
675
|
-
const v = [...a],
|
|
676
|
-
v.splice(
|
|
675
|
+
const v = [...a], M = Math.min(m, v.length);
|
|
676
|
+
v.splice(M, 0, s), l.value = v, await q(), r.value || (await new Promise((P) => requestAnimationFrame(() => P())), requestAnimationFrame(() => {
|
|
677
677
|
t(v);
|
|
678
678
|
}));
|
|
679
679
|
}
|
|
680
|
-
async function x(s,
|
|
680
|
+
async function x(s, m) {
|
|
681
681
|
var L;
|
|
682
682
|
if (!s || s.length === 0) return;
|
|
683
|
-
if (!
|
|
683
|
+
if (!m || m.length !== s.length) {
|
|
684
684
|
console.warn("[Masonry] restoreMany: items and indices arrays must have the same length");
|
|
685
685
|
return;
|
|
686
686
|
}
|
|
687
687
|
const a = l.value, d = new Set(a.map((k) => k.id)), v = [];
|
|
688
688
|
for (let k = 0; k < s.length; k++)
|
|
689
|
-
d.has((L = s[k]) == null ? void 0 : L.id) || v.push({ item: s[k], index:
|
|
689
|
+
d.has((L = s[k]) == null ? void 0 : L.id) || v.push({ item: s[k], index: m[k] });
|
|
690
690
|
if (v.length === 0) return;
|
|
691
|
-
const
|
|
691
|
+
const M = /* @__PURE__ */ new Map();
|
|
692
692
|
for (const { item: k, index: W } of v)
|
|
693
|
-
|
|
693
|
+
M.set(W, k);
|
|
694
694
|
const P = v.length > 0 ? Math.max(...v.map(({ index: k }) => k)) : -1, I = Math.max(a.length - 1, P), f = [];
|
|
695
695
|
let H = 0;
|
|
696
696
|
for (let k = 0; k <= I; k++)
|
|
697
|
-
|
|
697
|
+
M.has(k) ? f.push(M.get(k)) : H < a.length && (f.push(a[H]), H++);
|
|
698
698
|
for (; H < a.length; )
|
|
699
699
|
f.push(a[H]), H++;
|
|
700
700
|
l.value = f, await q(), r.value || (await new Promise((k) => requestAnimationFrame(() => k())), requestAnimationFrame(() => {
|
|
701
701
|
t(f);
|
|
702
702
|
}));
|
|
703
703
|
}
|
|
704
|
-
async function
|
|
704
|
+
async function T() {
|
|
705
705
|
l.value = [];
|
|
706
706
|
}
|
|
707
707
|
return {
|
|
@@ -709,47 +709,47 @@ function ta(e) {
|
|
|
709
709
|
removeMany: n,
|
|
710
710
|
restore: p,
|
|
711
711
|
restoreMany: x,
|
|
712
|
-
removeAll:
|
|
712
|
+
removeAll: T
|
|
713
713
|
};
|
|
714
714
|
}
|
|
715
|
-
function
|
|
715
|
+
function oa(e) {
|
|
716
716
|
const {
|
|
717
717
|
masonry: l,
|
|
718
718
|
useSwipeMode: r,
|
|
719
719
|
container: t,
|
|
720
720
|
columns: y,
|
|
721
|
-
containerWidth:
|
|
722
|
-
masonryContentHeight:
|
|
721
|
+
containerWidth: g,
|
|
722
|
+
masonryContentHeight: h,
|
|
723
723
|
layout: i,
|
|
724
724
|
fixedDimensions: w,
|
|
725
725
|
checkItemDimensions: b
|
|
726
726
|
} = e;
|
|
727
727
|
let n = [];
|
|
728
|
-
function p(
|
|
729
|
-
const a =
|
|
728
|
+
function p(m) {
|
|
729
|
+
const a = Kt(m);
|
|
730
730
|
let d = 0;
|
|
731
731
|
if (t.value) {
|
|
732
|
-
const { scrollTop: v, clientHeight:
|
|
733
|
-
d = v +
|
|
732
|
+
const { scrollTop: v, clientHeight: M } = t.value;
|
|
733
|
+
d = v + M + 100;
|
|
734
734
|
}
|
|
735
|
-
|
|
735
|
+
h.value = Math.max(a, d);
|
|
736
736
|
}
|
|
737
|
-
function x(
|
|
738
|
-
var
|
|
737
|
+
function x(m) {
|
|
738
|
+
var M, P;
|
|
739
739
|
if (r.value) {
|
|
740
|
-
l.value =
|
|
740
|
+
l.value = m;
|
|
741
741
|
return;
|
|
742
742
|
}
|
|
743
743
|
if (!t.value) return;
|
|
744
|
-
if (b(
|
|
744
|
+
if (b(m, "refreshLayout"), m.length > 1e3 && n.length > m.length && n.length - m.length < 100) {
|
|
745
745
|
let I = !0;
|
|
746
|
-
for (let f = 0; f <
|
|
747
|
-
if (((
|
|
746
|
+
for (let f = 0; f < m.length; f++)
|
|
747
|
+
if (((M = m[f]) == null ? void 0 : M.id) !== ((P = n[f]) == null ? void 0 : P.id)) {
|
|
748
748
|
I = !1;
|
|
749
749
|
break;
|
|
750
750
|
}
|
|
751
751
|
if (I) {
|
|
752
|
-
const f =
|
|
752
|
+
const f = m.map((H, L) => ({
|
|
753
753
|
...n[L],
|
|
754
754
|
originalIndex: L
|
|
755
755
|
}));
|
|
@@ -757,46 +757,46 @@ function aa(e) {
|
|
|
757
757
|
return;
|
|
758
758
|
}
|
|
759
759
|
}
|
|
760
|
-
const d =
|
|
760
|
+
const d = m.map((I, f) => ({
|
|
761
761
|
...I,
|
|
762
762
|
originalIndex: f
|
|
763
763
|
})), v = t.value;
|
|
764
764
|
if (w.value && w.value.width !== void 0) {
|
|
765
765
|
const I = v.style.width, f = v.style.boxSizing;
|
|
766
766
|
v.style.boxSizing = "border-box", v.style.width = `${w.value.width}px`, v.offsetWidth;
|
|
767
|
-
const H =
|
|
767
|
+
const H = Xe(d, v, y.value, i.value);
|
|
768
768
|
v.style.width = I, v.style.boxSizing = f, p(H), l.value = H, n = H;
|
|
769
769
|
} else {
|
|
770
|
-
const I =
|
|
770
|
+
const I = Xe(d, v, y.value, i.value);
|
|
771
771
|
p(I), l.value = I, n = I;
|
|
772
772
|
}
|
|
773
773
|
}
|
|
774
|
-
function
|
|
775
|
-
w.value =
|
|
776
|
-
y.value = ue(i.value,
|
|
774
|
+
function T(m, a) {
|
|
775
|
+
w.value = m, m && (m.width !== void 0 && (g.value = m.width), !r.value && t.value && l.value.length > 0 && q(() => {
|
|
776
|
+
y.value = ue(i.value, g.value), x(l.value), a && a();
|
|
777
777
|
}));
|
|
778
778
|
}
|
|
779
779
|
function s() {
|
|
780
|
-
y.value = ue(i.value,
|
|
780
|
+
y.value = ue(i.value, g.value), x(l.value);
|
|
781
781
|
}
|
|
782
782
|
return {
|
|
783
783
|
refreshLayout: x,
|
|
784
|
-
setFixedDimensions:
|
|
784
|
+
setFixedDimensions: T,
|
|
785
785
|
onResize: s,
|
|
786
786
|
calculateHeight: p
|
|
787
787
|
};
|
|
788
788
|
}
|
|
789
|
-
function
|
|
789
|
+
function ra(e) {
|
|
790
790
|
const {
|
|
791
791
|
masonry: l,
|
|
792
792
|
container: r,
|
|
793
793
|
columns: t,
|
|
794
794
|
virtualBufferPx: y,
|
|
795
|
-
loadThresholdPx:
|
|
796
|
-
} = e,
|
|
795
|
+
loadThresholdPx: g
|
|
796
|
+
} = e, h = B(e.handleScroll), i = B(0), w = B(0), b = y, n = B(!1), p = B({
|
|
797
797
|
distanceToTrigger: 0,
|
|
798
798
|
isNearTrigger: !1
|
|
799
|
-
}), x =
|
|
799
|
+
}), x = Z(() => {
|
|
800
800
|
const a = i.value - b, d = i.value + w.value + b, v = l.value;
|
|
801
801
|
return !v || v.length === 0 ? [] : v.filter((P) => {
|
|
802
802
|
if (typeof P.top != "number" || typeof P.columnHeight != "number")
|
|
@@ -805,9 +805,9 @@ function na(e) {
|
|
|
805
805
|
return P.top + P.columnHeight >= a && I <= d;
|
|
806
806
|
});
|
|
807
807
|
});
|
|
808
|
-
function
|
|
808
|
+
function T(a) {
|
|
809
809
|
if (!r.value) return;
|
|
810
|
-
const { scrollTop: d, clientHeight: v } = r.value,
|
|
810
|
+
const { scrollTop: d, clientHeight: v } = r.value, M = d + v, P = a ?? be(l.value, t.value), I = P.length ? Math.max(...P) : 0, f = typeof g == "number" ? g : 200, H = f >= 0 ? Math.max(0, I - f) : Math.max(0, I + f), L = Math.max(0, H - M), k = L <= 100;
|
|
811
811
|
p.value = {
|
|
812
812
|
distanceToTrigger: Math.round(L),
|
|
813
813
|
isNearTrigger: k
|
|
@@ -815,14 +815,14 @@ function na(e) {
|
|
|
815
815
|
}
|
|
816
816
|
async function s() {
|
|
817
817
|
if (r.value) {
|
|
818
|
-
const d = r.value.scrollTop, v = r.value.clientHeight || window.innerHeight,
|
|
819
|
-
i.value = d, w.value =
|
|
818
|
+
const d = r.value.scrollTop, v = r.value.clientHeight || window.innerHeight, M = v > 0 ? v : window.innerHeight;
|
|
819
|
+
i.value = d, w.value = M;
|
|
820
820
|
}
|
|
821
821
|
n.value = !0, await q(), await new Promise((d) => requestAnimationFrame(() => d())), n.value = !1;
|
|
822
|
-
const a =
|
|
823
|
-
|
|
822
|
+
const a = be(l.value, t.value);
|
|
823
|
+
h.value(a), T(a);
|
|
824
824
|
}
|
|
825
|
-
function
|
|
825
|
+
function m() {
|
|
826
826
|
i.value = 0, w.value = 0, n.value = !1, p.value = {
|
|
827
827
|
distanceToTrigger: 0,
|
|
828
828
|
isNearTrigger: !1
|
|
@@ -834,21 +834,21 @@ function na(e) {
|
|
|
834
834
|
virtualizing: n,
|
|
835
835
|
scrollProgress: p,
|
|
836
836
|
visibleMasonry: x,
|
|
837
|
-
updateScrollProgress:
|
|
837
|
+
updateScrollProgress: T,
|
|
838
838
|
updateViewport: s,
|
|
839
|
-
reset:
|
|
840
|
-
handleScroll:
|
|
839
|
+
reset: m,
|
|
840
|
+
handleScroll: h
|
|
841
841
|
};
|
|
842
842
|
}
|
|
843
|
-
function
|
|
844
|
-
const { masonry: l } = e, r =
|
|
845
|
-
function t(
|
|
846
|
-
return typeof
|
|
843
|
+
function ia(e) {
|
|
844
|
+
const { masonry: l } = e, r = B(/* @__PURE__ */ new Set());
|
|
845
|
+
function t(h) {
|
|
846
|
+
return typeof h == "number" && h > 0 && Number.isFinite(h);
|
|
847
847
|
}
|
|
848
|
-
function y(
|
|
848
|
+
function y(h, i) {
|
|
849
849
|
try {
|
|
850
|
-
if (!Array.isArray(
|
|
851
|
-
const w =
|
|
850
|
+
if (!Array.isArray(h) || h.length === 0) return;
|
|
851
|
+
const w = h.filter((n) => !t(n == null ? void 0 : n.width) || !t(n == null ? void 0 : n.height));
|
|
852
852
|
if (w.length === 0) return;
|
|
853
853
|
const b = [];
|
|
854
854
|
for (const n of w) {
|
|
@@ -870,28 +870,28 @@ function la(e) {
|
|
|
870
870
|
} catch {
|
|
871
871
|
}
|
|
872
872
|
}
|
|
873
|
-
function
|
|
873
|
+
function g() {
|
|
874
874
|
r.value.clear();
|
|
875
875
|
}
|
|
876
876
|
return {
|
|
877
877
|
checkItemDimensions: y,
|
|
878
878
|
invalidDimensionIds: r,
|
|
879
|
-
reset:
|
|
879
|
+
reset: g
|
|
880
880
|
};
|
|
881
881
|
}
|
|
882
|
-
const
|
|
882
|
+
const sa = { class: "flex-1 relative min-h-0" }, ua = { class: "w-full h-full rounded-xl overflow-hidden shadow-sm transition-all duration-300 bg-white relative" }, ca = {
|
|
883
883
|
key: 0,
|
|
884
884
|
class: "absolute inset-0 flex flex-col items-center justify-center bg-slate-100 text-slate-400 text-sm p-4 text-center"
|
|
885
|
-
},
|
|
885
|
+
}, va = {
|
|
886
886
|
key: 1,
|
|
887
887
|
class: "relative w-full h-full"
|
|
888
|
-
},
|
|
888
|
+
}, fa = ["src"], da = ["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 = {
|
|
889
889
|
key: 3,
|
|
890
890
|
class: "absolute bottom-2 left-1/2 transform -translate-x-1/2 flex items-center justify-center z-10"
|
|
891
|
-
},
|
|
891
|
+
}, ga = {
|
|
892
892
|
key: 4,
|
|
893
893
|
class: "absolute inset-0 flex flex-col items-center justify-center bg-slate-50 text-slate-400 text-sm p-4 text-center"
|
|
894
|
-
},
|
|
894
|
+
}, Me = /* @__PURE__ */ et({
|
|
895
895
|
__name: "MasonryItem",
|
|
896
896
|
props: {
|
|
897
897
|
item: {},
|
|
@@ -905,16 +905,16 @@ const oa = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full ro
|
|
|
905
905
|
},
|
|
906
906
|
emits: ["preload:success", "preload:error", "mouse-enter", "mouse-leave"],
|
|
907
907
|
setup(e, { emit: l }) {
|
|
908
|
-
const r = e, t = l, y =
|
|
909
|
-
let
|
|
910
|
-
const a =
|
|
908
|
+
const r = e, t = l, y = B(!1), g = B(!1), h = B(null), i = B(!1), w = B(!1), b = B(null), n = B(!1), p = B(!1), x = B(!1), T = B(null), s = B(null);
|
|
909
|
+
let m = null;
|
|
910
|
+
const a = Z(() => {
|
|
911
911
|
var o;
|
|
912
912
|
return r.type ?? ((o = r.item) == null ? void 0 : o.type) ?? "image";
|
|
913
|
-
}), d =
|
|
913
|
+
}), d = Z(() => {
|
|
914
914
|
var o;
|
|
915
915
|
return r.notFound ?? ((o = r.item) == null ? void 0 : o.notFound) ?? !1;
|
|
916
|
-
}), v =
|
|
917
|
-
function
|
|
916
|
+
}), v = Z(() => !!r.inSwipeMode);
|
|
917
|
+
function M(o) {
|
|
918
918
|
t("mouse-enter", { item: r.item, type: o });
|
|
919
919
|
}
|
|
920
920
|
function P(o) {
|
|
@@ -927,7 +927,7 @@ const oa = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full ro
|
|
|
927
927
|
}
|
|
928
928
|
function f(o) {
|
|
929
929
|
const u = o.target;
|
|
930
|
-
u && (v.value || u.play(),
|
|
930
|
+
u && (v.value || u.play(), M("video"));
|
|
931
931
|
}
|
|
932
932
|
function H(o) {
|
|
933
933
|
const u = o.target;
|
|
@@ -940,14 +940,14 @@ const oa = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full ro
|
|
|
940
940
|
t("preload:error", { item: r.item, type: "image", src: o, error: N }), E(N);
|
|
941
941
|
return;
|
|
942
942
|
}
|
|
943
|
-
const $ = new Image(), C = Date.now(),
|
|
943
|
+
const $ = new Image(), C = Date.now(), A = 300;
|
|
944
944
|
$.onload = () => {
|
|
945
|
-
const N = Date.now() - C, j = Math.max(0,
|
|
945
|
+
const N = Date.now() - C, j = Math.max(0, A - N);
|
|
946
946
|
setTimeout(async () => {
|
|
947
|
-
y.value = !0,
|
|
947
|
+
y.value = !0, g.value = !1, p.value = !1, await q(), await new Promise((G) => setTimeout(G, 100)), x.value = !0, t("preload:success", { item: r.item, type: "image", src: o }), u();
|
|
948
948
|
}, j);
|
|
949
949
|
}, $.onerror = () => {
|
|
950
|
-
|
|
950
|
+
g.value = !0, y.value = !1, p.value = !1;
|
|
951
951
|
const N = new Error("Failed to load image");
|
|
952
952
|
t("preload:error", { item: r.item, type: "image", src: o, error: N }), E(N);
|
|
953
953
|
}, $.src = o;
|
|
@@ -960,11 +960,11 @@ const oa = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full ro
|
|
|
960
960
|
t("preload:error", { item: r.item, type: "video", src: o, error: N }), E(N);
|
|
961
961
|
return;
|
|
962
962
|
}
|
|
963
|
-
const $ = document.createElement("video"), C = Date.now(),
|
|
963
|
+
const $ = document.createElement("video"), C = Date.now(), A = 300;
|
|
964
964
|
$.preload = "metadata", $.muted = !0, $.onloadedmetadata = () => {
|
|
965
|
-
const N = Date.now() - C, j = Math.max(0,
|
|
965
|
+
const N = Date.now() - C, j = Math.max(0, A - N);
|
|
966
966
|
setTimeout(async () => {
|
|
967
|
-
i.value = !0, w.value = !1, p.value = !1, await q(), await new Promise((
|
|
967
|
+
i.value = !0, w.value = !1, p.value = !1, await q(), await new Promise((G) => setTimeout(G, 100)), x.value = !0, t("preload:success", { item: r.item, type: "video", src: o }), u();
|
|
968
968
|
}, j);
|
|
969
969
|
}, $.onerror = () => {
|
|
970
970
|
w.value = !0, i.value = !1, p.value = !1;
|
|
@@ -986,15 +986,15 @@ const oa = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full ro
|
|
|
986
986
|
} catch {
|
|
987
987
|
}
|
|
988
988
|
} else {
|
|
989
|
-
|
|
989
|
+
h.value = o, y.value = !1, g.value = !1;
|
|
990
990
|
try {
|
|
991
991
|
await L(o);
|
|
992
992
|
} catch {
|
|
993
993
|
}
|
|
994
994
|
}
|
|
995
995
|
}
|
|
996
|
-
return
|
|
997
|
-
|
|
996
|
+
return tt(() => {
|
|
997
|
+
T.value && (m = new IntersectionObserver(
|
|
998
998
|
(o) => {
|
|
999
999
|
o.forEach((u) => {
|
|
1000
1000
|
u.isIntersecting && u.intersectionRatio >= 1 ? n.value || (n.value = !0, W()) : u.isIntersecting;
|
|
@@ -1004,10 +1004,10 @@ const oa = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full ro
|
|
|
1004
1004
|
// Only trigger when item is 100% visible (full height in view)
|
|
1005
1005
|
threshold: [1]
|
|
1006
1006
|
}
|
|
1007
|
-
),
|
|
1008
|
-
}),
|
|
1009
|
-
|
|
1010
|
-
}),
|
|
1007
|
+
), m.observe(T.value));
|
|
1008
|
+
}), at(() => {
|
|
1009
|
+
m && (m.disconnect(), m = null);
|
|
1010
|
+
}), te(
|
|
1011
1011
|
() => {
|
|
1012
1012
|
var o;
|
|
1013
1013
|
return (o = r.item) == null ? void 0 : o.src;
|
|
@@ -1022,7 +1022,7 @@ const oa = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full ro
|
|
|
1022
1022
|
} catch {
|
|
1023
1023
|
}
|
|
1024
1024
|
}
|
|
1025
|
-
} else if (o !==
|
|
1025
|
+
} else if (o !== h.value && (y.value = !1, g.value = !1, h.value = o, n.value)) {
|
|
1026
1026
|
p.value = !0;
|
|
1027
1027
|
try {
|
|
1028
1028
|
await L(o);
|
|
@@ -1031,14 +1031,14 @@ const oa = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full ro
|
|
|
1031
1031
|
}
|
|
1032
1032
|
}
|
|
1033
1033
|
}
|
|
1034
|
-
),
|
|
1034
|
+
), te(
|
|
1035
1035
|
() => r.isActive,
|
|
1036
1036
|
(o) => {
|
|
1037
1037
|
!v.value || !s.value || (o ? s.value.play() : s.value.pause());
|
|
1038
1038
|
}
|
|
1039
1039
|
), (o, u) => (O(), R("div", {
|
|
1040
1040
|
ref_key: "containerRef",
|
|
1041
|
-
ref:
|
|
1041
|
+
ref: T,
|
|
1042
1042
|
class: "relative w-full h-full flex flex-col"
|
|
1043
1043
|
}, [
|
|
1044
1044
|
o.headerHeight > 0 ? (O(), R("div", {
|
|
@@ -1046,42 +1046,42 @@ const oa = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full ro
|
|
|
1046
1046
|
class: "relative z-10",
|
|
1047
1047
|
style: ge({ height: `${o.headerHeight}px` })
|
|
1048
1048
|
}, [
|
|
1049
|
-
|
|
1049
|
+
X(o.$slots, "header", {
|
|
1050
1050
|
item: o.item,
|
|
1051
1051
|
remove: o.remove,
|
|
1052
1052
|
imageLoaded: y.value,
|
|
1053
|
-
imageError:
|
|
1053
|
+
imageError: g.value,
|
|
1054
1054
|
videoLoaded: i.value,
|
|
1055
1055
|
videoError: w.value,
|
|
1056
1056
|
showNotFound: d.value,
|
|
1057
1057
|
isLoading: p.value,
|
|
1058
1058
|
mediaType: a.value
|
|
1059
1059
|
})
|
|
1060
|
-
], 4)) :
|
|
1061
|
-
V("div",
|
|
1062
|
-
|
|
1060
|
+
], 4)) : ae("", !0),
|
|
1061
|
+
V("div", sa, [
|
|
1062
|
+
X(o.$slots, "default", {
|
|
1063
1063
|
item: o.item,
|
|
1064
1064
|
remove: o.remove,
|
|
1065
1065
|
imageLoaded: y.value,
|
|
1066
|
-
imageError:
|
|
1066
|
+
imageError: g.value,
|
|
1067
1067
|
videoLoaded: i.value,
|
|
1068
1068
|
videoError: w.value,
|
|
1069
1069
|
showNotFound: d.value,
|
|
1070
1070
|
isLoading: p.value,
|
|
1071
1071
|
mediaType: a.value,
|
|
1072
|
-
imageSrc:
|
|
1072
|
+
imageSrc: h.value,
|
|
1073
1073
|
videoSrc: b.value,
|
|
1074
1074
|
showMedia: x.value
|
|
1075
1075
|
}, () => [
|
|
1076
|
-
V("div",
|
|
1077
|
-
d.value ? (O(), R("div",
|
|
1076
|
+
V("div", ua, [
|
|
1077
|
+
d.value ? (O(), R("div", ca, u[3] || (u[3] = [
|
|
1078
1078
|
V("i", { class: "fas fa-search text-3xl mb-3 opacity-50" }, null, -1),
|
|
1079
1079
|
V("span", { class: "font-medium" }, "Not Found", -1),
|
|
1080
1080
|
V("span", { class: "text-xs mt-1 opacity-75" }, "This item could not be located", -1)
|
|
1081
|
-
]))) : (O(), R("div",
|
|
1082
|
-
a.value === "image" &&
|
|
1081
|
+
]))) : (O(), R("div", va, [
|
|
1082
|
+
a.value === "image" && h.value ? (O(), R("img", {
|
|
1083
1083
|
key: 0,
|
|
1084
|
-
src:
|
|
1084
|
+
src: h.value,
|
|
1085
1085
|
class: re([
|
|
1086
1086
|
"w-full h-full object-cover transition-opacity duration-700 ease-in-out",
|
|
1087
1087
|
y.value && x.value ? "opacity-100" : "opacity-0"
|
|
@@ -1090,9 +1090,9 @@ const oa = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full ro
|
|
|
1090
1090
|
loading: "lazy",
|
|
1091
1091
|
decoding: "async",
|
|
1092
1092
|
alt: "",
|
|
1093
|
-
onMouseenter: u[0] || (u[0] = (E) =>
|
|
1093
|
+
onMouseenter: u[0] || (u[0] = (E) => M("image")),
|
|
1094
1094
|
onMouseleave: u[1] || (u[1] = (E) => P("image"))
|
|
1095
|
-
}, null, 42,
|
|
1095
|
+
}, null, 42, fa)) : ae("", !0),
|
|
1096
1096
|
a.value === "video" && b.value ? (O(), R("video", {
|
|
1097
1097
|
key: 1,
|
|
1098
1098
|
ref_key: "videoEl",
|
|
@@ -1108,38 +1108,38 @@ const oa = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full ro
|
|
|
1108
1108
|
playsinline: "",
|
|
1109
1109
|
autoplay: v.value && r.isActive,
|
|
1110
1110
|
controls: v.value,
|
|
1111
|
-
onClick:
|
|
1112
|
-
onTouchend:
|
|
1111
|
+
onClick: Ye(I, ["stop"]),
|
|
1112
|
+
onTouchend: Ye(I, ["stop", "prevent"]),
|
|
1113
1113
|
onMouseenter: f,
|
|
1114
1114
|
onMouseleave: H,
|
|
1115
1115
|
onError: u[2] || (u[2] = (E) => w.value = !0)
|
|
1116
|
-
}, null, 42,
|
|
1117
|
-
!y.value && !i.value && !
|
|
1116
|
+
}, null, 42, da)) : ae("", !0),
|
|
1117
|
+
!y.value && !i.value && !g.value && !w.value ? (O(), R("div", {
|
|
1118
1118
|
key: 2,
|
|
1119
1119
|
class: re([
|
|
1120
1120
|
"absolute inset-0 bg-slate-100 flex items-center justify-center transition-opacity duration-500",
|
|
1121
1121
|
x.value ? "opacity-0 pointer-events-none" : "opacity-100"
|
|
1122
1122
|
])
|
|
1123
1123
|
}, [
|
|
1124
|
-
V("div",
|
|
1125
|
-
|
|
1124
|
+
V("div", ha, [
|
|
1125
|
+
X(o.$slots, "placeholder-icon", { mediaType: a.value }, () => [
|
|
1126
1126
|
V("i", {
|
|
1127
1127
|
class: re(a.value === "video" ? "fas fa-video text-xl text-slate-400" : "fas fa-image text-xl text-slate-400")
|
|
1128
1128
|
}, null, 2)
|
|
1129
1129
|
])
|
|
1130
1130
|
])
|
|
1131
|
-
], 2)) :
|
|
1132
|
-
p.value ? (O(), R("div",
|
|
1131
|
+
], 2)) : ae("", !0),
|
|
1132
|
+
p.value ? (O(), R("div", ma, u[4] || (u[4] = [
|
|
1133
1133
|
V("div", { class: "bg-white/90 backdrop-blur-sm rounded-full px-3 py-1.5 shadow-sm" }, [
|
|
1134
1134
|
V("div", { class: "animate-spin rounded-full h-4 w-4 border-b-2 border-blue-500" })
|
|
1135
1135
|
], -1)
|
|
1136
|
-
]))) :
|
|
1137
|
-
a.value === "image" &&
|
|
1136
|
+
]))) : ae("", !0),
|
|
1137
|
+
a.value === "image" && g.value || a.value === "video" && w.value ? (O(), R("div", ga, [
|
|
1138
1138
|
V("i", {
|
|
1139
1139
|
class: re(a.value === "video" ? "fas fa-video text-2xl mb-2 opacity-50" : "fas fa-image text-2xl mb-2 opacity-50")
|
|
1140
1140
|
}, null, 2),
|
|
1141
|
-
V("span", null, "Failed to load " +
|
|
1142
|
-
])) :
|
|
1141
|
+
V("span", null, "Failed to load " + Be(a.value), 1)
|
|
1142
|
+
])) : ae("", !0)
|
|
1143
1143
|
]))
|
|
1144
1144
|
])
|
|
1145
1145
|
])
|
|
@@ -1149,33 +1149,33 @@ const oa = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full ro
|
|
|
1149
1149
|
class: "relative z-10",
|
|
1150
1150
|
style: ge({ height: `${o.footerHeight}px` })
|
|
1151
1151
|
}, [
|
|
1152
|
-
|
|
1152
|
+
X(o.$slots, "footer", {
|
|
1153
1153
|
item: o.item,
|
|
1154
1154
|
remove: o.remove,
|
|
1155
1155
|
imageLoaded: y.value,
|
|
1156
|
-
imageError:
|
|
1156
|
+
imageError: g.value,
|
|
1157
1157
|
videoLoaded: i.value,
|
|
1158
1158
|
videoError: w.value,
|
|
1159
1159
|
showNotFound: d.value,
|
|
1160
1160
|
isLoading: p.value,
|
|
1161
1161
|
mediaType: a.value
|
|
1162
1162
|
})
|
|
1163
|
-
], 4)) :
|
|
1163
|
+
], 4)) : ae("", !0)
|
|
1164
1164
|
], 512));
|
|
1165
1165
|
}
|
|
1166
|
-
}),
|
|
1166
|
+
}), pa = { class: "w-full h-full flex items-center justify-center p-4" }, ya = { class: "w-full h-full max-w-full max-h-full relative" }, wa = {
|
|
1167
1167
|
key: 0,
|
|
1168
1168
|
class: "w-full py-8 text-center"
|
|
1169
|
-
},
|
|
1169
|
+
}, xa = {
|
|
1170
1170
|
key: 1,
|
|
1171
1171
|
class: "w-full py-8 text-center"
|
|
1172
|
-
},
|
|
1172
|
+
}, ba = { class: "text-red-500 dark:text-red-400" }, Ma = {
|
|
1173
1173
|
key: 0,
|
|
1174
1174
|
class: "w-full py-8 text-center"
|
|
1175
|
-
},
|
|
1175
|
+
}, Ta = {
|
|
1176
1176
|
key: 1,
|
|
1177
1177
|
class: "w-full py-8 text-center"
|
|
1178
|
-
},
|
|
1178
|
+
}, Ia = { class: "text-red-500 dark:text-red-400" }, Ea = /* @__PURE__ */ et({
|
|
1179
1179
|
__name: "Masonry",
|
|
1180
1180
|
props: {
|
|
1181
1181
|
getNextPage: {
|
|
@@ -1312,7 +1312,7 @@ const oa = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full ro
|
|
|
1312
1312
|
paddingLeft: 0,
|
|
1313
1313
|
paddingRight: 0,
|
|
1314
1314
|
placement: "masonry"
|
|
1315
|
-
},
|
|
1315
|
+
}, g = Z(() => {
|
|
1316
1316
|
var c;
|
|
1317
1317
|
return {
|
|
1318
1318
|
...y,
|
|
@@ -1322,7 +1322,7 @@ const oa = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full ro
|
|
|
1322
1322
|
...((c = t.layout) == null ? void 0 : c.sizes) || {}
|
|
1323
1323
|
}
|
|
1324
1324
|
};
|
|
1325
|
-
}),
|
|
1325
|
+
}), h = B(null), i = B(typeof window < "u" ? window.innerWidth : 1024), w = B(typeof window < "u" ? window.innerHeight : 768), b = B(null);
|
|
1326
1326
|
let n = null;
|
|
1327
1327
|
function p(c) {
|
|
1328
1328
|
return {
|
|
@@ -1333,42 +1333,42 @@ const oa = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full ro
|
|
|
1333
1333
|
"2xl": 1536
|
|
1334
1334
|
}[c] || 768;
|
|
1335
1335
|
}
|
|
1336
|
-
const x =
|
|
1336
|
+
const x = Z(() => {
|
|
1337
1337
|
if (t.layoutMode === "masonry") return !1;
|
|
1338
1338
|
if (t.layoutMode === "swipe") return !0;
|
|
1339
1339
|
const c = typeof t.mobileBreakpoint == "string" ? p(t.mobileBreakpoint) : t.mobileBreakpoint;
|
|
1340
1340
|
return i.value < c;
|
|
1341
|
-
}),
|
|
1341
|
+
}), T = r, s = Z({
|
|
1342
1342
|
get: () => t.items,
|
|
1343
|
-
set: (c) =>
|
|
1344
|
-
}),
|
|
1343
|
+
set: (c) => T("update:items", c)
|
|
1344
|
+
}), m = B(7), a = B(null), d = B([]), v = B(null), M = B(!1), P = B(0), I = B(!1), f = B(null), H = Z(() => Jt(i.value)), L = ia({
|
|
1345
1345
|
masonry: s
|
|
1346
|
-
}), { checkItemDimensions: k, reset: W } = L, o =
|
|
1346
|
+
}), { checkItemDimensions: k, reset: W } = L, o = oa({
|
|
1347
1347
|
masonry: s,
|
|
1348
1348
|
useSwipeMode: x,
|
|
1349
1349
|
container: a,
|
|
1350
|
-
columns:
|
|
1350
|
+
columns: m,
|
|
1351
1351
|
containerWidth: i,
|
|
1352
1352
|
masonryContentHeight: P,
|
|
1353
|
-
layout:
|
|
1353
|
+
layout: g,
|
|
1354
1354
|
fixedDimensions: b,
|
|
1355
1355
|
checkItemDimensions: k
|
|
1356
|
-
}), { refreshLayout: u, setFixedDimensions: E, onResize: $ } = o, C =
|
|
1356
|
+
}), { refreshLayout: u, setFixedDimensions: E, onResize: $ } = o, C = ra({
|
|
1357
1357
|
masonry: s,
|
|
1358
1358
|
container: a,
|
|
1359
|
-
columns:
|
|
1359
|
+
columns: m,
|
|
1360
1360
|
virtualBufferPx: t.virtualBufferPx,
|
|
1361
1361
|
loadThresholdPx: t.loadThresholdPx,
|
|
1362
1362
|
handleScroll: () => {
|
|
1363
1363
|
}
|
|
1364
1364
|
// Will be set after pagination is initialized
|
|
1365
|
-
}), { viewportTop:
|
|
1365
|
+
}), { viewportTop: A, viewportHeight: N, virtualizing: j, visibleMasonry: G, updateScrollProgress: D, updateViewport: Y, reset: J } = C, { onEnter: ne, onBeforeEnter: K, onBeforeLeave: ie, onLeave: ee } = ea(
|
|
1366
1366
|
{ container: a },
|
|
1367
1367
|
{ leaveDurationMs: t.leaveDurationMs, virtualizing: j }
|
|
1368
|
-
),
|
|
1368
|
+
), ot = ne, rt = K, it = ie, st = ee, ut = na({
|
|
1369
1369
|
getNextPage: t.getNextPage,
|
|
1370
1370
|
masonry: s,
|
|
1371
|
-
isLoading:
|
|
1371
|
+
isLoading: M,
|
|
1372
1372
|
hasReachedEnd: I,
|
|
1373
1373
|
loadError: f,
|
|
1374
1374
|
currentPage: v,
|
|
@@ -1382,20 +1382,20 @@ const oa = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full ro
|
|
|
1382
1382
|
backfillMaxCalls: t.backfillMaxCalls,
|
|
1383
1383
|
pageSize: t.pageSize,
|
|
1384
1384
|
autoRefreshOnEmpty: t.autoRefreshOnEmpty,
|
|
1385
|
-
emits:
|
|
1386
|
-
}), { loadPage:
|
|
1385
|
+
emits: T
|
|
1386
|
+
}), { loadPage: Te, loadNext: pe, refreshCurrentPage: ze, cancelLoad: Ie, maybeBackfillToTarget: ct } = ut, Q = aa({
|
|
1387
1387
|
useSwipeMode: x,
|
|
1388
1388
|
masonry: s,
|
|
1389
|
-
isLoading:
|
|
1389
|
+
isLoading: M,
|
|
1390
1390
|
loadNext: pe,
|
|
1391
|
-
loadPage:
|
|
1391
|
+
loadPage: Te,
|
|
1392
1392
|
paginationHistory: d
|
|
1393
|
-
}), { handleScroll:
|
|
1393
|
+
}), { handleScroll: Fe } = ta({
|
|
1394
1394
|
container: a,
|
|
1395
1395
|
masonry: s,
|
|
1396
|
-
columns:
|
|
1396
|
+
columns: m,
|
|
1397
1397
|
containerHeight: P,
|
|
1398
|
-
isLoading:
|
|
1398
|
+
isLoading: M,
|
|
1399
1399
|
pageSize: t.pageSize,
|
|
1400
1400
|
refreshLayout: u,
|
|
1401
1401
|
setItemsRaw: (c) => {
|
|
@@ -1404,22 +1404,22 @@ const oa = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full ro
|
|
|
1404
1404
|
loadNext: pe,
|
|
1405
1405
|
loadThresholdPx: t.loadThresholdPx
|
|
1406
1406
|
});
|
|
1407
|
-
C.handleScroll.value =
|
|
1408
|
-
const
|
|
1407
|
+
C.handleScroll.value = Fe;
|
|
1408
|
+
const vt = la({
|
|
1409
1409
|
masonry: s,
|
|
1410
1410
|
useSwipeMode: x,
|
|
1411
1411
|
refreshLayout: u,
|
|
1412
1412
|
refreshCurrentPage: ze,
|
|
1413
1413
|
loadNext: pe,
|
|
1414
|
-
maybeBackfillToTarget:
|
|
1414
|
+
maybeBackfillToTarget: ct,
|
|
1415
1415
|
autoRefreshOnEmpty: t.autoRefreshOnEmpty,
|
|
1416
1416
|
paginationHistory: d
|
|
1417
|
-
}), { remove: ce, removeMany:
|
|
1418
|
-
function
|
|
1419
|
-
E(c,
|
|
1417
|
+
}), { remove: ce, removeMany: ft, restore: dt, restoreMany: ht, removeAll: mt } = vt;
|
|
1418
|
+
function gt(c) {
|
|
1419
|
+
E(c, D), !c && h.value && (i.value = h.value.clientWidth, w.value = h.value.clientHeight);
|
|
1420
1420
|
}
|
|
1421
1421
|
l({
|
|
1422
|
-
isLoading:
|
|
1422
|
+
isLoading: M,
|
|
1423
1423
|
refreshLayout: u,
|
|
1424
1424
|
// Container dimensions (wrapper element)
|
|
1425
1425
|
containerWidth: i,
|
|
@@ -1433,138 +1433,144 @@ const oa = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full ro
|
|
|
1433
1433
|
// Load error tracking
|
|
1434
1434
|
loadError: f,
|
|
1435
1435
|
// Set fixed dimensions (overrides ResizeObserver)
|
|
1436
|
-
setFixedDimensions:
|
|
1436
|
+
setFixedDimensions: gt,
|
|
1437
1437
|
remove: ce,
|
|
1438
|
-
removeMany:
|
|
1439
|
-
removeAll:
|
|
1440
|
-
restore:
|
|
1441
|
-
restoreMany:
|
|
1438
|
+
removeMany: ft,
|
|
1439
|
+
removeAll: mt,
|
|
1440
|
+
restore: dt,
|
|
1441
|
+
restoreMany: ht,
|
|
1442
1442
|
loadNext: pe,
|
|
1443
|
-
loadPage:
|
|
1443
|
+
loadPage: Te,
|
|
1444
1444
|
refreshCurrentPage: ze,
|
|
1445
|
-
reset:
|
|
1446
|
-
destroy:
|
|
1447
|
-
init:
|
|
1445
|
+
reset: xt,
|
|
1446
|
+
destroy: bt,
|
|
1447
|
+
init: Ve,
|
|
1448
1448
|
restoreItems: Le,
|
|
1449
1449
|
paginationHistory: d,
|
|
1450
|
-
cancelLoad:
|
|
1451
|
-
scrollToTop:
|
|
1452
|
-
scrollTo:
|
|
1453
|
-
totalItems:
|
|
1450
|
+
cancelLoad: Ie,
|
|
1451
|
+
scrollToTop: pt,
|
|
1452
|
+
scrollTo: yt,
|
|
1453
|
+
totalItems: Z(() => s.value.length),
|
|
1454
1454
|
currentBreakpoint: H
|
|
1455
1455
|
});
|
|
1456
|
-
const se =
|
|
1457
|
-
function
|
|
1456
|
+
const se = Q.currentSwipeIndex, ve = Q.swipeOffset, ye = Q.isDragging, le = Q.swipeContainer, Ae = Q.handleTouchStart, We = Q.handleTouchMove, Re = Q.handleTouchEnd, Oe = Q.handleMouseDown, Ee = Q.handleMouseMove, ke = Q.handleMouseUp, Pe = Q.snapToCurrentItem;
|
|
1457
|
+
function pt(c) {
|
|
1458
1458
|
a.value && a.value.scrollTo({
|
|
1459
1459
|
top: 0,
|
|
1460
1460
|
behavior: (c == null ? void 0 : c.behavior) ?? "smooth",
|
|
1461
1461
|
...c
|
|
1462
1462
|
});
|
|
1463
1463
|
}
|
|
1464
|
-
function
|
|
1464
|
+
function yt(c) {
|
|
1465
1465
|
a.value && (a.value.scrollTo({
|
|
1466
1466
|
top: c.top ?? a.value.scrollTop,
|
|
1467
1467
|
left: c.left ?? a.value.scrollLeft,
|
|
1468
1468
|
behavior: c.behavior ?? "auto"
|
|
1469
|
-
}), a.value && (
|
|
1469
|
+
}), a.value && (A.value = a.value.scrollTop, N.value = a.value.clientHeight || window.innerHeight));
|
|
1470
1470
|
}
|
|
1471
|
-
function
|
|
1472
|
-
$(), a.value && (
|
|
1471
|
+
function wt() {
|
|
1472
|
+
$(), a.value && (A.value = a.value.scrollTop, N.value = a.value.clientHeight);
|
|
1473
1473
|
}
|
|
1474
|
-
function
|
|
1475
|
-
|
|
1474
|
+
function xt() {
|
|
1475
|
+
Ie(), a.value && a.value.scrollTo({
|
|
1476
1476
|
top: 0,
|
|
1477
1477
|
behavior: "smooth"
|
|
1478
|
-
}), s.value = [], w.value = 0, v.value = t.loadAtPage, d.value = [t.loadAtPage], I.value = !1, f.value = null,
|
|
1478
|
+
}), s.value = [], w.value = 0, v.value = t.loadAtPage, d.value = [t.loadAtPage], I.value = !1, f.value = null, J(), we = !1;
|
|
1479
1479
|
}
|
|
1480
|
-
function
|
|
1481
|
-
|
|
1480
|
+
function bt() {
|
|
1481
|
+
Ie(), s.value = [], P.value = 0, v.value = null, d.value = [], I.value = !1, f.value = null, M.value = !1, se.value = 0, ve.value = 0, ye.value = !1, J(), W(), a.value && a.value.scrollTo({
|
|
1482
1482
|
top: 0,
|
|
1483
1483
|
behavior: "auto"
|
|
1484
1484
|
// Instant scroll for destroy
|
|
1485
1485
|
});
|
|
1486
1486
|
}
|
|
1487
|
-
const oe =
|
|
1487
|
+
const oe = Qe(async () => {
|
|
1488
1488
|
x.value || await Y();
|
|
1489
|
-
}, 200),
|
|
1490
|
-
function
|
|
1491
|
-
|
|
1489
|
+
}, 200), Ce = Qe(wt, 200);
|
|
1490
|
+
function je() {
|
|
1491
|
+
Q.handleWindowResize();
|
|
1492
1492
|
}
|
|
1493
|
-
function
|
|
1494
|
-
v.value = S, d.value = [S], d.value.push(
|
|
1495
|
-
a.value && (
|
|
1493
|
+
function Ve(c, S, z) {
|
|
1494
|
+
v.value = S, d.value = [S], d.value.push(z), I.value = z == null, k(c, "init"), x.value ? (s.value = [...s.value, ...c], se.value === 0 && s.value.length > 0 && (ve.value = 0)) : (u([...s.value, ...c]), a.value && (A.value = a.value.scrollTop, N.value = a.value.clientHeight || window.innerHeight), q(() => {
|
|
1495
|
+
a.value && (A.value = a.value.scrollTop, N.value = a.value.clientHeight || window.innerHeight, D());
|
|
1496
1496
|
}));
|
|
1497
1497
|
}
|
|
1498
|
-
async function Le(c, S,
|
|
1498
|
+
async function Le(c, S, z) {
|
|
1499
1499
|
if (!t.skipInitialLoad) {
|
|
1500
|
-
|
|
1500
|
+
Ve(c, S, z);
|
|
1501
1501
|
return;
|
|
1502
1502
|
}
|
|
1503
|
-
v.value = S, d.value = [S],
|
|
1503
|
+
if (v.value = S, d.value = [S], z != null && d.value.push(z), I.value = z === null, f.value = null, k(c, "restoreItems"), x.value)
|
|
1504
|
+
s.value = c, se.value === 0 && s.value.length > 0 && (ve.value = 0);
|
|
1505
|
+
else if (u(c), a.value && (A.value = a.value.scrollTop, N.value = a.value.clientHeight || window.innerHeight), await q(), a.value) {
|
|
1506
|
+
A.value = a.value.scrollTop, N.value = a.value.clientHeight || window.innerHeight, D(), await q();
|
|
1507
|
+
const _ = be(s.value, m.value), F = _.length ? Math.max(..._) : 0, qe = a.value.scrollTop + a.value.clientHeight, Se = typeof t.loadThresholdPx == "number" ? t.loadThresholdPx : 200, Mt = Se >= 0 ? Math.max(0, F - Se) : Math.max(0, F + Se);
|
|
1508
|
+
qe >= Mt && !I.value && !M.value && d.value.length > 0 && d.value[d.value.length - 1] != null && await Fe(_, !0);
|
|
1509
|
+
}
|
|
1504
1510
|
}
|
|
1505
|
-
|
|
1506
|
-
|
|
1511
|
+
te(
|
|
1512
|
+
g,
|
|
1507
1513
|
() => {
|
|
1508
|
-
x.value || a.value && (
|
|
1514
|
+
x.value || a.value && (m.value = ue(g.value, i.value), u(s.value));
|
|
1509
1515
|
},
|
|
1510
1516
|
{ deep: !0 }
|
|
1511
|
-
),
|
|
1512
|
-
b.value && b.value.width !== void 0 ? i.value = b.value.width :
|
|
1513
|
-
}),
|
|
1517
|
+
), te(() => t.layoutMode, () => {
|
|
1518
|
+
b.value && b.value.width !== void 0 ? i.value = b.value.width : h.value && (i.value = h.value.clientWidth);
|
|
1519
|
+
}), te(a, (c) => {
|
|
1514
1520
|
c && !x.value ? (c.removeEventListener("scroll", oe), c.addEventListener("scroll", oe, { passive: !0 })) : c && c.removeEventListener("scroll", oe);
|
|
1515
1521
|
}, { immediate: !0 });
|
|
1516
1522
|
let we = !1;
|
|
1517
|
-
return
|
|
1523
|
+
return te(
|
|
1518
1524
|
() => [t.items, t.skipInitialLoad, t.initialPage, t.initialNextPage],
|
|
1519
|
-
([c, S,
|
|
1525
|
+
([c, S, z, _]) => {
|
|
1520
1526
|
if (S && c && c.length > 0 && !we) {
|
|
1521
1527
|
we = !0;
|
|
1522
|
-
const
|
|
1523
|
-
Le(c,
|
|
1528
|
+
const F = z ?? t.loadAtPage;
|
|
1529
|
+
Le(c, F, _ !== void 0 ? _ : void 0);
|
|
1524
1530
|
}
|
|
1525
1531
|
},
|
|
1526
1532
|
{ immediate: !1 }
|
|
1527
|
-
),
|
|
1533
|
+
), te(x, (c, S) => {
|
|
1528
1534
|
S === void 0 && c === !1 || q(() => {
|
|
1529
|
-
c ? (document.addEventListener("mousemove",
|
|
1535
|
+
c ? (document.addEventListener("mousemove", Ee), document.addEventListener("mouseup", ke), a.value && a.value.removeEventListener("scroll", oe), se.value = 0, ve.value = 0, s.value.length > 0 && Pe()) : (document.removeEventListener("mousemove", Ee), document.removeEventListener("mouseup", ke), a.value && h.value && (b.value && b.value.width !== void 0 ? i.value = b.value.width : i.value = h.value.clientWidth, a.value.removeEventListener("scroll", oe), a.value.addEventListener("scroll", oe, { passive: !0 }), s.value.length > 0 && (m.value = ue(g.value, i.value), u(s.value), A.value = a.value.scrollTop, N.value = a.value.clientHeight, D())));
|
|
1530
1536
|
});
|
|
1531
|
-
}, { immediate: !0 }),
|
|
1532
|
-
c && (c.addEventListener("touchstart",
|
|
1533
|
-
}),
|
|
1534
|
-
x.value && c > 0 && S === 0 && (se.value = 0, q(() =>
|
|
1535
|
-
}),
|
|
1537
|
+
}, { immediate: !0 }), te(le, (c) => {
|
|
1538
|
+
c && (c.addEventListener("touchstart", Ae, { passive: !1 }), c.addEventListener("touchmove", We, { passive: !1 }), c.addEventListener("touchend", Re), c.addEventListener("mousedown", Oe));
|
|
1539
|
+
}), te(() => s.value.length, (c, S) => {
|
|
1540
|
+
x.value && c > 0 && S === 0 && (se.value = 0, q(() => Pe()));
|
|
1541
|
+
}), te(h, (c) => {
|
|
1536
1542
|
n && (n.disconnect(), n = null), c && typeof ResizeObserver < "u" ? (n = new ResizeObserver((S) => {
|
|
1537
1543
|
if (!b.value)
|
|
1538
|
-
for (const
|
|
1539
|
-
const
|
|
1540
|
-
i.value !==
|
|
1544
|
+
for (const z of S) {
|
|
1545
|
+
const _ = z.contentRect.width, F = z.contentRect.height;
|
|
1546
|
+
i.value !== _ && (i.value = _), w.value !== F && (w.value = F);
|
|
1541
1547
|
}
|
|
1542
1548
|
}), n.observe(c), b.value || (i.value = c.clientWidth, w.value = c.clientHeight)) : c && (b.value || (i.value = c.clientWidth, w.value = c.clientHeight));
|
|
1543
|
-
}, { immediate: !0 }),
|
|
1549
|
+
}, { immediate: !0 }), te(i, (c, S) => {
|
|
1544
1550
|
c !== S && c > 0 && !x.value && a.value && s.value.length > 0 && q(() => {
|
|
1545
|
-
|
|
1551
|
+
m.value = ue(g.value, c), u(s.value), D();
|
|
1546
1552
|
});
|
|
1547
|
-
}),
|
|
1553
|
+
}), tt(async () => {
|
|
1548
1554
|
try {
|
|
1549
|
-
await q(),
|
|
1555
|
+
await q(), h.value && !n && (i.value = h.value.clientWidth, w.value = h.value.clientHeight), x.value || (m.value = ue(g.value, i.value), a.value && (A.value = a.value.scrollTop, N.value = a.value.clientHeight));
|
|
1550
1556
|
const c = t.loadAtPage;
|
|
1551
1557
|
if (d.value = [c], !t.skipInitialLoad)
|
|
1552
|
-
await
|
|
1558
|
+
await Te(d.value[0]);
|
|
1553
1559
|
else if (t.items && t.items.length > 0) {
|
|
1554
|
-
const S = t.initialPage !== null && t.initialPage !== void 0 ? t.initialPage : t.loadAtPage,
|
|
1555
|
-
await Le(t.items, S,
|
|
1560
|
+
const S = t.initialPage !== null && t.initialPage !== void 0 ? t.initialPage : t.loadAtPage, z = t.initialNextPage !== void 0 ? t.initialNextPage : void 0;
|
|
1561
|
+
await Le(t.items, S, z), we = !0;
|
|
1556
1562
|
}
|
|
1557
|
-
x.value ? q(() =>
|
|
1563
|
+
x.value ? q(() => Pe()) : D();
|
|
1558
1564
|
} catch (c) {
|
|
1559
|
-
f.value || (console.error("Error during component initialization:", c), f.value =
|
|
1565
|
+
f.value || (console.error("Error during component initialization:", c), f.value = me(c)), M.value = !1;
|
|
1560
1566
|
}
|
|
1561
|
-
window.addEventListener("resize",
|
|
1562
|
-
}),
|
|
1567
|
+
window.addEventListener("resize", Ce), window.addEventListener("resize", je);
|
|
1568
|
+
}), at(() => {
|
|
1563
1569
|
var c;
|
|
1564
|
-
n && (n.disconnect(), n = null), (c = a.value) == null || c.removeEventListener("scroll", oe), window.removeEventListener("resize",
|
|
1570
|
+
n && (n.disconnect(), n = null), (c = a.value) == null || c.removeEventListener("scroll", oe), window.removeEventListener("resize", Ce), window.removeEventListener("resize", je), le.value && (le.value.removeEventListener("touchstart", Ae), le.value.removeEventListener("touchmove", We), le.value.removeEventListener("touchend", Re), le.value.removeEventListener("mousedown", Oe)), document.removeEventListener("mousemove", Ee), document.removeEventListener("mouseup", ke);
|
|
1565
1571
|
}), (c, S) => (O(), R("div", {
|
|
1566
1572
|
ref_key: "wrapper",
|
|
1567
|
-
ref:
|
|
1573
|
+
ref: h,
|
|
1568
1574
|
class: "w-full h-full flex flex-col relative"
|
|
1569
1575
|
}, [
|
|
1570
1576
|
x.value ? (O(), R("div", {
|
|
@@ -1582,38 +1588,38 @@ const oa = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full ro
|
|
|
1582
1588
|
height: `${s.value.length * 100}%`
|
|
1583
1589
|
})
|
|
1584
1590
|
}, [
|
|
1585
|
-
(O(!0), R(
|
|
1586
|
-
key: `${
|
|
1591
|
+
(O(!0), R(Ue, null, _e(s.value, (z, _) => (O(), R("div", {
|
|
1592
|
+
key: `${z.page}-${z.id}`,
|
|
1587
1593
|
class: "absolute top-0 left-0 w-full",
|
|
1588
1594
|
style: ge({
|
|
1589
|
-
top: `${
|
|
1595
|
+
top: `${_ * (100 / s.value.length)}%`,
|
|
1590
1596
|
height: `${100 / s.value.length}%`
|
|
1591
1597
|
})
|
|
1592
1598
|
}, [
|
|
1593
|
-
V("div",
|
|
1594
|
-
V("div",
|
|
1595
|
-
|
|
1596
|
-
item:
|
|
1599
|
+
V("div", pa, [
|
|
1600
|
+
V("div", ya, [
|
|
1601
|
+
X(c.$slots, "default", {
|
|
1602
|
+
item: z,
|
|
1597
1603
|
remove: U(ce),
|
|
1598
|
-
index:
|
|
1604
|
+
index: z.originalIndex ?? s.value.indexOf(z)
|
|
1599
1605
|
}, () => [
|
|
1600
|
-
|
|
1601
|
-
item:
|
|
1606
|
+
He(Me, {
|
|
1607
|
+
item: z,
|
|
1602
1608
|
remove: U(ce),
|
|
1603
|
-
"header-height":
|
|
1604
|
-
"footer-height":
|
|
1609
|
+
"header-height": g.value.header,
|
|
1610
|
+
"footer-height": g.value.footer,
|
|
1605
1611
|
"in-swipe-mode": !0,
|
|
1606
|
-
"is-active":
|
|
1607
|
-
"onPreload:success": S[0] || (S[0] = (
|
|
1608
|
-
"onPreload:error": S[1] || (S[1] = (
|
|
1609
|
-
onMouseEnter: S[2] || (S[2] = (
|
|
1610
|
-
onMouseLeave: S[3] || (S[3] = (
|
|
1612
|
+
"is-active": _ === U(se),
|
|
1613
|
+
"onPreload:success": S[0] || (S[0] = (F) => T("item:preload:success", F)),
|
|
1614
|
+
"onPreload:error": S[1] || (S[1] = (F) => T("item:preload:error", F)),
|
|
1615
|
+
onMouseEnter: S[2] || (S[2] = (F) => T("item:mouse-enter", F)),
|
|
1616
|
+
onMouseLeave: S[3] || (S[3] = (F) => T("item:mouse-leave", F))
|
|
1611
1617
|
}, {
|
|
1612
|
-
header: fe((
|
|
1613
|
-
|
|
1618
|
+
header: fe((F) => [
|
|
1619
|
+
X(c.$slots, "item-header", de({ ref_for: !0 }, F), void 0, !0)
|
|
1614
1620
|
]),
|
|
1615
|
-
footer: fe((
|
|
1616
|
-
|
|
1621
|
+
footer: fe((F) => [
|
|
1622
|
+
X(c.$slots, "item-footer", de({ ref_for: !0 }, F), void 0, !0)
|
|
1617
1623
|
]),
|
|
1618
1624
|
_: 2
|
|
1619
1625
|
}, 1032, ["item", "remove", "header-height", "footer-height", "is-active"])
|
|
@@ -1622,16 +1628,16 @@ const oa = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full ro
|
|
|
1622
1628
|
])
|
|
1623
1629
|
], 4))), 128))
|
|
1624
1630
|
], 4),
|
|
1625
|
-
I.value && s.value.length > 0 ? (O(), R("div",
|
|
1626
|
-
|
|
1631
|
+
I.value && s.value.length > 0 ? (O(), R("div", wa, [
|
|
1632
|
+
X(c.$slots, "end-message", {}, () => [
|
|
1627
1633
|
S[8] || (S[8] = V("p", { class: "text-gray-500 dark:text-gray-400" }, "You've reached the end", -1))
|
|
1628
1634
|
], !0)
|
|
1629
|
-
])) :
|
|
1630
|
-
f.value && s.value.length > 0 ? (O(), R("div",
|
|
1631
|
-
|
|
1632
|
-
V("p",
|
|
1635
|
+
])) : ae("", !0),
|
|
1636
|
+
f.value && s.value.length > 0 ? (O(), R("div", xa, [
|
|
1637
|
+
X(c.$slots, "error-message", { error: f.value }, () => [
|
|
1638
|
+
V("p", ba, "Failed to load content: " + Be(f.value.message), 1)
|
|
1633
1639
|
], !0)
|
|
1634
|
-
])) :
|
|
1640
|
+
])) : ae("", !0)
|
|
1635
1641
|
], 2)) : (O(), R("div", {
|
|
1636
1642
|
key: 1,
|
|
1637
1643
|
class: re(["overflow-auto w-full flex-1 masonry-container", { "force-motion": t.forceMotion }]),
|
|
@@ -1642,42 +1648,42 @@ const oa = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full ro
|
|
|
1642
1648
|
class: "relative",
|
|
1643
1649
|
style: ge({ height: `${P.value}px`, "--masonry-duration": `${e.transitionDurationMs}ms`, "--masonry-leave-duration": `${e.leaveDurationMs}ms`, "--masonry-ease": e.transitionEasing })
|
|
1644
1650
|
}, [
|
|
1645
|
-
|
|
1651
|
+
He(Tt, {
|
|
1646
1652
|
name: "masonry",
|
|
1647
1653
|
css: !1,
|
|
1648
|
-
onEnter: U(
|
|
1649
|
-
onBeforeEnter: U(
|
|
1650
|
-
onLeave: U(
|
|
1651
|
-
onBeforeLeave: U(
|
|
1654
|
+
onEnter: U(ot),
|
|
1655
|
+
onBeforeEnter: U(rt),
|
|
1656
|
+
onLeave: U(st),
|
|
1657
|
+
onBeforeLeave: U(it)
|
|
1652
1658
|
}, {
|
|
1653
1659
|
default: fe(() => [
|
|
1654
|
-
(O(!0), R(
|
|
1655
|
-
key: `${
|
|
1660
|
+
(O(!0), R(Ue, null, _e(U(G), (z, _) => (O(), R("div", de({
|
|
1661
|
+
key: `${z.page}-${z.id}`,
|
|
1656
1662
|
class: "absolute masonry-item",
|
|
1657
1663
|
ref_for: !0
|
|
1658
|
-
}, U(
|
|
1659
|
-
|
|
1660
|
-
item:
|
|
1664
|
+
}, U(Zt)(z, _)), [
|
|
1665
|
+
X(c.$slots, "default", {
|
|
1666
|
+
item: z,
|
|
1661
1667
|
remove: U(ce),
|
|
1662
|
-
index:
|
|
1668
|
+
index: z.originalIndex ?? s.value.indexOf(z)
|
|
1663
1669
|
}, () => [
|
|
1664
|
-
|
|
1665
|
-
item:
|
|
1670
|
+
He(Me, {
|
|
1671
|
+
item: z,
|
|
1666
1672
|
remove: U(ce),
|
|
1667
|
-
"header-height":
|
|
1668
|
-
"footer-height":
|
|
1673
|
+
"header-height": g.value.header,
|
|
1674
|
+
"footer-height": g.value.footer,
|
|
1669
1675
|
"in-swipe-mode": !1,
|
|
1670
1676
|
"is-active": !1,
|
|
1671
|
-
"onPreload:success": S[4] || (S[4] = (
|
|
1672
|
-
"onPreload:error": S[5] || (S[5] = (
|
|
1673
|
-
onMouseEnter: S[6] || (S[6] = (
|
|
1674
|
-
onMouseLeave: S[7] || (S[7] = (
|
|
1677
|
+
"onPreload:success": S[4] || (S[4] = (F) => T("item:preload:success", F)),
|
|
1678
|
+
"onPreload:error": S[5] || (S[5] = (F) => T("item:preload:error", F)),
|
|
1679
|
+
onMouseEnter: S[6] || (S[6] = (F) => T("item:mouse-enter", F)),
|
|
1680
|
+
onMouseLeave: S[7] || (S[7] = (F) => T("item:mouse-leave", F))
|
|
1675
1681
|
}, {
|
|
1676
|
-
header: fe((
|
|
1677
|
-
|
|
1682
|
+
header: fe((F) => [
|
|
1683
|
+
X(c.$slots, "item-header", de({ ref_for: !0 }, F), void 0, !0)
|
|
1678
1684
|
]),
|
|
1679
|
-
footer: fe((
|
|
1680
|
-
|
|
1685
|
+
footer: fe((F) => [
|
|
1686
|
+
X(c.$slots, "item-footer", de({ ref_for: !0 }, F), void 0, !0)
|
|
1681
1687
|
]),
|
|
1682
1688
|
_: 2
|
|
1683
1689
|
}, 1032, ["item", "remove", "header-height", "footer-height"])
|
|
@@ -1687,31 +1693,31 @@ const oa = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full ro
|
|
|
1687
1693
|
_: 3
|
|
1688
1694
|
}, 8, ["onEnter", "onBeforeEnter", "onLeave", "onBeforeLeave"])
|
|
1689
1695
|
], 4),
|
|
1690
|
-
I.value && s.value.length > 0 ? (O(), R("div",
|
|
1691
|
-
|
|
1696
|
+
I.value && s.value.length > 0 ? (O(), R("div", Ma, [
|
|
1697
|
+
X(c.$slots, "end-message", {}, () => [
|
|
1692
1698
|
S[9] || (S[9] = V("p", { class: "text-gray-500 dark:text-gray-400" }, "You've reached the end", -1))
|
|
1693
1699
|
], !0)
|
|
1694
|
-
])) :
|
|
1695
|
-
f.value && s.value.length > 0 ? (O(), R("div",
|
|
1696
|
-
|
|
1697
|
-
V("p",
|
|
1700
|
+
])) : ae("", !0),
|
|
1701
|
+
f.value && s.value.length > 0 ? (O(), R("div", Ta, [
|
|
1702
|
+
X(c.$slots, "error-message", { error: f.value }, () => [
|
|
1703
|
+
V("p", Ia, "Failed to load content: " + Be(f.value.message), 1)
|
|
1698
1704
|
], !0)
|
|
1699
|
-
])) :
|
|
1705
|
+
])) : ae("", !0)
|
|
1700
1706
|
], 2))
|
|
1701
1707
|
], 512));
|
|
1702
1708
|
}
|
|
1703
|
-
}),
|
|
1709
|
+
}), ka = (e, l) => {
|
|
1704
1710
|
const r = e.__vccOpts || e;
|
|
1705
1711
|
for (const [t, y] of l)
|
|
1706
1712
|
r[t] = y;
|
|
1707
1713
|
return r;
|
|
1708
|
-
},
|
|
1714
|
+
}, Ze = /* @__PURE__ */ ka(Ea, [["__scopeId", "data-v-2c2a4c76"]]), Ha = {
|
|
1709
1715
|
install(e) {
|
|
1710
|
-
e.component("WyxosMasonry",
|
|
1716
|
+
e.component("WyxosMasonry", Ze), e.component("WMasonry", Ze), e.component("WyxosMasonryItem", Me), e.component("WMasonryItem", Me);
|
|
1711
1717
|
}
|
|
1712
1718
|
};
|
|
1713
1719
|
export {
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1720
|
+
Ze as Masonry,
|
|
1721
|
+
Me as MasonryItem,
|
|
1722
|
+
Ha as default
|
|
1717
1723
|
};
|