@wyxos/vibe 1.6.23 → 1.6.24
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 +552 -532
- package/lib/vibe.css +1 -1
- package/package.json +1 -1
- package/src/Masonry.vue +59 -18
package/lib/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { nextTick as q, ref as
|
|
2
|
-
let
|
|
3
|
-
function
|
|
4
|
-
if (
|
|
1
|
+
import { nextTick as q, ref as D, computed as Q, defineComponent as Ke, onMounted as Qe, onUnmounted as Ze, watch as ee, createElementBlock as R, openBlock as O, createCommentVNode as te, createElementVNode as V, normalizeStyle as ge, renderSlot as _, normalizeClass as re, withModifiers as je, toDisplayString as $e, unref as U, Fragment as Ve, renderList as qe, createVNode as Pe, withCtx as fe, mergeProps as de, TransitionGroup as xt } from "vue";
|
|
2
|
+
let Se = null;
|
|
3
|
+
function bt() {
|
|
4
|
+
if (Se != null) return Se;
|
|
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), Se = r, r;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function Ye(e, l, r, t = {}) {
|
|
13
13
|
const {
|
|
14
14
|
gutterX: y = 0,
|
|
15
15
|
gutterY: h = 0,
|
|
@@ -17,7 +17,7 @@ function qe(e, l, r, n = {}) {
|
|
|
17
17
|
footer: i = 0,
|
|
18
18
|
paddingLeft: w = 0,
|
|
19
19
|
paddingRight: b = 0,
|
|
20
|
-
sizes:
|
|
20
|
+
sizes: n = {
|
|
21
21
|
base: 1,
|
|
22
22
|
sm: 2,
|
|
23
23
|
md: 3,
|
|
@@ -26,7 +26,7 @@ function qe(e, l, r, n = {}) {
|
|
|
26
26
|
"2xl": 6
|
|
27
27
|
},
|
|
28
28
|
placement: p = "masonry"
|
|
29
|
-
} =
|
|
29
|
+
} = t;
|
|
30
30
|
let x = 0, M = 0;
|
|
31
31
|
try {
|
|
32
32
|
if (l && l.nodeType === 1 && typeof window < "u" && window.getComputedStyle) {
|
|
@@ -35,54 +35,54 @@ function qe(e, l, r, n = {}) {
|
|
|
35
35
|
}
|
|
36
36
|
} catch {
|
|
37
37
|
}
|
|
38
|
-
const s = (w || 0) + x, g = (b || 0) + M,
|
|
38
|
+
const s = (w || 0) + x, g = (b || 0) + M, a = l.offsetWidth - l.clientWidth, d = a > 0 ? a + 2 : bt() + 2, v = l.offsetWidth - d - s - g, T = y * (r - 1), P = Math.floor((v - T) / r), I = e.map((L) => {
|
|
39
39
|
const k = L.width, W = L.height;
|
|
40
|
-
return Math.round(
|
|
40
|
+
return Math.round(P * W / k) + i + m;
|
|
41
41
|
});
|
|
42
42
|
if (p === "sequential-balanced") {
|
|
43
|
-
const L =
|
|
43
|
+
const L = I.length;
|
|
44
44
|
if (L === 0) return [];
|
|
45
|
-
const k = (
|
|
46
|
-
let W = Math.max(...
|
|
47
|
-
const u = (
|
|
45
|
+
const k = (z, Y, G) => z + (Y > 0 ? h : 0) + G;
|
|
46
|
+
let W = Math.max(...I), o = I.reduce((z, Y) => z + Y, 0) + h * Math.max(0, L - 1);
|
|
47
|
+
const u = (z) => {
|
|
48
48
|
let Y = 1, G = 0, ne = 0;
|
|
49
49
|
for (let J = 0; J < L; J++) {
|
|
50
|
-
const ie =
|
|
51
|
-
if (Z <=
|
|
50
|
+
const ie = I[J], Z = k(G, ne, ie);
|
|
51
|
+
if (Z <= z)
|
|
52
52
|
G = Z, ne++;
|
|
53
|
-
else if (Y++, G = ie, ne = 1, ie >
|
|
53
|
+
else if (Y++, G = ie, ne = 1, ie > z || Y > r) return !1;
|
|
54
54
|
}
|
|
55
55
|
return Y <= r;
|
|
56
56
|
};
|
|
57
57
|
for (; W < o; ) {
|
|
58
|
-
const
|
|
59
|
-
u(
|
|
58
|
+
const z = Math.floor((W + o) / 2);
|
|
59
|
+
u(z) ? o = z : W = z + 1;
|
|
60
60
|
}
|
|
61
|
-
const
|
|
62
|
-
let C = r - 1, F = 0,
|
|
63
|
-
for (let
|
|
64
|
-
const Y =
|
|
65
|
-
!(k(F,
|
|
61
|
+
const E = o, $ = new Array(r).fill(0);
|
|
62
|
+
let C = r - 1, F = 0, N = 0;
|
|
63
|
+
for (let z = L - 1; z >= 0; z--) {
|
|
64
|
+
const Y = I[z], G = z < C;
|
|
65
|
+
!(k(F, N, Y) <= E) || G ? ($[C] = z + 1, C--, F = Y, N = 1) : (F = k(F, N, Y), N++);
|
|
66
66
|
}
|
|
67
67
|
$[0] = 0;
|
|
68
68
|
const j = [], X = new Array(r).fill(0);
|
|
69
|
-
for (let
|
|
70
|
-
const Y = $[
|
|
69
|
+
for (let z = 0; z < r; z++) {
|
|
70
|
+
const Y = $[z], G = z + 1 < r ? $[z + 1] : L, ne = z * (P + y);
|
|
71
71
|
for (let J = Y; J < G; J++) {
|
|
72
72
|
const Z = {
|
|
73
73
|
...e[J],
|
|
74
|
-
columnWidth:
|
|
74
|
+
columnWidth: P,
|
|
75
75
|
imageHeight: 0,
|
|
76
76
|
columnHeight: 0,
|
|
77
77
|
left: 0,
|
|
78
78
|
top: 0
|
|
79
79
|
};
|
|
80
|
-
Z.imageHeight =
|
|
80
|
+
Z.imageHeight = I[J] - (i + m), Z.columnHeight = I[J], Z.left = ne, Z.top = X[z], X[z] += Z.columnHeight + (J + 1 < G ? h : 0), j.push(Z);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
return j;
|
|
84
84
|
}
|
|
85
|
-
const f = new Array(r).fill(0),
|
|
85
|
+
const f = new Array(r).fill(0), H = [];
|
|
86
86
|
for (let L = 0; L < e.length; L++) {
|
|
87
87
|
const k = e[L], W = {
|
|
88
88
|
...k,
|
|
@@ -91,108 +91,108 @@ function qe(e, l, r, n = {}) {
|
|
|
91
91
|
columnHeight: 0,
|
|
92
92
|
left: 0,
|
|
93
93
|
top: 0
|
|
94
|
-
}, o = f.indexOf(Math.min(...f)), u = k.width,
|
|
95
|
-
W.columnWidth =
|
|
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 + m, W.top = f[o], f[o] += W.columnHeight + h, H.push(W);
|
|
96
96
|
}
|
|
97
|
-
return
|
|
97
|
+
return H;
|
|
98
98
|
}
|
|
99
|
-
var
|
|
100
|
-
function
|
|
101
|
-
var l =
|
|
99
|
+
var Mt = typeof global == "object" && global && global.Object === Object && global, Tt = typeof self == "object" && self && self.Object === Object && self, et = Mt || Tt || Function("return this")(), xe = et.Symbol, tt = Object.prototype, It = tt.hasOwnProperty, Et = tt.toString, me = xe ? xe.toStringTag : void 0;
|
|
100
|
+
function kt(e) {
|
|
101
|
+
var l = It.call(e, me), r = e[me];
|
|
102
102
|
try {
|
|
103
103
|
e[me] = void 0;
|
|
104
|
-
var
|
|
104
|
+
var t = !0;
|
|
105
105
|
} catch {
|
|
106
106
|
}
|
|
107
107
|
var y = Et.call(e);
|
|
108
|
-
return
|
|
108
|
+
return t && (l ? e[me] = r : delete e[me]), y;
|
|
109
109
|
}
|
|
110
|
-
var
|
|
110
|
+
var Lt = Object.prototype, Pt = Lt.toString;
|
|
111
111
|
function St(e) {
|
|
112
|
-
return
|
|
112
|
+
return Pt.call(e);
|
|
113
113
|
}
|
|
114
|
-
var Ht = "[object Null]",
|
|
115
|
-
function
|
|
116
|
-
return e == null ? e === void 0 ?
|
|
114
|
+
var Ht = "[object Null]", $t = "[object Undefined]", Ue = xe ? xe.toStringTag : void 0;
|
|
115
|
+
function Nt(e) {
|
|
116
|
+
return e == null ? e === void 0 ? $t : Ht : Ue && Ue in Object(e) ? kt(e) : St(e);
|
|
117
117
|
}
|
|
118
118
|
function Dt(e) {
|
|
119
119
|
return e != null && typeof e == "object";
|
|
120
120
|
}
|
|
121
121
|
var zt = "[object Symbol]";
|
|
122
122
|
function Bt(e) {
|
|
123
|
-
return typeof e == "symbol" || Dt(e) &&
|
|
123
|
+
return typeof e == "symbol" || Dt(e) && Nt(e) == zt;
|
|
124
124
|
}
|
|
125
|
-
var
|
|
126
|
-
function
|
|
127
|
-
for (var l = e.length; l-- &&
|
|
125
|
+
var Ft = /\s/;
|
|
126
|
+
function At(e) {
|
|
127
|
+
for (var l = e.length; l-- && Ft.test(e.charAt(l)); )
|
|
128
128
|
;
|
|
129
129
|
return l;
|
|
130
130
|
}
|
|
131
|
-
var
|
|
132
|
-
function
|
|
133
|
-
return e && e.slice(0,
|
|
131
|
+
var Wt = /^\s+/;
|
|
132
|
+
function Rt(e) {
|
|
133
|
+
return e && e.slice(0, At(e) + 1).replace(Wt, "");
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function Ne(e) {
|
|
136
136
|
var l = typeof e;
|
|
137
137
|
return e != null && (l == "object" || l == "function");
|
|
138
138
|
}
|
|
139
|
-
var
|
|
140
|
-
function
|
|
139
|
+
var _e = NaN, Ot = /^[-+]0x[0-9a-f]+$/i, Ct = /^0b[01]+$/i, jt = /^0o[0-7]+$/i, Vt = parseInt;
|
|
140
|
+
function Xe(e) {
|
|
141
141
|
if (typeof e == "number")
|
|
142
142
|
return e;
|
|
143
143
|
if (Bt(e))
|
|
144
|
-
return
|
|
145
|
-
if (
|
|
144
|
+
return _e;
|
|
145
|
+
if (Ne(e)) {
|
|
146
146
|
var l = typeof e.valueOf == "function" ? e.valueOf() : e;
|
|
147
|
-
e =
|
|
147
|
+
e = Ne(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 = Rt(e);
|
|
152
|
+
var r = Ct.test(e);
|
|
153
|
+
return r || jt.test(e) ? Vt(e.slice(2), r ? 2 : 8) : Ot.test(e) ? _e : +e;
|
|
154
154
|
}
|
|
155
|
-
var
|
|
156
|
-
return
|
|
157
|
-
},
|
|
158
|
-
function
|
|
159
|
-
var
|
|
155
|
+
var He = function() {
|
|
156
|
+
return et.Date.now();
|
|
157
|
+
}, qt = "Expected a function", Yt = Math.max, Ut = Math.min;
|
|
158
|
+
function Ge(e, l, r) {
|
|
159
|
+
var t, y, h, m, i, w, b = 0, n = !1, p = !1, x = !0;
|
|
160
160
|
if (typeof e != "function")
|
|
161
|
-
throw new TypeError(
|
|
162
|
-
l =
|
|
161
|
+
throw new TypeError(qt);
|
|
162
|
+
l = Xe(l) || 0, Ne(r) && (n = !!r.leading, p = "maxWait" in r, h = p ? Yt(Xe(r.maxWait) || 0, l) : h, x = "trailing" in r ? !!r.trailing : x);
|
|
163
163
|
function M(f) {
|
|
164
|
-
var
|
|
165
|
-
return
|
|
164
|
+
var H = t, L = y;
|
|
165
|
+
return t = y = void 0, b = f, m = e.apply(L, H), m;
|
|
166
166
|
}
|
|
167
167
|
function s(f) {
|
|
168
|
-
return b = f, i = setTimeout(d, l),
|
|
168
|
+
return b = f, i = setTimeout(d, l), n ? M(f) : m;
|
|
169
169
|
}
|
|
170
170
|
function g(f) {
|
|
171
|
-
var
|
|
172
|
-
return p ?
|
|
171
|
+
var H = f - w, L = f - b, k = l - H;
|
|
172
|
+
return p ? Ut(k, h - L) : k;
|
|
173
173
|
}
|
|
174
|
-
function
|
|
175
|
-
var
|
|
176
|
-
return w === void 0 ||
|
|
174
|
+
function a(f) {
|
|
175
|
+
var H = f - w, L = f - b;
|
|
176
|
+
return w === void 0 || H >= l || H < 0 || p && L >= h;
|
|
177
177
|
}
|
|
178
178
|
function d() {
|
|
179
|
-
var f =
|
|
180
|
-
if (
|
|
179
|
+
var f = He();
|
|
180
|
+
if (a(f))
|
|
181
181
|
return v(f);
|
|
182
182
|
i = setTimeout(d, g(f));
|
|
183
183
|
}
|
|
184
184
|
function v(f) {
|
|
185
|
-
return i = void 0, x &&
|
|
185
|
+
return i = void 0, x && t ? M(f) : (t = y = void 0, m);
|
|
186
186
|
}
|
|
187
187
|
function T() {
|
|
188
|
-
i !== void 0 && clearTimeout(i), b = 0,
|
|
188
|
+
i !== void 0 && clearTimeout(i), b = 0, t = w = y = i = void 0;
|
|
189
189
|
}
|
|
190
|
-
function
|
|
191
|
-
return i === void 0 ? m : v(
|
|
190
|
+
function P() {
|
|
191
|
+
return i === void 0 ? m : v(He());
|
|
192
192
|
}
|
|
193
|
-
function
|
|
194
|
-
var f =
|
|
195
|
-
if (
|
|
193
|
+
function I() {
|
|
194
|
+
var f = He(), H = a(f);
|
|
195
|
+
if (t = arguments, y = this, w = f, H) {
|
|
196
196
|
if (i === void 0)
|
|
197
197
|
return s(w);
|
|
198
198
|
if (p)
|
|
@@ -200,20 +200,20 @@ function Xe(e, l, r) {
|
|
|
200
200
|
}
|
|
201
201
|
return i === void 0 && (i = setTimeout(d, l)), m;
|
|
202
202
|
}
|
|
203
|
-
return
|
|
203
|
+
return I.cancel = T, I.flush = P, I;
|
|
204
204
|
}
|
|
205
205
|
function ue(e, l) {
|
|
206
|
-
const r = l ?? (typeof window < "u" ? window.innerWidth : 1024),
|
|
207
|
-
return r >= 1536 &&
|
|
206
|
+
const r = l ?? (typeof window < "u" ? window.innerWidth : 1024), t = e.sizes;
|
|
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 _t(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 _t(e) {
|
|
214
|
-
return e.reduce((r, n) => Math.max(r, n.top + n.columnHeight), 0) + 500;
|
|
215
|
-
}
|
|
216
213
|
function Xt(e) {
|
|
214
|
+
return e.reduce((r, t) => Math.max(r, t.top + t.columnHeight), 0) + 500;
|
|
215
|
+
}
|
|
216
|
+
function Gt(e) {
|
|
217
217
|
return {
|
|
218
218
|
transform: `translate3d(${e.left}px, ${e.top}px, 0)`,
|
|
219
219
|
top: "0px",
|
|
@@ -222,21 +222,21 @@ function Xt(e) {
|
|
|
222
222
|
height: `${e.columnHeight}px`
|
|
223
223
|
};
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function Jt(e, l = 0) {
|
|
226
226
|
return {
|
|
227
|
-
style:
|
|
227
|
+
style: Gt(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 De(e, l) {
|
|
235
235
|
if (!e.length || l <= 0)
|
|
236
236
|
return new Array(Math.max(1, l)).fill(0);
|
|
237
|
-
const
|
|
238
|
-
for (let m = 0; m <
|
|
239
|
-
const h = new Array(
|
|
237
|
+
const t = Array.from(new Set(e.map((m) => m.left))).sort((m, i) => m - i).slice(0, l), y = /* @__PURE__ */ new Map();
|
|
238
|
+
for (let m = 0; m < t.length; m++) y.set(t[m], m);
|
|
239
|
+
const h = new Array(t.length).fill(0);
|
|
240
240
|
for (const m of e) {
|
|
241
241
|
const i = y.get(m.left);
|
|
242
242
|
i != null && (h[i] = Math.max(h[i], m.top + m.columnHeight));
|
|
@@ -244,88 +244,88 @@ function $e(e, l) {
|
|
|
244
244
|
for (; h.length < l; ) h.push(0);
|
|
245
245
|
return h;
|
|
246
246
|
}
|
|
247
|
-
function
|
|
248
|
-
let r = 0,
|
|
247
|
+
function Kt(e, l) {
|
|
248
|
+
let r = 0, t = 0;
|
|
249
249
|
const y = 1e3;
|
|
250
|
-
function h(
|
|
250
|
+
function h(n, p) {
|
|
251
251
|
var s;
|
|
252
252
|
const x = (s = e.container) == null ? void 0 : s.value;
|
|
253
253
|
if (x) {
|
|
254
|
-
const g = x.scrollTop,
|
|
255
|
-
r = g - y,
|
|
254
|
+
const g = x.scrollTop, a = x.clientHeight;
|
|
255
|
+
r = g - y, t = g + a + y;
|
|
256
256
|
}
|
|
257
|
-
return
|
|
257
|
+
return n + p >= r && n <= t;
|
|
258
258
|
}
|
|
259
|
-
function m(
|
|
259
|
+
function m(n, p) {
|
|
260
260
|
var v;
|
|
261
|
-
const x = parseInt(
|
|
261
|
+
const x = parseInt(n.dataset.left || "0", 10), M = parseInt(n.dataset.top || "0", 10), s = parseInt(n.dataset.index || "0", 10), g = n.offsetHeight || parseInt(getComputedStyle(n).height || "200", 10) || 200;
|
|
262
262
|
if ((v = l == null ? void 0 : l.virtualizing) != null && v.value) {
|
|
263
|
-
|
|
264
|
-
|
|
263
|
+
n.style.transition = "none", n.style.opacity = "1", n.style.transform = `translate3d(${x}px, ${M}px, 0) scale(1)`, n.style.removeProperty("--masonry-opacity-delay"), requestAnimationFrame(() => {
|
|
264
|
+
n.style.transition = "", p();
|
|
265
265
|
});
|
|
266
266
|
return;
|
|
267
267
|
}
|
|
268
268
|
if (!h(M, g)) {
|
|
269
|
-
|
|
269
|
+
n.style.opacity = "1", n.style.transform = `translate3d(${x}px, ${M}px, 0) scale(1)`, n.style.transition = "none", p();
|
|
270
270
|
return;
|
|
271
271
|
}
|
|
272
|
-
const
|
|
273
|
-
|
|
274
|
-
|
|
272
|
+
const a = Math.min(s * 20, 160), d = n.style.getPropertyValue("--masonry-opacity-delay");
|
|
273
|
+
n.style.setProperty("--masonry-opacity-delay", `${a}ms`), requestAnimationFrame(() => {
|
|
274
|
+
n.style.opacity = "1", n.style.transform = `translate3d(${x}px, ${M}px, 0) scale(1)`;
|
|
275
275
|
const T = () => {
|
|
276
|
-
d ?
|
|
276
|
+
d ? n.style.setProperty("--masonry-opacity-delay", d) : n.style.removeProperty("--masonry-opacity-delay"), n.removeEventListener("transitionend", T), p();
|
|
277
277
|
};
|
|
278
|
-
|
|
278
|
+
n.addEventListener("transitionend", T);
|
|
279
279
|
});
|
|
280
280
|
}
|
|
281
|
-
function i(
|
|
281
|
+
function i(n) {
|
|
282
282
|
var M;
|
|
283
|
-
const p = parseInt(
|
|
283
|
+
const p = parseInt(n.dataset.left || "0", 10), x = parseInt(n.dataset.top || "0", 10);
|
|
284
284
|
if ((M = l == null ? void 0 : l.virtualizing) != null && M.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
|
}
|
|
288
|
-
|
|
288
|
+
n.style.opacity = "0", n.style.transform = `translate3d(${p}px, ${x + 10}px, 0) scale(0.985)`;
|
|
289
289
|
}
|
|
290
|
-
function w(
|
|
290
|
+
function w(n) {
|
|
291
291
|
var s;
|
|
292
|
-
const p = parseInt(
|
|
292
|
+
const p = parseInt(n.dataset.left || "0", 10), x = parseInt(n.dataset.top || "0", 10), M = n.offsetHeight || parseInt(getComputedStyle(n).height || "200", 10) || 200;
|
|
293
293
|
if (!((s = l == null ? void 0 : l.virtualizing) != null && s.value)) {
|
|
294
294
|
if (!h(x, M)) {
|
|
295
|
-
|
|
295
|
+
n.style.transition = "none";
|
|
296
296
|
return;
|
|
297
297
|
}
|
|
298
|
-
|
|
299
|
-
|
|
298
|
+
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"), requestAnimationFrame(() => {
|
|
299
|
+
n.style.transition = "";
|
|
300
300
|
});
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
|
-
function b(
|
|
304
|
-
var
|
|
305
|
-
const x = parseInt(
|
|
306
|
-
if ((
|
|
303
|
+
function b(n, p) {
|
|
304
|
+
var I;
|
|
305
|
+
const x = parseInt(n.dataset.left || "0", 10), M = parseInt(n.dataset.top || "0", 10), s = n.offsetHeight || parseInt(getComputedStyle(n).height || "200", 10) || 200;
|
|
306
|
+
if ((I = l == null ? void 0 : l.virtualizing) != null && I.value) {
|
|
307
307
|
p();
|
|
308
308
|
return;
|
|
309
309
|
}
|
|
310
310
|
if (!h(M, s)) {
|
|
311
|
-
|
|
311
|
+
n.style.transition = "none", n.style.opacity = "0", p();
|
|
312
312
|
return;
|
|
313
313
|
}
|
|
314
314
|
const g = typeof (l == null ? void 0 : l.leaveDurationMs) == "number" ? l.leaveDurationMs : NaN;
|
|
315
|
-
let
|
|
316
|
-
if (!Number.isFinite(
|
|
317
|
-
const
|
|
318
|
-
|
|
315
|
+
let a = Number.isFinite(g) && g > 0 ? g : NaN;
|
|
316
|
+
if (!Number.isFinite(a)) {
|
|
317
|
+
const H = getComputedStyle(n).getPropertyValue("--masonry-leave-duration") || "", L = parseFloat(H);
|
|
318
|
+
a = Number.isFinite(L) && L > 0 ? L : 200;
|
|
319
319
|
}
|
|
320
|
-
const d =
|
|
321
|
-
|
|
320
|
+
const d = n.style.transitionDuration, v = () => {
|
|
321
|
+
n.removeEventListener("transitionend", T), clearTimeout(P), n.style.transitionDuration = d || "";
|
|
322
322
|
}, T = (f) => {
|
|
323
|
-
(!f || f.target ===
|
|
324
|
-
},
|
|
323
|
+
(!f || f.target === n) && (v(), p());
|
|
324
|
+
}, P = setTimeout(() => {
|
|
325
325
|
v(), p();
|
|
326
|
-
},
|
|
326
|
+
}, a + 100);
|
|
327
327
|
requestAnimationFrame(() => {
|
|
328
|
-
|
|
328
|
+
n.style.transitionDuration = `${a}ms`, n.style.opacity = "0", n.style.transform = `translate3d(${x}px, ${M + 10}px, 0) scale(0.985)`, n.addEventListener("transitionend", T);
|
|
329
329
|
});
|
|
330
330
|
}
|
|
331
331
|
return {
|
|
@@ -335,11 +335,11 @@ function Jt(e, l) {
|
|
|
335
335
|
onLeave: b
|
|
336
336
|
};
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function Qt({
|
|
339
339
|
container: e,
|
|
340
340
|
masonry: l,
|
|
341
341
|
columns: r,
|
|
342
|
-
containerHeight:
|
|
342
|
+
containerHeight: t,
|
|
343
343
|
isLoading: y,
|
|
344
344
|
pageSize: h,
|
|
345
345
|
refreshLayout: m,
|
|
@@ -347,13 +347,13 @@ function Kt({
|
|
|
347
347
|
loadNext: w,
|
|
348
348
|
loadThresholdPx: b
|
|
349
349
|
}) {
|
|
350
|
-
let
|
|
350
|
+
let n = 0;
|
|
351
351
|
async function p(x) {
|
|
352
352
|
if (!e.value) return;
|
|
353
|
-
const M = x ??
|
|
354
|
-
|
|
353
|
+
const M = x ?? De(l.value, r.value), s = M.length ? Math.max(...M) : 0, g = e.value.scrollTop + e.value.clientHeight, a = e.value.scrollTop > n + 1;
|
|
354
|
+
n = e.value.scrollTop;
|
|
355
355
|
const d = typeof b == "number" ? b : 200, v = d >= 0 ? Math.max(0, s - d) : Math.max(0, s + d);
|
|
356
|
-
if (g >= v &&
|
|
356
|
+
if (g >= v && a && !y.value) {
|
|
357
357
|
await w(), await q();
|
|
358
358
|
return;
|
|
359
359
|
}
|
|
@@ -362,8 +362,8 @@ function Kt({
|
|
|
362
362
|
handleScroll: p
|
|
363
363
|
};
|
|
364
364
|
}
|
|
365
|
-
function
|
|
366
|
-
const { useSwipeMode: l, masonry: r, isLoading:
|
|
365
|
+
function Zt(e) {
|
|
366
|
+
const { useSwipeMode: l, masonry: r, isLoading: t, loadNext: y, loadPage: h, paginationHistory: m } = e, i = D(0), w = D(0), b = D(!1), n = D(0), p = D(0), x = D(null), M = Q(() => {
|
|
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;
|
|
@@ -376,7 +376,7 @@ function Qt(e) {
|
|
|
376
376
|
const o = i.value - 1;
|
|
377
377
|
return o < 0 ? null : r.value[o] || null;
|
|
378
378
|
});
|
|
379
|
-
function
|
|
379
|
+
function a() {
|
|
380
380
|
if (!x.value) return;
|
|
381
381
|
const o = x.value.clientHeight;
|
|
382
382
|
w.value = -i.value * o;
|
|
@@ -386,41 +386,41 @@ function Qt(e) {
|
|
|
386
386
|
y();
|
|
387
387
|
return;
|
|
388
388
|
}
|
|
389
|
-
i.value++,
|
|
389
|
+
i.value++, a(), i.value >= r.value.length - 5 && y();
|
|
390
390
|
}
|
|
391
391
|
function v() {
|
|
392
|
-
g.value && (i.value--,
|
|
392
|
+
g.value && (i.value--, a());
|
|
393
393
|
}
|
|
394
394
|
function T(o) {
|
|
395
|
-
l.value && (b.value = !0,
|
|
395
|
+
l.value && (b.value = !0, n.value = o.touches[0].clientY, p.value = w.value, o.preventDefault());
|
|
396
396
|
}
|
|
397
|
-
function
|
|
397
|
+
function P(o) {
|
|
398
398
|
if (!l.value || !b.value) return;
|
|
399
|
-
const u = o.touches[0].clientY -
|
|
399
|
+
const u = o.touches[0].clientY - n.value;
|
|
400
400
|
w.value = p.value + u, o.preventDefault();
|
|
401
401
|
}
|
|
402
|
-
function
|
|
402
|
+
function I(o) {
|
|
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 && g.value ? v() : u < 0 && s.value ? d() :
|
|
406
|
+
Math.abs(u) > 100 ? u > 0 && g.value ? v() : u < 0 && s.value ? d() : a() : a(), o.preventDefault();
|
|
407
407
|
}
|
|
408
408
|
function f(o) {
|
|
409
|
-
l.value && (b.value = !0,
|
|
409
|
+
l.value && (b.value = !0, n.value = o.clientY, p.value = w.value, o.preventDefault());
|
|
410
410
|
}
|
|
411
|
-
function
|
|
411
|
+
function H(o) {
|
|
412
412
|
if (!l.value || !b.value) return;
|
|
413
|
-
const u = o.clientY -
|
|
413
|
+
const u = o.clientY - n.value;
|
|
414
414
|
w.value = p.value + u, o.preventDefault();
|
|
415
415
|
}
|
|
416
416
|
function L(o) {
|
|
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 && g.value ? v() : u < 0 && s.value ? d() :
|
|
420
|
+
Math.abs(u) > 100 ? u > 0 && g.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 && !
|
|
423
|
+
!l.value && i.value > 0 && (i.value = 0, w.value = 0), l.value && r.value.length === 0 && !t.value && h(m.value[0]), l.value && a();
|
|
424
424
|
}
|
|
425
425
|
function W() {
|
|
426
426
|
i.value = 0, w.value = 0, b.value = !1;
|
|
@@ -437,14 +437,14 @@ function Qt(e) {
|
|
|
437
437
|
previousItem: g,
|
|
438
438
|
// Functions
|
|
439
439
|
handleTouchStart: T,
|
|
440
|
-
handleTouchMove:
|
|
441
|
-
handleTouchEnd:
|
|
440
|
+
handleTouchMove: P,
|
|
441
|
+
handleTouchEnd: I,
|
|
442
442
|
handleMouseDown: f,
|
|
443
|
-
handleMouseMove:
|
|
443
|
+
handleMouseMove: H,
|
|
444
444
|
handleMouseUp: L,
|
|
445
445
|
goToNextItem: d,
|
|
446
446
|
goToPreviousItem: v,
|
|
447
|
-
snapToCurrentItem:
|
|
447
|
+
snapToCurrentItem: a,
|
|
448
448
|
handleWindowResize: k,
|
|
449
449
|
reset: W
|
|
450
450
|
};
|
|
@@ -452,67 +452,67 @@ function Qt(e) {
|
|
|
452
452
|
function he(e) {
|
|
453
453
|
return e instanceof Error ? e : new Error(String(e));
|
|
454
454
|
}
|
|
455
|
-
function
|
|
455
|
+
function ea(e) {
|
|
456
456
|
const {
|
|
457
457
|
getNextPage: l,
|
|
458
458
|
masonry: r,
|
|
459
|
-
isLoading:
|
|
459
|
+
isLoading: t,
|
|
460
460
|
hasReachedEnd: y,
|
|
461
461
|
loadError: h,
|
|
462
462
|
currentPage: m,
|
|
463
463
|
paginationHistory: i,
|
|
464
464
|
refreshLayout: w,
|
|
465
465
|
retryMaxAttempts: b,
|
|
466
|
-
retryInitialDelayMs:
|
|
466
|
+
retryInitialDelayMs: n,
|
|
467
467
|
retryBackoffStepMs: p,
|
|
468
468
|
backfillEnabled: x,
|
|
469
469
|
backfillDelayMs: M,
|
|
470
470
|
backfillMaxCalls: s,
|
|
471
471
|
pageSize: g,
|
|
472
|
-
autoRefreshOnEmpty:
|
|
472
|
+
autoRefreshOnEmpty: a,
|
|
473
473
|
emits: d
|
|
474
|
-
} = e, v =
|
|
474
|
+
} = e, v = D(!1);
|
|
475
475
|
let T = !1;
|
|
476
|
-
function
|
|
476
|
+
function P(u, E) {
|
|
477
477
|
return new Promise(($) => {
|
|
478
478
|
const C = Math.max(0, u | 0), F = Date.now();
|
|
479
|
-
|
|
480
|
-
const
|
|
479
|
+
E(C, C);
|
|
480
|
+
const N = setInterval(() => {
|
|
481
481
|
if (v.value) {
|
|
482
|
-
clearInterval(
|
|
482
|
+
clearInterval(N), $();
|
|
483
483
|
return;
|
|
484
484
|
}
|
|
485
485
|
const j = Date.now() - F, X = Math.max(0, C - j);
|
|
486
|
-
|
|
486
|
+
E(X, C), X <= 0 && (clearInterval(N), $());
|
|
487
487
|
}, 100);
|
|
488
488
|
});
|
|
489
489
|
}
|
|
490
|
-
async function
|
|
491
|
-
let
|
|
490
|
+
async function I(u) {
|
|
491
|
+
let E = 0;
|
|
492
492
|
const $ = b;
|
|
493
|
-
let C =
|
|
493
|
+
let C = n;
|
|
494
494
|
for (; ; )
|
|
495
495
|
try {
|
|
496
496
|
const F = await u();
|
|
497
|
-
return
|
|
497
|
+
return E > 0 && d("retry:stop", { attempt: E, success: !0 }), F;
|
|
498
498
|
} catch (F) {
|
|
499
|
-
if (
|
|
500
|
-
throw d("retry:stop", { attempt:
|
|
501
|
-
d("retry:start", { attempt:
|
|
502
|
-
d("retry:tick", { attempt:
|
|
499
|
+
if (E++, E > $)
|
|
500
|
+
throw d("retry:stop", { attempt: E - 1, success: !1 }), F;
|
|
501
|
+
d("retry:start", { attempt: E, max: $, totalMs: C }), await P(C, (N, j) => {
|
|
502
|
+
d("retry:tick", { attempt: E, remainingMs: N, totalMs: j });
|
|
503
503
|
}), C += p;
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
506
|
async function f(u) {
|
|
507
507
|
try {
|
|
508
|
-
const
|
|
509
|
-
return w([...r.value, ...
|
|
510
|
-
} catch (
|
|
511
|
-
throw
|
|
508
|
+
const E = await I(() => l(u));
|
|
509
|
+
return w([...r.value, ...E.items]), E;
|
|
510
|
+
} catch (E) {
|
|
511
|
+
throw E;
|
|
512
512
|
}
|
|
513
513
|
}
|
|
514
|
-
async function
|
|
515
|
-
if (!
|
|
514
|
+
async function H(u, E = !1) {
|
|
515
|
+
if (!E && !x || T || v.value || y.value) return;
|
|
516
516
|
const $ = (u || 0) + (g || 0);
|
|
517
517
|
if (!g || g <= 0) return;
|
|
518
518
|
if (i.value[i.value.length - 1] == null) {
|
|
@@ -520,10 +520,10 @@ function Zt(e) {
|
|
|
520
520
|
return;
|
|
521
521
|
}
|
|
522
522
|
if (!(r.value.length >= $)) {
|
|
523
|
-
T = !0,
|
|
523
|
+
T = !0, t.value = !0;
|
|
524
524
|
try {
|
|
525
525
|
let F = 0;
|
|
526
|
-
for (d("backfill:start", { target: $, fetched: r.value.length, calls: F }); r.value.length < $ && F < s && i.value[i.value.length - 1] != null && !v.value && !y.value && T && (await
|
|
526
|
+
for (d("backfill:start", { target: $, fetched: r.value.length, calls: F }); r.value.length < $ && F < s && i.value[i.value.length - 1] != null && !v.value && !y.value && T && (await P(M, (j, X) => {
|
|
527
527
|
d("backfill:tick", {
|
|
528
528
|
fetched: r.value.length,
|
|
529
529
|
target: $,
|
|
@@ -532,14 +532,14 @@ function Zt(e) {
|
|
|
532
532
|
totalMs: X
|
|
533
533
|
});
|
|
534
534
|
}), !(v.value || !T)); ) {
|
|
535
|
-
const
|
|
536
|
-
if (
|
|
535
|
+
const N = i.value[i.value.length - 1];
|
|
536
|
+
if (N == null) {
|
|
537
537
|
y.value = !0;
|
|
538
538
|
break;
|
|
539
539
|
}
|
|
540
540
|
try {
|
|
541
541
|
if (v.value || !T) break;
|
|
542
|
-
const j = await f(
|
|
542
|
+
const j = await f(N);
|
|
543
543
|
if (v.value || !T) break;
|
|
544
544
|
h.value = null, i.value.push(j.nextPage), j.nextPage == null && (y.value = !0);
|
|
545
545
|
} catch (j) {
|
|
@@ -550,48 +550,48 @@ function Zt(e) {
|
|
|
550
550
|
}
|
|
551
551
|
d("backfill:stop", { fetched: r.value.length, calls: F });
|
|
552
552
|
} finally {
|
|
553
|
-
T = !1,
|
|
553
|
+
T = !1, t.value = !1;
|
|
554
554
|
}
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
557
|
async function L(u) {
|
|
558
|
-
if (!
|
|
559
|
-
v.value = !1,
|
|
558
|
+
if (!t.value) {
|
|
559
|
+
v.value = !1, t.value = !0, y.value = !1, h.value = null;
|
|
560
560
|
try {
|
|
561
|
-
const
|
|
561
|
+
const E = r.value.length;
|
|
562
562
|
if (v.value) return;
|
|
563
563
|
const $ = await f(u);
|
|
564
|
-
return v.value ? void 0 : (h.value = null, m.value = u, i.value.push($.nextPage), $.nextPage == null && (y.value = !0), await
|
|
565
|
-
} catch (
|
|
566
|
-
throw h.value = he(
|
|
564
|
+
return v.value ? void 0 : (h.value = null, m.value = u, i.value.push($.nextPage), $.nextPage == null && (y.value = !0), await H(E), $);
|
|
565
|
+
} catch (E) {
|
|
566
|
+
throw h.value = he(E), E;
|
|
567
567
|
} finally {
|
|
568
|
-
|
|
568
|
+
t.value = !1;
|
|
569
569
|
}
|
|
570
570
|
}
|
|
571
571
|
}
|
|
572
572
|
async function k() {
|
|
573
|
-
if (!
|
|
574
|
-
v.value = !1,
|
|
573
|
+
if (!t.value && !y.value) {
|
|
574
|
+
v.value = !1, t.value = !0, h.value = null;
|
|
575
575
|
try {
|
|
576
576
|
const u = r.value.length;
|
|
577
577
|
if (v.value) return;
|
|
578
|
-
const
|
|
579
|
-
if (
|
|
580
|
-
y.value = !0,
|
|
578
|
+
const E = i.value[i.value.length - 1];
|
|
579
|
+
if (E == null) {
|
|
580
|
+
y.value = !0, t.value = !1;
|
|
581
581
|
return;
|
|
582
582
|
}
|
|
583
|
-
const $ = await f(
|
|
584
|
-
return v.value ? void 0 : (h.value = null, m.value =
|
|
583
|
+
const $ = await f(E);
|
|
584
|
+
return v.value ? void 0 : (h.value = null, m.value = E, i.value.push($.nextPage), $.nextPage == null && (y.value = !0), await H(u), $);
|
|
585
585
|
} catch (u) {
|
|
586
586
|
throw h.value = he(u), u;
|
|
587
587
|
} finally {
|
|
588
|
-
|
|
588
|
+
t.value = !1;
|
|
589
589
|
}
|
|
590
590
|
}
|
|
591
591
|
}
|
|
592
592
|
async function W() {
|
|
593
|
-
if (!
|
|
594
|
-
v.value = !1,
|
|
593
|
+
if (!t.value) {
|
|
594
|
+
v.value = !1, t.value = !0;
|
|
595
595
|
try {
|
|
596
596
|
const u = m.value;
|
|
597
597
|
if (u == null) {
|
|
@@ -599,36 +599,36 @@ function Zt(e) {
|
|
|
599
599
|
return;
|
|
600
600
|
}
|
|
601
601
|
r.value = [], y.value = !1, h.value = null, i.value = [u];
|
|
602
|
-
const
|
|
602
|
+
const E = await f(u);
|
|
603
603
|
if (v.value) return;
|
|
604
|
-
h.value = null, m.value = u, i.value.push(
|
|
604
|
+
h.value = null, m.value = u, i.value.push(E.nextPage), E.nextPage == null && (y.value = !0);
|
|
605
605
|
const $ = r.value.length;
|
|
606
|
-
return await
|
|
606
|
+
return await H($), E;
|
|
607
607
|
} catch (u) {
|
|
608
608
|
throw h.value = he(u), u;
|
|
609
609
|
} finally {
|
|
610
|
-
|
|
610
|
+
t.value = !1;
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
613
|
}
|
|
614
614
|
function o() {
|
|
615
615
|
const u = T;
|
|
616
|
-
v.value = !0,
|
|
616
|
+
v.value = !0, t.value = !1, T = !1, u && d("backfill:stop", { fetched: r.value.length, calls: 0, cancelled: !0 });
|
|
617
617
|
}
|
|
618
618
|
return {
|
|
619
619
|
loadPage: L,
|
|
620
620
|
loadNext: k,
|
|
621
621
|
refreshCurrentPage: W,
|
|
622
622
|
cancelLoad: o,
|
|
623
|
-
maybeBackfillToTarget:
|
|
623
|
+
maybeBackfillToTarget: H,
|
|
624
624
|
getContent: f
|
|
625
625
|
};
|
|
626
626
|
}
|
|
627
|
-
function
|
|
627
|
+
function ta(e) {
|
|
628
628
|
const {
|
|
629
629
|
masonry: l,
|
|
630
630
|
useSwipeMode: r,
|
|
631
|
-
refreshLayout:
|
|
631
|
+
refreshLayout: t,
|
|
632
632
|
refreshCurrentPage: y,
|
|
633
633
|
loadNext: h,
|
|
634
634
|
maybeBackfillToTarget: m,
|
|
@@ -636,7 +636,7 @@ function ea(e) {
|
|
|
636
636
|
paginationHistory: w
|
|
637
637
|
} = e;
|
|
638
638
|
async function b(s) {
|
|
639
|
-
const g = l.value.filter((
|
|
639
|
+
const g = l.value.filter((a) => a.id !== s.id);
|
|
640
640
|
if (l.value = g, await q(), g.length === 0 && w.value.length > 0) {
|
|
641
641
|
if (i)
|
|
642
642
|
await y();
|
|
@@ -647,14 +647,14 @@ function ea(e) {
|
|
|
647
647
|
}
|
|
648
648
|
return;
|
|
649
649
|
}
|
|
650
|
-
await new Promise((
|
|
651
|
-
|
|
650
|
+
await new Promise((a) => requestAnimationFrame(() => a())), requestAnimationFrame(() => {
|
|
651
|
+
t(g);
|
|
652
652
|
});
|
|
653
653
|
}
|
|
654
|
-
async function
|
|
654
|
+
async function n(s) {
|
|
655
655
|
if (!s || s.length === 0) return;
|
|
656
|
-
const g = new Set(s.map((d) => d.id)),
|
|
657
|
-
if (l.value =
|
|
656
|
+
const g = new Set(s.map((d) => d.id)), a = l.value.filter((d) => !g.has(d.id));
|
|
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
|
|
@@ -665,16 +665,16 @@ function ea(e) {
|
|
|
665
665
|
return;
|
|
666
666
|
}
|
|
667
667
|
await new Promise((d) => requestAnimationFrame(() => d())), requestAnimationFrame(() => {
|
|
668
|
-
|
|
668
|
+
t(a);
|
|
669
669
|
});
|
|
670
670
|
}
|
|
671
671
|
async function p(s, g) {
|
|
672
672
|
if (!s) return;
|
|
673
|
-
const
|
|
674
|
-
if (
|
|
675
|
-
const v = [...
|
|
676
|
-
v.splice(T, 0, s), l.value = v, await q(), r.value || (await new Promise((
|
|
677
|
-
|
|
673
|
+
const a = l.value;
|
|
674
|
+
if (a.findIndex((P) => P.id === s.id) !== -1) return;
|
|
675
|
+
const v = [...a], T = Math.min(g, v.length);
|
|
676
|
+
v.splice(T, 0, s), l.value = v, await q(), r.value || (await new Promise((P) => requestAnimationFrame(() => P())), requestAnimationFrame(() => {
|
|
677
|
+
t(v);
|
|
678
678
|
}));
|
|
679
679
|
}
|
|
680
680
|
async function x(s, g) {
|
|
@@ -684,21 +684,21 @@ function ea(e) {
|
|
|
684
684
|
console.warn("[Masonry] restoreMany: items and indices arrays must have the same length");
|
|
685
685
|
return;
|
|
686
686
|
}
|
|
687
|
-
const
|
|
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
689
|
d.has((L = s[k]) == null ? void 0 : L.id) || v.push({ item: s[k], index: g[k] });
|
|
690
690
|
if (v.length === 0) return;
|
|
691
691
|
const T = /* @__PURE__ */ new Map();
|
|
692
692
|
for (const { item: k, index: W } of v)
|
|
693
693
|
T.set(W, k);
|
|
694
|
-
const
|
|
695
|
-
let
|
|
696
|
-
for (let k = 0; k <=
|
|
697
|
-
T.has(k) ? f.push(T.get(k)) :
|
|
698
|
-
for (;
|
|
699
|
-
f.push(
|
|
694
|
+
const P = v.length > 0 ? Math.max(...v.map(({ index: k }) => k)) : -1, I = Math.max(a.length - 1, P), f = [];
|
|
695
|
+
let H = 0;
|
|
696
|
+
for (let k = 0; k <= I; k++)
|
|
697
|
+
T.has(k) ? f.push(T.get(k)) : H < a.length && (f.push(a[H]), H++);
|
|
698
|
+
for (; H < a.length; )
|
|
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
704
|
async function M() {
|
|
@@ -706,17 +706,17 @@ function ea(e) {
|
|
|
706
706
|
}
|
|
707
707
|
return {
|
|
708
708
|
remove: b,
|
|
709
|
-
removeMany:
|
|
709
|
+
removeMany: n,
|
|
710
710
|
restore: p,
|
|
711
711
|
restoreMany: x,
|
|
712
712
|
removeAll: M
|
|
713
713
|
};
|
|
714
714
|
}
|
|
715
|
-
function
|
|
715
|
+
function aa(e) {
|
|
716
716
|
const {
|
|
717
717
|
masonry: l,
|
|
718
718
|
useSwipeMode: r,
|
|
719
|
-
container:
|
|
719
|
+
container: t,
|
|
720
720
|
columns: y,
|
|
721
721
|
containerWidth: h,
|
|
722
722
|
masonryContentHeight: m,
|
|
@@ -724,56 +724,56 @@ function ta(e) {
|
|
|
724
724
|
fixedDimensions: w,
|
|
725
725
|
checkItemDimensions: b
|
|
726
726
|
} = e;
|
|
727
|
-
let
|
|
727
|
+
let n = [];
|
|
728
728
|
function p(g) {
|
|
729
|
-
const
|
|
729
|
+
const a = Xt(g);
|
|
730
730
|
let d = 0;
|
|
731
|
-
if (
|
|
732
|
-
const { scrollTop: v, clientHeight: T } =
|
|
731
|
+
if (t.value) {
|
|
732
|
+
const { scrollTop: v, clientHeight: T } = t.value;
|
|
733
733
|
d = v + T + 100;
|
|
734
734
|
}
|
|
735
|
-
m.value = Math.max(
|
|
735
|
+
m.value = Math.max(a, d);
|
|
736
736
|
}
|
|
737
737
|
function x(g) {
|
|
738
|
-
var T,
|
|
738
|
+
var T, P;
|
|
739
739
|
if (r.value) {
|
|
740
740
|
l.value = g;
|
|
741
741
|
return;
|
|
742
742
|
}
|
|
743
|
-
if (!
|
|
744
|
-
if (b(g, "refreshLayout"), g.length > 1e3 &&
|
|
745
|
-
let
|
|
743
|
+
if (!t.value) return;
|
|
744
|
+
if (b(g, "refreshLayout"), g.length > 1e3 && n.length > g.length && n.length - g.length < 100) {
|
|
745
|
+
let I = !0;
|
|
746
746
|
for (let f = 0; f < g.length; f++)
|
|
747
|
-
if (((T = g[f]) == null ? void 0 : T.id) !== ((
|
|
748
|
-
|
|
747
|
+
if (((T = g[f]) == null ? void 0 : T.id) !== ((P = n[f]) == null ? void 0 : P.id)) {
|
|
748
|
+
I = !1;
|
|
749
749
|
break;
|
|
750
750
|
}
|
|
751
|
-
if (
|
|
752
|
-
const f = g.map((
|
|
753
|
-
...
|
|
751
|
+
if (I) {
|
|
752
|
+
const f = g.map((H, L) => ({
|
|
753
|
+
...n[L],
|
|
754
754
|
originalIndex: L
|
|
755
755
|
}));
|
|
756
|
-
p(f), l.value = f,
|
|
756
|
+
p(f), l.value = f, n = f;
|
|
757
757
|
return;
|
|
758
758
|
}
|
|
759
759
|
}
|
|
760
|
-
const d = g.map((
|
|
761
|
-
...
|
|
760
|
+
const d = g.map((I, f) => ({
|
|
761
|
+
...I,
|
|
762
762
|
originalIndex: f
|
|
763
|
-
})), v =
|
|
763
|
+
})), v = t.value;
|
|
764
764
|
if (w.value && w.value.width !== void 0) {
|
|
765
|
-
const
|
|
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
|
|
768
|
-
v.style.width =
|
|
767
|
+
const H = Ye(d, v, y.value, i.value);
|
|
768
|
+
v.style.width = I, v.style.boxSizing = f, p(H), l.value = H, n = H;
|
|
769
769
|
} else {
|
|
770
|
-
const
|
|
771
|
-
p(
|
|
770
|
+
const I = Ye(d, v, y.value, i.value);
|
|
771
|
+
p(I), l.value = I, n = I;
|
|
772
772
|
}
|
|
773
773
|
}
|
|
774
|
-
function M(g,
|
|
775
|
-
w.value = g, g && (g.width !== void 0 && (h.value = g.width), !r.value &&
|
|
776
|
-
y.value = ue(i.value, h.value), x(l.value),
|
|
774
|
+
function M(g, a) {
|
|
775
|
+
w.value = g, g && (g.width !== void 0 && (h.value = g.width), !r.value && t.value && l.value.length > 0 && q(() => {
|
|
776
|
+
y.value = ue(i.value, h.value), x(l.value), a && a();
|
|
777
777
|
}));
|
|
778
778
|
}
|
|
779
779
|
function s() {
|
|
@@ -786,28 +786,28 @@ function ta(e) {
|
|
|
786
786
|
calculateHeight: p
|
|
787
787
|
};
|
|
788
788
|
}
|
|
789
|
-
function
|
|
789
|
+
function na(e) {
|
|
790
790
|
const {
|
|
791
791
|
masonry: l,
|
|
792
792
|
container: r,
|
|
793
|
-
columns:
|
|
793
|
+
columns: t,
|
|
794
794
|
virtualBufferPx: y,
|
|
795
795
|
loadThresholdPx: h
|
|
796
|
-
} = e, m =
|
|
796
|
+
} = e, m = D(e.handleScroll), i = D(0), w = D(0), b = y, n = D(!1), p = D({
|
|
797
797
|
distanceToTrigger: 0,
|
|
798
798
|
isNearTrigger: !1
|
|
799
799
|
}), x = Q(() => {
|
|
800
|
-
const
|
|
801
|
-
return !v || v.length === 0 ? [] : v.filter((
|
|
802
|
-
if (typeof
|
|
800
|
+
const a = i.value - b, d = i.value + w.value + b, v = l.value;
|
|
801
|
+
return !v || v.length === 0 ? [] : v.filter((P) => {
|
|
802
|
+
if (typeof P.top != "number" || typeof P.columnHeight != "number")
|
|
803
803
|
return !0;
|
|
804
|
-
const
|
|
805
|
-
return
|
|
804
|
+
const I = P.top;
|
|
805
|
+
return P.top + P.columnHeight >= a && I <= d;
|
|
806
806
|
});
|
|
807
807
|
});
|
|
808
|
-
function M(
|
|
808
|
+
function M(a) {
|
|
809
809
|
if (!r.value) return;
|
|
810
|
-
const { scrollTop: d, clientHeight: v } = r.value, T = d + v,
|
|
810
|
+
const { scrollTop: d, clientHeight: v } = r.value, T = d + v, P = a ?? De(l.value, t.value), I = P.length ? Math.max(...P) : 0, f = typeof h == "number" ? h : 200, H = f >= 0 ? Math.max(0, I - f) : Math.max(0, I + f), L = Math.max(0, H - T), k = L <= 100;
|
|
811
811
|
p.value = {
|
|
812
812
|
distanceToTrigger: Math.round(L),
|
|
813
813
|
isNearTrigger: k
|
|
@@ -818,12 +818,12 @@ function aa(e) {
|
|
|
818
818
|
const d = r.value.scrollTop, v = r.value.clientHeight || window.innerHeight, T = v > 0 ? v : window.innerHeight;
|
|
819
819
|
i.value = d, w.value = T;
|
|
820
820
|
}
|
|
821
|
-
|
|
822
|
-
const
|
|
823
|
-
m.value(
|
|
821
|
+
n.value = !0, await q(), await new Promise((d) => requestAnimationFrame(() => d())), n.value = !1;
|
|
822
|
+
const a = De(l.value, t.value);
|
|
823
|
+
m.value(a), M(a);
|
|
824
824
|
}
|
|
825
825
|
function g() {
|
|
826
|
-
i.value = 0, w.value = 0,
|
|
826
|
+
i.value = 0, w.value = 0, n.value = !1, p.value = {
|
|
827
827
|
distanceToTrigger: 0,
|
|
828
828
|
isNearTrigger: !1
|
|
829
829
|
};
|
|
@@ -831,7 +831,7 @@ function aa(e) {
|
|
|
831
831
|
return {
|
|
832
832
|
viewportTop: i,
|
|
833
833
|
viewportHeight: w,
|
|
834
|
-
virtualizing:
|
|
834
|
+
virtualizing: n,
|
|
835
835
|
scrollProgress: p,
|
|
836
836
|
visibleMasonry: x,
|
|
837
837
|
updateScrollProgress: M,
|
|
@@ -840,29 +840,29 @@ function aa(e) {
|
|
|
840
840
|
handleScroll: m
|
|
841
841
|
};
|
|
842
842
|
}
|
|
843
|
-
function
|
|
844
|
-
const { masonry: l } = e, r =
|
|
845
|
-
function
|
|
843
|
+
function la(e) {
|
|
844
|
+
const { masonry: l } = e, r = D(/* @__PURE__ */ new Set());
|
|
845
|
+
function t(m) {
|
|
846
846
|
return typeof m == "number" && m > 0 && Number.isFinite(m);
|
|
847
847
|
}
|
|
848
848
|
function y(m, i) {
|
|
849
849
|
try {
|
|
850
850
|
if (!Array.isArray(m) || m.length === 0) return;
|
|
851
|
-
const w = m.filter((
|
|
851
|
+
const w = m.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
|
-
for (const
|
|
855
|
-
const p = (
|
|
854
|
+
for (const n of w) {
|
|
855
|
+
const p = (n == null ? void 0 : n.id) ?? `idx:${l.value.indexOf(n)}`;
|
|
856
856
|
r.value.has(p) || (r.value.add(p), b.push(p));
|
|
857
857
|
}
|
|
858
858
|
if (b.length > 0) {
|
|
859
|
-
const
|
|
859
|
+
const n = b.slice(0, 10);
|
|
860
860
|
console.warn(
|
|
861
861
|
"[Masonry] Items missing width/height detected:",
|
|
862
862
|
{
|
|
863
863
|
context: i,
|
|
864
864
|
count: b.length,
|
|
865
|
-
sampleIds:
|
|
865
|
+
sampleIds: n,
|
|
866
866
|
hint: "Ensure each item has positive width and height. Consider providing fallbacks (e.g., 512x512) at the data layer."
|
|
867
867
|
}
|
|
868
868
|
);
|
|
@@ -879,19 +879,19 @@ function na(e) {
|
|
|
879
879
|
reset: h
|
|
880
880
|
};
|
|
881
881
|
}
|
|
882
|
-
const
|
|
882
|
+
const oa = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full rounded-xl overflow-hidden shadow-sm transition-all duration-300 bg-white relative" }, ia = {
|
|
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
|
+
}, sa = {
|
|
886
886
|
key: 1,
|
|
887
887
|
class: "relative w-full h-full"
|
|
888
|
-
},
|
|
888
|
+
}, ua = ["src"], ca = ["src", "autoplay", "controls"], va = { class: "w-12 h-12 rounded-full bg-white/80 backdrop-blur-sm flex items-center justify-center shadow-sm" }, fa = {
|
|
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
|
+
}, da = {
|
|
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
|
+
}, be = /* @__PURE__ */ Ke({
|
|
895
895
|
__name: "MasonryItem",
|
|
896
896
|
props: {
|
|
897
897
|
item: {},
|
|
@@ -905,9 +905,9 @@ const la = { class: "flex-1 relative min-h-0" }, oa = { 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,
|
|
908
|
+
const r = e, t = l, y = D(!1), h = D(!1), m = D(null), i = D(!1), w = D(!1), b = D(null), n = D(!1), p = D(!1), x = D(!1), M = D(null), s = D(null);
|
|
909
909
|
let g = null;
|
|
910
|
-
const
|
|
910
|
+
const a = Q(() => {
|
|
911
911
|
var o;
|
|
912
912
|
return r.type ?? ((o = r.item) == null ? void 0 : o.type) ?? "image";
|
|
913
913
|
}), d = Q(() => {
|
|
@@ -915,12 +915,12 @@ const la = { class: "flex-1 relative min-h-0" }, oa = { class: "w-full h-full ro
|
|
|
915
915
|
return r.notFound ?? ((o = r.item) == null ? void 0 : o.notFound) ?? !1;
|
|
916
916
|
}), v = Q(() => !!r.inSwipeMode);
|
|
917
917
|
function T(o) {
|
|
918
|
-
|
|
918
|
+
t("mouse-enter", { item: r.item, type: o });
|
|
919
919
|
}
|
|
920
|
-
function
|
|
921
|
-
|
|
920
|
+
function P(o) {
|
|
921
|
+
t("mouse-leave", { item: r.item, type: o });
|
|
922
922
|
}
|
|
923
|
-
function
|
|
923
|
+
function I(o) {
|
|
924
924
|
if (v.value) return;
|
|
925
925
|
const u = o.target;
|
|
926
926
|
u && (u.paused ? u.play() : u.pause());
|
|
@@ -929,57 +929,57 @@ const la = { class: "flex-1 relative min-h-0" }, oa = { class: "w-full h-full ro
|
|
|
929
929
|
const u = o.target;
|
|
930
930
|
u && (v.value || u.play(), T("video"));
|
|
931
931
|
}
|
|
932
|
-
function
|
|
932
|
+
function H(o) {
|
|
933
933
|
const u = o.target;
|
|
934
|
-
u && (v.value || u.pause(),
|
|
934
|
+
u && (v.value || u.pause(), P("video"));
|
|
935
935
|
}
|
|
936
936
|
function L(o) {
|
|
937
|
-
return new Promise((u,
|
|
937
|
+
return new Promise((u, E) => {
|
|
938
938
|
if (!o) {
|
|
939
|
-
const
|
|
940
|
-
|
|
939
|
+
const N = new Error("No image source provided");
|
|
940
|
+
t("preload:error", { item: r.item, type: "image", src: o, error: N }), E(N);
|
|
941
941
|
return;
|
|
942
942
|
}
|
|
943
943
|
const $ = new Image(), C = Date.now(), F = 300;
|
|
944
944
|
$.onload = () => {
|
|
945
|
-
const
|
|
945
|
+
const N = Date.now() - C, j = Math.max(0, F - N);
|
|
946
946
|
setTimeout(async () => {
|
|
947
|
-
y.value = !0, h.value = !1, p.value = !1, await q(), await new Promise((X) => setTimeout(X, 100)), x.value = !0,
|
|
947
|
+
y.value = !0, h.value = !1, p.value = !1, await q(), await new Promise((X) => setTimeout(X, 100)), x.value = !0, t("preload:success", { item: r.item, type: "image", src: o }), u();
|
|
948
948
|
}, j);
|
|
949
949
|
}, $.onerror = () => {
|
|
950
950
|
h.value = !0, y.value = !1, p.value = !1;
|
|
951
|
-
const
|
|
952
|
-
|
|
951
|
+
const N = new Error("Failed to load image");
|
|
952
|
+
t("preload:error", { item: r.item, type: "image", src: o, error: N }), E(N);
|
|
953
953
|
}, $.src = o;
|
|
954
954
|
});
|
|
955
955
|
}
|
|
956
956
|
function k(o) {
|
|
957
|
-
return new Promise((u,
|
|
957
|
+
return new Promise((u, E) => {
|
|
958
958
|
if (!o) {
|
|
959
|
-
const
|
|
960
|
-
|
|
959
|
+
const N = new Error("No video source provided");
|
|
960
|
+
t("preload:error", { item: r.item, type: "video", src: o, error: N }), E(N);
|
|
961
961
|
return;
|
|
962
962
|
}
|
|
963
963
|
const $ = document.createElement("video"), C = Date.now(), F = 300;
|
|
964
964
|
$.preload = "metadata", $.muted = !0, $.onloadedmetadata = () => {
|
|
965
|
-
const
|
|
965
|
+
const N = Date.now() - C, j = Math.max(0, F - N);
|
|
966
966
|
setTimeout(async () => {
|
|
967
|
-
i.value = !0, w.value = !1, p.value = !1, await q(), await new Promise((X) => setTimeout(X, 100)), x.value = !0,
|
|
967
|
+
i.value = !0, w.value = !1, p.value = !1, await q(), await new Promise((X) => setTimeout(X, 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;
|
|
971
|
-
const
|
|
972
|
-
|
|
971
|
+
const N = new Error("Failed to load video");
|
|
972
|
+
t("preload:error", { item: r.item, type: "video", src: o, error: N }), E(N);
|
|
973
973
|
}, $.src = o;
|
|
974
974
|
});
|
|
975
975
|
}
|
|
976
976
|
async function W() {
|
|
977
977
|
var u;
|
|
978
|
-
if (!
|
|
978
|
+
if (!n.value || p.value || d.value || a.value === "video" && i.value || a.value === "image" && y.value)
|
|
979
979
|
return;
|
|
980
980
|
const o = (u = r.item) == null ? void 0 : u.src;
|
|
981
981
|
if (o)
|
|
982
|
-
if (p.value = !0, x.value = !1,
|
|
982
|
+
if (p.value = !0, x.value = !1, a.value === "video") {
|
|
983
983
|
b.value = o, i.value = !1, w.value = !1;
|
|
984
984
|
try {
|
|
985
985
|
await k(o);
|
|
@@ -993,11 +993,11 @@ const la = { class: "flex-1 relative min-h-0" }, oa = { class: "w-full h-full ro
|
|
|
993
993
|
}
|
|
994
994
|
}
|
|
995
995
|
}
|
|
996
|
-
return
|
|
996
|
+
return Qe(() => {
|
|
997
997
|
M.value && (g = new IntersectionObserver(
|
|
998
998
|
(o) => {
|
|
999
999
|
o.forEach((u) => {
|
|
1000
|
-
u.isIntersecting && u.intersectionRatio >= 1 ?
|
|
1000
|
+
u.isIntersecting && u.intersectionRatio >= 1 ? n.value || (n.value = !0, W()) : u.isIntersecting;
|
|
1001
1001
|
});
|
|
1002
1002
|
},
|
|
1003
1003
|
{
|
|
@@ -1005,24 +1005,24 @@ const la = { class: "flex-1 relative min-h-0" }, oa = { class: "w-full h-full ro
|
|
|
1005
1005
|
threshold: [1]
|
|
1006
1006
|
}
|
|
1007
1007
|
), g.observe(M.value));
|
|
1008
|
-
}),
|
|
1008
|
+
}), Ze(() => {
|
|
1009
1009
|
g && (g.disconnect(), g = null);
|
|
1010
|
-
}),
|
|
1010
|
+
}), ee(
|
|
1011
1011
|
() => {
|
|
1012
1012
|
var o;
|
|
1013
1013
|
return (o = r.item) == null ? void 0 : o.src;
|
|
1014
1014
|
},
|
|
1015
1015
|
async (o) => {
|
|
1016
1016
|
if (!(!o || d.value)) {
|
|
1017
|
-
if (
|
|
1018
|
-
if (o !== b.value && (i.value = !1, w.value = !1, b.value = o,
|
|
1017
|
+
if (a.value === "video") {
|
|
1018
|
+
if (o !== b.value && (i.value = !1, w.value = !1, b.value = o, n.value)) {
|
|
1019
1019
|
p.value = !0;
|
|
1020
1020
|
try {
|
|
1021
1021
|
await k(o);
|
|
1022
1022
|
} catch {
|
|
1023
1023
|
}
|
|
1024
1024
|
}
|
|
1025
|
-
} else if (o !== m.value && (y.value = !1, h.value = !1, m.value = o,
|
|
1025
|
+
} else if (o !== m.value && (y.value = !1, h.value = !1, m.value = o, n.value)) {
|
|
1026
1026
|
p.value = !0;
|
|
1027
1027
|
try {
|
|
1028
1028
|
await L(o);
|
|
@@ -1031,7 +1031,7 @@ const la = { class: "flex-1 relative min-h-0" }, oa = { class: "w-full h-full ro
|
|
|
1031
1031
|
}
|
|
1032
1032
|
}
|
|
1033
1033
|
}
|
|
1034
|
-
),
|
|
1034
|
+
), ee(
|
|
1035
1035
|
() => r.isActive,
|
|
1036
1036
|
(o) => {
|
|
1037
1037
|
!v.value || !s.value || (o ? s.value.play() : s.value.pause());
|
|
@@ -1055,10 +1055,10 @@ const la = { class: "flex-1 relative min-h-0" }, oa = { class: "w-full h-full ro
|
|
|
1055
1055
|
videoError: w.value,
|
|
1056
1056
|
showNotFound: d.value,
|
|
1057
1057
|
isLoading: p.value,
|
|
1058
|
-
mediaType:
|
|
1058
|
+
mediaType: a.value
|
|
1059
1059
|
})
|
|
1060
|
-
], 4)) :
|
|
1061
|
-
V("div",
|
|
1060
|
+
], 4)) : te("", !0),
|
|
1061
|
+
V("div", oa, [
|
|
1062
1062
|
_(o.$slots, "default", {
|
|
1063
1063
|
item: o.item,
|
|
1064
1064
|
remove: o.remove,
|
|
@@ -1068,18 +1068,18 @@ const la = { class: "flex-1 relative min-h-0" }, oa = { class: "w-full h-full ro
|
|
|
1068
1068
|
videoError: w.value,
|
|
1069
1069
|
showNotFound: d.value,
|
|
1070
1070
|
isLoading: p.value,
|
|
1071
|
-
mediaType:
|
|
1071
|
+
mediaType: a.value,
|
|
1072
1072
|
imageSrc: m.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", ra, [
|
|
1077
|
+
d.value ? (O(), R("div", ia, 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
|
-
|
|
1081
|
+
]))) : (O(), R("div", sa, [
|
|
1082
|
+
a.value === "image" && m.value ? (O(), R("img", {
|
|
1083
1083
|
key: 0,
|
|
1084
1084
|
src: m.value,
|
|
1085
1085
|
class: re([
|
|
@@ -1090,10 +1090,10 @@ const la = { class: "flex-1 relative min-h-0" }, oa = { class: "w-full h-full ro
|
|
|
1090
1090
|
loading: "lazy",
|
|
1091
1091
|
decoding: "async",
|
|
1092
1092
|
alt: "",
|
|
1093
|
-
onMouseenter: u[0] || (u[0] = (
|
|
1094
|
-
onMouseleave: u[1] || (u[1] = (
|
|
1095
|
-
}, null, 42,
|
|
1096
|
-
|
|
1093
|
+
onMouseenter: u[0] || (u[0] = (E) => T("image")),
|
|
1094
|
+
onMouseleave: u[1] || (u[1] = (E) => P("image"))
|
|
1095
|
+
}, null, 42, ua)) : te("", !0),
|
|
1096
|
+
a.value === "video" && b.value ? (O(), R("video", {
|
|
1097
1097
|
key: 1,
|
|
1098
1098
|
ref_key: "videoEl",
|
|
1099
1099
|
ref: s,
|
|
@@ -1108,12 +1108,12 @@ const la = { class: "flex-1 relative min-h-0" }, oa = { 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: je(I, ["stop"]),
|
|
1112
|
+
onTouchend: je(I, ["stop", "prevent"]),
|
|
1113
1113
|
onMouseenter: f,
|
|
1114
|
-
onMouseleave:
|
|
1115
|
-
onError: u[2] || (u[2] = (
|
|
1116
|
-
}, null, 42,
|
|
1114
|
+
onMouseleave: H,
|
|
1115
|
+
onError: u[2] || (u[2] = (E) => w.value = !0)
|
|
1116
|
+
}, null, 42, ca)) : te("", !0),
|
|
1117
1117
|
!y.value && !i.value && !h.value && !w.value ? (O(), R("div", {
|
|
1118
1118
|
key: 2,
|
|
1119
1119
|
class: re([
|
|
@@ -1121,25 +1121,25 @@ const la = { class: "flex-1 relative min-h-0" }, oa = { class: "w-full h-full ro
|
|
|
1121
1121
|
x.value ? "opacity-0 pointer-events-none" : "opacity-100"
|
|
1122
1122
|
])
|
|
1123
1123
|
}, [
|
|
1124
|
-
V("div",
|
|
1125
|
-
_(o.$slots, "placeholder-icon", { mediaType:
|
|
1124
|
+
V("div", va, [
|
|
1125
|
+
_(o.$slots, "placeholder-icon", { mediaType: a.value }, () => [
|
|
1126
1126
|
V("i", {
|
|
1127
|
-
class: re(
|
|
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)) : te("", !0),
|
|
1132
|
+
p.value ? (O(), R("div", fa, 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
|
-
|
|
1136
|
+
]))) : te("", !0),
|
|
1137
|
+
a.value === "image" && h.value || a.value === "video" && w.value ? (O(), R("div", da, [
|
|
1138
1138
|
V("i", {
|
|
1139
|
-
class: re(
|
|
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 " + $e(a.value), 1)
|
|
1142
|
+
])) : te("", !0)
|
|
1143
1143
|
]))
|
|
1144
1144
|
])
|
|
1145
1145
|
])
|
|
@@ -1158,24 +1158,24 @@ const la = { class: "flex-1 relative min-h-0" }, oa = { class: "w-full h-full ro
|
|
|
1158
1158
|
videoError: w.value,
|
|
1159
1159
|
showNotFound: d.value,
|
|
1160
1160
|
isLoading: p.value,
|
|
1161
|
-
mediaType:
|
|
1161
|
+
mediaType: a.value
|
|
1162
1162
|
})
|
|
1163
|
-
], 4)) :
|
|
1163
|
+
], 4)) : te("", !0)
|
|
1164
1164
|
], 512));
|
|
1165
1165
|
}
|
|
1166
|
-
}),
|
|
1166
|
+
}), ma = { class: "w-full h-full flex items-center justify-center p-4" }, ha = { class: "w-full h-full max-w-full max-h-full relative" }, ga = {
|
|
1167
1167
|
key: 0,
|
|
1168
1168
|
class: "w-full py-8 text-center"
|
|
1169
|
-
},
|
|
1169
|
+
}, pa = {
|
|
1170
1170
|
key: 1,
|
|
1171
1171
|
class: "w-full py-8 text-center"
|
|
1172
|
-
},
|
|
1172
|
+
}, ya = { class: "text-red-500 dark:text-red-400" }, wa = {
|
|
1173
1173
|
key: 0,
|
|
1174
1174
|
class: "w-full py-8 text-center"
|
|
1175
|
-
},
|
|
1175
|
+
}, xa = {
|
|
1176
1176
|
key: 1,
|
|
1177
1177
|
class: "w-full py-8 text-center"
|
|
1178
|
-
},
|
|
1178
|
+
}, ba = { class: "text-red-500 dark:text-red-400" }, Ma = /* @__PURE__ */ Ke({
|
|
1179
1179
|
__name: "Masonry",
|
|
1180
1180
|
props: {
|
|
1181
1181
|
getNextPage: {
|
|
@@ -1204,6 +1204,15 @@ const la = { class: "flex-1 relative min-h-0" }, oa = { class: "w-full h-full ro
|
|
|
1204
1204
|
type: Boolean,
|
|
1205
1205
|
default: !1
|
|
1206
1206
|
},
|
|
1207
|
+
// Initial pagination state when skipInitialLoad is true and items are provided
|
|
1208
|
+
initialPage: {
|
|
1209
|
+
type: [Number, String],
|
|
1210
|
+
default: null
|
|
1211
|
+
},
|
|
1212
|
+
initialNextPage: {
|
|
1213
|
+
type: [Number, String],
|
|
1214
|
+
default: null
|
|
1215
|
+
},
|
|
1207
1216
|
pageSize: {
|
|
1208
1217
|
type: Number,
|
|
1209
1218
|
default: 40
|
|
@@ -1294,7 +1303,7 @@ const la = { class: "flex-1 relative min-h-0" }, oa = { class: "w-full h-full ro
|
|
|
1294
1303
|
"item:mouse-leave"
|
|
1295
1304
|
],
|
|
1296
1305
|
setup(e, { expose: l, emit: r }) {
|
|
1297
|
-
const
|
|
1306
|
+
const t = e, y = {
|
|
1298
1307
|
sizes: { base: 1, sm: 2, md: 3, lg: 4, xl: 5, "2xl": 6 },
|
|
1299
1308
|
gutterX: 10,
|
|
1300
1309
|
gutterY: 10,
|
|
@@ -1307,14 +1316,14 @@ const la = { class: "flex-1 relative min-h-0" }, oa = { class: "w-full h-full ro
|
|
|
1307
1316
|
var c;
|
|
1308
1317
|
return {
|
|
1309
1318
|
...y,
|
|
1310
|
-
...
|
|
1319
|
+
...t.layout,
|
|
1311
1320
|
sizes: {
|
|
1312
1321
|
...y.sizes,
|
|
1313
|
-
...((c =
|
|
1322
|
+
...((c = t.layout) == null ? void 0 : c.sizes) || {}
|
|
1314
1323
|
}
|
|
1315
1324
|
};
|
|
1316
|
-
}), m =
|
|
1317
|
-
let
|
|
1325
|
+
}), m = D(null), i = D(typeof window < "u" ? window.innerWidth : 1024), w = D(typeof window < "u" ? window.innerHeight : 768), b = D(null);
|
|
1326
|
+
let n = null;
|
|
1318
1327
|
function p(c) {
|
|
1319
1328
|
return {
|
|
1320
1329
|
sm: 640,
|
|
@@ -1325,89 +1334,89 @@ const la = { class: "flex-1 relative min-h-0" }, oa = { class: "w-full h-full ro
|
|
|
1325
1334
|
}[c] || 768;
|
|
1326
1335
|
}
|
|
1327
1336
|
const x = Q(() => {
|
|
1328
|
-
if (
|
|
1329
|
-
if (
|
|
1330
|
-
const c = typeof
|
|
1337
|
+
if (t.layoutMode === "masonry") return !1;
|
|
1338
|
+
if (t.layoutMode === "swipe") return !0;
|
|
1339
|
+
const c = typeof t.mobileBreakpoint == "string" ? p(t.mobileBreakpoint) : t.mobileBreakpoint;
|
|
1331
1340
|
return i.value < c;
|
|
1332
1341
|
}), M = r, s = Q({
|
|
1333
|
-
get: () =>
|
|
1342
|
+
get: () => t.items,
|
|
1334
1343
|
set: (c) => M("update:items", c)
|
|
1335
|
-
}), g =
|
|
1344
|
+
}), g = D(7), a = D(null), d = D([]), v = D(null), T = D(!1), P = D(0), I = D(!1), f = D(null), H = Q(() => _t(i.value)), L = la({
|
|
1336
1345
|
masonry: s
|
|
1337
|
-
}), { checkItemDimensions: k, reset: W } = L, o =
|
|
1346
|
+
}), { checkItemDimensions: k, reset: W } = L, o = aa({
|
|
1338
1347
|
masonry: s,
|
|
1339
1348
|
useSwipeMode: x,
|
|
1340
|
-
container:
|
|
1349
|
+
container: a,
|
|
1341
1350
|
columns: g,
|
|
1342
1351
|
containerWidth: i,
|
|
1343
|
-
masonryContentHeight:
|
|
1352
|
+
masonryContentHeight: P,
|
|
1344
1353
|
layout: h,
|
|
1345
1354
|
fixedDimensions: b,
|
|
1346
1355
|
checkItemDimensions: k
|
|
1347
|
-
}), { refreshLayout: u, setFixedDimensions:
|
|
1356
|
+
}), { refreshLayout: u, setFixedDimensions: E, onResize: $ } = o, C = na({
|
|
1348
1357
|
masonry: s,
|
|
1349
|
-
container:
|
|
1358
|
+
container: a,
|
|
1350
1359
|
columns: g,
|
|
1351
|
-
virtualBufferPx:
|
|
1352
|
-
loadThresholdPx:
|
|
1360
|
+
virtualBufferPx: t.virtualBufferPx,
|
|
1361
|
+
loadThresholdPx: t.loadThresholdPx,
|
|
1353
1362
|
handleScroll: () => {
|
|
1354
1363
|
}
|
|
1355
1364
|
// Will be set after pagination is initialized
|
|
1356
|
-
}), { viewportTop: F, viewportHeight:
|
|
1357
|
-
{ container:
|
|
1358
|
-
{ leaveDurationMs:
|
|
1359
|
-
),
|
|
1360
|
-
getNextPage:
|
|
1365
|
+
}), { viewportTop: F, viewportHeight: N, virtualizing: j, visibleMasonry: X, updateScrollProgress: z, updateViewport: Y, reset: G } = C, { onEnter: ne, onBeforeEnter: J, onBeforeLeave: ie, onLeave: Z } = Kt(
|
|
1366
|
+
{ container: a },
|
|
1367
|
+
{ leaveDurationMs: t.leaveDurationMs, virtualizing: j }
|
|
1368
|
+
), at = ne, nt = J, lt = ie, ot = Z, rt = ea({
|
|
1369
|
+
getNextPage: t.getNextPage,
|
|
1361
1370
|
masonry: s,
|
|
1362
1371
|
isLoading: T,
|
|
1363
|
-
hasReachedEnd:
|
|
1372
|
+
hasReachedEnd: I,
|
|
1364
1373
|
loadError: f,
|
|
1365
1374
|
currentPage: v,
|
|
1366
1375
|
paginationHistory: d,
|
|
1367
1376
|
refreshLayout: u,
|
|
1368
|
-
retryMaxAttempts:
|
|
1369
|
-
retryInitialDelayMs:
|
|
1370
|
-
retryBackoffStepMs:
|
|
1371
|
-
backfillEnabled:
|
|
1372
|
-
backfillDelayMs:
|
|
1373
|
-
backfillMaxCalls:
|
|
1374
|
-
pageSize:
|
|
1375
|
-
autoRefreshOnEmpty:
|
|
1377
|
+
retryMaxAttempts: t.retryMaxAttempts,
|
|
1378
|
+
retryInitialDelayMs: t.retryInitialDelayMs,
|
|
1379
|
+
retryBackoffStepMs: t.retryBackoffStepMs,
|
|
1380
|
+
backfillEnabled: t.backfillEnabled,
|
|
1381
|
+
backfillDelayMs: t.backfillDelayMs,
|
|
1382
|
+
backfillMaxCalls: t.backfillMaxCalls,
|
|
1383
|
+
pageSize: t.pageSize,
|
|
1384
|
+
autoRefreshOnEmpty: t.autoRefreshOnEmpty,
|
|
1376
1385
|
emits: M
|
|
1377
|
-
}), { loadPage:
|
|
1386
|
+
}), { loadPage: Me, loadNext: pe, refreshCurrentPage: ze, cancelLoad: Te, maybeBackfillToTarget: it } = rt, K = Zt({
|
|
1378
1387
|
useSwipeMode: x,
|
|
1379
1388
|
masonry: s,
|
|
1380
1389
|
isLoading: T,
|
|
1381
1390
|
loadNext: pe,
|
|
1382
|
-
loadPage:
|
|
1391
|
+
loadPage: Me,
|
|
1383
1392
|
paginationHistory: d
|
|
1384
|
-
}), { handleScroll:
|
|
1385
|
-
container:
|
|
1393
|
+
}), { handleScroll: st } = Qt({
|
|
1394
|
+
container: a,
|
|
1386
1395
|
masonry: s,
|
|
1387
1396
|
columns: g,
|
|
1388
|
-
containerHeight:
|
|
1397
|
+
containerHeight: P,
|
|
1389
1398
|
isLoading: T,
|
|
1390
|
-
pageSize:
|
|
1399
|
+
pageSize: t.pageSize,
|
|
1391
1400
|
refreshLayout: u,
|
|
1392
1401
|
setItemsRaw: (c) => {
|
|
1393
1402
|
s.value = c;
|
|
1394
1403
|
},
|
|
1395
1404
|
loadNext: pe,
|
|
1396
|
-
loadThresholdPx:
|
|
1405
|
+
loadThresholdPx: t.loadThresholdPx
|
|
1397
1406
|
});
|
|
1398
|
-
C.handleScroll.value =
|
|
1399
|
-
const
|
|
1407
|
+
C.handleScroll.value = st;
|
|
1408
|
+
const ut = ta({
|
|
1400
1409
|
masonry: s,
|
|
1401
1410
|
useSwipeMode: x,
|
|
1402
1411
|
refreshLayout: u,
|
|
1403
|
-
refreshCurrentPage:
|
|
1412
|
+
refreshCurrentPage: ze,
|
|
1404
1413
|
loadNext: pe,
|
|
1405
|
-
maybeBackfillToTarget:
|
|
1406
|
-
autoRefreshOnEmpty:
|
|
1414
|
+
maybeBackfillToTarget: it,
|
|
1415
|
+
autoRefreshOnEmpty: t.autoRefreshOnEmpty,
|
|
1407
1416
|
paginationHistory: d
|
|
1408
|
-
}), { remove: ce, removeMany:
|
|
1409
|
-
function
|
|
1410
|
-
|
|
1417
|
+
}), { remove: ce, removeMany: ct, restore: vt, restoreMany: ft, removeAll: dt } = ut;
|
|
1418
|
+
function mt(c) {
|
|
1419
|
+
E(c, z), !c && m.value && (i.value = m.value.clientWidth, w.value = m.value.clientHeight);
|
|
1411
1420
|
}
|
|
1412
1421
|
l({
|
|
1413
1422
|
isLoading: T,
|
|
@@ -1416,140 +1425,151 @@ const la = { class: "flex-1 relative min-h-0" }, oa = { class: "w-full h-full ro
|
|
|
1416
1425
|
containerWidth: i,
|
|
1417
1426
|
containerHeight: w,
|
|
1418
1427
|
// Masonry content height (for backward compatibility, old containerHeight)
|
|
1419
|
-
contentHeight:
|
|
1428
|
+
contentHeight: P,
|
|
1420
1429
|
// Current page
|
|
1421
1430
|
currentPage: v,
|
|
1422
1431
|
// End of list tracking
|
|
1423
|
-
hasReachedEnd:
|
|
1432
|
+
hasReachedEnd: I,
|
|
1424
1433
|
// Load error tracking
|
|
1425
1434
|
loadError: f,
|
|
1426
1435
|
// Set fixed dimensions (overrides ResizeObserver)
|
|
1427
|
-
setFixedDimensions:
|
|
1436
|
+
setFixedDimensions: mt,
|
|
1428
1437
|
remove: ce,
|
|
1429
|
-
removeMany:
|
|
1430
|
-
removeAll:
|
|
1431
|
-
restore:
|
|
1432
|
-
restoreMany:
|
|
1438
|
+
removeMany: ct,
|
|
1439
|
+
removeAll: dt,
|
|
1440
|
+
restore: vt,
|
|
1441
|
+
restoreMany: ft,
|
|
1433
1442
|
loadNext: pe,
|
|
1434
|
-
loadPage:
|
|
1435
|
-
refreshCurrentPage:
|
|
1436
|
-
reset:
|
|
1437
|
-
destroy:
|
|
1438
|
-
init:
|
|
1439
|
-
restoreItems:
|
|
1443
|
+
loadPage: Me,
|
|
1444
|
+
refreshCurrentPage: ze,
|
|
1445
|
+
reset: yt,
|
|
1446
|
+
destroy: wt,
|
|
1447
|
+
init: Ce,
|
|
1448
|
+
restoreItems: Le,
|
|
1440
1449
|
paginationHistory: d,
|
|
1441
|
-
cancelLoad:
|
|
1442
|
-
scrollToTop:
|
|
1443
|
-
scrollTo:
|
|
1450
|
+
cancelLoad: Te,
|
|
1451
|
+
scrollToTop: ht,
|
|
1452
|
+
scrollTo: gt,
|
|
1444
1453
|
totalItems: Q(() => s.value.length),
|
|
1445
|
-
currentBreakpoint:
|
|
1454
|
+
currentBreakpoint: H
|
|
1446
1455
|
});
|
|
1447
|
-
const se = K.currentSwipeIndex, ve = K.swipeOffset, ye = K.isDragging, le = K.swipeContainer,
|
|
1448
|
-
function
|
|
1449
|
-
|
|
1456
|
+
const se = K.currentSwipeIndex, ve = K.swipeOffset, ye = K.isDragging, le = K.swipeContainer, Be = K.handleTouchStart, Fe = K.handleTouchMove, Ae = K.handleTouchEnd, We = K.handleMouseDown, Ie = K.handleMouseMove, Ee = K.handleMouseUp, ke = K.snapToCurrentItem;
|
|
1457
|
+
function ht(c) {
|
|
1458
|
+
a.value && a.value.scrollTo({
|
|
1450
1459
|
top: 0,
|
|
1451
1460
|
behavior: (c == null ? void 0 : c.behavior) ?? "smooth",
|
|
1452
1461
|
...c
|
|
1453
1462
|
});
|
|
1454
1463
|
}
|
|
1455
|
-
function
|
|
1456
|
-
|
|
1457
|
-
top: c.top ??
|
|
1458
|
-
left: c.left ??
|
|
1464
|
+
function gt(c) {
|
|
1465
|
+
a.value && (a.value.scrollTo({
|
|
1466
|
+
top: c.top ?? a.value.scrollTop,
|
|
1467
|
+
left: c.left ?? a.value.scrollLeft,
|
|
1459
1468
|
behavior: c.behavior ?? "auto"
|
|
1460
|
-
}),
|
|
1461
|
-
}
|
|
1462
|
-
function gt() {
|
|
1463
|
-
$(), t.value && (F.value = t.value.scrollTop, D.value = t.value.clientHeight);
|
|
1469
|
+
}), a.value && (F.value = a.value.scrollTop, N.value = a.value.clientHeight || window.innerHeight));
|
|
1464
1470
|
}
|
|
1465
1471
|
function pt() {
|
|
1466
|
-
|
|
1472
|
+
$(), a.value && (F.value = a.value.scrollTop, N.value = a.value.clientHeight);
|
|
1473
|
+
}
|
|
1474
|
+
function yt() {
|
|
1475
|
+
Te(), a.value && a.value.scrollTo({
|
|
1467
1476
|
top: 0,
|
|
1468
1477
|
behavior: "smooth"
|
|
1469
|
-
}), s.value = [], w.value = 0, v.value =
|
|
1478
|
+
}), s.value = [], w.value = 0, v.value = t.loadAtPage, d.value = [t.loadAtPage], I.value = !1, f.value = null, G(), we = !1;
|
|
1470
1479
|
}
|
|
1471
|
-
function
|
|
1472
|
-
|
|
1480
|
+
function wt() {
|
|
1481
|
+
Te(), s.value = [], P.value = 0, v.value = null, d.value = [], I.value = !1, f.value = null, T.value = !1, se.value = 0, ve.value = 0, ye.value = !1, G(), W(), a.value && a.value.scrollTo({
|
|
1473
1482
|
top: 0,
|
|
1474
1483
|
behavior: "auto"
|
|
1475
1484
|
// Instant scroll for destroy
|
|
1476
1485
|
});
|
|
1477
1486
|
}
|
|
1478
|
-
const oe =
|
|
1487
|
+
const oe = Ge(async () => {
|
|
1479
1488
|
x.value || await Y();
|
|
1480
|
-
}, 200),
|
|
1481
|
-
function
|
|
1489
|
+
}, 200), Re = Ge(pt, 200);
|
|
1490
|
+
function Oe() {
|
|
1482
1491
|
K.handleWindowResize();
|
|
1483
1492
|
}
|
|
1484
|
-
function
|
|
1485
|
-
v.value =
|
|
1486
|
-
|
|
1493
|
+
function Ce(c, S, B) {
|
|
1494
|
+
v.value = S, d.value = [S], d.value.push(B), I.value = B == 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 && (F.value = a.value.scrollTop, N.value = a.value.clientHeight || window.innerHeight), q(() => {
|
|
1495
|
+
a.value && (F.value = a.value.scrollTop, N.value = a.value.clientHeight || window.innerHeight, z());
|
|
1487
1496
|
}));
|
|
1488
1497
|
}
|
|
1489
|
-
async function
|
|
1490
|
-
if (!
|
|
1491
|
-
|
|
1498
|
+
async function Le(c, S, B) {
|
|
1499
|
+
if (!t.skipInitialLoad) {
|
|
1500
|
+
Ce(c, S, B);
|
|
1492
1501
|
return;
|
|
1493
1502
|
}
|
|
1494
|
-
v.value =
|
|
1503
|
+
v.value = S, d.value = [S], B != null && d.value.push(B), I.value = B === null, f.value = null, k(c, "restoreItems"), x.value ? (s.value = c, se.value === 0 && s.value.length > 0 && (ve.value = 0)) : (u(c), a.value && (F.value = a.value.scrollTop, N.value = a.value.clientHeight || window.innerHeight), await q(), a.value && (F.value = a.value.scrollTop, N.value = a.value.clientHeight || window.innerHeight, z()));
|
|
1495
1504
|
}
|
|
1496
|
-
|
|
1505
|
+
ee(
|
|
1497
1506
|
h,
|
|
1498
1507
|
() => {
|
|
1499
|
-
x.value ||
|
|
1508
|
+
x.value || a.value && (g.value = ue(h.value, i.value), u(s.value));
|
|
1500
1509
|
},
|
|
1501
1510
|
{ deep: !0 }
|
|
1502
|
-
),
|
|
1511
|
+
), ee(() => t.layoutMode, () => {
|
|
1503
1512
|
b.value && b.value.width !== void 0 ? i.value = b.value.width : m.value && (i.value = m.value.clientWidth);
|
|
1504
|
-
}),
|
|
1513
|
+
}), ee(a, (c) => {
|
|
1505
1514
|
c && !x.value ? (c.removeEventListener("scroll", oe), c.addEventListener("scroll", oe, { passive: !0 })) : c && c.removeEventListener("scroll", oe);
|
|
1506
|
-
}, { immediate: !0 })
|
|
1507
|
-
|
|
1508
|
-
|
|
1515
|
+
}, { immediate: !0 });
|
|
1516
|
+
let we = !1;
|
|
1517
|
+
return ee(
|
|
1518
|
+
() => [t.items, t.skipInitialLoad, t.initialPage, t.initialNextPage],
|
|
1519
|
+
([c, S, B, ae]) => {
|
|
1520
|
+
if (S && c && c.length > 0 && !we) {
|
|
1521
|
+
we = !0;
|
|
1522
|
+
const A = B ?? t.loadAtPage;
|
|
1523
|
+
Le(c, A, ae !== void 0 ? ae : void 0);
|
|
1524
|
+
}
|
|
1525
|
+
},
|
|
1526
|
+
{ immediate: !1 }
|
|
1527
|
+
), ee(x, (c, S) => {
|
|
1528
|
+
S === void 0 && c === !1 || q(() => {
|
|
1529
|
+
c ? (document.addEventListener("mousemove", Ie), document.addEventListener("mouseup", Ee), a.value && a.value.removeEventListener("scroll", oe), se.value = 0, ve.value = 0, s.value.length > 0 && ke()) : (document.removeEventListener("mousemove", Ie), document.removeEventListener("mouseup", Ee), a.value && m.value && (b.value && b.value.width !== void 0 ? i.value = b.value.width : i.value = m.value.clientWidth, a.value.removeEventListener("scroll", oe), a.value.addEventListener("scroll", oe, { passive: !0 }), s.value.length > 0 && (g.value = ue(h.value, i.value), u(s.value), F.value = a.value.scrollTop, N.value = a.value.clientHeight, z())));
|
|
1509
1530
|
});
|
|
1510
|
-
}, { immediate: !0 }),
|
|
1511
|
-
c && (c.addEventListener("touchstart",
|
|
1512
|
-
}),
|
|
1513
|
-
x.value && c > 0 &&
|
|
1514
|
-
}),
|
|
1515
|
-
|
|
1531
|
+
}, { immediate: !0 }), ee(le, (c) => {
|
|
1532
|
+
c && (c.addEventListener("touchstart", Be, { passive: !1 }), c.addEventListener("touchmove", Fe, { passive: !1 }), c.addEventListener("touchend", Ae), c.addEventListener("mousedown", We));
|
|
1533
|
+
}), ee(() => s.value.length, (c, S) => {
|
|
1534
|
+
x.value && c > 0 && S === 0 && (se.value = 0, q(() => ke()));
|
|
1535
|
+
}), ee(m, (c) => {
|
|
1536
|
+
n && (n.disconnect(), n = null), c && typeof ResizeObserver < "u" ? (n = new ResizeObserver((S) => {
|
|
1516
1537
|
if (!b.value)
|
|
1517
|
-
for (const
|
|
1518
|
-
const ae =
|
|
1538
|
+
for (const B of S) {
|
|
1539
|
+
const ae = B.contentRect.width, A = B.contentRect.height;
|
|
1519
1540
|
i.value !== ae && (i.value = ae), w.value !== A && (w.value = A);
|
|
1520
1541
|
}
|
|
1521
|
-
}),
|
|
1522
|
-
}, { immediate: !0 }),
|
|
1523
|
-
c !==
|
|
1524
|
-
g.value = ue(h.value, c), u(s.value),
|
|
1542
|
+
}), 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 }), ee(i, (c, S) => {
|
|
1544
|
+
c !== S && c > 0 && !x.value && a.value && s.value.length > 0 && q(() => {
|
|
1545
|
+
g.value = ue(h.value, c), u(s.value), z();
|
|
1525
1546
|
});
|
|
1526
|
-
}),
|
|
1547
|
+
}), Qe(async () => {
|
|
1527
1548
|
try {
|
|
1528
|
-
await q(), m.value && !
|
|
1529
|
-
const c =
|
|
1530
|
-
if (d.value = [c], !
|
|
1531
|
-
await
|
|
1532
|
-
else if (
|
|
1533
|
-
const
|
|
1534
|
-
await
|
|
1535
|
-
}
|
|
1536
|
-
|
|
1537
|
-
x.value ? q(() => Ie()) : B();
|
|
1549
|
+
await q(), m.value && !n && (i.value = m.value.clientWidth, w.value = m.value.clientHeight), x.value || (g.value = ue(h.value, i.value), a.value && (F.value = a.value.scrollTop, N.value = a.value.clientHeight));
|
|
1550
|
+
const c = t.loadAtPage;
|
|
1551
|
+
if (d.value = [c], !t.skipInitialLoad)
|
|
1552
|
+
await Me(d.value[0]);
|
|
1553
|
+
else if (t.items && t.items.length > 0) {
|
|
1554
|
+
const S = t.initialPage !== null && t.initialPage !== void 0 ? t.initialPage : t.loadAtPage, B = t.initialNextPage !== void 0 ? t.initialNextPage : void 0;
|
|
1555
|
+
await Le(t.items, S, B), we = !0;
|
|
1556
|
+
}
|
|
1557
|
+
x.value ? q(() => ke()) : z();
|
|
1538
1558
|
} catch (c) {
|
|
1539
1559
|
f.value || (console.error("Error during component initialization:", c), f.value = he(c)), T.value = !1;
|
|
1540
1560
|
}
|
|
1541
|
-
window.addEventListener("resize",
|
|
1542
|
-
}),
|
|
1561
|
+
window.addEventListener("resize", Re), window.addEventListener("resize", Oe);
|
|
1562
|
+
}), Ze(() => {
|
|
1543
1563
|
var c;
|
|
1544
|
-
|
|
1545
|
-
}), (c,
|
|
1564
|
+
n && (n.disconnect(), n = null), (c = a.value) == null || c.removeEventListener("scroll", oe), window.removeEventListener("resize", Re), window.removeEventListener("resize", Oe), le.value && (le.value.removeEventListener("touchstart", Be), le.value.removeEventListener("touchmove", Fe), le.value.removeEventListener("touchend", Ae), le.value.removeEventListener("mousedown", We)), document.removeEventListener("mousemove", Ie), document.removeEventListener("mouseup", Ee);
|
|
1565
|
+
}), (c, S) => (O(), R("div", {
|
|
1546
1566
|
ref_key: "wrapper",
|
|
1547
1567
|
ref: m,
|
|
1548
1568
|
class: "w-full h-full flex flex-col relative"
|
|
1549
1569
|
}, [
|
|
1550
1570
|
x.value ? (O(), R("div", {
|
|
1551
1571
|
key: 0,
|
|
1552
|
-
class: re(["overflow-hidden w-full flex-1 swipe-container touch-none select-none", { "force-motion":
|
|
1572
|
+
class: re(["overflow-hidden w-full flex-1 swipe-container touch-none select-none", { "force-motion": t.forceMotion, "cursor-grab": !U(ye), "cursor-grabbing": U(ye) }]),
|
|
1553
1573
|
ref_key: "swipeContainer",
|
|
1554
1574
|
ref: le,
|
|
1555
1575
|
style: { height: "100%", "max-height": "100%", position: "relative" }
|
|
@@ -1562,32 +1582,32 @@ const la = { class: "flex-1 relative min-h-0" }, oa = { class: "w-full h-full ro
|
|
|
1562
1582
|
height: `${s.value.length * 100}%`
|
|
1563
1583
|
})
|
|
1564
1584
|
}, [
|
|
1565
|
-
(O(!0), R(
|
|
1566
|
-
key: `${
|
|
1585
|
+
(O(!0), R(Ve, null, qe(s.value, (B, ae) => (O(), R("div", {
|
|
1586
|
+
key: `${B.page}-${B.id}`,
|
|
1567
1587
|
class: "absolute top-0 left-0 w-full",
|
|
1568
1588
|
style: ge({
|
|
1569
1589
|
top: `${ae * (100 / s.value.length)}%`,
|
|
1570
1590
|
height: `${100 / s.value.length}%`
|
|
1571
1591
|
})
|
|
1572
1592
|
}, [
|
|
1573
|
-
V("div",
|
|
1574
|
-
V("div",
|
|
1593
|
+
V("div", ma, [
|
|
1594
|
+
V("div", ha, [
|
|
1575
1595
|
_(c.$slots, "default", {
|
|
1576
|
-
item:
|
|
1596
|
+
item: B,
|
|
1577
1597
|
remove: U(ce),
|
|
1578
|
-
index:
|
|
1598
|
+
index: B.originalIndex ?? s.value.indexOf(B)
|
|
1579
1599
|
}, () => [
|
|
1580
|
-
|
|
1581
|
-
item:
|
|
1600
|
+
Pe(be, {
|
|
1601
|
+
item: B,
|
|
1582
1602
|
remove: U(ce),
|
|
1583
1603
|
"header-height": h.value.header,
|
|
1584
1604
|
"footer-height": h.value.footer,
|
|
1585
1605
|
"in-swipe-mode": !0,
|
|
1586
1606
|
"is-active": ae === U(se),
|
|
1587
|
-
"onPreload:success":
|
|
1588
|
-
"onPreload:error":
|
|
1589
|
-
onMouseEnter:
|
|
1590
|
-
onMouseLeave:
|
|
1607
|
+
"onPreload:success": S[0] || (S[0] = (A) => M("item:preload:success", A)),
|
|
1608
|
+
"onPreload:error": S[1] || (S[1] = (A) => M("item:preload:error", A)),
|
|
1609
|
+
onMouseEnter: S[2] || (S[2] = (A) => M("item:mouse-enter", A)),
|
|
1610
|
+
onMouseLeave: S[3] || (S[3] = (A) => M("item:mouse-leave", A))
|
|
1591
1611
|
}, {
|
|
1592
1612
|
header: fe((A) => [
|
|
1593
1613
|
_(c.$slots, "item-header", de({ ref_for: !0 }, A), void 0, !0)
|
|
@@ -1602,56 +1622,56 @@ const la = { class: "flex-1 relative min-h-0" }, oa = { class: "w-full h-full ro
|
|
|
1602
1622
|
])
|
|
1603
1623
|
], 4))), 128))
|
|
1604
1624
|
], 4),
|
|
1605
|
-
|
|
1625
|
+
I.value && s.value.length > 0 ? (O(), R("div", ga, [
|
|
1606
1626
|
_(c.$slots, "end-message", {}, () => [
|
|
1607
|
-
|
|
1627
|
+
S[8] || (S[8] = V("p", { class: "text-gray-500 dark:text-gray-400" }, "You've reached the end", -1))
|
|
1608
1628
|
], !0)
|
|
1609
|
-
])) :
|
|
1610
|
-
f.value && s.value.length > 0 ? (O(), R("div",
|
|
1629
|
+
])) : te("", !0),
|
|
1630
|
+
f.value && s.value.length > 0 ? (O(), R("div", pa, [
|
|
1611
1631
|
_(c.$slots, "error-message", { error: f.value }, () => [
|
|
1612
|
-
V("p",
|
|
1632
|
+
V("p", ya, "Failed to load content: " + $e(f.value.message), 1)
|
|
1613
1633
|
], !0)
|
|
1614
|
-
])) :
|
|
1634
|
+
])) : te("", !0)
|
|
1615
1635
|
], 2)) : (O(), R("div", {
|
|
1616
1636
|
key: 1,
|
|
1617
|
-
class: re(["overflow-auto w-full flex-1 masonry-container", { "force-motion":
|
|
1637
|
+
class: re(["overflow-auto w-full flex-1 masonry-container", { "force-motion": t.forceMotion }]),
|
|
1618
1638
|
ref_key: "container",
|
|
1619
|
-
ref:
|
|
1639
|
+
ref: a
|
|
1620
1640
|
}, [
|
|
1621
1641
|
V("div", {
|
|
1622
1642
|
class: "relative",
|
|
1623
|
-
style: ge({ height: `${
|
|
1643
|
+
style: ge({ height: `${P.value}px`, "--masonry-duration": `${e.transitionDurationMs}ms`, "--masonry-leave-duration": `${e.leaveDurationMs}ms`, "--masonry-ease": e.transitionEasing })
|
|
1624
1644
|
}, [
|
|
1625
|
-
|
|
1645
|
+
Pe(xt, {
|
|
1626
1646
|
name: "masonry",
|
|
1627
1647
|
css: !1,
|
|
1628
|
-
onEnter: U(
|
|
1629
|
-
onBeforeEnter: U(
|
|
1630
|
-
onLeave: U(
|
|
1631
|
-
onBeforeLeave: U(
|
|
1648
|
+
onEnter: U(at),
|
|
1649
|
+
onBeforeEnter: U(nt),
|
|
1650
|
+
onLeave: U(ot),
|
|
1651
|
+
onBeforeLeave: U(lt)
|
|
1632
1652
|
}, {
|
|
1633
1653
|
default: fe(() => [
|
|
1634
|
-
(O(!0), R(
|
|
1635
|
-
key: `${
|
|
1654
|
+
(O(!0), R(Ve, null, qe(U(X), (B, ae) => (O(), R("div", de({
|
|
1655
|
+
key: `${B.page}-${B.id}`,
|
|
1636
1656
|
class: "absolute masonry-item",
|
|
1637
1657
|
ref_for: !0
|
|
1638
|
-
}, U(
|
|
1658
|
+
}, U(Jt)(B, ae)), [
|
|
1639
1659
|
_(c.$slots, "default", {
|
|
1640
|
-
item:
|
|
1660
|
+
item: B,
|
|
1641
1661
|
remove: U(ce),
|
|
1642
|
-
index:
|
|
1662
|
+
index: B.originalIndex ?? s.value.indexOf(B)
|
|
1643
1663
|
}, () => [
|
|
1644
|
-
|
|
1645
|
-
item:
|
|
1664
|
+
Pe(be, {
|
|
1665
|
+
item: B,
|
|
1646
1666
|
remove: U(ce),
|
|
1647
1667
|
"header-height": h.value.header,
|
|
1648
1668
|
"footer-height": h.value.footer,
|
|
1649
1669
|
"in-swipe-mode": !1,
|
|
1650
1670
|
"is-active": !1,
|
|
1651
|
-
"onPreload:success":
|
|
1652
|
-
"onPreload:error":
|
|
1653
|
-
onMouseEnter:
|
|
1654
|
-
onMouseLeave:
|
|
1671
|
+
"onPreload:success": S[4] || (S[4] = (A) => M("item:preload:success", A)),
|
|
1672
|
+
"onPreload:error": S[5] || (S[5] = (A) => M("item:preload:error", A)),
|
|
1673
|
+
onMouseEnter: S[6] || (S[6] = (A) => M("item:mouse-enter", A)),
|
|
1674
|
+
onMouseLeave: S[7] || (S[7] = (A) => M("item:mouse-leave", A))
|
|
1655
1675
|
}, {
|
|
1656
1676
|
header: fe((A) => [
|
|
1657
1677
|
_(c.$slots, "item-header", de({ ref_for: !0 }, A), void 0, !0)
|
|
@@ -1667,31 +1687,31 @@ const la = { class: "flex-1 relative min-h-0" }, oa = { class: "w-full h-full ro
|
|
|
1667
1687
|
_: 3
|
|
1668
1688
|
}, 8, ["onEnter", "onBeforeEnter", "onLeave", "onBeforeLeave"])
|
|
1669
1689
|
], 4),
|
|
1670
|
-
|
|
1690
|
+
I.value && s.value.length > 0 ? (O(), R("div", wa, [
|
|
1671
1691
|
_(c.$slots, "end-message", {}, () => [
|
|
1672
|
-
|
|
1692
|
+
S[9] || (S[9] = V("p", { class: "text-gray-500 dark:text-gray-400" }, "You've reached the end", -1))
|
|
1673
1693
|
], !0)
|
|
1674
|
-
])) :
|
|
1675
|
-
f.value && s.value.length > 0 ? (O(), R("div",
|
|
1694
|
+
])) : te("", !0),
|
|
1695
|
+
f.value && s.value.length > 0 ? (O(), R("div", xa, [
|
|
1676
1696
|
_(c.$slots, "error-message", { error: f.value }, () => [
|
|
1677
|
-
V("p",
|
|
1697
|
+
V("p", ba, "Failed to load content: " + $e(f.value.message), 1)
|
|
1678
1698
|
], !0)
|
|
1679
|
-
])) :
|
|
1699
|
+
])) : te("", !0)
|
|
1680
1700
|
], 2))
|
|
1681
1701
|
], 512));
|
|
1682
1702
|
}
|
|
1683
|
-
}),
|
|
1703
|
+
}), Ta = (e, l) => {
|
|
1684
1704
|
const r = e.__vccOpts || e;
|
|
1685
|
-
for (const [
|
|
1686
|
-
r[
|
|
1705
|
+
for (const [t, y] of l)
|
|
1706
|
+
r[t] = y;
|
|
1687
1707
|
return r;
|
|
1688
|
-
},
|
|
1708
|
+
}, Je = /* @__PURE__ */ Ta(Ma, [["__scopeId", "data-v-c6a3147d"]]), ka = {
|
|
1689
1709
|
install(e) {
|
|
1690
|
-
e.component("WyxosMasonry",
|
|
1710
|
+
e.component("WyxosMasonry", Je), e.component("WMasonry", Je), e.component("WyxosMasonryItem", be), e.component("WMasonryItem", be);
|
|
1691
1711
|
}
|
|
1692
1712
|
};
|
|
1693
1713
|
export {
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1714
|
+
Je as Masonry,
|
|
1715
|
+
be as MasonryItem,
|
|
1716
|
+
ka as default
|
|
1697
1717
|
};
|